Interface sliding management method, device and readable storage medium

By building a linked list association interface in the LVGL graphics library device and optimizing storage strategies, the problem of excessive memory occupancy of the interface is solved, and the stable operation of the device and efficient interface switching is achieved.

CN119781672APending Publication Date: 2025-04-08SHENZHEN YANXIANG QIANDONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411759531.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In devices using the LVGL graphics library, due to the large number of interfaces that can be displayed or the storage space is limited, the interface takes up too much memory, which is not conducive to the stable operation of the device.

Method used

By building a linked list in memory, the various interfaces of the manipulating device are associated, and the display information of the adjacent interface and the current interface is stored on the linked list node, so that the node data domain of the interval interface is left empty, thereby reducing memory usage.

Benefits of technology

It effectively reduces the memory space occupied by the interface, ensures the stable operation of the device, and supports efficient switching of interface sliding operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781672A_ABST
    Figure CN119781672A_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and readable storage medium for managing interface sliding, the method comprising: constructing at least one set of linked lists in a memory to associate various interfaces of a control device; storing interface display information corresponding to an adjacent interface and interface display information corresponding to a current interface on corresponding nodes in the linked list, so that the data domain on the node corresponding to the interval interface remains empty; wherein the adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the interval interface is the interface that is separated from the current interface by the adjacent interface. The present invention can effectively reduce the occupation of memory space by the interface of the control device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, device and readable storage medium for managing interface sliding. Background Art

[0002] LVGL (Light and Versatile Graphics Library) is a GUI (Graphical User Interface) library suitable for various embedded platforms and displays. It provides a wealth of controls, themes, animations, fonts, images and other elements, as well as flexible layout and event handling mechanisms. It is widely used in wearable devices, industrial control equipment, smart homes, and IoT devices. Among them, pixels (xp) are the units of control movement in LVGL.

[0003] However, for some devices using LVGL, usually due to the large number of displayable interfaces or the limited storage space provided by the devices, the displayable interfaces occupy too much memory of the device, which is not conducive to the operation of the device. Summary of the invention

[0004] To solve the above problems, the interface sliding management method and device provided by the present invention effectively reduces the memory space occupied by the interface of the control device by clearing the data domain on the node corresponding to the isolation interface, which is beneficial to ensure the stable operation of the control device.

[0005] In a first aspect, the present invention provides a method for managing interface sliding, the method comprising:

[0006] Constructing at least one set of linked lists in memory to associate various interfaces of the control device;

[0007] The interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface are stored in the corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty;

[0008] Among them, the adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the interval interface is an interface that is separated from the current interface by the adjacent interface.

[0009] Optionally, the step of constructing at least one set of linked lists in memory includes:

[0010] After each interface of the control device is created, confirm whether each interface has an associated adjacent interface in at least one direction to obtain the existence status information of each interface, where the adjacent interface is an interface that is adjacent to the interface to be confirmed;

[0011] At least one set of linked lists is constructed in the memory according to the existence status information of each interface.

[0012] Optionally, the interface display information includes a child object and a parent object, the interface is created through the child object, and the parent object management is used to manage the child objects on the corresponding interface;

[0013] The steps of storing the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in corresponding nodes in the linked list and keeping the data field on the node corresponding to the interval interface empty include:

[0014] Get the parent object of the adjacent interface and the parent object of the current interface;

[0015] The parent object corresponding to the adjacent interface and the parent object corresponding to the current interface are stored in corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty.

[0016] Optionally, the method further comprises:

[0017] Through the sliding operation performed by the user on the current interface, the sliding track information corresponding to the sliding operation is obtained;

[0018] Determine whether to switch the current interface based on the sliding track information and the preset movement threshold.

[0019] Optionally, the sliding track information includes the sliding direction and the sliding distance, and the size of the interface is equal to the size of the screen of the control device;

[0020] The steps of determining whether to switch the current interface according to the sliding track information and the preset movement threshold include:

[0021] Determine whether the sliding distance is greater than or equal to the interface switching distance. The interface switching distance is obtained by multiplying the screen resolution by the movement threshold.

