[go: up one dir, main page]

CN110046000A - Small routine operation method and device - Google Patents

Small routine operation method and device Download PDF

Info

Publication number
CN110046000A
CN110046000A CN201910331999.0A CN201910331999A CN110046000A CN 110046000 A CN110046000 A CN 110046000A CN 201910331999 A CN201910331999 A CN 201910331999A CN 110046000 A CN110046000 A CN 110046000A
Authority
CN
China
Prior art keywords
data
directory
running
applet
target applet
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910331999.0A
Other languages
Chinese (zh)
Other versions
CN110046000B (en
Inventor
崔英林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lianshang Network Technology Group Co.,Ltd.
Original Assignee
Shanghai Lianshang Network Technology Co Ltd
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 Shanghai Lianshang Network Technology Co Ltd filed Critical Shanghai Lianshang Network Technology Co Ltd
Priority to CN201910331999.0A priority Critical patent/CN110046000B/en
Publication of CN110046000A publication Critical patent/CN110046000A/en
Application granted granted Critical
Publication of CN110046000B publication Critical patent/CN110046000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

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

Abstract

本申请实施例公开了小程序运行方法和装置。该方法的一具体实施方式包括:对该第一宿主应用建立运行目录和至少一个数据目录;响应于检测到对集成于该第一宿主应用的目标小程序的用户启动操作,运行该目标小程序,将运行过程中产生的运行数据存储于该运行目录下;响应于检测到对该目标小程序的用户关闭操作,将该运行目录下的运行数据复制到该目标小程序对应的数据目录下。本申请实施例提供的方案通过对每个小程序单独设置数据目录,以使不同小程序间的数据相互隔离。

The embodiments of the present application disclose a method and a device for running an applet. A specific implementation of the method includes: establishing a running directory and at least one data directory for the first host application; in response to detecting a user-initiated operation on a target applet integrated in the first host application, running the target applet , and store the running data generated during the running process in the running directory; in response to detecting the user closing operation of the target applet, copy the running data in the running directory to the data directory corresponding to the target applet. The solution provided by the embodiment of the present application separates data between different applet programs by setting a data directory for each applet.

Description

小程序运行方法和装置Small program running method and device

技术领域technical field

本申请实施例涉及计算机技术领域,具体涉及互联网技术领域,尤其涉及小程序运行方法和装置。The embodiments of the present application relate to the field of computer technologies, in particular to the field of Internet technologies, and in particular, to a method and apparatus for running an applet.

背景技术Background technique

在操作系统中,宿主应用的数据往往在同一个目录下。如果多个小程序集成于同一个宿主应用,每个小程序可以利用其他小程序对应的目录下的数据。In the operating system, the data of the host application is often in the same directory. If multiple applets are integrated into the same host application, each applet can use the data in the directories corresponding to other applets.

这样,集成于同一个宿主应用的小程序之间的信息是互通的,无法实现小程序之间数据的隔离。In this way, the information between the applets integrated in the same host application is communicated, and the data isolation between the applets cannot be realized.

发明内容SUMMARY OF THE INVENTION

本申请实施例提出了小程序运行方法和装置。The embodiments of the present application propose a method and apparatus for running an applet.

第一方面,本申请实施例提供了一种小程序运行方法,应用于终端设备,终端设备安装有包括第一宿主应用的至少一个宿主应用;方法包括:对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据;响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录下;响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。In a first aspect, an embodiment of the present application provides a method for running an applet, which is applied to a terminal device, where at least one host application including a first host application is installed; the method includes: establishing a running directory for the first host application and at least one host application. A data directory, wherein different data directories are used to store data of different applets integrated by the first host application, and the operation directory is used to store operation data, and the operation data includes user behavior data; The user starts the operation of the target applet of the host application, runs the target applet, and stores the running data generated during the running process in the running directory; in response to detecting the user closing operation of the target applet, the running data in the running directory is stored. Copy to the data directory corresponding to the target applet.

第二方面,本申请实施例提供了一种小程序运行装置,应用于终端设备,终端设备安装有包括第一宿主应用的至少一个宿主应用;装置包括:建立单元,被配置成对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据;运行单元,被配置成响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录下;复制单元,被配置成响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。In a second aspect, an embodiment of the present application provides an apparatus for running an applet, which is applied to a terminal device, where at least one host application including a first host application is installed on the terminal device; the apparatus includes: a establishing unit configured to The application establishes a running directory and at least one data directory, wherein different data directories are used to store data of different applets integrated by the first host application, and the running directory is used to store running data, and the running data includes user behavior data; the running unit, is configured to run the target applet in response to detecting a user-initiated operation of the target applet integrated in the first host application, and store the operation data generated during the operation in the operation directory; the replication unit is configured to respond to After detecting the user's close operation of the target applet, the running data in the running directory is copied to the data directory corresponding to the target applet.

第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如小程序运行方法中任一实施例的方法。In a third aspect, embodiments of the present application provide an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors , so that one or more processors implement the method of any one of the embodiments of the applet running method.

第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如小程序运行方法中任一实施例的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the method in any of the embodiments of the method for running a small program.

本申请实施例提供的小程序运行方案,首先,对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据。之后,响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录下。最后,响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。本申请实施例提供的方案通过对每个小程序单独设置数据目录,以使不同小程序间的数据相互隔离。并且本申请实施例对运行中的小程序设置运行目录,以便于对当前运行的运行数据设置使用权限,实现权限隔离。In the applet operation solution provided by the embodiment of the present application, first, an operation directory and at least one data directory are established for the first host application, wherein different data directories are used to store data of different applet programs integrated by the first host application, and run The directory is used to store operational data, including user behavior data. Afterwards, in response to detecting a user-initiated operation on the target applet integrated in the first host application, the target applet is run, and the operation data generated during the operation is stored in the operation directory. Finally, in response to detecting the user closing operation of the target applet, the operation data in the operation directory is copied to the data directory corresponding to the target applet. In the solution provided by the embodiments of the present application, a data directory is separately set for each applet, so as to isolate the data between different applets from each other. In addition, in the embodiment of the present application, a running directory is set for the running applet, so as to set the usage authority for the currently running running data and implement authority isolation.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1是本申请可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which the present application can be applied;

图2是根据本申请的小程序运行方法的一个实施例的流程图;2 is a flowchart of an embodiment of a method for running an applet according to the present application;

图3是根据本申请的小程序运行方法的一个宿主应用场景的示意图;3 is a schematic diagram of a host application scenario of the applet running method according to the present application;

图4是根据本申请的小程序运行方法的又一个实施例的流程图;FIG. 4 is a flowchart of another embodiment of a method for running an applet according to the present application;

图5是根据本申请的小程序运行装置的一个实施例的结构示意图;5 is a schematic structural diagram of an embodiment of an apparatus for running an applet according to the present application;

图6是适于用来实现本申请实施例的电子设备的计算机系统的结构示意图。FIG. 6 is a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.

具体实施方式Detailed ways

下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

图1示出了可以宿主应用本申请的小程序运行方法或小程序运行装置的实施例的示例性系统架构100。FIG. 1 shows an exemplary system architecture 100 that can host an embodiment of the applet running method or applet running apparatus of the present application.

如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the system architecture 100 may include terminal devices 101 , 102 , and 103 , a network 104 and a server 105 . The network 104 is a medium used to provide a communication link between the terminal devices 101 , 102 , 103 and the server 105 . The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端宿主应用,例如小程序运行宿主应用、视频类宿主应用、直播宿主应用、即时通信工具、邮箱客户端、社交平台软件等。The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like. Various communication client host applications may be installed on the terminal devices 101 , 102 and 103 , such as applet running host applications, video host applications, live broadcast host applications, instant messaging tools, email clients, social platform software, and the like.

这里的终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、电子书阅读器、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块(例如用来提供分布式服务的多个软件或软件模块),也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 here may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, e-book readers, laptop computers, desktop computers, and the like. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (eg, multiple software or software modules for providing distributed services), or as a single software or software module. There is no specific limitation here.

服务器105可以是提供各种服务的服务器,例如对终端设备101、102、103提供支持的后台服务器。后台服务器可以对接收到的用户历史行为数据等数据进行分析等处理,并将处理结果反馈给终端设备。The server 105 may be a server that provides various services, such as a background server that provides support for the terminal devices 101 , 102 , and 103 . The background server can analyze and process the received user historical behavior data and other data, and feed back the processing results to the terminal device.

需要说明的是,本申请实施例所提供的小程序运行方法一般由终端设备101、102、103执行,相应地,小程序运行装置可以设置于终端设备101、102、103中。It should be noted that the applet running method provided by the embodiments of the present application is generally executed by the terminal devices 101 , 102 and 103 , and correspondingly, the applet running apparatus may be set in the terminal devices 101 , 102 and 103 .

应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 1 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.

继续参考图2,示出了根据本申请的小程序运行方法的一个实施例的流程200。该小程序运行方法,包括以下步骤:Continuing to refer to FIG. 2 , a flow 200 of an embodiment of a method for running an applet according to the present application is shown. The operation method of the applet includes the following steps:

步骤201,对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据。Step 201, establishing an operation directory and at least one data directory for the first host application, wherein different data directories are used to store data of different small programs integrated by the first host application, the operation directory is used to store operation data, and the operation data includes: User behavior data.

在本实施例中,小程序运行方法的执行主体(例如图1所示的终端设备)可以对第一宿主应用建立运行目录以及数据目录。这样,便于单独对运行目录设置权限,以使上述执行主体或者服务器无法将运行目录下的运行数据应用于不具备权限的小程序。第一宿主应用可以是终端设备安装的任意一个集成了小程序的宿主应用。用户行为数据指用户关于小程序的行为所产生的数据。比如,用户行为数据可以包括用户通过小程序访问网页的时间和网页的网址。上述数据目录下的数据可以包括用户行为数据。不同的目标小程序的数据可以存储于不同的数据目录下,以便于对不同数据目录下的数据进行隔离。具体地,数据目录下和运行目录下都可以存在文件夹,在文件夹中可以存储数据。宿主应用指存在小程序运行平台的应用。小程序运行平台用于在宿主应用中为小程序提供运行环境,是小程序能够在宿主应用中启动和运行的必要条件。小程序运行平台可以向小程序提供待显示的界面的模板、浏览器以及针对不同宿主应用或者不同操作系统的个性化服务。In this embodiment, the execution body of the applet running method (for example, the terminal device shown in FIG. 1 ) may establish a running directory and a data directory for the first host application. In this way, it is convenient to set permissions on the running directory separately, so that the above-mentioned execution subject or the server cannot apply the running data in the running directory to the applet that does not have the permission. The first host application may be any host application integrated with the applet installed on the terminal device. User behavior data refers to the data generated by the user's behavior about the Mini Program. For example, the user behavior data may include the time when the user accesses the web page through the applet and the web address of the web page. The data under the above data directory may include user behavior data. Data of different target applets can be stored in different data directories, so as to isolate the data in different data directories. Specifically, folders may exist in both the data directory and the running directory, and data may be stored in the folders. The host application refers to the application on which the applet runs on the platform. The applet running platform is used to provide a running environment for the applet in the host application, and is a necessary condition for the applet to start and run in the host application. The applet running platform can provide the applet with a template of the interface to be displayed, a browser, and personalized services for different host applications or different operating systems.

步骤202,响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录下。Step 202 , in response to detecting a user-initiated operation on the target applet integrated in the first host application, run the target applet, and store the operation data generated during the operation in the operation directory.

在本实施例中,上述执行主体可以响应于检测到用户对集成于上述第一宿主应用的目标小程序的用户启动操作,启动并运行上述目标小程序。并且,上述执行主体可以将运行过程中产生的运行数据存储于上述运行目录下。用户启动操作是用户的操作,用于指示启动上述目标小程序。In this embodiment, the above-mentioned execution body may start and run the above-mentioned target applet in response to detecting a user-initiated operation of the user on the target applet integrated in the above-mentioned first host application. In addition, the above-mentioned execution body may store the operation data generated during the operation process in the above-mentioned operation directory. The user-initiated operation is an operation of the user, which is used to instruct to start the above-mentioned target applet.

在本实施例一些可选的实现方式中,步骤202包括:响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,判断目标小程序对应的数据目录下是否存在运行数据;若存在,将存在的运行数据解密存储于运行目录下,基于运行目录下的运行数据,运行目标小程序;若不存在,运行目标小程序。In some optional implementations of this embodiment, step 202 includes: in response to detecting a user-initiated operation on the target applet integrated in the first host application, determining whether there is running data in the data directory corresponding to the target applet; If it exists, the existing operation data is decrypted and stored in the operation directory, and the target applet is run based on the operation data in the operation directory; if it does not exist, the target applet is run.

在这些可选的实现方式中,上述执行主体可以响应于检测到用户对目标小程序的用户启动操作,判断数据目录下是否存在运行数据。这样,上述执行主体可以根据判断结果执行后续步骤。In these optional implementation manners, the above-mentioned execution body may, in response to detecting a user-initiated operation of the target applet by the user, determine whether there is running data in the data directory. In this way, the above-mentioned executive body can execute subsequent steps according to the judgment result.

上述执行主体可以在存在运行数据的情况下,将数据目录下的运行数据存储于上述运行目录下,继而,上述执行主体可以基于其中的运行数据运行上述目标小程序。如果判断结果是目标小程序对应的数据目录下不存在运行数据,那么上述执行主体可以直接运行上述目标小程序。The above-mentioned execution body may store the operation data in the data directory in the above-mentioned operation directory when the operation data exists, and then the above-mentioned execution body may run the above-mentioned target applet based on the operation data therein. If the judgment result is that there is no running data in the data directory corresponding to the target applet, then the above-mentioned execution subject can directly run the above-mentioned target applet.

在实践中,上述执行主体可以采用多种方式基于运行数据运行目标小程序。举例来说,上述执行主体可以将运行数据上传至目标小程序的服务器,以使该服务器确定出用户所喜好的对象。比如,喜好的对象可以是视频类型、商品种类等等。继而,该服务器能够向上述执行主体的目标小程序推送相关的视频、商品或广告等等。这样,上述执行主体可以播出所推送的内容。此外,如果目标小程序有指令指示用户阅览某网页,那么只要运行数据中出现了用户对该网页的浏览记录,则上述执行主体可以确定用户已阅览。In practice, the above-mentioned execution body can run the target applet based on the running data in various ways. For example, the above-mentioned execution body can upload the running data to the server of the target applet, so that the server can determine the object that the user likes. For example, the favorite object may be a video type, a commodity type, and so on. Then, the server can push related videos, commodities, advertisements, etc. to the target applet of the above-mentioned executive body. In this way, the above-mentioned executive body can broadcast the pushed content. In addition, if the target applet has an instruction to instruct the user to browse a certain webpage, as long as the user's browsing record of the webpage appears in the running data, the above-mentioned execution body can determine that the user has browsed the webpage.

这些实现方式可以在存在运行数据的情况下,利用运行数据针对终端设备的用户更好地运行目标小程序。These implementations can use the running data to better run the target applet for the user of the terminal device in the presence of running data.

步骤203,响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。Step 203 , in response to detecting the user's closing operation on the target applet, copy the running data in the running directory to the data directory corresponding to the target applet.

在本实施例中,上述执行主体可以响应于检测到用户对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。具体地,用户关闭操作为用户的操作,用于指示关闭上述目标小程序。In this embodiment, the execution body may copy the running data in the running directory to the data directory corresponding to the target applet in response to detecting the user's closing operation of the target applet by the user. Specifically, the user's closing operation is an operation of the user, which is used to instruct the closing of the above-mentioned target applet.

在本实施例一些可选的实现方式中,第一宿主应用所集成的不同的小程序对应的数据目录的秘钥不同。In some optional implementation manners of this embodiment, the secret keys of the data directories corresponding to different applets integrated in the first host application are different.

在这些可选的实现方式中,上述执行主体或者服务器可以对数据目录设置秘钥,所设置的秘钥与小程序标识有一对一的关系。因而,不同的小程序的数据所在的数据目录之间的秘钥不同。这样,可以更好地隔离各个小程序之间的数据,以防止小程序的数据随意地被利用。In these optional implementation manners, the above-mentioned execution body or server may set a secret key for the data directory, and the set secret key has a one-to-one relationship with the applet identifier. Therefore, the secret keys are different between the data directories where the data of different applet programs are located. In this way, the data between each applet can be better isolated to prevent the data of the applet from being used arbitrarily.

在本实施例一些可选的实现方式中,在步骤203之后,上述方法还可以包括:In some optional implementations of this embodiment, after step 203, the above method may further include:

对目标小程序对应的数据目录下,目标小程序本次运行的运行数据进行加密。Under the data directory corresponding to the target applet, the running data of the current operation of the target applet is encrypted.

在这些可选的实现方式中,上述执行主体可以对目标小程序对应的数据目录下,由本次运行上述目标小程序所产生的运行数据进行加密。这里所加密的数据包括所复制的数据。此外,还可以包括其他数据,比如从运行目录下定时缓存到数据目录下的数据。这里加密所采用的秘钥仅用于目标小程序对应的数据目录。In these optional implementation manners, the above-mentioned execution body may encrypt the operation data generated by running the above-mentioned target applet this time in the data directory corresponding to the target applet. The encrypted data here includes copied data. In addition, other data may also be included, such as data periodically cached from the running directory to the data directory. The key used for encryption here is only used for the data directory corresponding to the target applet.

这些实现方式,可以对数据目录下的运行数据进行加密,以实现对各个数据目录下的数据进行隔离。In these implementation manners, the operating data in the data directory can be encrypted to isolate the data in each data directory.

在本实施例一些可选的实现方式中,在步骤203之后,上述方法还包括:In some optional implementations of this embodiment, after step 203, the above method further includes:

清空运行目录下的数据。Clear the data in the run directory.

在这些可选的实现方式中,上述执行主体可以在将运行目录下的运行数据复制到数据目录之后,清空运行目录下的数据,以便于其他小程序将运行数据存储于其中。In these optional implementation manners, the above-mentioned execution body may clear the data in the running directory after copying the running data in the running directory to the data directory, so that other applet programs can store the running data therein.

在本实施例一些可选的实现方式中,运行目录下的运行数据仅用于执行集成于第一宿主应用且在运行中的小程序对应的指令。In some optional implementations of this embodiment, the running data in the running directory is only used to execute the instructions corresponding to the running applet integrated in the first host application.

在这些可选的实现方式中,上述执行主体可以将运行目录下的运行数据应用于集成于上述第一宿主应用的当前运行的小程序,而无法将运行目录下的运行数据应用于非在运行中或非集成于第一宿主应用的小程序。具体地,小程序对应的指令可以是各种各样的,比如指令可以指示将运行数据发送给小程序对应的服务器,以便于服务器进行数据分析,或者便于服务器对终端设备推送广告。In these optional implementation manners, the execution body can apply the running data in the running directory to the currently running applet integrated in the first host application, but cannot apply the running data in the running directory to the non-running applet An applet that is integrated or non-integrated into the first host application. Specifically, the instructions corresponding to the applet may be various, for example, the instructions may instruct to send the running data to the server corresponding to the applet, so as to facilitate the server to perform data analysis, or to facilitate the server to push advertisements to the terminal device.

这些可选的实现方式可以通过限定使用权限,对运行目录下的数据进行隔离,以便于更好地对其中的数据进行保护,避免上述执行主体将其中的数据应用于其他小程序。These optional implementations can isolate the data in the running directory by restricting usage rights, so as to better protect the data in it, and prevent the above-mentioned execution subject from applying the data in it to other applets.

继续参见图3,图3是根据本实施例的小程序运行方法的宿主应用场景的一个示意图。在图3的宿主应用场景中,终端设备301安装有包括即时通信宿主应用的5个宿主应用。终端设备301可以对上述即时通信宿主应用建立运行目录和3个数据目录302,其中,3个数据目录用于存储即时通信宿主应用所集成的3个不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据。终端设备301响应于检测到对集成于即时通信宿主应用的游戏小程序的用户启动操作,运行上述游戏小程序,将运行过程中产生的运行数据303存储于运行目录。终端设备301响应于检测到对游戏小程序的用户关闭操作,将运行目录下的运行数据303复制到游戏小程序对应的数据目录304下。Continuing to refer to FIG. 3 , FIG. 3 is a schematic diagram of a host application scenario of the applet running method according to this embodiment. In the host application scenario of FIG. 3 , the terminal device 301 is installed with five host applications including the instant messaging host application. The terminal device 301 can establish a running directory and three data directories 302 for the above instant messaging host application, wherein the three data directories are used to store the data of three different applets integrated by the instant messaging host application, and the running directory is used to store the running directory. data, operational data including user behavior data. The terminal device 301 runs the above-mentioned game applet in response to detecting the user-initiated operation of the game applet integrated in the instant messaging host application, and stores the operation data 303 generated during the operation in the operation directory. In response to detecting the user's closing operation of the game applet, the terminal device 301 copies the operation data 303 in the operation directory to the data directory 304 corresponding to the game applet.

本申请的上述实施例提供的方法通过对每个小程序单独设置数据目录,以使不同小程序间的数据相互隔离。并且本实施例对运行中的小程序设置运行目录,以便于对当前运行的运行数据设置使用权限,实现权限隔离。The method provided by the above-mentioned embodiments of the present application separates data between different applet programs by setting a data directory for each applet. In addition, in this embodiment, a running directory is set for the running applet, so as to set the usage authority for the currently running running data and implement authority isolation.

进一步参考图4,其示出了小程序运行方法的又一个实施例的流程400。该小程序运行方法的流程400,包括以下步骤:With further reference to FIG. 4 , it shows a flow 400 of yet another embodiment of a method for running an applet. The process 400 of the applet running method includes the following steps:

步骤401,对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据。Step 401, establishing an operation directory and at least one data directory for the first host application, wherein different data directories are used to store data of different small programs integrated by the first host application, and the operation directory is used to store operation data, and the operation data includes: User behavior data.

在本实施例中,小程序运行方法的执行主体(例如图1所示的终端设备)可以对第一宿主应用建立运行目录以及数据目录。这样,便于单独对运行目录设置权限,以使上述执行主体或者服务器无法将运行目录下的运行数据应用于不具备权限的小程序。第一宿主应用可以是终端设备安装的任意一个集成了小程序的宿主应用。用户行为数据指用户进行的关于小程序的行为所产生的数据。In this embodiment, the execution body of the applet running method (for example, the terminal device shown in FIG. 1 ) may establish a running directory and a data directory for the first host application. In this way, it is convenient to set permissions on the running directory separately, so that the above-mentioned execution subject or the server cannot apply the running data in the running directory to the applet that does not have the permission. The first host application may be any host application integrated with the applet installed on the terminal device. User behavior data refers to the data generated by the user's behavior about the Mini Program.

步骤402,响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录下。Step 402 , in response to detecting the user-initiated operation on the target applet integrated with the first host application, run the target applet, and store the operation data generated during the operation in the operation directory.

在本实施例中,上述执行主体可以响应于检测到用户对集成于上述第一宿主应用的目标小程序的用户启动操作,运行上述目标小程序,并将运行过程中产生的运行数据存储于上述运行目录下。用户启动操作是用户的操作,用于指示启动目标小程序。In this embodiment, the execution body may run the target applet in response to detecting a user-initiated operation of the target applet integrated in the first host application by the user, and store the operation data generated during the running process in the above-mentioned target applet. run directory. A user-initiated action is an action by the user to instruct the target applet to be activated.

步骤403,将在运行目录下生成的运行数据定时备份到目标小程序对应的数据目录下。Step 403, regularly backing up the running data generated in the running directory to the data directory corresponding to the target applet.

在本实施例中,上述执行主体可以周期性地将运行目标下生成的运行数据在目标小程序对应的数据目录下备份。比如可以在数据目录下压缩存储,以进行备份。此外,在每次备份之后,也可以对所备份的数据进行加密,以及时确保所备份数据不被随意使用。In this embodiment, the above-mentioned execution body may periodically back up the running data generated under the running target in the data directory corresponding to the target applet. For example, it can be compressed and stored in the data directory for backup. In addition, after each backup, the backed up data can also be encrypted to ensure that the backed up data is not used arbitrarily in time.

步骤404,响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。Step 404, in response to detecting the user's closing operation on the target applet, copy the running data in the running directory to the data directory corresponding to the target applet.

在本实施例中,上述执行主体可以响应于检测到用户对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。具体地,用户关闭操作为用户的操作,用于指示关闭上述目标小程序。In this embodiment, the execution body may copy the running data in the running directory to the data directory corresponding to the target applet in response to detecting the user's closing operation of the target applet by the user. Specifically, the user's closing operation is an operation of the user, which is used to instruct the closing of the above-mentioned target applet.

在本实施例的一些可选的实现方式中,步骤404包括:将运行目录下,在最后一次定时备份运行数据之后增加的运行数据复制到目标小程序对应的数据目录下。In some optional implementations of this embodiment, step 404 includes: copying the running data added after the last timed backup of the running data in the running directory to the data directory corresponding to the target applet.

在这些可选的实现方式中,上述执行主体的复制过程可以是对运行目录下的数据中,未备份到数据目录下的数据进行复制,而之前已经备份到数据目录下的数据则可以不再重复存储到数据目录下。这样,可以避免运行数据的重复存储,提高数据的存储效率。In these optional implementation manners, the copying process of the above-mentioned execution body may be to copy the data in the running directory that has not been backed up to the data directory, and the data that has been backed up to the data directory before may not be Repeatedly stored in the data directory. In this way, repeated storage of the operating data can be avoided, and the storage efficiency of the data can be improved.

在这些实现方式的一些可选的宿主应用场景中,在步骤404之后,上述方法还可以包括:在目标小程序对应的数据目录下,将定时备份的运行数据以及所复制的运行数据进行加密。In some optional host application scenarios of these implementations, after step 404, the above method may further include: encrypting the regularly backed up running data and the copied running data in the data directory corresponding to the target applet.

在这些可选的宿主应用场景中,上述执行主体可以将从运行目录存储到数据目录下的运行数据进行加密。具体地,这里所加密的数据可以包括定时备份的数据以及复制的数据。加密的秘钥是针对上述目标小程序的数据目录所设置的秘钥。In these optional host application scenarios, the above-mentioned execution body may encrypt the operation data stored from the operation directory to the data directory. Specifically, the encrypted data here may include regularly backed up data and replicated data. The encrypted key is the key set for the data directory of the above target applet.

这些宿主应用场景可以在将运行目录下的运行数据全部存储到数据目录下之后,再对存储的数据进行加密,这样,不会因为过于频繁的加密引起性能问题,从而确保小程序的运行顺畅。In these host application scenarios, after all the running data in the running directory is stored in the data directory, the stored data can be encrypted, so that performance problems will not be caused by too frequent encryption, thus ensuring the smooth running of the applet.

本实施例对运行数据进行定时备份,以避免小程序运行结束后统一存储可能带来的存储时间过于集中导致出现终端设备的性能问题。In this embodiment, the running data is backed up regularly, so as to avoid the performance problem of the terminal device caused by the excessive concentration of storage time caused by the unified storage after the operation of the applet is completed.

进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种小程序运行装置的一个实施例,该装置实施例与图2所示的方法实施例相对应,该装置具体可以应用于各种电子设备中。With further reference to FIG. 5 , as an implementation of the methods shown in the above figures, the present application provides an embodiment of an apparatus for running an applet. The apparatus embodiment corresponds to the method embodiment shown in FIG. 2 . Can be used in various electronic devices.

如图5所示,本实施例的小程序运行装置500包括:建立单元501、运行单元502和复制单元503。其中,建立单元501,被配置成对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据;运行单元502,被配置成响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录;复制单元503,被配置成响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。As shown in FIG. 5 , the applet running apparatus 500 in this embodiment includes: a establishing unit 501 , an running unit 502 and a copying unit 503 . The establishment unit 501 is configured to establish a running directory and at least one data directory for the first host application, wherein different data directories are used to store data of different applets integrated by the first host application, and the running directory is used to store Running data, the running data includes user behavior data; the running unit 502 is configured to run the target applet in response to detecting a user-initiated operation of the target applet integrated in the first host application, and convert the running data generated during the running process Stored in the running directory; the copying unit 503 is configured to copy the running data in the running directory to the data directory corresponding to the target applet in response to detecting the user closing operation of the target applet.

在一些实施例中,小程序运行装置500的建立单元501可以对第一宿主应用建立运行目录以及数据目录。这样,便于单独对运行目录设置权限,以使上述执行主体或者服务器无法将运行目录下的运行数据应用于不具备权限的小程序。第一宿主应用可以是终端设备安装的任意一个集成了小程序的宿主应用。In some embodiments, the establishing unit 501 of the applet running apparatus 500 may establish a running directory and a data directory for the first host application. In this way, it is convenient to set permissions on the running directory separately, so that the above-mentioned execution subject or the server cannot apply the running data in the running directory to the applet that does not have the permission. The first host application may be any host application integrated with the applet installed on the terminal device.

在一些实施例中,运行单元502可以响应于检测到用户对集成于上述第一宿主应用的目标小程序的用户启动操作,启动并运行上述目标小程序。并且,上述执行主体可以将运行过程中产生的运行数据存储于上述运行目录下。In some embodiments, the running unit 502 may start and run the above-mentioned target applet in response to detecting a user-initiated operation of the user on the target applet integrated in the above-mentioned first host application. In addition, the above-mentioned execution body may store the operation data generated during the operation process in the above-mentioned operation directory.

在一些实施例中,复制单元503可以响应于检测到用户对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。具体地,用户关闭操作为用户的操作,用于指示关闭上述目标小程序。In some embodiments, the copying unit 503 may copy the running data in the running directory to the data directory corresponding to the target applet in response to detecting the user's closing operation of the target applet by the user. Specifically, the user's closing operation is an operation of the user, which is used to instruct the closing of the above-mentioned target applet.

在本实施例的一些可选的实现方式中,第一宿主应用所集成的不同的小程序对应的数据目录的秘钥不同。In some optional implementation manners of this embodiment, the secret keys of the data directories corresponding to different mini-programs integrated in the first host application are different.

在本实施例的一些可选的实现方式中,运行单元,进一步被配置成按照如下方式执行响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序:响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,判断目标小程序对应的数据目录下是否存在运行数据;若存在,将存在的运行数据解密存储于运行目录下,基于运行目录下的运行数据,运行目标小程序;若不存在,运行目标小程序。In some optional implementations of this embodiment, the running unit is further configured to execute the target applet in response to detecting a user-initiated operation of the target applet integrated in the first host application in the following manner: in response to After detecting the user-initiated operation of the target applet integrated in the first host application, determine whether there is running data in the data directory corresponding to the target applet; if so, decrypt the existing running data and store it in the running directory, The running data in the directory, run the target applet; if it does not exist, run the target applet.

在本实施例的一些可选的实现方式中,装置还包括:加密单元,被配置成对目标小程序对应的数据目录下,目标小程序本次运行的运行数据进行加密。In some optional implementations of this embodiment, the apparatus further includes: an encryption unit configured to encrypt the running data of the current running of the target applet under the data directory corresponding to the target applet.

在本实施例的一些可选的实现方式中,装置还包括:备份单元,被配置成将在运行目录下生成的运行数据定时备份到目标小程序对应的数据目录下。In some optional implementations of this embodiment, the apparatus further includes: a backup unit configured to regularly back up the running data generated in the running directory to a data directory corresponding to the target applet.

在本实施例的一些可选的实现方式中,复制单元,进一步被配置成按照如下方式执行将运行目录下的运行数据复制到目标小程序对应的数据目录下:将运行目录下,在最后一次定时备份运行数据之后增加的运行数据复制到目标小程序对应的数据目录下。In some optional implementations of this embodiment, the copying unit is further configured to copy the running data in the running directory to the data directory corresponding to the target applet in the following manner: The running data added after the running data is regularly backed up is copied to the data directory corresponding to the target applet.

在本实施例的一些可选的实现方式中,装置还包括:执行单元,被配置成在目标小程序对应的数据目录下,将定时备份的运行数据以及所复制的运行数据进行加密。In some optional implementations of this embodiment, the apparatus further includes: an execution unit configured to encrypt the regularly backed up running data and the copied running data under the data directory corresponding to the target applet.

在本实施例的一些可选的实现方式中,装置还包括:清空单元,被配置成清空运行目录下的数据。In some optional implementation manners of this embodiment, the apparatus further includes: a clearing unit configured to clear data in the running directory.

在本实施例的一些可选的实现方式中,运行目录下的运行数据仅用于执行集成于第一宿主应用且在运行中的小程序对应的指令。In some optional implementations of this embodiment, the running data in the running directory is only used to execute the instructions corresponding to the running applet integrated in the first host application.

如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。As shown in FIG. 6, an electronic device 600 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 601 that may be loaded into random access according to a program stored in a read only memory (ROM) 602 or from a storage device 608 Various appropriate actions and processes are executed by the programs in the memory (RAM) 603 . In the RAM 603, various programs and data necessary for the operation of the electronic device 600 are also stored. The processing device 601 , the ROM 602 , and the RAM 603 are connected to each other through a bus 604 . An input/output (I/O) interface 605 is also connected to bus 604 .

通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图6中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。Typically, the following devices can be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration The output device 607 of the device, etc.; the storage device 608; and the communication device 609. Communication means 609 may allow electronic device 600 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 6 shows electronic device 600 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 6 may represent one device, or may represent multiple devices as required.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM 602被安装。在该计算机程序被处理装置601执行时,执行本公开的实施例的方法中限定的上述功能。需要说明的是,本公开的实施例的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication device 609 , or from the storage device 608 , or from the ROM 602 . When the computer program is executed by the processing apparatus 601, the above-described functions defined in the methods of the embodiments of the present disclosure are executed. It should be noted that the computer-readable medium of the embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, 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), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In embodiments of the present disclosure, 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. Rather, in embodiments of the present disclosure, a computer-readable signal medium may include a data signal in baseband or propagated as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks 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 the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that 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 in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括建立单元、运行单元和复制单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,建立单元还可以被描述为“对第一宿主应用建立运行目录和至少一个数据目录的单元”。The units involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described unit can also be provided in a processor, for example, it can be described as: a processor includes a building unit, an operating unit and a copying unit. Wherein, the names of these units do not constitute a limitation of the unit itself under certain circumstances, for example, the establishment unit may also be described as "a unit for establishing a running directory and at least one data directory for the first host application".

