Usage Method, Device, Terminal, Storage Medium and Product of Applied Business Function

By using virtual pages (Spage) to simulate the Activity page in Android system, the problem that the target application cannot display business functions in the foreground when running in the background is solved, and better business isolation and simplified function switching are achieved.

CN115114019BActive Publication Date: 2025-05-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210593877.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2025-05-30
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

In Android system, when the target application is in the background running state, the target business functions cannot be displayed using the Activity page, resulting in the inability to display and use some of the target application's business functions in the foreground.

Method used

By using virtual pages (Spage) to simulate the Activity page in the target application, and using different virtual pages to manage different business functions, thereby rendering and displaying the target function view of the target business function in the target business container.

Benefits of technology

It realizes that when the target application is running in the background, the business functions of the target application can be displayed and used in the foreground, providing better business isolation and simplified business function switching logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114019B_ABST
    Figure CN115114019B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, terminal, storage medium and product for using the service functions of an application, belonging to the technical field of terminals. The method includes: when the target application is in the background running state and does not have the permission to use the target service function through the Activity page, receiving a target call request for the target application, where the target call request is used to call the target service function of the target application for foreground use; determining a target service container and a target virtual page corresponding to the target service function, and different virtual pages are used to manage different service functions of the target application; based on the target virtual page, rendering and displaying a target function view corresponding to the target service function in the target service container. This method can improve the service isolation of the target service function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and particularly to a method, device, terminal, storage medium, and product for using the service functions of an application. Background Art

[0002] An Activity page is a basic form provided in the Android system for page display. Each Activity page is full-screen sized and has a clear upper and lower layer relationship. When the upper layer displays an Activity page, the lower layer Activity page cannot be operated.

[0003] In related technologies, there are some special applications or special services that need to be co-displayed with other application pages. For example, for an input method service, when a user is using the input method service to input on other application pages, the input method page (the input page corresponding to the input method service) and the page being input (other application pages) need to be co-displayed, and the page being input will also respond while operating the input method page.

[0004] Obviously, the input method page and the page being input are not in an upper and lower layer relationship. Therefore, when displaying the input function of the input method application in the foreground, the Activity page cannot be used. Summary of the Invention

[0005] This application provides a method, device, terminal, storage medium, and product for using the service functions of an application. The technical solutions are as follows:

[0006] According to one aspect of this application, a method for using the service function of an application is provided. The method includes:

[0007] When the target application is in the background running state and does not have the permission to use the target service function using an Activity page, receive a target call request for the target application. The target call request is used to call the target service function of the target application to be used in the foreground;

[0008] Determine a target service container and a target virtual page corresponding to the target service function. The target service container is the display container corresponding to the target service function when used in the foreground. The target virtual page is used to manage the target service function of the target application, and different virtual pages are used to manage different service functions of the target application;

[0009] Based on the target virtual page, render and display a target function view corresponding to the target service function in the target service container.

[0010] According to another aspect of the present application, there is provided an apparatus for using a business function of an application, the apparatus comprising:

[0011] a receiving module, configured to receive a target call request for the target application when the target application is in a background running state and does not have the permission to use the target business function through an active Activity page, where the target call request is used to call the target business function of the target application for foreground use;

[0012] a determining module, configured to determine a target business container and a target virtual page corresponding to the target business function, where the target business container is a display container corresponding to the target business function when used in the foreground, and the target virtual page is used to manage the target business function of the target application, and different virtual pages are used to manage different business functions of the target application;

[0013] a display module, configured to render and display a target function view corresponding to the target business function in the target business container based on the target virtual page.

[0014] According to one aspect of the present application, there is provided a terminal, which includes a processor and a memory. The memory stores a computer program, and the computer program is loaded and executed by the processor to implement the method for using the business function of the application as described above.

[0015] According to another aspect of the present application, there is provided a computer-readable storage medium, which stores a computer program, and the computer program is loaded and executed by the processor to implement the method for using the business function of the application as described above.

[0016] According to another aspect of the present application, there is provided a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the terminal reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for using the business function of the application as described above.

[0017] The beneficial effects brought by the technical solutions provided in the embodiments of the present application at least include:

[0018] In the embodiments of the present application, for the scenario where when the target application is running in the background and it is necessary to display and use the target business function corresponding to the target application in the foreground, but the Activity page cannot be used to display the target business function, the target business function is organized by using a virtual page (Spage) to simulate the Activity page in the target application, and different virtual pages are used to manage different business functions that need to be isolated; compared with the related art, by manually assembling the views of each business function and mounting the display logic of each business function view on a certain container node, the isolation of different business functions is relatively poor. The present application uses virtual pages to organize the business, which can enable the switching of different business functions to be directly achieved through virtual page switching, providing better business isolation for the business functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0020] Figure 1 is a schematic diagram of the usage principle of business functions in the related art;

[0021] Figure 2 is a schematic diagram of the original usage of business functions provided by the present application;

[0022] Figure 3 shows a flowchart of a method for using the business functions of an application provided by an exemplary embodiment of the present application;

[0023] Figure 4 shows a flowchart of a method for using the business functions of an application provided by another exemplary embodiment of the present application;

[0024] Figure 5 shows a schematic diagram of the management process of a virtual page in the background shown by an exemplary embodiment of the present application;

[0025] Figure 6 shows the corresponding relationship between the life cycle of a virtual page and an input method service shown by an exemplary embodiment of the present application;

[0026] Figure 7 shows a flowchart of a method for using the business functions of an application provided by another exemplary embodiment of the present application;

[0027] Figure 8 shows a schematic diagram of the switching of different business functions of an input method application shown by an exemplary embodiment of the present application;

[0028] Figure 9 Schematic diagram of the nested structure of virtual pages and sub-virtual pages shown in an exemplary embodiment of the present application;

[0029] Figure 10 Schematic diagram of the structure of a virtual page framework shown in an exemplary embodiment of the present application;

[0030] Figure 11 Schematic diagram of a rendering strategy shown in an exemplary embodiment of the present application;

[0031] Figure 12 Flowchart showing the method of using the business functions of an application provided in another exemplary embodiment of the present application;

[0032] Figure 13 Block diagram showing the structure of an apparatus for using the business functions of an application provided in an exemplary embodiment of the present application;

[0033] Figure 14 Block diagram showing the structure of a terminal provided in an exemplary embodiment of the present application. Detailed implementation manners

[0034] To make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0035] In the related art, in some scenarios where certain applications or services are running in the background and need to call some business functions of the application (or service) for front-end display, the Activity page cannot be used to use these business functions; to enable these business functions to be displayed in the front end, developers often implement them by manually assembling business function views and writing the business display logic corresponding to each business function view; as Figure 1 shown, for business function 102, all business function views (views) of the business function are assembled together, and the business display logic 103 of each business function view is written; then the business function is mounted in the business container 101 to achieve the front-end display of the business function 102; since the display logics of different business function views are all placed in the business display logic 103, the isolation between different business functions is poor, and a large amount of control code needs to be written to implement the switching between different business function views in the business container 101.