[0022] The method also includes:

[0023] When the sliding distance is greater than or equal to the interface switching distance, the current interface is switched according to the sliding direction and the linked list;

[0024] When the sliding distance is less than the interface switching distance, the control screen continues to display the current interface.

[0025] Optionally, when the sliding distance is less than the interface switching distance, the step of controlling the screen to continue to display the current interface includes:

[0026] When the sliding distance is less than the interface switching distance, the current screen is moved along the sliding direction to the rebound distance;

[0027] After the current screen moves the rebound distance, the control screen continues to display the current interface;

[0028] The rebound distance is obtained by dividing the actual sliding distance of the current interface by the preset rebound threshold, and the rebound threshold is greater than 1.

[0029] Optionally, the method further comprises:

[0030] When the current interface is sliding, control the screen to insert sliding animation.

[0031] Optionally, the method further comprises:

[0032] After the current interface is switched, data fields in at least one set of linked lists are updated according to the switched current interface.

[0033] In a second aspect, the present invention provides a device for managing interface sliding, the device comprising:

[0034] A linked list construction module is configured to construct at least one set of linked lists in the memory to associate various interfaces of the control device;

[0035] A linked list updating module is configured to store the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty;

[0036] Among them, the adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the interval interface is an interface that is separated from the current interface by the adjacent interface.

[0037] Optionally, the linked list building module includes:

[0038] The determination submodule is configured to determine whether each interface has an associated adjacent interface in at least one direction after each interface of the control device is created, so as to obtain the existence status information of each interface, wherein the adjacent interface is an interface that is adjacent to the interface to be confirmed;

[0039] A construction submodule is configured to construct at least one set of linked lists in memory according to the existence status information of each interface;

[0040] The interface display information includes child objects and parent objects. The interface is created through child objects, and the parent object management is used to manage the child objects on the corresponding interface;

[0041] The linked list update module includes:

[0042] An acquisition submodule, configured to acquire the parent object of the adjacent interface and the parent object of the current interface;

[0043] The updating submodule is configured to store the parent object corresponding to the adjacent interface and the parent object corresponding to the current interface on the corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty.

[0044] In a third aspect, the present invention provides a readable storage medium having a computer program stored thereon, which implements the steps of any one of the methods in the first aspect when the computer program is executed by a processor.

[0045] The interface sliding management method, device and readable storage medium provided in the embodiments of the present invention store interface display information through a linked list, and only store the interface display information corresponding to the adjacent interface and the current interface on the corresponding node. This not only ensures stable switching of the interface, but also saves the memory space occupied by the node's data domain, which is beneficial to ensure the stable operation of the control device. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0047] Figure 1 This is a schematic flow chart of a method for managing interface sliding based on LVGL according to an embodiment of the present application;

[0048] Figure 2 A schematic diagram of the interconnection relationship between various interfaces in a control device according to an embodiment of the present application;

[0049] Figure 3 A schematic diagram of the interconnection relationship between various interfaces in a control device according to an embodiment of the present application;

[0050] Figure 4 This is a schematic flow chart of a method for managing interface sliding based on LVGL according to an embodiment of the present application;

[0051] Figure 5 It is a schematic structural diagram of a management device for interface sliding based on LVGL according to an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.

[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0054] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.

[0055] LVGL is a GUI library suitable for various embedded platforms and displays. It provides a wealth of controls, themes, animations, fonts, images and other elements, as well as flexible layout and event handling mechanisms. It is widely used in wearable devices, industrial control, home devices and IoT devices.

[0056] Example 1

[0057] This embodiment provides a method for managing interface sliding based on LVGL. Figure 1 The method is applied to the operating system on the control device, and the method includes steps S101 to S102.

[0058] Step S101: construct at least one set of linked lists in the memory to associate various interfaces of the control device.

[0059] It should be noted that the linked list in step S101 may be a one-way linked list, a two-way linked list, or a four-way linked list, etc. In a one-way linked list, each node includes a pointer field and a data field; in a two-way linked list, each node includes two pointer fields and a data field; in a four-way linked list, each node includes four pointer fields and a data field.