作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:对第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储第一宿主应用所集成的不同小程序的数据,运行目录用于存储运行数据,运行数据包括用户行为数据;响应于检测到对集成于第一宿主应用的目标小程序的用户启动操作,运行目标小程序,将运行过程中产生的运行数据存储于运行目录;响应于检测到对目标小程序的用户关闭操作,将运行目录下的运行数据复制到目标小程序对应的数据目录下。As another aspect, the present application also provides a computer-readable medium, which may be included in the apparatus described in the above-mentioned embodiments, or may exist independently without being assembled into the apparatus. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the device, the device causes the device to: establish a running directory and at least one data directory for the first host application, wherein different data directories Used to store data of different applets integrated by the first host application, the run directory is used to store run data, and the run data includes user behavior data; in response to detecting a user-initiated operation on the target applet integrated in the first host application , run the target applet, and store the running data generated during the running process in the running directory; in response to detecting the user closing operation of the target applet, copy the running data in the running directory to the data directory corresponding to the target applet.

以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above technical features, and should also cover the above technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above-mentioned features with the technical features disclosed in this application (but not limited to) with similar functions.

Claims (11)

1.一种小程序运行方法,应用于终端设备,所述终端设备安装有包括第一宿主应用的至少一个宿主应用;所述方法包括:1. A method for running an applet, applied to a terminal device installed with at least one host application including a first host application; the method comprising: 对所述第一宿主应用建立运行目录和至少一个数据目录,其中,不同的数据目录用于存储所述第一宿主应用所集成的不同小程序的数据,所述运行目录用于存储运行数据,运行数据包括用户行为数据;establishing an operation directory and at least one data directory for the first host application, wherein different data directories are used to store data of different small programs integrated by the first host application, and the operation directory is used to store operation data, Operational data includes user behavior data; 响应于检测到对集成于所述第一宿主应用的目标小程序的用户启动操作,运行所述目标小程序,将运行过程中产生的运行数据存储于所述运行目录下;In response to detecting the user-initiated operation of the target applet integrated in the first host application, run the target applet, and store the operation data generated during the operation in the operation directory; 响应于检测到对所述目标小程序的用户关闭操作,将所述运行目录下的运行数据复制到所述目标小程序对应的数据目录下。In response to detecting the user's closing operation on the target applet, the operation data in the operation directory is copied to the data directory corresponding to the target applet. 2.根据权利要求1所述的方法,其中,2. The method of claim 1, wherein, 所述第一宿主应用所集成的不同的小程序对应的数据目录的秘钥不同。The secret keys of the data directories corresponding to the different mini-programs integrated in the first host application are different. 3.根据权利要求1所述的方法,其中,响应于检测到对集成于所述第一宿主应用的目标小程序的用户启动操作,运行所述目标小程序,包括:3. The method of claim 1, wherein, in response to detecting a user-initiated operation on a target applet integrated into the first host application, running the target applet comprises: 响应于检测到对集成于所述第一宿主应用的目标小程序的用户启动操作,判断所述目标小程序对应的数据目录下是否存在运行数据;In response to detecting a user-initiated operation of the target applet integrated in the first host application, determining whether there is running data in the data directory corresponding to the target applet; 若存在,将存在的运行数据解密存储于所述运行目录下,基于所述运行目录下的运行数据,运行所述目标小程序;If it exists, decrypt the existing operating data and store it in the operating directory, and run the target applet based on the operating data in the operating directory; 若不存在,运行所述目标小程序。If not, run the target applet. 4.根据权利要求1所述的方法,其中,在所述将所述运行目录下的运行数据复制到所述目标小程序对应的数据目录下之后,所述方法还包括:4. The method according to claim 1, wherein, after the operation data under the operation directory is copied to the data directory corresponding to the target applet, the method further comprises: 对所述目标小程序对应的数据目录下,所述目标小程序本次运行的运行数据进行加密。Under the data directory corresponding to the target applet, the operation data of the current operation of the target applet is encrypted. 5.根据权利要求1所述的方法,其中,在所述将运行过程中产生的运行数据存储于所述运行目录下之后,所述方法还包括:5. The method according to claim 1, wherein after the operation data generated during the operation is stored in the operation directory, the method further comprises: 将在所述运行目录下生成的运行数据定时备份到所述目标小程序对应的数据目录下。The running data generated in the running directory is regularly backed up to the data directory corresponding to the target applet. 6.根据权利要求5所述的方法,其中,所述将所述运行目录下的运行数据复制到所述目标小程序对应的数据目录下,包括:6. The method according to claim 5, wherein the copying of the running data under the running directory to the data directory corresponding to the target applet comprises: 将所述运行目录下,在最后一次定时备份运行数据之后增加的运行数据复制到所述目标小程序对应的数据目录下。Copy the running data added after the last timed backup of running data in the running directory to the data directory corresponding to the target applet. 7.根据权利要求6所述的方法,其中,在所述将所述运行目录下的运行数据复制到所述目标小程序对应的数据目录下之后,所述方法还包括:7. The method according to claim 6, wherein, after the operation data under the operation directory is copied to the data directory corresponding to the target applet, the method further comprises: 所述在所述目标小程序对应的数据目录下,将定时备份的运行数据以及所复制的运行数据进行加密。In the data directory corresponding to the target applet, the regularly backed up operation data and the copied operation data are encrypted. 8.根据权利要求1-5之一所述的方法,其中,在所述将所述运行目录下的运行数据复制到所述目标小程序对应的数据目录下之后,所述方法还包括:8. The method according to one of claims 1-5, wherein, after the operation data under the operation directory is copied to the data directory corresponding to the target applet, the method further comprises: 清空所述运行目录下的数据。Clear the data in the running directory. 9.根据权利要求1-5之一所述的方法,其中,所述运行目录下的运行数据仅用于执行集成于所述第一宿主应用且在运行中的小程序对应的指令。9 . The method according to claim 1 , wherein the operation data under the operation directory is only used to execute instructions corresponding to the applet integrated in the first host application and running. 10 . 10.一种电子设备,包括:10. An electronic device comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-9中任一所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9. 11.一种计算机可读存储介质,其上存储有计算机程序,其中,该程序被处理器执行时实现如权利要求1-9中任一所述的方法。11. A computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the method of any one of claims 1-9.
CN201910331999.0A 2019-04-24 2019-04-24 Small program running method and device Active CN110046000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910331999.0A CN110046000B (en) 2019-04-24 2019-04-24 Small program running method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910331999.0A CN110046000B (en) 2019-04-24 2019-04-24 Small program running method and device