[0036] Based on the problem of poor business isolation in the related art, the embodiments of the present application provide a virtual page (Spage), which can organize business functions through the virtual page and simulate the form of organizing business functions by the Activity page. Schematically, as Figure 2As shown, the business functions can be divided according to the business types included in the business function 202, and different virtual pages (Spage) can be used to manage different business functions and the business display logics corresponding to these business functions, which can better isolate different business functions. Moreover, when switching business functions in the business container 201, it only needs to be achieved by switching different virtual pages, which can further reduce the complexity of business function switching.

[0037] Please refer to Figure 3 , which shows a flowchart of a method for using business functions of an application provided by an exemplary embodiment of the present application. Taking the application of this method to a terminal as an example, this method includes:

[0038] Step 301, when the target application is in the background running state and does not have the permission to use the target business function in the foreground using an Activity page, receive a target call request for the target application, where the target call request is used to call the target business function of the target application to be used in the foreground.

[0039] Among them, the target application is an application whose partial business functions can be displayed and used in the foreground when the target application is in the background running state. For example, the target application can be an input method application. When the user has an input requirement when other display interfaces are shown, the input keyboard function of the input method application can be called to be used in the foreground; the target application can also be an audio and video application. When the audio and video application switches to the background to play audio and video and the desktop lyrics function is enabled, the desktop lyrics function of the audio and video application can be called to be displayed in the foreground when other display interfaces are shown; the target application can also be a sports application. When the sports application is running in the background, some monitoring data can be displayed in the foreground. For example, the function of displaying the number of steps taken in sports. The specific application corresponding to the target application in the embodiments of the present application is not limited.

[0040] Since the page display form provided by the Android system is based on Activity (activity) pages, and only when the target application is running in the foreground does it have the permission to use the Activity page to use business functions. Therefore, for the scenario where the target application is in the background running state but needs to display some business functions (or some application functions) of the target application in the foreground, it does not have the permission to use the Activity page to use the target business function. The embodiments of the present application mainly provide a possible function usage method for such business function usage scenarios.

[0041] Optionally, the target application can be an application that remains in the background after the terminal is started, such as an input method application; or it can be an application that is switched to the background (not a background-resident application) by the user after actively starting the application, such as an audio and video application.

[0042] In a possible implementation, when the target application is in the background running state, a target call request for the target business function is received, and the target call request is used to call the target business function (partial business function) of the target application for foreground use; the target business function is a business function that can be displayed and used in the foreground without switching the target application to the foreground running state, or the target business function is a business function that can be displayed and used in the foreground when the target application is in the background running state.

[0043] Taking the target application as an input method application as an example, the input method application generally resides in the background running state. When the user triggers the input box on the browser application interface, a target call request for the corresponding keyboard input function of the input method application is received, and the keyboard input function is called for foreground use.

[0044] Step 302, determine the target business container and the target virtual page corresponding to the target business function. The target business container is the display container corresponding to the target business function when used in the foreground, and the target virtual page is used to manage the target business function of the target application, and different virtual pages are used to manage different business functions of the target application.

[0045] In the related art, for the situation where the Activity page cannot be used to display business functions, generally, the business function view is manually assembled, and the display logic of each business function view is mounted on a certain container node, and the isolation of different business functions is poor. For the problems in the related art, in the embodiments of the present application, virtual pages (Spage) are used in the target application to simulate the Activity page to organize the business, and different virtual pages are used to manage different business functions that need to be isolated. Then, the switching of different business functions can be directly implemented through virtual page switching, providing better isolation for business functions.

[0046] Taking the input method application as an example, when the keyboard input function is displayed in the foreground, the keyboard input interface often only occupies a part of the display screen size. Different from the Activity page, the virtual page is no longer full screen size, but is hung in a certain display container, meeting the requirement that the target business function only occupies a part of the screen.

[0047] Since the target business function is often not full-screen displayed when presented on the front end; and the target business function may have some personalized modes. For example, the display areas and display positions corresponding to different modes such as the one-handed mode, floating mode, and normal mode of the input method application are all different. Therefore, in a possible implementation, before presenting and using the target business function on the front end, it is first necessary to determine the display area and display size corresponding to the target business function when presented on the front end, and the display area and display size are determined by the size of the business container occupied when the target business function is presented. That is to say, when a call request for the target business function is received, it is necessary to determine the target business container corresponding to the target business function when used on the front end, and this target business container is used to present the target business function.

[0048] Since the target business function is often relatively complex, putting the business logic in a single virtual page will still have serious coupling. Often, the target business function will be divided into different business functions, and different business functions are managed by different virtual pages. While improving the isolation between businesses, it can also avoid too much business logic coupled in the same virtual page; and when the target business function is called and presented on the front end, often only the function view corresponding to one virtual page needs to be presented. Therefore, in a possible implementation, after receiving a call request for the target business function, it is also necessary to determine the target virtual page corresponding to the target business function to be presented, so that subsequently, based on this virtual page, the target function view corresponding to the target business function can be rendered and displayed in the target business container.

[0049] Step 303, based on the target virtual page, render and display the target function view corresponding to the target business function in the target business container.

[0050] In a possible implementation, when the target business container corresponding to the target business function when presented on the front end is determined, the target function view corresponding to the target business function can be rendered and generated based on the display logic of the target business function provided in the virtual page, as well as the business content to be displayed, etc. Then, the target function view is mounted in the target business container, that is, the target business function can be presented on the front end.

[0051] In summary, in the embodiments of the present application, for the scenario where the target application is running in the background and needs to display and use the target business function corresponding to the target application in the foreground, but the Activity page cannot be used to display the target business function, the virtual page (Spage) is adopted in the target application to simulate the Activity page to organize the target business function, and different virtual pages are used to manage different business functions that need to be isolated; compared with the related art, by manually assembling each business function view and mounting the display logic of each business function view on a certain container node, the isolation of different business functions is poor. The present application uses virtual pages to organize the business, which can directly implement the switching of different business functions through virtual page switching, providing better business isolation for the business functions.

[0052] Taking the input method as an example, there are scenarios where multiple function views are switched. For example, in different input modes (normal mode, one-handed mode, and floating mode) of the input method, the corresponding keyboard input page and keyboard selection page, etc. When using the input method function, it may involve switching scenarios of multiple display pages (or function views), and this part of the switching logic of the input method is hosted by the virtual page (Spage) framework, thereby reducing the complexity of business development. The following embodiments mainly illustrate in more detail how the virtual page framework specifically serves the target business function.

[0053] As Figure 4 shown, it shows a flowchart of a method for using the business function of an application provided by another exemplary embodiment of the present application. Taking the example that this method is applied to a terminal, this method includes:

[0054] Step 401, when the target application is in the background running state and does not have the permission to use the target business function by using the Activity page, receive a target call request for the target application.

[0055] The implementation manner of step 401 can refer to the above embodiments, and will not be elaborated in this embodiment.

[0056] Step 402, determine the target business container and the first virtual page corresponding to the target business function, where the first virtual page is used to manage the first business function of the target application.

