WO2021013242A1 - 一种启动小程序的方法、设备和计算机存储介质 - Google Patents

一种启动小程序的方法、设备和计算机存储介质 Download PDF

Info

Publication number
WO2021013242A1
WO2021013242A1 PCT/CN2020/104097 CN2020104097W WO2021013242A1 WO 2021013242 A1 WO2021013242 A1 WO 2021013242A1 CN 2020104097 W CN2020104097 W CN 2020104097W WO 2021013242 A1 WO2021013242 A1 WO 2021013242A1
Authority
WO
WIPO (PCT)
Prior art keywords
host application
applet
file package
host
terminal device
Prior art date
Application number
PCT/CN2020/104097
Other languages
English (en)
French (fr)
Inventor
苗景磊
Original Assignee
上海连尚网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海连尚网络科技有限公司 filed Critical 上海连尚网络科技有限公司
Publication of WO2021013242A1 publication Critical patent/WO2021013242A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1748De-duplication implemented within the file system, e.g. based on file segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • 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/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading
    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications

Definitions

  • the present invention relates to the technical field of computer applications, in particular to a method, equipment and computer storage medium for starting a small program.
  • Mini Program is an application that can be used without installation, and it runs in the environment provided by the host application. It is more and more widely used because it is available at any time without installation and uninstallation. At present, each host application needs to download the file package of the applet locally when launching the applet, which will inevitably cause a waste of resources.
  • the present invention provides a method, device and computer storage medium for starting a small program to save resources.
  • the present invention provides a method for starting an applet, which is executed by a host application of a terminal device, and the method includes:
  • confirming whether there is a file package of the applet stored in the host application in the terminal device includes: confirming that each host application in the terminal device belongs to the same host alliance as the host application, and determining Whether the determined host application stores the file package of the applet;
  • Setting the storage location of the file package of the applet can also be readable by other host applications, including: setting the storage location of the file package of the applet to be readable by each host application that belongs to the same host alliance as the host application;
  • each host application in the same host alliance adopts the same applet standard.
  • the method further includes:
  • the information of each host application belonging to the same host alliance as the host application is synchronized from the server side, and the host application information of the host alliance that has been installed by the terminal device is determined.
  • confirming whether there is a file package in which the host application stores the applet in the terminal device includes:
  • the method further includes:
  • the status of the file package of the mini program stored in the host application is reported to the server, so that other host applications of the terminal device can obtain it from the server.
  • the method further includes:
  • the status of the file package of each host application storage applet in the terminal device is obtained from the server and stored in the private database of the host application;
  • the method further includes:
  • the status of storing the file package of the applet in the host application is synchronized to the shared database in the terminal device, so that other host applications of the terminal device can obtain it from the shared database.
  • the storage location of the file package of the applet is in the private directory of the host application.
  • confirming whether there is a file package in which the host application stores the applet in the terminal device includes:
  • the terminal device determines whether the terminal device has a file package in which the applet is stored in another host application. If so, read all files from the private directory of the other host application that stores the file package of the applet. The file package of the small program.
  • confirming whether there is a file package of the applet stored in the host application in the terminal device includes: determining whether the shared storage space of the terminal device stores the file package of the applet;
  • the downloading and storing the file package of the small program from the server side includes: downloading the file package of the small program from the server side and storing it in the shared storage space of the terminal device.
  • the present invention provides a method for starting an applet, which is executed by the server corresponding to the host application, and the method includes:
  • the status of the file package of each host application stored in the applet in the terminal device where the host application is located is synchronized with the corresponding host application for use by the corresponding host application to start the applet.
  • the method further includes:
  • the information of each host application that belongs to the same host alliance with the corresponding host application is synchronized with the corresponding host application, where each host application in the same host alliance adopts the same applet standard.
  • the integration of the file package status of each host application stored applet in the same terminal device includes:
  • the status of the file packages of the host application storage applet stored on the server side and the status of the file packages of each host application storage applet synchronized from the server side of other host applications are combined and deduplicated for the same terminal device.
  • the present invention provides a device, which includes:
  • One or more processors are One or more processors;
  • Storage device for storing one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
  • the present invention provides a storage medium containing computer-executable instructions, which when executed by a computer processor are used to perform any of the above methods.
  • each host application in the same terminal device shares the downloaded applet file package to start the applet, thereby solving the problem of repeated downloading of the applet and saving resources.
  • FIG. 1 is a schematic diagram of a system architecture involved in an embodiment of the present invention
  • Figure 2 is a flowchart of a main method provided by an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method executed by a host application 1 according to Embodiment 1 of the present invention
  • FIG. 4 is a flowchart executed on the server side in Embodiment 1 of the present invention.
  • FIG. 5 is a flowchart of a method executed by the host application 1 according to Embodiment 2 of the present invention.
  • FIG. 6 is a flowchart of a method executed by a host application 1 according to Embodiment 3 of the present invention.
  • Figure 7 shows a block diagram of an exemplary computer system suitable for implementing embodiments of the present invention.
  • the system architecture mainly includes a host application and a server side corresponding to the host application.
  • the applet relies on the host application to run on the terminal device, and the environment in which the applet runs is provided by the host application.
  • the terminal devices may include, but are not limited to, smart mobile terminals, smart home devices, network devices, wearable devices, smart medical devices, PCs (personal computers), etc.
  • smart mobile devices can include mobile phones, tablet computers, notebook computers, PDAs (personal digital assistants), Internet cars, etc.
  • Smart home devices may include smart home appliances, such as smart TVs, smart speakers, and so on.
  • Network equipment may include, for example, switches, wireless APs, servers, and so on.
  • Wearable devices may include smart watches, smart glasses, smart bracelets, virtual reality devices, augmented reality devices, mixed reality devices (that is, devices that can support virtual reality and augmented reality), and so on.
  • the same terminal device may contain multiple host applications.
  • host application 1 and host application 2 are taken as an example.
  • a host application may also run multiple applets, and different host applications may run different applets or the same applet.
  • the host application 1 runs the applet a and the applet b
  • the host application 2 runs the applet b and the applet c.
  • Each host application has a corresponding server side. As shown in Figure 1, host application 1 corresponds to server side 1, and host application 2 corresponds to server side 2. Each host application can interact with its corresponding server. In the embodiment of the present invention, data exchange can also be performed between different servers.
  • Each server can be a single server or a server group composed of multiple servers. It should be understood that the numbers of terminal devices, host applications, applets, and servers in FIG. 1 are only illustrative. According to implementation needs, there can be any number of terminal devices, host applications, applets, and servers.
  • FIG. 2 is a flowchart of the main method provided by an embodiment of the present invention.
  • the method is executed by the host application of the terminal device.
  • the execution device may be a plug-in located in the host application of the terminal device or a functional unit such as a software development kit (SDK). .
  • SDK software development kit
  • the present invention is not limited to the types of events that trigger the start of the applet in the host application.
  • the user can click the icon of the applet in the host application to trigger the start of the applet, or the user can click a link in the host application to trigger the corresponding applet Start, etc.
  • the file package of the applet involved in the embodiment of the present invention is not an installation package, but contains the applet files required to start the applet and run the applet, and may include, for example: source files , Compressed code, resource files, etc.
  • the file package of the small program is downloaded from the server and stored to start the small program, and the storage location of the file package of the small program is set to be readable by other host applications.
  • the terminal device does not store the file package of the applet in the host application, it needs to be downloaded from the server, and the file package of the applet needs to be stored.
  • the file package of the small program for downloading can also be used by other host applications. In addition to the storage location of the small program package readable by the host application, the storage location is also readable by other host applications.
  • a host application in the same terminal device is used to share the file package of the stored applet, and the sharing method may be, but not limited to, the following:
  • the first method the host application stores the downloaded applet file package in the private directory of the host application, and the private directory is set to be readable by other host applications. At the same time, the host application reports the status of the file package storing the applet to the corresponding server.
  • the server side of each host application will synchronize the status of the file package of the host application storing the applet so that other host applications can access the corresponding
  • the server side obtains the status of the file package of each host application storing the applet in the same terminal device.
  • the host application stores the applet file package in the private directory of the host application, and the status of each host application storing the applet file package is synchronized on the server side and obtained from the server side.
  • the second method the host application stores the downloaded applet file package in the private directory of the host application, and the private directory is set to be readable by other host applications. At the same time, the host application records the status of the file package storing the applet in the shared database in the terminal device. Each host application can learn the storage status of the applet file package from the shared database.
  • the third method the host application stores the downloaded small program file packages in the shared storage space of the terminal device, and each host application in the terminal device reads the small program file package from the shared storage space to start the small program.
  • a host application that adopts the same applet standard can be called a host alliance.
  • the method of sharing the applet file package provided by the embodiment of the present invention is adopted. Which host applications belong to the same host alliance can be configured on the server side uniformly, and then each host application obtains it from the server side.
  • the manner in which each host application of the same host alliance shares the applet file package is described as an example.
  • the file packages of all applets adopt a unified naming mechanism, so that the corresponding applets can be known through the file package names of the applets.
  • FIG. 3 is a flowchart of a method provided in Embodiment 1 of the present invention.
  • the first implementation manner described above is described.
  • the method executed by the host application 1 may include the following processes:
  • the information of the host alliance is synchronized from the server and stored in the local database of the host application 1.
  • the host application 1 When the host application 1 is started, it can send a synchronization request of the host alliance to the corresponding server, and the corresponding server returns to the host application 1 the information of each host application of the host alliance, such as the package name. Then the host application 1 can determine the host application information of the host alliance that the terminal device has installed.
  • the host application 1 When the host application 1 starts, it can scan the locally installed applications of the terminal device where it is located, and then further use the information of the host alliance synchronized from the server to determine the host application of the host alliance that the terminal device has installed Information, the host application information can be stored in the database of the host application in the form of a list.
  • the host application 1 can store the information of the host application 1 and the host application 2 in the local database of the host application 1.
  • the status of the small program file packages stored by each host application in the same host alliance in the terminal device is synchronized from the server side, and stored in the local database of the host application 1.
  • the small program file packages stored in the host application of the host alliance in the terminal device can be obtained from the server side, for example, including the package name and version number.
  • host application 1 obtains this terminal device from the server.
  • Host application 1 stores applet a and applet b
  • host application 2 stores applet b and applet c. Then store this information in the host application 1 In the local database.
  • the file package of the small program c stored in the private directory of the host application 1 is used to start the small program c, and the startup process is ended.
  • the host application 1 reads the file package of the applet c from the private directory of other host applications, and is used to start the applet c in the host application 1 to end the startup process.
  • the host application 1 reads the file package of the applet c from the private directory of the host application 2 to start the applet c.
  • the host application 1 downloads the file package of the applet c from the corresponding server, stores it in the private directory of the host application 1, and sets the permissions of the private directory to be readable by each host application of the host alliance.
  • only the permissions of the private directory may be set to be readable and not writable by each host application of the host alliance.
  • the host application 1 uses the downloaded file package to start the small program c, and reports the status of the file package storing the small program c to the server.
  • the process shown in Figure 4 can be executed for the server, including:
  • the host application When the host application reports the status of the file package storing the applet, it can carry information such as terminal device identification, host application identification, applet identification, and applet version number. After the server receives this information, it performs corresponding maintenance on the server-side local database.
  • the status of the file package of the other host application storing the applet is synchronized from the server side of the other host application.
  • the foregoing 401 and 402 are not necessarily executed in the foregoing order.
  • the synchronization in step 402 may be periodic or triggered based on an event.
  • the server side of each host application can open an interface for synchronization with each other for the host alliance, and the server side can synchronize the status of the file package of each host application storage applet stored in the local database to other server ends in the host alliance.
  • the status stored in the local database on the server side and the status synchronized from other servers are both in the form of "terminal device identification-host application identification-applet identification-applet version number", how can the same terminal device identification
  • the information is merged and de-duplicated, so as to obtain the status of the file package of each host application storing the applet under the same terminal device identification.
  • the status of the file package of each host application stored in the applet in the terminal device where the host application is located is synchronized with the corresponding host application, so that the corresponding host application can start the applet for use.
  • the terminal device identification of the host application can be obtained, and the status of the file package of each host application storing the applet under the terminal device identification can be issued to it.
  • FIG. 5 is a flowchart of a method provided in Embodiment 2 of the present invention. In this embodiment, the foregoing second implementation manner is described. Assuming that the user wants to start the applet c in the host application 1, as shown in FIG. 5, the method executed by the host application 1 may include the following processes:
  • the file package of the small program c stored in the private directory of the host application 1 is used to start the small program c, and the startup process is ended.
  • a shared database may be set in the terminal device, and the shared database has read and write permissions for all host applications in the host alliance.
  • the shared database maintains the status of the file package of each host application in the host alliance in the terminal device, including the package name and version number.
  • this step on the one hand, it is also determined whether other host applications of the same host alliance store the file package of applet c, and on the other hand, it is determined whether the stored file package of applet c meets the version requirements of host application 1. Both If it is satisfied, go to 505, otherwise go to 506. Generally, if the required version of the host application 1 is lower than or equal to the version of the applet c stored in other host applications, it is considered that the version requirement is met.
  • the host application 1 reads the file package of the applet c from the private directory of other host applications, and is used to start the applet c in the host application 1 to end the startup process.
  • the host application 1 reads the file package of the applet c from the private directory of the host application 2 to start the applet c.
  • the host application 1 downloads the file package of the applet c from the corresponding server, stores it in the private directory of the host application 1, and sets the permissions of the private directory to be readable by each host application of the host alliance.
  • only the permissions of the private directory may be set to be readable and not writable by each host application of the host alliance.
  • the host application 1 uses the downloaded file package to start the small program c, and records the status of the file package storing the small program c in the shared database.
  • FIG. 6 is a flow chart of the method provided in Embodiment 3 of the present invention.
  • the above-mentioned third implementation manner is described. Assuming that the user wants to start the applet c in the host application 1, as shown in Figure 6, the method may include the following processes:
  • the host application 1 obtains the event initiated by the applet c.
  • the host application 1 determines whether the shared storage space of the terminal device stores the file package of the applet c, if yes, execute 603; otherwise, execute 604.
  • a shared storage space is set in the terminal device, and the shared storage space is open to read and write permissions for each host application in the host alliance.
  • the host applications in the host alliance all store the downloaded applet file package in the shared storage space for sharing within the host alliance.
  • this step on the one hand, it is also determined whether the file package of applet c is stored in the shared storage space, and on the other hand, it is determined whether the file package of the stored applet c meets the version requirements of the host application 1. If both , Go to 603, otherwise go to 604. Generally, if the required version of the host application 1 is lower than or equal to the stored version of the applet c, it is considered to meet the version requirements.
  • the host application 1 reads the file package of the applet c from the shared storage space, starts the applet c, and ends the startup process.
  • the host application 1 downloads the file package of the applet c from the corresponding server, and stores it in the shared storage space of the terminal device.
  • the file package of the lower version that already exists in the shared storage space can be retained or deleted.
  • the form of the aforementioned shared storage space is not limited by the present invention.
  • an SDCard may be used, or other forms of shared storage space may be used.
  • the host application 1 uses the downloaded file package to start the applet c.
  • Figure 7 shows a block diagram of an exemplary computer system 012 suitable for implementing embodiments of the present invention.
  • the computer system 012 shown in FIG. 7 is only an example, and should not bring any limitation to the functions and application scope of the embodiments of the present invention.
  • the computer system 012 is represented in the form of a general-purpose computing device.
  • the components of the computer system 012 may include, but are not limited to: one or more processors or processing units 016, a system memory 028, and a bus 018 connecting different system components (including the system memory 028 and the processing unit 016).
  • the bus 018 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
  • Computer system 012 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer system 012, including volatile and non-volatile media, removable and non-removable media.
  • the system memory 028 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 030 and/or cache memory 032.
  • the computer system 012 may further include other removable/non-removable, volatile/nonvolatile computer system storage media.
  • the storage system 034 can be used to read and write non-removable, non-volatile magnetic media (not shown in FIG. 7, and is generally referred to as a "hard drive").
  • a disk drive for reading and writing to a removable non-volatile disk such as a "floppy disk”
  • a removable non-volatile disk such as CD-ROM, DVD-ROM
  • other optical media read and write optical disc drives.
  • each drive can be connected to the bus 018 through one or more data media interfaces.
  • the memory 028 may include at least one program product, and the program product has a set (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 040 with a set of (at least one) program module 042 can be stored in, for example, the memory 028.
  • Such program module 042 includes, but is 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 042 generally executes the functions and/or methods in the described embodiments of the present invention.
  • the computer system 012 can also communicate with one or more external devices 014 (such as keyboards, pointing devices, displays 024, etc.).
  • the computer system 012 communicates with external radar devices, and can also communicate with one or more users Communication with a device that can interact with the computer system 012, and/or with any device (such as a network card, modem, etc.) that enables the computer system 012 to communicate with one or more other computing devices. This communication can be performed through an input/output (I/O) interface 022.
  • the computer system 012 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 020.
  • networks such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet
  • the network adapter 020 communicates with other modules of the computer system 012 through the bus 018. It should be understood that although not shown in FIG. 7, other hardware and/or software modules can be used in conjunction with the computer system 012, 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 processing unit 016 executes various functional applications and data processing by running programs stored in the system memory 028, for example, to implement the method flow provided by the embodiment of the present invention.
  • the above-mentioned computer program may be set in a computer storage medium, that is, the computer storage medium is encoded with a computer program.
  • the program is executed by one or more computers, one or more computers can execute the above-mentioned embodiments of the present invention.
  • the method flow and/or device operation For example, the process of the method provided in the embodiment of the present invention is executed by the above-mentioned one or more processors.
  • 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.
  • 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.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory Erasable programmable read-only memory
  • CD-ROM compact disk read-only memory
  • 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 connect to the user's computer) connection).
  • LAN local area network
  • WAN wide area network

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

本发明提供了一种启动小程序的方法、设备和计算机存储介质,其中方法包括:终端设备的宿主应用获取到触发小程序启动的事件后,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包;如果是,则利用所述小程序的文件包启动所述小程序;否则,从服务器端下载并存储所述小程序的文件包,设置所述小程序的文件包的存储位置其他宿主应用也可读。在本发明中同一终端设备中各宿主应用共享下载的小程序的文件包来进行小程序的启动,从而实现解决小程序重复下载的问题,节约资源。

Description

一种启动小程序的方法、设备和计算机存储介质 【技术领域】
本发明涉及计算机应用技术领域,特别涉及一种启动小程序的方法、设备和计算机存储介质。
【背景技术】
本部分旨在为权利要求书中陈述的本发明的实施方式提供背景或上下文。此处的描述不因为包括在本部分中就被认为是现有技术。
小程序(Mini Program)是一种不需要安装即可使用的应用,其运行于宿主应用提供的环境下。其因随时可用但又无需安装卸载而得到了越来越广泛的应用。目前各宿主应用在启动小程序时,均需要分别在宿主应用本地下载小程序的文件包,这必然会造成资源的浪费。
【发明内容】
有鉴于此,本发明提供了一种启动小程序的方法、设备和计算机存储介质,以节约资源。
具体技术方案如下:
一方面,本发明提供了一种启动小程序的方法,由终端设备的宿主应用执行,该方法包括:
获取到触发小程序启动的事件;
确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包;
如果是,则利用所述小程序的文件包启动所述小程序;
否则,从服务器端下载并存储所述小程序的文件包以启动所述小程序,设置所述小程序的文件包的存储位置其他宿主应用也可读。
根据本发明一优选实施方式,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:确认所述终端设备中与本宿主应用属于同一宿主联盟的各宿主应用,判断确定出的所述各宿主应用是否存储有所述小程序的文件包;
设置所述小程序的文件包的存储位置其他宿主应用也可读,包括:设置所述小程序的文件包的存储位置对于与本宿主应用属于同一宿主联盟的各宿主应用可读;
其中,同一宿主联盟中各宿主应用采用相同的小程序标准。
根据本发明一优选实施方式,该方法还包括:
从服务器端同步与本宿主应用属于同一宿主联盟的各宿主应用的信息,并确定所述终端设备已经安装的所述宿主联盟的宿主应用信息。
根据本发明一优选实施方式,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:
判断所述终端设备中是否存在宿主应用存储有所述小程序的文件包且该小程序的文件包符合本宿主应用的版本要求。
根据本发明一优选实施方式,在所述从服务器端下载并存储所述小程序的包之后,该方法还包括:
将本宿主应用存储小程序的文件包的状况上报至服务器端,以便所述终端设备的其他宿主应用从服务器端获取。
根据本发明一优选实施方式,该方法还包括:
宿主应用启动后,从服务器端获取所述终端设备中各宿主应用存储小程序的文件包的状况,并存储于本宿主应用的私有数据库;
查询所述私有数据库以执行所述确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包的步骤。
根据本发明一优选实施方式,在所述从服务器端下载并存储所述小程序的包之后,该方法还包括:
将本宿主应用存储所述小程序的文件包的状况同步至所述终端设备中的共享数据库,以便所述终端设备的其他宿主应用从所述共享数据库获取。
根据本发明一优选实施方式,所述小程序的文件包的存储位置为本宿主应用的私有目录下。
根据本发明一优选实施方式,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:
先确认本宿主应用的私有目录下是否存在所述小程序的文件包;
如果不存在,再判断所述终端设备是否存在其他宿主应用存储有所述小程序的文件包,如果是,则从存储有所述小程序的文件包的其他宿主应用的私有目录下读取所述小程序的文件包。
根据本发明一优选实施方式,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:判断所述终端设备的共享存储空间是否存储有所述小程序的文件包;
所述从服务器端下载并存储所述小程序的文件包,包括:从服务器端下载所述小程序的文件包并存储于所述终端设备的共享存储空间。
第二方面,本发明提供了一种启动小程序的方法,由宿主应用对应的服务器端执行,该方法包括:
接收对应宿主应用上报的所述宿主应用存储小程序的文件包的状况;以及,从其他宿主应用的服务器端同步其他宿主应用存储小程序的文件包的状况;
对同一终端设备中各宿主应用存储小程序的文件包的状况进行整合;
向对应宿主应用同步该宿主应用所在终端设备中各宿主应用存储小程序的文件包的状况,以供对应宿主应用启动小程序使用。
根据本发明一优选实施方式,该方法还包括:
向对应宿主应用同步与对应宿主应用属于同一宿主联盟的各宿主应用的信息,其中,同一宿主联盟中各宿主应用采用相同的小程序标准。
根据本发明一优选实施方式,所述对同一终端设备中各宿主应用存储小程序的文件包的状况进行整合包括:
将本服务器端存储的宿主应用存储小程序的文件包的状况与从其他宿主应用的服务器端同步来的各宿主应用存储小程序的文件包的状况进行针对同一终端设备的合并和去重。
第三方面,本发明提供了一种设备,所述设备包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上任一所述的方法。
第四方面,本发明提供了一种包含计算机可执行指令的存储介质,所述计 算机可执行指令在由计算机处理器执行时用于执行如上任一所述的方法。
由以上技术方案可以看出,在本发明中同一终端设备中各宿主应用共享下载的小程序的文件包来进行小程序的启动,从而实现解决小程序重复下载的问题,节约资源。
【附图说明】
图1为本发明实施例涉及的系统架构示意图;
图2为本发明实施例提供的主要方法流程图;
图3为本发明实施例一提供的宿主应用1执行的方法流程图;
图4为本发明实施例一中服务器端执行的流程图;
图5为本发明实施例二提供的宿主应用1执行的方法流程图;
图6为本发明实施例三提供的宿主应用1执行的方法流程图;
图7示出了适于用来实现本发明实施方式的示例性计算机系统的框图。
【具体实施方式】
为了使本发明的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本发明进行详细描述。
为了方便对本发明的理解,首先对本发明所涉及的系统架构以及主要概念进行描述。如图1中所示,该系统架构主要包括宿主应用和宿主应用对应的服务器端。
小程序依托宿主应用在终端设备上运行,小程序运行所在的环境是宿主应用提供的。其中终端设备可以包括但不限于诸如:智能移动终端、智能家居设备、网络设备、可穿戴式设备、智能医疗设备、PC(个人计算机)等。其中智能移动设备可以包括诸如手机、平板电脑、笔记本电脑、PDA(个人数字助理)、互联网汽车等。智能家居设备可以包括智能家电设备,诸如智能电视、智能音箱等。网络设备可以包括诸如交换机、无线AP、服务器等。可穿戴式设备可以包括诸如智能手表、智能眼镜、智能手环、虚拟现实设备、增强现实设备、混合现实设备(即可以支持虚拟现实和增强现实的设备)等等。
同一终端设备上可能包含多个宿主应用,图1中以包含宿主应用1和宿主应用2为例。一个宿主应用中也可能运行多个小程序,且不同宿主应用可能运行不同的小程序,也可能运行相同的小程序。如图1中所示,宿主应用1中运 行小程序a和小程序b,宿主应用2中运行小程序b和小程序c。
每个宿主应用都存在对应的服务器端,如图1中所示,宿主应用1对应服务器端1,宿主应用2对应服务器端2。每个宿主应用均可以与其对应的服务器端进行交互,在本发明实施例中,不同的服务器端之间也可以进行数据交互。
各服务器端可以是单一服务器,也可以是多个服务器构成的服务器群组。应该理解,图1中的终端设备、宿主应用、小程序、服务器端的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、宿主应用、小程序、服务器端。
本发明的核心思想在于,同一终端设备中各宿主应用共享下载的小程序的文件包来进行小程序的启动,从而实现解决小程序重复下载的问题,节约资源。图2为本发明实施例提供的主要方法流程图,该方法由终端设备的宿主应用执行,执行装置可以是位于终端设备宿主应用的插件或软件开发工具包(Software Development Kit,SDK)等功能单元。如图2所示,该方法主要包括以下步骤:
在201中,获取触发小程序启动的事件。
本发明并不限于在宿主应用中触发小程序启动的事件类型,例如可以是用户在宿主应用中点击小程序图标以触发小程序启动,也可以是用户在宿主应用中点击某链接触发对应小程序启动,等等。
在202中,确认终端设备中是否存在宿主应用存储有该小程序的文件包,如果是,执行203;否则,执行204。
由于小程序在宿主应用中无需安装,因此本发明实施例中涉及的小程序的文件包并非安装包,而是包含启动小程序以及运行小程序所需要的小程序文件,可以包括诸如:源文件、压缩后的代码、资源文件等等。
在203中,利用该小程序的文件包启动该小程序,结束流程。
如果在终端设备中已经有宿主应用存储有该小程序的文件包,则无需重复下载,直接利用已经存储的小程序的文件包启动小程序即可。
在204中,从服务器端下载并存储该小程序的文件包以启动该小程序,设置该小程序的文件包的存储位置其他宿主应用可读。
若终端设备中并没有宿主应用存储有该小程序的文件包,则需要从服务器端下载,并存储该小程序的文件包。为了下载的小程序的文件包也能够为其他 宿主应用所使用,除了本宿主应用可读该小程序包的存储位置之外,该存储位置对其他宿主应用也可读。
在本发明实施例中采用同一终端设备中宿主应用共享存储的小程序的文件包的方式,其中共享方式可以采用但不限于以下几种:
第一种方式:宿主应用将下载的小程序文件包存储于本宿主应用的私有目录下,设置该私有目录对其他宿主应用也可读。同时,宿主应用将存储小程序的文件包的状况上报至对应的服务器端,各宿主应用的服务器端会进行宿主应用存储小程序的文件包的状况同步,以供其他宿主应用均能够从对应的服务器端获取到同一终端设备中各宿主应用存储小程序的文件包的状况。
也就是说,第一种方式中,宿主应用将小程序文件包存储在本宿主应用的私有目录下,各宿主应用存储小程序文件包的状况在服务器端同步并从服务器端获取。
第二种方式:宿主应用将下载的小程序文件包存储于本宿主应用的私有目录下,设置该私有目录对其他宿主应用也可读。同时,宿主应用将存储小程序的文件包的状况记录于终端设备中的共享数据库。各宿主应用均能够从共享数据库中获知小程序文件包的存储状况。
第三种方式:宿主应用将下载的小程序文件包均存储于终端设备的共享存储空间,终端设备中各宿主应用均从该共享存储空间读取小程序文件包来进行小程序的启动。
下面将结合具体实施例对上述三种方式分别进行详细描述。另外,需要说明的是,一种理想的情况是,所有宿主应用均采用相同的小程序标准。但往往在实际情况中,一些宿主应用是采用相同的小程序标准的,但另一些宿主应用则采用其他小程序标准。那么可以将采用相同小程序标准的宿主应用称为一个宿主联盟。针对属于同一宿主联盟的各宿主应用采用本发明实施例所提供的共享小程序文件包的方式。关于哪些宿主应用属于同一宿主联盟则可以在服务器端统一配置,然后各宿主应用从服务器端获取。在下面的实施例中均以同一宿主联盟的各宿主应用共享小程序文件包的方式为例进行描述。另外,对于宿主联盟的所有宿主应用而言,所有小程序的文件包均采用统一的命名机制,以便通过小程序的文件包名就能够获知其对应的小程序。
实施例一、
图3为本发明实施例一提供的方法流程图,本实施例中对上述第一种实现方式进行描述。假设用户欲在宿主应用1中启动小程序c,如图3所示,由宿主应用1执行的方法可以包括以下过程:
在301中,宿主应用1启动时,从服务器端同步宿主联盟的信息并存储于宿主应用1本地的数据库。
宿主应用1在启动时,可以向对应服务器端发送宿主联盟的同步请求,对应服务器端向该宿主应用1返回宿主联盟的各宿主应用的信息,例如包名。然后宿主应用1可以确定本终端设备已经安装的宿主联盟的宿主应用信息。
当宿主应用1启动时,可以对所在终端设备本地已安装的应用程序进行扫描,再进一步利用从服务器端同步到的宿主联盟的信息,就能够确定出本终端设备已经安装的宿主联盟的宿主应用信息,可以将这些宿主应用的信息以列表形式存储于本宿主应用的数据库中。
举个例子,假设服务器端下发的宿主联盟的信息包括:宿主应用1、宿主应用2、宿主应用3、宿主应用4……。宿主应用1扫描本终端设备后发现本终端设备安装有宿主应用1和宿主应用2,那么宿主应用1就可以将宿主应用1和宿主应用2的信息存储于宿主应用1本地的数据库中。
在302中,宿主应用1启动后,从服务器端同步本终端设备中同一宿主联盟中各宿主应用存储小程序文件包的状况,并存储于宿主应用1本地的数据库中。
即宿主应用1在启动后,可以从服务器端获得本终端设备中宿主联盟的宿主应用都存储有哪些小程序文件包,例如包含包名、版本号等。
接续上例,假设宿主应用1从服务器端获得本终端设备中宿主应用1存储有小程序a和小程序b,宿主应用2存储有小程序b和小程序c,则将这些信息存储于宿主应用1本地的数据库中。
在303中,获取到宿主应用1中小程序c启动的事件后,判断宿主应用1的私有目录下是否存储有小程序c的文件包,如果是,执行304;否则执行305。
在304中,利用宿主应用1私有目录下存储的小程序c的文件包启动小程序c,结束本启动流程。
在305中,查询宿主应用1本地的数据库,确定同一宿主联盟的其他宿主应用是否存储有小程序c的文件包,如果是,执行306;否则,执行307。
在本步骤中,一方面确定同一宿主联盟的其他宿主应用是否存储有小程序c的文件包,另一方面确定存储的小程序c的文件包是否满足宿主应用1的版本要求,两方面均满足的情况下,执行306,否则执行307。通常宿主应用1如果需求的版本低于或等于其他宿主应用存储的小程序c的版本,则认为满足版本要求。
在306中,宿主应用1从其他宿主应用的私有目录下读取小程序c的文件包,并用以在宿主应用1中启动小程序c,结束本启动流程。
例如经查询若宿主应用2中已经存储有小程序c的文件包,则宿主应用1从宿主应用2的私有目录下读取小程序c的文件包来启动小程序c。
在307中,宿主应用1从对应的服务器端下载小程序c的文件包,存储于宿主应用1的私有目录下,并设置该私有目录的权限为宿主联盟的各宿主应用可读。
作为一种优选的实施方式,为了保证私有目录下内容的安全性,可以仅设置私有目录的权限为宿主联盟的各宿主应用可读不可写。
在308中,宿主应用1利用下载的文件包启动小程序c,并将存储小程序c的文件包的状况上报至服务器端。
在本实施例中,对于服务器端可以执行如图4中所示流程,包括:
在401中,接收对应宿主应用上报的该宿主应用存储小程序的文件包的状况。
宿主应用上报存储小程序的文件包的状况时,可以携带终端设备标识、宿主应用标识、小程序标识、小程序版本号等信息。服务器端接收这些信息后,在服务器端本地数据库进行对应维护。
例如,维护“终端设备标识-宿主应用标识-小程序标识-小程序版本号”这种关系项。
在402中,从其他宿主应用的服务器端同步其他宿主应用存储小程序的文件包的状况。
上述401和402并不一定按照上述顺序执行,步骤402中的同步可以是周 期性地,也可以是基于事件触发。
各宿主应用的服务器端可以针对宿主联盟互相开放用于进行同步的接口,服务器端能够将本地数据库中存储的各宿主应用存储小程序的文件包的状况同步给宿主联盟中的其他服务器端。
在403中,对同一终端设备中各宿主应用存储小程序的文件包的状况进行整合。
服务器端本地数据库存储的状况和从其他服务器端同步来的状况均是诸如“终端设备标识-宿主应用标识-小程序标识-小程序版本号”的形式,呢么可以将同一终端设备标识下的信息进行合并和去重处理,从而得到同一终端设备标识下各宿主应用存储小程序的文件包的状况。
在404中,向对应宿主应用同步该宿主应用所在终端设备中各宿主应用存储小程序的文件包的状况,以供对应宿主应用启动小程序使用。
可以在诸如图3中步骤302的状况下,获取宿主应用的终端设备标识,并向其下发该终端设备标识下各宿主应用存储小程序的文件包的状况。
实施例二、
图5为本发明实施例二提供的方法流程图,本实施例中对上述第二种实现方式进行描述。假设用户欲在宿主应用1中启动小程序c,如图5所示,由宿主应用1执行的方法可以包括以下过程:
在501中,获取宿主应用1中小程序c启动的事件。
在502中,判断宿主应用1的私有目录下是否存储有小程序c的文件包,如果是,执行503;否则执行504。
在503中,利用宿主应用1私有目录下存储的小程序c的文件包启动小程序c,结束本启动流程。
在504中,查询终端设备的共享数据库,确定同一宿主联盟的其他宿主应用是否存储有小程序c的文件包,如果是,执行505;否则,执行506。
在本发明实施例中,可以在终端设备中设置一共享数据库,该共享数据库对宿主联盟中所有宿主应用均开放读写权限。在共享数据库中维护有本终端设备中该宿主联盟下各宿主应用存储小程序的文件包的状况,例如包括包名和版本号。
在本步骤中,同样一方面确定同一宿主联盟的其他宿主应用是否存储有小程序c的文件包,另一方面确定存储的小程序c的文件包是否满足宿主应用1的版本要求,两方面均满足的情况下,执行505,否则执行506。通常宿主应用1如果需求的版本低于或等于其他宿主应用存储的小程序c的版本,则认为满足版本要求。
在505中,宿主应用1从其他宿主应用的私有目录下读取小程序c的文件包,并用以在宿主应用1中启动小程序c,结束本启动流程。
例如经查询若宿主应用2中已经存储有小程序c的文件包,则宿主应用1从宿主应用2的私有目录下读取小程序c的文件包来启动小程序c。
在506中,宿主应用1从对应的服务器端下载小程序c的文件包,存储于宿主应用1的私有目录下,并设置该私有目录的权限为宿主联盟的各宿主应用可读。
作为一种优选的实施方式,为了保证私有目录下内容的安全性,可以仅设置私有目录的权限为宿主联盟的各宿主应用可读不可写。
在507中,宿主应用1利用下载的文件包启动小程序c,并将存储小程序c的文件包的状况记录至共享数据库。
实施例三、
图6为本发明实施例三提供的方法流程图,本实施例中对上述第三种实现方式进行描述。假设用户欲在宿主应用1中启动小程序c,如图6所示,该方法可以包括以下过程:
在601中,宿主应用1获取小程序c启动的事件。
在602中,宿主应用1判断终端设备的共享存储空间是否存储有小程序c的文件包,如果是,执行603;否则执行604。
在本实施例中,在终端设备中设置共享存储空间,该共享存储空间对宿主联盟中各宿主应用开放读写权限。宿主联盟中的宿主应用均将下载的小程序的文件包存储于该共享存储空间以在宿主联盟范围内进行共享。
在本步骤中,同样一方面确定共享存储空间是否存储有小程序c的文件包,另一方面确定存储的小程序c的文件包是否满足宿主应用1的版本要求,两方面均满足的情况下,执行603,否则执行604。通常宿主应用1如果需求的版本 低于或等于已经存储的小程序c的版本,则认为满足版本要求。
在603中,宿主应用1从共享存储空间读取小程序c的文件包,启动小程序c,结束本启动流程。
在604中,宿主应用1从对应的服务器端下载小程序c的文件包,存储于终端设备的共享存储空间。
对于宿主应用1因版本需要下载小程序c的更高版本的文件包,则对于共享存储空间中已经存在的较低版本的文件包可以保留,也可以删除。
上述共享存储空间的形式本发明并不加以限制,例如可以采用SDCard,还可以采用其他形式的共享存储空间。
在605中,宿主应用1利用下载的文件包启动小程序c。
图7示出了适于用来实现本发明实施方式的示例性计算机系统012的框图。图7显示的计算机系统012仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。
如图7所示,计算机系统012以通用计算设备的形式表现。计算机系统012的组件可以包括但不限于:一个或者多个处理器或者处理单元016,系统存储器028,连接不同系统组件(包括系统存储器028和处理单元016)的总线018。
总线018表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。
计算机系统012典型地包括多种计算机系统可读介质。这些介质可以是任何能够被计算机系统012访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。
系统存储器028可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)030和/或高速缓存存储器032。计算机系统012可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统034可以用于读写不可移动的、非易失性磁介质(图7未显示,通常称为“硬盘驱动器”)。尽管图7中未示出,可以提供用于对可移 动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线018相连。存储器028可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本发明各实施例的功能。
具有一组(至少一个)程序模块042的程序/实用工具040,可以存储在例如存储器028中,这样的程序模块042包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块042通常执行本发明所描述的实施例中的功能和/或方法。
计算机系统012也可以与一个或多个外部设备014(例如键盘、指向设备、显示器024等)通信,在本发明中,计算机系统012与外部雷达设备进行通信,还可与一个或者多个使得用户能与该计算机系统012交互的设备通信,和/或与使得该计算机系统012能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口022进行。并且,计算机系统012还可以通过网络适配器020与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器020通过总线018与计算机系统012的其它模块通信。应当明白,尽管图7中未示出,可以结合计算机系统012使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
处理单元016通过运行存储在系统存储器028中的程序,从而执行各种功能应用以及数据处理,例如实现本发明实施例所提供的方法流程。
上述的计算机程序可以设置于计算机存储介质中,即该计算机存储介质被编码有计算机程序,该程序在被一个或多个计算机执行时,使得一个或多个计算机执行本发明上述实施例中所示的方法流程和/或装置操作。例如,被上述一个或多个处理器执行本发明实施例所提供的方法流程。
随着时间、技术的发展,介质含义越来越广泛,计算机程序的传播途径不再受限于有形介质,还可以直接从网络下载等。可以采用一个或多个计算机可 读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、电线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本发明操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明保护的范围之内。