[0060] The number of linked lists is related not only to the type of linked lists selected, but also to the layout of the interface, where the layout of the interface includes but is not limited to linear layout (one-dimensional layout), in-plane layout (two-dimensional layout) and spatial layout (three-dimensional layout).

[0061] The relationship between the various interfaces of the control device is Figure 2 As an example, the relationship shown in Figure 2 Page 1-6 in the figure represent the six interfaces of the control device, and the layout of the six interfaces is in-plane layout. Figure 2The arrowed line in the figure represents the association between two adjacent interfaces. When the linked list in the figure is a one-way linked list, four sets of linked lists are required to reflect the association between the six interfaces; when the linked list in the figure is a two-way linked list, two sets of linked lists are required to reflect the association between the six interfaces; when the linked list in the figure is a four-way linked list, one set of linked lists is required to reflect the association between the six interfaces.

[0062] Taking the above linked list as a doubly linked list as an example, the two sets of linked lists are the first doubly linked lists: And the second doubly linked list: Among them, node1-6 represent the corresponding nodes of Page1-6 in the corresponding linked list, and each node corresponds to an interface; Indicates the relationship between two adjacent nodes; In the linked list, the two pointer fields on node1 point to node2 and node4 respectively, and the two pointer fields on node4 point to node1 and node3 respectively. At the same time, in the above two sets of bidirectional linked lists, the data field in each node stores the identifier of the corresponding interface, which is convenient for the operating system on the control device to determine the positional relationship between any interface and other interfaces through the first bidirectional linked list and the second bidirectional linked list. That is, through the first bidirectional linked list, it can be determined that the two adjacent interfaces on the left and right of Page2 are Page1 and Page3, and through the second bidirectional linked list, it can be determined that the two adjacent interfaces above and below Page2 are Page6 and Page5. If Figure 2 If a third dimension of interface is added to the association relationship of the interface in the figure, the layout mode is spatial layout. At this time, if a bidirectional linked list is used as the linked list, the number of linked lists required is not less than 3 groups, which will not be elaborated in this embodiment.

[0063] In this embodiment, the layout of the interface is an in-plane layout and the linked list is a four-way linked list. Step S101 specifically constructs six nodes in the memory, namely node1, node2, node3, node4, node5, and node6, to form a set of four-way linked lists.

[0064] The structure of each node in the four-way linked list is as follows:

[0065] {

[0066] up node; / / up pointer

[0067] down node; / / down pointer

[0068] left node; / / left pointer

[0069] right node; / / right pointer

[0070] parent; / / parent object

[0071] }

[0072] Among them, up node, down node, left node, and right node correspond to the four pointers in the node respectively, that is, the contents corresponding to the four pointer fields, and parent is the data in the node, that is, the contents corresponding to the data field.

[0073] Each node associated with the six interfaces is described as page2, and its corresponding node is node2. The up pointer of node2 points to node6, the down pointer of node2 points to node5, the left pointer of node2 points to node1, and the right pointer of node2 points to node3.

[0074] For page6, the corresponding node is node6, the upper pointer of node6 has no address, so it is NULL; the left pointer and right pointer of node6 are also NULL; the lower pointer of node6 points to node2. The remaining nodes are similar, and this embodiment will not be repeated.

[0075] In a further optional embodiment of the present embodiment, the step of constructing at least one set of linked lists in the memory includes: after each interface of the control device is created, determining whether each interface has an associated adjacent interface in at least one direction to obtain the existence status information of each interface; and constructing at least one set of linked lists in the memory based on the existence status information of each interface.

[0076] The adjacent interface is an interface that is adjacent to the interface to be confirmed and has a direct association relationship.

[0077] It can be understood that in the step of "determining whether each interface has an associated adjacent interface in at least one direction", the number of directions is determined by the association relationship between each interface set in the process of creating each interface. If the chain in the memory is a group of one-way chains, the number of directions is 1; if the chain in the memory contains two groups of one-way chains representing different directions, the number of directions is 2; if the chain in the memory contains three groups of one-way chains representing different directions, the number of directions is 3. If the chain in the memory is a group of two-way chains, the number of directions is 2; if the chain in the memory contains two groups of one-way chains representing different directions, the number of directions is 4; if the chain in the memory contains three groups of one-way chains representing different directions, the number of directions is 6. If the chain in the memory is a group of four-way chains, the number of directions is 4. Figure 2 or Figure 3 If the chain in the memory contains multiple groups of four-way chains representing different directions, the method for determining the number of directions involves the specific directions represented by the chains, and the situation is relatively complicated, so it will not be elaborated in this embodiment.