[0057] Since the target business function is often relatively complex. For example, taking the input function of an input method application as an example, there are scenarios where multiple function views are switched. For example, in different input modes (normal mode, one-handed mode, and floating mode) of the input method, the corresponding keyboard input page and keyboard selection page, etc. Therefore, in order to switch different function pages more conveniently and further improve the business isolation degree, the target business function in this embodiment can be divided into at least two types of business functions, and different types of business functions are managed by different virtual pages. For example, the keyboard input function of the input method can be managed by the first virtual page, and the keyboard selection function can be managed by the second virtual page. Correspondingly, when the user clicks the return control on the page corresponding to the keyboard selection function and returns to the page corresponding to the keyboard input function, only the second virtual page needs to be switched to the first virtual page, which can greatly simplify the page switching logic. And when adding a new type of business, it can also be achieved by adding a virtual page, which has nothing to do with the existing virtual pages and reduces the complexity of business development.

[0058] Since the target business function corresponds to multiple virtual pages, and only the function view corresponding to a single virtual page can be displayed in the target business container at the same time. Therefore, in a possible implementation manner, when receiving a call request corresponding to the target business function, the first business function that the target business function needs to display first can be determined, so as to determine the first virtual page corresponding to the first business function and the target business container. For example, taking the input method application as an example, if the floating mode is set for the input method, the position and size of the determined target business container are the position and size of the input method corresponding to the floating mode, and the first virtual page is the page corresponding to the keyboard input function in the floating mode.

[0059] Among them, the first business function is a part of the target business function.

[0060] Step 403, based on the first virtual page, render and display the first function view corresponding to the first business function in the target business container.

[0061] In a possible implementation manner, after determining the target business container and the first virtual page corresponding to the first business function, the first function view corresponding to the first business function can be rendered and generated based on the display logic of the first business function provided in the first virtual page and the specific business content to be displayed, etc., and then the first function view is mounted in the target business container, that is, the first business function in the target business function can be displayed in the foreground.

[0062] Step 404, in response to a switching operation on the first function view, determine the second virtual page after the switching indicated by the switching operation, and the second virtual page is used to manage the second business function of the target application.

[0063] Since the target business function is divided into multiple business functions, and different business functions are managed by different virtual pages; when the user has a need to switch between different business functions, for example, switching from the keyboard input function of the input method application to the keyboard selection function, it is necessary to involve the switching of different virtual pages. In a possible implementation manner, when a switching operation on the first function view is received, the second business function to be switched to indicated by the switching operation can be first determined, so as to determine the second virtual page corresponding to the management of the second business function.

[0064] Taking the input method application as an example, the first function view can be the keyboard input view corresponding to the keyboard input function, and the switching operation on the first function view can be a click operation on the keyboard selection control in the keyboard input view (for switching to the keyboard selection view corresponding to the keyboard selection function), and the second business function corresponding to the switching operation is the keyboard selection function; it can also be a click operation on the expression selection control in the keyboard input view (for switching to the expression selection view corresponding to the expression selection function), and the second business function indicated by the switching operation is the expression selection function, etc.

[0065] Step 405, based on the second virtual page, render and display the second function view corresponding to the second business function in the target business container.

[0066] In a possible implementation manner, when the second business function and the second virtual page after switching indicated by the switching operation are determined, the second function view corresponding to the second business function can be rendered and generated based on the display logic of the second business function provided in the second virtual page, as well as the specific business content to be displayed, etc., and then the second function view is mounted in the target business container, that is, the second business function in the target business function can be displayed in the foreground.

[0067] In the process of switching from the first function view to the second function view, the switching of the first virtual page to the second virtual page is also involved in the background virtual page management. Then, how to manage the opened first virtual page and second virtual page in the background to ensure that after receiving the switching operation, the second function view can be controlled by the second virtual page to be displayed. Since the virtual page is similar to the Activity page, when managing the virtual page in the background, a management method similar to that of managing the Activity page can also be adopted: stack management. The later opened page is at the top layer, and the initially opened page is at the bottom layer and may be blocked by other pages. That is to say, the virtual page corresponding to the function view currently displayed in the foreground should be at the top of the background stack structure.

[0068] When managing the virtual page through the stack structure, in an exemplary example, step 405 may include step 405A and step 405B.

[0069] Step 405A: Add the second virtual page to the top of the stack structure so that the first virtual page is located below the top of the stack.

[0070] Optionally, manage virtual pages through a stack structure, that is, manage multiple created virtual pages through a stack structure, so that the order of each virtual page in the stack structure is consistent with the display order of the function views corresponding to the virtual pages in the foreground; for example, if the function view corresponding to virtual page A is displayed on the top layer in the foreground, then virtual page A is also located at the top of the stack structure.

[0071] Optionally, when no switching operation for the first function view is received, that is, when the first function view is displayed on the top layer in the foreground, in the stack structure in the background, the first virtual page corresponding to the first function view should be located at the top of the stack structure.

[0072] Since the function view corresponding to the virtual page at the top of the stack is displayed on the top layer in the foreground, based on this stack management mechanism, in a possible implementation, when switching from the first function view to the second function view, it is necessary to add the second virtual page corresponding to the second function view to the top of the stack structure, and the corresponding first virtual page is moved below the top of the stack.

[0073] As Figure 5 shown, it shows a schematic diagram of the management process of virtual pages in the background shown in an exemplary embodiment of the present application. Before switching, virtual page 1 (Spage1) is located at the top of the stack. After switching, virtual page 2 (Spage2) is added to the top of the stack, and Spage1 is located below Spage2. Optionally, both Spage3 and Spage4 are added to the stack structure before Spage1.

[0074] Step 405B: Based on the second virtual page, render and display the second function view corresponding to the second service function in the target service container, and the first function view is blocked by the second function view.

[0075] After the second virtual page is located at the top of the stack, the second function view corresponding to the second service function can be rendered and displayed in the target service container based on the second virtual page.

[0076] Optionally, since the first virtual page is located below the second virtual page, the corresponding first function view is also switched below the second function view, and the corresponding first function view can be blocked by the second function view, and the first function view is not visible in the foreground.

[0077] Optionally, during the process of managing virtual pages through a stack structure, in order to facilitate the switching requirements of different business functions in different scenarios, three startup modes are also correspondingly set for virtual pages, including: standard (new creation mode), singleTop (stack top reuse mode), and singleTask (in-stack reuse mode). The standard (new creation mode) means that each time a virtual page is opened, it is new. That is to say, each time a business function is used, a new virtual page needs to be created. The singleTop (stack top reuse mode) means that when a certain business function is repeatedly opened, if the top of the stack is the virtual page corresponding to the current business function, then the virtual page can be directly reused without having to create a new virtual page; the singleTask (in-stack reuse mode) is that when the virtual page exists in the stack, even if the virtual page is not at the top of the stack, all the virtual pages above the virtual page can be cleared so that the virtual page is at the top of the stack; it can be used to handle the scenario where multiple virtual pages are created and destroyed simultaneously.

[0078] Optionally, for the in-stack reuse mode, in one possible implementation, after switching from the first function view to the second function view (the first virtual page is below the second virtual page, but the first virtual page is still in the stack), when a switching operation to switch back to the first function view is received, the in-stack reuse mode can be used to directly clear all the virtual pages above the first virtual page in the stack structure so that the first virtual page is at the top of the stack, and then based on the first virtual page, the first function view corresponding to the first business function is rendered and displayed in the target business container.