Claims (15)

  1. 一种启动小程序的方法,由终端设备的宿主应用执行,其特征在于,该方法包括:
    获取到触发小程序启动的事件;
    确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包;
    如果是,则利用所述小程序的文件包启动所述小程序;
    否则,从服务器端下载并存储所述小程序的文件包以启动所述小程序,设置所述小程序的文件包的存储位置其他宿主应用也可读。
  2. 根据权利要求1所述的方法,其特征在于,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:确认所述终端设备中与本宿主应用属于同一宿主联盟的各宿主应用,判断确定出的所述各宿主应用是否存储有所述小程序的文件包;
    设置所述小程序的文件包的存储位置其他宿主应用也可读,包括:设置所述小程序的文件包的存储位置对于与本宿主应用属于同一宿主联盟的各宿主应用可读;
    其中,同一宿主联盟中各宿主应用采用相同的小程序标准。
  3. 根据权利要求2所述的方法,其特征在于,该方法还包括:
    从服务器端同步与本宿主应用属于同一宿主联盟的各宿主应用的信息,并确定所述终端设备已经安装的所述宿主联盟的宿主应用信息。
  4. 根据权利要求1所述的方法,其特征在于,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:
    判断所述终端设备中是否存在宿主应用存储有所述小程序的文件包且该小程序的文件包符合本宿主应用的版本要求。
  5. 根据权利要求1所述的方法,其特征在于,在所述从服务器端下载并存储所述小程序的包之后,该方法还包括:
    将本宿主应用存储小程序的文件包的状况上报至服务器端,以便所述终端设备的其他宿主应用从服务器端获取。
  6. 根据权利要求5所述的方法,其特征在于,该方法还包括:
    宿主应用启动后,从服务器端获取所述终端设备中各宿主应用存储小程序的 文件包的状况,并存储于本宿主应用的私有数据库;
    查询所述私有数据库以执行所述确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包的步骤。
  7. 根据权利要求1所述的方法,其特征在于,在所述从服务器端下载并存储所述小程序的包之后,该方法还包括:
    将本宿主应用存储所述小程序的文件包的状况同步至所述终端设备中的共享数据库,以便所述终端设备的其他宿主应用从所述共享数据库获取。
  8. 根据权利要求5或7所述的方法,其特征在于,所述小程序的文件包的存储位置为本宿主应用的私有目录下。
  9. 根据权利要求8所述的方法,其特征在于,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:
    先确认本宿主应用的私有目录下是否存在所述小程序的文件包;
    如果不存在,再判断所述终端设备是否存在其他宿主应用存储有所述小程序的文件包,如果是,则从存储有所述小程序的文件包的其他宿主应用的私有目录下读取所述小程序的文件包。
  10. 根据权利要求1所述的方法,其特征在于,确认所述终端设备中是否存在宿主应用存储有所述小程序的文件包,包括:判断所述终端设备的共享存储空间是否存储有所述小程序的文件包;
    所述从服务器端下载并存储所述小程序的文件包,包括:从服务器端下载所述小程序的文件包并存储于所述终端设备的共享存储空间。
  11. 一种启动小程序的方法,由宿主应用对应的服务器端执行,其特征在于,该方法包括:
    接收对应宿主应用上报的所述宿主应用存储小程序的文件包的状况;以及,从其他宿主应用的服务器端同步其他宿主应用存储小程序的文件包的状况;
    对同一终端设备中各宿主应用存储小程序的文件包的状况进行整合;
    向对应宿主应用同步该宿主应用所在终端设备中各宿主应用存储小程序的文件包的状况,以供对应宿主应用启动小程序使用。
  12. 根据权利要求11所述的方法,其特征在于,该方法还包括:
    向对应宿主应用同步与对应宿主应用属于同一宿主联盟的各宿主应用的信息, 其中,同一宿主联盟中各宿主应用采用相同的小程序标准。
  13. 根据权利要求11所述的方法,其特征在于,所述对同一终端设备中各宿主应用存储小程序的文件包的状况进行整合包括:
    将本服务器端存储的宿主应用存储小程序的文件包的状况与从其他宿主应用的服务器端同步来的各宿主应用存储小程序的文件包的状况进行针对同一终端设备的合并和去重。
  14. 一种设备,其特征在于,所述设备包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-13中任一所述的方法。
  15. 一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行如权利要求1-13中任一所述的方法。