Publications (2)

Publication Number Publication Date
CN110046000A true CN110046000A (en) 2019-07-23
CN110046000B CN110046000B (en) 2022-03-11

Family

ID=67278913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910331999.0A Active CN110046000B (en) 2019-04-24 2019-04-24 Small program running method and device

Country Status (1)

Country Link
CN (1) CN110046000B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110688124A (en) * 2019-08-23 2020-01-14 北京奇艺世纪科技有限公司 Applet processing method, device, electronic equipment and computer readable storage medium
CN111338542A (en) * 2020-02-19 2020-06-26 北京字节跳动网络技术有限公司 Shortcut generation method and device and computer readable storage medium
CN112559980A (en) * 2020-11-24 2021-03-26 珠海凡泰极客科技有限责任公司 Applet operation capable of embedding numerous arbitrary APPs
CN114003404A (en) * 2021-10-20 2022-02-01 上海钧正网络科技有限公司 Application service providing method and device based on host program
CN114896570A (en) * 2020-05-27 2022-08-12 支付宝(杭州)信息技术有限公司 Installation management method, device and system of applet

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853181A (en) * 2010-05-11 2010-10-06 中达电通股份有限公司 Subprogram mutual calling method used in embedded system
CN103473091A (en) * 2011-01-21 2013-12-25 北京奇虎科技有限公司 Method and system for software migration and installation for computing equipment
CN104063284A (en) * 2013-03-18 2014-09-24 腾讯科技(深圳)有限公司 Method and device operating application program
CN104965723A (en) * 2014-10-09 2015-10-07 腾讯科技(深圳)有限公司 Application program operation method and apparatus
CN107220528A (en) * 2017-07-21 2017-09-29 北京深思数盾科技股份有限公司 The protection of java applet and operation method, device and terminal
CN109542530A (en) * 2018-10-26 2019-03-29 深圳点猫科技有限公司 A kind of hierarchical loading method and device based on small routine framework

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853181A (en) * 2010-05-11 2010-10-06 中达电通股份有限公司 Subprogram mutual calling method used in embedded system
CN103473091A (en) * 2011-01-21 2013-12-25 北京奇虎科技有限公司 Method and system for software migration and installation for computing equipment
CN104063284A (en) * 2013-03-18 2014-09-24 腾讯科技(深圳)有限公司 Method and device operating application program
CN104965723A (en) * 2014-10-09 2015-10-07 腾讯科技(深圳)有限公司 Application program operation method and apparatus
CN107220528A (en) * 2017-07-21 2017-09-29 北京深思数盾科技股份有限公司 The protection of java applet and operation method, device and terminal
CN109542530A (en) * 2018-10-26 2019-03-29 深圳点猫科技有限公司 A kind of hierarchical loading method and device based on small routine framework

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
微信开发者: "小程序.小故事(19)——文件系统能力", 《小程序.小故事(19)——文件系统能力,HTTPS://WWW.QIANYXCX.COM/ARTICLE/36.HTML》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110688124A (en) * 2019-08-23 2020-01-14 北京奇艺世纪科技有限公司 Applet processing method, device, electronic equipment and computer readable storage medium
CN110688124B (en) * 2019-08-23 2023-03-17 北京奇艺世纪科技有限公司 Applet processing method, apparatus, electronic device and computer readable storage medium
CN111338542A (en) * 2020-02-19 2020-06-26 北京字节跳动网络技术有限公司 Shortcut generation method and device and computer readable storage medium
CN114896570A (en) * 2020-05-27 2022-08-12 支付宝(杭州)信息技术有限公司 Installation management method, device and system of applet
CN112559980A (en) * 2020-11-24 2021-03-26 珠海凡泰极客科技有限责任公司 Applet operation capable of embedding numerous arbitrary APPs
CN112559980B (en) * 2020-11-24 2023-05-05 深圳凡泰极客科技有限责任公司 Applet runtime capable of embedding a plurality of random APP
CN114003404A (en) * 2021-10-20 2022-02-01 上海钧正网络科技有限公司 Application service providing method and device based on host program
CN114003404B (en) * 2021-10-20 2024-09-27 上海钧正网络科技有限公司 Application service providing method and device based on host program

