WO2019085385A1 - 基于Android的页面启动方法、存储介质、电子设备及系统 - Google Patents

基于Android的页面启动方法、存储介质、电子设备及系统 Download PDF

Info

Publication number
WO2019085385A1
WO2019085385A1 PCT/CN2018/081289 CN2018081289W WO2019085385A1 WO 2019085385 A1 WO2019085385 A1 WO 2019085385A1 CN 2018081289 W CN2018081289 W CN 2018081289W WO 2019085385 A1 WO2019085385 A1 WO 2019085385A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
startup
information
android
application module
Prior art date
Application number
PCT/CN2018/081289
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 WO2019085385A1 publication Critical patent/WO2019085385A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class 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/546Message passing systems or structures, e.g. queues

Definitions

  • the invention relates to the field of componentization of an Android client, and particularly relates to an Android-based page startup method, a storage medium, an electronic device and a system.
  • the component needs to start the page inside the application module. Because the relationship between the application module and the component is: the application module depends on the component (that is, the application module can directly reference the component), and the component does not depend on the application module. (ie, the component can't directly reference the application module), so before starting the page in the application module through the component, you need to start the page directly from the previous application module (because it is inside the application module, so you can start it directly), change In order to start through the component, the way to pass parameters to the page is changed from the application module to the component.
  • the technical problem solved by the present invention is to start a page in an application module by using a component of the Android client without changing the page business logic.
  • the invention can realize the purpose of the component startup page by means of the application module starting the page, thereby ensuring the stability of the page and the subsequent user experience.
  • the Android-based page startup method provided by the present invention includes the following steps:
  • the application module parses the page startup data, obtains the page startup information, and starts the page corresponding to the page startup information by using the start function.
  • the page startup information in S2 includes page information and startup parameter information.
  • the process of starting the page corresponding to the page startup information by using the start function in S3 includes: after determining the page corresponding to the page information by using the start function, starting the determined page according to the startup parameter information.
  • the format of the page startup data in S2 is a JSON format.
  • the invention provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Android-based page startup method is implemented.
  • the electronic device comprises a memory and a processor.
  • the memory stores a computer program running on the processor, and the processor implements the above-mentioned Android-based page startup method when the computer program executes the computer program.
  • the Android-based page startup system comprises a message event bus setting module set on the Android client, a page startup information transmission module disposed on the component, and a message receiving module disposed on the application module;
  • the message event bus setting module is configured to: set a message event bus between the component and the application module;
  • the page startup information transmission module is configured to: when the page inside the application module needs to be started, obtain the page startup information, and after the page startup information is encapsulated into the page startup data, the page startup data is transmitted to the message receiving module through the message event bus;
  • the message receiving module is configured to: after parsing the page startup data to obtain the page startup information, start a page corresponding to the page startup information by using a start function.
  • the page startup information in the page startup information transmission module includes page information and startup parameter information.
  • the process of the message receiving module starting the page corresponding to the page startup information by using the start function includes: after determining the page corresponding to the page information by using the start function, starting the determined page according to the startup parameter information.
  • the format of the page startup data in the page startup information transmission module is a JSON format.
  • the application module parses the page startup message sent by the component, and starts the page according to the page startup message.
  • the present invention can implement the purpose of the component launch page by means of the application module launching the page, thereby ensuring the stability of the page and the subsequent user experience.
  • the invention can start the page of the corresponding application module according to different page information and startup parameter information through the start function, and has wide application range and strong practicability, and is very suitable for promotion.
  • FIG. 1 is a flowchart of a method for starting a page based on Android according to an embodiment of the present invention
  • FIG. 2 is a block diagram showing the connection of an electronic device in an embodiment of the present invention.
  • an Android-based page startup method in an embodiment of the present invention includes the following steps:
  • a message event bus is set between the component and the application module, and the message event bus is used to implement communication between the component and the application module, and goes to S2.
  • the component When the component needs to start the page inside the application module, the component obtains the page startup information, the page startup information includes the page information and the startup parameter information, and the page startup information is encapsulated into a JSON format (JavaScript Object Notation, a lightweight data exchange format). After the page startup data, the page startup data is transmitted to the application module through the message event bus, and goes to S3.
  • JSON format JavaScript Object Notation, a lightweight data exchange format
  • S3 The application module parses the page startup data, obtains the page startup information, and starts a page corresponding to the page startup information by using a start function (a startup function).
  • a start function a startup function
  • the specific process is: after the page corresponding to the page information is determined by the start function, according to the startup parameter information
  • start the determined page the actual implementation is: start function is "start (target, param)", where target is the page information, param is the startup parameter information. It can be seen that the embodiment of the present invention can start the page of the corresponding application module according to different page information and startup parameter information through the start function, and has wide application range and strong practicability, and is very suitable for promotion.
  • the application module parses the page startup message delivered by the component, and starts the page according to the page startup message.
  • the embodiment of the invention makes the connection between the component and the page, but "bridges" through the application module, there is no need to change the page.
  • the business logic therefore, the embodiment of the present invention can implement the purpose of the component launching page by means of the application module starting the page, thereby ensuring the stability of the page and the subsequent user experience.
  • the embodiment of the invention further provides a storage medium, where the computer program is stored on the storage medium, and the computer-based page startup method is implemented when the computer program is executed by the processor.
  • the storage medium includes a U disk, a mobile hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a disk or an optical disk, and the like. The medium of the code.
  • an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the computer stores a computer program running on the processor, and the processor implements the above-mentioned Android-based page startup method when the processor executes the computer program. .
  • the Android-based page startup system in the embodiment of the present invention includes a message event bus setting module disposed on the Android client, a page startup information transmission module disposed on the component, and a message receiving module disposed on the application module.
  • the message event bus setting module is configured to: set a message event bus between the component and the application module;
  • the page startup information transmission module is configured to: when the page inside the application module needs to be started, obtain page startup information, the page startup information includes page information and startup parameter information; and the page startup information is encapsulated into a JSON format page startup data, and the page is started. Data is transmitted to the message receiving module via the message event bus.
  • the message receiving module is configured to: after parsing the page startup data to obtain the page startup information, start a page corresponding to the page startup information by using a start function: after determining a page corresponding to the page information by using a start function, starting the determined page according to the startup parameter information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种基于Android的页面启动方法、存储介质、电子设备及系统,涉及Android客户端的组件化领域。该方法的步骤为:在组件与应用模块之间设置消息事件总线;组件需要启动应用模块内部的页面时,组件获取页面启动信息,将页面启动信息封装为页面启动数据后,将页面启动数据通过消息事件总线传输至应用模块;应用模块解析页面启动数据,得到页面启动信息,通过start函数启动与页面启动信息对应的页面。本发明能够在不改变页面业务逻辑的基础上,通过Android客户端的组件,来启动应用模块内的页面。本发明能够以应用模块启动页面的手段,来实现组件启动页面的目的,进而保证了页面的稳定性能以及后续的用户体验。

Description

基于Android的页面启动方法、存储介质、电子设备及系统 技术领域
本发明涉及Android客户端的组件化领域,具体涉及一种基于Android的页面启动方法、存储介质、电子设备及系统。
背景技术
在Android客户端的组件化过程中,组件需要启动应用模块内部的页面,由于应用模块与组件之间的关系是:应用模块依赖于组件(即应用模块能够直接引用组件),组件不会依赖应用模块(即组件不能直接引用应用模块),因此将通过组件启动应用模块中的页面之前,需要将页面的启动方式由之前的通过应用模块直接启动(因为在应用模块内部,所以可以直接启动),变更为通过组件启动,具体为将页面传递参数的方式由应用模块改为组件。
但是,将页面传递参数的方式由应用模块改为组件,这必然会改变页面的业务逻辑,页面的业务逻辑被修改后会降低页面的稳定性能,进而导致页面在运行时可能存在诸多问题,存在问题的页面直接上线可能会带来不可预知的后果。
发明内容
针对现有技术中存在的缺陷,本发明解决的技术问题为:在不改变页面业务逻辑的基础上,通过Android客户端的组件,来启动应用模块内的页面。本发明能够以应用模块启动页面的手段,来实现组件启动页面的目的,进而保证了页面的稳定性能以及后续的用户体验。
为达到以上目的,本发明提供的基于Android的页面启动方法,包括以下步骤:
S1:在组件与应用模块之间设置消息事件总线;
S2:组件需要启动应用模块内部的页面时,组件获取页面启动信息,将页面启动信息封装为页面启动数据后,将页面启动数据通过消息事件总线传输至应用模块,转到S3;
S3:应用模块解析页面启动数据,得到页面启动信息,通过start函数启动与页面启动信息对应的页面。
在上述技术方案的基础上,S2中所述页面启动信息包括页面信息和启动参数信息。
在上述技术方案的基础上,S3中所述通过start函数启动与页面启动信息对应的页面的流程包括:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面。
在上述技术方案的基础上,S2中所述页面启动数据的格式为JSON格式。
本发明提供的存储介质,该存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述基于Android的页面启动方法。
本发明提供的电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,处理器执行计算机程序时实现上述基于Android的页面启动方法。
本发明提供的基于Android的页面启动系统,包括设置于Android客户端上的消息事件总线设置模块、设置于组件上的页面启动信息传输模块、以及设置于应用模块上的消息接收模块;
消息事件总线设置模块用于:在组件与应用模块之间设置消息事件总线;
页面启动信息传输模块用于:需要启动应用模块内部的页面时,获取页面启动信息,将页面启动信息封装为页面启动数据后,将页面启动数据通过消息事件总线传输至消息接收模块;
消息接收模块用于:解析页面启动数据得到页面启动信息后,通过start函数启动与页面启动信息对应的页面。
在上述技术方案的基础上,所述页面启动信息传输模块中的页面启动信息包括页面信息和启动参数信息。
在上述技术方案的基础上,所述消息接收模块通过start函数启动与页面启动信息对应的页面的流程包括:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面。
在上述技术方案的基础上,所述页面启动信息传输模块中的页面启动数据的格式为JSON格式。
与现有技术相比,本发明的优点在于:
(1)参见S1至S3可知,本发明在组件启动应用模块中的页面时,通过应用模块来解析组件下发的页面启动消息、并根据页面启动消息来启动页面。与现有技术中组件需要改变页面的业务逻辑来启动页面相比,因为本发明使得组件与页面之间没有之间联系,而是通过应用模块来“桥接”,所以不需要改变页面的业务逻辑;因此,本发明能够以应用模块启动页面的手段,来实现组件启动页面的目的,进而保证了页面的稳定性能以及后续的用户体验。
(2)本发明能够通过start函数,根据不同的页面信息和启动参数信息,来启动对应应用模块的页面,适用范围广泛,实用性较强,非常适于推广。
附图说明
图1为本发明实施例中基于Android的页面启动方法的流程图;
图2为本发明实施例中电子设备的连接框图。
具体实施方式
以下结合附图及实施例对本发明作进一步详细说明。
参见图1所示,本发明实施例中的基于Android的页面启动方法,包括以下步骤:
S1:在组件与应用模块之间设置消息事件总线,消息事件总线用于实现组件与应用模块之间的通信,转到S2。
S2:组件需要启动应用模块内部的页面时,组件获取页面启动信息,页面启动信息包括页面信息和启动参数信息,将页面启动信息封装为JSON格式(JavaScript Object Notation,轻量级的数据交换格式)的页面启动数据后,将页面启动数据通过消息事件总线传输至应用模块,转到S3。
S3:应用模块解析页面启动数据,得到页面启动信息,通过start函数(启动函数)启动与页面启动信息对应的页面,具体流程为:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面,实际实现方式为:start函数为“start(target,param)”,其中target为页面信息,param为启动参数信息。由此可知,本发明实施例能够通过start函数,根据不同的页面信息和启动参数信息,来启动对应应用模块的页面,适用范围广泛,实用性较强,非常适于推广。
参见S1至S3可知,本发明实施例在组件启动应用模块中的页面时,通过应用模块来解析组件下发的页面启动消息、并根据页面启动消息来启动页面。与现有技术中组件需要改变页面的业务逻辑来启动页面相比,因为本发明实施例使得组件与页面之间没有之间联系,而是通过应用模块来“桥接”,所以不需要改变页面的业务逻辑;因此, 本发明实施例能够以应用模块启动页面的手段,来实现组件启动页面的目的,进而保证了页面的稳定性能以及后续的用户体验。
本发明实施例还提供一种存储介质,存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述基于Android的页面启动方法。需要说明的是,所述存储介质包括U盘、移动硬盘、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、磁碟或者光盘等各种可以存储程序代码的介质。
参见图2所示,本发明实施例还提供一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,处理器执行计算机程序时实现上述基于Android的页面启动方法。
本发明实施例中的基于Android的页面启动系统,包括设置于Android客户端上的消息事件总线设置模块、设置于组件上的页面启动信息传输模块、以及设置于应用模块上的消息接收模块。
消息事件总线设置模块用于:在组件与应用模块之间设置消息事件总线;
页面启动信息传输模块用于:需要启动应用模块内部的页面时,获取页面启动信息,页面启动信息包括页面信息和启动参数信息;将页面启动信息封装为JSON格式的页面启动数据后,将页面启动数据通过消息事件总线传输至消息接收模块。
消息接收模块用于:解析页面启动数据得到页面启动信息后,通过start函数启动与页面启动信息对应的页面:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面。
需要说明的是:本发明实施例提供的系统在进行模块间通信时,仅以上述各功能模块的划分进行举例说明,实际应用模块中,可以根据需要而将上述功能分配由不同的功能模块完成,即将系统的内部结 构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
进一步,本发明不局限于上述实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围之内。本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (10)

  1. 一种基于Android的页面启动方法,其特征在于,该方法包括以下步骤:
    S1:在组件与应用模块之间设置消息事件总线;
    S2:组件需要启动应用模块内部的页面时,组件获取页面启动信息,将页面启动信息封装为页面启动数据后,将页面启动数据通过消息事件总线传输至应用模块,转到S3;
    S3:应用模块解析页面启动数据,得到页面启动信息,通过start函数启动与页面启动信息对应的页面。
  2. 如权利要求1所述的基于Android的页面启动方法,其特征在于:S2中所述页面启动信息包括页面信息和启动参数信息。
  3. 如权利要求2所述的基于Android的页面启动方法,其特征在于:S3中所述通过start函数启动与页面启动信息对应的页面的流程包括:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面。
  4. 如权利要求1至3任一项所述的基于Android的页面启动方法,其特征在于:S2中所述页面启动数据的格式为JSON格式。
  5. 一种存储介质,该存储介质上存储有计算机程序,其特征在于:所述计算机程序被处理器执行时实现权利要求1至4任一项所述的方法。
  6. 一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,其特征在于:处理器执行计算机程序时实现权利要求1至4任一项所述的方法。
  7. 一种基于Android的页面启动系统,其特征在于:该系统包括设置于Android客户端上的消息事件总线设置模块、设置于组件上 的页面启动信息传输模块、以及设置于应用模块上的消息接收模块;
    消息事件总线设置模块用于:在组件与应用模块之间设置消息事件总线;
    页面启动信息传输模块用于:需要启动应用模块内部的页面时,获取页面启动信息,将页面启动信息封装为页面启动数据后,将页面启动数据通过消息事件总线传输至消息接收模块;
    消息接收模块用于:解析页面启动数据得到页面启动信息后,通过start函数启动与页面启动信息对应的页面。
  8. 如权利要求7所述的基于Android的页面启动系统,其特征在于:所述页面启动信息传输模块中的页面启动信息包括页面信息和启动参数信息。
  9. 如权利要求8所述的基于Android的页面启动系统,其特征在于:所述消息接收模块通过start函数启动与页面启动信息对应的页面的流程包括:通过start函数确定与页面信息对应的页面后,根据启动参数信息启动确定的页面。
  10. 如权利要求7至9任一项所述的基于Android的页面启动系统,其特征在于:所述页面启动信息传输模块中的页面启动数据的格式为JSON格式。
PCT/CN2018/081289 2017-11-01 2018-03-30 基于Android的页面启动方法、存储介质、电子设备及系统 WO2019085385A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711058320.2A CN108052361B (zh) 2017-11-01 2017-11-01 基于Android的页面启动方法、存储介质、电子设备及系统
CN201711058320.2 2017-11-01

Publications (1)

Publication Number Publication Date
WO2019085385A1 true WO2019085385A1 (zh) 2019-05-09

Family

ID=62119853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/081289 WO2019085385A1 (zh) 2017-11-01 2018-03-30 基于Android的页面启动方法、存储介质、电子设备及系统

Country Status (2)

Country Link
CN (1) CN108052361B (zh)
WO (1) WO2019085385A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113254154B (zh) * 2021-05-21 2024-03-29 技德技术研究所(武汉)有限公司 一种在Linux上兼容运行Android系统的应用启动方法及装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914204A (zh) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 一种用于视图显示和切换的方法和装置
CN106155639A (zh) * 2015-03-24 2016-11-23 阿里巴巴集团控股有限公司 一种操作界面的加载方法及装置
CN106843912A (zh) * 2017-03-22 2017-06-13 武汉斗鱼网络科技有限公司 页面信息获取方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103914204A (zh) * 2012-12-31 2014-07-09 北京新媒传信科技有限公司 一种用于视图显示和切换的方法和装置
CN106155639A (zh) * 2015-03-24 2016-11-23 阿里巴巴集团控股有限公司 一种操作界面的加载方法及装置
CN106843912A (zh) * 2017-03-22 2017-06-13 武汉斗鱼网络科技有限公司 页面信息获取方法及装置

Also Published As

Publication number Publication date
CN108052361B (zh) 2019-08-23
CN108052361A (zh) 2018-05-18

Similar Documents

Publication Publication Date Title
US20200081701A1 (en) Information Upgrading Method, Apparatus and Storage Medium for Automatic Driving Vehicle
US9639485B2 (en) Method and apparatus for transmitting data in android platform based terminal device
US9635098B2 (en) Open platform, open platform access system, storage medium, and method for allowing third party application to access open platform
TW201828220A (zh) 業務處理方法及裝置
US10291719B2 (en) Enabling communication while limiting access to user information
US10642983B2 (en) Method and apparatus for protecting application
US11977637B2 (en) Technique for authentication and prerequisite checks for software updates
US8495617B2 (en) Interworking system between user terminal and smart card for executing widget, and method thereof
US8069443B2 (en) Techniques for providing services and establishing processing environments
WO2017071358A1 (zh) 一种软件升级的方法及装置
JP7327731B2 (ja) 車載システムにおけるセキュリティ保護方法およびデバイス
WO2016062146A1 (zh) 序列号信息的更新方法、装置及终端
CN114327803A (zh) 区块链访问机器学习模型的方法、装置、设备和介质
CN111083166A (zh) 云数据库设置白名单的方法、装置及计算机存储介质
WO2018000692A1 (zh) 数据同步方法、系统及用于数据同步的用户终端和服务端
US20170177395A1 (en) Embedded architecture based on process virtual machine
WO2019085385A1 (zh) 基于Android的页面启动方法、存储介质、电子设备及系统
CN114124916A (zh) 数据传输方法、装置、电子设备及存储介质
WO2017198155A1 (zh) 一种启动adb调试的方法及终端
US8893105B2 (en) Activation-based regulatory updates
CN104899502B (zh) 用于对受保护的硬件资源的软件启用接入的装置和方法
US10255441B2 (en) Electronic device and method of managing image by electronic device
CN106453213A (zh) 一种系统间调用方法及装置
WO2015003605A1 (en) Systems and methods for content transmission for instant messaging
WO2014198111A1 (en) Systems and methods for multimedia-processing

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

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

Country of ref document: EP

Kind code of ref document: A1