PCT/CN2020/104097 2019-07-25 2020-07-24 一种启动小程序的方法、设备和计算机存储介质 WO2021013242A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910676162.XA CN110389935B (zh) 2019-07-25 2019-07-25 一种启动小程序的方法、设备和计算机存储介质
CN201910676162.X 2019-07-25

Publications (1)

Publication Number Publication Date
WO2021013242A1 true WO2021013242A1 (zh) 2021-01-28

Family

ID=68287376

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/104097 WO2021013242A1 (zh) 2019-07-25 2020-07-24 一种启动小程序的方法、设备和计算机存储介质

Country Status (2)

Country Link
CN (1) CN110389935B (zh)
WO (1) WO2021013242A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11941411B2 (en) 2020-05-08 2024-03-26 Tencent Technology (Shenzhen) Company Limited Application starting method and related device

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389935B (zh) * 2019-07-25 2021-04-16 上海连尚网络科技有限公司 一种启动小程序的方法、设备和计算机存储介质
CN110908738B (zh) * 2019-11-29 2021-03-23 百度在线网络技术(北京)有限公司 用于运行小程序的方法和装置
CN111475142B (zh) * 2020-04-03 2023-04-28 支付宝(杭州)信息技术有限公司 一种小程序文件包的生成方法、装置及设备
US11593082B2 (en) * 2020-04-10 2023-02-28 Apple Inc. Registered applications for electronic devices
CN111767069B (zh) * 2020-06-30 2024-03-15 北京百度网讯科技有限公司 小程序处理方法、服务器、设备及存储介质
CN113220367A (zh) * 2021-05-12 2021-08-06 北京百度网讯科技有限公司 小程序的运行方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040143641A1 (en) * 2003-01-16 2004-07-22 Sun Microsystems, Inc., A Delaware Corporation System for communicating program data between a first device and a second device
CN101729671A (zh) * 2009-12-31 2010-06-09 宇龙计算机通信科技(深圳)有限公司 一种终端、备份文件管理的方法及系统
CN104868939A (zh) * 2015-06-04 2015-08-26 广东欧珀移动通信有限公司 一种基于蓝牙的终端间同步方法及装置
CN109710333A (zh) * 2018-12-28 2019-05-03 上海掌门科技有限公司 寄宿应用的处理方法、设备及计算机可读存储介质
CN110389935A (zh) * 2019-07-25 2019-10-29 上海连尚网络科技有限公司 一种启动小程序的方法、设备和计算机存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595220B (zh) * 2018-04-25 2021-04-16 上海掌门科技有限公司 应用组件的处理方法、设备及计算机可读存储介质
CN109933442B (zh) * 2019-03-04 2022-12-30 上海连尚网络科技有限公司 小程序平台间的通讯方法、设备和计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040143641A1 (en) * 2003-01-16 2004-07-22 Sun Microsystems, Inc., A Delaware Corporation System for communicating program data between a first device and a second device
CN101729671A (zh) * 2009-12-31 2010-06-09 宇龙计算机通信科技(深圳)有限公司 一种终端、备份文件管理的方法及系统
CN104868939A (zh) * 2015-06-04 2015-08-26 广东欧珀移动通信有限公司 一种基于蓝牙的终端间同步方法及装置
CN109710333A (zh) * 2018-12-28 2019-05-03 上海掌门科技有限公司 寄宿应用的处理方法、设备及计算机可读存储介质
CN110389935A (zh) * 2019-07-25 2019-10-29 上海连尚网络科技有限公司 一种启动小程序的方法、设备和计算机存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11941411B2 (en) 2020-05-08 2024-03-26 Tencent Technology (Shenzhen) Company Limited Application starting method and related device