[0078] In this embodiment, after each interface of the control device is created, it is determined whether each interface has associated adjacent interfaces in the four directions of up, down, left, and right, so as to obtain the existence status information of each interface.

[0079] Combination Figure 2 , the adjacent interfaces of page2 are page1, page6, page3 and page5; the adjacent interfaces of page3 are page2 and page4; the adjacent interfaces of page4 are page3 and page1; the adjacent interface of page6 is page2.

[0080] If the interface association relationship corresponding to the linked list constructed in memory is as follows Figure 3 , page7 is only the adjacent interface of page6, not the adjacent interface of page3.

[0081] By determining whether each interface has an associated adjacent interface in at least one direction to obtain the existence status information of each interface, the direction of the pointer field in each node can be quickly and accurately determined during the process of building the linked list, thereby improving the efficiency and accuracy of linked list construction.

[0082] Step S102: Store the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in corresponding nodes in the linked list, and keep the data field on the node corresponding to the interval interface empty.

[0083] Among them, the adjacent interface is at least one interface that is adjacent to the current interface based on the association relationship between the various interfaces, the current interface is the interface being displayed by the control device, and the separated interface is an interface that is adjacent to the current interface based on the association relationship between the various interfaces.

[0084] It is understandable that the adjacent interface can be only an interface that is adjacent to the current interface, that is, an adjacent interface. The adjacent interface can also be an adjacent interface, and an interface that is adjacent to the adjacent interface in a direction other than the current interface.

[0085] by Figure 2Taking Page2 as the current interface as an example, if the adjacent interface is the adjacent interface, then the adjacent interfaces of Page2 are Page1, Page3, Page5 and Page6; if the adjacent interface is the adjacent interface, and an interface adjacent to the adjacent interface in a direction outside the current interface, then the adjacent interfaces of Page2 are Page1, Page3, Page4, Page5 and Page6.

[0086] by Figure 3 Take Page3 as the current interface as an example. If the adjacent interface is the adjacent interface, then the adjacent interfaces of Page3 are Page2 and Page4.

[0087] by Figure 3 Taking Page4 as the current interface as an example, if the adjacent interface is the immediately adjacent interface and an interface that is adjacent to the immediately adjacent interface in a direction outside the current interface, the adjacent interfaces of Page4 are Page1, Page2 and Page3.

[0088] by Figure 3 For example, if the adjacent interface is the immediate adjacent interface, and the two interfaces adjacent to the immediate adjacent interface in the direction outside the current interface, the adjacent interfaces of Page4 are Page1, Page3, Page4, Page5 and Page6. Among them, Page1 and Page3 are the immediate adjacent interfaces of Page4, and the two interfaces adjacent to the immediate adjacent interface of Page4 in the direction outside the current interface are Page4, Page5 and Page6.

[0089] Whether the specific adjacent interface is an adjacent interface, or an adjacent interface and an interface adjacent to the adjacent interface in a direction other than the current interface, can be set according to the number of interfaces in the control device.

[0090] If there are a large number of interfaces in the control device, the adjacent interface is the adjacent interface and the interface adjacent to the adjacent interface in a direction other than the current interface. In this way, the user can quickly switch the current interface to the interface separated from the current interface during the process of switching the current interface, thereby improving the efficiency of interface switching and enhancing the user experience.

[0091] If the memory space is tight, the adjacent interface is the adjacent interface. This can avoid the situation of insufficient memory space, thereby improving the stability of the control device and improving the user experience.

[0092] In this embodiment, the control device is a smart watch, the memory is the hardware on the control device, and the adjacent interface is only the adjacent interface.

