WO2020177699A1 - App execution method, computer device, and storage medium - Google Patents

App execution method, computer device, and storage medium Download PDF

Info

Publication number
WO2020177699A1
WO2020177699A1 PCT/CN2020/077696 CN2020077696W WO2020177699A1 WO 2020177699 A1 WO2020177699 A1 WO 2020177699A1 CN 2020077696 W CN2020077696 W CN 2020077696W WO 2020177699 A1 WO2020177699 A1 WO 2020177699A1
Authority
WO
WIPO (PCT)
Prior art keywords
applet
running
program
small program
determined
Prior art date
Application number
PCT/CN2020/077696
Other languages
French (fr)
Chinese (zh)
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 WO2020177699A1 publication Critical patent/WO2020177699A1/en

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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Definitions

  • the present invention relates to computer application technology, in particular to a method for running a small program, a computer device and a storage medium.
  • Mini Programs are a brand new way to connect users and services. They usually depend on the host application, that is, they cannot be operated separately from the host application.
  • the present invention provides a method for running an applet, a computer device and a storage medium.
  • a method for running a small program including:
  • a computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, and the processor implements the method described above when the program is executed.
  • a multi-dimensional operating environment can be maintained for at least two small programs launched by the user.
  • an operating environment is created for each small program, and the operating environments of different small programs are mutually exclusive. Independence, thereby realizing simultaneous operation of multiple small programs, thereby avoiding problems in the prior art to a certain extent, and saving system resource consumption.
  • Figure 1 is a schematic diagram of the data sharing method of the present invention.
  • Fig. 2 is a flowchart of an embodiment of a method for running a small program according to the present invention.
  • Figure 3 shows a block diagram of an exemplary computer system/server 12 suitable for implementing embodiments of the present invention.
  • the embodiment of the present invention discloses a method for running a small program, which can maintain a multi-dimensional operating environment for at least two small programs started by a user. Among them, an operating environment is created for each applet, and the operating environments of different applets are independent of each other, thereby realizing the simultaneous operation of multiple applets.
  • the execution subject of the above method may be a small program platform.
  • the simultaneous operation of different applets can be achieved by maintaining a multi-dimensional operating environment.
  • Each applet occupies an operating environment independently. Different operating environments are independent of each other, but can share disk and memory.
  • the applet platform can also introduce operating environment management to manage different applets.
  • the applet platform creates a running environment for the applet, which can include dividing storage space for the applet in the physical storage area, establishing a running directory for the applet, initializing the access rights of the applet, and initializing the register status of the applet, etc. .
  • the small program platform can establish a unique running directory for it, and the running directory can be named by a character string generated by the ID-related characteristics of the small program.
  • you can set access permissions for the running directory, and only the applet has access permissions.
  • the applet platform can also divide the running directory of each applet into a private area and a shared area, that is, a part of the running directory of each applet is divided into a shared area. Among them, the division of the shared area is executed by the applet platform, but the specific data to be written into the shared area can be determined by the applet itself.
  • the shared area of the applet needs to be granted access by the applet platform after the corresponding permission statement. For example, when the second applet requests access to the shared area of the first applet, if it is determined that the second applet has declared the data access authority to the first applet and the authentication of the second applet is passed, the first applet can be allowed The second applet accesses the shared area of the first applet.
  • Figure 1 is a schematic diagram of the data sharing method of the present invention. As shown in Figure 1, assuming that two small programs are running at the same time, namely the first small program and the second small program, the running directories of the first small program and the second small program are divided into a private area and a shared area, respectively. The permission control of the program platform, the second applet can access the shared area of the first applet, and the first applet can also access the shared area of the second applet.
  • the access operation to the shared area usually refers to a read operation, that is, to read data.
  • a read operation that is, to read data.
  • the applet platform can also isolate the process clusters maintained by different applets. Take the first applet as an example. After it is started, a process will be started. After that, as the first applet runs, such as page operations and task scheduling, the first applet can start other related processes one after another to form a Process cluster.
  • the process clusters of different applets can be isolated by the applet platform, and the communication between different applet processes can be carried out by the above-mentioned method of declaring data access rights and authentication.
  • the processes in the process cluster of the same applet can access each other, and have the same permissions for the private area and shared area of the applet.
  • the applet platform For the applet platform, if it is determined that the user issues a start instruction for any applet, and the applet is determined to be an unrunning applet, an operating environment can be created for the applet, and the applet can be placed in the foreground to run , Switch the running applet other than the applet to the background. If it is determined that the user issues a start instruction for any applet and that the applet is a running applet, the applet can be switched from the background to Foreground, and can switch the running applet other than the applet to the background.
  • the user sends a start instruction for any small program, which may mean that the user clicks on the icon of the small program.
  • the user's start instruction for any small program such as the first small program
  • it can first be determined whether the first small program is an already running small program, and different operations can be performed subsequently according to different determination results. For example, when it is determined that the first small program is a running small program, the first small program can be switched from the background to the foreground, and the running small programs other than the first small program can be switched to the background.
  • the first applet is an unrunning applet
  • the applet platform can also maintain a list of running applets, for example, the entire list of running applets can be maintained by maintaining a running stack. You can determine whether the first applet is a running applet by querying the running applet list. If it is determined that the first applet is recorded in the running applet list, then the first applet can be determined to be an already running applet. If it is determined that the first applet is not recorded in the running applet list, it can be determined that the first applet is an unrunning applet. If it is determined that the first applet is not recorded in the running applet list, the first applet can also be recorded in the running applet list.
  • the applet platform can also realize the management of the life cycle of each applet.
  • the applet When the applet is running, there will be a lot of temporary data, which is stored in the global data area or the applet platform.
  • the applet When the applet is switched, the data needs to be saved first, and then the state is switched.
  • the life cycle of the applet needs to be designed, such as creating, starting, resuming, running, suspending, stopping, and destroying states.
  • These states describe the complete operation process of the applet, but in practical applications, Not every state will be involved.
  • creation mainly refers to the process of the applet platform creating a running environment for the applet
  • suspension refers to the state when the applet switches the background
  • recovery refers to the process of returning from the suspended state to the running state.
  • the running data of the first applet can be saved.
  • the running data usually refers to the mirrored data at the moment before the switch, such as register status, etc. .
  • the saved running data of the first small program can be reloaded, that is, mirror data recovery is performed, so that the first small program can continue to run according to the running data.
  • the number of applets that can be run at the same time can be limited.
  • the specific value of the threshold may be determined according to actual needs. In addition, which small programs to stop running can also be determined according to actual needs.
  • the threshold is three
  • three applets have been running at the same time, namely the first applet, the second applet, and the third applet, and the user’s start instruction for the fourth applet has been obtained.
  • the three One of the applets with the earliest start time such as the first applet, stops running, or if there is not enough memory, you can also use the two applets with the earliest start time among the three applets, such as the first applet and the second applet. Stop running, or you can stop running one of the three applets that consumes the most memory, such as the third applet.
  • the specific implementation method is not limited. For small programs that stop running, they can be deleted from the list of running small programs.
  • FIG. 2 is a flowchart of an embodiment of a method for running a small program according to the present invention. As shown in Figure 2, it includes the following specific implementations.
  • the first applet is determined to be an unrunning applet, and then 206 is executed.
  • the first small program is switched from the background to the foreground, and the running small programs other than the first small program are switched to the background, and then the process ends.
  • the running data of the first applet can be saved. Accordingly, when the first applet is switched to the foreground, the saved running data of the first applet can be reloaded .
  • At least one running applet is stopped, and then 208 is executed.
  • an operating environment is created for the first small program, and the first small program is placed in the foreground to run, wherein the operating environments of different small programs are independent of each other.
  • Creating a running environment for the first applet may include dividing storage space for the first applet in the physical storage area, establishing a running directory for the first applet, initializing the access rights of the first applet, and The register status of the program is initialized, etc.
  • access permissions can be set for the running directory, and only the first small program has access permissions.
  • the running directory of the first applet can also be divided into a private area and a shared area. Subsequently, when the second applet requests access to the shared area of the first applet, if it is determined that the second applet has declared the data access authority to the first applet and the authentication of the second applet is passed, the first applet can be allowed The second applet accesses the shared area of the first applet.
  • process clusters maintained by different applets can also be isolated.
  • the communication between different applet processes can be carried out by the above-mentioned method of declaring data access rights and authentication.
  • the first applet is recorded in the running applet list, and then the process ends.
  • a multi-dimensional operating environment can be maintained for at least two small programs started by the user.
  • an operating environment is created for each small program, and the operating environments of different small programs are independent of each other, thereby achieving The simultaneous operation of multiple applets avoids the problems in the prior art to a certain extent and saves system resource consumption.
  • the foreground and background can be switched Operation, for example, when you start other applets, you can switch the applets to the background, and when you need to start the applets again, you can switch the applets to the foreground, so there is no need to recreate the running environment for the applets, saving This saves system resource consumption, and because the applet can be switched to the foreground directly without creating a running environment, users can directly enter the required applet page, thereby improving page loading speed.
  • FIG. 3 shows a block diagram of an exemplary computer system/server 12 suitable for implementing embodiments of the present invention.
  • the computer system/server 12 shown in FIG. 3 is only an example, and should not bring any limitation to the function and application scope of the embodiment of the present invention.
  • the computer system/server 12 takes the form of a general-purpose computing device.
  • the components of the computer system/server 12 may include, but are not limited to: one or more processors (processing units) 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processor 16).
  • the bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure among multiple bus structures.
  • these architectures include but are not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and peripheral component interconnection ( PCI) bus.
  • ISA industry standard architecture
  • MAC microchannel architecture
  • VESA Video Electronics Standards Association
  • PCI peripheral component interconnection
  • the computer system/server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer system/server 12, including volatile and nonvolatile media, removable and non-removable media.
  • the memory 28 may include a computer system readable medium in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32.
  • the computer system/server 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 3, and generally referred to as a "hard drive").
  • a disk drive for reading and writing to removable non-volatile disks such as "floppy disks”
  • a removable non-volatile optical disk such as CD-ROM, DVD-ROM
  • other optical media read and write optical disc drives.
  • each drive can be connected to the bus 18 through one or more data media interfaces.
  • the memory 28 may include at least one program product having a set of (for example, at least one) program modules, which are configured to perform the functions of the embodiments of the present invention.
  • a program/utility tool 40 having a set of (at least one) program modules 42 may be stored in, for example, the memory 28.
  • Such program modules 42 include, but are not limited to, an operating system, one or more application programs, and other programs Modules and program data, each of these examples or some combination may include the realization of a network environment.
  • the program module 42 generally executes the functions and/or methods in the described embodiments of the present invention.
  • the computer system/server 12 can also communicate with one or more external devices 14 (such as keyboards, pointing devices, displays 24, etc.), and can also communicate with one or more devices that enable users to interact with the computer system/server 12. And/or communicate with any device (such as a network card, modem, etc.) that enables the computer system/server 12 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 22.
  • the computer system/server 12 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 20. As shown in FIG.
  • the network adapter 20 communicates with other modules of the computer system/server 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the computer system/server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, Tape drives and data backup storage systems, etc.
  • the processor 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the method in the embodiment shown in FIG. 2.
  • the present invention also discloses a computer-readable storage medium on which a computer program is stored.
  • a computer program is stored on which a computer program is stored.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • the computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and computer-readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
  • the computer program code used to perform the operations of the present invention can be written in one or more programming languages or a combination thereof.
  • the programming languages include object-oriented programming languages-such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server.
  • the remote computer can be connected to the user's 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 (for example, using an Internet service provider to pass Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider for example, using an Internet service provider to pass Internet connection.
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other division modes in actual implementation.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
  • the above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium.
  • the above-mentioned software functional unit is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the method described in the various embodiments of the present invention. Part of the steps.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed are an app execution method, a computer device, and a storage medium. The method comprises: maintaining a multi-dimensional execution environment for at least two apps started by a user; constructing separately an execution environment for each of the apps, the execution environments of different apps being mutually independent. The use of the solution of the present invention conserves system resource consumption.

