CN105204824A - Method and device for communication between application and mobile terminal - Google Patents
Method and device for communication between application and mobile terminal Download PDFInfo
- Publication number
- CN105204824A CN105204824A CN201410241208.2A CN201410241208A CN105204824A CN 105204824 A CN105204824 A CN 105204824A CN 201410241208 A CN201410241208 A CN 201410241208A CN 105204824 A CN105204824 A CN 105204824A
- Authority
- CN
- China
- Prior art keywords
- application program
- mobile terminal
- interpreter
- protocol
- calling
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000004891 communication Methods 0.000 title claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 39
- 230000006870 function Effects 0.000 claims abstract description 36
- 238000005516 engineering process Methods 0.000 description 18
- 230000007246 mechanism Effects 0.000 description 7
- 230000018109 developmental process Effects 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000008140 language development Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
Landscapes
- Telephonic Communication Services (AREA)
Abstract
本发明提供了一种应用程序与移动终端之间通讯的方法及装置,涉及通信领域,解决现有技术中应用程序与移动终端实现通讯的方式没有统一标准,可复用性差,扩展困难的问题,该应用程序与移动终端之间通讯的方法包括:根据应用程序语言的调用信息获取所述应用程序对应的协议解释器;通过所述协议解释器调用移动终端相关功能,并进行数据处理;将处理的数据返回给所述应用程序。本发明的方案为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。
The present invention provides a method and device for communication between an application program and a mobile terminal, relates to the field of communication, and solves the problems in the prior art that there is no unified standard for communication between an application program and a mobile terminal, poor reusability, and difficult expansion The method for communicating between the application program and the mobile terminal includes: obtaining a protocol interpreter corresponding to the application program according to the call information of the application program language; calling relevant functions of the mobile terminal through the protocol interpreter, and performing data processing; The processed data is returned to the application. The scheme of the invention provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
Description
技术领域technical field
本发明涉及通信领域,特别涉及一种应用程序与移动终端之间通讯的方法及装置。The invention relates to the communication field, in particular to a method and device for communication between an application program and a mobile terminal.
背景技术Background technique
随着移动互联网技术的不断发展和相关硬件技术的进步,特别是移动终端设备技术不断改进,以及网络应用WEBAPP发展需要的超文本语言5/层叠样式表HTML5/css3技术和云计算能力等条件都开始成熟,同时传统互联网服务商对于3G以及4G技术的布局和推进,大量网站逐步专门开发针对移动终端适配的网站,并且也有越来越多的APP应用出现在各种移动互联网平台上。With the continuous development of mobile Internet technology and the advancement of related hardware technology, especially the continuous improvement of mobile terminal equipment technology, as well as the hypertext language 5/cascading style sheet HTML5/css3 technology and cloud computing capabilities required for the development of network applications WEBAPP At the same time, traditional Internet service providers are deploying and promoting 3G and 4G technologies. A large number of websites are gradually developing websites adapted to mobile terminals, and more and more APP applications are appearing on various mobile Internet platforms.
HTML相关技术在移动端浏览器中得到越来越广泛的应用。HTML5技术本身已经比较成熟,HTML5的接受程度已经得到了推广和普及,标准已经形成。而在HTML相关技术在移动端应用过程中,无论是作为浏览器技术还是进行移动APP应用集成,都存在一个与移动设备进行通讯的问题。移动终端设备的技术进步主要表现在更强的处理能力、更加友好的用户界面、更小的体积、更大的屏幕和分辨率、更多更好的用户体验如多点触摸、语音、多传感器、3G上网、地理位置定位等等。HTML技术只有能够具有非常强大完整与移动设备通讯的能力,才能够充分发挥移动设备的硬件优势,开发出更能吸引人的移动端网站和移动APP,这些都要求HTML,javascript等能够与移动设备进行无障碍通讯。另外,移动设备语言IOS,Android等虽然都提供了相应的实现,但是各平台实现方式独力,没有统一标准,实现方式差异化过大导致针对不同平台,我们需要提供多套实现,极大地增加了设计开发及实现成本,并且可复用性太差,为相应技术的扩展造成极大困难。HTML-related technologies are more and more widely used in mobile browsers. The HTML5 technology itself is relatively mature, the acceptance of HTML5 has been promoted and popularized, and the standard has been formed. However, in the application process of HTML-related technologies on mobile terminals, whether as browser technology or mobile APP application integration, there is a problem of communicating with mobile devices. The technical progress of mobile terminal equipment is mainly manifested in stronger processing power, more friendly user interface, smaller volume, larger screen and resolution, more and better user experience such as multi-touch, voice, multi-sensor , 3G Internet access, geographic location positioning and so on. Only when HTML technology has a very powerful and complete ability to communicate with mobile devices, can it give full play to the hardware advantages of mobile devices and develop more attractive mobile websites and mobile apps. All of these require HTML, javascript, etc. to be able to communicate with mobile devices Communicate without hassle. In addition, although mobile device languages such as IOS and Android provide corresponding implementations, the implementation methods of each platform are independent, there is no unified standard, and the differences in implementation methods are too large. As a result, we need to provide multiple sets of implementations for different platforms, which greatly increases The cost of design, development and implementation, and the poor reusability have caused great difficulties for the expansion of corresponding technologies.
发明内容Contents of the invention
本发明要解决的技术问题是提供一种应用程序与移动终端之间通讯的方法及装置,解决现有技术中应用程序与移动终端实现通讯的方式没有统一标准,可复用性差,扩展困难的问题。The technical problem to be solved by the present invention is to provide a method and device for communication between an application program and a mobile terminal, which solves the problems in the prior art that there is no unified standard for communication between an application program and a mobile terminal, poor reusability, and difficult expansion question.
为解决上述技术问题,本发明的实施例提供一种应用程序与移动终端之间通讯的方法,包括:In order to solve the above technical problems, an embodiment of the present invention provides a method for communication between an application program and a mobile terminal, including:
根据应用程序语言的调用信息获取所述应用程序对应的协议解释器;Acquiring a protocol interpreter corresponding to the application program according to the calling information of the application program language;
通过所述协议解释器调用移动终端相关功能,并进行数据处理;calling relevant functions of the mobile terminal through the protocol interpreter, and performing data processing;
将处理的数据返回给所述应用程序。The processed data is returned to the application.
其中,所述调用信息包括:Wherein, the call information includes:
用于识别所述协议解释器的解释器标识符;an interpreter identifier for identifying said protocol interpreter;
接口,所述接口为所述移动终端相关功能的对应方法入口;an interface, where the interface is a corresponding method entry of related functions of the mobile terminal;
参数列表,所述参数列表为所述应用程序语言携带的数据信息。A parameter list, where the parameter list is data information carried by the application language.
其中,根据应用程序语言的调用信息获取所述应用程序对应的协议解释器的步骤具体为:Wherein, the step of obtaining the protocol interpreter corresponding to the application program according to the calling information of the application program language is as follows:
根据所述解释器标识符获取所述应用程序对应的协议解释器。Obtain the protocol interpreter corresponding to the application program according to the interpreter identifier.
其中,通过所述协议解释器调用移动终端相关功能,并进行数据处理的步骤包括:Wherein, the steps of invoking relevant functions of the mobile terminal through the protocol interpreter and performing data processing include:
通过所述协议解释器及所述接口信息调用所述移动终端相关功能,并返回调用结果;calling related functions of the mobile terminal through the protocol interpreter and the interface information, and returning the calling result;
根据所述参数列表对所述返回结果进行数据处理。Perform data processing on the returned result according to the parameter list.
其中,所述调用信息基于统一资源定位符URL语法进行定义;以及Wherein, the calling information is defined based on the Uniform Resource Locator URL syntax; and
所述调用信息还包括:The calling information also includes:
用于标识调用类别的协议头。Protocol header used to identify the class of the call.
为解决上述技术问题,本发明的实施例还提供一种应用程序与移动终端之间通讯的装置,包括:In order to solve the above technical problems, an embodiment of the present invention also provides a communication device between an application program and a mobile terminal, including:
获取模块,用于根据应用程序语言的调用信息获取所述应用程序对应的协议解释器;An acquisition module, configured to acquire a protocol interpreter corresponding to the application program according to the calling information of the application program language;
处理模块,用于通过所述协议解释器调用移动终端相关功能,并进行数据处理;A processing module, used for invoking relevant functions of the mobile terminal through the protocol interpreter, and performing data processing;
返回模块,用于将处理的数据返回给所述应用程序。The returning module is used for returning the processed data to the application program.
其中,所述调用信息包括:Wherein, the call information includes:
用于识别所述协议解释器的解释器标识符;an interpreter identifier for identifying said protocol interpreter;
接口,所述接口为所述移动终端相关功能的对应方法入口;an interface, where the interface is a corresponding method entry of related functions of the mobile terminal;
参数列表,所述参数列表为所述应用程序语言携带的数据信息。A parameter list, where the parameter list is data information carried by the application language.
其中,所述获取模块具体用于:Wherein, the acquisition module is specifically used for:
根据所述解释器标识符获取所述应用程序对应的协议解释器。Obtain the protocol interpreter corresponding to the application program according to the interpreter identifier.
其中,所述处理模块包括:Wherein, the processing module includes:
调用模块,用于通过所述协议解释器及所述接口信息调用所述移动终端相关功能,并返回调用结果;A calling module, configured to call related functions of the mobile terminal through the protocol interpreter and the interface information, and return a call result;
处理子模块,用于根据所述参数列表对所述返回结果进行数据处理。The processing sub-module is configured to perform data processing on the returned result according to the parameter list.
其中,所述调用信息基于统一资源定位符URL语法进行定义;以及Wherein, the calling information is defined based on the Uniform Resource Locator URL syntax; and
所述调用信息还包括:The calling information also includes:
用于标识调用类别的协议头。Protocol header used to identify the class of the call.
本发明的上述技术方案的有益效果如下:The beneficial effects of above-mentioned technical scheme of the present invention are as follows:
本发明实施例的应用程序与移动终端之间通讯的方法,先根据应用程序语言的调用信息获取应用程序对应的协议解释器;然后通过协议解释器调用移动终端的相关功能,并进行数据处理;最后将处理的数据返回给应用程序。为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。In the method for communication between the application program and the mobile terminal in the embodiment of the present invention, first obtain the protocol interpreter corresponding to the application program according to the call information of the application program language; then use the protocol interpreter to call the relevant functions of the mobile terminal and perform data processing; Finally, the processed data is returned to the application. It provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
附图说明Description of drawings
图1为本发明应用程序与移动终端之间通讯的方法流程图;Fig. 1 is the flow chart of the method for communication between the application program and the mobile terminal of the present invention;
图2为本发明应用程序与移动终端之间通讯的方法一具体实施例的示意图;2 is a schematic diagram of a specific embodiment of a method for communicating between an application program and a mobile terminal according to the present invention;
图3为本发明应用程序与移动终端之间通讯的装置的结构示意图。FIG. 3 is a schematic structural diagram of a communication device between an application program and a mobile terminal according to the present invention.
具体实施方式Detailed ways
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.
本发明实施例的应用程序与移动终端之间通讯的方法,为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。The method for communication between the application program and the mobile terminal in the embodiment of the present invention provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
如图1所示,本发明实施例的应用程序与移动终端之间通讯的实现方法,包括:As shown in Figure 1, the implementation method of communication between the application program and the mobile terminal in the embodiment of the present invention includes:
步骤11,根据应用程序语言的调用信息获取所述应用程序对应的协议解释器;Step 11, obtaining the protocol interpreter corresponding to the application program according to the calling information of the application program language;
步骤12,通过所述协议解释器调用移动终端相关功能,并进行数据处理;Step 12, calling relevant functions of the mobile terminal through the protocol interpreter, and performing data processing;
步骤13,将处理的数据返回给所述应用程序。Step 13, returning the processed data to the application program.
本发明实施例的应用程序与移动终端之间通讯的方法,先根据应用程序语言的调用信息获取应用程序对应的协议解释器;然后通过协议解释器调用移动终端的相关功能,并进行数据处理;最后将处理的数据返回给应用程序。为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。In the method for communication between the application program and the mobile terminal in the embodiment of the present invention, first obtain the protocol interpreter corresponding to the application program according to the call information of the application program language; then use the protocol interpreter to call the relevant functions of the mobile terminal and perform data processing; Finally, the processed data is returned to the application. It provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
其中,应用程序语言可以为超文本标记语言HTML、Javascript等,应用程序可以为移动WEB网站、移动浏览器应用及移动APP应用等。Wherein, the application language may be hypertext markup language HTML, Javascript, etc., and the application program may be a mobile WEB website, a mobile browser application, a mobile APP application, and the like.
另外,协议解释器部分可根据不同移动语言平台,提供对应的软件开发工具包SDK,此部分应用程序编程接口API相对稳定独立,采用公开SDK方式对外提供,在移动APP应用及移动端HTML开发过程中可根据对应语言平台引入即可,最大限度提供了统一的、稳定的、可重用的实现。In addition, the protocol interpreter part can provide corresponding software development kit SDK according to different mobile language platforms. The application programming interface API of this part is relatively stable and independent, and it is provided externally in the form of public SDK. It can be imported according to the corresponding language platform, providing a unified, stable, and reusable implementation to the maximum extent.
本发明的具体实施例中,所述调用信息可以包括:In a specific embodiment of the present invention, the call information may include:
用于识别所述协议解释器的解释器标识符;an interpreter identifier for identifying said protocol interpreter;
接口,所述接口为所述移动终端相关功能的对应方法入口;an interface, where the interface is a corresponding method entry of related functions of the mobile terminal;
参数列表,所述参数列表为所述应用程序语言携带的数据信息A parameter list, the parameter list is the data information carried by the application language
此时,可通过解释器标识符识别协议解释器、以根据应用程序获取应用程序对应的协议解释器;可通过接口获取移动终端相关功能的对应方法入口,以调用终端相关功能;可通过参数列表获取协议解释器进行数据处理所需的数据信息,以根据应用程序需求进行数据处理。At this time, the protocol interpreter can be identified by the interpreter identifier to obtain the protocol interpreter corresponding to the application program according to the application program; the corresponding method entry of the mobile terminal related function can be obtained through the interface to call the terminal related function; the parameter list can be used to Obtain the data information required by the protocol interpreter for data processing, so as to perform data processing according to application requirements.
其中,根据应用程序语言的调用信息获取所述应用程序对应的协议解释器的步骤具体为:Wherein, the step of obtaining the protocol interpreter corresponding to the application program according to the calling information of the application program language is as follows:
根据所述解释器标识符获取所述应用程序对应的协议解释器。Obtain the protocol interpreter corresponding to the application program according to the interpreter identifier.
此时,能在接收到应用程序语言的调用指令后,通过解释器标示符查找对应的协议解释器进行相关数据处理,方便了操作。At this time, after receiving the calling instruction of the application program language, the corresponding protocol interpreter can be searched through the interpreter identifier for relevant data processing, which facilitates the operation.
其中,通过所述协议解释器调用移动终端相关功能,并进行数据处理的步骤包括:Wherein, the steps of invoking relevant functions of the mobile terminal through the protocol interpreter and performing data processing include:
通过所述协议解释器及所述接口信息调用所述移动终端相关功能,并返回调用结果;calling related functions of the mobile terminal through the protocol interpreter and the interface information, and returning the calling result;
根据所述参数列表对所述返回结果进行数据处理。Perform data processing on the returned result according to the parameter list.
此时,协议解释器能通过接口调用终端相关功能,并根据参数列表对调用结果进行数据处理,以返回应用程序所需数据。At this time, the protocol interpreter can call the relevant functions of the terminal through the interface, and perform data processing on the call result according to the parameter list, so as to return the data required by the application program.
进一步的,所述调用信息基于统一资源定位符URL语法进行定义;以及Further, the calling information is defined based on the Uniform Resource Locator URL syntax; and
所述调用信息还包括:The calling information also includes:
用于标识调用类别的协议头。Protocol header used to identify the class of the call.
此时,通过URL技术实现了多移动平台定义统一的协议机制,实现了跨移动语言平台的特性,且通过协议头可对本发明实施例的调用信息与其他调用进行区分,保证了操作的准确性。At this time, the unified protocol mechanism defined by multiple mobile platforms is realized through the URL technology, and the characteristics of cross-mobile language platforms are realized, and the call information of the embodiment of the present invention can be distinguished from other calls through the protocol header, ensuring the accuracy of the operation .
优选的,所述调用信息可以定义为如下的wie协议:Preferably, the call information can be defined as the following wie protocol:
wie://[解释器标识符]/[接口]?[参数列表]wie://[interpreter identifier]/[interface]? [parameter list]
其中,参数列表格式可以为:Key=value,Key为参数标识,value为参数值,多个参数之间采用“&”链接符进行链接,如:type=1&width=300&height=400。Wherein, the parameter list format can be: Key=value, Key is the parameter identifier, value is the parameter value, multiple parameters are linked by "&" link symbol, such as: type=1&width=300&height=400.
假定应用程序语言为HTML语言,HTML中wie协议调用方式可以为:window.location.href=“wie://[解释器标识符]/[接口]?[参数列表]”,如:window.location.href=“wie://www.founderdpt.com/camera.do?type1&width=300&height=400”。其中,解释器标识符为:“www.founderdpt.com”,接口为:“camera.do”。Assuming that the application language is HTML, the calling method of wie protocol in HTML can be: window.location.href="wie://[interpreter identifier]/[interface]?[parameter list]", such as: window.location .href="wie://www.founderdpt.com/camera.do?type1&width=300&height=400". Among them, the interpreter identifier is: "www.founderdpt.com", and the interface is: "camera.do".
具体的,如图2所示,当HTML/Javascript语言调用wie协议后,可通过协议解释器注册管理器根据解释器标识符查找对应的协议解释器(wie解释器);然后通过协议解释器根据接口信息调用移动终端的相关功能模块,并根据参数列表进行数据处理;处理完成后,把处理的数据返回给应用程序。Specifically, as shown in Figure 2, when the HTML/Javascript language calls the wie protocol, the corresponding protocol interpreter (wie interpreter) can be found through the protocol interpreter registration manager according to the interpreter identifier; The interface information calls the relevant functional modules of the mobile terminal, and performs data processing according to the parameter list; after the processing is completed, the processed data is returned to the application program.
这里也可以把处理的数据返回给网络视图webview组件,由webview组件完成后续处理流程后再返回给应用程序。Here, the processed data can also be returned to the webview component, and the webview component will return to the application program after completing the subsequent processing process.
其中,解释器注册管理器可根据不同的移动语言平台特性,提供对应的协议解释器注册机制。且为了保证解释器注册管理器可扩展性,解释器注册管理器应当相对独立并具有一般化接口。Wherein, the interpreter registration manager can provide a corresponding protocol interpreter registration mechanism according to the characteristics of different mobile language platforms. And in order to ensure the extensibility of the interpreter registration manager, the interpreter registration manager should be relatively independent and have a generalized interface.
一种具体实施例,HTML语言调用终端照相机程序返回照片,HTML产生的调用信息为:A kind of specific embodiment, HTML language calls terminal camera program to return photo, and the call information that HTML produces is:
window.location.href=“wie://www.founderdpt.com/camera.do?type1&width=300&height=400”。window.location.href="wie://www.founderdpt.com/camera.do?type1&width=300&height=400".
则首先根据wie协议中的解释器标识符部分获取应用程序对应的协议解释器,然后通过协议解释器根据接口信息调用移动终端相关功能,并根据参数列表信息进行数据处理,这里通过协议解释器调用终端照相机:首先打开设备照相机;在用户点击拍照后,将拍摄的图片按照参数列表信息进行处理后保存;并返回图片本地存储路径给HTML应用程序供其进行后续处理。Then first obtain the protocol interpreter corresponding to the application program according to the interpreter identifier part in the wie protocol, and then use the protocol interpreter to call the relevant functions of the mobile terminal according to the interface information, and perform data processing according to the parameter list information. Here, the protocol interpreter is used to call Terminal camera: first open the device camera; after the user clicks to take a photo, process the captured picture according to the parameter list information and save it; and return the local storage path of the picture to the HTML application for subsequent processing.
另一种具体实施例,HTML语言请求返回设备系统版本号,则首先根据wie协议中的解释器标识符部分获取应用程序对应的协议解释器;然后通过协议解释器根据接口信息调用移动终端设备系统本地代码,并根据本地代码查找对应版本号;最后将获取的版本号返回给HTML应用程序。Another specific embodiment, if the HTML language request returns the device system version number, then first obtain the corresponding protocol interpreter of the application program according to the interpreter identifier part in the wie protocol; then call the mobile terminal device system according to the interface information through the protocol interpreter Local code, and find the corresponding version number according to the local code; finally return the obtained version number to the HTML application.
本发明的具体实施例中,协议解释器部分采用与移动终端设备语言平台相适应的语言开发,通过发行公开SDKAPI接口的方式实现移动平台定制功能,常规设备系统功能模块使用方法都将预定义在其中,并且用户可以根据需要自定义扩展相应模块的功能,以此达到高效和可扩展特性。用户也可以根据移动APP或移动端浏览器相关功能的需要定义适合自己应用的接口功能,并提供相应的协议解释器实现,以此达到扩展的目的。In the specific embodiment of the present invention, the protocol interpreter part adopts the language development that is compatible with the language platform of the mobile terminal equipment, and realizes the mobile platform customization function through the mode of releasing the public SDKAPI interface, and the usage method of the conventional equipment system function module will be predefined in Among them, and users can customize and expand the functions of corresponding modules according to needs, so as to achieve high efficiency and scalability. Users can also define interface functions suitable for their own applications according to the needs of mobile APP or mobile browser related functions, and provide corresponding protocol interpreters to achieve the purpose of expansion.
本发明实施例的应用程序与移动终端之间通讯的方法可以为移动端HTML相关技术的应用,提供与移动终端良好的通讯机制,实现HTML技术调用移动终端如:照相机,定位功能,多媒体功能,传感器等模块统一的API机制,同时还可以实现HTML技术与移动终端原生语言IOS、Android等结合开发移动端APP应用,提供交互良好,功能强大的HTML模块实现。通过设计统一的通信协议机制,实现跨语言平台,标准化等特性,另外通过实现协议解释器注册机制和公开独立的解释器SDK包方式,为HTML技术在移动端的应用提供了强大的支持,去差异化的设计极大地提高了移动APP开发效率,为HTML技术在不同移动平台间的复用提供强有力的支撑。The method for communication between the application program and the mobile terminal in the embodiment of the present invention can provide a good communication mechanism with the mobile terminal for the application of HTML-related technologies at the mobile terminal, and realize that HTML technology calls the mobile terminal such as: camera, positioning function, multimedia function, The unified API mechanism of sensors and other modules can also realize the combination of HTML technology and mobile terminal native language IOS, Android, etc. to develop mobile APP applications, providing a well-interacted and powerful HTML module implementation. Through the design of a unified communication protocol mechanism, cross-language platform, standardization and other features are realized. In addition, through the implementation of the protocol interpreter registration mechanism and the disclosure of an independent interpreter SDK package, it provides strong support for the application of HTML technology on the mobile terminal and eliminates differences. The optimized design greatly improves the efficiency of mobile APP development, and provides strong support for the reuse of HTML technology among different mobile platforms.
如图3所示,本发明的实施例还提供了一种应用程序与移动终端之间通讯的装置,包括:As shown in Figure 3, the embodiment of the present invention also provides a device for communication between an application program and a mobile terminal, including:
获取模块,用于根据应用程序语言的调用信息获取所述应用程序对应的协议解释器;An acquisition module, configured to acquire a protocol interpreter corresponding to the application program according to the calling information of the application program language;
处理模块,用于通过所述协议解释器调用移动终端相关功能,并进行数据处理;A processing module, used for invoking relevant functions of the mobile terminal through the protocol interpreter, and performing data processing;
返回模块,用于将处理的数据返回给所述应用程序。The returning module is used for returning the processed data to the application program.
本发明实施例的应用程序与移动终端之间通讯的装置,为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。The device for communication between the application program and the mobile terminal in the embodiment of the present invention provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
其中,所述调用信息包括:Wherein, the call information includes:
用于识别所述协议解释器的解释器标识符;an interpreter identifier for identifying said protocol interpreter;
接口,所述接口为所述移动终端相关功能的对应方法入口;an interface, where the interface is a corresponding method entry of related functions of the mobile terminal;
参数列表,所述参数列表为所述应用程序语言携带的数据信息。A parameter list, where the parameter list is data information carried by the application language.
此时,解释器标识符、接口及参数列表为后续操作提供了必要的数据需求,方便了操作。At this time, the interpreter identifier, interface, and parameter list provide the necessary data requirements for subsequent operations and facilitate operations.
其中,所述获取模块具体用于:Wherein, the acquisition module is specifically used for:
根据所述解释器标识符获取所述应用程序对应的协议解释器。Obtain the protocol interpreter corresponding to the application program according to the interpreter identifier.
此时,能在接收到应用程序语言的调用指令后,通过解释器标示符查找对应的协议解释器进行相关数据处理,方便了操作。At this time, after receiving the calling instruction of the application program language, the corresponding protocol interpreter can be searched through the interpreter identifier for relevant data processing, which facilitates the operation.
其中,所述处理模块包括:Wherein, the processing module includes:
调用模块,用于通过所述协议解释器及所述接口信息调用所述移动终端相关功能,并返回调用结果;A calling module, configured to call related functions of the mobile terminal through the protocol interpreter and the interface information, and return a call result;
处理子模块,用于根据所述参数列表对所述返回结果进行数据处理。The processing sub-module is configured to perform data processing on the returned result according to the parameter list.
此时,协议解释器能通过接口调用终端相关功能,并根据参数列表对调用结果进行数据处理,以返回应用程序所需数据。At this time, the protocol interpreter can call the relevant functions of the terminal through the interface, and perform data processing on the call result according to the parameter list, so as to return the data required by the application program.
进一步的,所述调用信息基于统一资源定位符URL语法进行定义;以及Further, the calling information is defined based on the Uniform Resource Locator URL syntax; and
所述调用信息还包括:The calling information also includes:
用于标识调用类别的协议头。Protocol header used to identify the class of the call.
此时,通过URL技术实现了多移动平台定义统一的协议机制,实现了跨移动语言平台的特性,且通过协议头可对本发明实施例的调用信息与其他调用进行区分,保证了操作的准确性。At this time, the unified protocol mechanism defined by multiple mobile platforms is realized through the URL technology, and the characteristics of cross-mobile language platforms are realized, and the call information of the embodiment of the present invention can be distinguished from other calls through the protocol header, ensuring the accuracy of the operation .
本发明实施例的应用程序与移动终端之间通讯的装置,为应用程序与移动终端之间的通讯提供了统一标准,实现了可复用性强,易扩展的目的。The device for communication between the application program and the mobile terminal in the embodiment of the present invention provides a unified standard for the communication between the application program and the mobile terminal, and realizes the purpose of strong reusability and easy expansion.
需要说明的是,该应用程序与移动终端之间通讯的装置是与上述应用程序与移动终端之间通讯的方法相对应的装置,其中上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到同样的技术效果。It should be noted that the device for communication between the application program and the mobile terminal is a device corresponding to the above method for communication between the application program and the mobile terminal, and all the implementation methods in the above method embodiments are applicable to the implementation of the device In the example, the same technical effect can also be achieved.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above description is a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, and these improvements and modifications can also be made. It should be regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410241208.2A CN105204824A (en) | 2014-05-30 | 2014-05-30 | Method and device for communication between application and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410241208.2A CN105204824A (en) | 2014-05-30 | 2014-05-30 | Method and device for communication between application and mobile terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105204824A true CN105204824A (en) | 2015-12-30 |
Family
ID=54952536
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410241208.2A Pending CN105204824A (en) | 2014-05-30 | 2014-05-30 | Method and device for communication between application and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105204824A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106648610A (en) * | 2016-10-24 | 2017-05-10 | 广州华多网络科技有限公司 | Function interface remote call method and device and function interface remote call response method and device |
CN106681734A (en) * | 2016-12-30 | 2017-05-17 | 广州华多网络科技有限公司 | Response method and device for function interface call |
CN107861713A (en) * | 2017-07-25 | 2018-03-30 | 平安普惠企业管理有限公司 | Data calling method, device and computer-readable recording medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6766350B1 (en) * | 1999-06-25 | 2004-07-20 | Canon Research Centre France S.A. | Shared management of data objects in a communication network |
CN103106102A (en) * | 2013-01-14 | 2013-05-15 | 百度在线网络技术(北京)有限公司 | Running method of Web application program and mobile terminal |
CN103457982A (en) * | 2012-06-05 | 2013-12-18 | 中兴通讯股份有限公司 | Method and device for interaction of mobile internet webpage and mobile terminal capacity |
-
2014
- 2014-05-30 CN CN201410241208.2A patent/CN105204824A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6766350B1 (en) * | 1999-06-25 | 2004-07-20 | Canon Research Centre France S.A. | Shared management of data objects in a communication network |
CN103457982A (en) * | 2012-06-05 | 2013-12-18 | 中兴通讯股份有限公司 | Method and device for interaction of mobile internet webpage and mobile terminal capacity |
CN103106102A (en) * | 2013-01-14 | 2013-05-15 | 百度在线网络技术(北京)有限公司 | Running method of Web application program and mobile terminal |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106648610A (en) * | 2016-10-24 | 2017-05-10 | 广州华多网络科技有限公司 | Function interface remote call method and device and function interface remote call response method and device |
CN106648610B (en) * | 2016-10-24 | 2019-12-31 | 广州华多网络科技有限公司 | Method and device for remotely calling and responding functional interface |
CN106681734A (en) * | 2016-12-30 | 2017-05-17 | 广州华多网络科技有限公司 | Response method and device for function interface call |
CN107861713A (en) * | 2017-07-25 | 2018-03-30 | 平安普惠企业管理有限公司 | Data calling method, device and computer-readable recording medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102118504B (en) | Methods and devices for calling local applications by means of mobile terminal browser | |
CN103873918B (en) | Image processing method, device and terminal | |
CN103309660B (en) | Mobile solution cross-platform development method | |
CN104821954B (en) | A kind of cross-platform remote procedure calling (PRC) method | |
CN104267972B (en) | Browser local interface extended method and device | |
CN103970760B (en) | A kind of web-page requests processing method and processing device | |
WO2012155678A1 (en) | Method and terminal for developing mobile phone application interface based on browser parsing manner | |
CN107229480A (en) | A kind of desktop application construction method and device based on web technology | |
CN103533428A (en) | Method for releasing intelligent terminal webpage video to television for broadcasting and intelligent terminal | |
CN104077162A (en) | Mobile terminal application template updating and issuing method and device | |
CN102799477A (en) | Resource access method and apparatus | |
CN103237083A (en) | Mobile information service resource aggregation system and mobile information service resource aggregation method | |
CN104954413B (en) | Method, system, ustomer premises access equipment and the server-side of the Internet, applications service are provided | |
CN105068802B (en) | A kind of Web application software realization system and method for striding equipment operation | |
CN113076294A (en) | Information sharing method and device | |
CN101807204B (en) | Dynamic creation method of processing Web service with remote sensing image | |
CN112015384A (en) | An interface mapping method and device | |
CN105204824A (en) | Method and device for communication between application and mobile terminal | |
CN103607454A (en) | Method for setting private proxy server for Android system browser | |
CN103457982B (en) | A kind of method and apparatus of mobile Internet webpage and capacity of mobile terminal interaction | |
CN101964742B (en) | Method, system and device for using network open ability | |
CN110555145A (en) | Browser-based webpage content acquisition system and acquisition method thereof | |
CN107239265B (en) | Binding method and device of Java function and C function | |
CN102523271B (en) | Terminal and communication method and system thereof | |
CN102546737A (en) | Wireless Internet gateway access system and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20151230 |