WO2023131146A1 - 一种虚拟任务栈的处理方法及装置 - Google Patents

一种虚拟任务栈的处理方法及装置 Download PDF

Info

Publication number
WO2023131146A1
WO2023131146A1 PCT/CN2023/070293 CN2023070293W WO2023131146A1 WO 2023131146 A1 WO2023131146 A1 WO 2023131146A1 CN 2023070293 W CN2023070293 W CN 2023070293W WO 2023131146 A1 WO2023131146 A1 WO 2023131146A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
affinity
started
task stack
startup
Prior art date
Application number
PCT/CN2023/070293
Other languages
English (en)
French (fr)
Inventor
袁科杰
金炼城
Original Assignee
北京有竹居网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京有竹居网络技术有限公司 filed Critical 北京有竹居网络技术有限公司
Publication of WO2023131146A1 publication Critical patent/WO2023131146A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/552Details of game data or player data management for downloading to client devices, e.g. using OS version, hardware or software profile of the client device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of computer technology, in particular to a method and device for processing a virtual task stack.
  • Free installation technology provides a complete virtual operating environment.
  • An application program that uses the installation-free technology can achieve the running effect that can be achieved by installing the application program without installing it on the system.
  • Game Box is an application program that uses installation-free technology.
  • the game box is a way to realize the game platform and distribution.
  • Android Android plug-in technology is needed to run the game in a plug-in way. If you use the plug-in method to run the game, you can use the game box to handle the page jump problem.
  • a virtual task stack can be added by the game box middleware, and the virtual task stack can be mapped to the system task stack, instead of the system to manage the task stack. Among them, the virtual task stack is used to manage game pages.
  • the current processing method of the virtual task stack has the problem that the startup effect of the application program page does not meet expectations. Therefore, a solution is urgently needed to solve the above problem.
  • the technical problem to be solved in this application is that the startup effect of the application program page due to the virtual stack processing method does not meet expectations, and a processing method and device for a virtual task stack are provided.
  • the embodiment of the present application provides a method for processing a virtual task stack, the method including:
  • a target virtual task stack for storing the page to be started is determined.
  • the virtual affinity of the page to be started includes:
  • a first affinity, or a second affinity the first affinity is the real affinity of the page to be started, and the second affinity is the affinity of the first virtual task stack , the first virtual task stack is a virtual task stack storing the source page.
  • determining a target virtual task stack for storing the page to be started based on the virtual affinity includes:
  • the target virtual task stack is determined based on the first affinity and the startup parameters of the page to be started.
  • the determining the target virtual task stack based on the virtual affinity and the startup parameters of the page to be started includes:
  • the undetermined virtual task stack complies with the startup parameters of the to-be-started page, determine the undetermined virtual task stack as the target virtual task stack.
  • the determining the target virtual task stack based on the virtual affinity and the startup parameters of the page to be started includes:
  • the target virtual task stack is created based on the startup parameters of the page to be started, and the affinity of the target virtual task stack is the first affinity.
  • determining the target virtual task stack for storing the page to be started based on the virtual affinity includes:
  • the target virtual task stack is determined based on the second affinity, the startup parameters of the page to be started, and the startup parameters of the source page.
  • the determining the target virtual task stack based on the virtual affinity, the startup parameters of the page to be started, and the startup parameters of the source page includes:
  • the pending virtual task stack complies with the startup parameters of the page to be started and the startup parameter of the source page, determine the pending virtual task stack as the target virtual task stack.
  • the determining the target virtual task stack based on the virtual affinity, the startup parameters of the page to be started, and the startup parameters of the source page includes:
  • the target virtual task stack is created based on the startup parameters of the page to be started or the startup parameters of the source page, and the affinity of the target virtual task stack is the second affinity.
  • the startup parameters include a startup mode and a startup flag, and there is a conflict between the startup mode and the startup flag of the page to be started, based on the first affinity and the startup parameters of the page to be started, determine
  • the target virtual task stack includes:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the first affinity and the startup mode of the to-be-started page, determine The target virtual task stack.
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the first affinity and the activation flag of the page to be activated , determine the target virtual task stack.
  • the startup parameters include a startup mode and a startup flag, and if there is a conflict between the startup mode and the startup logo of the page to be started, based on the second affinity, the startup parameters of the page to be started, and
  • the startup parameters of the source page determine the target virtual task stack, including:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the second affinity, the startup mode of the to-be-started page, and the The startup parameters of the source page are determined to determine the target virtual task stack;
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the second affinity, the activation flag of the page to be activated and the startup parameters of the source page to determine the target virtual task stack.
  • an embodiment of the present application provides a processing device for a virtual task stack, the device comprising:
  • An acquisition unit configured to acquire the startup parameters of the page to be started and the startup parameters of the source page of the page to be started;
  • a first determination unit configured to determine the virtual affinity of the page to be activated based on the activation parameter of the page to be activated and the activation parameter of the source page;
  • the second determining unit is configured to determine a target virtual task stack for storing the page to be started based on the virtual affinity.
  • the virtual affinity of the page to be started includes:
  • a first affinity, or a second affinity the first affinity is the real affinity of the page to be started, and the second affinity is the affinity of the first virtual task stack , the first virtual task stack is a virtual task stack storing the source page.
  • the second determining unit is configured to:
  • the target virtual task stack is determined based on the first affinity and the startup parameters of the page to be started.
  • the second determination unit is configured to:
  • the undetermined virtual task stack complies with the startup parameters of the to-be-started page, determine the undetermined virtual task stack as the target virtual task stack.
  • the second determination unit is configured to:
  • the target virtual task stack is created based on the startup parameters of the page to be started, and the affinity of the target virtual task stack is the first affinity.
  • the second determining unit is configured to:
  • the target virtual task stack is determined based on the second affinity, the startup parameters of the page to be started, and the startup parameters of the source page.
  • the second determination unit is configured to:
  • the pending virtual task stack complies with the startup parameters of the page to be started and the startup parameter of the source page, determine the pending virtual task stack as the target virtual task stack.
  • the second determination unit is configured to:
  • the target virtual task stack is created based on the startup parameters of the page to be started or the startup parameters of the source page, and the affinity of the target virtual task stack is the second affinity.
  • the startup parameters include a startup mode and a startup flag, and there is a conflict between the startup mode and the startup logo of the page to be started, and the second determination unit is configured to:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the first affinity and the startup mode of the to-be-started page, determine The target virtual task stack.
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the first affinity and the activation flag of the page to be activated , determine the target virtual task stack.
  • the startup parameters include a startup mode and a startup flag, and if there is a conflict between the startup mode and the startup flag of the page to be started, the second determination unit is configured to:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the second affinity, the startup mode of the to-be-started page, and the The startup parameters of the source page are determined to determine the target virtual task stack;
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the second affinity, the activation flag of the page to be activated and the startup parameters of the source page to determine the target virtual task stack.
  • an embodiment of the present application provides a device, where the device includes a processor and a memory;
  • the processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the above first aspects.
  • an embodiment of the present application provides a computer-readable storage medium, which is characterized by including instructions, and the instructions instruct a device to execute the method described in any one of the above first aspects.
  • an embodiment of the present application provides a computer program product, which, when running on a computer, causes the computer to execute the method described in any one of the above first aspects.
  • the embodiment of the present application has the following advantages:
  • An embodiment of the present application provides a method for processing a virtual task stack. Specifically, before starting a page to be started, start parameters of the page to be started and start parameters of a source page of the page to be started may be obtained. Based on the startup parameters of the page to be started and the startup parameters of the source page, determine the virtual affinity of the page to be started; then, based on the virtual affinity of the page to be started, determine the The target virtual task stack for the page.
  • the target virtual task stack for storing the page to be started is determined based on the virtual affinity of the page to be started, and the virtual affinity is based on the startup parameters and source of the page to be started
  • the starting parameters of the page are determined, therefore, the determined target virtual task stack takes into account the factors needed to start the page to be started based on the source page, therefore, the determined target virtual task stack is used to store the
  • the to-be-started page can make the start-up effect of the to-be-started page meet expectations.
  • FIG. 1 is a schematic flowchart of a method for processing a virtual task stack provided in an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a processing device for a virtual task stack provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a device provided by an embodiment of the present application .
  • the inventors of the present application found through research that, in the traditional technology, before starting a page, the virtual stack storing the page to be started can be determined according to the affinity of the page to be started and the start parameters of the page to be started.
  • the affinity of the virtual task stack storing the page to be started must be the affinity of the page to be started.
  • the effect after the page to be started is started does not meet expectations.
  • the startup parameters include: startup mode.
  • the startup modes may include four types: standard, singleTop, singleTask and singleInstance.
  • the startup parameter may also include a startup flag (flag). Regarding the startup mode and startup flag, no detailed description will be given here.
  • singleTop indicates that when the page to be started is already in the virtual task stack, the virtual task stack is reused. In other words, singleTop indicates that if there is already a page (eg C page) at the top of the virtual task stack, this page (eg C page) cannot be started repeatedly.
  • singleTask indicates that the page to be started needs to be at the top of the virtual task stack, and other pages stored in the virtual task stack need to be popped up.
  • singleInstance is the global singleton mode, which means that as long as the virtual task stack corresponding to a certain page has been created, the corresponding virtual task stack will not be recreated when the page needs to be started again. In other words, when the startup mode of a page is singleInstance, only one page can be stored in the virtual task stack of the page.
  • the embodiment of the present application does not specifically limit the startup flag of the page to be started.
  • the startup flag may include multipleTask, and multipleTask indicates that a virtual task stack needs to be created to store pages.
  • Scenario 1 The virtual task stack affinity of page A is abc, and the startup mode of page A is singleTask; the task stack affinity of page B is default, and the startup mode is standard (standard).
  • the desired effect is that page B is directly superimposed on page A.
  • the virtual task stack storing page B should be the virtual task stack storing page A, wherein the affinity of the virtual task stack storing page A is abc.
  • the affinity of the virtual task stack storing the B page is determined by the page affinity of the B page itself. Therefore, when the B page is started, the B page is stored in the default virtual task stack. task stack instead of being stored in the virtual task stack with an affinity of abc, so that the startup effect of the B page does not meet expectations.
  • Scenario 2 The affinity of page A is default, and the startup mode is single Instance; the affinity of page B is default, and the startup mode is singleTop.
  • the B page is stored in the virtual task stack where the A page is located, but the startup mode of the A page indicates that the virtual task stack can only store one page. Therefore, the startup effect of page B is not as expected.
  • Scenario 4 The affinity of page A is default, the startup mode is standard, and the startup flag is multipleTask; the affinity of page B is default, the startup mode is standard, and the flag is not started.
  • a virtual task stack for example, virtual task stack 1
  • the affinity of the virtual task stack 1 is default.
  • a virtual task stack (such as virtual task stack 2) will be recreated to store page A according to the start flag of page A, and the affinity of virtual task stack 2 for storing page A is also the default.
  • virtual task stack 1 is determined as the virtual task stack for storing page B from the two virtual task stacks with the default affinity according to the page starting sequence of the application.
  • Page A and Page B are the same page.
  • the affinity of page A is the default affinity, and the startup mode is singleTask; the startup mode of page B is singleTask, and the startup flag is multipleTask.
  • Page A and Page B are the same page.
  • the affinity of page A is the default affinity, and the startup mode is singleTop; the startup mode of page B is singleTop, and the startup flag is multipleTask.
  • the affinity of the page mentioned above refers to the real affinity of the page.
  • the real affinity of the page can be defined in the Android development file AndroidManifest.xml.
  • the embodiment of the present application provides a method for processing a virtual task stack, which can make the page startup effect meet expectations.
  • this figure is a schematic flowchart of a method for processing a virtual task stack provided by an embodiment of the present application.
  • the method provided in the embodiment of the present application may be executed by an installation-free application, such as a game application, which is not specifically limited in the embodiment of the present application.
  • the method shown in FIG. 1 may, for example, include the following steps: S101-S103.
  • S101 Acquire startup parameters of a page to be started and startup parameters of a source page of the page to be started.
  • the to-be-started page in the embodiment of the present application is a certain page that needs to be loaded during the running of the application without installation.
  • the startup parameters of the page can be defined in the Android development file AndroidManifest.xml. Therefore, in the embodiment of the present application, the startup parameters of the page to be started and the startup parameters of the source page can be acquired through the Android development file AndroidManifest.xml.
  • the startup parameters of the page are used to describe the startup effect of the page.
  • the startup parameters include: startup mode.
  • the startup modes may include four types: standard, singleTop, singleTask and singleInstance.
  • the startup parameter may also include a startup flag (flag). For the startup mode and startup flag, you can refer to the relevant description above, and the description will not be repeated here.
  • the source page of the page to be started refers to the page that is the basis for loading the page to be started. For example: if page A starts on the basis of page B, then page B is the source page of page A.
  • S102 Based on the activation parameters of the page to be activated and the activation parameters of the source page, determine the virtual affinity of the page to be activated.
  • the page to be started is started on the basis of the source page. Therefore, the actual startup effect of the page to be started is not only related to its own startup parameters, but also related to the startup parameters of the source page. Therefore, in the embodiment of the present application, the virtual affinity of the page to be started can be determined based on the start parameter of the page to be started and the start parameter of the source page, so as to further base on the virtual affinity A target virtual task stack for storing the page to be started is determined.
  • the virtual affinity of the page to be activated may be the real affinity of the page to be activated, or the second affinity, where the second affinity is the An affinity of a virtual task stack, the first virtual task stack is a virtual task stack storing the source page.
  • the startup of the to-be-started page is independent of the source page, that is: If the to-be-started page is not superimposed on the source page after being started, the virtual affinity of the to-be-started page is the real affinity of the to-be-started page. If the startup parameter of the page to be started and the startup parameter of the source page indicate that the startup effect of the page to be started is: directly superimposed on the source page, then the virtual affinity of the page to be started is Describe the second affinity.
  • first affinity the "true affinity of the page to be activated"
  • S103 Based on the virtual affinity, determine a target virtual task stack for storing the page to be started.
  • a target virtual task stack for storing the page to be started may be determined based on the virtual affinity.
  • the affinity of the target virtual task stack is the virtual affinity.
  • an existing virtual task stack whose affinity is the virtual affinity can be determined as the target virtual task stack, and a new virtual task stack can be created as the target virtual task stack.
  • the target virtual task stack described above is not specifically limited in this embodiment of the present application.
  • the virtual affinity may be the first affinity or the second affinity.
  • the following describes the specific implementation of S103 when the virtual affinity is the first affinity and the second affinity respectively.
  • the target virtual task stack may be determined based on the first affinity and the startup parameters of the page to be started.
  • “determine the target virtual task stack based on the first affinity and the startup parameters of the page to be started” can be realized in multiple ways, and two possible ways are introduced below.
  • the affinity of the target virtual task stack is equal to the virtual affinity.
  • the virtual task stack whose affinity is the first affinity can be determined as the pending virtual task stack from the existing virtual task stacks, and then, based on the startup parameters of the page to be started , judging whether the pending virtual task stack complies with the startup parameters of the page to be started. If the pending virtual task stack complies with the startup parameters of the page to be started, then determine the pending virtual task stack as the target virtual task stack. For example: if the startup mode of the page to be started is standard, then it can be considered that the virtual task stack to be determined meets the startup parameters of the page to be started. If the startup flag of the page to be started is multipleTask, it can be considered that the pending virtual task stack does not meet the startup parameters of the page to be started (because multipleTask indicates to create a new virtual task stack).
  • the target virtual task stack may be created based on the startup parameters of the page to be started.
  • the affinity of the virtual task stack is the virtual affinity of the first page pushed into the stack.
  • the target virtual task stack is used to store the pages to be started, and the virtual affinity of the pages to be started is the first affinity, therefore, the affinity of the target virtual task stack is the first affinity.
  • the target virtual task stack may be created if the startup parameter of the page to be started indicates that a new virtual task stack needs to be created.
  • the target virtual task stack may be created.
  • the aforementioned pending virtual task stack does not meet the startup parameters of the page to be started. For example: if the startup flag of the page to be started is multipleTask, then the target virtual task stack can be created.
  • the virtual affinity is the second affinity
  • the startup parameters of the source page determine the startup effect of the page to be started.
  • the target virtual task stack may be determined based on the second affinity, the startup parameters of the page to be started, and the startup parameters of the source page.
  • the affinity of the target virtual task stack is equal to the virtual affinity.
  • the virtual task stack whose affinity is the second affinity can be determined as the pending virtual task stack from the existing virtual task stacks, and then, based on the startup parameter of the page to be started and the startup parameters of the source page, and determine whether the pending virtual task stack conforms to the startup parameters of the page to be started and the startup parameters of the source page. If the pending virtual task stack matches the startup parameters of the page to be started and the startup parameter of the source page, then determine the pending virtual task stack as the target virtual task stack.
  • Example 1 The pending virtual task stack is the first virtual task stack, and the startup mode of the page to be started is standard, the startup mode of the source page is singleTask, the page to be started and the source page Not the same page. Then it can be considered that the pending virtual task stack conforms to the startup parameters of the page to be started and the startup parameters of the source page.
  • Example 2 the pending virtual task stack is the first virtual task stack, and the startup mode of the page to be started is singleTop, and the startup mode of the source page is single Instance, then the pending virtual task stack can be considered The startup parameters of the source page do not match (because single Instance indicates that the virtual task stack can only store one page).
  • the target virtual task stack may be created based on the startup parameters of the page to be started or the startup parameters of the source page. It can be understood that since the affinity of the virtual task stack is the virtual affinity of the first page pushed into the stack. The target virtual task stack is used to store pages to be started, and the virtual affinity of the pages to be started is the second affinity, therefore, the affinity of the target virtual task stack is the second affinity. In an example, if the startup parameter of the page to be started indicates that a new virtual task stack needs to be created, the target virtual task stack may be created. In yet another example, if the aforementioned pending virtual task stack does not meet the startup parameters of the page to be started or the startup parameter of the source page, the target virtual task stack may be created. In some embodiments, when the virtual task stack to be determined is the first virtual task stack, and the startup parameter of the source page indicates that the first virtual task stack can no longer store the page to be started, the target can be created Virtual task stack.
  • Example 1 If the startup flag of the page to be started is multipleTask, then the target virtual task stack can be created.
  • Example 2 the pending virtual task stack is the first virtual task stack, and the startup mode of the source page is single instance, then the target virtual task stack can be created according to the single instance.
  • the startup parameters may include a startup mode and a startup flag.
  • the page to be started there may be a conflict between its startup mode and startup flag.
  • the conflict between the startup mode and the startup flag means that the target virtual task stack determined according to the startup mode is inconsistent with the target virtual task stack determined according to the startup flag.
  • the pending virtual task stack is the first virtual task stack
  • the startup mode of the page to be started is single Instance
  • the startup flag of the page to be started is multipleTask.
  • the priority relationship can be preset, and when there is a conflict between the startup mode of the page to be started and the startup flag of the page to be started, according to the preset priority relationship, determine the The startup mode of the page to be started and the priority of the startup flag of the page to be started, and determine the target virtual task stack according to the factor with higher priority. Specifically: if the priority of the startup mode of the page to be started is higher than the priority of the startup flag of the page to be started, then determine the target virtual task stack based on the startup mode of the page to be started. If the priority of the startup mode of the page to be started is lower than the priority of the startup flag of the page to be started, the target virtual task stack is determined based on the startup flag of the page to be started.
  • the pending virtual task stack is the first virtual task stack
  • the startup mode of the page to be started is single Instance
  • the startup flag of the page to be started is multipleTask
  • the pending virtual task stack is the first virtual task stack
  • the page to be started is The source page is not the same page.
  • the first virtual task stack can be determined as the target virtual task stack, and according to the startup flag of the page to be started, the target virtual task stack needs to be created .
  • the priority of the startup mode single Instance is higher than that of the startup flag multipleTask, therefore, the target virtual task stack is determined based on the startup mode single Instance, that is, the first virtual task stack is determined as the target virtual task stack, Instead of creating a new virtual task stack as the target virtual task stack.
  • the preset priority relationship may be specifically set according to the actual situation, and is not specifically limited in this embodiment of the present application.
  • S103 can be implemented in two ways, one of which is: determining the target virtual task stack based on the first affinity and the startup parameters of the page to be started. Another implementation manner is: determining the target virtual task stack based on the second affinity, the startup parameters of the page to be started, and the startup parameters of the source page.
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the first affinity and the startup mode of the to-be-started page, determine The target virtual task stack.
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the first affinity and the activation flag of the page to be activated , determine the target virtual task stack.
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the second affinity, the startup mode of the to-be-started page, and the The startup parameters of the source page are determined to determine the target virtual task stack;
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the second affinity, the activation flag of the page to be activated and the startup parameters of the source page to determine the target virtual task stack.
  • the startup flag of the startup page and the startup parameters of the source page determine the target virtual task stack can refer to the above "based on the second affinity, the startup parameters of the page to be started and The start parameters of the source page determine the description part of the target virtual task stack", which will not be repeated here.
  • the target virtual task stack is determined based on the startup parameters of the page to be started, that is: based on the page to be started.
  • the startup mode and the startup flag of the page to be started determine the target virtual task stack.
  • the virtual affinity is determined according to the startup parameters of the page to be started and the startup parameters of the source page. Therefore, the target virtual task stack determined based on the virtual affinity takes into account the Factors that need to be considered for page startup of the page to be started. Therefore, using the determined target virtual task stack to store the page to be started can make the startup effect of the page to be started meet expectations.
  • Scenario 1 The virtual task stack affinity of page A is abc, and the startup mode of page A is singleTask; the task stack affinity of page B is default, and the startup mode is standard (standard).
  • the determined virtual affinity of the B page is abc, and since the virtual task stack of the A page conforms to the startup parameters of the A page and the startup parameters of the B page, the virtual task stack of the A page is It is determined as a virtual task stack for storing the B page, so as to achieve the effect that the B page is directly superimposed on the A page.
  • Scenario 2 The affinity of page A is default, and the startup mode is single Instance; the affinity of page B is default, and the startup mode is singleTop.
  • the virtual affinity of page B is the default, and the startup mode of page A is single instance. Therefore, the virtual task stack of page A is determined as the pending virtual task stack of page A, but because the pending virtual The task stack does not conform to the startup parameter (single Instance) of page A. Therefore, a virtual task stack is re-created to store page B, so that the startup effect of page B meets expectations.
  • Scenario 4 The affinity of page A is default, the startup mode is standard, and the startup flag is multipleTask; the affinity of page B is default, the startup mode is standard, and the flag is not started.
  • the affinity of the virtual task stack of page A is no longer the default affinity, but the virtual affinity of page A (for example, affinity cde).
  • the virtual affinity of page B is also cde, and the undetermined virtual task stack (virtual task stack of page A) conforms to the startup parameters of page A and the startup parameters of page B. Therefore, the virtual task stack of the A page is determined as the virtual task stack storing the B page, so as to achieve the effect that the B page is directly superimposed on the A page.
  • Page A and Page B are the same page.
  • the affinity of page A is the default affinity, and the startup mode is singleTask; the startup mode of page B is singleTask, and the startup flag is multipleTask.
  • Page A and Page B are the same page.
  • the affinity of page A is the default affinity, and the startup mode is singleTop; the startup mode of page B is singleTop, and the startup flag is multipleTask.
  • the apparatus 200 may specifically include: an acquiring unit 201 , a first determining unit 202 and a second determining unit 203 .
  • the obtaining unit 201 is configured to obtain the starting parameters of the page to be started and the starting parameters of the source page of the page to be started;
  • the first determination unit 202 is configured to determine the virtual affinity of the page to be activated based on the activation parameter of the page to be activated and the activation parameter of the source page;
  • the second determining unit 203 is configured to determine a target virtual task stack for storing the page to be started based on the virtual affinity.
  • the virtual affinity of the page to be started includes:
  • a first affinity, or a second affinity the first affinity is the real affinity of the page to be started, and the second affinity is the affinity of the first virtual task stack , the first virtual task stack is a virtual task stack storing the source page.
  • the second determining unit 202 is configured to:
  • the target virtual task stack is determined based on the first affinity and the startup parameters of the page to be started.
  • the second determining unit 202 is configured to:
  • the undetermined virtual task stack complies with the startup parameters of the to-be-started page, determine the undetermined virtual task stack as the target virtual task stack.
  • the second determining unit 202 is configured to:
  • the target virtual task stack is created based on the startup parameters of the page to be started, and the affinity of the target virtual task stack is the first affinity.
  • the second determining unit 202 is configured to:
  • the target virtual task stack is determined based on the second affinity, the startup parameters of the page to be started, and the startup parameters of the source page.
  • the second determining unit 202 is configured to:
  • the pending virtual task stack complies with the startup parameters of the page to be started and the startup parameter of the source page, determine the pending virtual task stack as the target virtual task stack.
  • the second determining unit 202 is configured to:
  • the target virtual task stack is created based on the startup parameters of the page to be started or the startup parameters of the source page, and the affinity of the target virtual task stack is the second affinity.
  • the startup parameters include a startup mode and a startup flag, and there is a conflict between the startup mode and the startup logo of the page to be started, and the second determining unit 202 is configured to:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the first affinity and the startup mode of the to-be-started page, determine The target virtual task stack.
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the first affinity and the activation flag of the page to be activated , determine the target virtual task stack.
  • the startup parameters include a startup mode and a startup flag, and if there is a conflict between the startup mode and the startup logo of the page to be started, the second determining unit 202 is configured to:
  • the predetermined priority relationship indicates that the priority of the startup mode of the to-be-started page is higher than the startup flag of the to-be-started page, based on the second affinity, the startup mode of the to-be-started page, and the The startup parameters of the source page are determined to determine the target virtual task stack;
  • the predetermined priority relationship indicates that the priority of the activation mode of the page to be activated is lower than the activation flag of the page to be activated, based on the second affinity, the activation flag of the page to be activated and the startup parameters of the source page to determine the target virtual task stack.
  • the device 200 is a device corresponding to the method provided by the above method embodiment, the specific realization of each unit of the device 200 is the same concept as the above method embodiment, therefore, regarding each unit of the device 200 For specific implementation, reference may be made to the description of the above method embodiments, and details are not repeated here.
  • the embodiment of the present application also provides a device, the device includes a processor and a memory;
  • the processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the above method embodiments.
  • FIG. 3 it shows a schematic structural diagram of an electronic device 300 suitable for implementing the embodiment of the present application.
  • the electronic equipment in the embodiment of the present application may include but not limited to mobile phones, notebook computers, digital broadcast receivers, PDA (Personal Digital Assistant, personal digital assistant), PAD (portable android device, tablet computer), PMP (Portable Media Player, portable multimedia player), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs (television, television sets), desktop computers, and the like.
  • PDA Personal Digital Assistant
  • PAD portable android device, tablet computer
  • PMP Portable Media Player, portable multimedia player
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals)
  • fixed terminals such as digital TVs (television, television sets), desktop computers, and the like.
  • the electronic device shown in FIG. 3 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.
  • an electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, which may be randomly accessed according to a program stored in a read-only memory (ROM) 302 or loaded from a storage device 308.
  • a processing device such as a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • various appropriate actions and processes are executed by programs in the memory (RAM) 303 .
  • RAM 303 various programs and data necessary for the operation of the electronic device 300 are also stored.
  • the processing device 301, ROM 302, and RAM 303 are connected to each other through a bus 304.
  • An input/output (I/O) interface 305 is also connected to the bus 304 .
  • the following devices can be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speaker, vibrating an output device 307 such as a computer; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309.
  • the communication means 309 may allow the electronic device 300 to perform wireless or wired communication with other devices to exchange data. While FIG. 3 shows electronic device 300 having various means, it should be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present application include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 309 , or from storage means 308 , or from ROM 302 .
  • the processing device 301 the above-mentioned functions defined in the methods of the embodiments of the present application are executed.
  • An embodiment of the present application provides a computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method described in any of the foregoing embodiments is implemented.
  • the computer-readable medium mentioned above in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can communicate using any currently known or future network protocols such as HTTP (HyperText Transfer Protocol, Hypertext Transfer Protocol), and can communicate with digital data in any form or medium
  • HTTP HyperText Transfer Protocol
  • the communication eg, communication network
  • Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the above-mentioned method.
  • Computer program code for carrying out the operations of this application may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider such as AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present application may be implemented by means of software or by means of hardware.
  • the name of the unit/module does not constitute a limitation of the unit itself in some cases, for example, the voice data collection module can also be described as a "data collection module”.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSPs Application Specific Standard Products
  • SOCs System on Chips
  • CPLD Complex Programmable Logical device
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Stored Programmes (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

本申请公开了一种虚拟任务栈的处理方法,在启动待启动页面之前,可以获取待启动页面的启动参数和待启动页面的来源页面的启动参数。基于待启动页面的启动参数和来源页面的启动参数,确定待启动页面的虚拟亲和度;而后,基于待启动页面的虚拟亲和度,确定用于存放待启动页面的目标虚拟任务栈。由此可见,基于待启动页面的虚拟亲和度确定用于存放待启动页面的目标虚拟任务栈,而虚拟亲和度是根据待启动页面的启动参数和来源页面的启动参数确定的,因此,所确定的目标虚拟任务栈,综合考虑了基于来源页面启动待启动页面所需要考虑的因素,因此,使用所确定的目标虚拟任务栈存放待启动页面,能够使得待启动页面的启动效果符合预期。

Description

一种虚拟任务栈的处理方法及装置
本申请要求于2022年1月10日提交中国国家知识产权局、申请号为202210023394.7、申请名称为“一种虚拟任务栈的处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别是涉及一种虚拟任务栈的处理方法及装置。
背景技术
免安装技术提供了完整的虚拟运行环境。应用了免安装技术的应用程序,无需安装到系统,也能达到安装该应用程序所能达到的运行效果。
例如:游戏盒子是一种应用了免安装技术的应用程序。游戏盒子是一种实现游戏平台和分发的方式,实现游戏盒子需要用到安卓(Android)插件化技术,使用插件化的方式运行游戏。若使用插件化的方式运行游戏,则可以使用游戏盒子处理页面跳转问题。在一种实现方式中:可以由游戏盒子中间件新增虚拟任务栈,通过虚拟任务栈映射到系统任务栈,代替系统进行任务栈的管理。其中,虚拟任务栈用于管理游戏页面。
目前的虚拟任务栈的处理方式,存在应用程序页面的启动效果不符合预期的问题,因此,急需一种方案,能够解决上述问题。
发明内容
本申请所要解决的技术问题是虚拟栈处理方式导致应用程序页面的启动效果不符合预期,提供一种虚拟任务栈的处理方法及装置。
第一方面,本申请实施例提供了一种虚拟任务栈的处理方法,所述方法包括:
获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数;
基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度;
基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
可选的,所述待启动页面的虚拟亲和度,包括:
第一亲和度,或者,第二亲和度,所述第一亲和度为所述待启动页面的真实亲和度,所述第二亲和度为第一虚拟任务栈的亲和度,所述第一虚拟任务栈为存放所述来源页面的虚拟任务栈。
可选的,若所述虚拟亲和度为所述第一亲和度,所述基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈,包括:
基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述基于所述虚拟亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
从已有的虚拟任务栈中、将亲和度为所述第一亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述基于所述虚拟亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
基于所述待启动页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第一亲和度。
可选的,若所述虚拟亲和度为所述第二亲和度,所述基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈,包括:
基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述基于所述虚拟亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
从已有的虚拟任务栈中、将亲和度为所述第二亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数以及所述来源页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述基于所述虚拟亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
基于所述待启动页面的启动参数或者所述来源页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第二亲和度。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标虚拟任务栈。
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,则基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈;
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
第二方面,本申请实施例提供了一种虚拟任务栈的处理装置,所述装置包括:
获取单元,用于获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数;
第一确定单元,用于基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度;
第二确定单元,用于基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
可选的,所述待启动页面的虚拟亲和度,包括:
第一亲和度,或者,第二亲和度,所述第一亲和度为所述待启动页面的真实亲和度,所述第二亲和度为第一虚拟任务栈的亲和度,所述第一虚拟任务栈为存放所述来源页面的虚拟任务栈。
可选的,若所述虚拟亲和度为所述第一亲和度,所述第二确定单元,用于:
基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述第二确定单元,用于:
从已有的虚拟任务栈中、将亲和度为所述第一亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述第二确定单元,用于:
基于所述待启动页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第一亲和度。
可选的,若所述虚拟亲和度为所述第二亲和度,所述第二确定单元,用于:
基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述第二确定单元,用于:
从已有的虚拟任务栈中、将亲和度为所述第二亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数以及所述来源页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述第二确定单元,用于:
基于所述待启动页面的启动参数或者所述来源页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第二亲和度。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,所述第二确定单元,用于:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标虚拟任务栈。
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,则所述第二确定单元,用于:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈;
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
第三方面,本申请实施例提供了一种设备,所述设备包括处理器和存储器;
所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行以上第一方面任一项所述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,其特征在于,包括指令,所述指令指示设备执行以上第一方面任一项所述的方法。
第五方面,本申请实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得计算机执行以上第一方面任一项所述的方法。
与现有技术相比,本申请实施例具有以下优点:
本申请实施例提供了一种虚拟任务栈的处理方法,具体地,在启动待启动页面之前,可以获取待启动页面的启动参数和所述待启动页面的来源页面的启动参数。基于所述待启动页面的启动参数和来源页面的启动参数,确定所述待启动页面的虚拟亲和度;而后,基于所述待启动页面的虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。由此可见,在本申请实施例中,基于待启动页面的虚拟亲和度确定用于存放待启动页面的目标虚拟任务栈,而所述虚拟亲和度是根据待启动页面的启动参数和来源页面的启动参数确定的,因此,所确定的目标虚拟任务栈,综合考虑了基于所述来源页面启动所述待启动页面所需要考虑的因素,因此,使用所确定的目标虚拟任务栈存放所述待启动页面,能够使得待启动页面的启动效果符合预期。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种虚拟任务栈的处理方法的流程示意图;
图2为本申请实施例提供的一种虚拟任务栈的处理装置的结构示意图;
图3为本申请实施例提供的一种设备的结构示意图
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的发明人经过研究发现,传统技术中,在启动一个页面之前,可以根据待启动页面的亲和度和待启动页面的启动参数确定存放该待启动页面的虚拟栈。存放待启动页面的虚拟任务栈的亲和度,一定是所述待启动页面的亲和度。但是,采用这种方式,在一些场景下,会使得待启动页面启动之后的效果不符合预期。
其中:启动参数包括:启动模式。在安卓系统中,所述启动模式可以包括standard、singleTop、singleTask和singleInstance这四种。另外,为了达到额外的页面启动效果,启动参数还可以包括启动标志(flag)。关于启动模式和启动flag,此处不做详细说明。
其中:
standard为默认启动模式。
singleTop表示待启动的页面已经处于虚拟任务栈时,复用该虚拟任务栈。换言之,singleTop指示若虚拟任务栈的栈顶已经有一个页面(例如C页面),则不能再重复启动该页面(例如C页面)。
singleTask表示待启动的页面需要处于虚拟任务栈的栈顶,并且,需要弹出该虚拟任务栈中存储的其它页面。
singleInstance为全局单例模式,表示只要创建过某一页面对应的虚拟任务 栈,则再需要启动该页面时,不再重新创建对应的虚拟任务栈。换言之,当某一页面的启动模式为singleInstance时,该页面的虚拟任务栈中只能存储一个该页面。
关于待启动页面的启动flag,本申请实施例不做具体限定。在一个示例中,所述启动flag可以包括multipleTask,multipleTask指示需要新建一个虚拟任务栈以存放页面。
以下介绍几种可能的场景。
场景1:A页面的虚拟任务栈亲和度为abc,A页面的启动模式为singleTask;B页面的任务栈亲和度为默认,启动模式为标准(standard)。
当在A页面的基础上启动B页面时,希望达到的效果是B页面直接叠加在A页面上。换言之,存放B页面的虚拟任务栈理应是存放A页面的虚拟任务栈,其中,存放A页面的虚拟任务栈的亲和度为abc。
但是,在传统技术中,存放B页面的虚拟任务栈的亲和度,由B页面自身的页面亲和度确定,故而,在启动B页面时,将B页面存放在亲和度为默认的虚拟任务栈中,而不是存放在亲和度为abc的虚拟任务栈中,从而导致B页面的启动效果不符合预期。
场景2:A页面的亲和度默认,启动模式为single Instance;B页面的亲和度为默认,启动模式为singleTop。
在传统技术中,会将B页面存储在A页面所在的虚拟任务栈中,但是,A页面的启动模式指示了该虚拟任务栈只能存储一个页面。因此,B页面的启动效果不符合预期。
场景3:A页面和B页面为同一个页面,A页面和B页面的启动参数均为:启动模式是singleTask或singleTop,启动flag是multipleTask。
当在A页面的基础上启动B页面时,希望达到的效果是不重新启动页面B。而在传统技术中,会新建一个新的虚拟任务栈存放B页面,并且,启动了页面B。
场景4:A页面的亲和度为默认,启动模式是standard,启动flag是multipleTask;B页面的亲和度为默认,启动模式是standard,没有启动flag。
当在A页面的基础上启动B页面时,希望达到的效果是:将B页面存放在存放A页面的虚拟任务栈中。
而在传统技术中,在应用的第一个页面启动时,会创建一个虚拟任务栈(例如虚拟任务栈1),该虚拟任务栈1的亲和度为默认。而A页面启动之后,根据A页面的启动flag会重新创建一个虚拟任务栈(例如虚拟任务栈2)以存放A页面,存放A页面的虚拟任务栈2的亲和度也是默认。在启动B页面时,会根据应用的页面启动顺序从这两个亲和度为默认的虚拟任务栈中,将虚拟任务栈1确定为存放页面B的虚拟任务栈。
场景5:A页面和B页面是同一个页面。A页面的亲和度为默认亲和度,启动模式为singleTask;B页面的启动模式是singleTask,启动flag是multipleTask。
当在A页面的基础上启动B页面时,希望达到的效果是:不启动B页面。但是,在传统技术中,会新建一个虚拟任务栈存放B页面,并且,重新启动B页面。
场景6:A页面和B页面是同一个页面。A页面的亲和度为默认亲和度,启动模式为singleTop;B页面的启动模式是singleTop,启动flag是multipleTask。
当在A页面的基础上启动B页面时,希望达到的效果是:不启动B页面。但是,在传统技术中,会新建一个虚拟任务栈存放B页面,并且,重新启动B页面。
需要说明的是,以上提及的页面的亲和度,指的是页面的真实亲和度。对于安卓操作系统而言,页面的真实亲和度,可以在安卓开发文件AndroidManifest.xml中定义。
为了解决上述问题,本申请实施例提供了一种虚拟任务栈的处理方法,能够使得页面的启动效果符合预期。
下面结合附图,详细说明本申请的各种非限制性实施方式。
示例性方法
参见图1,该图为本申请实施例提供的一种虚拟任务栈的处理方法的流程示意图。本申请实施例提供的方法,可以由免安装应用执行,该免安装应用例如可以是游戏应用,本申请实施例不做具体限定。
图1所示的方法,例如可以包括以下步骤:S101-S103。
S101:获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数。
本申请实施例中的待启动页面,为免安装应用运行过程中需要加载的某一个页面。
在一个示例中,页面的启动参数可以在安卓开发文件AndroidManifest.xml中定义。因此,在本申请实施例中,可以通过所述安卓开发文件AndroidManifest.xml获取所述待启动页面的启动参数和所述来源页面的启动参数。
关于启动参数,需要说明的是,对于一个页面而言,该页面的启动参数用于描述该页面的启动效果。在一个示例中,启动参数包括:启动模式。在安卓系统中,所述启动模式可以包括standard、singleTop、singleTask和singleInstance这四种。另外,为了达到额外的页面启动效果,启动参数也可以包括启动标志(flag)。关于启动模式和启动flag,可以参考上文的相关描述部分,此处不再重复说明。
关于待启动页面的来源页面,需要说明的是,待启动页面的来源页面指的是作为待启动页面加载的基础的页面。举例说明:若A页面在B页面的基础上启动,则B页面为A页面的来源页面。
S102:基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度。
在本申请实施例中,考虑到由于待启动页面在来源页面的基础上启动。因此,待启动页面的实际启动效果除了与自身的启动参数相关之外,还与所述来源页面的启动参数相关。因此,在本申请实施例中,可以基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度,以便于进一步基于所述虚拟亲和度确定用于存放所述待启动页面的目标虚拟任务栈。
关于S102,需要说明的是:所述待启动页面的虚拟亲和度,可以是所述待启动页面的真实亲和度,也可以是第二亲和度,其中,第二亲和度为第一虚拟任务栈的亲和度,所述第一虚拟任务栈为存放所述来源页面的虚拟任务栈。
需要说明的是,在本申请实施例中,对于一个虚拟任务栈而言,其亲和度为第一个入栈的页面的虚拟亲和度。可以理解的是,所述第二亲和度,也就是所述来源页面的虚拟亲和度。
在一些实施例中,若所述待启动页面的启动参数和所述来源页面的启动参 数指示所述待启动页面的启动效果为:所述待启动页面启动之后独立于所述来源页面,即:所述待启动页面启动之后不叠加在所述来源页面上,则所述待启动页面的虚拟亲和度为所述待启动页面的真实亲和度。若所述待启动页面的启动参数和所述来源页面的启动参数指示所述待启动页面的启动效果为:直接叠加在所述来源页面上,则所述待启动页面的虚拟亲和度为所述第二亲和度。
为方便描述,在下文中,将“所述待启动页面的真实亲和度”称为“第一亲和度”。
S103:基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
确定待启动页面的虚拟亲和度之后,可以基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
在本申请实施例中,所述目标虚拟任务栈的亲和度,为所述虚拟亲和度。在一个示例中,S103在具体实现时,例如可以将已有的亲和度为所述虚拟亲和度的虚拟任务栈确定为所述目标虚拟任务栈,又如可以新建一个虚拟任务栈作为所述目标虚拟任务栈,本申请实施例不做具体限定。
如上所述,所述虚拟亲和度可以是第一亲和度或者第二亲和度。以下分别介绍当所述虚拟亲和度为第一亲和度和第二亲和度时,S103的具体实现方式。
在一个示例中,若所述虚拟亲和度为所述第一亲和度,则说明所述待启动页面无需叠加在所述来源页面上,此时,可以根据所述待启动页面的启动参数来确定所述待启动页面的启动效果。对于这种情况,S103在具有实现时,可以基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。其中,“基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈”在具体实现时,可以有多种实现方式,以下介绍两种可能的实现方式。
如前所述,目标虚拟任务栈的亲和度,等于所述虚拟亲和度。在一些实施例中,可以从已有的虚拟任务栈中、将亲和度为所述第一亲和度的虚拟任务栈确定为待定虚拟任务栈,而后,基于所述待启动页面的启动参数,判断所述待定虚拟任务栈是否符合所述待启动页面的启动参数。若所述待定虚拟任务栈符合所述待启动页面的启动参数,则将所述待定虚拟任务栈确定为所述目标虚拟任务栈。举例说明:若所述待启动页面的启动模式为标准,则可以认为所述待 定虚拟任务栈符合所述待启动页面的启动参数。若所述待启动页面的启动flag为multipleTask,则可以认为所述待定虚拟任务栈不符合所述待启动页面的启动参数(因为multipleTask指示新建一个虚拟任务栈)。
在又一些实施例中,可以基于所述待启动页面的启动参数,创建所述目标虚拟任务栈。如前文所述,虚拟任务栈的亲和度为第一个入栈的页面的虚拟亲和度。而目标虚拟任务栈用于存放待启动页面,并且,待启动页面的虚拟亲和度为第一亲和度,故而,所述目标虚拟任务栈的亲和度为所述第一亲和度。在一个示例中,若所述待启动页面的启动参数指示需要新建一个虚拟任务栈,则可以创建所述目标虚拟任务栈。在又一个示例中,若前述待定虚拟任务栈不符合所述待启动页面的启动参数,则可以创建所述目标虚拟任务栈。举例说明:所述待启动页面的启动flag为multipleTask,则可以创建所述目标虚拟任务栈。
在一个示例中,若所述虚拟亲和度为所述第二亲和度,则说明所述待启动页面需要叠加在所述来源页面上,此时,可以根据所述待启动页面的启动参数以及所述来源页面的启动参数来确定所述待启动页面的启动效果。对于这种情况,S103在具有实现时,可以基于所述第二亲和度、所述待启动页面的启动参数和所述来源页面的启动参数,确定所述目标虚拟任务栈。其中,“基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈”在具体实现时,可以有多种实现方式,以下介绍两种可能的实现方式。
如前所述,目标虚拟任务栈的亲和度,等于所述虚拟亲和度。在一些实施例中,可以从已有的虚拟任务栈中、将亲和度为所述第二亲和度的虚拟任务栈确定为待定虚拟任务栈,而后,基于所述待启动页面的启动参数和所述来源页面的启动参数,判断所述待定虚拟任务栈是否符合所述待启动页面的启动参数和所述来源页面的启动参数。若所述待定虚拟任务栈符合所述待启动页面的启动参数和所述来源页面的启动参数,则将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
举例说明1:所述待定虚拟任务栈为第一虚拟任务栈,并且,所述待启动页面的启动模式为标准,所述来源页面的启动模式为singleTask,所述待启动页面和所述来源页面不是同一个页面。则可以认为所述待定虚拟任务栈符合所述待启动页面的启动参数和所述来源页面的启动参数。
举例说明2:所述待定虚拟任务栈为第一虚拟任务栈,并且,所述待启动页面的启动模式为singleTop,所述来源页面的启动模式为single Instance,则可以认为所述待定虚拟任务栈不符合所述来源页面的启动参数(因为single Instance指示虚拟任务栈只能存放一个页面)。
在又一些实施例中,可以基于所述待启动页面的启动参数或者所述来源页面的启动参数,创建所述目标虚拟任务栈。可以理解的是,由于虚拟任务栈的亲和度为第一个入栈的页面的虚拟亲和度。而目标虚拟任务栈用于存放待启动页面,并且,待启动页面的虚拟亲和度为第二亲和度,故而,所述目标虚拟任务栈的亲和度为所述第二亲和度。在一个示例中,若所述待启动页面的启动参数指示需要新建一个虚拟任务栈则可以创建所述目标虚拟任务栈。在又一个示例中,若前述待定虚拟任务栈不符合所述待启动页面的启动参数或者所述来源页面的启动参数,则可以创建所述目标虚拟任务栈。在一些实施例中,当待定虚拟任务栈为所述第一虚拟任务栈、且所述来源页面的启动参数指示该第一虚拟任务栈不能再存放所述待启动页面,则可以创建所述目标虚拟任务栈。
举例说明1:所述待启动页面的启动flag为multipleTask,则可以创建所述目标虚拟任务栈。
举例说明2:所述待定虚拟任务栈为第一虚拟任务栈,并且,所述来源页面的启动模式为single Instance,则可以根据该single Instance创建所述目标虚拟任务栈。
如前所述,在一些示例中,启动参数可以包括启动模式和启动flag。在一些场景中,对于待启动页面而言,其启动模式和启动flag可能会存在冲突。其中,启动模式和启动flag存在冲突,指的是根据启动模式所确定的目标虚拟任务栈和根据所述启动flag所确定的目标虚拟任务栈不一致。
举例说明:待定虚拟任务栈为第一虚拟任务栈,待启动页面的启动模式为single Instance,待启动页面的启动flag为multipleTask。则当待定虚拟任务栈为第一虚拟任务栈,并且,待启动页面的来源页面不是同一个页面时,基于所述待启动页面的启动模式,可以将所述第一虚拟任务栈确定为目标虚拟任务栈,而根据待启动页面的启动flag,则需要创建所述目标虚拟任务栈。
鉴于此,在本申请实施例中,可以预先设置优先级关系,当所述待启动页面的启动模式和待启动页面的启动flag存在冲突时,根据所述预先设置的优先 级关系,确定所述待启动页面的启动模式和待启动页面的启动flag的优先级,并根据优先级高的因素来确定目标虚拟任务栈。具体地:若所述待启动页面的启动模式的优先级高于所述待启动页面的启动flag的优先级,则基于所述待启动页面的启动模式确定所述目标虚拟任务栈。若所述待启动页面的启动模式的优先级低于所述待启动页面的启动flag的优先级,则基于所述待启动页面的启动flag确定所述目标虚拟任务栈。
举例说明:待定虚拟任务栈为第一虚拟任务栈,待启动页面的启动模式为single Instance,待启动页面的启动flag为multipleTask,待定虚拟任务栈为第一虚拟任务栈,并且,待启动页面的来源页面不是同一个页面基于所述待启动页面的启动模式,可以将所述第一虚拟任务栈确定为目标虚拟任务栈,而根据待启动页面的启动flag,则需要创建所述目标虚拟任务栈。在本申请实施例中,启动模式single Instance的优先级高于启动flag multipleTask,因此,基于所述启动模式single Instance确定目标虚拟任务栈,即将所述第一虚拟任务栈确定为目标虚拟任务栈,而不是创建一个新的虚拟任务栈作为目标虚拟任务栈。
关于预先设置的优先级关系,可以根据实际情况具体设置,本申请实施例不作具体限定。
如前所述,S103在具体实现时,可以有两种实现方式,其中一种方式为:基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。另外一种实现方式为:基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
因此,当所述待启动页面的启动模式和启动标志存在冲突,“基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈”在具体实现时,可以包括:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标虚拟任务栈。
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈。
关于“基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标 虚拟任务栈”和“基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈”的具体实现,可以参考上文对于“基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈”的描述部分,此处不再重复描述。
当所述待启动页面的启动模式和启动标志存在冲突,“基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈”,在具体实现时,可以包括:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈;
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
关于“基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈”和“基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈”的具体实现,可以参考上文对于“基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈”的描述部分,此处不再重复描述。
可以理解的是,当所述待启动页面的启动模式和待启动页面的启动flag不存在冲突时,基于所述待启动页面的启动参数确定目标虚拟任务栈,即:基于所述待启动页面的启动模式和所述待启动页面的启动flag确定目标虚拟任务栈。
如上所述可知,所述虚拟亲和度是根据待启动页面的启动参数和来源页面的启动参数确定的,因此,基于虚拟亲和度所确定的目标虚拟任务栈,综合考虑了基于所述来源页面启动所述待启动页面所需要考虑的因素,因此使用所确定的目标虚拟任务栈存放所述待启动页面,能够使得待启动页面的启动效果符合预期。
接下来,介绍应用了本申请实施例提供的方案之后,上文提及的6个场景的页面启动效果。
场景1:A页面的虚拟任务栈亲和度为abc,A页面的启动模式为singleTask;B页面的任务栈亲和度为默认,启动模式为标准(standard)。
利用本方案之后,所确定的B页面的虚拟亲和合为abc,并且,由于A页面的虚拟任务栈符合A页面的启动参数和B页面的启动参数,因此,将所述A页面的虚拟任务栈确定为存放B页面的虚拟任务栈,从而达到B页面直接叠加在A页面上的效果。
场景2:A页面的亲和度默认,启动模式为single Instance;B页面的亲和度为默认,启动模式为singleTop。
利用本方案之后,确定B页面的虚拟亲和度为默认,而A页面的启动模式为single Instance,因此,将A页面的虚拟任务栈确定为A页面的待定虚拟任务栈,但是由于该待定虚拟任务栈不符合A页面的启动参数(single Instance),因此,重新创建一个虚拟任务栈以存放页面B,从而使得B页面的启动效果符合预期。
场景3:A页面和B页面为同一个页面,A页面和B页面的启动参数均为:启动模式是singleTask或singleTop,启动flag是multipleTask。
利用本申请实施例的方案之后,由于singleTask的优先级高于multipleTask(singleTop的优先级也高于multipleTask),因此,不会重新启动A页面。
场景4:A页面的亲和度为默认,启动模式是standard,启动flag是multipleTask;B页面的亲和度为默认,启动模式是standard,没有启动flag。
利用本方案之后,A页面的虚拟任务栈的亲和度不再是默认亲和度,而是A页面的虚拟亲和度(例如亲和度cde)。而B页面的虚拟亲和度也是cde,并且,待定虚拟任务栈(A页面的虚拟任务栈)符合A页面的启动参数以及B页面的启动参数。因此,将所述A页面的虚拟任务栈确定为存放B页面的虚拟任务栈,从而达到B页面直接叠加在A页面上的效果。
场景5:A页面和B页面是同一个页面。A页面的亲和度为默认亲和度,启动模式为singleTask;B页面的启动模式是singleTask,启动flag是multipleTask。
利用本申请实施例的方案之后,由于singleTask的优先级高于multipleTask,因此,不会重新启动A页面。
场景6:A页面和B页面是同一个页面。A页面的亲和度为默认亲和度, 启动模式为singleTop;B页面的启动模式是singleTop,启动flag是multipleTask。
利用本申请实施例的方案之后,由于singleTop的优先级高于multipleTask,因此,不会重新启动A页面。
示例性设备
基于以上实施例提供的方法,本申请实施例还提供了一种装置,以下结合附图介绍该装置。
参见图2,该图为本申请实施例提供的一种虚拟任务栈的处理装置的结构示意图。所述装置200例如可以具体包括:获取单元201、第一确定单元202和第二确定单元203。
获取单元201,用于获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数;
第一确定单元202,用于基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度;
第二确定单元203,用于基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
可选的,所述待启动页面的虚拟亲和度,包括:
第一亲和度,或者,第二亲和度,所述第一亲和度为所述待启动页面的真实亲和度,所述第二亲和度为第一虚拟任务栈的亲和度,所述第一虚拟任务栈为存放所述来源页面的虚拟任务栈。
可选的,若所述虚拟亲和度为所述第一亲和度,所述第二确定单元202,用于:
基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述第二确定单元202,用于:
从已有的虚拟任务栈中、将亲和度为所述第一亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述第二确定单元202,用于:
基于所述待启动页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第一亲和度。
可选的,若所述虚拟亲和度为所述第二亲和度,所述第二确定单元202,用于:
基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
可选的,所述第二确定单元202,用于:
从已有的虚拟任务栈中、将亲和度为所述第二亲和度的虚拟任务栈确定为待定虚拟任务栈;
在所述待定虚拟任务栈符合所述待启动页面的启动参数以及所述来源页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
可选的,所述第二确定单元202,用于:
基于所述待启动页面的启动参数或者所述来源页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第二亲和度。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,所述第二确定单元202,用于:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标虚拟任务栈。
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈。
可选的,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,则所述第二确定单元202,用于:
若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈;
或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
由于所述装置200是与以上方法实施例提供的方法对应的装置,所述装置200的各个单元的具体实现,均与以上方法实施例为同一构思,因此,关于所述装置200的各个单元的具体实现,可以参考以上方法实施例的描述部分,此处不再赘述。
本申请实施例还提供了一种设备,所述设备包括处理器和存储器;
所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行以上方法实施例任一项所述的方法。
下面参考图3,其示出了适于用来实现本申请实施例的电子设备300的结构示意图。本申请实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(Personal Digital Assistant,个人数字助理)、PAD(portable android device,平板电脑)、PMP(Portable Media Player,便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV(television,电视机)、台式计算机等等的固定终端。图3示出的电子设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图3所示,电子设备300可以包括处理装置(例如中央处理器、图形处理器等)301,其可以根据存储在只读存储器(ROM)302中的程序或者从存储装置308加载到随机访问存储器(RAM)303中的程序而执行各种适当的动作和处理。在RAM303中,还存储有电子设备300操作所需的各种程序和数据。处理装置301、ROM 302以及RAM 303通过总线304彼此相连。输入/输出(I/O)接口305也连接至总线304。
通常,以下装置可以连接至I/O接口305:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置306;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置307;包括例如磁带、硬盘等的存储装置308;以及通信装置309。通信装置309可以允许电子设备300与其他设备进行无线或有线通信以交换数据。虽然图3示出了具有各种装置的电子设备300,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品, 其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置309从网络上被下载和安装,或者从存储装置308被安装,或者从ROM302被安装。在该计算机程序被处理装置301执行时,执行本申请实施例的方法中限定的上述功能。
本申请实施例提供的电子设备与上述实施例提供的方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本申请实施例提供一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如上述任一实施例所述的方法。
需要说明的是,本申请上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网 络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元/模块的名称在某种情况下并不构 成对该单元本身的限定,例如,语音数据采集模块还可以被描述为“数据采集模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本申请的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制
以上所述仅为本申请的较佳实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (14)

  1. 一种虚拟任务栈的处理方法,其特征在于,所述方法包括:
    获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数;
    基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度;
    基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
  2. 根据权利要求1所述的方法,其特征在于,所述待启动页面的虚拟亲和度,包括:
    第一亲和度,或者,第二亲和度,所述第一亲和度为所述待启动页面的真实亲和度,所述第二亲和度为第一虚拟任务栈的亲和度,所述第一虚拟任务栈为存放所述来源页面的虚拟任务栈。
  3. 根据权利要求2所述的方法,其特征在于,若所述虚拟亲和度为所述第一亲和度,所述基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈,包括:
    基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述虚拟亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
    从已有的虚拟任务栈中、将亲和度为所述第一亲和度的虚拟任务栈确定为待定虚拟任务栈;
    在所述待定虚拟任务栈符合所述待启动页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
  5. 根据权利要求3所述的方法,其特征在于,所述基于所述虚拟亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
    基于所述待启动页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第一亲和度。
  6. 根据权利要求2所述的方法,其特征在于,若所述虚拟亲和度为所述第二亲和度,所述基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈,包括:
    基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述虚拟亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
    从已有的虚拟任务栈中、将亲和度为所述第二亲和度的虚拟任务栈确定为待定虚拟任务栈;
    在所述待定虚拟任务栈符合所述待启动页面的启动参数以及所述来源页面的启动参数的情况下,将所述待定虚拟任务栈确定为所述目标虚拟任务栈。
  8. 根据权利要求6所述的方法,其特征在于,所述基于所述虚拟亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
    基于所述待启动页面的启动参数或者所述来源页面的启动参数,创建所述目标虚拟任务栈,所述目标虚拟任务栈的亲和度为所述第二亲和度。
  9. 根据权利要求3所述的方法,其特征在于,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,基于所述第一亲和度和所述待启动页面的启动参数,确定所述目标虚拟任务栈,包括:
    若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动模式,确定所述目标虚拟任务栈。
    或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第一亲和度和所述待启动页面的启动标志,确定所述目标虚拟任务栈。
  10. 根据权利要求6所述的方法,其特征在于,所述启动参数包括启动模式和启动标志,并且,所述待启动页面的启动模式和启动标志存在冲突,则基于所述第二亲和度、所述待启动页面的启动参数以及所述来源页面的启动参数,确定所述目标虚拟任务栈,包括:
    若预先确定的优先级关系指示所述待启动页面的启动模式的优先级高于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动模式以及所述来源页面的启动参数,确定所述目标虚拟任务栈;
    或者,若预先确定的优先级关系指示所述待启动页面的启动模式的优先级低于所述待启动页面的启动标志,则基于所述第二亲和度、所述待启动页面的启动标志以及所述来源页面的启动参数,确定所述目标虚拟任务栈。
  11. 一种虚拟任务栈的处理装置,其特征在于,所述装置包括:
    获取单元,用于获取待启动页面的启动参数以及所述待启动页面的来源页面的启动参数;
    第一确定单元,用于基于所述待启动页面的启动参数和所述来源页面的启动参数,确定所述待启动页面的虚拟亲和度;
    第二确定单元,用于基于所述虚拟亲和度,确定用于存放所述待启动页面的目标虚拟任务栈。
  12. 一种设备,其特征在于,所述设备包括处理器和存储器;
    所述处理器用于执行所述存储器中存储的指令,以使得所述设备执行如权利要求1至10中任一项所述的方法。
  13. 一种计算机可读存储介质,其特征在于,包括指令,所述指令指示设备执行如权利要求1至10中任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1至10中任一项所述的方法。
PCT/CN2023/070293 2022-01-10 2023-01-04 一种虚拟任务栈的处理方法及装置 WO2023131146A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210023394.7A CN116450279A (zh) 2022-01-10 2022-01-10 一种虚拟任务栈的处理方法及装置
CN202210023394.7 2022-01-10

Publications (1)

Publication Number Publication Date
WO2023131146A1 true WO2023131146A1 (zh) 2023-07-13

Family

ID=87073136

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/070293 WO2023131146A1 (zh) 2022-01-10 2023-01-04 一种虚拟任务栈的处理方法及装置

Country Status (2)

Country Link
CN (1) CN116450279A (zh)
WO (1) WO2023131146A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091585A1 (en) * 2003-10-23 2005-04-28 Microsoft Corporation Systems and methods for pagination and co-pagination
CN106778248A (zh) * 2016-12-26 2017-05-31 北京奇虎科技有限公司 应用程序Activity启动的方法和装置
CN109426532A (zh) * 2017-08-22 2019-03-05 腾讯科技(深圳)有限公司 安卓系统中衔接页面的方法、装置及电子设备

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050091585A1 (en) * 2003-10-23 2005-04-28 Microsoft Corporation Systems and methods for pagination and co-pagination
CN106778248A (zh) * 2016-12-26 2017-05-31 北京奇虎科技有限公司 应用程序Activity启动的方法和装置
CN109426532A (zh) * 2017-08-22 2019-03-05 腾讯科技(深圳)有限公司 安卓系统中衔接页面的方法、装置及电子设备

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Android四种启动模式(standard, singleTop, singleTask, singleInstance)", 14 July 2020 (2020-07-14), XP093077480, Retrieved from the Internet <URL:https://blog.csdn.net/u012211003/article/details/107345027> *
ANONYMOUS: "Thoroughly understand the Activity startup mode-SingleTop, SingleTask, SingleInstance specific usage scenarios", 3 June 2016 (2016-06-03), XP093077478, Retrieved from the Internet <URL:https://blog.csdn.net/zivensonice/article/details/51569502> *

Also Published As

Publication number Publication date
CN116450279A (zh) 2023-07-18

Similar Documents

Publication Publication Date Title
US10515056B2 (en) API for resource discovery and utilization
WO2021068634A1 (zh) 页面跳转方法、装置、电子设备及计算机可读存储介质
WO2020143555A1 (zh) 用于展现信息的方法和装置
WO2021082649A1 (zh) 榜单更新方法、装置、可读介质和电子设备
WO2021088794A1 (zh) 控件设置方法、装置、电子设备及交互系统
WO2023061286A1 (zh) 操作系统启动方法、装置和电子设备
WO2023173954A1 (zh) 数据获取方法、装置、存储介质以及电子设备
CN110784520A (zh) 文件下载方法、装置及电子设备
CN111309391A (zh) 应用程序启动方法、装置、设备及介质
CN111079125A (zh) 一种应用程序调用第三方库动态提升权限的方法及装置
WO2023061287A1 (zh) 操作系统启动方法、装置和电子设备
WO2020224294A1 (zh) 用于处理信息的系统、方法和装置
CN114201317B (zh) 数据传输方法、装置、存储介质及电子设备
WO2022148231A1 (zh) 应用程序启动控制方法、装置、电子设备和存储介质
CN113407165B (zh) Sdk的生成和自升级方法、装置、可读介质和设备
CN112416303B (zh) 软件开发工具包热修复方法、装置及电子设备
WO2024055819A1 (zh) 页面展示方法、装置、存储介质和电子设备
US20240007591A1 (en) Method and apparatus of interaction video connection, electronic device, and storage medium
CN112020704A (zh) 用于执行应用更新周期的资源的设备间传输
WO2023072070A1 (zh) 显示控制方法、装置和电子设备
WO2020186927A1 (zh) 数据分享方法、装置、设备及介质
WO2023179404A1 (zh) 直播启播方法、设备及程序产品
WO2023131146A1 (zh) 一种虚拟任务栈的处理方法及装置
WO2023093633A1 (zh) 终端固件的启动方法、装置、电子设备及存储介质
CN109614089B (zh) 数据访问代码的自动生成方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23737011

Country of ref document: EP

Kind code of ref document: A1