Description

小程序运行方法、计算机设备及存储介质Mini program running method, computer equipment and storage medium 【技术领域】【Technical Field】
本发明涉及计算机应用技术,特别涉及小程序运行方法、计算机设备及存储介质。The present invention relates to computer application technology, in particular to a method for running a small program, a computer device and a storage medium.
【背景技术】【Background technique】
小程序,是一种全新的连接用户与服务的方式,通常需要依赖于宿主应用,即不能脱离宿主应用而单独运营。Mini Programs are a brand new way to connect users and services. They usually depend on the host application, that is, they cannot be operated separately from the host application.
目前,通常每次只能运行一个小程序,即当用户启动第一小程序后,之前运行的第二小程序则需要停止运行,这样,当用户在较短的时间内需要重新启动第二小程序时,则需要重新创建第二小程序的运行环境等,从而增大了系统资源消耗等。At present, usually only one small program can be run at a time, that is, when the user starts the first small program, the second small program that was previously running needs to be stopped, so that when the user needs to restart the second small program in a short time When programming, it is necessary to recreate the operating environment of the second applet, etc., thereby increasing system resource consumption and so on.
【发明内容】[Content of the invention]
有鉴于此,本发明提供了小程序运行方法、计算机设备及存储介质。In view of this, the present invention provides a method for running an applet, a computer device and a storage medium.
具体技术方案如下:The specific technical solutions are as follows:
一种小程序运行方法,包括:A method for running a small program, including:
为用户启动的至少两个小程序维护一个多维运行环境;Maintain a multi-dimensional operating environment for at least two small programs launched by users;
其中,分别为每个小程序创建一个运行环境,不同小程序的运行环境彼此独立。Among them, a running environment is created for each applet, and the running environments of different applets are independent of each other.
一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如以上所述的方法。A computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, and the processor implements the method described above when the program is executed.
一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现如以上所述的方法。A computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is realized.
基于上述介绍可以看出,采用本发明所述方案,可为用户启动的至少两个小程序维护一个多维运行环境,其中,分别为每个小程序创建一个运行环境,不同小程序的运行环境彼此独立,从而实现了多个小程序的同时运行,进而从 一定程度上避免了现有技术中存在的问题,节省了系统资源消耗。Based on the above introduction, it can be seen that with the solution of the present invention, a multi-dimensional operating environment can be maintained for at least two small programs launched by the user. Among them, an operating environment is created for each small program, and the operating environments of different small programs are mutually exclusive. Independence, thereby realizing simultaneous operation of multiple small programs, thereby avoiding problems in the prior art to a certain extent, and saving system resource consumption.
【附图说明】【Explanation of drawings】
图1为本发明所述数据共享方式示意图。Figure 1 is a schematic diagram of the data sharing method of the present invention.
图2为本发明所述小程序运行方法实施例的流程图。Fig. 2 is a flowchart of an embodiment of a method for running a small program according to the present invention.
图3示出了适于用来实现本发明实施方式的示例性计算机系统/服务器12的框图。Figure 3 shows a block diagram of an exemplary computer system/server 12 suitable for implementing embodiments of the present invention.
【具体实施方式】【detailed description】
为了使本发明的技术方案更加清楚、明白,以下参照附图并举实施例,对本发明所述方案进行进一步说明。In order to make the technical solution of the present invention clearer and more comprehensible, the following further describes the solution of the present invention with reference to the drawings and embodiments.
显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the protection scope of the present invention.
另外,应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。In addition, it should be understood that the term "and/or" in this text is only an association relationship describing associated objects, which means that there can be three types of relationships, for example, A and/or B can mean that there is A alone and A at the same time. And B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
本发明实施例中公开了一种小程序运行方法,可为用户启动的至少两个小程序维护一个多维运行环境。其中,分别为每个小程序创建一个运行环境,不同小程序的运行环境彼此独立,从而实现了多个小程序的同时运行。The embodiment of the present invention discloses a method for running a small program, which can maintain a multi-dimensional operating environment for at least two small programs started by a user. Among them, an operating environment is created for each applet, and the operating environments of different applets are independent of each other, thereby realizing the simultaneous operation of multiple applets.
上述方法的执行主体可为小程序平台。可通过维护一个多维运行环境来实现不同小程序的同时运行,每个小程序独立占用一个运行环境,不同的运行环境之间彼此独立,但可共享磁盘和内存。小程序平台还可引入运行环境管理,来管理不同的小程序。The execution subject of the above method may be a small program platform. The simultaneous operation of different applets can be achieved by maintaining a multi-dimensional operating environment. Each applet occupies an operating environment independently. Different operating environments are independent of each other, but can share disk and memory. The applet platform can also introduce operating environment management to manage different applets.
小程序平台为小程序创建运行环境,可包括在物理存储区中为小程序划分出存储空间、为小程序建立运行目录、对小程序的访问权限进行初始化、对小程序的寄存器状态进行初始化等。The applet platform creates a running environment for the applet, which can include dividing storage space for the applet in the physical storage area, establishing a running directory for the applet, initializing the access rights of the applet, and initializing the register status of the applet, etc. .
针对每个小程序,小程序平台可为其建立唯一的运行目录,运行目录可用该小程序的ID相关特征生成的字符串命名。并且,可为运行目录设置访问权限,只有该小程序具有访问权限。For each small program, the small program platform can establish a unique running directory for it, and the running directory can be named by a character string generated by the ID-related characteristics of the small program. In addition, you can set access permissions for the running directory, and only the applet has access permissions.
为了便于小程序间的数据共享,小程序平台还可将每个小程序的运行目录划分为私有区域和共享区域,即将每个小程序的运行目录的一部分划分为共享区域。其中,划分出共享区域由小程序平台来执行,但具体将哪些数据写入到共享区域中可由小程序自己来决定。In order to facilitate data sharing between applets, the applet platform can also divide the running directory of each applet into a private area and a shared area, that is, a part of the running directory of each applet is divided into a shared area. Among them, the division of the shared area is executed by the applet platform, but the specific data to be written into the shared area can be determined by the applet itself.
小程序的共享区域需要相应的权限声明后由小程序平台赋予访问能力。比如,当第二小程序请求访问第一小程序的共享区域时,若确定第二小程序声明了对第一小程序的数据访问权限且对第二小程序的鉴权通过,则可允许第二小程序访问第一小程序的共享区域。The shared area of the applet needs to be granted access by the applet platform after the corresponding permission statement. For example, when the second applet requests access to the shared area of the first applet, if it is determined that the second applet has declared the data access authority to the first applet and the authentication of the second applet is passed, the first applet can be allowed The second applet accesses the shared area of the first applet.
图1为本发明所述数据共享方式示意图。如图1所示,假设同时运行了两个小程序,即第一小程序和第二小程序,分别将第一小程序和第二小程序的运行目录划分为私有区域和共享区域,基于小程序平台的权限控制,第二小程序可访问第一小程序的共享区域,第一小程序也可访问第二小程序的共享区域。Figure 1 is a schematic diagram of the data sharing method of the present invention. As shown in Figure 1, assuming that two small programs are running at the same time, namely the first small program and the second small program, the running directories of the first small program and the second small program are divided into a private area and a shared area, respectively. The permission control of the program platform, the second applet can access the shared area of the first applet, and the first applet can also access the shared area of the second applet.
对于共享区域的访问操作通常是指读操作,即读取数据。假设第二小程序读取了第一小程序的数据之后,想给第一小程序发数据,那么第二小程序通常会将相关数据写入到自己的共享区域中,然后通知第一小程序去读取,实现交叉访问。The access operation to the shared area usually refers to a read operation, that is, to read data. Suppose that after the second applet has read the data of the first applet, it wants to send data to the first applet, then the second applet usually writes the relevant data into its own shared area, and then informs the first applet To read, to achieve cross access.
另外,小程序平台还可对不同的小程序分别维护的进程簇进行权限隔离。以第一小程序为例,启动之后,会启动一个进程,之后,随着第一小程序的运行,如页面操作和任务调度等,第一小程序可陆续启动其它的相关进程,从而形成一个进程簇。不同小程序的进程簇可由小程序平台进行权限隔离,不同小程序进程间的通讯可采用上述声明数据访问权限及鉴权的方式进行。In addition, the applet platform can also isolate the process clusters maintained by different applets. Take the first applet as an example. After it is started, a process will be started. After that, as the first applet runs, such as page operations and task scheduling, the first applet can start other related processes one after another to form a Process cluster. The process clusters of different applets can be isolated by the applet platform, and the communication between different applet processes can be carried out by the above-mentioned method of declaring data access rights and authentication.
同一个小程序的进程簇中的进程可以互相访问,对于小程序的私有区域和共享区域享有同样的权限。The processes in the process cluster of the same applet can access each other, and have the same permissions for the private area and shared area of the applet.
对于小程序平台来说,若确定用户针对任一小程序发出启动指令,且确定该小程序为未运行的小程序,可为该小程序创建运行环境,并可将该小程序置于前台运行,将该小程序之外的已运行的小程序切换到后台,若确定用户针对任一小程序发出启动指令,且确定该小程序为已运行的小程序,可将该小程序从后台切换到前台,并可将该小程序之外的已运行的小程序切换到后台。For the applet platform, if it is determined that the user issues a start instruction for any applet, and the applet is determined to be an unrunning applet, an operating environment can be created for the applet, and the applet can be placed in the foreground to run , Switch the running applet other than the applet to the background. If it is determined that the user issues a start instruction for any applet and that the applet is a running applet, the applet can be switched from the background to Foreground, and can switch the running applet other than the applet to the background.
用户针对任一小程序发出启动指令,可以是指用户点击该小程序的图标等。The user sends a start instruction for any small program, which may mean that the user clicks on the icon of the small program.
当获取到用户针对任一小程序如第一小程序的启动指令时,可首先确定出第一小程序是否为已运行的小程序,根据确定结果的不同,后续可执行不同的操作。比如,当确定第一小程序为已运行的小程序时,可将第一小程序从后台切换到前台,并可将第一小程序之外的已运行的小程序切换到后台。当确定第一小程序为未运行的小程序时,可为第一小程序创建运行环境,并将第一小程序置于前台运行,将第一小程序之外的已运行的小程序切换到后台,其中,不同小程序的运行环境彼此独立。When the user's start instruction for any small program, such as the first small program, is obtained, it can first be determined whether the first small program is an already running small program, and different operations can be performed subsequently according to different determination results. For example, when it is determined that the first small program is a running small program, the first small program can be switched from the background to the foreground, and the running small programs other than the first small program can be switched to the background. When it is determined that the first applet is an unrunning applet, you can create an operating environment for the first applet, put the first applet to run in the foreground, and switch the running applets other than the first applet to In the background, the operating environments of different applets are independent of each other.
另外,小程序平台还可维护一个运行小程序列表,如可通过维护一个运行栈来维护整个运行小程序列表。可通过查询运行小程序列表,确定出第一小程序是否为已运行的小程序,如若确定第一小程序记录在运行小程序列表中,则可确定第一小程序为已运行的小程序,若确定第一小程序未记录在运行小程序列表中,则可确定第一小程序为未运行的小程序。若确定第一小程序未记录在运行小程序列表中,还可将第一小程序记录到运行小程序列表中。In addition, the applet platform can also maintain a list of running applets, for example, the entire list of running applets can be maintained by maintaining a running stack. You can determine whether the first applet is a running applet by querying the running applet list. If it is determined that the first applet is recorded in the running applet list, then the first applet can be determined to be an already running applet. If it is determined that the first applet is not recorded in the running applet list, it can be determined that the first applet is an unrunning applet. If it is determined that the first applet is not recorded in the running applet list, the first applet can also be recorded in the running applet list.
小程序平台还可实现对每个小程序生命周期的管理。小程序运行时会有很多的临时数据,存放在全局数据区或小程序平台内部,当小程序切换时,需要对这些数据先进行保存,之后再进行状态的切换。相应地,需要设计小程序的生命周期,如可包括创建、启动、恢复、运行、暂停、停止和销毁等状态,这几种状态描述了小程序的完整运转流程,但在实际应用中,并不是每种状态都一定会涉及到。其中,创建主要是指小程序平台为小程序创建运行环境的过程,暂停是指小程序切换后台时的状态,恢复是指从暂停状态恢复为运行状态的过程。The applet platform can also realize the management of the life cycle of each applet. When the applet is running, there will be a lot of temporary data, which is stored in the global data area or the applet platform. When the applet is switched, the data needs to be saved first, and then the state is switched. Correspondingly, the life cycle of the applet needs to be designed, such as creating, starting, resuming, running, suspending, stopping, and destroying states. These states describe the complete operation process of the applet, but in practical applications, Not every state will be involved. Among them, creation mainly refers to the process of the applet platform creating a running environment for the applet, suspension refers to the state when the applet switches the background, and recovery refers to the process of returning from the suspended state to the running state.
以第一小程序为例,当需要将第一小程序切换到后台时,可对第一小程序的运行数据进行保存,运行数据通常是指切换之前时刻的镜像数据,如可包括寄存器状态等。当需要将第一小程序切换到前台时,可重新加载所保存的第一小程序的运行数据,即进行镜像数据恢复,从而使得第一小程序可根据运行数据继续运行。Take the first applet as an example. When the first applet needs to be switched to the background, the running data of the first applet can be saved. The running data usually refers to the mirrored data at the moment before the switch, such as register status, etc. . When the first small program needs to be switched to the foreground, the saved running data of the first small program can be reloaded, that is, mirror data recovery is performed, so that the first small program can continue to run according to the running data.
另外,为了维护小程序平台的稳定性和内存消耗限制等,可对同时运行的小程序数进行限制。In addition, in order to maintain the stability of the applet platform and memory consumption limits, the number of applets that can be run at the same time can be limited.
比如,当确定用户针对任一小程序发出启动指令时,若确定该小程序为未 运行的小程序,且确定已运行的小程序数达到预定阈值,则可将至少一个已运行的小程序停止运行。For example, when it is determined that the user has issued a start instruction for any small program, if it is determined that the small program is not running, and it is determined that the number of running small programs reaches a predetermined threshold, at least one running small program can be stopped run.
所述阈值的具体取值可根据实际需要而定。另外,停止运行哪些小程序也可根据实际需要而定。The specific value of the threshold may be determined according to actual needs. In addition, which small programs to stop running can also be determined according to actual needs.
假设阈值为三,目前已经同时运行了三个小程序,分别为第一小程序、第二小程序和第三小程序,又获取到了用户针对第四小程序的启动指令,那么可将三个小程序中启动时间最早的一个小程序如第一小程序停止运行,或者,如果内存不够,也可以将三个小程序中启动时间最早的两个小程序如第一小程序和第二小程序停止运行,或者,还可以将三个小程序中内存消耗最大的一个小程序如第三小程序停止运行等,具体实现方式不限。对于停止运行的小程序,可从运行小程序列表中删除。Assuming that the threshold is three, three applets have been running at the same time, namely the first applet, the second applet, and the third applet, and the user’s start instruction for the fourth applet has been obtained. Then the three One of the applets with the earliest start time, such as the first applet, stops running, or if there is not enough memory, you can also use the two applets with the earliest start time among the three applets, such as the first applet and the second applet. Stop running, or you can stop running one of the three applets that consumes the most memory, such as the third applet. The specific implementation method is not limited. For small programs that stop running, they can be deleted from the list of running small programs.
基于上述介绍,图2为本发明所述小程序运行方法实施例的流程图。如图2所示,包括以下具体实现方式。Based on the above introduction, FIG. 2 is a flowchart of an embodiment of a method for running a small program according to the present invention. As shown in Figure 2, it includes the following specific implementations.
在201中,获取用户的第一小程序启动指令。In 201, a user's first small program startup instruction is obtained.
在202中,确定第一小程序是否记录在运行小程序列表中,若是,则执行203,否则,执行204。In 202, it is determined whether the first applet is recorded in the running applet list, if yes, execute 203, otherwise, execute 204.
在203中,确定第一小程序为已运行的小程序,之后执行205。In 203, it is determined that the first applet is a running applet, and then 205 is executed.
在204中,确定第一小程序为未运行的小程序,之后执行206。In 204, the first applet is determined to be an unrunning applet, and then 206 is executed.
在205中,将第一小程序从后台切换到前台,并将第一小程序之外的已运行的小程序切换到后台,之后结束流程。In 205, the first small program is switched from the background to the foreground, and the running small programs other than the first small program are switched to the background, and then the process ends.
在将第一小程序切换到后台时,可对第一小程序的运行数据进行保存,相应地,在将第一小程序切换到前台时,可重新加载所保存的第一小程序的运行数据。When the first applet is switched to the background, the running data of the first applet can be saved. Accordingly, when the first applet is switched to the foreground, the saved running data of the first applet can be reloaded .
在206中,确定已运行的小程序数是否达到预定阈值,若是,则执行207,否则,执行208。In 206, it is determined whether the number of run applets reaches a predetermined threshold, if yes, execute 207, otherwise, execute 208.
在207中,将至少一个已运行的小程序停止运行,之后执行208。In 207, at least one running applet is stopped, and then 208 is executed.
具体停止运行哪个/哪些小程序可根据实际需要而定。Which applets to stop running can be determined according to actual needs.
在208中,为第一小程序创建运行环境,并将第一小程序置于前台运行,其中,不同小程序的运行环境彼此独立。In 208, an operating environment is created for the first small program, and the first small program is placed in the foreground to run, wherein the operating environments of different small programs are independent of each other.
为第一小程序创建运行环境,可以包括在物理存储区中为第一小程序划分出存储空间、为第一小程序建立运行目录、对第一小程序的访问权限进行初始化、对第一小程序的寄存器状态进行初始化等。Creating a running environment for the first applet may include dividing storage space for the first applet in the physical storage area, establishing a running directory for the first applet, initializing the access rights of the first applet, and The register status of the program is initialized, etc.
其中,在为第一小程序建立运行目录后,可为运行目录设置访问权限,只有第一小程序具有访问权限。Among them, after the running directory is established for the first small program, access permissions can be set for the running directory, and only the first small program has access permissions.
为了便于小程序间的数据共享,还可将第一小程序的运行目录划分为私有区域和共享区域。后续,当第二小程序请求访问第一小程序的共享区域时,若确定第二小程序声明了对第一小程序的数据访问权限且对第二小程序的鉴权通过,则可允许第二小程序访问第一小程序的共享区域。In order to facilitate data sharing between applets, the running directory of the first applet can also be divided into a private area and a shared area. Subsequently, when the second applet requests access to the shared area of the first applet, if it is determined that the second applet has declared the data access authority to the first applet and the authentication of the second applet is passed, the first applet can be allowed The second applet accesses the shared area of the first applet.
另外,还可对不同的小程序分别维护的进程簇进行权限隔离。不同小程序进程间的通讯可采用上述声明数据访问权限及鉴权的方式进行。In addition, the process clusters maintained by different applets can also be isolated. The communication between different applet processes can be carried out by the above-mentioned method of declaring data access rights and authentication.
在209中,将第一小程序记录到运行小程序列表中,之后结束流程。In 209, the first applet is recorded in the running applet list, and then the process ends.
对于新启动的第一小程序,可将其记录到运行小程序列表中。For the first small program that is newly started, it can be recorded in the list of running small programs.
需要说明的是,对于前述的各方法实施例,为了简单描述,将其表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described sequence of actions, because according to In the present invention, some steps can be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the involved actions and modules are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in an embodiment, reference may be made to related descriptions of other embodiments.
总之,采用本发明所述方案,可为用户启动的至少两个小程序维护一个多维运行环境,其中,分别为每个小程序创建一个运行环境,不同小程序的运行环境彼此独立,从而实现了多个小程序的同时运行,进而从一定程度上避免了现有技术中存在的问题,节省了系统资源消耗,具体地,对于任一小程序,当其启动后,可进行前台和后台的切换操作,如当启动其它小程序时,可将该小程序切换到后台,当需要再次启动该小程序时,可将该小程序切换到前台,从而无需为该小程序重新创建运行环境等,节省了系统资源消耗,而且,由于可直接将该小程序切换前台,无需进行创建运行环境等操作,对于用户来说可以直接进入所需的小程序页面,从而提升了页面加载速度等。In a word, by adopting the solution of the present invention, a multi-dimensional operating environment can be maintained for at least two small programs started by the user. Among them, an operating environment is created for each small program, and the operating environments of different small programs are independent of each other, thereby achieving The simultaneous operation of multiple applets avoids the problems in the prior art to a certain extent and saves system resource consumption. Specifically, for any applet, when it is started, the foreground and background can be switched Operation, for example, when you start other applets, you can switch the applets to the background, and when you need to start the applets again, you can switch the applets to the foreground, so there is no need to recreate the running environment for the applets, saving This saves system resource consumption, and because the applet can be switched to the foreground directly without creating a running environment, users can directly enter the required applet page, thereby improving page loading speed.
图3示出了适于用来实现本发明实施方式的示例性计算机系统/服务器12的框图。图3显示的计算机系统/服务器12仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。Figure 3 shows a block diagram of an exemplary computer system/server 12 suitable for implementing embodiments of the present invention. The computer system/server 12 shown in FIG. 3 is only an example, and should not bring any limitation to the function and application scope of the embodiment of the present invention.
如图3所示,计算机系统/服务器12以通用计算设备的形式表现。计算机系统/服务器12的组件可以包括但不限于:一个或者多个处理器(处理单元)16,存储器28,连接不同系统组件(包括存储器28和处理器16)的总线18。As shown in Fig. 3, the computer system/server 12 takes the form of a general-purpose computing device. The components of the computer system/server 12 may include, but are not limited to: one or more processors (processing units) 16, a memory 28, and a bus 18 connecting different system components (including the memory 28 and the processor 16).
总线18表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。The bus 18 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any bus structure among multiple bus structures. For example, these architectures include but are not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and peripheral component interconnection ( PCI) bus.
计算机系统/服务器12典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机系统/服务器12访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。The computer system/server 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer system/server 12, including volatile and nonvolatile media, removable and non-removable media.
存储器28可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)30和/或高速缓存存储器32。计算机系统/服务器12可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统34可以用于读写不可移动的、非易失性磁介质(图3未显示,通常称为“硬盘驱动器”)。尽管图3中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线18相连。存储器28可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。The memory 28 may include a computer system readable medium in the form of volatile memory, such as random access memory (RAM) 30 and/or cache memory 32. The computer system/server 12 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 3, and generally referred to as a "hard drive"). Although not shown in FIG. 3, a disk drive for reading and writing to removable non-volatile disks (such as "floppy disks") and a removable non-volatile optical disk (such as CD-ROM, DVD-ROM) can be provided. Or other optical media) read and write optical disc drives. In these cases, each drive can be connected to the bus 18 through one or more data media interfaces. The memory 28 may include at least one program product having a set of (for example, at least one) program modules, which are configured to perform the functions of the embodiments of the present invention.
具有一组(至少一个)程序模块42的程序/实用工具40,可以存储在例如存储器28中,这样的程序模块42包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块42通常执行本发明所描述的实施例中的功能和/或方法。A program/utility tool 40 having a set of (at least one) program modules 42 may be stored in, for example, the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, and other programs Modules and program data, each of these examples or some combination may include the realization of a network environment. The program module 42 generally executes the functions and/or methods in the described embodiments of the present invention.
计算机系统/服务器12也可以与一个或多个外部设备14(例如键盘、指向设备、显示器24等)通信,还可与一个或者多个使得用户能与该计算机系统/服务器12交互的设备通信,和/或与使得该计算机系统/服务器12能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口22进行。并且,计算机系统/服务器12还可以通过网络适配器20与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图3所示,网络适配器20通过总线18与计算机系统/服务器12的其它模块通信。应当明白,尽管图中未示出,可以结合计算机系统/服务器12使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The computer system/server 12 can also communicate with one or more external devices 14 (such as keyboards, pointing devices, displays 24, etc.), and can also communicate with one or more devices that enable users to interact with the computer system/server 12. And/or communicate with any device (such as a network card, modem, etc.) that enables the computer system/server 12 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 22. In addition, the computer system/server 12 may also communicate with one or more networks (for example, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 20. As shown in FIG. 3, the network adapter 20 communicates with other modules of the computer system/server 12 through the bus 18. It should be understood that although not shown in the figure, other hardware and/or software modules can be used in conjunction with the computer system/server 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, Tape drives and data backup storage systems, etc.
处理器16通过运行存储在存储器28中的程序,从而执行各种功能应用以及数据处理,例如实现图2所示实施例中的方法。The processor 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the method in the embodiment shown in FIG. 2.
本发明同时公开了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时将实现如图2所示实施例中的方法。The present invention also discloses a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method in the embodiment shown in FIG. 2 will be implemented.
可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Any combination of one or more computer-readable media may be used. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), Erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this document, the computer-readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, apparatus, or device.
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读 介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。The computer-readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and computer-readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、电线、光缆、RF等等,或者上述的任意合适的组合。The program code contained on the computer-readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。The computer program code used to perform the operations of the present invention can be written in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages-such as Java, Smalltalk, C++, and also conventional Procedural programming language-such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partly on the user's computer, executed as an independent software package, partly on the user's computer and partly executed on a remote computer, or entirely executed on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's 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 (for example, using an Internet service provider to pass Internet connection).
在本发明所提供的几个实施例中,应该理解到,所揭露的装置和方法等,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division modes in actual implementation.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software functional units.
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储 介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the method described in the various embodiments of the present invention. Part of the steps. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the present invention Within the scope of protection.