[0079] Optionally, for the stack top reuse mode, in one possible implementation, when a repeated creation operation for the first virtual page is received and the first virtual page is at the top of the stack structure at this time, there is no need to create a new first virtual page, and the first virtual page at the top of the stack can be directly reused, and then based on the first virtual page, the first function view corresponding to the first business function is rendered and displayed in the target business container.

[0080] Optionally, when maintaining the normal use of the target business function, it also involves the life cycles of each virtual page, such as the creation time of the virtual page and the destruction time of the virtual page, etc. In the virtual page framework in the embodiments of the present application, a life cycle management module is also provided for managing the life cycles of each virtual page.

[0081] As shown in Table 1, it shows some life cycle definitions (functions) corresponding to virtual pages.

[0082] Table 1

[0083]

[0084] As can be seen from Table 1, when there is a need to create a target virtual page, the onCreate (create) function can be called to create the target virtual page; when there is a need to close the target virtual page, the onDestory (destroy) function can be called to destroy or close the target virtual page; when there is a need to display the target function view, the onStart function can be called to display the target function view so that the target function view is in a visible and operable state; when there is a need to stop displaying the target function view, the onStop (stop) function can be called to stop displaying the target function view so that the target function view is in an invisible and inoperable state; when the target function view switches back from an invisible and inoperable state to a visible and operable state, the onResume (resume) function can be called to display the target function view; when the target function view switches from a visible and operable state to a visible and inoperable state, the onPause (pause) function can be called to display the target function view.

[0085] Since the virtual page is mainly for the service of the business function, when the business function is not in use, the virtual page should also be destroyed correspondingly. When the business function needs to be used, the virtual page needs to be created correspondingly. That is to say, the life cycle of the virtual page mainly depends on the change of the life cycle of the host (target business function). For example, taking the input method application as an example, the creation and destruction of the virtual page corresponding to the input method function should be related to the start input view and the end input view of the input method business function (input method service or application), and the life cycle of the corresponding virtual page should also be bound to these two functions.

[0086] As Figure 6 shown, it shows the corresponding relationship between the life cycle of the virtual page and the input method service shown in an exemplary embodiment of the present application. Figure 6 On the left side is the life cycle of the input method service (input method application), and on the right side is the life cycle of the virtual page dependent on the input method application. Only when it is necessary to load the input view, the OnCreate function, the onStart function, and the onResume function will be called in sequence to load and display the function view; when the input method application completes the input view, the onPause function, the onStop function, and the onDestory function will be called in sequence to destroy the function view.

[0087] Optionally, the transfer order of the life cycle within the same stack structure is: the life cycle is transferred from the bottom layer to the top layer. In a possible application scenario, if there are multiple virtual pages in the stack structure, when a close operation on the target business function is received, the virtual pages can be closed in sequence from the lower layer to the upper layer of the stack structure. For example, taking Figure 5For example, if it is necessary to close the target service function, according to the switched stack structure, the closing order of Spage1 to Spage4 is: Spage4 - Spage3 - Spage1 - Spage2.

[0088] It should be noted that the operation of closing the target service function refers to stopping the front - end use and display of the target service function of the target application. Taking the input method application as an example, when the user finishes inputting, the operation of closing the input method page, for example, clicking the retract control on the input method page, or clicking the close control on the input method page, etc.

[0089] In this embodiment, the page switching method and background management method between different virtual pages are mainly described. Since different virtual pages correspond to and manage different service functions, when switching between different service functions, page switching can be directly implemented by different virtual pages, which not only ensures the service isolation degree but also improves the convenience of switching between different service functions. In addition, using the stack structure to manage virtual pages makes the last - opened page located at the top of the stack and the initially - opened page located at the bottom of the stack. The initially - opened page is blocked by the last - opened page, making the virtual page management conform to the function view display logic, which is more conducive to the display and management of different service functions.

[0090] There may be a situation where a certain service function is too complex. If all the business logics of the same service function are placed in the same virtual page, there may still be a serious coupling phenomenon. For example, the keyboard input function in the input method application may also include functions such as nine - key input, 26 - key input, handwriting input, voice input, stroke input, Wubi input, etc. Then, in order to avoid affecting the service switching efficiency due to overly complex business, in a possible implementation manner, each service function can be further divided internally to obtain multiple sub - service functions, and different sub - service functions are also managed by different sub - virtual pages.

[0091] As Figure 7 shown, it shows a flowchart of a method for using the service function of an application provided by another exemplary embodiment of the present application. Taking the example of this method being applied to a terminal, this method includes:

[0092] Step 701, when the target application is in the background running state and does not have the permission to use the target service function through the Activity page, receive a target call request for the target application.

[0093] The implementation manner of step 701 can refer to the above - mentioned embodiment, and this embodiment will not be elaborated here.

[0094] Step 702: Determine the target service container, target virtual page, and first sub-virtual page corresponding to the target service function. The first sub-virtual page is used to manage the first sub-service function in the target service function.

[0095] In order to further refine each service function and avoid coupling problems caused by complex services, in a possible implementation, the service functions managed by the same virtual page can be divided into at least two sub-service functions, and sub-virtual pages can be nested in the virtual page. The sub-virtual pages are used to manage different sub-service functions of the virtual page, that is, different sub-virtual pages corresponding to the same virtual page are used to manage different sub-service functions.

[0096] Taking the input method application as an example, when the input method function is called and displayed in the foreground, usually the first thing to be displayed is the nine-key input function corresponding to the keyboard input function. Then the nine-key input function is a sub-service function of the keyboard input function. Therefore, in a possible implementation, when a call request for the target service function is received, in addition to determining the target service container and target virtual page corresponding to the target service function, it is also necessary to determine the first sub-service function to be displayed in the target virtual page and the first sub-virtual page used to manage the first sub-service function.

[0097] Step 703: Based on the target virtual page and the first sub-virtual page, render and display a target function view containing the first sub-function view in the target service container. The first sub-function view is the function view corresponding to the first sub-service function, and the first sub-function view is displayed in the target sub-service container in the target service container.

[0098] In a possible implementation, after determining the target service container, target virtual page, and first sub-virtual page corresponding to the target service function, a target function view containing the first sub-function view can be rendered and generated based on the display logic and display service content included in the target virtual page, and the display logic and service content included in the first virtual page, and the target function view is mounted and displayed in the target service container.

[0099] Among them, the first sub-function view is displayed in the target sub-service container in the target service container. Taking the input method application as an example, in addition to the nine-key input function view, the keyboard input page also includes other tool views, etc. Since the nine-key input function view can be switched to other keyboard input function views, for example, the 26-key input function view, the area where the corresponding nine-key input function view is located is the sub-service container; by mounting different input function views in this sub-service container, switching between different sub-service functions can be achieved.

[0100] Optionally, the target function view corresponding to the target virtual page may include multiple sub-service containers.

[0101] Step 704, in response to a switching operation on the first sub - function view, remove the first sub - function view from the target sub - service container, and determine the second sub - virtual page indicated by the switching operation after the switching.

[0102] In an input method application, there may be a switching scenario. In the keyboard input view, only the nine - key input view in the keyboard input view is switched to the 26 - key input view, and it is still in the keyboard input view. For this switching scenario, only the switching of different sub - service functions and the corresponding switching of different sub - virtual pages are involved. In a possible implementation manner, when receiving a switching operation on the first sub - function view, the second sub - service function indicated by the switching operation and the second sub - virtual page corresponding to the second sub - service function can be determined.

