Micro application page jump method and device, equipment and storage medium
Patent Information
- Application Number
- CN202210925909.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-08-03
AI Technical Summary
[0005]本申请提供一种微应用页面跳转方法、装置、设备及存储介质,用以解决在应用程序中打开新的微应用页面时,频繁打开和关闭微应用页面造成的页面闪动和卡顿的问题,提高了页面打开过程中的流畅性
[0023]本申请提供的微应用页面跳转方法,包括:获取来自应用程序外部的外部跳转请求,从外部跳转请求中解析出跳转协议,基于跳转协议将应用程序切换至前台,并确定待打开的目标微应用的目标页面,关闭应用程序中在先打开的所有微应用的所有页面,在应用程序中打开目标微应用的目标页面。在应用程序中打开新的微应用页面之前,关闭应用程序中在先打开的所有微应用页面,如此,避免在应用程序中打开新的微应用页面时,频繁打开和关闭微应用页面造成的页面闪动和卡顿的问题,提高了页面打开过程中的流畅性。
Smart Images

Figure CN115391704B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mobile internet technology, and in particular to a method, apparatus, device and storage medium for micro-application page redirection. Background Technology
[0002] With the development of mobile internet, applications (APPs) are now embedding more and more micro-applications or light apps, which come from various companies or merchants. After micro-applications are integrated into high-traffic applications, their exposure can be increased, driving traffic to the micro-applications.
[0003] Companies and merchants behind various micro-applications not only want users to be able to access them only through the application, but also want them to be able to enter through entry points outside the application, thus forming a multi-level entry point.
[0004] However, when opening a micro-app's page through an entry point outside the application, if the application has already opened other micro-app pages, page flickering and lag may occur. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for micro-application page navigation, which solves the problem of page flickering and lag caused by frequently opening and closing micro-application pages when opening new micro-application pages in an application, thereby improving the smoothness of the page opening process.
[0006] Firstly, this application provides a method for micro-application page redirection, including:
[0007] Get external redirect requests from outside the application;
[0008] Parse the jump protocol from the external jump request;
[0009] Based on the aforementioned redirection protocol, the application is switched to the foreground, and the target page of the target micro-application to be opened is determined;
[0010] Close all pages of all micro-applications that were previously opened in the application;
[0011] Open the target page of the target micro-application in the application.
[0012] Secondly, this application provides a micro-application page redirection device, comprising:
[0013] The retrieval module is used to retrieve external redirect requests from outside the application;
[0014] A jump protocol determination module is used to parse the jump protocol from the external jump request;
[0015] The target page determination module is used to switch the application to the foreground based on the jump protocol and determine the target page of the target micro-application to be opened;
[0016] The page closing module is used to close all pages of all micro-applications that were opened earlier in the application.
[0017] The target page opening module is used to open the target page of the target micro-application in the application.
[0018] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0019] The memory stores computer-executed instructions;
[0020] The processor executes computer execution instructions stored in the memory to implement the method as described in the first aspect of this application.
[0021] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect of this application.
[0022] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect of this application.
[0023] The micro-application page navigation method provided in this application includes: obtaining an external navigation request from outside the application; parsing the navigation protocol from the external navigation request; switching the application to the foreground based on the navigation protocol; determining the target page of the target micro-application to be opened; closing all pages of all previously opened micro-applications in the application; and opening the target page of the target micro-application in the application. By closing all previously opened micro-application pages in the application before opening a new micro-application page, the method avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page, thus improving the smoothness of the page opening process. Attached Figure Description
[0024] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0025] Figure 1A flowchart illustrating a micro-application page redirection method provided in an embodiment of the present invention;
[0026] Figure 2 A flowchart illustrating another micro-application page redirection method provided in an embodiment of the present invention;
[0027] Figure 3 A flowchart illustrating another micro-application page redirection method provided in an embodiment of the present invention;
[0028] Figure 4 This is a schematic diagram of the structure of a micro-application page redirection device provided in an embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.
[0030] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0031] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0032] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.
[0033] Terminology Explanation:
[0034] Scheme: A page redirection protocol that can conveniently meet our needs in certain scenarios, such as:
[0035] In HTML5, clicking an anchor point on a webpage will redirect the application to that specific page.
[0036] When an application receives a push notification, clicking the notification will redirect the user to the corresponding page, such as the details page.
[0037] The application can jump to a page specified by another application.
[0038] SDK stands for Software Development Kit, which is a software development kit that is embedded in the application development program.
[0039] An activity is an application component responsible for interacting with the user. An activity is usually a single page or window that can display some controls, listen for and handle user events, and respond accordingly.
[0040] registerActivityLifecycleCallbacks is an interface in Android applications that monitors the lifecycle of all activities in the application.
[0041] ActivityLifecycleCallbacks is an interface in Android applications that records the lifecycle states of an application, including when it starts, is in the foreground, is in the background, and is destroyed.
[0042] onActivityResumed: is a method in ActivityLifecycleCallbacks that brings the activity to the foreground.
[0043] onActivityStopped: is a method in ActivityLifecycleCallbacks that puts the activity in a closed state.
[0044] In existing technologies, when a micro-application's page is opened through an entry point outside the application, the micro-application's SDK and the application are bridged via JavaScript (JS) links and calls each other. The micro-application's SDK is unaware that an already opened micro-application page needs to be closed. JS only acts as a bridge when the application opens a new micro-application page. Then, the micro-application calls methods from the application, and the application calls JS methods to close the previously opened micro-application page, and then opens a new micro-application page. This constant opening, closing, and reopening of the micro-application page causes page flickering, which can easily lead to lag on devices with poor performance.
[0045] To address the aforementioned technical problems, this application proposes the following technical concept: before opening a new micro-application page in the application, close all previously opened micro-application pages in the application. This avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page in the application, thus improving the smoothness of the page opening process.
[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0047] Figure 1 A flowchart of a micro-application page redirection method provided in an embodiment of the present invention is shown below. Figure 1 As shown, this embodiment is applicable to situations where a micro-application page is opened through an entry point outside the application. This method can be executed by the micro-application page redirection device provided in this embodiment. This device can be implemented in software and / or hardware, and is typically configured in electronic devices, such as... Figure 1 As shown, the method may include the following steps:
[0048] S110. Obtain an external redirect request from outside the application.
[0049] In this embodiment of the invention, the electronic device carries an application, which may be a running application (running in the foreground or background) or an application that has been installed but not run; this embodiment of the invention does not limit this. An external redirection request is a redirection request that is not generated through the application's own micro-application entry point, but rather through an entry point outside the application. For example, the electronic device responds to a user's click on an entry point outside the application by obtaining an external redirection request from outside the application.
[0050] For example, in some embodiments of the present invention, the entry point outside the application is an anchor point in a webpage. For example, the webpage may be an HTML5 page; HTML5 is a language for describing web content. An anchor point is a type of hyperlink in webpage creation; clicking an anchor point allows quick navigation to the specified location or page. When a user clicks an anchor point in a webpage, the electronic device responds to the user's click operation by obtaining an external redirection request from outside the application.
[0051] For example, in some embodiments of the present invention, the entry point outside the application is a push message in the notification bar of the electronic device. This push message can be a push message from a running application (running in the foreground or background), or a push message from an application that has been installed but not yet run. This embodiment of the present invention does not impose any limitations on this. For example, when the electronic device receives a push message with an entry point, and the user clicks on the message, the electronic device responds to the user's click operation on the push message in the notification bar by obtaining an external redirection request from outside the application.
[0052] For example, in some embodiments of the present invention, the entry point outside the application is a shortcut icon for a micro-application on the micro-application desktop. For example, the application's interface has a micro-application desktop, also known as a micro-application favorites bar, where shortcut icons for frequently used or recently used micro-applications are saved. When a user clicks a shortcut icon on the micro-application desktop, the electronic device responds to the user's click operation by obtaining an external redirection request from outside the application.
[0053] S120. Parse the jump protocol from the external jump request.
[0054] A jump protocol is a protocol for jumping between pages within an application, as well as between applications. For example, a Scheme is a general intra-page jump protocol. By defining a Scheme protocol, it is very convenient to jump between pages within an application, and it can also be invoked externally or by invoking external applications to enter any page of the application. In this embodiment of the invention, the jump protocol is parsed from the external jump request. This jump protocol specifies the application to be jumped to, the target micro-application within the application, and the target page within the target micro-application.
[0055] S130. Switch the application to the foreground based on the jump protocol and determine the target page of the target micro-application to be opened.
[0056] In this embodiment of the invention, after obtaining the jump protocol, the jump protocol is parsed to determine the application to be jumped to and the target page of the target micro-application to be opened.
[0057] For example, if the application to be redirected to is running in the foreground of the electronic device, the target page of the target micro-application to be opened is determined directly according to the redirection protocol. If the application is running in the background of the electronic device, the application is first switched to the foreground, and then the target page of the target micro-application to be opened is determined according to the redirection protocol. If the application is not running, the electronic device first opens the application and runs it in the foreground, and then the target page of the target micro-application to be opened is determined according to the redirection protocol.
[0058] In some embodiments of the present invention, switching the application to the foreground based on a jump protocol and determining the target page of the target micro-application to be opened includes the following steps:
[0059] S131. Parse the jump protocol to obtain the name of the jump protocol, the address field value corresponding to the address field in the jump protocol, and the path value corresponding to the path field.
[0060] For example, in some embodiments of the present invention, the jump protocol is a Scheme protocol. The format of the Scheme protocol includes a protocol name (Scheme), an address field, a path field, and a parameter field, each of which is assigned a corresponding value. The protocol name represents the application to be opened, the address field value represents the target micro-application to be opened, and the path field value represents the target page to be opened within the micro-application.
[0061] For example, a Scheme protocol is as follows:
[0062] A: / / B:9999 / macthDetail? macthId=222&time=10001
[0063] Where A is the name of the Scheme, indicating that the application to be opened is A. B is the address field, indicating that the target micro-application to be opened is B, 9999 represents the port number of the path, macthDetail represents the page specified by the Schema, and macthId=222&time=10001 represents the function parameters passed.
[0064] S132, Switch the application to the foreground based on the name of the jump protocol.
[0065] After parsing the redirection protocol and obtaining the protocol name, the application is switched to the foreground based on the name of the redirection protocol. For example, if the protocol name of the Scheme is A, it means that the application to be opened is A, and the electronic device switches application A to the foreground. If application A is already running in the foreground, this step is unnecessary. If application A is not running, application A is invoked to run in the foreground.
[0066] S133. Determine the target micro-application to be opened based on the address field value.
[0067] After the application is brought to the foreground, the target micro-application to be opened is determined based on the address field value.
[0068] S134. Determine the target page of the target micro-application based on the path value corresponding to the path field.
[0069] The page corresponding to the path value in the path field is determined as the target page.
[0070] S140. Close all pages of all micro-applications that were opened earlier in the application.
[0071] After determining the target page to open, instead of opening the target page immediately, all pages of all previously opened micro-applications in the application are closed. In this way, when opening the target page, there is no need to frequently open and close micro-application pages, avoiding page flickering and lag caused by frequently opening and closing micro-application pages when opening new micro-application pages in the application, thus improving the smoothness of the page opening process.
[0072] In some embodiments of the present invention, closing all pages of all previously opened micro-applications within the application includes the following steps:
[0073] S141. Determine if there is a previously opened micro-application page in the application.
[0074] For example, the first step is to determine if a previously opened micro-application page exists within the application. Specifically, a page is equivalent to an activity. When a new page opens, its corresponding activity is placed in the foreground of the activity stack, while other activities in the stack are moved to the background. When a page is closed, its corresponding activity is removed from the activity stack. Therefore, in this embodiment of the invention, the page lifecycle monitoring interface `registerActivityLifecycleCallbacks` can be called to view the application's micro-application page activity records from the activity stack. The micro-application page activity records are then used to check if a previously opened micro-application page exists within the application, i.e., whether an activity already exists in the application's activity stack.
[0075] S142. If there are pages of previously opened micro-applications in the application, then close all pages of all previously opened micro-applications in the application.
[0076] For example, if there are pages of previously opened micro-applications in the application, then all pages of all previously opened micro-applications in the application are closed, that is, all activities are removed from the application's activity stack. For example, in some embodiments of the present invention, a page removal function is called to remove all pages from the activity stack. Specifically, the page removal function `onActivityStopped` in `ActivityLifecycleCallbacks` is called to remove all activities from the activity stack.
[0077] S143. If the page of the previously opened micro-application does not exist in the application, then perform the step of opening the target page of the target micro-application in the application.
[0078] If the page of the micro-application does not exist in the application (i.e., there is no activity in the application's activity stack), then the step of opening the target page of the target micro-application in the application is executed, saving the steps of opening the target page and improving the speed of opening the page.
[0079] S150. Open the target page of the target micro-application in the application.
[0080] After closing all pages of all previously opened micro-apps within the application, the target page of the target micro-app is opened within the application. This eliminates the need to frequently open and close micro-app pages when opening the target page, avoiding page flickering and lag issues caused by frequently opening and closing micro-app pages when opening new micro-app pages within the application, thus improving the smoothness of the page opening process.
[0081] For example, in some embodiments of the present invention, the corresponding target micro-application is found according to the address field value in the jump protocol, and then the micro-application opening function in the target micro-application software development kit is called to open the target micro-application. Then, the target page is found according to the path value in the jump protocol, and the target page of the target micro-application is opened.
[0082] In this embodiment of the invention, when the target page of the target micro-application is opened in the application, the target page is added to the activity stack in order to record the lifecycle of the target page. Specifically, the application calls the page addition function onActivityResumed in ActivityLifecycleCallbacks to add the activity corresponding to the target page to the activity stack.
[0083] The micro-application page navigation method provided in this invention includes: obtaining an external navigation request from outside the application; parsing the navigation protocol from the external navigation request; switching the application to the foreground based on the navigation protocol; determining the target page of the target micro-application to be opened; closing all pages of all previously opened micro-applications in the application; and opening the target page of the target micro-application in the application. By closing all previously opened micro-application pages in the application before opening a new micro-application page, the method avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page, thus improving the smoothness of the page opening process.
[0084] The application to be opened may be in a state such as running in the foreground of the electronic device, running in the background of the electronic device, not running or not installed. In response to the above states, this embodiment of the invention provides a micro-application page jump method to deal with the above different states. Figure 2A flowchart of another micro-application page redirection method provided in an embodiment of the present invention is shown below. Figure 2 As shown, the method includes the following steps:
[0085] S201. Obtain an external redirect request from outside the application.
[0086] In this embodiment of the invention, as described in the foregoing embodiments, the external jump request is a jump request generated not through the micro-application entry point of the application itself, but through an entry point outside the application. For example, the external jump request may come from an anchor point on an HTML5 page, a push message in the notification bar of an electronic device, or a micro-application shortcut icon on the micro-application desktop; this invention does not limit the scope of the request.
[0087] S202. Parse the jump protocol from the external jump request.
[0088] In this embodiment of the invention, a jump protocol is parsed from an external jump request. This jump protocol specifies the application to be jumped to, the target micro-application in the application, and the target page in the target micro-application.
[0089] S203. Parse the jump protocol to obtain the name of the jump protocol, the address field value corresponding to the address field in the jump protocol, and the path value corresponding to the path field.
[0090] For example, in some embodiments of the present invention, the jump protocol is a Scheme protocol. The format of the Scheme protocol includes a protocol name (Scheme), an address field, a path field, and a parameter field, each of which is assigned a corresponding value. The protocol name represents the application to be opened, the address field value represents the target micro-application to be opened, and the path field value represents the target page to be opened within the micro-application.
[0091] S204. Determine the application to be opened based on the name of the jump protocol.
[0092] For example, the name of the redirect protocol is the name of the application to be opened.
[0093] S205. Determine the status of the application in the electronic device.
[0094] An application to be opened may exist in four states: running in the foreground of the electronic device, running in the background of the electronic device, not running, or not installed. For example, in this embodiment of the invention, the electronic device can call the application lifecycle monitoring interface to view the application's status on the electronic device from the application's activity stack.
[0095] If the application is running in the foreground of the electronic device, step S209 is executed directly. For example, if the application is running in the foreground of the electronic device, the target micro-application to be opened is determined based on the address field value.
[0096] If the application is running in the background of the electronic device, then step S206 is executed to switch the application to the foreground. For example, if the application is running in the background of the electronic device, the application switching function is called to switch the application to the foreground.
[0097] If the application is not running on the electronic device, then step S207 is executed: open the application and run it in the foreground. For example, if the application is not running on the electronic device, the application open function is called to open the application and run it in the foreground.
[0098] If the application is not installed on the electronic device, step S208 is executed: open the application download page of the app store, download the application, and run it. For example, if the application is not installed on the electronic device, the application opening function is called to open the app store, and the user is redirected to the application's download page to download and run the application in the foreground.
[0099] S209. Determine the target micro-application to be opened based on the address field value.
[0100] After the application runs in the foreground, the target micro-application to be opened is determined based on the address field value.
[0101] S210. Determine the target page of the target micro-application based on the path value corresponding to the path field.
[0102] The page corresponding to the path value in the path field is determined as the target page.
[0103] S211. Close all pages of all micro-applications that were opened earlier in the application.
[0104] After determining the target page to be opened, the target page is not opened immediately. Instead, all pages of all previously opened micro-applications within the application are closed. Specifically, the process of closing all pages of previously opened micro-applications within the application has been described in detail in the foregoing embodiments, and will not be repeated here.
[0105] S212. Open the target page of the target micro-application in the application.
[0106] After closing all pages of all previously opened micro-applications within the application, the target page of the target micro-application is opened within the application. This eliminates the need to frequently open and close micro-application pages when opening the target page, avoiding page flickering and lag issues caused by frequent opening and closing of micro-application pages when opening new micro-application pages within the application, thus improving the smoothness of the page opening process. Specifically, the detailed process of opening the target page of the target micro-application within the application has been described in detail in the foregoing embodiments, and will not be repeated here.
[0107] The micro-application page navigation method provided in this invention flexibly responds to different states of the application to be opened on the electronic device, improving the flexibility of the micro-application page navigation method and enhancing the user experience. Furthermore, before opening a new micro-application page in the application, all previously opened micro-application pages in the application are closed. This avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page in the application, thus improving the smoothness of the page opening process.
[0108] In existing technologies, when a micro-application page is opened through an entry point outside the application, if the newly opened page requires the user to log in and the user is already logged in, and the previously opened page was not logged in, then when returning to the previously opened page, the previous page will show that the user is not logged in, which can easily give the user the illusion that they are not logged in.
[0109] To address the aforementioned issues, this invention proposes the following technical concept: Before opening a new micro-application page requiring login within the application, a temporary authorization is requested from the micro-application's server, and all previously opened micro-application pages within the application are closed. This avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page within the application, improving the smoothness of the page opening process. Furthermore, since all previously opened micro-application pages within the application are closed, returning to the main interface of the application upon revisiting prevents users from being misled into not being logged in when returning to previously opened, unlogged-in pages, thus enhancing the user experience.
[0110] Figure 3 A flowchart of another micro-application page redirection method provided in an embodiment of the present invention is shown below. Figure 3 As shown, the method includes the following steps:
[0111] S301. Obtain an external redirect request from outside the application.
[0112] In this embodiment of the invention, as described in the foregoing embodiments, the external jump request is a jump request generated not through the micro-application entry point of the application itself, but through an entry point outside the application. For example, the external jump request may come from an anchor point on an HTML5 page, a push message in the notification bar of an electronic device, or a micro-application shortcut icon on the micro-application desktop; this invention does not limit the scope of the request.
[0113] S302. Obtain the jump protocol from the external jump request.
[0114] For example, the application parses external redirect requests to obtain the redirect protocol.
[0115] S303. Parse the jump protocol and obtain the address field value corresponding to the address field, the path value corresponding to the path field, and the parameter value of the parameter field in the jump protocol.
[0116] In some embodiments of the present invention, the redirection protocol is a Scheme protocol. The format of a Scheme protocol includes a protocol name (Scheme), an address field, a path field, and a parameter field, each assigned a corresponding value. For example, the parameter field may represent the ID of an item on the page, or that the page is a user login page, etc., and this embodiment of the present invention does not limit this. A Scheme protocol may include multiple different parameter fields. For example, in this embodiment of the present invention, the example of an application to be opened running in the foreground of an electronic device is used for illustration.
[0117] S304. Determine the target micro-application to be opened based on the address field value.
[0118] The address field value corresponds to the target micro-application to be opened. Therefore, the target micro-application to be opened can be determined based on the address field value.
[0119] S305. Determine the target page of the target micro-application based on the path value corresponding to the path field.
[0120] The path value corresponding to the path field represents the target page to be opened in the micro-application. Therefore, the target page of the target micro-application can be determined based on the path value corresponding to the path field.
[0121] S306. Determine whether the target page requires login based on parameter values.
[0122] For example, when a Scheme protocol includes a parameter field representing a login page, the system determines whether login is required for the target page based on the parameter value of that field. An example Scheme protocol would look like this:
[0123] A: / / B:9999 / macthDetail? islogin=true
[0124] In this context, islogin=true indicates that the page requires user login.
[0125] S307. In response to the user's login request, request temporary authorization from the server of the target micro-application.
[0126] In this embodiment of the invention, to avoid the cumbersome process of users entering login usernames and passwords and to improve page operation efficiency, if the target page requires login, a login control will be displayed on the login page. When the user clicks the login control, a login request is generated. In response to the user's login request, the application requests temporary authorization from the server of the target micro-application.
[0127] If the target page does not require login, then perform the steps to close all pages of all previously opened micro-applications in the application.
[0128] S308. Obtain the temporary authorization code issued by the server of the target micro-application and verify the temporary authorization code.
[0129] The target micro-application's server responds to the application's request by issuing a temporary authorization code to the application. The application obtains the temporary authorization code issued by the target micro-application's server and verifies the code to confirm the user's legitimacy.
[0130] S309. Upon successful verification, log in to the target page as the user.
[0131] If verification is successful, the user logs into the target page as an account registered in the target micro-application. If verification fails, the process returns to requesting temporary authorization from the target micro-application's server until verification is successful.
[0132] S310. Close all pages of all micro-applications that were opened earlier in the application.
[0133] After determining the target page to open, close all pages of all previously opened micro-applications within the application.
[0134] Specifically, the process of closing all pages of all previously opened micro-applications in the application has been described in detail in the foregoing embodiments, and will not be repeated here in the embodiments of the present invention.
[0135] S311. Open the target page of the target micro-application in the application.
[0136] After closing all pages of all previously opened micro-apps within the application, the target page of the target micro-app is opened within the application. This eliminates the need to frequently open and close micro-app pages when opening the target page, avoiding page flickering and lag issues caused by frequently opening and closing micro-app pages when opening new micro-app pages within the application, thus improving the smoothness of the page opening process.
[0137] Specifically, the process of opening the target page of the target micro-application in the application has been described in detail in the foregoing embodiments, and will not be repeated here in the embodiments of the present invention.
[0138] The micro-application page redirection method provided in this invention requests temporary authorization from the micro-application server before opening a new micro-application page that requires login in the application, logs into the target page, and closes all previously opened micro-application pages in the application. This avoids page flickering and lag caused by frequently opening and closing micro-application pages when opening a new micro-application page in the application, improving the smoothness of the page opening process. Furthermore, since all previously opened micro-application pages in the application are closed, returning to the main interface of the application avoids the user being misled into not being logged in when returning to previously opened, unlogged-in pages, thus improving the user experience.
[0139] This invention also provides a micro-application page redirection device. Figure 4 This is a schematic diagram of the structure of a micro-application page redirection device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the micro-application page navigation device may include:
[0140] Module 410 is used to obtain external redirect requests from outside the application;
[0141] The jump protocol determination module 420 is used to parse the jump protocol from the external jump request;
[0142] The target page determination module 430 is used to switch the application to the foreground based on the jump protocol and determine the target page of the target micro-application to be opened;
[0143] Page closing module 440 is used to close all pages of all micro-applications that are opened previously in the application.
[0144] The target page opening module 450 is used to open the target page of the target micro-application in the application.
[0145] In some embodiments of the present invention, the acquisition module 410 includes:
[0146] The first sub-module is used to obtain external redirect requests generated by the user's click operation on anchor points in the webpage.
[0147] In some embodiments of the present invention, the acquisition module 410 includes:
[0148] The second sub-module is used to obtain external redirect requests generated by the user's click operation on the push message in the notification bar.
[0149] In some embodiments of the present invention, the acquisition module 410 includes:
[0150] The third sub-module is used to obtain external redirect requests generated by the user's click operation on the micro-application shortcut icon on the micro-application desktop.
[0151] In some embodiments of the present invention, the target page determination module 430 includes:
[0152] The jump protocol parsing submodule is used to parse the jump protocol and obtain the name of the jump protocol, the address field value corresponding to the address field in the jump protocol, and the path value corresponding to the path field.
[0153] An application switching submodule is used to switch the application to the foreground based on the name of the jump protocol;
[0154] The target micro-application determination submodule is used to determine the target micro-application to be opened based on the address field value;
[0155] The target page determination submodule is used to determine the target page of the target micro-application based on the path value corresponding to the path field.
[0156] In some embodiments of the present invention, the page closing module 440 includes:
[0157] The judgment submodule is used to determine whether there is a previously opened page of the micro-application in the application;
[0158] The page closing submodule is used to close all pages of all previously opened micro-applications in the application when there are pages of previously opened micro-applications in the application.
[0159] An execution submodule is used to perform the step of opening the target page of the target micro-application in the application when there is no previously opened page of the micro-application in the application.
[0160] In some embodiments of the present invention, the determination submodule includes:
[0161] The interface call unit is used to call the page lifecycle monitoring interface to view the micro-application page activity records of the application from the activity stack;
[0162] The search unit is used to search the micro-application page activity record to find whether there is a previously opened micro-application page in the application.
[0163] In some embodiments of the present invention, the page closing submodule includes:
[0164] The removal function call unit is used to call the page removal function to remove all pages in the activity stack.
[0165] In some embodiments of the present invention, the target page opening module 450 includes:
[0166] The open function call submodule is used to call the micro-application open function in the target micro-application software development kit according to the address field value, and open the target micro-application.
[0167] The target page opening submodule is used to open the target page of the target micro-application based on the path value.
[0168] In some embodiments of the present invention, the micro-application page redirection device further includes:
[0169] An added function call module is used to call a page addition function when the target page of the target micro-application is opened in the application, thereby adding the target page to the activity stack.
[0170] In some embodiments of the present invention, the micro-application page redirection device further includes:
[0171] The parameter value acquisition module is used to acquire the parameter values of the parameter fields in the jump protocol after determining the target page of the target micro-application to be opened;
[0172] The judgment module is used to determine whether the target page requires login based on the parameter value;
[0173] The request module is used to request temporary authorization from the server of the target micro-application in response to the user's login request when the target page requires login.
[0174] The verification module is used to obtain the temporary authorization code issued by the server of the target micro-application and to verify the temporary authorization code.
[0175] The login module is used to log in to the target page as the user when the verification is successful.
[0176] The aforementioned micro-application page redirection device can execute the micro-application page redirection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the micro-application page redirection method.
[0177] This invention provides an electronic device, which may be the terminal device described in the foregoing embodiments of this invention. Figure 5 This is a schematic diagram of an electronic device provided for an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0178] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0179] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0180] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as micro-application page navigation methods.
[0181] In some embodiments, the micro-application page navigation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the micro-application page navigation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the micro-application page navigation method by any other suitable means (e.g., by means of firmware).
[0182] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0183] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0184] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0185] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0186] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0187] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0188] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the micro-application page navigation method provided in any embodiment of this application.
[0189] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0190] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
Claims
1. A method for page navigation in a micro-application, characterized in that, include: Get external redirect requests from outside the application; Parse the jump protocol from the external jump request; The jump protocol is parsed to obtain the name of the jump protocol, the address field value corresponding to the address field in the jump protocol, and the path value corresponding to the path field. Switch the application to the foreground based on the name of the redirection protocol; The target micro-application to be opened is determined based on the address field value; The target page of the target micro-application is determined based on the path value corresponding to the path field; wherein, the jump protocol is the jump protocol between pages within the application and between applications; all pages of all micro-applications that were opened earlier in the application are closed; Open the target page of the target micro-application in the application; After determining the target page of the target micro-application to be opened, the process also includes: Obtain the parameter values of the parameter fields in the jump protocol; Based on the parameter values, determine whether the target page requires login; If the target page requires login, then in response to the user's login request, a temporary authorization request is sent to the server of the target micro-application. Obtain the temporary authorization code issued by the server of the target micro-application, and verify the temporary authorization code; Upon successful verification, the user logs into the target page as the user. This includes closing all pages of all previously opened micro-applications within the application, including: Call the page lifecycle monitoring interface to view the micro-application page activity records of the application from the activity stack; Search the application's page activity log to see if there is a previously opened page of a micro-application. If there is a page of a previously opened micro-application in the application, then the page removal function is called to remove all pages in the activity stack; If there is no previously opened page of the micro-application in the application, then the step of opening the target page of the target micro-application in the application is performed.
2. The method according to claim 1, characterized in that, Retrieve external redirect requests from outside the application, including: Get external redirect requests generated by user clicks on anchor points on web pages.
3. The method according to claim 1, characterized in that, Retrieve external redirect requests from outside the application, including: Get the external redirect request generated by the user's click action on the push message in the notification bar.
4. The method according to claim 1, characterized in that, Retrieve external redirect requests from outside the application, including: Get external redirect requests generated by the user's click action on the mini-app shortcut icon on the mini-app desktop.
5. The method according to claim 1, characterized in that, Opening the target page of the target micro-application within the application includes: The target micro-application is opened by calling the micro-application opening function in the target micro-application software development kit based on the address field value. Open the target page of the target micro-application based on the path value.
6. The method according to any one of claims 1-4, characterized in that, When the target page of the target micro-application is opened in the application, the following is also included: Call the page addition function to add the target page to the activity stack.
7. A micro-application page navigation device, characterized in that, include: The retrieval module is used to retrieve external redirect requests from outside the application; A jump protocol determination module is used to parse the jump protocol from the external jump request; The target page determination module is used to switch the application to the foreground based on the jump protocol and determine the target page of the target micro-application to be opened; The page closing module is used to close all pages of all micro-applications that were opened earlier in the application. The target page opening module is used to open the target page of the target micro-application in the application. The target page determination module includes: The jump protocol parsing submodule is used to parse the jump protocol and obtain the name of the jump protocol, the address field value corresponding to the address field in the jump protocol, and the path value corresponding to the path field. An application switching submodule is used to switch the application to the foreground based on the name of the jump protocol; The target micro-application determination submodule is used to determine the target micro-application to be opened based on the address field value; The target page determination submodule is used to determine the target page of the target micro-application based on the path value corresponding to the path field; wherein, the jump protocol is the jump protocol between pages within the application and between applications; The page close module includes: The judgment submodule is used to call the page lifecycle monitoring interface to view the micro-application page activity records of the application from the activity stack; and to search for whether there is a previously opened micro-application page in the application from the micro-application page activity records. The page closing submodule is used to call the page removal function to remove all pages in the activity stack when there is a previously opened page of a micro-application in the application. An execution submodule is used to perform the step of opening the target page of the target micro-application in the application when there is no previously opened page of the micro-application in the application. The device further includes: The parameter value acquisition module is used to acquire the parameter values of the parameter fields in the jump protocol after determining the target page of the target micro-application to be opened; The judgment module is used to determine whether the target page requires login based on the parameter value; The request module is used to request temporary authorization from the server of the target micro-application in response to the user's login request when the target page requires login. The verification module is used to obtain the temporary authorization code issued by the server of the target micro-application and to verify the temporary authorization code. The login module is used to log in to the target page as a user when the verification is successful.
8. The apparatus according to claim 7, characterized in that, The modules that open on the target page include: The open function call submodule is used to call the micro-application open function in the target micro-application software development kit according to the address field value, and open the target micro-application. The target page opening submodule is used to open the target page of the target micro-application based on the path value.
9. The apparatus according to claim 7, characterized in that, Also includes: An added function call module is used to call a page addition function when the target page of the target micro-application is opened in the application, thereby adding the target page to the activity stack.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
12. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Applet and host application seamless navigation method and device, electronic equipment and medium
CN112364266A