[0093] In a further optional embodiment of this embodiment, the interface display information includes a child object and a parent object. The interface is created by the child object. The parent object management is used to manage the child objects on the corresponding interface.

[0094] The steps of storing the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in corresponding nodes in the linked list and keeping the data field on the node corresponding to the interval interface empty include:

[0095] Get the parent object of the adjacent interface and the parent object of the current interface; store the parent object corresponding to the adjacent interface and the parent object corresponding to the current interface on the corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty.

[0096] By storing the parent object in the data domain of the corresponding node, the memory space occupied by the interface resources can be further saved.

[0097] It should be noted that each interface on the control device includes multiple levels, where the parent object is located at the highest level and the child objects are located at other levels. The parent object can conveniently and quickly manage the child objects under its name, so by selecting the parent object as the key parameter for parameter transfer, the corresponding interface can be created and deleted.

[0098] In this embodiment, page2 is the watch face interface, page1 is the heart rate interface, page3 is the blood oxygen interface, page6 is the shortcut interface, and page5 is the message interface. Taking page2 as an example, the general watch face interface will have image resources such as the right hour hand, minute hand, background image, etc. Each image resource is a separate child object. When creating the node corresponding to page2, all child objects in page2 are created based on the parent object. Among them, the creation code is: create watchface page (node2.parent). When deleting, if the parent object is destroyed, all child objects under the name of the parent object will be destroyed. Therefore, when deleting the parent object of the watch face interface, its child objects, hour hand, minute hand, background image and other resources will also be destroyed and released together. Deletion code: delete watchface page (node2.parent).

[0099] Combination Figure 2 , if the current interface is in page2, the operating system needs to create interface resources for page1, page2, page3, page5, and page6 in memory. In the process of building the linked list, the operating system performs the following operations:

[0100] create watchface page(node2.parent) / / pass the parent object of node2 as a parameter to the interface creation function to create a watchface interface

[0101] create heart rate page(node1.parent) / / Pass the parent object of node1 as a parameter to the interface creation function to create the heart rate interface

[0102] create blood oxygen page(node3.parent) / / pass the parent object of node3 as a parameter to the interface creation function to create the blood oxygen interface

[0103] create short cut page(node6.parent) / / pass the parent object of node6 as a parameter to the interface creation function to create a shortcut interface

[0104] create message_page(node5.parent) / / Pass the parent object of node5 as a parameter to the interface creation function to create the message interface.

[0105] In a further optional embodiment of this embodiment, the method further includes:

[0106] Through the sliding operation performed by the user on the current interface, the sliding track information corresponding to the sliding operation is obtained;

[0107] Determine whether to switch the current interface based on the sliding track information and the preset movement threshold.

[0108] By using the sliding track information and the preset movement threshold to determine whether to switch the current interface, it is possible to effectively avoid the occurrence of misoperation. The movement threshold may be 20%, 25% or 35%.

[0109] In a further optional embodiment of the present embodiment, the sliding track information includes the sliding direction and the sliding distance, and the size of the interface is equal to the size of the screen of the control device.

[0110] The steps of determining whether to switch the current interface according to the sliding track information and the preset movement threshold include:

[0111] It is determined whether the sliding distance is greater than or equal to the interface switching distance, wherein the interface switching distance is obtained by multiplying the screen resolution by the movement threshold.

[0112] The method also includes: when the sliding distance is greater than or equal to the interface switching distance, switching the current interface according to the sliding direction and the linked list; when the sliding distance is less than the interface switching distance, controlling the screen to continue displaying the current interface.

[0113] Specifically, taking a 360×360 resolution screen as an example, if the movement threshold is set to 30%, the interface switching distance is 108. In this way, when the user slides on the screen for a distance of 108 pixels or more, the operating system will switch to the corresponding interface according to the sliding track information, completing the update of the current interface. When the user slides on the screen for a distance less than 108 pixels, the current interface on the screen remains unchanged.

[0114] In a further optional embodiment of the present embodiment, the method further includes: determining an adjacent interface that follows the movement of the current interface according to the sliding direction and the sliding distance.