[0103] In order to enable the second sub - function view to be mounted in the target sub - service container, when receiving a switching operation on the first sub - function view, it is also necessary to remove the first sub - function view from the target sub - service container so that the second sub - function view can be mounted in the target sub - service container subsequently.

[0104] Step 705, mount the second sub - function view corresponding to the second sub - virtual page on the target sub - service container.

[0105] In a possible implementation manner, after determining the second sub - virtual page, the display logic and display content included in the second sub - virtual page can be used to render the second sub - function view, so as to mount the rendered second sub - function view on the target sub - service container.

[0106] Optionally, multiple sub - virtual pages mounted in the same sub - service container can also be managed through a stack structure. To distinguish the stack structures corresponding to different virtual pages, the stack structures of different sub - virtual pages can be called sub - stack structures.

[0107] Based on the stack management mechanism, the function view corresponding to the virtual page (sub - virtual page) at the top of the stack is displayed at the topmost layer in the foreground. In a possible implementation manner, when receiving a switching operation, the second sub - virtual page can be added to the top of the sub - stack structure, then the first sub - virtual page is located below the second sub - virtual page, and the corresponding second sub - function view obscures the first sub - function view.

[0108] Such as Figure 8As shown, it shows a schematic diagram of the switching of different service functions of an input method application shown in an exemplary embodiment of the present application. When the user clicks on the search input box 802 in the browser interface 801, the input function of the input method application can be called to be displayed in the foreground, and a first function view 803 corresponding to the first virtual page is correspondingly displayed. The first function view 803 corresponds to the keyboard input function in the input method function; a keyboard input area 807 and other toolbars are displayed in the first function view 803. For example, a keyboard selection control 804; when the user needs to switch to the keyboard selection function of the input method function, the keyboard selection control 804 can be correspondingly clicked, and then the second function view 805 corresponding to the second virtual page is switched and displayed. The second function view 805 contains multiple input keyboards 806 that can be selected; optionally, the switching of different input keyboards involves the switching of the sub-function views corresponding to the keyboard input area 807 in the first function view 803. For example, switching from the 9-key input function view to the 26-key input function view.

[0109] It should be noted that the management logic of the sub-stack structure is similar to the management logic of the stack structure in the above embodiment. The switching process of different sub-virtual pages can refer to the switching process of different virtual pages in the above embodiment, and this embodiment will not be elaborated here.

[0110] As Figure 9 As shown, it shows a schematic diagram of the nested structure of virtual pages and sub-virtual pages shown in an exemplary embodiment of the present application. The target service function can be divided into three service functions, which are managed by Spage1, Spage2, and Spage3 respectively for different service functions; the same service function is further divided. For example, the service function managed by Spage1 can be further divided into three sub-service functions, which are managed by sub-Spage1, sub-Spage2, and sub-Spage3 respectively for different sub-service functions; the service function managed by Spage3 can be further divided into three sub-service functions, which are managed by sub-Spage4 and sub-Spage5 respectively for different sub-service functions; optionally, the sub-service functions managed by sub-Spage can also be further divided.

[0111] Step 706, render and display the second sub-function view in the target sub-service container.

[0112] When the second sub-function view is mounted on the target sub-service container, the second sub-function view can be rendered and displayed in the target sub-service container.

[0113] Optionally, the transfer order of the lifecycle between the virtual page and the sub-virtual page is as follows: the lifecycle is transferred from the virtual page of the parent node to the virtual page of the child node; within the same stack structure, the lifecycle is transferred from the bottom layer to the top layer. In a possible implementation manner, when a close operation on the target virtual page is received, since the target sub-business container in the target virtual page corresponds to multiple sub-virtual pages, the sub-virtual pages can be closed in sequence from the lower layer to the upper layer according to the sub-stack structure.

[0114] In this embodiment, by performing a finer-grained division on the same business function, multiple sub-business functions are obtained, and different sub-business functions can be managed by different sub-virtual pages, forming a nested structure of virtual page - sub-virtual page; it is possible to achieve a more detailed division of complex business functions, thereby avoiding the problem of serious coupling caused by placing all business logics of complex business functions in the same virtual page, and further improving the business switching efficiency and development efficiency.

[0115] Combined with the above embodiment, as Figure 10 shown, it shows a schematic structural diagram of a virtual page framework shown in an exemplary embodiment of the present application. The virtual page framework mainly includes: a stack management module 1001, a lifecycle management module 1002, a Jetpack support module 1003, an inter-page communication module 1004, a rendering strategy module 1005, an ability expansion module 1006, a Spage API 1007 (virtual page interface), and a switching animation module 1008.

[0116] Stack management module 1001: SPage adopts a stack structure during background management. The page opened later is at the top layer and is displayed last. The page opened initially is at the bottom layer and may be blocked by other pages, which most conforms to the page management logic. Each opened SPage exists in a Page stack.

[0117] Lifecycle management module 1002: The lifecycle module 1002 gives SPage stronger management capabilities. The definition of the lifecycle adopts the standard definition of the Android system, with a finer understanding cost and is also an essential part of jetPack.

[0118] Jetpack Support Module 1003: As an extension package for Android, Jetpack can be dynamically integrated into virtual pages other than Activities. Since SPage supports the lifecycle and is consistent with the Activity page, the integration method of Jetpack into SPage can refer to that of Activity. The specific integration method is as follows: SPage implements two necessary interfaces for Jetpack integration, LifecycleOwner andViewModelStoreOwner, to support the Jetpack extension package. ViewModel refers to the object for storing and managing the business data associated with page display, which is associated with the lifecycle of the virtual page; ViewModelStoreOwner: provides a cache pool for ViewModel objects to the extension package. The LifecycleOwner interface notifies the extension package of the lifecycle of the current page, and Jetpack can handle communication between different pages and clean up the cache pool of ViewModel according to the page lifecycle.

[0119] Inter-page Communication Module 1004: Since SPage supports Jetpack, inter-page communication can be carried out using ViewModel + LiveData in Jetpack.

[0120] Rendering Strategy Module 1005: To ensure the correct definition of the lifecycle, there is a certain relationship between the mounting time and the lifecycle. That is, the functional view will only be mounted on the business container when it needs to be displayed. If the functional view stops being displayed, it will be removed from the business container.

[0121] As Figure 11 shown, it shows a schematic diagram of the rendering strategy shown in an exemplary embodiment of the present application. As Figure 11 can be seen, only when the onStart function is called, the functional view will be mounted (addView) in the business container; when the onStop function is called, the functional view will be removed (removeView) from the business container.

[0122] Capability Expansion Module 1006: To facilitate subsequent business function expansion, SPage has expansion capabilities, mainly including a general event distribution function. Its main components are as follows:

[0123] (1) Provides a general distribution interface: public void dispatchExtraEvent(int event, Object... args), where the first parameter event is used as the event identifier and can be defined by the user; the second parameter args is the general event parameter, which is determined by the specific event that needs to be expanded.

[0124] (2) Each SPage provides a receiving interface: public void onExtraEvent(int event, Object...args).

