CN111104632A - Interaction mechanism of mobile terminal and JS code - Google Patents

Interaction mechanism of mobile terminal and JS code Download PDF

Info

Publication number
CN111104632A
CN111104632A CN201911239278.3A CN201911239278A CN111104632A CN 111104632 A CN111104632 A CN 111104632A CN 201911239278 A CN201911239278 A CN 201911239278A CN 111104632 A CN111104632 A CN 111104632A
Authority
CN
China
Prior art keywords
mobile terminal
interaction
data
interaction mechanism
code according
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.)
Pending
Application number
CN201911239278.3A
Other languages
Chinese (zh)
Inventor
李俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Nanjing Digital Technology Co Ltd
Original Assignee
Unicloud Nanjing Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unicloud Nanjing Digital Technology Co Ltd filed Critical Unicloud Nanjing Digital Technology Co Ltd
Priority to CN201911239278.3A priority Critical patent/CN111104632A/en
Publication of CN111104632A publication Critical patent/CN111104632A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Telephonic Communication Services (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses an interaction mechanism of a mobile terminal and JS codes, based on a DSbridge framework, the mobile terminal and a corresponding JS developer negotiate an interaction method and an analysis scheme corresponding to the interaction method; and when the mobile terminal loads the JS webpage, the loaded JS webpage automatically calls the interaction method.

Description

Interaction mechanism of mobile terminal and JS code
Technical Field
The invention relates to the field of application of a mobile terminal, in particular to an interaction mechanism of the mobile terminal and a JS code.
Background
With the advent of the mobile internet era, the functional coverage required by mobile-end applications is becoming more widespread in such large environments. In this case, for all functions, development of native (mobile terminal native is classified into IOS, android, and the like) is required, and a large amount of manpower and material resources are required to be input. But the user experience is degraded if developed entirely using a cross-platform language. For the situation, we need to choose and trade, write some needed updates (such as an advertisement function and a lottery function) with JS codes, and conveniently perform quick update iteration. Then as the function of the mobile terminal matures, the JS code often needs data in the native code, at this time we need to interact with the JS.
In the prior art, an interaction method name and related parameters are jointly agreed by a native code developer and a JS developer, the method name is written into codes of both parties, and the DSbridge monitors the method. And when the primary application calls the JS code method, monitoring the JS code, and delivering the corresponding method and the corresponding parameters to the JS code to realize the corresponding function.
Relative hysteresis is caused because the relevant agreed-upon code is written into the native code, once the JS code is modified, for example, the modified agreed-upon method name or parameters are increased. Native mobile applications are not aware, however, leading to failure of the method.
Disclosure of Invention
In view of this, the present invention provides an interaction mechanism between a mobile terminal and JS codes, which is used to solve the problem that a native mobile application cannot sense the JS codes in the prior art when the JS codes are modified.
In order to achieve the purpose, the invention provides an interaction mechanism of a mobile terminal and JS codes, wherein the mobile terminal and a corresponding JS developer negotiate an interaction method and an analysis scheme corresponding to the interaction method; and when the mobile terminal loads the JS webpage, the loaded JS webpage automatically calls the interaction method.
Optionally, the native application of the mobile terminal monitors the interaction method, and performs data analysis.
Optionally, the interactive method is obtained by using an API request, and data analysis is performed.
Optionally, the mobile terminal performs corresponding interface setting according to the data obtained by the analysis, and binds the data obtained by the analysis with the interface control.
Optionally, the interface control is clicked to acquire the data bound with the interface control, the data is transmitted to the JS interface, and the JS interface performs corresponding setting.
Optionally, the interaction method includes a fixed data structure and a varying data content.
Optionally, the changed data content includes a method name and corresponding parameters
Compared with the prior art, the technical scheme of the invention has the following advantages: the invention can keep the synchronism with the JS code in real time, is compatible with different versions of the application of the mobile terminal, ensures the effectiveness of the JS and the native interaction, and achieves the purposes of saving the labor cost and dynamically and efficiently realizing the rapid iteration. The invention can dynamically encapsulate the method for the native application of the mobile terminal and the mutual calling of the JS interface on the basis of the DSbridge framework, thereby ensuring the real-time effectiveness of the method. The native control can be dynamically distributed according to the interactive data, flexibly bound and called the JS newest method in real time, so that better compatibility is achieved.
Drawings
FIG. 1 is a flow chart of an interaction mechanism of a mobile terminal and a JS code in the invention;
Detailed Description
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention is not limited to only these embodiments. The invention is intended to cover alternatives, modifications, equivalents and alternatives which may be included within the spirit and scope of the invention.
In the following description of the preferred embodiments of the present invention, specific details are set forth in order to provide a thorough understanding of the present invention, and it will be apparent to those skilled in the art that the present invention may be practiced without these specific details.
The invention is described in more detail in the following paragraphs by way of example with reference to the accompanying drawings. It should be noted that the drawings are in simplified form and are not to precise scale, which is only used for convenience and clarity to assist in describing the embodiments of the present invention.
Referring to fig. 1, a flow chart of an interaction mechanism between a mobile terminal and a JS code of the present invention is illustrated, and the method includes the following steps:
s01: the APP front end and JS end research and development personnel negotiate an interaction method and an analysis scheme, and the interaction method comprises a method name and a data structure.
S02: loading a JS webpage at the APP front end; after the loading is successful, the step S03 is performed; otherwise, the procedure is ended.
S03: the loaded JS webpage automatically calls the interaction method in step S01; after the calling is successful, the step S04 is carried out; otherwise, the procedure is ended.
S04: and the APP front end monitors a corresponding interaction method and performs data analysis.
S05: the APP performs interface setting according to the data parsed in step S04, and binds the interface control and the parsed data.
S06: and (4) operating the APP front end, clicking the interface control generated in the step S05, transmitting the data obtained by analyzing in the step S04 to the JS interface, and calling a corresponding method by the JS webpage to perform related operation.
In the interaction mechanism, the interaction method negotiated in the scheme can be obtained by using an API request mode, and interface layout and binding of corresponding click events are carried out.
Although the embodiments have been described and illustrated separately, it will be apparent to those skilled in the art that some common techniques may be substituted and integrated between the embodiments, and reference may be made to one of the embodiments not explicitly described, or to another embodiment described.
The above-described embodiments do not limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and principle of the above-described embodiments should be included in the protection scope of the technical solution.

Claims (7)

1. An interaction mechanism of a mobile terminal and JS codes is based on a DSbridge framework, and is characterized in that: the mobile terminal negotiates an interaction method and an analysis scheme corresponding to the interaction method with a corresponding JS developer; and when the mobile terminal loads the JS webpage, the loaded JS webpage automatically calls the interaction method.
2. The interaction mechanism between the mover and the JS code according to claim 1, characterized in that: and the native application of the mobile terminal monitors the interaction method and analyzes data.
3. The interaction mechanism between the mover and the JS code according to claim 1, characterized in that: and acquiring the interaction method by using an API request mode, and analyzing data.
4. The interaction mechanism between the mover and the JS code according to claim 2, characterized in that: and the mobile terminal performs corresponding interface setting according to the data obtained by analysis and binds the data obtained by analysis with the interface control.
5. The interaction mechanism between the mover and the JS code according to claim 4, wherein: and clicking the interface control to acquire the data bound with the interface control, transmitting the data to the JS interface, and correspondingly setting the JS interface.
6. The interaction mechanism of the mobile terminal and the JS code according to any one of claims 1-5, wherein: the interactive method includes a fixed data structure and varying data content.
7. The interaction mechanism between the mover and the JS code according to claim 6, wherein: the changed data content includes a method name and corresponding parameters.
CN201911239278.3A 2019-12-06 2019-12-06 Interaction mechanism of mobile terminal and JS code Pending CN111104632A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911239278.3A CN111104632A (en) 2019-12-06 2019-12-06 Interaction mechanism of mobile terminal and JS code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911239278.3A CN111104632A (en) 2019-12-06 2019-12-06 Interaction mechanism of mobile terminal and JS code

Publications (1)

Publication Number Publication Date
CN111104632A true CN111104632A (en) 2020-05-05

Family

ID=70421761

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911239278.3A Pending CN111104632A (en) 2019-12-06 2019-12-06 Interaction mechanism of mobile terminal and JS code

Country Status (1)

Country Link
CN (1) CN111104632A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760162A (en) * 2016-02-04 2016-07-13 四川长虹电器股份有限公司 Development method for hybrid APP software
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN109976831A (en) * 2019-03-28 2019-07-05 山东浪潮通软信息科技有限公司 Data interactive method between a kind of JavaScript and primary APP

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760162A (en) * 2016-02-04 2016-07-13 四川长虹电器股份有限公司 Development method for hybrid APP software
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN109976831A (en) * 2019-03-28 2019-07-05 山东浪潮通软信息科技有限公司 Data interactive method between a kind of JavaScript and primary APP

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
阿里云开发者社区: "原生Js交互之DSBridge", 《阿里云开发者社区DEVELOPER.ALIYUN.COM/ARTICLE/664494》 *

Similar Documents

Publication Publication Date Title
US8612947B2 (en) System and method for remotely compiling multi-platform native applications for mobile devices
US8099720B2 (en) Translating declarative models
CN107688529B (en) Component debugging method and device
CN105718313A (en) Application operation method and device
CN109240697B (en) Call processing method and device and storage medium
GB2589658A (en) Method and apparatus for running an applet
JP7106001B2 (en) SUB-APPLICATION DEVELOPMENT METHOD, APPARATUS, COMPUTER DEVICE, AND COMPUTER PROGRAM
US11966795B2 (en) Method and device for loading minus-one screen, terminal, and computer readable storage medium
CN107463405B (en) Application program updating method and device
CN106775862A (en) Using loading method and device
CN112035112A (en) Application program development method, system, medium and electronic device
CN111045940B (en) Software automation test method, device, architecture, server and storage medium
CN108021445B (en) Memory optimization method, device and system and computer readable storage medium
CN105824611A (en) Rapid development system based on Android intelligent operation platform
CN113641582A (en) Mixed-mode mobile application debugging method and system
CN109213533A (en) A kind of advertisement SDK dynamic loading method, device and terminal
CN106325851B (en) Interactive remote collaboration method for Android application
CN111104632A (en) Interaction mechanism of mobile terminal and JS code
US20210349738A1 (en) Application library analytics tool
CN112130888A (en) Method, device and equipment for updating application program and computer storage medium
CN112015384A (en) Interface mapping method and device
CN108009084B (en) Testing method, device and system for hybrid mobile application
US8181188B2 (en) Version resiliency for a host application and managed code
KR20160000761A (en) Apparatus, system, method and readable recording medium of managing a project file
KR100538801B1 (en) Graphic User Interface Providing System And Method Wireless Terminal Applications

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200505

WD01 Invention patent application deemed withdrawn after publication