Also Published As

Publication number Publication date
CN110389935B (zh) 2021-04-16
CN110389935A (zh) 2019-10-29

Similar Documents

Publication Publication Date Title
WO2021013242A1 (zh) 一种启动小程序的方法、设备和计算机存储介质
WO2021013243A1 (zh) 一种启动小程序的方法、设备和计算机存储介质
WO2021013247A1 (zh) 一种运行小程序的方法、设备和计算机存储介质
US20220053068A1 (en) Methods, apparatuses and computer storage media for applet state synchronization
KR101138491B1 (ko) 동기화 방법 및 시스템
US8220004B2 (en) Method, apparatus and computer program product for sharing resources via an interprocess communication
KR101212858B1 (ko) 동기화 방법 및 시스템
US20220214932A1 (en) Methods, devices and computer storage media for inter-mini program platform communication
WO2021057317A1 (zh) 一种访问对接器、系统及应用该访问对接器的方法及装置
WO2021088671A1 (zh) 一种端能力的调用方法、设备和计算机存储介质
US20160261693A1 (en) Cloud-based data backup and operation method and system
CN107256188B (zh) 安卓设备的控制方法、装置、终端及存储介质
WO2020143555A1 (zh) 用于展现信息的方法和装置
WO2020020202A1 (zh) 应用程序的账号管理方法、装置、设备和介质
US20220245005A1 (en) Methods, devices and computer storage media for inter-mini program platform discovery
CN114385091A (zh) 网盘盘符的实现方法、装置、网盘及存储介质
WO2023174013A1 (zh) 显存分配方法、装置、介质及电子设备
JP2015517165A (ja) ユーザーインターフェイスウェブサービス
CN114201317B (zh) 数据传输方法、装置、存储介质及电子设备
WO2022062634A1 (zh) 在业务中集成地图服务的方法、装置、设备和存储介质
CN109614089B (zh) 数据访问代码的自动生成方法、装置、设备及存储介质
CN102025751A (zh) 一种远程访问数据的方法、装置和系统
WO2021226965A1 (zh) 资源处理方法、装置、电子设备和存储介质
CN115269483A (zh) 控制方法、控制装置和连接装置
CN118227220A (zh) 应用程序运行方法、装置、存储介质及电子设备

Legal Events

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

Ref document number: 20844722

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

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20844722

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 08.09.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20844722

Country of ref document: EP

Kind code of ref document: A1