Claims (10)

  1. 一种小程序运行方法,其特征在于,包括:A method for running a small program, characterized in that it comprises:
    为用户启动的至少两个小程序维护一个多维运行环境;Maintain a multi-dimensional operating environment for at least two small programs launched by users;
    其中,分别为每个小程序创建一个运行环境,不同小程序的运行环境彼此独立。Among them, a running environment is created for each applet, and the running environments of different applets are independent of each other.
  2. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, wherein:
    该方法进一步包括:对不同的小程序分别维护的进程簇进行权限隔离。The method further includes: performing permission isolation on the process clusters maintained by different small programs.
  3. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, wherein:
    所述创建运行环境包括:The creation of the operating environment includes:
    为所述小程序建立运行目录,并为所述运行目录设置访问权限,只有所述小程序具有访问权限。A running directory is established for the small program, and access permissions are set for the running directory, and only the small program has access permissions.
  4. 根据权利要求3所述的方法,其特征在于,The method according to claim 3, wherein:
    该方法进一步包括:The method further includes:
    分别将每个小程序的运行目录划分为私有区域和共享区域;Divide the running directory of each applet into a private area and a shared area;
    当第二小程序请求访问第一小程序的共享区域时,若确定所述第二小程序声明了对所述第一小程序的数据访问权限且对所述第二小程序的鉴权通过,则允许所述第二小程序访问所述第一小程序的共享区域。When the second applet requests to access the shared area of the first applet, if it is determined that the second applet has declared the data access authority to the first applet and the authentication of the second applet is passed, Then, the second applet is allowed to access the shared area of the first applet.
  5. 根据权利要求1所述的方法,其特征在于,The method according to claim 1, wherein:
    该方法进一步包括:The method further includes:
    若确定用户针对任一小程序发出启动指令,且确定所述小程序为未运行的小程序,则为所述小程序创建运行环境,并将所述小程序置于前台运行,将所述小程序之外的已运行的小程序切换到后台;If it is determined that the user has issued a start instruction for any small program, and it is determined that the small program is not running, then an operating environment is created for the small program, the small program is placed in the foreground to run, and the small program is The running applet outside the program is switched to the background;
    若确定用户针对任一小程序发出启动指令,且确定所述小程序为已运行的小程序,则将所述小程序从后台切换到前台,并将所述小程序之外的已运行的小程序切换到后台。If it is determined that the user issues a start instruction for any small program, and it is determined that the small program is a running small program, the small program is switched from the background to the foreground, and the running small programs other than the small program The program switches to the background.
  6. 根据权利要求5所述的方法,其特征在于,The method of claim 5, wherein:
    所述确定所述小程序为已运行的小程序包括:若确定所述小程序记录在运行小程序列表中,则确定所述小程序为已运行的小程序;The determining that the applet is a running applet includes: if it is determined that the applet is recorded in the running applet list, determining that the applet is an already running applet;
    所述确定所述小程序为未运行的小程序包括:若确定所述小程序未记录在所述运行小程序列表中,则确定所述小程序为未运行的小程序;The determining that the applet is an unrunning applet includes: if it is determined that the applet is not recorded in the running applet list, determining that the applet is an unrunning applet;
    该方法进一步包括:若确定所述小程序未记录在所述运行小程序列表中,则将所述小程序记录到所述运行小程序列表中。The method further includes: if it is determined that the applet is not recorded in the list of running applets, recording the applet in the list of running applets.
  7. 根据权利要求5所述的方法,其特征在于,The method of claim 5, wherein:
    该方法进一步包括:The method further includes:
    当需要将所述小程序切换到后台时,对所述小程序的运行数据进行保存;When it is necessary to switch the small program to the background, save the running data of the small program;
    当需要将所述小程序切换到前台时,重新加载所保存的所述小程序的运行数据。When the small program needs to be switched to the foreground, the saved running data of the small program is reloaded.
  8. 根据权利要求5所述的方法,其特征在于,The method of claim 5, wherein:
    该方法进一步包括:The method further includes:
    当确定用户针对任一小程序发出启动指令时,若确定所述小程序为未运行的小程序,且确定已运行的小程序数达到预定阈值,则将至少一个已运行的小程序停止运行。When it is determined that the user issues a start instruction for any applet, if it is determined that the applet is an unrunning applet, and it is determined that the number of applets that have been run reaches a predetermined threshold, at least one applet that has run is stopped.
  9. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1~8中任一项所述的方法。A computer device, comprising a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program as claimed in claims 1-8 The method of any one of.
  10. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1~8中任一项所述的方法。A computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method according to any one of claims 1 to 8.
