CN113849252B - Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device - Google Patents
Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device Download PDFInfo
- Publication number
- CN113849252B CN113849252B CN202110943932.XA CN202110943932A CN113849252B CN 113849252 B CN113849252 B CN 113849252B CN 202110943932 A CN202110943932 A CN 202110943932A CN 113849252 B CN113849252 B CN 113849252B
- Authority
- CN
- China
- Prior art keywords
- page
- target
- display screen
- management unit
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
- Stored Programmes (AREA)
Abstract
Description
技术领域Technical Field
本申请涉及小程序技术领域,特别涉及一种小程序多屏显示方法、一种支持小程序多屏显示的宿主系统及一种客户端设备。The present application relates to the field of mini-program technology, and in particular to a mini-program multi-screen display method, a host system supporting mini-program multi-screen display, and a client device.
背景技术Background technique
在互联网时代,人们的每项需求都需要安装APP。一方面,越来越多的APP应用占据了客户端设备大量的存储空间;另一方面,每次客户端设备的系统升级或者更新时,安装在客户端设备中的APP也都要重新安装,给人们带来了很大的不便。In the Internet age, people need to install APPs for every need. On the one hand, more and more APPs occupy a large amount of storage space on client devices; on the other hand, every time the client device system is upgraded or updated, the APPs installed in the client device must be reinstalled, which brings great inconvenience to people.
小程序,是一种基于特定编程语言开发完成,无需下载和安装,就可以使用的应用。小程序的最大特点是使用便捷。用户无需手动在客户端设备的操作系统中安装小程序。小程序依托于大型APP作为载体进行使用。Mini Program is an application developed based on a specific programming language and can be used without downloading and installing. The biggest feature of Mini Program is its convenience. Users do not need to manually install Mini Program in the operating system of the client device. Mini Program relies on large APP as a carrier for use.
现有技术中,小程序方案多仅支持单屏设备,尚未有技术方案能够使小程序适配多屏设备。In the prior art, most mini program solutions only support single-screen devices, and there is no technical solution that can adapt mini programs to multi-screen devices.
发明内容Summary of the invention
为解决现有技术中小程序方案无法支持多屏设备的技术问题,本申请公开了一种小程序多屏显示方法、一种支持小程序多屏显示的宿主系统以及一种客户端设备。In order to solve the technical problem that the mini program solution in the prior art cannot support multi-screen devices, the present application discloses a mini program multi-screen display method, a host system supporting mini program multi-screen display, and a client device.
所述小程序多屏显示方法包括:监听目标小程序的跳转事件,其中,所述目标小程序寄生在目标宿主应用中,所述目标宿主应用装载在目标客户端设备中,所述目标客户端设备包括多个显示屏,所述宿主应用包括多个页面管理单元,一个页面管理单元被配置为管理所述小程序在一个显示屏上显示的页面;当监听到所述跳转事件后,从所述多个页面管理单元中确定目标页面管理单元;以及基于所述页面管理单元获取目标页面资源数据并通过视图单元将所述目标页面资源数据显示在目标显示屏上,其中,所述目标显示屏同所述目标页面管理单元对应。The mini-program multi-screen display method includes: monitoring the jump event of the target mini-program, wherein the target mini-program is parasitic in the target host application, the target host application is loaded in the target client device, the target client device includes multiple display screens, the host application includes multiple page management units, and a page management unit is configured to manage the page displayed by the mini-program on a display screen; when the jump event is monitored, determining the target page management unit from the multiple page management units; and obtaining target page resource data based on the page management unit and displaying the target page resource data on the target display screen through the view unit, wherein the target display screen corresponds to the target page management unit.
在一些实施例中,其中,所述多个页面管理单元中的每个页面管理单元采用栈结构对与其对应的显示屏的页面进行管理。In some embodiments, each of the plurality of page management units manages a page of a display screen corresponding thereto using a stack structure.
在一些实施例中,其中,每个页面管理单元包括一份路由文件,所述路由文件定义了同所述页面管理单元对应的显示屏上的页面跳转的规则,每份路由文件包括若干个路由接口,所述通过所述页面管理单元获取目标页面资源数据包括:调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据,其中,所述目标路由接口属于所述目标页面管理单元。In some embodiments, each page management unit includes a routing file, which defines the rules for page jumps on the display screen corresponding to the page management unit, and each routing file includes several routing interfaces. Obtaining the target page resource data through the page management unit includes: calling the target routing interface that matches the jump event to obtain the target page resource data, wherein the target routing interface belongs to the target page management unit.
在一些实施例中,其中,所述客户端设备包括第一显示屏和第二显示屏,所述多个页面管理单元包括:第一页面管理单元,被配置为管理所述小程序在第一显示屏上显示的页面,包括第一页面栈,所述第一页面栈内包括预定数目的页面实例,所述第一页面站内的所述页面实例被预设为同所述第一显示屏对应;以及第二页面管理单元,被配置为管理所述小程序在第二显示屏上显示的页面,包括第二页面栈,所述第二页面栈内包括预定数目的页面实例,所述第二页面栈内的所述页面实例被预设为同所述第二显示屏对应。In some embodiments, wherein the client device includes a first display screen and a second display screen, the multiple page management units include: a first page management unit, configured to manage the pages displayed by the mini-program on the first display screen, including a first page stack, the first page stack including a predetermined number of page instances, and the page instances in the first page stack are preset to correspond to the first display screen; and a second page management unit, configured to manage the pages displayed by the mini-program on the second display screen, including a second page stack, the second page stack including a predetermined number of page instances, and the page instances in the second page stack are preset to correspond to the second display screen.
在一些实施例中,其中,当触发页面跳转事件的用户行为的对象为第一显示屏时,所述目标页面管理单元为所述第一页面管理单元,所述目标显示屏为所述第一显示屏;当触发页面跳转事件的用户行为的对象为第二显示屏时,所述目标页面管理单元为所述第二页面管理单元,所述目标显示屏为所述第二显示屏。In some embodiments, when the object of the user behavior that triggers the page jump event is the first display screen, the target page management unit is the first page management unit, and the target display screen is the first display screen; when the object of the user behavior that triggers the page jump event is the second display screen, the target page management unit is the second page management unit, and the target display screen is the second display screen.
在一些实施例中,其中,当触发页面跳转事件的用户行为的对象为第一显示屏和第二显示屏中的一个时,所述目标页面管理单元包括所述第一页面管理单元和所述第二页面管理单元,所述目标显示屏包括所述第一显示屏和所述第二显示屏。In some embodiments, when the object of the user behavior that triggers the page jump event is one of the first display screen and the second display screen, the target page management unit includes the first page management unit and the second page management unit, and the target display screen includes the first display screen and the second display screen.
在一些实施例中,其中,所述调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据包括:从目标存储单元中调取所述目标页面资源数据,其中,所述目标存储单元用于存储有关所述小程序的数据,所述数据包括所述第一页面实例的数据和所述第二页面示例的数据。In some embodiments, calling the target routing interface that matches the jump event to obtain the target page resource data includes: retrieving the target page resource data from a target storage unit, wherein the target storage unit is used to store data about the mini program, and the data includes data of the first page instance and data of the second page instance.
在一些实施例中,其中,所述第一页面管理单元由所述小程序的worker模块执行;以及所述第二页面管理单元由所述宿主应用的native模块执行。In some embodiments, the first page management unit is executed by a worker module of the applet; and the second page management unit is executed by a native module of the host application.
在一些实施例中,其中,所述第一页面管理单元由所述小程序的worker模块执行;以及所述第二页面管理单元由所述小程序的worker模块执行。In some embodiments, the first page management unit is executed by a worker module of the applet; and the second page management unit is executed by a worker module of the applet.
在一些实施例中,其中,所述跳转事件包括所述目标页面的url地址,所述小程序多屏显示方法还包括:解析所述跳转事件包含的url地址、并获取同所述url地址匹配的路由,其中,同所述url地址匹配的路由即为所述目标路由。In some embodiments, wherein the jump event includes the URL address of the target page, the mini-program multi-screen display method further includes: parsing the URL address contained in the jump event and obtaining a route matching the URL address, wherein the route matching the URL address is the target route.
所述支持小程序双屏显示的宿主系统,包括:视图单元,被配置为将寄生在所述宿主系统中的小程序的页面资源数据显示为客户端设备显示屏上的页面、以及基于用户对页面的行为生成触发页面跳转的事件;逻辑单元,被配置为接收所述视图单元的事件反馈,基于所述事件反馈获取所述小程序的页面数据并将所述页面数据发送给所述视图单元以通过所述视图单元将所述页面数据显示在所述显示屏上,其中,所述客户端设备包括多个显示屏,所述逻辑单元可通过所述多个页面管理单元控制所述小程序在所述多个显示屏上显示的页面,一个页面管理单元被配置为管理所述小程序在一个显示屏上显示的页面。The host system supporting dual-screen display of mini-programs includes: a view unit, configured to display the page resource data of the mini-program parasitic in the host system as a page on the display screen of the client device, and to generate an event that triggers a page jump based on the user's behavior on the page; a logic unit, configured to receive event feedback from the view unit, obtain the page data of the mini-program based on the event feedback and send the page data to the view unit to display the page data on the display screen through the view unit, wherein the client device includes multiple display screens, and the logic unit can control the pages displayed by the mini-program on the multiple display screens through the multiple page management units, and one page management unit is configured to manage the pages displayed by the mini-program on one display screen.
在一些实施例中,其中,所述多个页面管理单元中的每个页面管理单元采用栈结构对与其对应的显示屏的页面进行管理。In some embodiments, each of the plurality of page management units manages a page of a display screen corresponding thereto using a stack structure.
在一些实施例中,其中,每个页面管理单元包括一份路由文件,所述路由文件定义了同所述页面管理单元对应的显示屏上的页面跳转的规则,每份路由文件包括若干个路由接口,所述通过所述页面管理单元获取目标页面资源数据包括:调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据,其中,所述目标路由接口属于所述目标页面管理单元。In some embodiments, each page management unit includes a routing file, which defines the rules for page jumps on the display screen corresponding to the page management unit, and each routing file includes several routing interfaces. Obtaining the target page resource data through the page management unit includes: calling the target routing interface that matches the jump event to obtain the target page resource data, wherein the target routing interface belongs to the target page management unit.
在一些实施例中,其中,所述客户端设备包括第一显示屏和第二显示屏,所述多个页面管理单元包括:第一页面管理单元,被配置为管理所述小程序在第一显示屏上显示的页面,包括第一页面栈,所述第一页面栈内包括预定数目的页面实例,所述第一页面站内的所述页面实例被预设为同所述第一显示屏对应;以及第二页面管理单元,被配置为管理所述小程序在第二显示屏上显示的页面,包括第二页面栈,所述第二页面栈内包括预定数目的页面实例,所述第二页面栈内的所述页面实例被预设为同所述第二显示屏对应。In some embodiments, wherein the client device includes a first display screen and a second display screen, the multiple page management units include: a first page management unit, configured to manage the pages displayed by the mini-program on the first display screen, including a first page stack, the first page stack including a predetermined number of page instances, and the page instances in the first page stack are preset to correspond to the first display screen; and a second page management unit, configured to manage the pages displayed by the mini-program on the second display screen, including a second page stack, the second page stack including a predetermined number of page instances, and the page instances in the second page stack are preset to correspond to the second display screen.
在一些实施例中,其中,当触发页面跳转事件的用户行为的对象为第一显示屏时,所述目标页面管理单元为所述第一页面管理单元,所述目标显示屏为所述第一显示屏;当触发页面跳转事件的用户行为的对象为第二显示屏时,所述目标页面管理单元为所述第二页面管理单元,所述目标显示屏为所述第二显示屏。In some embodiments, when the object of the user behavior that triggers the page jump event is the first display screen, the target page management unit is the first page management unit, and the target display screen is the first display screen; when the object of the user behavior that triggers the page jump event is the second display screen, the target page management unit is the second page management unit, and the target display screen is the second display screen.
在一些实施例中,其中,当触发页面跳转事件的用户行为的对象为第一显示屏和第二显示屏中的一个时,所述目标页面管理单元包括所述第一页面管理单元和所述第二页面管理单元,所述目标显示屏包括所述第一显示屏和所述第二显示屏。In some embodiments, when the object of the user behavior that triggers the page jump event is one of the first display screen and the second display screen, the target page management unit includes the first page management unit and the second page management unit, and the target display screen includes the first display screen and the second display screen.
在一些实施例中,其中,所述调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据包括:从目标存储单元中调取所述目标页面资源数据,其中,所述目标存储单元用于存储有关所述小程序的数据,所述数据包括所述第一页面实例的数据和所述第二页面示例的数据。In some embodiments, calling the target routing interface that matches the jump event to obtain the target page resource data includes: retrieving the target page resource data from a target storage unit, wherein the target storage unit is used to store data about the mini program, and the data includes data of the first page instance and data of the second page instance.
在一些实施例中,其中,所述第一页面管理单元由所述小程序的框架管理;以及所述第二页面管理单元由所述宿主系统的native模块管理。In some embodiments, the first page management unit is managed by the framework of the applet; and the second page management unit is managed by the native module of the host system.
在一些实施例中,其中,所述第一页面管理单元由所述小程序的框架管理管理;以及所述第二页面管理单元由所述小程序的框架管理管理。In some embodiments, the first page management unit is managed by the framework management of the applet; and the second page management unit is managed by the framework management of the applet.
所述客户端设备,包括:存储器,存储有至少一个指令集;以及处理器,同所述存储器和所述显示器通信连接,当所述客户端运行时,所述处理器读取并运行所述至少一个指令集并根据所述至少一个指令集的指示执行本申请所述的小程序双屏显示方法从而控制所述客户端设备的不同显示屏所显示的页面。The client device includes: a memory storing at least one instruction set; and a processor communicatively connected to the memory and the display. When the client is running, the processor reads and runs the at least one instruction set and executes the mini-program dual-screen display method described in the present application according to the instructions of the at least one instruction set, thereby controlling the pages displayed on different display screens of the client device.
本申请提供的小程序多屏显示方法、支持小程序多屏显示的宿主系统以及客户端设备,通过在小程序框架内创建多个页面栈的方式,来支持小程序页面多屏显示,开发者只需要开发一个小程序即可,降低了开发者的难度,小程序更新的时候也只需要更新一个小程序即可,更容易同步更新;每个页面栈包括其各自的页面路由接口,因此每个屏都可以支持多页面以及页面间跳转,通过多页面栈的设计可以使小程序支持同一个页面启动到不同屏幕上,不同屏幕对应不同的页面栈,不同的页面栈的路由接口之间无需通信,避免了接口间通信带来的各种问题。The mini-program multi-screen display method, host system supporting mini-program multi-screen display, and client device provided in the present application support multi-screen display of mini-program pages by creating multiple page stacks within the mini-program framework. Developers only need to develop one mini-program, which reduces the difficulty for developers. When updating the mini-program, only one mini-program needs to be updated, which makes it easier to update synchronously. Each page stack includes its own page routing interface, so each screen can support multiple pages and jumps between pages. The design of multiple page stacks can enable the mini-program to support the same page starting on different screens. Different screens correspond to different page stacks. There is no need for communication between the routing interfaces of different page stacks, which avoids various problems caused by communication between interfaces.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本说明书实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
图1示出了根据本申请实施例提供的一种客户端设备的硬件结构示意图;FIG1 is a schematic diagram showing a hardware structure of a client device provided according to an embodiment of the present application;
图2示出了根据本申请实施例提供的一种小程序的架构;FIG2 shows the architecture of a small program provided according to an embodiment of the present application;
图3示出了根据本申请实施例提供的一种仅支持单屏显示的小程序的页面管理结构;FIG3 shows a page management structure of a small program that only supports single-screen display according to an embodiment of the present application;
图4示出了根据本申请实施例提供的一种小程序的页面管理结构;FIG4 shows a page management structure of a mini-program provided according to an embodiment of the present application;
图5示出了根据本申请实施例提供的一种页面管理单元对显示屏的页面进行管理的示意图;FIG5 is a schematic diagram showing a page management unit managing pages of a display screen according to an embodiment of the present application;
图6示出了根据本申请实施例提供的一种页面管理单元对显示屏的页面进行管理的示意图;以及FIG6 is a schematic diagram showing a page management unit managing pages of a display screen according to an embodiment of the present application; and
图7示出了根据本申请的一些实施例所提供的小程序多屏显示方法的流程图。FIG. 7 shows a flowchart of a method for displaying a mini-program on multiple screens according to some embodiments of the present application.
具体实施方式Detailed ways
以下描述提供了本申请的特定应用场景和要求,目的是使本领域技术人员能够制造和使用本申请中的内容。对于本领域技术人员来说,对所公开的实施例的各种局部修改是显而易见的,并且在不脱离本申请的精神和范围的情况下,可以将这里定义的一般原理应用于其他实施例和应用。因此,本申请不限于所示的实施例,而是与权利要求一致的最宽范围。The following description provides specific application scenarios and requirements of the present application, with the purpose of enabling those skilled in the art to make and use the content in the present application. It will be apparent to those skilled in the art that various local modifications to the disclosed embodiments are apparent, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present application. Therefore, the present application is not limited to the embodiments shown, but to the widest scope consistent with the claims.
这里使用的术语仅用于描述特定示例实施例的目的,而不是限制性的。The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting.
考虑到以下描述,本申请的这些特征和其他特征、以及结构的相关元件的操作和功能、以及部件的组合和制造的经济性可以得到明显提高。参考附图,所有这些形成本申请的一部分。然而,应该清楚地理解,附图仅用于说明和描述的目的,并不旨在限制本申请的范围。In view of the following description, these and other features of the present application, as well as the operation and function of the related elements of the structure, and the economy of the combination and manufacture of the parts can be significantly improved. With reference to the accompanying drawings, all of which form a part of this application. However, it should be clearly understood that the drawings are only for the purpose of illustration and description and are not intended to limit the scope of this application.
以下描述可以显著改进本申请的这些和其他特征,以及结构的相关元件的操作和功能,以及组件的组合和制造的经济效率。所有这些都参考附图形成本申请的一部分。然而,应该清楚地理解,附图仅用于说明和描述的目的,并不旨在限制本申请的范围。还应理解,附图未按比例绘制。The following description may significantly improve these and other features of the present application, as well as the operation and function of the relevant elements of the structure, and the combination of components and the economic efficiency of manufacturing. All of these refer to the accompanying drawings to form a part of this application. However, it should be clearly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of the present application. It should also be understood that the drawings are not drawn to scale.
本申请提供一种小程序多屏显示方法、一种支持小程序多屏显示的宿主系统以及一种客户端设备。The present application provides a method for displaying a mini-program on multiple screens, a host system supporting displaying a mini-program on multiple screens, and a client device.
作为示例,图1示出了根据本申请实施例提供的一种客户端设备100的硬件结构示意图。参考图1客户端设备100可以包括存储器230和处理器220。As an example, Fig. 1 shows a schematic diagram of a hardware structure of a client device 100 provided according to an embodiment of the present application. Referring to Fig. 1 , the client device 100 may include a memory 230 and a processor 220 .
存储器230可以包括数据存储装置。所述数据存储装置可以是非暂时性存储介质,也可以是暂时性存储介质。比如所述数据存储装置可以包括磁盘232、只读存储器(ROM)234或随机存取存储器(RAM)236中的一种或多种。存储器230还包括存储在所述数据存储装置中的至少一个指令集。所述指令集是计算机程序代码,所述计算机程序代码可以包括执行本申请中示出的方法的程序、例程、对象、组件、数据结构、过程、模块等等。The memory 230 may include a data storage device. The data storage device may be a non-transitory storage medium or a temporary storage medium. For example, the data storage device may include one or more of a disk 232, a read-only memory (ROM) 234, or a random access memory (RAM) 236. The memory 230 also includes at least one instruction set stored in the data storage device. The instruction set is a computer program code, and the computer program code may include a program, a routine, an object, a component, a data structure, a process, a module, etc. for executing the method shown in the present application.
处理器220同存储器230通过内部通信总线210进行通讯。至少一个处理器220用以执行上述至少一个指令集,当至少一个处理器220执行上述至少一个指令集时,客户端设备100实施本申请示出的小程序多屏显示方法。处理器220可以执行本申请示出的方法包含的部分或者全部步骤。处理器220可以是一个或多个处理器的形式,在一些实施例中,处理器220可以包括一个或多个硬件处理器,例如微控制器,微处理器,精简指令集计算机(RISC),专用集成电路(ASIC),特定于应用的指令集处理器(ASIP),中央处理单元(CPU),图形处理单元(GPU),物理处理单元(PPU),微控制器单元,数字信号处理器(DSP),现场可编程门阵列(FPGA),高级RISC机器(ARM),可编程逻辑器件(PLD),能够执行一个或多个功能的任何电路或处理器等,或其任何组合。仅仅为了说明问题,在本申请中客户端设备100中仅描述了一个处理器220。然而,应当注意,本申请中客户端设备100还可以包括多个处理器,因此,本申请中披露的操作和/或方法步骤可以如本申请所述的由一个处理器执行,也可以由多个处理器联合执行。例如,如果在本申请中客户端设备100的处理器220执行步骤A和步骤B,则应该理解,步骤A和步骤B也可以由两个不同处理器220联合或分开执行(例如,第一处理器执行步骤A,第二处理器执行步骤B,或者第一和第二处理器共同执行步骤A和B)。The processor 220 communicates with the memory 230 via the internal communication bus 210. At least one processor 220 is used to execute the at least one instruction set mentioned above. When at least one processor 220 executes the at least one instruction set mentioned above, the client device 100 implements the mini-program multi-screen display method shown in this application. The processor 220 can execute some or all of the steps included in the method shown in this application. The processor 220 can be in the form of one or more processors. In some embodiments, the processor 220 can include one or more hardware processors, such as a microcontroller, a microprocessor, a reduced instruction set computer (RISC), an application-specific integrated circuit (ASIC), an application-specific instruction set processor (ASIP), a central processing unit (CPU), a graphics processing unit (GPU), a physical processing unit (PPU), a microcontroller unit, a digital signal processor (DSP), a field programmable gate array (FPGA), an advanced RISC machine (ARM), a programmable logic device (PLD), any circuit or processor capable of performing one or more functions, etc., or any combination thereof. For illustration purposes only, only one processor 220 is described in the client device 100 in this application. However, it should be noted that the client device 100 in the present application may also include multiple processors, and therefore, the operations and/or method steps disclosed in the present application may be performed by one processor as described in the present application, or may be performed jointly by multiple processors. For example, if the processor 220 of the client device 100 in the present application performs step A and step B, it should be understood that step A and step B may also be performed jointly or separately by two different processors 220 (for example, the first processor performs step A, the second processor performs step B, or the first and second processors perform steps A and B together).
在一些实施例中,客户端设备100还可以包括通信端口250和内部通信总线210。通信端口250用于客户端设备100同外界的数据通讯。内部通信总线210可以连接不同的系统组件,包括存储器230和处理器220。In some embodiments, the client device 100 may further include a communication port 250 and an internal communication bus 210. The communication port 250 is used for data communication between the client device 100 and the outside world. The internal communication bus 210 may connect different system components, including a memory 230 and a processor 220.
在一些实施例中,客户端设备100还可以包括I/O组件260。I/O组件260支持客户端设备100和其他组件之间的输入/输出。In some embodiments, the client device 100 may also include an I/O component 260. The I/O component 260 supports input/output between the client device 100 and other components.
在一些实施例中,所述I/O组件260可以包括显示器。所述显示器可以接收所述处理器220的指令并将数据显示为所述显示器上的人机交互界面。In some embodiments, the I/O component 260 may include a display. The display may receive instructions from the processor 220 and display data as a human-computer interaction interface on the display.
作为示例,图2示出了根据本申请实施例提供的一种小程序的架构。所述小程序的架构可以以框架文档的形式集成在宿主系统200内。宿主系统200安装在客户端设备100内。As an example, FIG2 shows an architecture of a small program provided according to an embodiment of the present application. The architecture of the small program can be integrated in the host system 200 in the form of a framework document. The host system 200 is installed in the client device 100.
宿主系统200可以是一种应用程序(application,APP)。所述应用程序可以包括计算机程序代码。所述计算机程序代码可以包括,但不限于,程序、例程、对象、组件、数据结构、过程、模块,等等。客户端设备200中装载的操作系统可以为宿主系统100提供其运行所需的环境。The host system 200 may be an application (APP). The application may include computer program code. The computer program code may include, but is not limited to, programs, routines, objects, components, data structures, processes, modules, etc. The operating system loaded in the client device 200 may provide the host system 100 with the environment required for its operation.
作为示例,宿主系统200可以是一种开放平台。所述开放平台通过公开其应用程序编程接口(API)或函数(function)来使外部的程序可以增加该开放平台的功能或使用该开放平台的资源,而不需要更改该开放平台的源代码。通过所述开放平台公开的API或function,外部程序可以接入所述开放平台。所述开放平台可以提供运行外部程序的运行时环境(runtime)。也就是,当外部程序接入所述开放平台后,所述开放平台的runtime可以运行所述外部程序的代码。作为示例,所述开放平台可以包括,但不限于,数字生活开放平台,社交开放平台,购物开放平台,游戏开放平台,内容平台,等等。所述外部的程序指的是所述开放平台外的程序。作为示例,所述外部的程序可以包括,但不限于,所述开放平台外部的,移动应用,网站应用,公众账号,第三方平台,等等。在一些实施例中,所述外部的程序是小程序。As an example, the host system 200 may be an open platform. The open platform enables external programs to increase the functionality of the open platform or use the resources of the open platform by disclosing its application programming interface (API) or function, without changing the source code of the open platform. Through the API or function disclosed by the open platform, external programs can access the open platform. The open platform can provide a runtime environment (runtime) for running external programs. That is, when an external program is connected to the open platform, the runtime of the open platform can run the code of the external program. As an example, the open platform may include, but is not limited to, a digital life open platform, a social open platform, a shopping open platform, a game open platform, a content platform, and the like. The external program refers to a program outside the open platform. As an example, the external program may include, but is not limited to, mobile applications, website applications, public accounts, third-party platforms, and the like outside the open platform. In some embodiments, the external program is a mini-program.
为了便于描述,在本申请下面的描述中,以“小程序”表示通过所述开放的API或function接入所述开放平台中的外部程序。所述小程序可以是基于所述宿主APP开发的。例如,所述宿主APP可以是XX社交软件,所述小程序可以是基于所述XX社交软件的环境开发、并接入在所述XX社交软件中的小程序或者H5。又比如,所述宿主APP可以是XX支付软件,所述小程序可以是基于所述XX支付软件开发、并接入所述XX支付软件中的商户或服务小程序。For ease of description, in the following description of this application, "mini program" refers to an external program that is connected to the open platform through the open API or function. The mini program may be developed based on the host APP. For example, the host APP may be XX social software, and the mini program may be a mini program or H5 developed based on the environment of the XX social software and connected to the XX social software. For another example, the host APP may be XX payment software, and the mini program may be a merchant or service mini program developed based on the XX payment software and connected to the XX payment software.
在一些实施例中,所述宿主系统200可以包括原生应用程序(NativeApplication,简称Native APP)。所述Native APP可以基于本地操作系统运行。在一些实施例中,所述小程序可以包括基于所述Native APP开发的网页应用程序(Web Application,简称Web APP)。所述Web APP可以基于浏览器运行。In some embodiments, the host system 200 may include a native application (Native Application, referred to as Native APP). The Native APP may run based on a local operating system. In some embodiments, the applet may include a web application (Web Application, referred to as Web APP) developed based on the Native APP. The Web APP may run based on a browser.
具体地,图2所示的小程序架构可以包括视图单元001和逻辑单元002。Specifically, the applet architecture shown in FIG. 2 may include a view unit 001 and a logic unit 002 .
视图单元001被配置为将寄生在所述宿主系统200中的小程序的页面资源数据显示为客户端设备100的显示屏上的页面、以及基于用户对页面的行为生成触发页面跳转的事件。The view unit 001 is configured to display the page resource data of the applet parasitic in the host system 200 as a page on the display screen of the client device 100, and to generate an event triggering a page jump based on the user's behavior on the page.
逻辑单元002被配置为接收所述视图单元001的事件反馈,基于所述事件反馈获取所述小程序的页面数据并将所述页面数据发送给所述视图单元001以通过所述视图单元001将所述页面数据显示在所述显示屏上。The logic unit 002 is configured to receive event feedback from the view unit 001 , obtain page data of the applet based on the event feedback and send the page data to the view unit 001 so as to display the page data on the display screen through the view unit 001 .
作为示例,图3示出了根据本申请实施例提供的一种仅支持单屏显示的小程序的页面管理结构。小程序的页面路由由小程序的框架来管理的。框架以栈的形式维护了所有页面。栈作为一种数据结构,是一种只能在一端进行插入和删除操作的特殊线性表。它按照后进先出的原则存储数据,先进入的数据被压入栈底,最后进入的数据在栈顶,需要读数据的时候从栈顶开始弹出数据(最后一个数据被第一个读出来)。小程序的页面交互也是通过栈来完成的。小程序初始化时,新页面入栈;打开新页面时,新页面入栈;页面重定向时,当前页面出栈,新页面入栈;页面返回时,页面不断出栈,直到新页面入栈;tab切换时,页面全部出栈,只留下新的tab页面;重新加载时,页面全部出栈,只留下新的页面。采用图3所示的架构来维护小程序显示的页面,可以支持小程序的多个页面的切换,但是,同时只能有一个页面(位于栈顶的页面)显示在显示屏上。As an example, FIG3 shows a page management structure of a small program that only supports single-screen display according to an embodiment of the present application. The page routing of the small program is managed by the framework of the small program. The framework maintains all pages in the form of a stack. As a data structure, a stack is a special linear table that can only perform insertion and deletion operations at one end. It stores data according to the principle of last-in-first-out. The first data entered is pushed to the bottom of the stack, and the last data entered is at the top of the stack. When data needs to be read, data is popped from the top of the stack (the last data is read out first). The page interaction of the small program is also completed through the stack. When the small program is initialized, a new page is pushed into the stack; when a new page is opened, a new page is pushed into the stack; when the page is redirected, the current page is popped out of the stack and the new page is pushed into the stack; when the page returns, the page is continuously popped out of the stack until the new page is pushed into the stack; when the tab is switched, all pages are popped out of the stack, leaving only the new tab page; when reloading, all pages are popped out of the stack, leaving only the new page. Using the architecture shown in FIG3 to maintain the pages displayed by the small program, it is possible to support the switching of multiple pages of the small program, but only one page (the page at the top of the stack) can be displayed on the display screen at the same time.
根据前面的描述,客户端设备100可以包括显示器。所述显示器可以接收所述处理器220的指令并将数据显示为所述显示器上的人机交互界面。在一些实施例中,所述客户端设备100包括多个显示屏。在一些实施例中,所述多个显示屏可以是通过分屏技术展示在一个显示器上的两个屏幕。在一些实施例中,所述多个显示屏可以是分别显示在不同的显示器上的屏幕。比如图2中所示的,所述客户端设备可以包括第一显示屏110和第二显示屏120。第一显示屏110和第二显示屏120可以属于不同的显示器。According to the foregoing description, the client device 100 may include a display. The display may receive instructions from the processor 220 and display data as a human-computer interaction interface on the display. In some embodiments, the client device 100 includes multiple display screens. In some embodiments, the multiple display screens may be two screens displayed on one display through a split screen technology. In some embodiments, the multiple display screens may be screens displayed on different displays respectively. For example, as shown in FIG. 2 , the client device may include a first display screen 110 and a second display screen 120. The first display screen 110 and the second display screen 120 may belong to different displays.
当客户端设备100具有多个显示屏时,采用图3所示的小程序架构无法实现在该客户端设备100的不同显示屏显示不同的页面内容。When the client device 100 has multiple display screens, it is not possible to display different page contents on different display screens of the client device 100 using the applet architecture shown in FIG. 3 .
作为示例,图4示出了根据本申请实施例提供的一种小程序的页面管理结构。图4中示出了多个页面管理单元400。一个页面管理单元400被配置为管理所述小程序在一个显示屏上显示的页面。所述逻辑单元可通过所述多个页面管理单元控制所述小程序在所述多个显示屏上显示的页面。作为示例,在图4所示的页面管理结构中,所述多个页面管理单元中的每个页面管理单元400采用栈结构对与其对应的显示屏的页面进行管理。As an example, FIG4 shows a page management structure of a mini-program provided according to an embodiment of the present application. FIG4 shows a plurality of page management units 400. A page management unit 400 is configured to manage pages displayed by the mini-program on a display screen. The logic unit may control the pages displayed by the mini-program on the plurality of display screens through the plurality of page management units. As an example, in the page management structure shown in FIG4, each of the plurality of page management units 400 uses a stack structure to manage the pages of the display screen corresponding thereto.
以客户端设备100包括第一显示屏110和第二显示屏120为例,所述多个页面管理单元可以包括第一页面管理单元400-1和第二页面管理单元400-2。Taking the client device 100 including the first display screen 110 and the second display screen 120 as an example, the plurality of page management units may include a first page management unit 400 - 1 and a second page management unit 400 - 2 .
第一页面管理单元400-1可以被配置为管理所述小程序在第一显示屏110上显示的页面。第一页面管理单元400-1可以包括第一页面栈。所述第一页面栈内包括预定数目的页面实例。所述第一页面站内的所述页面实例被预设为同所述第一显示屏110对应。例如,第一显示屏110可以是小程序的主屏幕,所述第一页面栈内的页面实例可以是主屏幕的页面实例,比如,主屏页面a,主屏页面b、主屏页面c,等等。所述第一页面栈用于维护所述主屏幕的页面显示及页面间跳转。The first page management unit 400-1 may be configured to manage the pages displayed by the applet on the first display screen 110. The first page management unit 400-1 may include a first page stack. The first page stack includes a predetermined number of page instances. The page instances in the first page stack are preset to correspond to the first display screen 110. For example, the first display screen 110 may be the home screen of the applet, and the page instances in the first page stack may be page instances of the home screen, such as home screen page a, home screen page b, home screen page c, and so on. The first page stack is used to maintain the page display of the home screen and jump between pages.
第二页面管理单元400-2被配置为管理所述小程序在第二显示屏120上显示的页面。第二页面管理单元400-2可以包括第二页面栈。所述第二页面栈内包括预定数目的页面实例。所述第二页面栈内的所述页面实例被预设为同所述第二显示屏120对应。例如,第二显示屏110可以是小程序的扩展的副屏幕,所述第二页面栈内的页面实例可以是副屏幕的页面实例,比如,副屏页面a,副屏页面b、副屏页面c,等等。所述第二页面栈用于维护所述副屏幕的页面显示及页面间跳转。The second page management unit 400-2 is configured to manage the pages displayed by the applet on the second display screen 120. The second page management unit 400-2 may include a second page stack. The second page stack includes a predetermined number of page instances. The page instances in the second page stack are preset to correspond to the second display screen 120. For example, the second display screen 110 may be an extended sub-screen of the applet, and the page instances in the second page stack may be page instances of the sub-screen, such as sub-screen page a, sub-screen page b, sub-screen page c, and so on. The second page stack is used to maintain the page display of the sub-screen and jump between pages.
在一些实施例中当触发页面跳转事件的用户行为的对象为第一显示屏110和第二显示屏120中的一个时,所述目标页面管理单元包括所述第一页面管理单元400-1和所述第二页面管理单元400-2,所述目标显示屏包括所述第一显示屏110和所述第二显示屏120。作为示例,图5示出了根据本申请实施例提供的一种页面管理单元对显示屏的页面进行管理的示意图。当用户对第一显示屏110进行了操作,比如,用户点击了第一显示屏上的某个图标按钮或在第一显示屏上的添加了某些文字内容,根据用户行为触发的跳转事件,逻辑单元可以通过第一页面管理单元控制第一显示屏上的页面跳转,同时通过第二页面管理单元控制第二显示屏上的页面跳转。也就是,用户对一个显示屏进行操作,第一显示屏显示的页面和第二显示屏显示的页面均会跳转。In some embodiments, when the object of the user behavior that triggers the page jump event is one of the first display screen 110 and the second display screen 120, the target page management unit includes the first page management unit 400-1 and the second page management unit 400-2, and the target display screen includes the first display screen 110 and the second display screen 120. As an example, FIG5 shows a schematic diagram of managing the pages of a display screen by a page management unit provided in an embodiment of the present application. When the user operates the first display screen 110, for example, the user clicks on an icon button on the first display screen or adds some text content on the first display screen, according to the jump event triggered by the user behavior, the logic unit can control the page jump on the first display screen through the first page management unit, and control the page jump on the second display screen through the second page management unit. That is, when the user operates a display screen, the page displayed on the first display screen and the page displayed on the second display screen will both jump.
在一些实施例中当触发页面跳转事件的用户行为的对象为第一显示屏110时,所述目标页面管理单元为所述第一页面管理单元400-1,所述目标显示屏为所述第一显示屏110;当触发页面跳转事件的用户行为的对象为第二显示屏120时,所述目标页面管理单元为所述第二页面管理单元400-2,所述目标显示屏为所述第二显示屏120。作为示例,图6示出了根据本申请实施例提供的一种页面管理单元对显示屏的页面进行管理的示意图。当用户仅对第一显示屏110进行了操作,比如,用户点击了第一显示屏上的某个图标按钮或在第一显示屏上的添加了某些文字内容,根据用户行为触发的跳转事件,逻辑单元可以通过第一页面管理单元控制第一显示屏上的页面跳转,第二页面管理单元控制第二显示屏上的页面不跳转。也就是,第一页面管理单元只能根据来自第一显示屏的触发事件维护第一显示屏上的页面。第一页面管理单元不响应有关第二显示屏的事件。对应地,第二页面管理单元也只对来自第二显示屏的事件有响应。这样,一个页面管理单元同一个显示屏的事件和页面建立了一一对应关系,程序运行期间不容易出错。In some embodiments, when the object of the user behavior that triggers the page jump event is the first display screen 110, the target page management unit is the first page management unit 400-1, and the target display screen is the first display screen 110; when the object of the user behavior that triggers the page jump event is the second display screen 120, the target page management unit is the second page management unit 400-2, and the target display screen is the second display screen 120. As an example, FIG. 6 shows a schematic diagram of a page management unit provided according to an embodiment of the present application managing the page of the display screen. When the user only operates the first display screen 110, for example, the user clicks on an icon button on the first display screen or adds some text content on the first display screen, according to the jump event triggered by the user behavior, the logic unit can control the page jump on the first display screen through the first page management unit, and the second page management unit controls the page on the second display screen not to jump. That is, the first page management unit can only maintain the page on the first display screen according to the trigger event from the first display screen. The first page management unit does not respond to events related to the second display screen. Correspondingly, the second page management unit also only responds to events from the second display screen. In this way, a page management unit establishes a one-to-one correspondence between the events and pages of a display screen, and errors are less likely to occur during program execution.
根据前文的介绍,每个页面管理单元采用栈结构对与其对应的显示屏的页面进行管理和维护。在一些实施例中,每个页面管理单元包括一份路由文件,所述路由文件定义了同所述页面管理单元对应的显示屏上的页面跳转的规则,每份路由文件包括若干个路由接口,所述通过所述页面管理单元获取目标页面资源数据包括:调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据,其中,所述目标路由接口属于所述目标页面管理单元。作为示例,所述路由接口可以包括,但不限于,switchTab接口,reLauncn接口,redirectTo接口,navigateTo接口,navigateBack接口,等等。所述switchTab接口可以是跳转到指定标签页页面,并关闭其他所有非标签页页面的API(Application ProgrammingInterface,应用程序接口)。所述reLauncn接口可以是关闭当前所有页面,跳转到小程序内的某个指定页面的API。所述redirectTo接口可以是关闭当前页面,跳转到小程序内的某个指定页面的API。所述navigateTo接口可以是从当前页面,跳转到小程序内的某个指定页面的API。通过所述navigateTo接口可以实现在显示屏上打开新页面。所述navigateBack接口可以是关闭当前页面,返回上一级或多级页面的API。可调用navigateBack接口之前,可先获取当前的页面栈信息,决定需要返回几层。在一些实施例中,还可以通过Pagelist接口来获取当前页面列表。使用navigateTo接口每新打开一个页面,页面栈大小可以加1,直到页面栈大小为页面栈最大允许的层数(比如5层)为止。对应的,使用navigateBack接口每返回一层页面,页面栈大小可以减1,直至页面栈大小为1。According to the above introduction, each page management unit uses a stack structure to manage and maintain the page of the display screen corresponding to it. In some embodiments, each page management unit includes a routing file, and the routing file defines the rules for page jumps on the display screen corresponding to the page management unit. Each routing file includes several routing interfaces, and the acquisition of target page resource data through the page management unit includes: calling the target routing interface matching the jump event to obtain the target page resource data, wherein the target routing interface belongs to the target page management unit. As an example, the routing interface may include, but is not limited to, a switchTab interface, a reLauncn interface, a redirectTo interface, a navigateTo interface, a navigateBack interface, and the like. The switchTab interface may be an API (Application ProgrammingInterface) that jumps to a specified tab page and closes all other non-tab pages. The reLauncn interface may be an API that closes all current pages and jumps to a specified page in a mini-program. The redirectTo interface may be an API that closes the current page and jumps to a specified page in a mini-program. The navigateTo interface may be an API that jumps from the current page to a specified page in a mini-program. The navigateTo interface can be used to open a new page on the display screen. The navigateBack interface can be an API for closing the current page and returning to the previous page or multiple pages. Before calling the navigateBack interface, the current page stack information can be obtained first to determine how many layers need to be returned. In some embodiments, the current page list can also be obtained through the Pagelist interface. For each new page opened using the navigateTo interface, the page stack size can be increased by 1 until the page stack size reaches the maximum allowed number of layers of the page stack (for example, 5 layers). Correspondingly, for each layer of the page returned using the navigateBack interface, the page stack size can be reduced by 1 until the page stack size is 1.
继续参考图2所示的小程序框架。在一些实施例中,所述框架还包括用于存储数据的存储单元003。在一些实施例中,所述调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据包括:从目标存储单元中调取所述目标页面资源数据,其中,所述目标存储单元用于存储有关所述小程序的数据,所述数据包括所述第一页面实例的数据和所述第二页面示例的数据。存储单元003可以是所述小程序的存储空间。所述存储空间内可以包括第一数据块、第二数据块和第三数据块。所述第一数据块被配置为存储仅同第一显示屏页面相关的数据。所述第二数据块被配置为存储仅同第二显示屏页面相关的数据。所述第三数据块可以是共享数据块,即所述第三数据块中可以存储所述第一显示屏和所述第二显示屏共享的数据。比如有一个订单列表,在主屏页面中的订单列表中加一个数据,那么副屏页面可以直接知道这个数据变了,即主屏页面和副屏页面可以共同去改同一个数据。这样,一方面提高了存储空间的利用率,另一方面,不需要数据在主屏和副屏之间传输就实现了主屏和副屏数据的互通,节省了内存,提高了性能。Continue to refer to the applet framework shown in Figure 2. In some embodiments, the framework also includes a storage unit 003 for storing data. In some embodiments, the calling of the target routing interface matching the jump event to obtain the target page resource data includes: retrieving the target page resource data from the target storage unit, wherein the target storage unit is used to store data about the applet, and the data includes data of the first page instance and data of the second page instance. Storage unit 003 can be a storage space for the applet. The storage space can include a first data block, a second data block, and a third data block. The first data block is configured to store data related only to the first display screen page. The second data block is configured to store data related only to the second display screen page. The third data block can be a shared data block, that is, the third data block can store data shared by the first display screen and the second display screen. For example, there is an order list, and a data is added to the order list in the main screen page, then the secondary screen page can directly know that the data has changed, that is, the main screen page and the secondary screen page can jointly change the same data. In this way, on the one hand, the utilization rate of the storage space is improved, and on the other hand, the data between the main screen and the sub-screen can be communicated without the need to transmit data between the main screen and the sub-screen, thus saving memory and improving performance.
在一些实施例中,所述第一页面管理单元由所述小程序的worker模块管理;所述第二页面管理单元由所述宿主应用的native模块管理。比如,第一页面管理单元可以是主屏的页面栈,第二页面管理单元可以是副屏的页面栈,所述主屏页面栈可以由小程序前端框架(例如,前端worker层)管理,所述副屏页面栈可以由native容器管理。In some embodiments, the first page management unit is managed by the worker module of the mini program, and the second page management unit is managed by the native module of the host application. For example, the first page management unit may be the page stack of the main screen, and the second page management unit may be the page stack of the secondary screen. The main screen page stack may be managed by the mini program front-end framework (e.g., the front-end worker layer), and the secondary screen page stack may be managed by the native container.
在一些实施例中,所述第一页面管理单元由所述小程序的worker模块管理;所述第二页面管理单元由所述小程序的worker模块执行。比如,第一页面管理单元可以是主屏的页面栈,第二页面管理单元可以是副屏的页面栈,所述主屏页面栈和所述副屏页面栈可以均由小程序前端框架管理。In some embodiments, the first page management unit is managed by the worker module of the mini program; the second page management unit is executed by the worker module of the mini program. For example, the first page management unit may be a page stack of the main screen, and the second page management unit may be a page stack of the secondary screen, and both the main screen page stack and the secondary screen page stack may be managed by the mini program front-end framework.
一个小程序可以对应一个worker模块。所述worker模块可以是所述小程序的虚拟空间或者运行空间。作为示例,所述worker模块可以是所述小程序的一个虚拟进程,该虚拟进程可以是专门服务于该小程序的进程,以保护该小程序数据的一致性和完整性,而使这些数据不被其他的地方感知。所述native模块可以是原生模块。A mini program may correspond to a worker module. The worker module may be the virtual space or running space of the mini program. As an example, the worker module may be a virtual process of the mini program, which may be a process dedicated to serving the mini program to protect the consistency and integrity of the mini program data so that the data is not perceived by other places. The native module may be a native module.
作为示例,图7示出了根据本申请的一些实施例所提供的小程序多屏显示方法S100的流程图。流程S100中的部分步骤和/或所有步骤可以作为至少一个指令集存储在客户端设备100中的非临时性存储介质(比如存储器230)中,用于控制所述客户端设备的不同显示屏所显示的页面。至少一个处理器220同所述至少一个非临时性存储介质通信连接,其中当所述客户端设备100运行时,所述至少一个处理器220读取所述至少一个指令集,并且根据所述至少一个指令集的指示执行流程S100中的步骤。As an example, FIG7 shows a flowchart of a mini-program multi-screen display method S100 provided according to some embodiments of the present application. Some steps and/or all steps in process S100 can be stored as at least one instruction set in a non-temporary storage medium (such as memory 230) in the client device 100, which is used to control the pages displayed on different display screens of the client device. At least one processor 220 is communicatively connected to the at least one non-temporary storage medium, wherein when the client device 100 is running, the at least one processor 220 reads the at least one instruction set and executes the steps in process S100 according to the instructions of the at least one instruction set.
以下呈现的所示流程S100的操作,旨在是说明性的而非限制性的。在一些实施例中,流程S100在实现时可以添加一个或多个未描述的额外操作,和/或删减一个或多个此处所描述的操作。此外,图7中所示的和下文描述的操作的顺序并不对此加以限制。The operations of the illustrated process S100 presented below are intended to be illustrative and not restrictive. In some embodiments, process S100 may add one or more additional operations not described, and/or delete one or more operations described herein when implemented. In addition, the order of the operations illustrated in FIG. 7 and described below is not intended to be limiting.
S110,监听目标小程序的跳转事件。S110, monitoring the jump event of the target applet.
S120,当监听到所述跳转事件后,从所述多个页面管理单元中确定目标页面管理单元。S120: After the jump event is monitored, a target page management unit is determined from the multiple page management units.
所述目标小程序寄生在目标宿主应用中,所述目标宿主应用装载在目标客户端设备中,所述目标客户端设备包括多个显示屏,所述宿主应用包括多个页面管理单元,一个页面管理单元被配置为管理所述小程序在一个显示屏上显示的页面。The target applet is parasitic in a target host application, the target host application is loaded in a target client device, the target client device includes multiple display screens, the host application includes multiple page management units, and a page management unit is configured to manage a page displayed by the applet on a display screen.
所述跳转事件可以由用户对显示屏的交互行为触发。比如,所述交互行为可以是用点击某个显示屏上的某个图标按钮。又比如,所述交互行为可以是用户在某个显示屏上的特定文本框内增加了内容。The jump event may be triggered by a user's interaction with a display screen. For example, the interaction may be clicking an icon button on a display screen. For another example, the interaction may be that the user adds content to a specific text box on a display screen.
S130,解析所述跳转事件包含的url地址、并获取同所述url地址匹配的路由。S130, parsing the URL address contained in the jump event, and acquiring a route matching the URL address.
在一些实施例中,所述跳转事件包括所述目标页面的url地址。在监听到所述跳转事件后,处理器可以解析所述跳转事件包含的url地址、并获取同所述url地址匹配的路由。In some embodiments, the jump event includes the URL address of the target page. After monitoring the jump event, the processor can parse the URL address included in the jump event and obtain a route matching the URL address.
S140,调用同所述跳转事件匹配的目标路由接口从而获取所述目标页面资源数据。S140: Call a target routing interface that matches the jump event to obtain the target page resource data.
S150,通过视图单元将所述目标页面资源数据显示在目标显示屏上。S150: Display the target page resource data on a target display screen via a view unit.
其中,所述目标路由接口为同所述url地址匹配的路由接口。所述目标路由接口属于所述目标页面管理单元。The target routing interface is a routing interface that matches the URL address and belongs to the target page management unit.
在基于所述页面管理单元获取了目标页面资源数据,之后,处理器可以通过视图单元将所述目标页面资源数据显示在目标显示屏上,其中,所述目标显示屏同所述目标页面管理单元对应。After acquiring the target page resource data based on the page management unit, the processor may display the target page resource data on a target display screen through a view unit, wherein the target display screen corresponds to the target page management unit.
综上,本申请提供的小程序多屏显示方法、支持小程序多屏显示的宿主系统以及客户端设备:通过在小程序框架内创建多个页面栈的方式,来支持小程序页面多屏显示,开发者只需要开发一个小程序即可,降低了开发者的难度,小程序更新的时候也只需要更新一个小程序即可,更容易同步更新;每个页面栈包括其各自的页面路由接口,因此每个屏都可以支持多页面以及页面间跳转,通过多页面栈的设计可以使小程序支持同一个页面启动到不同屏幕上,不同屏幕对应不同的页面栈,不同的页面栈的路由接口之间无需通信,避免了接口间通信带来的各种问题。In summary, the mini-program multi-screen display method, host system supporting mini-program multi-screen display, and client device provided by the present application: by creating multiple page stacks within the mini-program framework to support multi-screen display of mini-program pages, developers only need to develop one mini-program, which reduces the difficulty for developers. When updating the mini-program, only one mini-program needs to be updated, which makes it easier to update synchronously; each page stack includes its own page routing interface, so each screen can support multiple pages and jumps between pages. The design of multiple page stacks can enable the mini-program to support the same page starting on different screens. Different screens correspond to different page stacks. There is no need to communicate between the routing interfaces of different page stacks, thus avoiding various problems caused by communication between interfaces.
本说明书另一方面提供一种计算机可读存储介质。所述存储介质中存储有至少一组计算机指令。当所述指令被处理器执行时,所述指令指导所述处理器实施本说明书所述的小程序多屏显示方法的步骤。在一些可能的实施方式中,本说明书的各个方面还可以实现为一种程序产品的形式,其包括程序代码。当所述程序产品在信号处理设备上运行时,所述程序代码用于使信号处理设备执行本说明书描述的小程序多屏显示方法的步骤。用于实现上述方法的程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)包括程序代码,并可以在信号处理设备上运行。然而,本说明书的程序产品不限于此,在本说明书中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统(例如处理器202)使用或者与其结合使用。所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。所述计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读存储介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。可以以一种或多种程序设计语言的任意组合来编写用于执行本说明书操作的程序代码,所述程序设计语言包括面向对象的程序设计语言一诸如Java、C++等,还包括常规的过程式程序设计语言一诸如“C”语言或类似的程序设计语言。程序代码可以完全地在信号处理设备上执行、部分地在数据处理装置200上执行、作为一个独立的软件包执行、部分在信号处理设备上部分在远程计算设备上执行、或者完全在远程计算设备上执行。On the other hand, this specification provides a computer-readable storage medium. At least one set of computer instructions is stored in the storage medium. When the instructions are executed by the processor, the instructions guide the processor to implement the steps of the small program multi-screen display method described in this specification. In some possible implementations, various aspects of this specification can also be implemented in the form of a program product, which includes a program code. When the program product is run on a signal processing device, the program code is used to enable the signal processing device to execute the steps of the small program multi-screen display method described in this specification. The program product for implementing the above method can use a portable compact disk read-only memory (CD-ROM) to include program code and can be run on a signal processing device. However, the program product of this specification is not limited to this. In this specification, the readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system (such as processor 202) or used in combination with it. The program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein the readable program code is carried. 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 above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above. Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the signal processing device, partially on the data processing apparatus 200, as a separate software package, partially on the signal processing device and partially on a remote computing device, or entirely on a remote computing device.
综上所述,在阅读本详细公开内容之后,本领域技术人员可以明白,前述详细公开内容可以仅以示例的方式呈现,并且可以不是限制性的。尽管这里没有明确说明,本领域技术人员可以理解本申请意图囊括对实施例的各种合理改变,改进和修改。这些改变,改进和修改旨在由本申请提出,并且在本申请的示例性实施例的精神和范围内。In summary, after reading this detailed disclosure, it will be apparent to those skilled in the art that the aforementioned detailed disclosure may be presented only by way of example and may not be restrictive. Although not explicitly stated herein, it will be appreciated by those skilled in the art that this application is intended to encompass various reasonable changes, improvements and modifications to the embodiments. These changes, improvements and modifications are intended to be proposed by this application and are within the spirit and scope of the exemplary embodiments of this application.
此外,本申请中的某些术语已被用于描述本申请的实施例。例如,“一个实施例”,“实施例”和/或“一些实施例”意味着结合该实施例描述的特定特征,结构或特性可以包括在本申请的至少一个实施例中。因此,可以强调并且应当理解,在本说明书的各个部分中对“实施例”或“一个实施例”或“替代实施例”的两个或更多个引用不一定都指代相同的实施例。此外,特定特征,结构或特性可以在本申请的一个或多个实施例中适当地组合。In addition, certain terms in this application have been used to describe embodiments of the present application. For example, "one embodiment", "embodiment" and/or "some embodiments" mean that a particular feature, structure or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present application. Therefore, it can be emphasized and should be understood that two or more references to "embodiment" or "one embodiment" or "alternative embodiment" in various parts of this specification do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics can be appropriately combined in one or more embodiments of the present application.
应当理解,在本申请的实施例的前述描述中,为了帮助理解一个特征,出于简化本申请的目的,本申请有时将各种特征组合在单个实施例、附图或其描述中。或者,本申请又是将各种特征分散在多个本申请的实施例中。然而,这并不是说这些特征的组合是必须的,本领域技术人员在阅读本申请的时候完全有可能将其中一部分特征提取出来作为单独的实施例来理解。也就是说,本申请中的实施例也可以理解为多个次级实施例的整合。而每个次级实施例的内容在于少于单个前述公开实施例的所有特征的时候也是成立的。It should be understood that in the foregoing description of the embodiments of the present application, in order to help understand a feature and for the purpose of simplifying the present application, the present application sometimes combines various features in a single embodiment, drawings or description thereof. Alternatively, the present application disperses various features in multiple embodiments of the present application. However, this does not mean that the combination of these features is necessary. It is entirely possible for those skilled in the art to extract some of the features and understand them as separate embodiments when reading the present application. In other words, the embodiments in the present application can also be understood as the integration of multiple secondary embodiments. This is also true when the content of each secondary embodiment is less than all the features of a single aforementioned disclosed embodiment.
在一些实施方案中,表达用于描述和要求保护本申请的某些实施方案的数量或性质的数字应理解为在某些情况下通过术语“约”,“近似”或“基本上”修饰。例如,除非另有说明,否则“约”,“近似”或“基本上”可表示其描述的值的±20%变化。因此,在一些实施方案中,书面描述和所附权利要求书中列出的数值参数是近似值,其可以根据特定实施方案试图获得的所需性质而变化。在一些实施方案中,数值参数应根据报告的有效数字的数量并通过应用普通的舍入技术来解释。尽管阐述本申请的一些实施方案列出了广泛范围的数值范围和参数是近似值,但具体实施例中都列出了尽可能精确的数值。In some embodiments, the numbers expressing the quantity or properties used to describe and claim certain embodiments of the present application should be understood to be modified in some cases by the terms "about", "approximately" or "substantially". For example, unless otherwise stated, "about", "approximately" or "substantially" may represent a ±20% variation of the value described. Therefore, in some embodiments, the numerical parameters listed in the written description and the attached claims are approximate values, which may vary depending on the desired properties that a particular embodiment attempts to obtain. In some embodiments, the numerical parameters should be interpreted according to the number of reported significant figures and by applying ordinary rounding techniques. Although some embodiments of the present application are described, the numerical ranges and parameters listed in a wide range are approximate, but the numerical values that are as accurate as possible are listed in the specific examples.
本文引用的每个专利,专利申请,专利申请的出版物和其他材料,例如文章,书籍,说明书,出版物,文件,物品等,可以通过引用结合于此。用于所有目的的全部内容,除了与其相关的任何起诉文件历史,可能与本文件不一致或相冲突的任何相同的,或者任何可能对权利要求的最宽范围具有限制性影响的任何相同的起诉文件历史。现在或以后与本文件相关联。举例来说,如果在与任何所包含的材料相关联的术语的描述、定义和/或使用与本文档相关的术语、描述、定义和/或之间存在任何不一致或冲突时,使用本文件中的术语为准。Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, articles, etc., cited herein may be incorporated herein by reference in its entirety for all purposes, except for any prosecution document history related thereto, any equivalent that may be inconsistent or conflicting with this document, or any equivalent prosecution document history that may have a limiting effect on the broadest scope of the claims now or later associated with this document. For example, if there is any inconsistency or conflict between the description, definition, and/or use of a term associated with any of the incorporated materials and the term, description, definition, and/or use associated with this document, the term in this document shall control.
最后,应理解,本文公开的申请的实施方案是对本申请的实施方案的原理的说明。其他修改后的实施例也在本申请的范围内。因此,本申请披露的实施例仅仅作为示例而非限制。本领域技术人员可以根据本申请中的实施例采取替代配置来实现本申请中的申请。因此,本申请的实施例不限于申请中被精确地描述过的那些实施例。Finally, it should be understood that the embodiments of the application disclosed herein are explanations of the principles of the embodiments of the present application. Other modified embodiments are also within the scope of the present application. Therefore, the embodiments disclosed in the present application are merely examples and not limitations. Those skilled in the art can adopt alternative configurations according to the embodiments in the present application to realize the application in the present application. Therefore, the embodiments of the present application are not limited to those embodiments that have been accurately described in the application.
Claims (20)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110943932.XA CN113849252B (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
CN202410750193.6A CN118689575A (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110943932.XA CN113849252B (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410750193.6A Division CN118689575A (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113849252A CN113849252A (en) | 2021-12-28 |
CN113849252B true CN113849252B (en) | 2024-05-10 |
Family
ID=78975831
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110943932.XA Active CN113849252B (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
CN202410750193.6A Pending CN118689575A (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
Family Applications After (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410750193.6A Pending CN118689575A (en) | 2021-08-17 | 2021-08-17 | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN113849252B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2325153A1 (en) * | 2000-11-06 | 2002-05-06 | Wintokens.Com Inc. | A system and method for collecting consumer information |
CN106293473A (en) * | 2016-08-15 | 2017-01-04 | 珠海市魅族科技有限公司 | Page display method and device |
CN110083413A (en) * | 2019-03-13 | 2019-08-02 | 维沃移动通信有限公司 | A kind of small routine call method and terminal device |
CN111026462A (en) * | 2019-12-10 | 2020-04-17 | 百度在线网络技术(北京)有限公司 | Applet control method, apparatus, device and medium |
CN111694475A (en) * | 2020-04-27 | 2020-09-22 | 华为技术有限公司 | Terminal control method and device and terminal equipment |
-
2021
- 2021-08-17 CN CN202110943932.XA patent/CN113849252B/en active Active
- 2021-08-17 CN CN202410750193.6A patent/CN118689575A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2325153A1 (en) * | 2000-11-06 | 2002-05-06 | Wintokens.Com Inc. | A system and method for collecting consumer information |
CN106293473A (en) * | 2016-08-15 | 2017-01-04 | 珠海市魅族科技有限公司 | Page display method and device |
CN110083413A (en) * | 2019-03-13 | 2019-08-02 | 维沃移动通信有限公司 | A kind of small routine call method and terminal device |
CN111026462A (en) * | 2019-12-10 | 2020-04-17 | 百度在线网络技术(北京)有限公司 | Applet control method, apparatus, device and medium |
CN111694475A (en) * | 2020-04-27 | 2020-09-22 | 华为技术有限公司 | Terminal control method and device and terminal equipment |
Also Published As
Publication number | Publication date |
---|---|
CN118689575A (en) | 2024-09-24 |
CN113849252A (en) | 2021-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3053028B1 (en) | Rendering interpreter for visualizing data provided from restricted environment container | |
US10754633B2 (en) | Application installation package generation method and apparatus, and storage medium | |
US9928038B2 (en) | Dynamically building locale objects or subsections of locale objects based on historical data | |
CN107748740B (en) | Code-free sharing of spreadsheet objects | |
CN108958844A (en) | A kind of control method and terminal of application program | |
CN107885540A (en) | A kind of method, apparatus and terminal of loading application programs static resource | |
RU2679380C1 (en) | Method of providing possibility of sharing desktop and mobile terminal | |
CN106856485B (en) | Data service publishing method and device | |
US9875109B2 (en) | Method and apparatus for generating user adaptive application in mobile terminal | |
CN109933381B (en) | Kernel loading method and device | |
CN106528210A (en) | Application program running method and device | |
CN103443763A (en) | ISA bridging including support for call to overidding virtual functions | |
US11895553B2 (en) | Web application with components in different virtual environments | |
CN108829311A (en) | A kind of method and apparatus based on Widget display data | |
CN108055320A (en) | Processing method, terminal device and the computer readable storage medium of resource downloading | |
CN112579048A (en) | Applet integration method, device, electronic equipment and storage medium | |
CN113343138A (en) | Rollback interception method and device, intelligent terminal and storage medium | |
CN112235132A (en) | Method, device, medium and server for dynamically configuring service | |
CN111930455A (en) | Page updating method, device, terminal and storage medium | |
CN108563476B (en) | Application running method, device, storage medium and electronic device | |
US20140089909A1 (en) | Dynamically building locale objects at run-time | |
CN113849252B (en) | Mini program multi-screen display method, host system supporting mini program multi-screen display, and client device | |
CN115495687A (en) | Page caching method, device, equipment and storage medium | |
CN108491230A (en) | Cartoon display method and device, client | |
CN114237755A (en) | Application operating method, apparatus, electronic device, and storage medium |
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 |