Page return method, device, mobile terminal and storage medium
By setting back attribute marks for the page and indexing them based on these marks, the problems of low page backing efficiency and low accuracy in the prior art are solved, and a more efficient and accurate page backing operation is achieved.
Patent Information
- Application Number
- CN202011537230.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-23
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2040-12-23
AI Technical Summary
The prior art has low efficiency and low accuracy when returning pages, especially when browsing more pages, traversing all pages or comparing mark attributes leads to an increase in the system burden and inaccurate matching.
By setting back attribute marks on the page and indexing them according to these attribute marks, avoiding traversing all browsing pages and improving system response efficiency; at the same time, page matching is done through back attribute marks to ensure the accuracy of the match.
Improves the efficiency and accuracy of page return, reduces the system burden, and avoids matching errors.
Smart Images

Figure CN114662023B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile terminal technology, and in particular to a method, device, mobile terminal and storage medium for page return. Background Art
[0002] With the popularity of mobile devices, people use mobile devices to browse information more and more frequently in their daily lives. When they need to return to the last browsed page during the browsing process, they usually only need to click the return button on the screen to return to the previous page. If they want to choose multiple levels of return pages, they often have to click the return button continuously to return to the multiple levels of return pages.
[0003] In order to solve the problem that returning to multiple levels of pages cannot return to the page the user wants to return to at once, the technology used in the prior art is generally to traverse all pages in the navigation controller, compare each page to see if it is the return page specified by the user, and after the comparison is successful, get the reference of the specified page and then return to the specified page; or create a subclass of the view controller, add a mark attribute to the subclass, set the value of the mark attribute in advance for the page that needs to be returned to multiple levels, compare the mark attribute during the traversal process, and return to the specified page if the comparison is successful.
[0004] The disadvantages of the above two solutions are that they both require traversing all the page data in the navigation controller, which is inefficient when there are many page data; or when there are many page types, it is impossible to accurately determine which page needs to be rolled back, which leads to problems; or when multiple different pages of the same type need to be distinguished, inheritance is required, which increases the cost of use. This makes the existing technology inefficient and inaccurate when rolling back pages and rolling back multi-level pages.
[0005] In the prior art, all pages that have been browsed are usually traversed to compare whether they are pages that need to be returned; or a subclass of a view controller is created, a tag attribute is added to the subclass, and the value of the tag attribute is set in advance for the page that needs to be returned to in multiple levels, and the tag attribute is compared during the traversal process. If the comparison is successful, the page is returned to the specified page. Although the technical solution in the prior art can perform the page return operation, when there are many browsed pages, the method of returning the page by traversing the browsed pages or traversing and comparing all the tag attributes is low in efficiency and accuracy. Therefore, in order to improve the efficiency and accuracy of the method of returning the page, it becomes a technical problem to be solved. Summary of the invention
[0006] The present application provides a method, device, mobile terminal and storage medium for page return. By setting a return attribute mark for a page and then indexing it according to the set attribute mark, there is no need to traverse all browsing pages, thereby improving system response efficiency; and then through the return attribute mark, it is necessary to match the specified return page with all pages, thereby eliminating the problem of inaccurate matching.
[0007] In one aspect, the present application provides a method for returning a page, which is applied to a mobile terminal, wherein the mobile terminal includes a navigation controller for controlling a page, and the method for returning a page includes:
[0008] When accessing the first page, setting a return attribute mark for the first page;
[0009] When accessing the second page, obtaining a return request of the first page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0010] Return to the first page according to the return attribute mark of the first page through the navigation controller.
[0011] In some embodiments of the present application, before obtaining the return request of the first page when accessing the second page, the method further includes:
[0012] A rollback attribute flag is set for at least one interval page among the plurality of pages.
[0013] In some embodiments of the present application, returning to the first page according to the return attribute mark of the first page by the navigation controller includes:
[0014] Returning, by the navigation controller according to the return attribute mark of the at least one interval page, to the interval page with the earliest access time among the at least one interval page;
[0015] By means of the navigation controller, according to the return attribute mark of the first page, return to the first page from the interval page with the earliest access time.
[0016] In some embodiments of the present application, the page return method further includes:
[0017] When accessing the second page, a non-specified page return request is obtained;
[0018] According to the non-specified page return request, determining, by the navigation controller, a return attribute mark with the last set time in the at least one interval page;
[0019] Return to the interval page corresponding to the last return attribute mark of the set time.
[0020] In some embodiments of the present application, when accessing the first page, setting a return attribute mark for the first page includes:
[0021] When accessing the first page, add a return attribute category to the first page;
[0022] The return attribute mark is added to the return attribute classification.
[0023] In some embodiments of the present application, after adding the return attribute mark to the return attribute classification, the method further includes:
[0024] A preset association function is called to associate a Boolean variable with the first page through a preset unique key, wherein the Boolean variable is used to set the attribute of the return attribute mark.
[0025] In some embodiments of the present application, the mobile terminal includes a navigation stack for storing visited pages; when accessing a first page, after setting a return attribute mark for the first page, the method includes:
[0026] The first page is stored in the navigation stack.
[0027] In some embodiments of the present application, returning to the first page according to the return attribute mark of the first page by the navigation controller includes:
[0028] Acquiring the first page from the navigation stack by the navigation controller according to the return attribute mark of the first page;
[0029] Return to the first page via the navigation controller;
[0030] The first page is deleted from the navigation stack.
[0031] In some embodiments of the present application, at least one interval page among the multiple pages is set with a rollback attribute mark, and after storing the first page in the navigation stack, the method further includes:
[0032] storing the at least one interval page with a return attribute mark in the navigation stack;
[0033] Returning to the first page according to the return attribute mark of the first page by the navigation controller includes:
[0034] Retrieving, by the navigation controller, the at least one interval page from the navigation stack according to the return attribute flag of the at least one interval page, and returning to the interval page with the earliest access time among the at least one interval page;
[0035] deleting the at least one interval page from the navigation stack;
[0036] When on the interval page with the earliest access time among the at least one interval page, returning to the first page according to the return attribute mark of the first page by the navigation controller;
[0037] The first page is deleted from the navigation stack.
[0038] On the other hand, the present application also provides a page return device, which is applied to a mobile terminal, wherein the mobile terminal includes a navigation controller for page control, including:
[0039] A setting module, when accessing the first page, sets a return attribute mark for the first page;
[0040] an acquisition module, which acquires a return request of the first page when accessing the second page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0041] The page return module obtains a page return request after accessing the second page, wherein the page return request includes the return attribute mark information; and returns to the first page according to the return attribute mark of the first page through the navigation controller.
[0042] In some embodiments of the present application, the setting module is also used to:
[0043] When accessing the second page, before obtaining the return request of the first page, a return attribute mark is set for at least one interval page among the multiple pages.
[0044] In some embodiments of the present application, the page return module is specifically used to:
[0045] Returning, by the navigation controller according to the return attribute mark of the at least one interval page, to the interval page with the earliest access time among the at least one interval page;
[0046] By means of the navigation controller, according to the return attribute mark of the first page, return to the first page from the interval page with the earliest access time.
[0047] In some embodiments of the present application, the acquisition module is further used to:
[0048] When accessing the second page, a non-specified page return request is obtained;
[0049] The page return module is specifically used for:
[0050] According to the non-specified page return request, determining, by the navigation controller, a return attribute mark with the last set time in the at least one interval page;
[0051] Return to the interval page corresponding to the last return attribute mark of the set time.
[0052] In some embodiments of the present application, the setting module is specifically used to:
[0053] When accessing the first page, add a return attribute category to the first page;
[0054] The return attribute mark is added to the return attribute classification.
[0055] In some embodiments of the present application, the setting module is further used to:
[0056] After adding the return attribute mark in the return attribute classification, a preset association function is called to associate a Boolean variable to the first page through a preset unique key, and the Boolean variable is used to set the attributes of the return attribute mark.
[0057] In some embodiments of the present application, the mobile terminal includes a navigation stack for storing visited pages; the device also includes a storage module, and the storage module is used to:
[0058] When accessing a first page, after setting a return attribute mark for the first page, the first page is stored in the navigation stack.
[0059] In some embodiments of the present application, the page return module is specifically used to:
[0060] Acquiring the first page from the navigation stack by the navigation controller according to the return attribute mark of the first page;
[0061] Return to the first page via the navigation controller;
[0062] The first page is deleted from the navigation stack.
[0063] In some embodiments of the present application, at least one interval page among the multiple pages is provided with a rollback attribute mark, and the storage module is used to:
[0064] After storing the first page in the navigation stack, storing the at least one page with a return attribute mark set for the interval page in the navigation stack;
[0065] The page return module is specifically used for:
[0066] Retrieving, by the navigation controller, the at least one interval page from the navigation stack according to the return attribute flag of the at least one interval page, and returning to the interval page with the earliest access time among the at least one interval page;
[0067] deleting the at least one interval page from the navigation stack;
[0068] When on the interval page with the earliest access time among the at least one interval page, returning to the first page according to the return attribute mark of the first page by the navigation controller;
[0069] The first page is deleted from the navigation stack.
[0070] On the other hand, the present application also provides a mobile terminal, the mobile terminal comprising:
[0071] one or more processors;
[0072] Memory; and
[0073] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps in the page rollback method.
[0074] On the other hand, the present application also provides a computer-readable storage medium, characterized in that a computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the page return method.
[0075] The present application sets a rollback attribute mark for the page and performs page rollback according to the rollback attribute mark, thereby avoiding traversing all browsed pages, reducing system burden and improving system response time; at the same time, the page rollback operation is performed according to the rollback attribute mark, reducing the steps of comparing and matching the specified page with all pages in the prior art, thereby avoiding matching errors and improving the accuracy of page rollback. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 This is a flow chart of an embodiment of a page return method in an embodiment of the present application;
[0077] Figure 2 This is a flow chart of an embodiment of a page return method in an embodiment of the present application;
[0078] Figure 3This is a flow chart of an embodiment of a page return method in an embodiment of the present application;
[0079] Figure 4 This is a flow chart of applying a navigation stack to advance a page in an embodiment of the present application;
[0080] Figure 5 This is a flowchart of applying a navigation stack to return a page in an embodiment of the present application;
[0081] Figure 6 This is a flowchart of applying the navigation stack to return to a non-specified page in an embodiment of the present application;
[0082] Figure 7 This is a schematic diagram of the structure of an embodiment of a page return device in an embodiment of the present application;
[0083] Figure 8 It is a schematic diagram of the structure of an embodiment of a mobile terminal in the embodiment of the present application. DETAILED DESCRIPTION
[0084] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with specific implementations and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and do not limit the scope of the present application. In addition, the well-known structures and well-known technical descriptions omitted in the following description are to avoid unnecessary confusion of the concepts of the present application.
[0085] The present application can be expressed in many different forms, and the present application should not be interpreted only as the specific embodiments described herein. The embodiments are provided in the present application to explain the practical application of the present application, so that those skilled in the art can understand the various embodiments of the present application and various modifications suitable for specific intended applications.
[0086] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0087] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0088] The following first introduces some basic concepts involved in the embodiments of the present application:
[0089] Runtime technology: Programming languages usually include static languages, such as C, which must decide which function to call during the compilation phase. If the function is not implemented, a compilation error will be reported. It also includes dynamic languages, such as OC (Objective-C), which cannot decide which function to actually call during the compilation phase. As long as the function is declared, no error will be reported even if it is not implemented. The operation of OC code requires not only a compiler, but also a runtime system to execute the compiled code.
[0090] Runtime is a set of low-level pure C language APIs (Application Programming Interface). The OC code will eventually be converted into runtime code by the compiler, and the function calling method is determined by the message mechanism. This is also the basis for using OC as a dynamic language.
[0091] Classification: The essence of classification is a reference data type, similar to basic data types such as byte, short, int (char), long, float, double, etc. The difference is that it is a complex data type. Because its essence is a data type rather than data, it does not exist in the memory and cannot be directly operated. It can only become operable when it is instantiated as an object.
[0092] Classification is an abstraction of a class of things in real life that have common characteristics. If the data types provided in a program have a direct correspondence with the concepts in the application, the program will be easier to understand and easier to modify. A well-chosen set of user-defined classes will make the program more concise. In addition, it will make various forms of code analysis easier to perform. In particular, it will make it possible for the compiler to check for illegal uses of objects.
[0093] The internal encapsulation of the classification attributes and methods is used to operate its own members. A class is a definition of an object with behavior. It describes what an object can do and how it does it. They are programs and processes that can operate on this object. It contains information about how the object behaves, including its name, attributes, methods, and events.
[0094] The composition of a classification includes member attributes and member methods (data members and member functions). Data members correspond to the attributes of a class. The data members of a class are also a data type and do not require memory allocation. Member functions are used to operate the attributes of a class. They are unique operations of a class, such as "students" can "attend classes", but "fruits" cannot. The operation of interaction between a class and the outside world is called an interface.
[0095] The mobile terminal in the embodiment of the present application can be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the mobile terminal can be a portable computer, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, etc. This embodiment does not limit the type of the mobile terminal.
[0096] The embodiments of the present application provide a method, device, mobile terminal and storage medium for page return, which are described in detail below.
[0097] like Figure 1 As shown, it is a flow chart of an embodiment of a page return method in an embodiment of the present application. The page return method is applied to a mobile terminal, and the mobile terminal includes a navigation controller for page control. The page return method includes the following steps 101-103:
[0098] 101. When accessing a first page, a return attribute mark is set for the first page.
[0099] A page is any interface of an application in a mobile terminal, and a return attribute mark is mark information for returning a marked page, such as the custom isAnchor in this embodiment. Exemplarily, the isAnchor can be set by a preset association function of the runtime technology.
[0100] Specifically, after adding the return attribute mark in the return attribute classification, the method also includes: calling a preset association function, associating a Boolean type variable to the first page through a preset unique key, and the Boolean type variable is used to set the attributes of the return attribute mark, for example, yes or no, yes means that the return attribute mark has been set.
[0101] Among them, the preset association function can be the objc_setAssociatedObject function in the iOS system. Specifically, the objc_setAssociatedObject function can be used to associate a Boolean variable with the page through a preset or custom-set unique key; at this time, the isAnchor is formed, that is, the value of isAnchor can be yes or no, and yes indicates that the return attribute mark has been set.
[0102] 102. When accessing the second page, obtain a return request of the first page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0103] When the user accesses the second page on the mobile terminal, the user can perform a page back operation, such as using the return key or a feedback gesture. For example, when the user performs a back operation to the first page, the mobile terminal can obtain a back request for the first page.
[0104] 103. Return to the first page according to the return attribute mark of the first page through the navigation controller.
[0105] The navigation controller UIViewController is used to control pages in the application of the mobile terminal, usually appearing as the control area at the top of the application, where the navigation controller can also be in other areas of the page; when the mobile terminal receives a return request for the first page in step 102, exemplarily, the navigation controller can index and return to the first page according to the Boolean variable associated with the unique key set in step 101.
[0106] In the embodiment of the present application, a rollback attribute mark is set for the page, and the page is rolled back according to the rollback attribute mark, thereby avoiding traversal of all browsed pages, reducing system burden, and improving system response time; at the same time, the page rollback operation is performed according to the rollback attribute mark, reducing the step of comparing and matching the specified page with all pages in the prior art, thereby avoiding matching errors and improving the accuracy of page rollback.
[0107] In some embodiments of the present application, before obtaining a return request for the first page when accessing the second page, the method may include: setting a return attribute mark for at least one interval page among the multiple pages.
[0108] As in step 102, there is at least one interval page between the first page and the second page. When a user browses in an application, he usually browses most pages, including other pages browsed between browsing the first page and browsing the second page, which are the interval pages; wherein the interval page can also be set with a return attribute mark according to the example of setting the return attribute mark in the above step 101; when a return request for the first page is obtained, the navigation controller can directly return to the first page according to the return attribute mark set for the first page.
[0109] Specifically, setting a rollback attribute mark for the first page when accessing the first page may include: adding a rollback attribute category for the first page when accessing the first page; and adding the rollback attribute mark in the rollback attribute category.
[0110] For example, assuming that the first page is page A, when page A is accessed, a fallback attribute category is added to page A by adding a category to page A in UIViewController, and the category is used to add an attribute fallback attribute tag, such as isAnchor.
[0111] like Figure 2 As shown, in some embodiments of the present application, returning to the first page according to the return attribute mark of the first page by the navigation controller may include the following steps 201 to 202:
[0112] 201. Return, through the navigation controller according to the return attribute mark of the at least one interval page, to the interval page with the earliest access time among the at least one interval page.
[0113] The return method of this step is not to return to the first page directly, but to perform a multi-level return according to the order of setting the return attribute mark, and return to the first page through the multi-level return method; when the user hopes to browse the previous page with the return attribute mark set during the return process, the user can start the return method in this step 201 through an operation different from returning to the first page, such as a custom gesture.
[0114] 202. Using the navigation controller, return to the first page from the interval page with the earliest access time according to the return attribute mark of the first page.
[0115] At this time, when the user has finished staying in the interval page, he can return to the first page according to the return implementation method in the above step 103.
[0116] As shown in the figure, in some embodiments of the present application, the page return method may further include the following steps 301 to 303:
[0117] 301. When accessing the second page, a non-specified page return request is obtained.
[0118] When accessing the second page, the mobile terminal obtains a return request for a non-specified page. For example, the return request to the first page in the above step 102 can be regarded as a return request for a specified page.
[0119] 302. According to the non-specified page return request, determine, by the navigation controller, a return attribute mark with the last set time in the at least one interval page.
[0120] When a user browses the interface of an application, the time sequence for browsing different pages is linear, that is, the time for setting different back attribute marks on different pages is also linear time. At this time, the navigation controller obtains the last back attribute mark according to the setting time of different back attribute marks.
[0121] 303. Return to the interval page corresponding to the last return attribute mark of the set time.
[0122] According to the return attribute mark of the last time obtained in step 302, the navigation controller is used to return to the page where the return attribute mark of the last time is set.
[0123] Specifically, when accessing the first page, setting a rollback attribute mark for the first page includes: when accessing the first page, adding a rollback attribute category for the first page; and adding the rollback attribute mark in the rollback attribute category.
[0124] For example, assuming that the first page is page A, when accessing page A, adding a return attribute category for page A can be to add a category for page A in UIViewController, and the category is used to add an attribute return attribute mark, such as isAnchor described in step 101.
[0125] In some embodiments of the present application, the mobile terminal includes a navigation stack for storing visited pages; when accessing a first page, after setting a return attribute mark for the first page, the method includes: storing the first page in the navigation stack. The navigation stack can be used to store pages with a return attribute mark set.
[0126] like Figure 4As shown, it is a flow chart of a method for applying the navigation stack to perform page push (customPush), including the following steps 401 to 404:
[0127] 401. When executing push page (customPush) to page X.
[0128] The push page (customPush) is a method for replacing a page push process pre-set in the mobile terminal. Exemplarily, the push page (customPush) and the page push process pre-set in the mobile terminal can be exchanged using an exchange function of runtime technology.
[0129] Preferably, in the iOS system, a fallback attribute category is added to the navigation controller, and when the navigation controller in the fallback attribute category starts the system preset program push page, the exchange function method_exchangeImplementations of the runtime technology is called to call the customPush;
[0130] 402. Inquire of the page X whether to set a return attribute flag.
[0131] 403. If yes, the page X with the return attribute mark set is put into the navigation stack; a system display function preset in the system is called, and the next page is displayed, and this step ends.
[0132] 404. If not, directly call the system display function pre-set in the system, display the next page, and end this step.
[0133] When using an application in a mobile terminal, the mobile terminal includes a system function for displaying an application interface. Steps 403 and 404 can directly call the system function to display a page.
[0134] Preferably, in an iOS system, a pushViewController function preset in the iOS system may be called to display the first page;
[0135] In some embodiments of the present application, returning to the first page through the navigation controller according to the return attribute mark of the first page includes: obtaining the first page from the navigation stack through the navigation controller according to the return attribute mark of the first page; returning to the first page through the navigation controller; and deleting the first page from the navigation stack.
[0136] Exemplary: Figure 5 As shown, Figure 5The flowchart is a method for applying the navigation stack to return a page, comprising the following steps 501 to 505:
[0137] 501. Execute the page return request (customPop) process.
[0138] The page return request (customPop) process is a custom process. In this embodiment, for example, the page return request process preset in the exchange function exchange system of the runtime technology can be used;
[0139] Preferably, in the iOS system, when the request for returning the first page is obtained, the exchange function method_exchangeImplementations of the runtime technology is called to call customPop.
[0140] 502. Call a system function to return to the first page.
[0141] The method can be used to return to the first page according to the return attribute mark, and display the first page; the above embodiment includes a method for indexing to the first page using the return attribute mark, so it will not be repeated; wherein the system function can be a return function in the mobile terminal system;
[0142] Preferably, in the iOS system, a popViewControllerAnimatedr function preset in the iOS system is called;
[0143] 503. Detect whether the first page is stored in the navigation stack.
[0144] 504. If yes, move the returned page in the navigation stack; end the process
[0145] 505. If the answer is no, then the process ends directly.
[0146] In some embodiments of the present application, the page return method also includes: when accessing the second page, obtaining a non-specified page return request; based on the non-specified page return request, determining, through the navigation controller, a return attribute mark with a last set time in the at least one interval page; and returning to the interval page corresponding to the return attribute mark with a last set time.
[0147] like Figure 6 As shown, Figure 6 A flowchart of a method for using the navigation controller to obtain a non-specified page return request includes the following steps 601 to 603
[0148] 601. When a non-specified page request is obtained (popToAnchor).
[0149] 602. Obtain the interval page corresponding to the last return attribute mark of the set time;
[0150] According to the non-specified page rollback request, the rollback attribute mark with the latest set time in the at least one interval page is determined by the navigation controller; the pages with the rollback attribute mark set are stored in the navigation stack once according to linear time, that is, the top page of the navigation stack is the page with the rollback attribute mark with the latest set time.
[0151] 603. Return to the top page of the navigation stack.
[0152] In some embodiments of the present application, at least one interval page among the multiple pages is set with a rollback attribute mark, and after the first page is stored in the navigation stack, the method further includes: storing the page with the rollback attribute mark set for the at least one interval page in the navigation stack; returning to the first page through the navigation controller according to the rollback attribute mark of the first page, including: obtaining the at least one interval page from the navigation stack through the navigation controller according to the rollback attribute mark of the at least one interval page, and returning to the interval page with the earliest access time among the at least one interval page; deleting the at least one interval page from the navigation stack; when on the interval page with the earliest access time among the at least one interval page, returning to the first page through the navigation controller according to the rollback attribute mark of the first page; deleting the first page from the navigation stack.
[0153] Through the customPush described in the above embodiment, page A is pushed to page A, and the page A does not set a return attribute mark. The customPush is directly called to push to page B, and the page B sets a return attribute mark, and the page B with the return attribute mark set is placed in the navigation stack; then the customPush method is used to push from page B to page C, and the page also sets a return attribute mark, and then the customPush is used to push from page C to page D, and at this time, page D is the current page; wherein pages B and C are page data in the navigation stack, according to the linear rule of time, page C is the top page of the stack, and page B is the bottom page of the stack;
[0154] Among them, as described in this implementation, a rollback attribute mark is set for the page C, and the method of setting the rollback attribute mark is the rollback attribute mark implementation method described in the above embodiment, associating a Boolean type variable to the page C through a unique key; calling the unique key to index the associated Boolean variable can index to the page C; displaying the page C; and then indexing to page B according to the method of indexing to the page C.
[0155] In order to better implement the method for returning a page in the embodiment of the present application, based on the method for returning a page, an apparatus for returning a page is also provided in the embodiment of the present application, which is applied to a mobile terminal, and the mobile terminal includes a navigation controller, such as Figure 7 As shown, the page return device 700 includes:
[0156] A setting module 701 sets a return attribute mark for the first page when accessing the first page;
[0157] An acquisition module 702 acquires a return request of the first page when accessing the second page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0158] The page return module 703 obtains a page return request after accessing the second page, wherein the page return request includes the return attribute mark information; and returns to the first page according to the return attribute mark of the first page through the navigation controller.
[0159] In this embodiment, the setting module 701 can not only set a return attribute mark for the first page, but also set a return attribute mark for each browsed page; the acquisition module 702 can advance the page with the return attribute mark set; the page return module 703 can roll back the page according to the return request and the respective return attribute marks on different pages; in actual use, the user can return to the page that needs to be returned more quickly and accurately according to the return attribute mark, thereby improving the efficiency and accuracy of use.
[0160] In some embodiments of the present application, the setting module 701 is also used to:
[0161] When accessing the second page, before obtaining the return request of the first page, a return attribute mark is set for at least one interval page among the multiple pages.
[0162] In some embodiments of the present application, the page return module 703 is specifically used to:
[0163] Returning, by the navigation controller according to the return attribute mark of the at least one interval page, to the interval page with the earliest access time among the at least one interval page;
[0164] By means of the navigation controller, according to the return attribute mark of the first page, return to the first page from the interval page with the earliest access time.
[0165] In some embodiments of the present application, the acquisition module 702 is further used to:
[0166] When accessing the second page, a non-specified page return request is obtained;
[0167] The page return module 703 is specifically used for:
[0168] According to the non-specified page return request, determining, by the navigation controller, a return attribute mark with the last set time in the at least one interval page;
[0169] Return to the interval page corresponding to the last return attribute mark of the set time.
[0170] In some embodiments of the present application, the setting module 701 is specifically used to:
[0171] When accessing the first page, add a return attribute category to the first page;
[0172] The return attribute mark is added to the return attribute classification.
[0173] In some embodiments of the present application, the setting module 701 is further used to:
[0174] After adding the return attribute mark in the return attribute classification, a preset association function is called to associate a Boolean variable to the first page through a preset unique key, and the Boolean variable is used to set the attributes of the return attribute mark.
[0175] In some embodiments of the present application, the mobile terminal includes a navigation stack for storing visited pages; the device also includes a storage module, and the storage module is used to:
[0176] When accessing a first page, after setting a return attribute mark for the first page, the first page is stored in the navigation stack.
[0177] In some embodiments of the present application, the page return module 703 is specifically used to:
[0178] Acquiring the first page from the navigation stack by the navigation controller according to the return attribute mark of the first page;
[0179] Return to the first page via the navigation controller;
[0180] The first page is deleted from the navigation stack.
[0181] In some embodiments of the present application, at least one interval page among the multiple pages is provided with a rollback attribute mark, and the storage module is used to:
[0182] After storing the first page in the navigation stack, storing the at least one page with a return attribute mark set for the interval page in the navigation stack;
[0183] The page return module 703 is specifically used for:
[0184] Retrieving, by the navigation controller, the at least one interval page from the navigation stack according to the return attribute flag of the at least one interval page, and returning to the interval page with the earliest access time among the at least one interval page;
[0185] deleting the at least one interval page from the navigation stack;
[0186] When on the interval page with the earliest access time among the at least one interval page, returning to the first page according to the return attribute mark of the first page by the navigation controller;
[0187] The first page is deleted from the navigation stack.
[0188] This embodiment further provides a mobile terminal, which integrates at least the page return device provided in this embodiment, and includes:
[0189] one or more processors;
[0190] Memory; and
[0191] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the page rollback method mentioned in any one of the above embodiments.
[0192] The present application also provides a mobile terminal that integrates any of the page return devices provided in the present application. Figure 8 As shown, it shows a schematic diagram of the structure of the mobile terminal involved in the embodiment of the present application, specifically:
[0193] The mobile terminal may include one or more processors 801 of processing cores, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Figure 8 The mobile terminal structure shown in the figure does not constitute a limitation on the mobile terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0194] The processor 801 is the control center of the mobile terminal, and uses various interfaces and lines to connect various parts of the entire mobile terminal. By running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, the processor 801 executes various functions of the mobile terminal and processes data, thereby monitoring the mobile terminal as a whole. Optionally, the processor 801 may include one or more processing cores; the processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0195] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile terminal, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0196] The mobile terminal also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply 803 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.
[0197] The mobile terminal may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0198] Although not shown, the mobile terminal may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the mobile terminal will load the executable files corresponding to the processes of one or more applications into the memory 802 according to the following instructions, and the processor 801 will run the applications stored in the memory 802, thereby realizing various functions, as follows:
[0199] When accessing the first page, setting a return attribute mark for the first page;
[0200] When accessing the second page, obtaining a return request of the first page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0201] Return to the first page according to the return attribute mark of the first page through the navigation controller.
[0202] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0203] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the fault handling methods provided in the embodiments of the present application. For example, the computer program may be loaded by a processor to execute the following steps:
[0204] When accessing the first page, setting a return attribute mark for the first page;
[0205] When accessing the second page, obtaining a return request of the first page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page;
[0206] Return to the first page according to the return attribute mark of the first page through the navigation controller.
[0207] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0208] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0209] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0210] The page return method, device, mobile device and storage medium provided in the embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A page return method, characterized in that: Applied to a mobile terminal, the mobile terminal includes a navigation controller for page control, and the page return method includes: When accessing the first page, add a return attribute category to the first page; Adding a return attribute mark in the return attribute classification; Calling a preset association function, associating a Boolean variable to the first page through a preset unique key, wherein the Boolean variable is used to set the attribute of the return attribute mark; When accessing the second page, obtaining a return request of the first page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page; Return to the first page according to the return attribute mark of the first page through the navigation controller.
2. The page return method according to claim 1, characterized in that: Before obtaining the return request of the first page when accessing the second page, the method further includes: A rollback attribute flag is set for at least one interval page among the plurality of pages.
3. The page return method according to claim 2, characterized in that: The returning to the first page according to the return attribute mark of the first page by the navigation controller includes: Returning, by the navigation controller according to the return attribute mark of the at least one interval page, to the interval page with the earliest access time among the at least one interval page; By means of the navigation controller, according to the return attribute mark of the first page, return to the first page from the interval page with the earliest access time.
4. The page return method according to claim 2, characterized in that: The method further comprises: When accessing the second page, a non-specified page return request is obtained; According to the non-specified page return request, determining, by the navigation controller, a return attribute mark with the last set time in the at least one interval page; Return to the interval page corresponding to the last return attribute mark of the set time.
5. The page return method according to claim 1, characterized in that: The mobile terminal includes a navigation stack for storing visited pages; After adding the return attribute mark to the return attribute classification, the method includes: The first page is stored in the navigation stack.
6. The page return method according to claim 5, characterized in that: The returning to the first page according to the return attribute mark of the first page by the navigation controller includes: Acquiring the first page from the navigation stack by the navigation controller according to the return attribute mark of the first page; Return to the first page via the navigation controller; The first page is deleted from the navigation stack.
7. The page return method according to claim 5, characterized in that: At least one interval page among the multiple pages is set with a return attribute mark, and after storing the first page in the navigation stack, the method further includes: storing the at least one interval page with a return attribute mark in the navigation stack; Returning to the first page according to the return attribute mark of the first page by the navigation controller includes: Retrieving, by the navigation controller, the at least one interval page from the navigation stack according to the return attribute flag of the at least one interval page, and returning to the interval page with the earliest access time among the at least one interval page; deleting the at least one interval page from the navigation stack; When on the interval page with the earliest access time among the at least one interval page, returning to the first page according to the return attribute mark of the first page by the navigation controller; The first page is deleted from the navigation stack.
8. A page return device, characterized in that: Applied to a mobile terminal, the mobile terminal includes a navigation controller for page control, including: A setting module, when accessing the first page, adds a return attribute category to the first page; adds a return attribute mark in the return attribute category; calls a preset association function, associates a Boolean variable to the first page through a preset unique key, and the Boolean variable is used to set the attribute of the return attribute mark; an acquisition module, which acquires a return request of the first page when accessing the second page, wherein the return request of the first page includes a return attribute mark of the first page, and there is at least one interval page between the first page and the second page; The page return module returns to the first page according to the return attribute mark of the first page through the navigation controller.
9. A mobile terminal, characterized in that: The mobile terminal comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor to implement the page rollback method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the page return method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Page rollback method and related device
CN110263273A