[0125] (3) After the dispatchExtraEvent distributes an event, each SPage determines whether it can receive the distributed event according to its own life cycle. The specific life cycle determination conditions include two types: restrictive conditions and sticky conditions; the restrictive condition is that the page must be at least in the onStart state to receive the corresponding event distribution; the sticky condition is that the parent virtual page caches relevant events, and after the new child virtual page starts, it will receive the event information of the most recent distributed event.

[0126] Spage API1007: The receiving interface in the capability extension module 1006; can be used to receive events distributed from external services or applications.

[0127] The switching animation module 1008: Mainly responsible for the switching animation between different functional views. Can directly reuse the switching animation of the Activity page.

[0128] The above embodiments are described with the target application. In a possible application scenario, the above method for using the business functions of the application can be applied to an input method application, that is, the target application is an input method application.

[0129] As Figure 12 shown, it shows a flowchart of the method for using the business functions of the application provided by another exemplary embodiment of the present application. Taking the application of this method to a terminal as an example, this method includes:

[0130] Step 1201, when the input method application is in the background running state and does not have the permission to use the input method function with an Activity page, receive a target call request for the input method application, where the target call request is used to call the input method function of the input method application for foreground use.

[0131] Step 1202, determine the target business container and target virtual page corresponding to the input method function.

[0132] Step 1203, based on the target virtual page, render and display the target function view corresponding to the input method function in the target business container.

[0133] Among them, the input method functions corresponding to the input method application can be divided into: emoji selection function, keyboard selection function, keyboard input function, voice input function, etc. Each target virtual page corresponds to managing a business function. Specifically, the keyboard selection function can be further divided into: nine-key input function, 26-key input function, handwriting input function, stroke input function, Wubi input function, etc. These are the sub-business functions of the keyboard selection function and can be managed by different sub-virtual pages respectively.

[0134] It should be noted that the implementation manners of steps 1201 to 1203 can refer to the usage process of the business function corresponding to the target application in the above-mentioned embodiment, and this embodiment will not be elaborated here.

[0135] In this embodiment, for the scenario where the input method application cannot use the Activity page to display the input method function when it needs to be displayed and used in the foreground during the background operation process, a virtual page (Spage) is adopted in the input method application to simulate the Activity page to organize the input method function, and different virtual pages are used to manage different input method functions that need to be isolated. Compared with the related technology, by manually assembling the views of each input method function and mounting the display logic of each input method function view on a certain container node, the isolation of different input method functions is poor. Using virtual pages to organize the input method function in this application can enable the switching of different input method functions to be directly realized through virtual page switching, providing better isolation for business functions.

[0136] Figure 13 It is a structural block diagram of a device for using the business function of an application provided by an exemplary embodiment of the present application. The device includes:

[0137] A receiving module 1301, configured to receive a target call request for the target application when the target application is in the background running state and does not have the permission to use the target business function by using an active Activity page. The target call request is used to call the target business function of the target application for foreground use;

[0138] A determining module 1302, configured to determine a target business container and a target virtual page corresponding to the target business function. The target business container is the display container corresponding to the target business function when it is used in the foreground. The target virtual page is used to manage the target business function of the target application, and different virtual pages are used to manage different business functions of the target application;

[0139] A display module 1303, configured to render and display a target function view corresponding to the target business function in the target business container based on the target virtual page.

[0140] In an optional embodiment, the target service function is divided into at least two service functions;

[0141] The determining module 1302 is further configured to:

[0142] Determine a target service container and a first virtual page corresponding to the target service function, where the first virtual page is used to manage a first service function of the target application;

[0143] The display module 1303 is further configured to:

[0144] Based on the first virtual page, render and display a first function view corresponding to the first service function in the target service container.

[0145] In an optional embodiment, the determining module 1302 is further configured to, in response to a switching operation on the first function view, determine a second virtual page after switching indicated by the switching operation, where the second virtual page is used to manage a second service function of the target application;

[0146] The display module 1303 is further configured to, based on the second virtual page, render and display a second function view corresponding to the second service function in the target service container.

[0147] In an optional embodiment, virtual pages are managed through a stack structure;

[0148] The display module 1303 is further configured to:

[0149] Add the second virtual page to the top of the stack structure, so that the first virtual page is located below the top of the stack;

[0150] Based on the second virtual page, render and display the second function view corresponding to the second service function in the target service container, and the first function view is blocked by the second function view.

[0151] In an optional embodiment, the device further includes:

[0152] A clearing module, configured to, in response to a switching operation to switch back to the first function view, clear all virtual pages above the first virtual page in the stack structure;

[0153] The display module 1303 is further configured to, based on the first virtual page, render and display the first function view corresponding to the first service function in the target service container.

[0154] In an optional embodiment, the device further includes:

[0155] A multiplexing module, configured to multiplex the first virtual page when a creation operation for the first virtual page is received and the first virtual page is located at the top of the stack structure.

[0156] The display module 1303 is further configured to render and display the first function view corresponding to the first service function in the target service container based on the first virtual page.

[0157] In an optional embodiment, the apparatus further includes:

[0158] A closing module, configured to close virtual pages in sequence from the lower layer to the upper layer of the stack structure when a closing operation for the target service function is received.

[0159] In an optional embodiment, the service functions managed by the same virtual page are divided into at least two types of sub-service functions, and different sub-virtual pages corresponding to the same virtual page are used to manage different sub-service functions;

[0160] The determining module 1302 is further configured to:

[0161] Determine the target service container, the target virtual page, and the first sub-virtual page corresponding to the target service function, where the first sub-virtual page is used to manage the first sub-service function in the target service function;

[0162] The display module 1303 is further configured to:

[0163] Render and display the target function view including the first sub-function view in the target service container based on the target virtual page and the first sub-virtual page, where the first sub-function view is the function view corresponding to the first sub-service function, and the first sub-function view is displayed in the target sub-service container in the target service container.

[0164] In an optional embodiment, the apparatus further includes:

[0165] A switching module, configured to remove the first sub-function view from the target sub-service container in response to a switching operation for the first sub-function view, and determine the second sub-virtual page after switching indicated by the switching operation;

[0166] An adding module, configured to mount the second sub-function view corresponding to the second sub-virtual page on the target sub-service container;

[0167] The display module 1303 is configured to render and display the second sub-function view in the target sub-service container.

[0168] In an alternative embodiment, sub-virtual pages in the same sub-service container are managed through a sub-stack structure;

[0169] The apparatus further includes:

[0170] The adding module is further configured to add the second sub-virtual page to the top of the sub-stack structure.

[0171] In an alternative embodiment, the apparatus further includes:

[0172] A closing module, configured to, in response to a closing operation on the target virtual page, close the sub-virtual pages in sequence from the lower layer to the upper layer according to the sub-stack structure.

[0173] In an alternative embodiment, the apparatus further includes:

[0174] An invocation module, configured to, when there is a need to create the target virtual page, invoke the onCreate function to create the target virtual page;

[0175] The invocation module is further configured to, when there is a need to close the target virtual page, invoke the onDestory function to destroy the target virtual page;

[0176] The invocation module is further configured to, when there is a need to display the target function view, invoke the onStart function to display the target function view, so that the target function view is in a visible and operable state;