PCT/CN2020/077696 2019-03-04 2020-03-04 App execution method, computer device, and storage medium WO2020177699A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910161392.2A CN110083399B (en) 2019-03-04 2019-03-04 Applet running method, computer device and storage medium
CN201910161392.2 2019-03-04

Publications (1)

Publication Number Publication Date
WO2020177699A1 true WO2020177699A1 (en) 2020-09-10

Family

ID=67413085

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/077696 WO2020177699A1 (en) 2019-03-04 2020-03-04 App execution method, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN110083399B (en)
WO (1) WO2020177699A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110083399B (en) * 2019-03-04 2021-06-22 上海连尚网络科技有限公司 Applet running method, computer device and storage medium
CN110569108B (en) * 2019-09-04 2021-04-30 腾讯科技(深圳)有限公司 Method for creating execution environment of mini-game virtual machine and related product
CN111026462B (en) * 2019-12-10 2023-08-29 百度在线网络技术(北京)有限公司 Applet control method, device, apparatus and medium
CN111913707B (en) * 2020-08-06 2024-02-20 上海连尚网络科技有限公司 Multiplexing method and device for running process
CN112182623B (en) * 2020-10-13 2022-05-13 支付宝(杭州)信息技术有限公司 Method and device for protecting user privacy
CN113608803A (en) * 2021-08-16 2021-11-05 上海万物新生环保科技集团有限公司 Method and equipment for realizing functional operation in multi-operation environment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219078A (en) * 2013-06-04 2014-12-17 阿里巴巴集团控股有限公司 Method and device for processing multiple runtime environment data
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291717B (en) * 2011-08-15 2014-12-31 宇龙计算机通信科技(深圳)有限公司 Data protection method and terminal
CN109063467A (en) * 2013-05-27 2018-12-21 华为终端(东莞)有限公司 The method, apparatus and terminal of system function call
CN103761471A (en) * 2014-02-21 2014-04-30 北京奇虎科技有限公司 Application program installation method and device based on intelligent terminal
US9838458B2 (en) * 2015-06-08 2017-12-05 Wesley John Boudville Cookies and anti-ad blocker using deep links in mobile apps
US10241491B2 (en) * 2015-06-16 2019-03-26 Siemens Aktiengesellschaft Interfaces for connected software applications in automation environments
US9952848B2 (en) * 2015-12-21 2018-04-24 Samsung Electronics Co., Ltd. Dependency-aware transformation of multi-function applications for on-demand execution
CN108536486A (en) * 2018-04-08 2018-09-14 苏州犀牛网络科技有限公司 The loading method and device of RN small routines
CN108647028B (en) * 2018-05-09 2024-02-09 广州腾讯科技有限公司 Application information processing method and device
CN108984225B (en) * 2018-06-19 2023-05-30 上海掌门科技有限公司 Method and device for quickly starting hosted application
CN109032691B (en) * 2018-06-25 2020-12-15 腾讯科技(深圳)有限公司 Applet running method and device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219078A (en) * 2013-06-04 2014-12-17 阿里巴巴集团控股有限公司 Method and device for processing multiple runtime environment data
CN110083399A (en) * 2019-03-04 2019-08-02 上海连尚网络科技有限公司 Small routine operation method, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Non-official translation: How much do you know about the technical framework of WeChat Mini Programs?", 23 January 2017 (2017-01-23), pages 1 - 4, XP055731971, Retrieved from the Internet <URL:http://www.wxapp-union.com/portal.php?mod=view&aid=1208> *
GARYCHIU: "Detailed explanation of the life cycle of WeChat applets", 3 January 2019 (2019-01-03), pages 1 - 5, XP055731977, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/53926404> *
WECHAT DEVELOPER: "Mini Programs•Stories (19)-File System Capability", HTTPS://WWW.QIANYXCX.COM/ARTICLE/36.HTML, 18 August 2018 (2018-08-18), pages 1 - 4, XP055731974, Retrieved from the Internet <URL:https://www.qianyxcx.com/article/36.html> *

