Desktop arrangement restoration method, electronic equipment and storage medium
By directly updating the first arrangement data, the cache usage and loading time problems of electronic devices when restoring desktop arrangements are solved, and the restore speed and device performance of desktop arrangements are improved.
Patent Information
- Application Number
- CN202411491220.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-08-05
AI Technical Summary
In the prior art, when electronic devices restore desktop layout, loading historical layout data tables takes up cache and consumes time, resulting in slow down desktop layout restoration speed, affecting device performance.
By obtaining the second arrangement data of the user's operation, the first arrangement data is directly updated without loading into the cache, simplifying the restoration process and improving accuracy and speed.
Reduces the time and cache usage of desktop layout and restoration, and improves the desktop performance and user experience of electronic devices.
Smart Images

Figure CN120429047A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a desktop layout restoration method, electronic device, and storage medium. Background Art
[0002] Desktop layout refers to the arrangement of elements such as application icons, folders, and card stacks displayed on the screen of electronic devices such as mobile phones and tablets. Currently, electronic devices can save historical desktop layouts (also known as secondary layouts) so that they can be restored at any time according to user needs.
[0003] In related art, after the electronic device's desktop is activated, the electronic device will load the desktop's historical layout data table into a cache. If a user wishes to restore the electronic device's desktop to its historical layout, the user can trigger the desktop's historical layout restoration function. In response to the user's triggering operation, the electronic device can use the cached historical layout data table. However, loading the historical layout data table onto the electronic device may result in excessive cache usage and long loading times, thereby reducing the desktop layout restoration speed and affecting the electronic device's desktop performance. Summary of the Invention
[0004] In order to solve the above problems, the present application provides a desktop layout restoration method, an electronic device and a storage medium, the purpose of which is to increase the desktop layout restoration speed and thereby improve the desktop performance of the electronic device.
[0005] In the first aspect, the present application provides a method for restoring a desktop layout. Exemplarily, the method can be applied to electronic devices, which may be mobile phones, tablet computers, laptop computers, etc. In this method, the electronic device can display a desktop including a first layout, and the arrangement of the first element of the desktop is the first layout; the user can perform a restoration operation on the second layout, for example, the user clicks on the thumbnail of the second layout (that is, the historical layout thumbnail mentioned later), or clicks on the preview control of the second layout, or clicks on the application control of the second layout. In response to the user's restoration operation on the second layout, the electronic device can obtain the layout data of the second layout, for example, it can be obtained from the desktop database. The layout data of the second layout includes the second position information of the second element on the desktop, for example, it includes the screen information, row information and column information of the second element on the desktop, etc. The second element can be an application icon, a folder or a card stack. Etc., in addition, the arrangement data of the second arrangement may further include identification information of the second element; then, the electronic device may update the arrangement data of the first arrangement based on the arrangement data of the second arrangement, and the arrangement data of the first arrangement may include the first position information of the first element on the desktop, for example, it includes screen information, row information and column information of the first element on the desktop, etc. In addition, the arrangement data of the first arrangement may further include identification information of the first element; then the electronic device may display the desktop including the updated first arrangement based on the updated arrangement data of the first arrangement, and when the user clicks on the thumbnail of the second arrangement, or clicks on the preview control of the second arrangement, the electronic device may display a preview desktop including the updated desktop of the first arrangement.
[0006] In this way, based on the user's restoration operation on the second layout, the layout data of the second layout can be obtained, and based on this, the layout data of the first layout can be updated without loading the layout data of the second layout into the cache, that is, there is no need to waste the electronic device's loading time and occupy the electronic device's cache, which can reduce the desktop layout restoration process, increase the desktop layout restoration speed, and thus improve the desktop performance of the electronic device.
[0007] In addition, when the electronic device stores multiple second arrangements, the user can trigger a restore operation for any second arrangement. The electronic device only needs to obtain the arrangement data of the second arrangement, without obtaining the arrangement data of other second arrangements. There is no need to maintain multiple second arrangements at the same time, which facilitates management.
[0008] In one possible implementation, updating the arrangement data of the first arrangement based on the arrangement data of the second arrangement may include: the electronic device first obtains the relationship between the first element and the second element, that is, obtains the relationship between the first element in the first arrangement and the second element in the second arrangement. For example, the two elements may be the same element, for example, both are application icons of a game application, and for example, the two elements may be different elements, for example, the first element is a folder and the second element is a card stack; then the electronic device may update the arrangement data of the first arrangement based on the relationship between the first element and the second element. For example, the relationship between the two elements may be obtained based on the identification information of the first element and the identification information of the second element. For example, if the identification information of the two elements is the same, it indicates that the two elements are the same element, and if the identification information of the two elements is different, it indicates that the two elements are different elements. In this way, the electronic device can update the arrangement data of the first arrangement based on the relationship between the first element and the second element. On the one hand, the arrangement data of the first arrangement is directly updated to simplify the desktop layout restoration process. On the other hand, the arrangement data of the first arrangement can be updated more accurately based on the relationship, which is conducive to improving the accuracy of desktop layout restoration.
[0009] In one possible implementation, when the first element and the second element are the same, for example, the first element and the second element are application icons of the same application, or the first element and the second element are the same card stack, or the first element and the second element are the same folder, etc., the electronic device updates the arrangement data of the first arrangement based on the relationship, which may include: in the arrangement data of the first arrangement, the electronic device updates the first position information of the first element to the second position information of the second element. For example, the first position information of the first element is represented as: screen: 1, (3, 3), which means that it is in the third row and third column of one screen of the electronic device, and the second position information of the second element is represented as: screen: 2, (1, 2), which means that it is in the first row and second column of the second screen of the electronic device. The electronic device can update the first position information of the first element in the arrangement data of the first arrangement to screen: 2, (1, 2). In this way, for the same first element and second element, the first position information is directly updated based on the second position information, which simplifies the restoration process of the desktop arrangement and improves the restoration efficiency of the desktop arrangement.
[0010] In one possible implementation, when the first element is different from the second element, for example, the first element and the second element are application icons of different applications, or the first element is an application icon and the second element is a card stack, etc., the electronic device updates the arrangement data of the first arrangement based on the relationship, which may include: in the arrangement data of the first arrangement, the electronic device updates the first position information of the first element to the preset position information. For example, assuming that the desktop of the electronic device includes a negative screen and a screen, the preset position information may be the position of the newly added screen of the desktop, for example, the preset position information is the position of the three screens of the desktop. In this way, when the first element does not belong to the second arrangement, the position of the first element on the desktop can avoid affecting the second arrangement, and on the basis of improving the accuracy of restoring the desktop arrangement to the second arrangement, avoid affecting the user's use of the first element.
[0011] In one possible implementation, the desktop layout restoration method may further include: if the second element is a container type, such as a folder or a card stack, indicating that the second element can be directly reconstructed, the electronic device may reconstruct the second element as the new first element, and the electronic device may construct second position information of the second element as the position information of the new first element; the electronic device may then add the new first element and its first position information to the layout data of the first layout. In this way, if the second element does not belong to the first layout and the second element can be directly reconstructed, the electronic device may reconstruct the second element and its position information as the new first element and its position information, which can further improve the accuracy of restoring the desktop layout to the second layout.
[0012] In a possible implementation, the arrangement data of the first arrangement may include first position information of multiple first elements on the desktop, for example, including first element 1, second element 2 and third element 3, and the arrangement data of the second arrangement may include second position information of multiple second elements on the desktop. The electronic device may update the arrangement data of the first arrangement based on the relationship between the multiple first elements and each second element, for example, the first element 1 is the same as the second element 1, the first element 2 is different from any second element, the first element 3 is also different from any second element, and the second element 2 belongs to a container type, and the second element 3 does not belong to a container type. In the arrangement data of the first arrangement, the electronic device may update the first position information of the first element 1 to the second position information of the second element 1, and update the first position information of the first element 2 and the first position information of the first element 3 to the preset position information, and reconstruct the second element 2 as the new first element, and reconstruct the second position information of the second element 2 as the first position information of the new first element, and finally update the new first element and its first position information to the arrangement data of the first arrangement to obtain the final updated arrangement data of the first arrangement. In this way, the user's use of the first element can be improved while ensuring that the desktop is accurately restored to the second layout, which is beneficial to improving the user experience.
[0013] In one possible implementation, the user's restoration operation for the second arrangement may include the user's triggering operation for the preview function of the second arrangement. Accordingly, the electronic device displays the desktop including the updated first arrangement based on the arrangement data of the updated first arrangement, which may include: the electronic device displays a preview interface of the desktop including the updated first arrangement based on the arrangement data of the updated first arrangement; then the user can trigger the application function of the second arrangement, for example, the preview interface includes an application control, and the user can click the application control to trigger the application function of the second arrangement, and the electronic device can display the desktop including the updated first arrangement based on the arrangement data of the updated first arrangement in response to the application operation for the second arrangement. In this way, the updated first arrangement obtained based on the second arrangement can be previewed to the user first, so that the user can see whether it meets his or her needs, which can improve the user experience.
[0014] In one possible implementation, the desktop layout restoration method may further include: the electronic device backing up the layout data of the first layout. Thus, when the layout data of the first layout is updated based on the layout data of the second layout, the electronic device also backs up the original, unupdated layout data of the first layout. This facilitates data recovery of the first layout in the event of an update error, allowing the layout data of the first layout to be updated again based on the layout data of the second layout. Furthermore, if the user only needs to preview the second layout, the desktop can be restored to the first layout, thereby improving the user experience.
[0015] In one possible implementation, the user's restore operation on the second arrangement may include the user's triggering operation of the preview function of the second arrangement. Accordingly, the electronic device displays the desktop including the updated first arrangement based on the updated arrangement data of the first arrangement, which may include: the electronic device displays a preview interface of the desktop including the updated first arrangement based on the updated arrangement data of the first arrangement; then the user can trigger the cancel function of the second arrangement, for example, the preview interface includes a cancel control, the user can click the cancel control to trigger the cancel function of the second arrangement, and the electronic device can replace the updated arrangement data of the first arrangement based on the backed-up arrangement data of the first arrangement in response to the cancel operation on the second arrangement.
[0016] In this way, the updated first layout based on the second layout can be previewed to the user first, so that the user can check whether it meets his or her needs. In the case that the user only has a preview requirement for the second layout, it indicates that the desktop still needs to apply the first layout. The layout data of the updated first layout can be replaced based on the backup layout data of the first layout, that is, rolling back to the original first version, which can meet user needs and improve their user experience.
[0017] In one possible implementation, updating the arrangement data of the first arrangement based on the arrangement data of the second arrangement may include: the electronic device updating the arrangement data of the first arrangement stored in a cache based on the arrangement data of the second arrangement. In this way, the arrangement data of the first arrangement in the cache is directly updated. When the electronic device applies the updated desktop of the first arrangement, the updated arrangement data of the first arrangement in the memory can be directly used without having to load it into the memory. This can increase the speed of restoring the desktop layout and improve the desktop performance of the electronic device.
[0018] In a second aspect, the present application provides an electronic device comprising a memory and a processor; the memory stores computer program code, the computer program code comprising computer instructions; one or more processors call the computer instructions to enable the electronic device to execute the desktop layout restoration method of the first aspect above.
[0019] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the desktop layout restoration method of the first aspect is implemented.
[0020] In a fourth aspect, the present application provides a computer program product, which includes a computer program code. When the computer program code is executed by an electronic device, the desktop layout restoration method of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flowchart of a desktop layout restoration method in the related art;
[0022] Figure 2 A flowchart of a desktop layout restoration method provided in an embodiment of the present application;
[0023] Figure 3 This is an application scenario diagram of a desktop layout restoration method provided in an embodiment of the present application;
[0024] Figure 4a A signaling interaction diagram for the historical arrangement preview phase provided in an embodiment of the present application;
[0025] Figure 4b A signaling interaction diagram of the historical arrangement application stage provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the description of the following embodiments clear and concise, the vocabulary involved in the embodiments of the present application is first explained. It should be understood that this explanation is for a clearer understanding of the embodiments of the present application and does not necessarily constitute a limitation of the embodiments of the present application.
[0027] Desktop layout refers to the arrangement of elements such as application icons, folders, and card stacks on the desktop. The current desktop layout (also called the first layout) refers to the arrangement of application icons, folders, and card stacks currently used on the desktop, while the historical desktop layout refers to the arrangement of elements previously used on the electronic device's desktop.
[0028] Historical arrangement data table: used to store data related to the historical arrangement of the desktop. For example, the historical arrangement data table can store the identification information and position information (also called second position information) of elements such as application icons. The identification information of an element refers to the information used to uniquely identify the element, and the position information refers to the position of the element on the desktop, such as the screen information, row information, and column information where the application icon is located. Figure 4a and Figure 4b The historical arrangement data table may also be referred to as the arrangement data of the second arrangement.
[0029] It should be noted that the historical arrangement data table is only a form of storing historical arrangement data, and this application does not limit this.
[0030] The following is a comparative explanation of the technical advantages of a desktop layout restoration method provided by this application in combination with related technologies.
[0031] In related technologies, such as Figure 1 As shown, after the electronic device's desktop is started, the historical arrangement data table is loaded from the desktop database into the cache. Then, the electronic device can use the historical arrangement data table as a reference to update the historical arrangement data table in the cache with new elements such as newly added applications and deleted elements such as uninstalled applications in the current arrangement of the desktop. In the case where a user operation triggers the historical arrangement preview function of the desktop, the electronic device can preview the historical arrangement to the user based on the historical arrangement data table in the cache. Subsequently, when the user triggers the application function of the historical arrangement of the desktop, the electronic device can restore the current arrangement of the desktop to the historical arrangement.
[0032] However, it has been found that when an electronic device loads the historical arrangement data table of the desktop database into the cache, it will occupy the cache and consume loading time. In the case where the electronic device stores multiple sets of historical arrangements, the electronic device may need to waste a lot of time loading the historical arrangement data tables corresponding to the multiple sets of historical arrangements, and it will also occupy more cache, which can easily reduce the restoration speed of the desktop arrangement, and thus affect the desktop performance of the electronic device.
[0033] In addition, electronic devices need to determine the corresponding new elements and deleted elements for multiple sets of historical arrangement data, which makes maintenance more difficult. In general, only one historical arrangement data table corresponding to one set of historical arrangements may be used, which easily increases the power consumption of electronic devices.
[0034] Therefore, in order to solve the above problems, the embodiment of the present application provides a method for restoring the desktop layout, such as Figure 2 As shown. In this method, after the desktop of the electronic device is started, the electronic device does not need to load the historical arrangement data table into the cache first. Instead, when the user operation triggers the historical arrangement preview function, for a set of historical arrangements triggered by the user, the electronic device queries the corresponding historical arrangement data table from the desktop database, updates the current arrangement data in the cache (also referred to as the arrangement data of the first arrangement) based on the identification information and position information of the elements stored therein, and previews the updated current arrangement data (also referred to as the updated arrangement data of the first arrangement) to the user. Finally, when the user triggers the historical arrangement application function of the desktop, the electronic device can apply the updated current arrangement data.
[0035] In this way, based on the user's triggering operation on a set of historical desktop arrangements, the historical arrangement data table can be queried accordingly, and based on this, the current arrangement data in the cache can be directly updated. The electronic device does not need to load the historical arrangement data table into the cache, which can reduce the occupancy of the electronic device cache and also save the electronic device from wasting time loading the historical arrangement data table. Therefore, the desktop arrangement restoration method provided by this application can increase the speed of desktop arrangement restoration, thereby improving the desktop performance of the electronic device.
[0036] In addition, when an electronic device stores multiple sets of historical arrangements, when a user operation triggers any set of historical arrangements, the electronic device only needs to query the historical arrangement data table corresponding to the set of historical arrangements without considering other sets of historical arrangements, which facilitates maintenance.
[0037] In order to enable people skilled in the art to more clearly understand the solution of the present application, the application scenario of the technical solution of the present application is first described below.
[0038] Take the electronic device as a mobile phone 100 as an example. Figure 3 As shown, the mobile phone 100 displays a history arrangement interface 310, which can be used to display history arrangement thumbnails 311, such as Figure 3 The two historical arrangement thumbnails shown may be named Historical Arrangement 1 and Historical Arrangement 2 respectively. The names may be user-defined or generated by the electronic device by default. This application does not limit this.
[0039] In some embodiments, the mobile phone 100 can display a desktop. The user can pinch the desktop with two fingers. In response to the user's pinching operation on the desktop, the mobile phone 100 can display personalized controls, setting controls, etc. on the desktop. For example, these controls can be displayed at the bottom of the desktop. The personalized controls can be used to enter the desktop arrangement interface. The user can click the personalized controls, and the mobile phone 100 can enter the desktop arrangement interface in response to the user's click. The desktop arrangement interface can display a history arrangement control, etc. The history arrangement control can be used to enter the history arrangement interface described above. The user can click the history arrangement control, and the mobile phone 100 can enter the history arrangement interface in response to the user's click.
[0040] It should be noted that the present application does not limit the manner in which the mobile phone 100 enters the history arrangement interface. The mobile phone 100 may also display a negative one screen interface, which provides a global search function and can provide the user with a rich set of online search services, as well as local resource search services of the mobile phone 100. For example, the negative one screen interface may include a search box, in which the user may enter the search text "history arrangement", and the mobile phone 100 may perform an online search based on the search text entered by the user. When the search is completed, the mobile phone 100 may display a search result display interface, and the search result display interface 430 may display a history arrangement control, etc. The user clicks on the history arrangement control, and the mobile phone 100 may also enter the history arrangement interface in response to the user's click operation.
[0041] It should be noted that this application does not limit the user's triggering operations on the desktop, personalized controls, and historical arrangement controls, etc., which can be user click triggering, sliding triggering, or voice triggering, etc.
[0042] Each historical arrangement thumbnail displayed on the historical arrangement interface 310 has a corresponding historical arrangement data table. The historical arrangement data table may be stored in a desktop database. The historical arrangement data table includes identification information and position information of each element included in the historical arrangement thumbnail.
[0043] Continue to see Figure 3 As shown, when the user has a preview requirement for the historical arrangement thumbnail of historical arrangement 2, the user can trigger the historical arrangement thumbnail, for example, by clicking on the historical arrangement thumbnail. In response to the user's triggering operation, the mobile phone 100 can obtain the historical arrangement data corresponding to historical arrangement 2 from the desktop database. Then, the mobile phone 100 can update the current arrangement data of the desktop in the cache based on the identification information and location information of the elements in the historical arrangement data. Subsequently, the mobile phone 100 can enter the preview interface 320 of the historical arrangement thumbnail based on the updated current arrangement data in the cache, and the user can preview historical arrangement 2, which includes elements such as a card stack 321, an application icon 322, and a folder 323.
[0044] In addition, the above-mentioned user triggering the historical arrangement thumbnail and the mobile phone 100 obtaining the historical arrangement data corresponding to the historical arrangement 2 from the desktop database in response to the user's triggering operation are only examples. The historical arrangement interface 310 may also display a preview control of the historical arrangement thumbnail (not shown in the figure), and the user triggers the preview control of the historical arrangement thumbnail, and the mobile phone 100 obtains the historical arrangement data corresponding to the historical arrangement 2 from the desktop database in response to the user's triggering operation; or the historical arrangement interface 310 may also display an application control of the historical arrangement thumbnail (not shown in the figure), and the user triggers the application control of the historical arrangement thumbnail, and the mobile phone 100 obtains the historical arrangement data corresponding to the historical arrangement 2 from the desktop database in response to the user's triggering operation. This application does not limit this. Any operation described above that triggers the mobile phone 100 to obtain the historical arrangement data corresponding to the historical arrangement 2 from the desktop database can be called a restore operation for the second arrangement.
[0045] Correspondingly, the historical arrangement interface 310 also displays the application control of the historical arrangement thumbnail. In the example where the user triggers the application control of the historical arrangement thumbnail, the mobile phone 100 responds to the user's trigger operation, obtains the historical arrangement data corresponding to the historical arrangement 2 from the desktop database, and then updates the current arrangement data of the desktop in the cache based on the identification information and position information of the elements in the historical arrangement data, and then enters the application interface of the historical arrangement thumbnail based on the updated current arrangement data in the cache, that is, there is no need to preview, and directly enter the desktop where the historical arrangement is applied (not shown in the figure).
[0046] It should be noted that the detailed process of previewing the historical arrangement thumbnail in response to the user's triggering operation on the historical arrangement thumbnail by the mobile phone 100 can be found in the following. Figure 4a and Figure 4b The introduction of the corresponding embodiments will not be expanded here.
[0047] Continue to see Figure 3 As shown, the preview interface 320 of the historical arrangement thumbnail can display the desktop, and the arrangement of the various elements on the desktop is obtained based on the historical arrangement 2. The preview interface 320 of the historical arrangement thumbnail can also display an application control 324 and a cancel control 325. The application control is used to apply the previewed historical arrangement 2 to the desktop, so that the mobile phone 100 returns to the desktop, and the arrangement of the various elements on the desktop is the same as that displayed on the preview interface 320; the cancel control is used to apply the unupdated current cached data to the desktop, so that the mobile phone 100 returns to the desktop, and the arrangement of the various elements on the desktop is the same as before the mobile phone 100 enters the preview interface 320.
[0048] like Figure 3As shown, the user clicks on the application control, and the mobile phone 100 can enter the desktop 330 in response to the user's click operation, and the arrangement of its various elements is the same as that displayed on the preview interface 320.
[0049] In addition, the user clicks the cancel control, and the mobile phone 100 can return to the history arrangement interface 310 (not shown in the figure) in response to the user's click operation.
[0050] Next, combine Figure 4a and Figure 4b The desktop layout restoration method provided by the embodiment of the present application is described in detail.
[0051] In some embodiments, the software system of the electronic device may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
[0052] For example, the Android system, which uses a layered architecture for electronic device software, divides the software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Android system can be divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0053] In some embodiments, the application layer may include a desktop application launcher, a data management class DatabaseLayoutFactory, a basic layout management class AbstractLayoutFactory, a data processing class OriginalLauncherModel, an application layout management class WisdomLayoutManager, and a desktop database.
[0054] The desktop application is responsible for managing and displaying the layout of various elements on the desktop, such as application icons, folders, and card stacks.
[0055] The Data Management class is responsible for restoring the historical layout of the desktop, including querying the name of the historical layout data table and updating the current layout data based on the historical layout data table. The Data Management class is a subclass of the Basic Layout Management class.
[0056] The basic layout management class is used to manage the basic layout of the desktop, including backing up the current layout data.
[0057] The data processing class is used to process desktop-related data and can interact with the desktop database, including querying historical arrangement data tables from the desktop database, creating new folders and card stacks, and other elements.
[0058] The application layout management class is used to manage the application layout of the desktop, including updating the desktop layout applied by the user to the desktop database.
[0059] The desktop database is used to store data related to the electronic device desktop. For example, the desktop database may store a historical arrangement data table, a current arrangement data table storing current arrangement data, and the like. The historical arrangement data table may include identification information and location information for elements (referred to as second elements) such as the name, application icon, folder, and card stack of the historical arrangement data table. The current arrangement data table is similarly described and will not be further elaborated. The location information of elements (referred to as first elements) in the current arrangement data may be referred to as (first location information).
[0060] It should be noted that the detailed functions of the above desktop applications, data management, basic layout management, data processing, application layout management and desktop database can be found below. Figure 4a and Figure 4b The corresponding embodiments will not be introduced here.
[0061] The desktop layout restoration method may include a historical layout preview phase and a historical layout application phase.
[0062] like Figure 4a As shown, the historical arrangement preview stage may include the following steps:
[0063] S401: The desktop application sends a desktop layout restoration event to the data management class in response to a user triggering operation on a historical layout thumbnail.
[0064] like Figure 3 As shown, the history arrangement interface 310 can display multiple history arrangement thumbnails 311, and the user can trigger any one of the history arrangement thumbnails.
[0065] In some embodiments, the user's triggering operation for the historical arrangement thumbnail (also referred to as the triggering operation for the preview function of the second arrangement) can be the user clicking a historical arrangement thumbnail with their finger, or the user clicking the historical arrangement thumbnail with a stylus. This application does not limit the triggering operation for the historical arrangement thumbnail.
[0066] In some embodiments, a desktop layout restore event may carry identification information of a historical layout thumbnail.
[0067] Exemplarily, the identification information of the historical arrangement thumbnail can be the time when the user stored the historical arrangement corresponding to the historical arrangement thumbnail. For example, a historical arrangement thumbnail corresponds to historical arrangement 1, and the time when the user stored historical arrangement 1 is 14:20:35 on August 20, 2024, and the identification information of the historical arrangement thumbnail is this time.
[0068] It should be noted that this application does not limit the identification information of the historical arrangement thumbnail, and it can be used to uniquely identify the historical arrangement 1.
[0069] S402: The data management class obtains the current desktop layout data from the cache in response to the desktop layout restoration event.
[0070] Cache can be used to temporarily store data for frequent access. For example, the cache can be a cache in a random access memory (RAM). When the electronic device is turned off or powered off, the cache can be cleared.
[0071] In some embodiments, after the electronic device is started, the current layout data stored in the desktop database can be loaded into the cache. Therefore, accordingly, the data management class can obtain the current layout data of the desktop from the cache.
[0072] In some embodiments, the current arrangement data may include identification information and position information of each element of the desktop.
[0073] The identification information of an element is used to uniquely identify the element, making it easier to distinguish different elements. For example, the identification information can be an identifier ID assigned to the element by an electronic device, etc.
[0074] For example, the elements of the desktop include application icon 1, application icon 2, folder 1 and card stack 1, and the identification information corresponding to each of them may be IDA1, IDA2, IDF1 and IDC1.
[0075] The position information is used to indicate the position of an element on the desktop. For example, the position information may include screen information, row information, and column information.
[0076] Screen information refers to the area of an element on the desktop, which can be expressed as "screen". For example, the desktop includes the negative one screen, the first screen, and the second screen. The negative one screen refers to the leftmost screen area of the desktop and can be expressed as "screen:-1". The first screen refers to the first screen area of the desktop, located to the right of the negative one screen, and can be expressed as "screen:1". The second screen refers to the second screen area of the desktop, located to the right of the first screen, and can be expressed as "screen:2".
[0077] The row information refers to the number of rows in the screen area of the desktop, which can be expressed as x. For example, if the desktop is 7×4, the row information is used to indicate that the element is in the 6th row among the 7 rows, which can be expressed as x:6.
[0078] The column information refers to the number of columns in the screen area of the desktop, which can be expressed as y. For example, if the desktop is 7×4, the column information is used to indicate that the element is in the third column among the four columns, which can be expressed as y:3.
[0079] For example, Figure 3 As shown, the location information of the application icon of the gallery application in the preview interface 320 includes: screen: 1, (3, 3), indicating that the application icon of the gallery application is in the 3rd row and 3rd column of one screen on the desktop, and its identification information may be ID: IDA5.
[0080] It should be understood that when a user triggers the historical arrangement thumbnail, the user may have a need to restore the current arrangement of the desktop to the historical arrangement, or may only have a need to preview the historical arrangement, and this application will subsequently update the current arrangement data in the cache.
[0081] Therefore, in order to meet the user's demand of only previewing the historical layout, that is, when the desktop still uses the current layout, the data management class can obtain the current layout data of the desktop from the cache so that it can be backed up later.
[0082] S403: The data management class sends the current layout data to the basic layout management class.
[0083] The data management class sends the current layout data of the desktop obtained from the cache to the basic layout management class.
[0084] S404: The basic layout management class backs up the current layout data.
[0085] The basic layout management class can back up the current layout data, that is, store the current layout data.
[0086] In some embodiments, the basic arrangement management class includes a data structure iteminfo, which is used to store the position information and identification information of each element in the current arrangement. For example, one element may correspond to one iteminfo.
[0087] Exemplarily, for each element, the basic layout management class may add a field called backup to its corresponding iteminfo, where backup is used to store the position information and identification information of the element in the current layout data.
[0088] It should be noted that the field backup is only an example, and other fields can also be added. This application does not limit this.
[0089] S405: The data management class queries to obtain the name of the historical arrangement data table corresponding to the historical arrangement thumbnail.
[0090] In some embodiments, the data management class stores the correspondence between the name of the historical arrangement data table and the identification information of the historical arrangement thumbnail. Based on the introduction of S401, the desktop arrangement restoration event includes the identification information of the historical arrangement thumbnail. The data management class can query the name of the historical arrangement data table with the corresponding relationship based on the identification information of the historical arrangement thumbnail.
[0091] For example, the identification information of the historical arrangement thumbnail of historical arrangement 1 is time 1, the name of the historical arrangement data table of historical arrangement 1 is table 1, and table 1 has a corresponding relationship with time 1; the identification information of the historical arrangement thumbnail of historical arrangement 2 is time 2, the name of the historical arrangement data table of historical arrangement 2 is table 2, and table 2 has a corresponding relationship with time 2.
[0092] Correspondingly, the user operation triggers the historical arrangement thumbnail of historical arrangement 1, and the data management class can receive the desktop arrangement restoration event, which carries the identification information of time 1. The data management class can query and obtain the name table 1 corresponding to time 1.
[0093] S406: The data management class sends a historical arrangement data table query request to the data processing class.
[0094] In some embodiments, the historical arrangement data table query request carries the name of the historical arrangement data table.
[0095] In the example where the name of the historical arrangement data table of historical arrangement 1 is Table 1, the historical arrangement data table query request may carry Table 1.
[0096] S407: The data processing class responds to the historical arrangement data table query request and obtains the historical arrangement data table from the desktop database.
[0097] In some embodiments, the desktop database stores multiple historical arrangement data tables, and different historical arrangement data tables have different names.
[0098] After receiving the historical arrangement data table query request, the data processing class can obtain the name of the historical arrangement data table it carries, and then the data processing class can query the corresponding historical arrangement data table from the desktop database based on the name of the historical arrangement data table.
[0099] S408: The data processing class sends the historical arrangement data table to the data management class.
[0100] S409: The data management class updates the position information of the elements in the current arrangement data in the cache based on the historical arrangement data table.
[0101] Based on the above introduction, the historical arrangement data table includes the position information and identification information of each element in the historical arrangement.
[0102] In some embodiments, for each element of the historical arrangement data table, the data management class can determine whether the current arrangement data in the cache has the same identification information based on its identification information (that is, obtain the relationship between the first element and the second element, for example, whether the first element is the same as the second element).
[0103] The data management class determines that the historical arrangement data table and the current arrangement data have the same identification information, indicating that the element with the identification information exists in both the historical arrangement and the current arrangement. The data management class can update the position information of the element in the historical arrangement data to the current arrangement data. In other words, the data management class modifies the position information of the element in the current arrangement data to its position information in the historical arrangement data.
[0104] Exemplarily, the identification information of the instant messaging application is stored both in the historical arrangement data table and in the current arrangement data in the cache. In the historical arrangement data table, the location information of the instant messaging application is screen: 2, (1, 1), and in the current arrangement data, its corresponding location information is screen: 2, (3, 4). The data management class can modify the location information of the instant messaging application in the current arrangement data to screen: 2, (1, 1), indicating that the application icon of the instant messaging application included in the desktop is moved to the first row and first column of the second screen, which is the same as the location information of the instant messaging application in the historical arrangement.
[0105] The data management class determines that identification information does not exist in the historical arrangement data table but exists in the current arrangement data, indicating that the element with this identification information does not exist in the historical arrangement but exists in the current arrangement. It is an element added after the historical arrangement is saved. The data management class can also modify the position information of the element.
[0106] Exemplarily, the data management class can arrange the elements in sequence on the newly added screen of the desktop (that is, update the first position information of the first element to the preset position information). For example, the desktop includes a negative screen, a first screen, and a second screen, and the element is the first element determined by the data management class that does not exist in the historical arrangement but exists in the current arrangement. The data management class can modify its position information to screen: 3, (1, 1). If the element is the second element determined by the data management class that does not exist in the historical arrangement but exists in the current arrangement, the data management class can modify its position information to screen: 3, (1, 2), and so on.
[0107] It should be noted that the data management class can arrange the elements in sequence on the newly added screen of the desktop is only an example. The data management class can also arrange them on the last existing screen of the desktop. For example, the data management class first updates the position information of elements of other classes, and finally updates the position information of the newly added elements after this historical arrangement is saved, and arranges them on the last existing screen of the desktop.
[0108] For example, if the desktop includes a negative screen, a first screen, and a second screen, the position information of elements of other classes has been updated, and the position information of the last element arranged in the second screen is screen: 2, (4, 3). Assuming the second screen is 7×4, for the first element that does not exist in the historical layout but exists in the current layout, the data management class can modify its position information to screen: 2, (4, 4), and so on, until there is no space for the second screen. The next element of this class can be arranged in order on the newly added screens of the desktop.
[0109] In this way, it is possible to prevent elements that do not exist in the historical arrangement but exist in the current arrangement from affecting the positions of elements in the historical arrangement, thereby ensuring the accuracy of desktop layout restoration.
[0110] For elements that exist in the historical arrangement data table but do not exist in the current arrangement data, please refer to the introduction of S410.
[0111] S410: The data management class determines that a target element exists, and sends an object construction request of the target element to the data processing class.
[0112] The target element refers to an element of the container type, and its identification information exists in the historical arrangement data table but does not exist in the current arrangement data.
[0113] By way of example, container-type elements include folders, card stacks, and the like.
[0114] That is, the data management class determines that the identification information in the historical arrangement data table does not exist in the current arrangement data, indicating that the element with this identification information exists in the historical arrangement but not in the current arrangement. It is an element that was deleted after the historical arrangement was saved.
[0115] It should be understood that among the elements that are deleted after this type of historical arrangement is saved, for elements belonging to the application icon type, their corresponding applications have been uninstalled, and the historical arrangement does not need to include this element.
[0116] For example, the application icon of a game application exists in the historical arrangement, but it has been uninstalled. If the user needs to restore the current arrangement to the historical arrangement, there is no need to arrange the game application again, and the position of the application icon of the game application on the desktop can be vacant.
[0117] However, elements of container type can be reconstructed. Therefore, the data management class determines that the target element exists and sends an object construction request of the target element to the data processing class.
[0118] S411: The data processing class reconstructs iteminfo in response to the object construction request of the target element.
[0119] In some embodiments, the object construction request carries identification information and location information of the target element. The data processing class can reconstruct iteminfo based on the identification information and location information.
[0120] For example, the data processing class may construct a data structure builditeminfo, where iteminfo includes identification information and location information of the target element, such as iteminfo: ID: IDA1, screen: -1, (1, 1).
[0121] S412: The data processing class sends iteminfo to the data management class.
[0122] S413: The data management class adds iteminfo to the current arrangement data in the cache.
[0123] Iteminfo includes identification information and location information of the corresponding target element. The data processing class adds iteminfo to the current arrangement data in the cache to obtain the updated current arrangement data. The updated current arrangement data can correspond to the historical arrangement thumbnail triggered by the user.
[0124] It should be noted that S410-413 are optional execution steps. When the data management class determines that the target element does not exist, these steps do not need to be executed. After the data management class executes S409, it can directly execute S414.
[0125] S414: The data management class outputs the updated current layout data in the cache.
[0126] In some embodiments, the data management class can integrate the updated current layout data in the cache and output the elements on the same screen together.
[0127] For example, the data management class can output the identification information and location information of each element included in the negative first screen of the desktop, the identification information and location information of each element included in the first screen, and the identification information and location information of each element included in the second screen.
[0128] S415: The data management class updates the desktop based on the output updated current layout data.
[0129] The data management class can update the desktop accordingly based on the output updated current layout data, so that the desktop layout corresponds to the updated current layout data, which is convenient for users to preview.
[0130] like Figure 4b As shown, the historical arrangement application stage may include the following steps:
[0131] S416: The desktop application sends a historically arranged application event to the application arrangement management class in response to the user's triggering operation on the application control.
[0132] like Figure 3 As shown, the preview interface 320 of the historical arrangement thumbnails may include an application control 324, and the user may trigger the application control 324. The user's triggering operation may refer to the relevant introduction of S401, and this application does not limit this.
[0133] The user's triggering operation on the application control may also be referred to as a triggering operation on the second arrangement of application functions.
[0134] S417: The application arrangement management class updates the updated current arrangement data in the cache to the desktop database in response to the historical arrangement application event.
[0135] In some embodiments, the data management class can store the current arrangement data, for example, the current arrangement data table. This application does not limit its storage form.
[0136] The application arrangement management class receives the application event of the historical arrangement, indicating that the current arrangement of the desktop has been determined to be updated. The data management class can update the updated current arrangement data in the cache to the desktop database.
[0137] In this way, after the desktop of the electronic device is restarted, the electronic device can use the latest current layout data on the desktop.
[0138] S418: Applying the layout management class outputs the updated current layout data in the cache.
[0139] S419: The application layout management class updates the desktop based on the output updated current layout data.
[0140] It should be noted that the introduction of S418-S419 can be found in the implementation of S414-S415, and will not be repeated here.
[0141] In this way, when the user previews multiple historical arrangement thumbnails, it can be ensured that the final display of the desktop meets the user's needs, that is, the updated current arrangement obtained based on the set of historical arrangements triggered by the user application control is displayed.
[0142] In addition, the history arrangement interface 310 introduced above also displays the application control of the history arrangement thumbnail. In the example where the user triggers the application control of the history arrangement thumbnail, S401 can be: the desktop application responds to the user's triggering operation on the application control of the history arrangement thumbnail, and sends a desktop arrangement restore event to the data management class, and then S402-S413 and S417-S419 can be executed. The difference is that the history arrangement application event of S417 can be sent by the data management class to the application arrangement management class.
[0143] In addition, after previewing the historical layout thumbnails, the user may still want to keep the current layout on the desktop. In this case, after executing 401-S415 above, perform the following steps 1-4:
[0144] Step 1: In response to the user's triggering operation of canceling the control, the desktop application sends an application event of the current layout to the basic layout management class.
[0145] like Figure 3 As shown, the preview interface 320 of the historical arrangement thumbnails may include a cancel control 325, and the user may trigger the cancel control 325. The user's triggering operation may refer to the relevant introduction of S401, and this application does not limit this.
[0146] The user's triggering operation on the cancel control may also be referred to as a triggering operation on the cancel function of the second arrangement.
[0147] Step 2: The basic layout management class responds to the application event of the current layout and outputs the backed-up current layout data.
[0148] Based on the introduction in S404 , the basic layout management class has backed up the current layout data. After receiving the application event of the current layout, the basic layout management class can output the backed-up current layout data.
[0149] Step 3: The basic layout management class updates the desktop based on the output current layout data.
[0150] It should be noted that the introduction of step 2 and step 3 can be found in the implementation of S414-S415 and will not be repeated here.
[0151] Step 4: The basic layout management class updates the current layout data to the cache.
[0152] The basic layout management class can replace the updated current layout data in the cache with the backed-up current layout data.
[0153] In this way, the desktop layout restoration method provided in the embodiment of the present application does not need to load the historical layout data table stored in itself into the cache, but can update the current layout data in the cache, which not only reduces the loading time, but also reduces the cache occupancy, and can increase the desktop layout restoration speed, thereby improving the desktop performance of the electronic device.
[0154] In addition, for multiple sets of historical arrangements stored in the electronic device, it is only necessary to store the corresponding historical arrangement data tables in the desktop database respectively, which is convenient for maintenance.
[0155] It should be noted that the electronic device in the above embodiment is a mobile phone for illustrative purposes only. In some embodiments, the electronic device may be a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or other terminal device. This application does not impose any particular restrictions on the specific form of the above electronic devices.
[0156] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement one or more steps in any of the above-mentioned methods for restoring a desktop layout.
[0157] The computer readable storage medium may be a non-transitory computer readable storage medium, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0158] Another embodiment of the present application further provides a computer program product comprising instructions, which, when executed by a computer, can implement one or more steps in any of the above-mentioned methods for restoring a desktop layout.
[0159] The electronic device, computer-readable storage medium, and computer program product provided in this embodiment are all used to execute the corresponding desktop layout restoration method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding desktop layout restoration method provided above, and will not be repeated here.
[0160] The terms "first", "second" and "third" in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0161] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0162] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for restoring a desktop layout, characterized in that: include: Displaying a desktop including a first arrangement; In response to the restoration operation on the second arrangement, acquiring arrangement data of the second arrangement; The arrangement data of the second arrangement includes second position information of the second element on the desktop; Based on the arrangement data of the second arrangement, updating the arrangement data of the first arrangement; the arrangement data of the first arrangement includes first position information of the first element on the desktop; Based on the updated arrangement data of the first arrangement, a desktop including the updated first arrangement is displayed.
2. The method according to claim 1, characterized in that The updating of the arrangement data of the first arrangement based on the arrangement data of the second arrangement includes: Obtaining the relationship between the first element and the second element; Based on the relationship, the arrangement data of the first arrangement is updated.
3. The method according to claim 2, characterized in that The relationship is that the first element is the same as the second element; and updating the arrangement data of the first arrangement includes: In the arrangement data of the first arrangement, the first position information of the first element is updated to the second position information of the second element.
4. The method according to claim 2, characterized in that The relationship is that the first element is different from the second element; and updating the arrangement data of the first arrangement includes: In the arrangement data of the first arrangement, the first position information of the first element is updated to preset position information.
5. The method according to claim 4, characterized in that Also includes: Determining that the second element belongs to a container type, constructing the second element as a new first element, and constructing second position information of the second element as first position information of the new first element; The new first element and the first position information of the new first element are updated to the arrangement data of the first arrangement.
6. The method according to any one of claims 1 to 5, characterized in that The restoring operation for the second arrangement includes triggering the preview function for the second arrangement, and the displaying of the desktop including the updated first arrangement based on the arrangement data of the updated first arrangement includes: Based on the updated layout data of the first layout, displaying a preview interface of the desktop including the updated first layout; The method further comprises: In response to a triggering operation on the application function of the second arrangement, a desktop including the updated first arrangement is displayed based on the arrangement data of the updated first arrangement.
7. The method according to any one of claims 1 to 5, characterized in that Also includes: Back up the arrangement data of the first arrangement.
8. The method according to claim 7, characterized in that The restoring operation for the second arrangement includes triggering the preview function for the second arrangement, and the displaying of the desktop including the updated first arrangement based on the arrangement data of the updated first arrangement includes: Based on the updated layout data of the first layout, displaying a preview interface of the desktop including the updated first layout; The method further comprises: In response to a triggering operation of a cancel function for the second arrangement, the updated arrangement data of the first arrangement is replaced based on the backup arrangement data of the first arrangement.
9. The method according to any one of claims 1 to 8, characterized in that The updating of the arrangement data of the first arrangement based on the arrangement data of the second arrangement includes: Based on the arrangement data of the second arrangement, the arrangement data of the first arrangement stored in the cache is updated.
10. An electronic device, characterized in that: including memory and processor; The memory is coupled to the processor, and is used to store computer program code, wherein the computer program code includes computer instructions, and one or more processors call the computer instructions to enable the electronic device to execute the desktop layout restoration method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for restoring a desktop layout according to any one of claims 1 to 9 is implemented.
12. A computer program product, characterized in that The method comprises computer program codes, which, when executed by an electronic device, implement the steps of the desktop layout restoration method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Desktop layout storage and recovery method and device thereof, terminal equipment and system
CN104915268A
Desktop layout switching method and electronic equipment
CN117724782A
Desktop layout method and apparatus, and electronic device
US20230221846A1