[0177] The invocation module is further configured to, when there is a need to stop displaying the target function view, invoke the onStop function to stop displaying the target function view, so that the target function view is in an invisible and inoperable state;

[0178] The invocation module is further configured to, when the target function view switches back from an invisible and inoperable state to a visible and operable state, invoke the onResume function to display the target function view;

[0179] The invocation module is further configured to, when the target function view switches from the visible and operable state to the invisible and inoperable state, invoke the onPause function to display the target function view.

[0180] In an alternative embodiment, the target application is an input method application;

[0181] The receiving module 1301 is further configured to:

[0182] When the input method application is running in the background and does not have the permission to use the input method function through the Activity page, receive the target call request for the input method application, where the target call request is used to call the input method function of the input method application for foreground use;

[0183] The determining module 1302 is further configured to:

[0184] Determine the target service container and the target virtual page corresponding to the input method function;

[0185] The display module 1303 is further configured to:

[0186] Based on the target virtual page, render and display the target function view corresponding to the input method function in the target service container.

[0187] In summary, for the scenario where when a target application is running in the background and it is necessary to display and use the target service function corresponding to the target application in the foreground, and the Activity page cannot be used to display the target service function, by using a virtual page (Spage) in the target application to simulate the Activity page to organize the target service function, and different virtual pages are used to manage different service functions that need to be isolated; compared with the related art, by manually assembling each service function view and mounting the display logic of each service function view on a certain container node, the isolation of different service functions is relatively poor. In this application, using virtual pages to organize services can enable the switching of different service functions to be directly achieved through virtual page switching, providing better isolation for service functions.

[0188] Please refer to Figure 14 , which shows a structural block diagram of a terminal 1400 provided by an exemplary embodiment of the present application. The terminal 1400 may be a portable mobile terminal, such as: a smart phone, a tablet computer, a Moving Picture Experts Group Audio Layer III (MP3) player, a Moving Picture Experts Group Audio Layer IV (MP4) player. The terminal 1400 may also be referred to by other names such as user equipment, portable terminal, etc.

[0189] Generally, the terminal 1400 includes: a processor 1401 and a memory 1402.

[0190] The processor 1401 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 1401 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), or programmable logic array (PLA). The processor 1401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1401 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1401 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.

[0191] The memory 1402 may include one or more computer-readable storage media, and the computer-readable storage media may be tangible and non-transitory. The memory 1402 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1402 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1401 to implement the method provided by the embodiments of the present application.

[0192] In some embodiments, the terminal 1400 may further optionally include: a peripheral device interface 1403.

[0193] The peripheral device interface 1403 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1401 and the memory 1402. In some embodiments, the processor 1401, the memory 1402, and the peripheral device interface 1403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1401, the memory 1402, and the peripheral device interface 1403 may be implemented on a separate chip or circuit board, and this embodiment does not limit this.

[0194] The present application further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method for using the service function of the application provided in the above method embodiment.

[0195] The present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method for using the service function of the application provided in the above method embodiment.

[0196] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0197] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc.

[0198] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for using a business function of an application, characterized in that, the method includes: When the target application is in the background running state and does not have the permission to use the target business function through the active Activity page, receiving a target call request for the target application, where the target call request is used to call the target business function of the target application for foreground use; Determining a target business container and a target virtual page corresponding to the target business function, where the target business container is the display container corresponding to the target business function when used in the foreground, and the target virtual page is used to manage the target business function of the target application, and different virtual pages are used to manage different business functions of the target application and the business display logic corresponding to the managed business functions. The virtual page organizes the business by simulating the Activity page in the target application, and the switching of different business functions is achieved through the switching of virtual pages. The size of the virtual page is smaller than the size of the display screen; Based on the display logic of the target business function provided in the target virtual page, rendering and displaying a target function view corresponding to the target business function in the target business container.

2. The method according to claim 1, characterized in that, the target business function is divided into at least two business functions; the determining the target business container and the target virtual page corresponding to the target business function includes: Determining a target business container and a first virtual page corresponding to the target business function, where the first virtual page is used to manage the first business function of the target application; the rendering and displaying a target function view corresponding to the target business function in the target business container based on the display logic of the target business function provided in the target virtual page includes: Based on the display logic of the target business function provided in the first virtual page, rendering and displaying a first function view corresponding to the first business function in the target business container.

3. The method according to claim 2, characterized in that, the method further includes: In response to a switching operation on the first function view, determining a second virtual page after the switching indicated by the switching operation, where the second virtual page is used to manage the second business function of the target application; Based on the second virtual page, rendering and displaying a second function view corresponding to the second business function in the target business container.

4. The method according to claim 3, characterized in that, managing virtual pages through a stack structure; the rendering and displaying a second function view corresponding to the second business function in the target business container based on the second virtual page includes: Adding the second virtual page to the top of the stack structure so that the first virtual page is located below the top of the stack; Based on the second virtual page, rendering and displaying the second function view corresponding to the second business function in the target business container, and the first function view is blocked by the second function view.

5. The method according to claim 4, characterized in that, the method further includes: In response to a switching operation to switch back to the first functional view, clear all virtual pages above the first virtual page in the stack structure; Based on the first virtual page, render and display the first functional view corresponding to the first business function in the service container.

6. The method according to claim 4, wherein, the method further includes: When a creation operation for the first virtual page is received and the first virtual page is located at the top of the stack structure, reuse the first virtual page; Based on the first virtual page, render and display the first functional view corresponding to the first business function in the target service container.

7. The method according to claim 4, wherein, the method further includes: When a closing operation for the target business function is received, close the virtual pages in sequence from the lower layer to the upper layer of the stack structure.

8. The method according to any one of claims 1 to 7, wherein, The business functions managed by the same virtual page are divided into at least two sub-business functions, and different sub-virtual pages corresponding to the same virtual page are used to manage different sub-business functions; The determining the target service container and the target virtual page corresponding to the target business function includes: Determine the target service container, the target virtual page, and a first sub-virtual page corresponding to the target business function, where the first sub-virtual page is used to manage the first sub-business function in the target business function; The rendering and displaying the target functional view corresponding to the target business function in the target service container based on the display logic of the target business function provided in the target virtual page includes: Based on the target virtual page and the first sub-virtual page, render and display the target functional view including the first sub-functional view in the target service container, where the first sub-functional view is the functional view corresponding to the first sub-business function, and the first sub-functional view is displayed in the target sub-service container in the target service container.

9. The method according to claim 8, wherein, the method further includes: In response to a switching operation for the first sub-functional view, remove the first sub-functional view from the target sub-service container, and determine the second sub-virtual page after the switching indicated by the switching operation; Mount the second sub-functional view corresponding to the second sub-virtual page on the target sub-service container; Render and display the second sub-functional view in the target sub-service container.

10. The method according to claim 9, wherein, Manage the sub-virtual pages in the same sub-service container through a sub-stack structure; After determining the second sub-virtual page after the switching indicated by the switching operation, the method further includes: Add the second sub-virtual page to the top of the sub-stack structure.

11. The method according to claim 10, wherein, the method further includes: In response to a closing operation for the target virtual page, close the sub-virtual pages in sequence from the lower layer to the upper layer of the sub-stack structure.