[0115] For example, the current interface is Page2, and the user controls Page2 to move rightward by a distance of T1 through the screen, and Page1 changes on the screen following the movement of Page2. Specifically, at this time, the portion of the right end of Page1 by a distance of T2 appears on the screen, thereby achieving the following movement of the interface. Among them, T2 is less than or equal to T1.

[0116] By setting the follow-up movement of the interface, the user can timely understand the image that will become the next current interface, thereby further improving the user experience.

[0117] In a further optional embodiment of the present embodiment, a sliding animation is provided on the control device. The method further includes: during the sliding of the current interface, controlling the screen to insert the sliding animation.

[0118] It is understandable that during the sliding of the current interface, there are at least the following situations: situation 1: the current interface successfully switches to the next interface; situation 2: there is an adjacent interface in the sliding direction of the current interface, but the interface switching fails; situation 3: there is no adjacent interface in the sliding direction of the current interface, and the interface switching fails.

[0119] In this embodiment, the sliding animation includes: switching animation, return animation and rebound animation. Specifically, when the user controls Page2 to move rightward by a distance T1 through the screen, if the distance T1 does not reach the interface switching distance, the screen needs to redisplay the complete Page2. When the sliding end in contact with the plane used by the user leaves the screen, the screen begins to prepare to display the complete Page2, and during this process the operating system controls the return animation to play on the screen.

[0120] Similarly, if the T1 distance reaches or exceeds the interface switching distance, the operating system controls the switching animation to play on the screen.

[0121] By setting the sliding animation, the user can quickly visually determine whether the sliding of the sliding end triggers the sliding of the current interface and whether the switching of the current interface is successful. The sliding end can be a stylus or a user's finger, etc., which is not specifically limited in this embodiment.

[0122] When the sliding distance is less than the interface switching distance, the steps of controlling the screen to continue to display the current interface include:

[0123] When the sliding distance is less than the interface switching distance, the current screen is moved along the sliding direction to the rebound distance; after the current screen moves the rebound distance, the control screen continues to display the current interface.

[0124] The rebound distance is obtained by dividing the actual sliding distance of the current interface by a preset rebound threshold, and the rebound threshold is greater than 1, such as 2, 5, 8, etc.

[0125] Specifically, a rebound animation is also set on the control device. For example, if Page5 is the current interface and the rebound threshold is 10 pixels, since there is no interface below Page5, when the user slides the screen upward, the operating system calls the rebound animation to play on the screen to prompt the user that the scroll has reached the bottom.

[0126] Before playing the rebound animation, and when Page5 moves upward, if the user controls Page5 to move upward a distance of 100 pixels through the operating system, 110 is divided by 10, and the rebound distance is 11. At this time, the rebound animation is played when Page5 moves upward a distance of 11 pixels on the screen until Page5 is fully displayed on the screen again, thus completing the realization of the rebound effect.

[0127] By setting a rebound animation, when the user slides the current interface to a position where there is no switchable interface, the user can be informed that the control device has responded to the user's current interface switching operation, thereby preventing the user from mistakenly believing that the sliding distance has not reached the interface switching distance, or mistakenly believing that the control device is stuck, thereby improving the user experience.

[0128] In a further optional embodiment of this embodiment, the method further includes:

[0129] After the current interface is switched, data fields in at least one set of linked lists are updated according to the switched current interface.

[0130] The step of updating the data fields in at least one set of linked lists is to execute step S102. Figure 2, take the example of switching the current interface from Page2 to Page3. When the current interface is Page2, the data fields on node1, node2, node3, node5, and node6 in the linked list all store the parent objects on the corresponding interfaces, while the data field on node4 is empty. After the current interface switches from Page2 to Page3, the data in the data field on node2 is retained in the linked list, that is, the data in the data field on node1, node5, and node6 are deleted. At the same time, based on the code of Page4 in the control device, the parent object of Page4 is created and retained in the data field on node4. In this way, the update of the data field on the corresponding node of the linked list is completed.

[0131] It should be noted that, in this embodiment, the operating system can implement operations such as updating the data field on the linked list and obtaining the sliding track information through corresponding callback functions, which will not be described in detail in this embodiment.

