Method and device for determining folding screen interface layout and electronic equipment
By constructing a diagram of interface elements and using a preset interface layout prediction model, the interface layout is automatically adjusted to adapt to different screen sizes, solving the problem of low interface adaptation efficiency and achieving efficient interface adaptation and improved user experience.
Patent Information
- Application Number
- CN202411921795.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies cannot efficiently determine the interface layout for different screen sizes, resulting in low interface adaptation efficiency and requiring a large amount of manual intervention and resource consumption.
By obtaining the difference between the current screen size and the initial screen size of the target terminal, a relationship diagram of interface elements is constructed, and the interface layout is automatically adjusted to adapt to the new screen ratio using a preset interface layout prediction model and optimization algorithm.
It achieves automated interface adaptation when the screen size changes, reducing manual intervention, lowering development and maintenance costs, and improving interface adaptation efficiency and user experience.
Smart Images

Figure CN121326319A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of financial technology, in particular to a folding screen interface layout determination method and device and electronic equipment. BACKGROUND
[0002] At present, major mobile phone manufacturers are competing to launch folding mobile phones with integrated inner and outer screens. In the folded state, the outer screen still retains the convenient operation of a rectangular screen, while in the unfolded state, the inner screen presents a nearly square wide visual space, providing an immersive experience for users.
[0003] However, the changing form of the screen poses a problem for financial service applications, which need to be adapted to both screen ratios. Not only must smooth use be maintained at the conventional screen ratio, but seamless switching to the expanded mode of the folding screen must also be achieved to fully utilize the additional space it provides. In the face of the difference in the inner and outer screen ratios, the adaptation work requires the reconstruction and layout adjustment of each frame of business interface, placing high demands on human and material resources. With the iterative update of technology, there will be more new devices with different screen ratios, and each iteration of technology will force the application to undergo a new round of adaptation work, involving a large number of front-end development resources. Not only does this increase maintenance costs, but it also consumes development time and effort, becoming a bottleneck that restricts application innovation and user experience improvement.
[0004] Therefore, there is an urgent need for a more streamlined and efficient method that can automatically adapt from the existing screen layout to any new screen ratio without redundant manual intervention.
[0005] To address the above problems, no effective solutions have been proposed so far. SUMMARY
[0006] The embodiments of the present application provide a folding screen interface layout determination method and device and electronic equipment to at least solve the technical problem that the interface layout under different screen sizes cannot be efficiently determined in the related art, resulting in low interface adaptation efficiency.
[0007] According to one aspect of the embodiments of this application, a method for determining the interface layout of a foldable screen is provided, comprising: obtaining the current screen size of a target terminal and determining whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device; if the absolute difference is greater than the preset threshold, obtaining all initial interface elements of the target terminal and constructing an interface element relationship diagram based on the initial interface elements; inputting the current screen size and the interface element relationship diagram into a preset interface layout prediction model and outputting the interface layout under the current screen size; and adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal.
[0008] Furthermore, before obtaining the current screen size of the target terminal, the method includes: using a preset interface to obtain the physical attributes of the target terminal, wherein the physical attributes include at least the initial screen size; or, listening to a broadcast event and reading the initial screen size from the broadcast event.
[0009] Further, the step of constructing an interface element relationship graph based on the initial interface elements includes: performing feature processing on all the initial interface elements to obtain initial interface element features, and representing the initial interface element features as nodes of the interface element relationship graph; determining the association relationship between any two initial interface elements, and representing the association relationship as edges of the interface element relationship graph; and constructing the interface element relationship graph based on the nodes and the edges.
[0010] Furthermore, before inputting the current screen size and the interface element relationship diagram into the preset interface layout prediction model and outputting the interface layout under the current screen size, the method includes: obtaining the historical screen sizes of multiple terminals, and extracting historical interface elements from the terminals to obtain a set of historical interface elements; extracting attributes from each historical interface element in the set of historical interface elements to obtain the attribute values of the historical interface elements; and constructing a preset set of visual effect rules based on all the historical interface elements and the attribute values corresponding to all the historical interface elements.
[0011] Further, the step of constructing a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements includes: determining the association relationship between any two historical interface elements, and constructing a preset element relationship model based on all the association relationships; determining the size range of historical interface components based on the preset element relationship model and the attribute values, wherein the attribute values include at least the size of the historical interface elements, the historical interface component is a combination of multiple historical interface elements, and the historical interface component is determined based on the preset element relationship model; clustering all the historical interface elements and all the attribute values to obtain element clustering results, wherein the clustering results include at least the size of each historical interface element in each cluster; determining the size range of the historical interface elements based on the size of each historical interface element in each cluster; and constructing the preset visual effect rule set based on the size range of the historical interface components and the size range of the historical interface elements.
[0012] Furthermore, after constructing a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements, the method further includes: performing feature processing on each historical interface element in the set of historical interface elements to obtain historical interface element features; constructing a historical interface element relationship graph based on the historical interface element features and the relationships between the historical interface elements, wherein the historical interface element features are nodes of the historical interface element relationship graph, and the relationships between the historical interface elements are edges of the historical interface element relationship graph; and training a preset initial interface layout prediction model based on the historical screen size, the historical interface element relationship graph, and preset layout samples to obtain the preset interface layout prediction model.
[0013] Furthermore, the interface layout includes at least: interface element size and interface component size. The step of adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal includes: adjusting the interface layout to obtain the target interface layout when it is detected that the interface element size is not within the size range of the historical interface elements; or, adjusting the interface layout based on the preset visual effect rule set to obtain the target interface layout when it is detected that the interface component size is not within the size range of the historical interface components.
[0014] Furthermore, after adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal, the method further includes: using a preset off-screen technology to draw the target interface elements in the target interface layout, obtaining the drawing results of the target interface elements, and copying the drawing results to the target terminal; when it is detected that there are target interface elements in the target interface layout whose positions do not belong to the current screen size range, using a preset virtual list technology to render other target interface elements, wherein the preset virtual list technology is used to render target interface elements whose positions belong to the current screen size range, and the other target interface elements refer to target interface elements whose positions belong to the current screen size range.
[0015] According to another aspect of the embodiments of this application, a device for determining the layout of a foldable screen interface is also provided, comprising: a judging unit, configured to obtain the current screen size of a target terminal and judge whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device; a construction unit, configured to obtain all initial interface elements of the target terminal when the absolute difference is greater than the preset threshold, and construct an interface element relationship diagram based on the initial interface elements; an input unit, configured to input the current screen size and the interface element relationship diagram into a preset interface layout prediction model and output the interface layout under the current screen size; and an adjustment unit, configured to adjust the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal.
[0016] Furthermore, the determining device includes: a first acquisition module, configured to acquire the physical attributes of the target terminal using a preset interface before acquiring the current screen size of the target terminal, wherein the physical attributes include at least the initial screen size; and a first listening module, configured to listen to broadcast events and read the initial screen size from the broadcast events.
[0017] Further, the construction unit includes: a first processing module, configured to perform feature processing on all the initial interface elements to obtain initial interface element features, and represent the initial interface element features as nodes of the interface element relationship graph; a first determining module, configured to determine the association relationship between any two initial interface elements, and represent the association relationship as edges of the interface element relationship graph; and a first construction module, configured to construct the interface element relationship graph based on the nodes and the edges.
[0018] Further, the determining device includes: a first extraction module, used to obtain historical screen sizes of multiple terminals and extract historical interface elements from the terminals to obtain a historical interface element set before inputting the current screen size and the interface element relationship diagram into a preset interface layout prediction model and outputting the interface layout under the current screen size; a second extraction module, used to extract attributes from each historical interface element in the historical interface element set to obtain the attribute value of the historical interface element; and a second construction module, used to construct a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements.
[0019] Further, the second construction module includes: a first determining submodule, used to determine the association relationship between any two historical interface elements, and construct a preset element relationship model based on all the association relationships; a second determining submodule, used to determine the size range of historical interface components based on the preset element relationship model and the attribute values, wherein the attribute values include at least the size of the historical interface elements, the historical interface component is a combination of multiple historical interface elements, and the historical interface component is determined based on the preset element relationship model; a first clustering submodule, used to cluster all the historical interface elements and all the attribute values to obtain element clustering results, wherein the clustering results include at least the size of each historical interface element in each cluster; a third determining submodule, used to determine the size range of the historical interface elements based on the size of each historical interface element in each cluster; and a first construction submodule, used to construct the preset visual effect rule set based on the size range of the historical interface components and the size range of the historical interface elements.
[0020] Further, the determining device includes: a second processing module, configured to, after constructing a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements, perform feature processing on each of the historical interface elements in the historical interface element set to obtain historical interface element features; a third construction module, configured to construct a historical interface element relationship graph based on the historical interface element features and the association relationships between the historical interface elements, wherein the historical interface element features are nodes of the historical interface element relationship graph, and the association relationships between the historical interface elements are edges of the historical interface element relationship graph; and a first training module, configured to train a preset initial interface layout prediction model based on the historical screen size, the historical interface element relationship graph, and a preset layout sample to obtain the preset interface layout prediction model.
[0021] Furthermore, the interface layout includes at least: interface element size and interface component size. A preset optimization algorithm is used. The adjustment unit includes: a first adjustment module, used to adjust the interface layout to obtain the target interface layout when the size of the interface element is detected to be outside the size range of the historical interface elements; and a second adjustment module, used to adjust the interface layout based on the preset visual effect rule set to obtain the target interface layout when the size of the interface component is detected to be outside the size range of the historical interface components.
[0022] Further, the determining device includes: a first drawing module, configured to, after adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal, draw the target interface elements in the target interface layout using a preset off-screen technology, obtain the drawing result of the target interface elements, and copy the drawing result to the target terminal; and a first rendering module, configured to, when detecting that there are target interface elements in the target interface layout whose positions do not belong to the current screen size range, render other target interface elements using a preset virtual list technology, wherein the preset virtual list technology is used to render target interface elements whose positions belong to the current screen size range, and the other target interface elements refer to target interface elements whose positions belong to the current screen size range.
[0023] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for determining the layout of a foldable screen interface.
[0024] According to another aspect of the embodiments of this application, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-described methods for determining the layout of a foldable screen interface.
[0025] In this invention, the current screen size of the target terminal is obtained, and it is determined whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold. If the absolute difference is greater than the preset threshold, all initial interface elements of the target terminal are obtained, and an interface element relationship graph is constructed based on the initial interface elements. The current screen size and the interface element relationship graph are input into a preset interface layout prediction model, and the interface layout under the current screen size is output. A preset optimization algorithm is used to adjust the interface layout to obtain the target interface layout of the target terminal. This solves the technical problem in related technologies that it is impossible to efficiently determine the interface layout under different screen sizes, resulting in low interface adaptation efficiency.
[0026] In this invention, the current screen size of the target terminal can be monitored and obtained in real time. It can also determine whether the absolute difference between the current screen size and the initial screen size of the target terminal in the initial folded state exceeds a preset threshold. If the absolute difference is greater than the preset threshold, all initial interface element information of the target terminal in the initial state can be extracted. Based on the initial interface element information, an interface element relationship diagram can be constructed. Then, the current screen size and the interface element relationship diagram can be input into a preset interface layout prediction model to obtain an interface layout scheme adapted to the current screen size. Afterward, a preset optimization algorithm can be used to fine-tune and optimize the interface layout output by the preset interface layout prediction model to generate the target interface layout of the target terminal. This eliminates the need for manual redesign and arrangement of the interface, effectively controls development and maintenance costs, and improves the automation level and speed of interface adaptation, thereby achieving the technical effect of improving interface adaptation efficiency. Attached Figure Description
[0027] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0028] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for determining a method to implement a foldable screen interface layout is shown.
[0029] Figure 2 This is a flowchart of a method for determining the layout of a foldable screen interface according to Embodiment 1 of this application;
[0030] Figure 3 This is a schematic diagram of an optional process for determining the layout of a foldable screen interface according to an embodiment of this application;
[0031] Figure 4 This is a schematic diagram of an optional foldable screen interface layout determination device according to an embodiment of this application;
[0032] Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] It should be noted that all related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, and displayed data) collected and involved in this invention are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data comply with the relevant laws, regulations, and standards of the relevant regions, necessary confidentiality measures have been taken, and it does not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, a request to obtain the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained only after receiving consent from the aforementioned user or organization.
[0036] In this invention, by automatically recognizing the change of the screen from folded to unfolded state and analyzing the initial interface elements, a layout scheme suitable for new screen sizes is automatically generated using a preset interface layout prediction model. This avoids the problem of re-layouting for each screen ratio in interface design, reduces labor costs, and solves the technical problem of low interface adaptation efficiency and high labor costs in mobile financial service applications when facing different screen sizes. The dynamic interface adaptation mechanism of this invention not only simplifies the development process, but also can quickly and accurately present an aesthetically pleasing and practical interface layout regardless of screen changes, significantly improving the user experience.
[0037] The present invention will now be described in detail with reference to various embodiments.
[0038] Example 1
[0039] According to an embodiment of this application, an embodiment of a method for determining the layout of a foldable screen interface is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0040] The methods provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for determining a method to implement a foldable screen interface layout is shown. Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1 The processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions may also be included. In addition, it may include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera, wherein the network interface can be connected to wired and / or wireless networks. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0041] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0042] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for determining the foldable screen interface layout in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned method for determining the foldable screen interface layout. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0043] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0044] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0045] Under the aforementioned operating environment, this application provides the following: Figure 2 The method for determining the layout of a foldable screen interface is shown. Figure 2 This is a flowchart of a method for determining the layout of a foldable screen interface according to Embodiment 1 of this application, as follows: Figure 2 As shown, the method includes the following steps:
[0046] Step S201: Obtain the current screen size of the target terminal and determine whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device.
[0047] Optionally, the target terminal refers to a terminal device with folding functionality (such as a foldable screen phone), which can switch between folded and unfolded forms.
[0048] In this embodiment of the invention, by monitoring device parameters or listening to system events, the screen size information of the target terminal can be obtained in real time, and it can be determined whether the screen size has changed (i.e., whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold (a pre-set threshold, such as 0)). This determines whether the dynamic adaptation process of the interface needs to be started, ensuring that the interface adjustment is only performed when the screen size changes significantly.
[0049] Step S202: If the absolute difference is greater than a preset threshold, obtain all initial interface elements of the target terminal, and construct an interface element relationship diagram based on the initial interface elements.
[0050] Optionally, the interface element relationship diagram can describe the spatial position, hierarchical relationship and interaction between interface elements (such as the relative position, size ratio, alignment and other aspects between interface elements).
[0051] In this embodiment of the invention, when the absolute difference is greater than a preset threshold, all initial interface element information of the target terminal in its initial state (such as a folded state) can be extracted, and an interface element relationship diagram can be constructed using the initial interface element information.
[0052] Step S203: Input the current screen size and interface element relationship diagram into the preset interface layout prediction model, and output the interface layout under the current screen size.
[0053] Optionally, the preset interface layout prediction model is a model trained using deep learning and graph theory techniques, which can predict an interface layout that adapts to the current screen size when given a graph of the relationship between the screen size and the interface elements.
[0054] In this embodiment of the invention, the acquired current screen size information and interface element relationship graph can be input into a preset interface layout prediction model (i.e., a pre-trained graph neural network model). The preset interface layout prediction model uses the learned design rules and layout knowledge to predict an interface layout scheme that matches the current screen size, thereby realizing automated layout adjustment from the initial screen size to the target screen size.
[0055] Step S204: The interface layout is adjusted using a preset optimization algorithm to obtain the target interface layout of the target terminal.
[0056] In this embodiment of the invention, the interface elements in the interface layout may have problems such as inaccurate color blocks or non-compliant size. A preset optimization algorithm (such as genetic algorithm, simulated annealing algorithm, etc.) can be used to adjust the interface layout to obtain the target interface layout of the target terminal, ensuring that the interface layout in different states maintains visual consistency (such as color matching, element alignment, etc.) while taking into account the user experience.
[0057] In summary, the current screen size of the target terminal can be monitored and obtained in real time. Then, it can be determined whether the absolute difference between the current screen size and the initial screen size of the target terminal in the initial folded state exceeds a preset threshold. If the absolute difference is greater than the preset threshold, all initial interface element information of the target terminal in the initial state can be extracted. Based on the initial interface element information, an interface element relationship graph can be constructed. Then, the current screen size and the interface element relationship graph can be input into a preset interface layout prediction model to obtain an interface layout scheme adapted to the current screen size. A preset optimization algorithm can be used to adjust the interface layout and generate the target interface layout. This realizes automatic interface adjustment for foldable screen phones in different screen states, thereby solving the technical problem in related technologies that cannot efficiently determine the interface layout under different screen sizes, resulting in low interface adaptation efficiency.
[0058] In order to accurately obtain the initial screen size of the target terminal, the method for determining the foldable screen interface layout provided in Embodiment 1 of this application uses a preset interface to obtain the physical attributes of the target terminal, wherein the physical attributes include at least: the initial screen size; or, listening to broadcast events and reading the initial screen size from the broadcast events.
[0059] Optionally, real-time monitoring of the phone screen's state can determine whether the phone has switched from a folded state to an unfolded state, or vice versa. Information on screen size changes under different states can be obtained by detecting device parameters or system events.
[0060] In this embodiment of the invention, the financial client application can call the API (Application Programming Interface) interface to obtain the physical attributes of the device (such as screen resolution, screen width, screen height, screen folding state, and screen unfolding state).
[0061] For example, in the Android system, physical properties can be obtained through the relevant APIs of the 'DisplayManager' class. When the target terminal changes from a folded state to an unfolded state, the screen size parameters will change, and the client application can accurately determine the current screen state based on this.
[0062] In some optional embodiments, the client application can also register to listen for broadcast events that change the state of the target terminal. For example, in the Android system, it can listen for broadcast events such as ACTION-SCREEN-ON, ACTION-SCREEN-OFF, and DISPLAY-CHANGED-ACTION. When the foldable phone unfolds, it can send a corresponding event notification to the client. After receiving the event notification, the client can read the new screen size information from the event.
[0063] In order to accurately construct the interface element relationship graph, in the method for determining the foldable screen interface layout provided in Embodiment 1 of this application, all initial interface elements are characterized to obtain initial interface element features, and the initial interface element features are represented as nodes of the interface element relationship graph; the association relationship between any two initial interface elements is determined, and the association relationship is represented as edges of the interface element relationship graph; and the interface element relationship graph is constructed based on the nodes and edges.
[0064] Optionally, all initial interface elements and their attributes (such as type, size, position, hierarchy, etc.) on the current client interface can be extracted by traversing the DOM (Document Object Model Tree) tree. All initial interface elements on the client interface can be characterized. The initial interface elements can be encoded into a set of numerical values or vectors to form initial interface element features, which are then used as nodes in the interface element relationship graph.
[0065] In this embodiment of the invention, the relationships between initial interface elements can be analyzed, including spatial relationships (such as adjacent, overlapping, and containing), hierarchical relationships, and functional relationships. These relationships are used as edges in the interface element relationship graph, connecting the corresponding nodes. Based on the nodes and edges, the interface element relationship graph can be constructed.
[0066] In order to accurately construct a set of preset visual effect rules, in the method for determining the layout of a foldable screen interface provided in Embodiment 1 of this application, the historical screen sizes of multiple terminals are obtained, and the historical interface elements of the terminals are extracted to obtain a set of historical interface elements; the attributes of each historical interface element in the set of historical interface elements are extracted to obtain the attribute values of the historical interface elements; and a set of preset visual effect rules is constructed based on all historical interface elements and the attribute values corresponding to all historical interface elements.
[0067] Optionally, the historical screen size of the user accessing the financial client using different terminals (such as foldable screen phones) can be obtained, and computer vision technology (such as edge detection, color segmentation, texture analysis, etc.) can be used to identify the historical interface elements (such as buttons, titles, icons, text boxes, etc.) of each terminal, so as to obtain a set of historical interface elements. Then, the attributes of each historical interface element in the set of historical interface elements can be extracted to obtain the attribute values of the historical interface elements (such as color value, font size, line height, margin, inner margin, rounded corner radius, shadow effect, transparency, etc.).
[0068] In this embodiment of the invention, based on all historical interface elements and their corresponding attribute values, design principles (such as color theory, grid systems, etc.) can be combined with statistical analysis and machine learning algorithms (such as cluster analysis) to obtain the correlation between elements and the pattern of attribute changes, thereby constructing a set of preset visual effect rules (such as including the best color matching scheme, common size range, standard component styles, etc.).
[0069] To improve the accuracy of constructing a preset visual effect rule set, in the method for determining the layout of a foldable screen interface provided in Embodiment 1 of this application, the relationship between any two historical interface elements is determined, and a preset element relationship model is constructed based on all relationships; the size range of historical interface components is determined based on the preset element relationship model and attribute values, wherein the attribute values include at least the size of the historical interface elements, and the historical interface components are combinations of multiple historical interface elements, and the historical interface components are determined based on the preset element relationship model; all historical interface elements and all attribute values are clustered to obtain element clustering results, wherein the clustering results include at least the size of each historical interface element in each cluster; the size range of historical interface elements is determined based on the size of each historical interface element in each cluster; and a preset visual effect rule set is constructed based on the size range of historical interface components and the size range of historical interface elements.
[0070] Optionally, the association between any two historical interface elements can be determined. The association includes, but is not limited to, the spatial relationship (such as the relative position of the interface elements), logical relationship (such as the functional hierarchy or operation flow of the interface elements), and visual relationship (such as the color and font of the interface elements). Based on all the associations, a preset element relationship model can be constructed.
[0071] In this embodiment of the invention, a preset element relationship model can describe the association between various historical interface elements (such as the association between several historical interface elements, which can form a historical interface component). By using the preset element relationship model and the attribute values of historical interface elements (such as the size of historical interface elements), the size range of historical interface components (composed of multiple historical interface elements, such as navigation bars, account information boxes, etc.) can be determined.
[0072] In this embodiment of the invention, clustering algorithms (such as K-means (K-means clustering algorithm, i.e., an unsupervised machine learning algorithm), hierarchical clustering, etc.) are used to cluster all historical interface elements and all attribute values to obtain element groups with similar characteristics (i.e., element clustering results (such as the size of each historical interface element in each cluster)). Based on the size of each historical interface element in each cluster, the size range of historical interface elements can be determined. Then, based on the size range of historical interface components and the size range of historical interface elements, a preset set of visual effect rules can be constructed.
[0073] To accurately obtain the preset interface layout prediction model, in the method for determining the foldable screen interface layout provided in Embodiment 1 of this application, each historical interface element in the historical interface element set is characterized to obtain historical interface element features; based on the historical interface element features and the relationships between historical interface elements, a historical interface element relationship graph is constructed, wherein the historical interface element features are the nodes of the historical interface element relationship graph, and the relationships between historical interface elements are the edges of the historical interface element relationship graph; based on the historical screen size, the historical interface element relationship graph, and the preset layout sample, the preset initial interface layout prediction model is trained to obtain the preset interface layout prediction model.
[0074] Optionally, each element in the historical interface element set can be characterized (including size, position, color, font, image resolution, etc.) to generate a set of numerical values or vectors as historical interface element features. Based on the historical interface element features (i.e., nodes of the historical interface element relationship graph) and the relationships between historical interface elements (i.e., edges of the historical interface element relationship graph), a historical interface element relationship graph can be constructed.
[0075] In this embodiment of the invention, a preset initial interface layout prediction model (as shown in the figure neural network model) is trained based on historical screen sizes, historical interface element relationship diagrams, and preset layout samples (such as historical layout design cases or layout samples under different screen sizes generated by artificial simulation) to obtain a preset interface layout prediction model.
[0076] Optionally, the interface layout includes at least: interface element size and interface component size. In order to obtain the target interface layout, in the method for determining the foldable screen interface layout provided in Embodiment 1 of this application, if the size of the interface element is detected to be outside the size range of the historical interface elements, the interface layout is adjusted to obtain the target interface layout; or, if the size of the interface component is detected to be outside the size range of the historical interface components, the interface layout is adjusted based on a preset set of visual effect rules to obtain the target interface layout.
[0077] In this embodiment of the invention, the interface layout may include two aspects of information: the size of interface elements and the size of interface components. The size of interface elements refers to the size of each element that constitutes the user interface (such as buttons, text boxes, images, etc.), while the size of interface components refers to the size of a collection of multiple interface elements that have specific functions or design patterns (such as navigation bars, account information boxes, etc.). The size of interface elements and the size of interface components together determine the display effect of the interface on different devices.
[0078] In this embodiment of the invention, when it is detected that the size of an interface element exceeds the size range of historical interface elements, a preset algorithm (such as genetic algorithm, simulated annealing algorithm, etc.) can be used to adjust the size of the element (including changing the font size, font size, spacing, button size, etc.) to obtain the target interface layout. Alternatively, when it is detected that the size of an interface component (such as a navigation bar) exceeds the size range of historical interface components, the size of the interface component can be intelligently adjusted according to a preset set of visual effect rules (including changing the spacing, size, position, etc. of elements within the component) to obtain the target interface layout.
[0079] In this embodiment of the invention, complex interface components can be split into independent, smaller components according to a set of preset visual effect rules, and additional content areas (such as adding a sidebar area) can be added.
[0080] In some alternative embodiments, a smooth animation transition effect can be added during the interface layout switching process to make the layout change more natural and smooth, and enhance the customer experience.
[0081] To definitively render target interface elements, the method for determining the foldable screen interface layout provided in Embodiment 1 of this application employs a preset off-screen technique to draw the target interface elements in the target interface layout, obtain the drawing results of the target interface elements, and copy the drawing results to the target terminal. If it is detected that there are target interface elements in the target interface layout whose positions are not within the current screen size range, a preset virtual list technique is used to render other target interface elements. The preset virtual list technique is used to render target interface elements whose positions are within the current screen size range, and other target interface elements refer to target interface elements whose positions are within the current screen size range.
[0082] Optionally, a preset off-screen technology (i.e., drawing interface elements in the background and generating the drawing results of the target interface elements in the target interface layout in memory, instead of rendering directly on the screen) can be used to draw the target interface elements in the target interface layout. This can obtain the drawing results of the target interface elements and copy them to the screen of the target terminal, achieving a smooth transition and fast display of interface elements on the new screen size, avoiding complex rendering operations on the screen directly when the screen size changes.
[0083] In this embodiment of the invention, when it is detected that there are target interface elements in the target interface layout whose positions are not within the current screen size range, a preset virtual list technology (i.e., only target interface elements within the visible area are rendered) can be used to render other target interface elements (referring to target interface elements whose positions are within the current screen size range), instead of rendering all interface elements at once, thereby reducing unnecessary memory usage.
[0084] In this embodiment of the invention, hardware acceleration (such as triggering GPU (Graphics Processing Unit) rendering through 3D transformations, animations, or 3D graphics interfaces via Cascading Style Sheets) can be used to reduce the CPU (Central Processing Unit) load and improve rendering speed. For frequently used interface elements, a caching strategy can be adopted, for example, storing them locally after the first rendering and loading them directly from the cache the next time they are opened, thus saving computing resources.
[0085] Figure 3This is a schematic diagram of an optional process for determining the layout of a foldable screen interface according to an embodiment of this application. First, system events can be listened to or device (such as a foldable phone) parameters can be monitored to obtain information on screen size changes. Then, historical interface elements of the device are extracted (i.e., interface elements are extracted), and the attributes of the extracted historical interface elements are quantified to obtain attribute values. Next, the relationship between any two historical interface elements can be determined, and a relationship model is constructed based on all relationships. Cluster analysis is then performed on all historical interface elements and all attribute values to obtain element clustering results. Based on the clustering results and attribute values, a rule set (i.e., a preset visual effect rule set) can be generated. Then, the historical interface elements are characterized to obtain historical interface element features. Based on the relationships between all historical interface elements and the historical interface elements... Features can be used to construct a graph of interface element relationships. Then, based on historical screen sizes, historical interface element relationship graphs, and preset layout samples, a deep learning model (i.e., an initial interface layout prediction model) is trained to obtain a preset interface layout prediction model. When the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, the preset interface layout prediction model is used to predict the layout of the current interface, resulting in the interface layout under the current screen size. Preset algorithms can be used to optimize the layout. Then, a set of rules (i.e., a set of preset visual effect rules) can be applied to split the interface components and use animation transitions to optimize performance, making layout changes more natural and smooth. GPU-accelerated rendering and off-screen rendering and virtualization rendering can be used to render interface elements. Caching and reuse mechanisms can also be used to save computing resources.
[0086] The method for determining the layout of a foldable screen interface provided in this application embodiment can accurately grasp the changes in screen size by real-time monitoring of the screen state. Then, it can construct an interface element relationship diagram and a set of preset visual effect rules, and use a preset interface layout prediction model to predict the interface layout under the current screen size to obtain the interface layout. To ensure the visual effect and operation experience of the predicted interface layout, a preset optimization algorithm is further used for fine-tuning to ensure the complete presentation of content and the consistency of the interface. This realizes the automatic generation of layout schemes suitable for new screen sizes and improves the efficiency of interface adaptation.
[0087] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0088] Example 2
[0089] This application also provides a device for determining the layout of a foldable screen interface. It should be noted that this device can be used to execute the method for determining the layout of a foldable screen interface provided in this application. The following describes the device for determining the layout of a foldable screen interface provided in this application.
[0090] According to an embodiment of this application, an apparatus for implementing the above-described method for determining the layout of a foldable screen interface is also provided. Figure 4 This is a schematic diagram of an optional foldable screen interface layout determination device according to an embodiment of this application, such as... Figure 4 As shown, the device for determining the layout of the foldable screen interface may include: a judgment unit 40, a construction unit 41, an input unit 42, and an adjustment unit 43.
[0091] The judgment unit 40 is used to obtain the current screen size of the target terminal and determine whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold. The target terminal is a foldable terminal device.
[0092] Construction unit 41 is used to acquire all initial interface elements of the target terminal when the absolute difference is greater than a preset threshold, and to construct an interface element relationship diagram based on the initial interface elements.
[0093] Input unit 42 is used to input the current screen size and interface element relationship diagram into the preset interface layout prediction model and output the interface layout under the current screen size.
[0094] The adjustment unit 43 is used to adjust the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal.
[0095] The device for determining the foldable screen interface layout provided in this application embodiment can obtain the current screen size of the target terminal through the judgment unit 40 and determine whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold. If the absolute difference is greater than the preset threshold, the construction unit 41 can obtain all the initial interface elements of the target terminal and construct an interface element relationship diagram based on the initial interface elements. The input unit 42 can input the current screen size and the interface element relationship diagram into a preset interface layout prediction model and output the interface layout under the current screen size. The adjustment unit 43 can use a preset optimization algorithm to adjust the interface layout to obtain the target interface layout of the target terminal.
[0096] Optionally, the determining device includes: a first acquisition module, configured to acquire the physical attributes of the target terminal using a preset interface before acquiring the current screen size of the target terminal, wherein the physical attributes include at least: the initial screen size; and a first listening module, configured to listen to broadcast events and read the initial screen size from the broadcast events.
[0097] Optionally, the construction unit includes: a first processing module, used to perform feature processing on all initial interface elements to obtain initial interface element features, and to represent the initial interface element features as nodes of the interface element relationship graph; a first determining module, used to determine the association relationship between any two initial interface elements, and to represent the association relationship as edges of the interface element relationship graph; and a first construction module, used to construct the interface element relationship graph based on the nodes and edges.
[0098] Optionally, the determining device includes: a first extraction module, used to obtain historical screen sizes of multiple terminals and extract historical interface elements from the terminals to obtain a set of historical interface elements before inputting the current screen size and interface element relationship diagram into a preset interface layout prediction model and outputting the interface layout under the current screen size; a second extraction module, used to extract attributes from each historical interface element in the set of historical interface elements to obtain the attribute values of the historical interface elements; and a second construction module, used to construct a preset set of visual effect rules based on all historical interface elements and the attribute values corresponding to all historical interface elements.
[0099] Optionally, the second construction module includes: a first determining submodule, used to determine the association between any two historical interface elements and construct a preset element relationship model based on all associations; a second determining submodule, used to determine the size range of historical interface components based on the preset element relationship model and attribute values, wherein the attribute values include at least the size of historical interface elements, and historical interface components are combinations of multiple historical interface elements, and historical interface components are determined based on the preset element relationship model; a first clustering submodule, used to cluster all historical interface elements and all attribute values to obtain element clustering results, wherein the clustering results include at least the size of each historical interface element in each cluster; a third determining submodule, used to determine the size range of historical interface elements based on the size of each historical interface element in each cluster; and a first construction submodule, used to construct a preset visual effect rule set based on the size range of historical interface components and the size range of historical interface elements.
[0100] Optionally, the determining device includes: a second processing module, used to perform feature processing on each historical interface element in the historical interface element set after constructing a preset visual effect rule set based on all historical interface elements and the attribute values corresponding to all historical interface elements, to obtain historical interface element features; a third construction module, used to construct a historical interface element relationship graph based on the historical interface element features and the relationships between historical interface elements, wherein the historical interface element features are the nodes of the historical interface element relationship graph, and the relationships between historical interface elements are the edges of the historical interface element relationship graph; and a first training module, used to train a preset initial interface layout prediction model based on historical screen size, the historical interface element relationship graph, and preset layout samples to obtain a preset interface layout prediction model.
[0101] Optionally, the interface layout includes at least: interface element size and interface component size. A preset optimization algorithm is used, and the adjustment unit includes: a first adjustment module, used to adjust the interface layout to obtain the target interface layout when the size of the interface element is detected to be outside the range of the size of the historical interface elements; and a second adjustment module, used to adjust the interface layout based on a preset set of visual effect rules to obtain the target interface layout when the size of the interface component is detected to be outside the range of the size of the historical interface components.
[0102] Optionally, the determining device includes: a first drawing module, used to, after adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal, draw the target interface elements in the target interface layout using a preset off-screen technology, obtain the drawing result of the target interface elements, and copy the drawing result to the target terminal; and a first rendering module, used to, when detecting that there are target interface elements in the target interface layout whose positions are not within the current screen size range, render other target interface elements using a preset virtual list technology, wherein the preset virtual list technology is used to render target interface elements whose positions are within the current screen size range, and other target interface elements refer to target interface elements whose positions are within the current screen size range.
[0103] The aforementioned device for determining the layout of the foldable screen interface may also include a processor and a memory. The aforementioned judgment unit 40, construction unit 41, input unit 42, adjustment unit 43, etc., are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0104] The aforementioned processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured; by adjusting kernel parameters, the interface layout can be adjusted based on all processed data to obtain the target interface layout for the target terminal.
[0105] The aforementioned memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0106] It should be noted that the aforementioned judgment unit 40, construction unit 41, input unit 42, and adjustment unit 43 correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the aforementioned units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the aforementioned units may be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The aforementioned units may also be part of a device and can run in the computer terminal 10 provided in Embodiment 1.
[0107] Example 3
[0108] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.
[0109] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0110] In this embodiment, the computer terminal described above can execute the following steps in the method for determining the layout of a foldable screen interface: obtaining the current screen size of the target terminal and determining whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device; if the absolute difference is greater than the preset threshold, obtaining all initial interface elements of the target terminal and constructing an interface element relationship diagram based on the initial interface elements; inputting the current screen size and the interface element relationship diagram into a preset interface layout prediction model and outputting the interface layout under the current screen size; and using a preset optimization algorithm to adjust the interface layout to obtain the target interface layout of the target terminal.
[0111] Optionally, the computer terminal described above may execute the program code of the following steps in the method for determining the layout of the foldable screen interface: using a preset interface to obtain the physical attributes of the target terminal, wherein the physical attributes include at least: the initial screen size; or, listening to broadcast events and reading the initial screen size from the broadcast events.
[0112] Optionally, the computer terminal described above can execute the following steps in the method for determining the layout of the foldable screen interface: perform feature processing on all initial interface elements to obtain the features of the initial interface elements, and represent the features of the initial interface elements as nodes in the interface element relationship graph; determine the association between any two initial interface elements, and represent the association as edges in the interface element relationship graph; and construct the interface element relationship graph based on the nodes and edges.
[0113] Optionally, the computer terminal described above can execute the following steps in the method for determining the layout of a foldable screen interface: obtain the historical screen sizes of multiple terminals, extract historical interface elements from the terminals to obtain a set of historical interface elements; extract attributes from each historical interface element in the set of historical interface elements to obtain the attribute values of the historical interface elements; and construct a set of preset visual effect rules based on all historical interface elements and the attribute values corresponding to all historical interface elements.
[0114] Optionally, the aforementioned computer terminal may execute the following steps in the method for determining the layout of a foldable screen interface: determining the relationship between any two historical interface elements, and constructing a preset element relationship model based on all relationships; determining the size range of historical interface components based on the preset element relationship model and attribute values, wherein the attribute values include at least: the size of historical interface elements, a historical interface component is a combination of multiple historical interface elements, and the historical interface component is determined based on the preset element relationship model; clustering all historical interface elements and all attribute values to obtain element clustering results, wherein the clustering results include at least: the size of each historical interface element in each cluster; determining the size range of historical interface elements based on the size of each historical interface element in each cluster; and constructing a preset set of visual effect rules based on the size range of historical interface components and the size range of historical interface elements.
[0115] Optionally, the aforementioned computer terminal may execute the following steps in the method for determining the layout of a foldable screen interface: performing feature processing on each historical interface element in the historical interface element set to obtain historical interface element features; constructing a historical interface element relationship graph based on the historical interface element features and the relationships between historical interface elements, wherein the historical interface element features are nodes in the historical interface element relationship graph, and the relationships between historical interface elements are edges in the historical interface element relationship graph; and training a preset initial interface layout prediction model based on the historical screen size, the historical interface element relationship graph, and preset layout samples to obtain a preset interface layout prediction model.
[0116] Optionally, the aforementioned computer terminal may execute the following steps in the method for determining the layout of a foldable screen interface: if the size of an interface element is detected to be outside the range of the size of historical interface elements, the interface layout is adjusted to obtain the target interface layout; or, if the size of an interface component is detected to be outside the range of the size of historical interface components, the interface layout is adjusted based on a preset set of visual effect rules to obtain the target interface layout.
[0117] Optionally, the aforementioned computer terminal may execute the following steps in the method for determining the layout of a foldable screen interface: using a preset off-screen technique to draw the target interface elements in the target interface layout, obtaining the drawing results of the target interface elements, and copying the drawing results to the target terminal; if it is detected that there are target interface elements in the target interface layout whose positions are not within the current screen size range, using a preset virtual list technique to render other target interface elements, wherein the preset virtual list technique is used to render target interface elements whose positions are within the current screen size range, and other target interface elements refer to target interface elements whose positions are within the current screen size range.
[0118] Optionally, Figure 5 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 5 As shown, the electronic device may include: one or more ( Figure 5 Only one of the components is shown: processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module, and display.
[0119] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and apparatus for determining the foldable screen interface layout in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned method for determining the foldable screen interface layout. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0120] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the method for determining the layout of the foldable screen interface.
[0121] The embodiments of this application provide a scheme for determining the layout of a foldable screen interface. By constructing an interface element relationship diagram and a preset set of visual effect rules, and using a preset interface layout prediction model to predict the interface layout under the current screen size, the interface layout is obtained. The interface layout is then optimized by a preset optimization algorithm to obtain the target interface layout. By using GPU acceleration and optimizing the rendering process, the interface can respond and display quickly under different folding states, significantly improving rendering efficiency. This solves the technical problem in related technologies where it is impossible to efficiently determine the interface layout under different screen sizes, resulting in low interface adaptation efficiency.
[0122] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be terminal devices such as smartphones, tablets, PDAs, and mobile internet devices (MIDs). Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.
[0123] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0124] Example 4
[0125] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for determining the foldable screen interface layout provided in Embodiment 1.
[0126] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0127] This application also provides a computer program product, which, when executed on a data processing device, is adapted to perform the steps of a method for determining the layout of a foldable screen interface.
[0128] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0129] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0131] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0133] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0134] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for determining the layout of a foldable screen interface, characterized in that, include: The current screen size of the target terminal is obtained, and it is determined whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device; If the absolute difference is greater than the preset threshold, all initial interface elements of the target terminal are obtained, and an interface element relationship diagram is constructed based on the initial interface elements. Input the current screen size and the interface element relationship diagram into the preset interface layout prediction model, and output the interface layout under the current screen size; The interface layout is adjusted using a preset optimization algorithm to obtain the target interface layout of the target terminal.
2. The method for determining the layout of a foldable screen interface according to claim 1, characterized in that, Before obtaining the current screen size of the target terminal, the following steps are included: Using a preset interface, the physical attributes of the target terminal are obtained, wherein the physical attributes include at least: the initial screen size; or, Listen for broadcast events and read the initial screen size from the broadcast events.
3. The method for determining the layout of a foldable screen interface according to claim 1, characterized in that, The step of constructing a relationship graph of interface elements based on the initial interface elements includes: All the initial interface elements are characterized to obtain initial interface element features, and the initial interface element features are represented as nodes of the interface element relationship graph. Determine the association between any two initial interface elements, and represent the association as an edge of the interface element relationship graph; Based on the nodes and edges, construct the interface element relationship graph.
4. The method for determining the layout of a foldable screen interface according to claim 1, characterized in that, Before inputting the current screen size and the interface element relationship diagram into the preset interface layout prediction model and outputting the interface layout under the current screen size, the process includes: Obtain the historical screen sizes of multiple terminals, and extract historical interface elements from the terminals to obtain a set of historical interface elements; Attribute extraction is performed on each historical interface element in the historical interface element set to obtain the attribute values of the historical interface elements; Based on all the historical interface elements and the attribute values corresponding to all the historical interface elements, a preset set of visual effect rules is constructed.
5. The method for determining the layout of a foldable screen interface according to claim 4, characterized in that, The step of constructing a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements includes: Determine the association between any two of the historical interface elements, and construct a preset element relationship model based on all the associations; Based on the preset element relationship model and the attribute values, the size range of the historical interface component is determined, wherein the attribute values include at least: the size of the historical interface element, the historical interface component is a combination of multiple historical interface elements, and the historical interface component is determined based on the preset element relationship model; Cluster all the historical interface elements and all the attribute values to obtain element clustering results, wherein the clustering results include at least: the size of each historical interface element in each cluster; The size range of the historical interface element is determined based on the size of each of the historical interface elements in each cluster; Based on the size range of the historical interface components and the size range of the historical interface elements, the preset visual effect rule set is constructed.
6. The method for determining the layout of a foldable screen interface according to claim 5, characterized in that, After constructing a preset visual effect rule set based on all the historical interface elements and the attribute values corresponding to all the historical interface elements, the method further includes: Each historical interface element in the set of historical interface elements is characterized to obtain historical interface element features. Based on the historical interface element features and the relationships between the historical interface elements, a historical interface element relationship graph is constructed, wherein the historical interface element features are nodes of the historical interface element relationship graph, and the relationships between the historical interface elements are edges of the historical interface element relationship graph. Based on the historical screen size, the historical interface element relationship diagram, and the preset layout sample, the preset initial interface layout prediction model is trained to obtain the preset interface layout prediction model.
7. The method for determining the layout of a foldable screen interface according to claim 5, characterized in that, The interface layout includes at least: interface element sizes and interface component sizes. The step of adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout for the target terminal includes: If the size of a UI element is detected to be outside the range of the sizes of historical UI elements, the UI layout is adjusted to obtain the target UI layout; or... If the size of the interface component is detected to be outside the range of the size of the historical interface components, the interface layout is adjusted based on the preset visual effect rule set to obtain the target interface layout.
8. The method for determining the layout of a foldable screen interface according to claim 7, characterized in that, After adjusting the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal, the method further includes: Using a preset off-screen technology, the target interface elements in the target interface layout are drawn to obtain the drawing results of the target interface elements, and the drawing results are copied to the target terminal. If it is detected that there are target interface elements in the target interface layout whose positions are not within the current screen size range, a preset virtual list technique is used to render other target interface elements. The preset virtual list technique is used to render target interface elements whose positions are within the current screen size range. The other target interface elements refer to target interface elements whose positions are within the current screen size range.
9. A device for determining the interface layout of a foldable screen, characterized in that, include: The judgment unit is used to obtain the current screen size of the target terminal and determine whether the absolute difference between the current screen size and the initial screen size is greater than a preset threshold, wherein the target terminal is a foldable terminal device. The construction unit is used to acquire all initial interface elements of the target terminal when the absolute difference is greater than the preset threshold, and to construct an interface element relationship diagram based on the initial interface elements. The input unit is used to input the current screen size and the interface element relationship diagram into a preset interface layout prediction model and output the interface layout under the current screen size. The adjustment unit is used to adjust the interface layout using a preset optimization algorithm to obtain the target interface layout of the target terminal.
10. A computer program product, characterized in that, The method includes a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for determining the layout of a foldable screen interface as described in any one of claims 1 to 8.
11. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for determining the layout of a foldable screen interface as described in any one of claims 1 to 8.