Also Published As

Publication number Publication date
CN110046000B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
JP6795684B2 (en) Malware detection and content item restoration
CN110046000B (en) Small program running method and device
JP6216886B2 (en) Technology for managing unsynchronized content items on unlinked devices
US10762229B2 (en) Secure searchable and shareable remote storage system and method
CN106612285B (en) Distributed cloud data management method and system based on peer-to-peer network
US8966287B2 (en) Systems and methods for secure third-party data storage
EP2831803B1 (en) Systems and methods for secure third-party data storage
US9202076B1 (en) Systems and methods for sharing data stored on secure third-party storage platforms
US10157290B1 (en) Systems and methods for encrypting files
US8713300B2 (en) System and method for netbackup data decryption in a high latency low bandwidth environment
US20150324303A1 (en) Systems and methods for secure hybrid third-party data storage
US11799644B2 (en) Default password removal
WO2020216204A1 (en) Information acquisition method and apparatus
US10645073B1 (en) Systems and methods for authenticating applications installed on computing devices
US10043015B2 (en) Method and apparatus for applying a customer owned encryption
CN110377440A (en) Information processing method and device
US9887979B1 (en) Systems and methods for enabling users to launch applications without entering authentication credentials
US10462113B1 (en) Systems and methods for securing push authentications
CN110825815A (en) Cloud note system information processing method, equipment and medium based on block chain
CN106547485B (en) Data migration method and device
CN110492998B (en) Methods of encrypting and decrypting data
CN110995690A (en) Secure storage method and device based on cloud storage
CN111309698A (en) Disk redirection method, device and system
CN113961931B (en) ADB tool usage method, device and electronic device
US10203944B1 (en) Systems and methods for dynamically customizing software programs

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 201306 N2025 room 24, 2 New Town Road, mud town, Pudong New Area, Shanghai

Patentee after: Shanghai Lianshang Network Technology Group Co.,Ltd.

Country or region after: China

Address before: 201306 N2025 room 24, 2 New Town Road, mud town, Pudong New Area, Shanghai

Patentee before: SHANGHAI LIANSHANG NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China