[0132] The LVGL-based interface sliding management method provided in this embodiment uses a linked list to associate various interfaces. When the interface sliding ends, the method dynamically creates and deletes the interface, always keeping the memory occupancy at a relatively low level, saving memory space, and can customize the interface sliding speed, movement threshold, rebound effect, whether to cycle interfaces in the same direction, interface movement direction and other parameters according to needs, thereby expanding the application scenarios of the control device.

[0133] Example 2

[0134] Based on the content of Example 1, this embodiment also provides a management method for interface sliding based on LVGL. The method is applied to the control system of the control device, combined with Figure 4 The method includes steps S201 to S207.

[0135] Step S201: Determine the existence status information of each interface in the control device.

[0136] Step S202: construct at least one set of linked lists in the memory according to the existence status information of each interface, so as to associate each interface of the control device.

[0137] Step S203: Obtaining sliding track information generated by the user operating the interface.

[0138] Step S204: Determine whether the sliding distance exceeds the interface switching distance.

[0139] It is understandable that in step S204, a comparison value corresponding to the movement threshold may be obtained through the sliding track information, and the comparison value may be compared with the movement threshold to determine whether to execute step S205 or step S206.

[0140] Step S205: When the sliding distance does not exceed the interface switching distance, a return animation is displayed and the screen continues to display the current interface.

[0141] Step S206: When the sliding distance exceeds the interface switching distance, a switching animation is displayed and the screen displays the interface adjacent to the current interface in the sliding direction.

[0142] Among them, making the screen display the adjacent interface of the current interface in the sliding direction can also be understood as switching the current interface, that is, using the adjacent interface of the current interface in the sliding direction as the current interface after switching.

[0143] Step S207: according to the address of the pointer field in the node corresponding to the switched current interface in the linked list, create or delete the content of the data field in the node corresponding to the switched current interface and the adjacent interface of the switched current interface in the linked list.

[0144] Example 3

[0145] Based on embodiments 1 and 2, this embodiment provides a management device 300 based on LVGL interface sliding. Figure 5 , the management device 300 includes:

[0146] The linked list construction module 301 is configured to construct at least one set of linked lists in the memory to associate various interfaces of the control device;

[0147] The linked list updating module 302 is configured to store the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in the corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty;

[0148] Among them, the adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the interval interface is an interface that is separated from the current interface by the adjacent interface.

[0149] In a further optional embodiment of this embodiment, the linked list construction module 301 includes:

[0150] The determination submodule is configured to determine whether each interface has an associated adjacent interface in at least one direction after each interface of the control device is created, so as to obtain the existence status information of each interface, wherein the adjacent interface is an interface that is adjacent to the interface to be confirmed;

[0151] A construction submodule is configured to construct at least one set of linked lists in memory according to the existence status information of each interface;

[0152] The interface display information includes child objects and parent objects. The interface is created through child objects, and the parent object management is used to manage the child objects on the corresponding interface;

[0153] The linked list updating module 302 includes:

[0154] An acquisition submodule, configured to acquire the parent object of the adjacent interface and the parent object of the current interface;

[0155] The updating submodule is configured to store the parent object corresponding to the adjacent interface and the parent object corresponding to the current interface on the corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty.

[0156] In a further optional embodiment of this embodiment, the management device 300 further includes:

[0157] An acquisition module is configured to acquire sliding track information corresponding to the sliding operation performed by the user on the current interface;

[0158] The determination module is configured to determine whether to switch the current interface according to the sliding track information and a preset movement threshold.

[0159] In a further optional embodiment of this embodiment, the sliding track information includes the sliding direction and the sliding distance, and the size of the interface is equal to the size of the screen of the control device;

[0160] The determination module is further configured to determine whether the sliding distance is greater than or equal to the interface switching distance, where the interface switching distance is obtained by multiplying the screen resolution by the movement threshold;

[0161] The management device 300 further includes:

[0162] A switching module, configured to switch the current interface according to the sliding direction and the linked list when the sliding distance is greater than or equal to the interface switching distance;

[0163] The first control module is configured to control the screen to continue displaying the current interface when the sliding distance is less than the interface switching distance.