12. The method according to any one of claims 1 to 8, wherein, the method further includes: when there is a need to create the target virtual page, calling the onCreate function to create the target virtual page; when there is a need to close the target virtual page, calling the onDestory function to destroy the target virtual page; when there is a need to display the target function view, calling the onStart function to display the target function view, so that the target function view is in a visible and operable state; when there is a need to stop displaying the target function view, calling the onStop function to stop displaying the target function view, so that the target function view is in an invisible and inoperable state; when the target function view switches back from the visible and inoperable state to the visible and operable state, calling the onResume function to display the target function view; when the target function view switches from the visible and operable state to the visible and inoperable state, calling the onPause function to display the target function view.

13. The method according to any one of claims 1 to 8, wherein, the target application is an input method application; when the target application is in the background running state and does not have the permission to use the target business function with the Activity page, receiving the target call request for the target application, including: when the input method application is in the background running state and does not have the permission to use the input method function with the Activity page, receiving the target call request for the input method application, the target call request being used to call the input method function of the input method application for foreground use; determining the target business container and the target virtual page corresponding to the target business function, including: determining the target business container and the target virtual page corresponding to the input method function; rendering and displaying the target function view corresponding to the target business function in the target business container based on the display logic of the target business function provided in the target virtual page, including: rendering and displaying the target function view corresponding to the input method function in the target business container based on the display logic of the target business function provided in the target virtual page.

14. A device for using the business function of an application, wherein, the device includes: a receiving module, configured to receive a target call request for the target application when the target application is in the background running state and does not have the permission to use the target business function with the Activity page, the target call request being used to call the target business function of the target application for foreground use; A determination module, configured to determine a target service container and a target virtual page corresponding to the target service function, where the target service container is a display container corresponding to the target service function when used in the foreground, and the target virtual page is used to manage the target service function of the target application, and different virtual pages are used to manage different service functions of the target application and the service display logics corresponding to the managed service functions. The virtual pages organize services by simulating Activity pages in the target application, and the switching of different service functions is achieved through the switching of virtual pages. The size of the virtual page is smaller than the size of the display screen; A display module, configured to render and display a target function view corresponding to the target service function in the target service container based on the display logic of the target service function provided in the target virtual page.

15. The apparatus according to claim 14, wherein, the target service function is divided into at least two service functions; the determination module is further configured to determine a target service container and a first virtual page corresponding to the target service function, where the first virtual page is used to manage the first service function of the target application; the display module is further configured to render and display a first function view corresponding to the first service function in the target service container based on the display logic of the target service function provided in the first virtual page.

16. The apparatus according to claim 15, wherein, the determination module is further configured to, in response to a switching operation on the first function view, determine a second virtual page after the switching indicated by the switching operation, where the second virtual page is used to manage the second service function of the target application; the display module is further configured to render and display a second function view corresponding to the second service function in the target service container based on the second virtual page.

17. The apparatus according to claim 16, wherein, the virtual pages are managed by a stack structure; the display module is further configured to: add the second virtual page to the top of the stack structure, so that the first virtual page is located below the top of the stack; render and display the second function view corresponding to the second service function in the target service container based on the second virtual page, and the first function view is blocked by the second function view.

18. The apparatus according to claim 17, wherein, the apparatus further includes: a clearing module, configured to, in response to a switching operation to switch back to the first function view, clear all virtual pages above the first virtual page in the stack structure; the display module is further configured to render and display the first function view corresponding to the first service function in the service container based on the first virtual page.

19. The apparatus according to claim 17, wherein, the apparatus further includes: a multiplexing module, configured to multiplex the first virtual page when a creation operation on the first virtual page is received and the first virtual page is located at the top of the stack structure. The display module is further configured to render and display the first function view corresponding to the first service function in the target service container based on the first virtual page.

20. The apparatus according to claim 17, wherein, the apparatus further comprises: a closing module, configured to sequentially close virtual pages from the lower layer to the upper layer according to the stack structure when a closing operation on the target service function is received.

21. The apparatus according to any one of claims 14 to 20, wherein, the service functions managed by the same virtual page are divided into at least two types of sub-service functions, and different sub-virtual pages corresponding to the same virtual page are used to manage different sub-service functions; the determining module is further configured to: determine the target service container, the target virtual page, and a first sub-virtual page corresponding to the target service function, where the first sub-virtual page is used to manage the first sub-service function in the target service function; the display module is further configured to: render and display the target function view including the first sub-function view in the target service container based on the target virtual page and the first sub-virtual page, where the first sub-function view is the function view corresponding to the first sub-service function, and the first sub-function view is displayed in the target sub-service container in the target service container.

22. The apparatus according to claim 21, wherein, the apparatus further comprises: a switching module, configured to remove the first sub-function view from the target sub-service container in response to a switching operation on the first sub-function view, and determine the second sub-virtual page after switching indicated by the switching operation; an adding module, configured to mount the second sub-function view corresponding to the second sub-virtual page on the target sub-service container; the display module is further configured to render and display the second sub-function view in the target sub-service container.

23. The apparatus according to claim 22, wherein, sub-virtual pages in the same sub-service container are managed by a sub-stack structure; the adding module is further configured to add the second sub-virtual page to the top of the sub-stack structure.

24. The apparatus according to claim 23, wherein, the apparatus further comprises: a closing module, configured to sequentially close sub-virtual pages from the lower layer to the upper layer according to the sub-stack structure in response to a closing operation on the target virtual page.

25. The apparatus according to any one of claims 14 to 21, wherein, the apparatus further comprises a calling module, configured to: call the onCreate function to create the target virtual page when there is a creation requirement for the target virtual page; call the onDestory function to destroy the target virtual page when there is a closing requirement for the target virtual page; call the onStart function to display the target function view when there is a display requirement for the target function view, so that the target function view is in a visible and operable state; In the case where there is a need to stop displaying the target function view, call the stop onStop function to stop displaying the target function view, so that the target function view is in an invisible and inoperable state; In the case where the target function view switches back from the visible and inoperable state to the visible and operable state, call the resume onResume function to display the target function view; In the case where the target function view switches from the visible and operable state to the visible and inoperable state, call the pause onPause function to display the target function view.

26. The device according to any one of claims 14 to 21, characterized in that the target application is an input method application; the receiving module is further configured to receive the target call request for the input method application when the input method application is in the background running state and does not have the permission to use the input method function using the Activity page, and the target call request is used to call the input method function of the input method application for foreground use; the determining module is further configured to determine the target service container and the target virtual page corresponding to the input method function; the display module is further configured to render and display the target function view corresponding to the input method function in the target service container based on the display logic of the target service function provided in the target virtual page.

27. A terminal, characterized in that the terminal includes: a processor and a memory, the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the method for using the service function of the application according to any one of claims 1 to 13.

28. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the method for using the service function of the application according to any one of claims 1 to 13.

29. A computer program product, characterized in that the computer program product stores a computer program, and the computer program is loaded and executed by a processor to implement the method for using the service function of the application according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Method, device, electronic device and medium for page display

    CN109086109A

  • Page data interaction method and device, storage medium and electronic equipment

    CN111625741A

  • Page rendering method and device, rendering server and storage medium

    CN111814089A

  • Application program management method and device, apparatus

    CN111913750A