Also Published As

Publication number Publication date
CN110083399A (en) 2019-08-02
CN110083399B (en) 2021-06-22

Similar Documents

Publication Publication Date Title
WO2020177699A1 (en) App execution method, computer device, and storage medium
US9075541B2 (en) Virtualizing storage for WPAR clients using node port ID virtualization
US8924703B2 (en) Secure virtualization environment bootable from an external media device
US9766913B2 (en) Method and system for managing peripheral devices for virtual desktops
US9836357B1 (en) Systems and methods for backing up heterogeneous virtual environments
CN109168328B (en) Virtual machine migration method and device and virtualization system
US9354908B2 (en) Instantly restoring virtual machines by providing read/write access to virtual disk before the virtual disk is completely restored
US12067411B2 (en) Hot growing a cloud hosted block device
WO2023179388A1 (en) Hot migration method for virtual machine instance
US20240256258A1 (en) Virtual machine update while keeping devices attached to the virtual machine
CN113826072A (en) Code update in system management mode
US10169062B2 (en) Parallel mapping of client partition memory to multiple physical adapters
US11093175B1 (en) Raid data storage device direct communication system
US8140810B2 (en) Storage management command control in virtualized environment
US9569241B2 (en) Sharing devices assigned to virtual machines using runtime exclusion
US11263039B2 (en) High performance attachable writeable volumes in VDI desktops
KR100735875B1 (en) System and method for remote access to a server and running multiple operating systems using live booting medium
JP7522775B2 (en) Non-volatile storage partition identifier
US20230333996A1 (en) System and method for network interface controller based data migration
US10152266B1 (en) Systems and methods for providing data backup services in a virtual environment
US20240311249A1 (en) System and method for managing recovery of management controllers
US11544013B2 (en) Array-based copy mechanism utilizing logical addresses pointing to same data block
US20240362046A1 (en) Hot Growing A Cloud Hosted Block Device
US20220121590A1 (en) System and method to handle uncompressible data with a compression accelerator
CN116340206A (en) Intelligent network interface controller host memory access

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: 20765635

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20765635

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.01.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20765635

Country of ref document: EP

Kind code of ref document: A1