[0164] In a further optional embodiment of this embodiment, the first control module includes:

[0165] The moving submodule is configured to move the current screen to the rebound distance along the sliding direction when the sliding distance is less than the interface switching distance;

[0166] The control submodule is configured to control the screen to continue to display the current interface after the current screen moves the rebound distance.

[0167] The rebound distance is obtained by dividing the actual sliding distance of the current interface by the preset rebound threshold, and the rebound threshold is greater than 1.

[0168] In a further optional embodiment of this embodiment, the management device 300 further includes:

[0169] The second control module is configured to control the screen to insert a sliding animation during the sliding of the current interface.

[0170] In a further optional embodiment of the present embodiment, the linked list updating module 302 is further configured to update the data fields in at least one group of linked lists according to the switched current interface after the current interface is switched.

[0171] In a third aspect, this embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method in the first aspect are implemented.

[0172] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.

[0173] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0174] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for managing interface sliding, characterized in that: The method comprises: Constructing at least one set of linked lists in memory to associate various interfaces of the control device; Store the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in the corresponding nodes in the linked list, and keep the data field on the node corresponding to the interval interface empty; The adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the separated interface is an interface separated from the current interface by the adjacent interface.

2. The method according to claim 1, characterized in that The step of constructing at least one set of linked lists in memory comprises: After each interface of the control device is created, confirm whether each interface has an associated adjacent interface in at least one direction to obtain the existence status information of each interface, wherein the adjacent interface is the interface that is adjacent to the interface to be confirmed; At least one set of linked lists is constructed in the memory according to the existence status information of each of the interfaces.

3. The method according to claim 1, characterized in that The interface display information includes a child object and a parent object, the interface is created by the child object, and the parent object management is used to manage the child object on the corresponding interface; The step of storing the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface in corresponding nodes in the linked list, and keeping the data field on the node corresponding to the interval interface empty comprises: Acquire the parent object of the adjacent interface and the parent object of the current interface; The parent object corresponding to the adjacent interface and the parent object corresponding to the current interface are stored in corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty.

4. The method according to claim 1, characterized in that: The method further comprises: Acquire sliding track information corresponding to the sliding operation performed by the user on the current interface; Whether to switch the current interface is determined according to the sliding track information and a preset movement threshold.

5. The method according to claim 4, characterized in that The sliding track information includes the sliding direction and the sliding distance, and the size of the interface is equal to the size of the screen of the control device; The step of determining whether to switch the current interface according to the sliding track information and a preset movement threshold comprises: Determining whether the sliding distance is greater than or equal to an interface switching distance, where the interface switching distance is obtained by multiplying a resolution of the screen by the movement threshold; The method further comprises: When the sliding distance is greater than or equal to the interface switching distance, switching the current interface according to the sliding direction and the linked list; When the sliding distance is less than the interface switching distance, the screen is controlled to continue displaying the current interface.

6. The method according to claim 5, characterized in that When the sliding distance is less than the interface switching distance, the step of controlling the screen to continue displaying the current interface includes: When the sliding distance is less than the interface switching distance, moving the current screen along the sliding direction to the rebound distance; After the current screen moves the rebound distance, controlling the screen to continue displaying the current interface; The rebound distance is obtained by dividing the actual sliding distance of the current interface by a preset rebound threshold, and the rebound threshold is greater than 1.

7. The method according to claim 5, characterized in that The method further comprises: During the sliding of the current interface, the screen is controlled to insert the sliding animation.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: After the current interface is switched, at least one set of data fields in the linked list is updated according to the switched current interface.

9. A device for managing interface sliding, characterized in that: The device comprises: A linked list construction module is configured to construct at least one set of linked lists in the memory to associate various interfaces of the control device; A linked list updating module, configured to store the interface display information corresponding to the adjacent interface and the interface display information corresponding to the current interface on corresponding nodes in the linked list, so that the data field on the node corresponding to the interval interface remains empty; Among them, the adjacent interface is at least one interface adjacent to the current interface, the current interface is the interface being displayed by the control device, and the separated interface is an interface separated from the current interface by the adjacent interface.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.