CN107222543A - A kind of mobile APP and the Web page means of communication and system - Google Patents

A kind of mobile APP and the Web page means of communication and system Download PDF

Info

Publication number
CN107222543A
CN107222543A CN201710445898.7A CN201710445898A CN107222543A CN 107222543 A CN107222543 A CN 107222543A CN 201710445898 A CN201710445898 A CN 201710445898A CN 107222543 A CN107222543 A CN 107222543A
Authority
CN
China
Prior art keywords
message
app
character string
serial number
communication
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.)
Granted
Application number
CN201710445898.7A
Other languages
Chinese (zh)
Other versions
CN107222543B (en
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.)
Beijing open space times Technology Co.,Ltd.
Original Assignee
Beijing Palm 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 Beijing Palm Technology Co Ltd filed Critical Beijing Palm Technology Co Ltd
Priority to CN201710445898.7A priority Critical patent/CN107222543B/en
Publication of CN107222543A publication Critical patent/CN107222543A/en
Application granted granted Critical
Publication of CN107222543B publication Critical patent/CN107222543B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network

Abstract

The present invention discloses a kind of mobile APP and the Web page means of communication, and it realizes the full duplex asynchronous communication of mobile APP and Web page, it is to avoid obstruction thread, does not interfere with the performance of mobile device.This mobile APP and the Web page means of communication, including:(1) primary API is packed, half-duplex is achieved and calls;(2) refusal readjustment, cancels synchronous obstruction;(3) self-defined communication serial number;(4) when receiving asynchronous returning result, handled respectively according to instruction type;(5) if the serial number of matching, it is determined that this message is the result of the asynchronous return for some instruction that APP was once sent, and jumps to step (4).

Description

A kind of mobile APP and the Web page means of communication and system
Technical field
The invention belongs to mobile APP technical field, more particularly to a kind of mobile APP and the Web page means of communication and System.
Background technology
Because mobile APP (application software i.e. on mobile terminal) will distinguish the equipment such as android, ios, therefore peace Full limitation is inconsistent with means of communication standard, and this allows for APP and the interaction of Web page is very cumbersome.
At present, APP and Web primary API (Application Programming Interface, application programming Interface) either simplex call method is only provided, i.e., " APP calls Web " or " Web calls APP ", and because this call is same step With can block thread, influence performance.In order to support complicated business scene and high performance requirements, needing realization badly, " APP and Web's is complete Duplexing asynchronous communication ".
The content of the invention
The technology of the present invention solves problem:The deficiencies in the prior art are overcome to lead to there is provided a kind of mobile APP and Web page Communication method, it realizes the full duplex asynchronous communication of mobile APP and Web page, it is to avoid obstruction thread, does not interfere with movement and sets Standby performance.
The present invention technical solution be:This mobile APP and the Web page means of communication, comprise the following steps:
(1) primary API is packed, half-duplex is achieved and calls;
(2) refusal readjustment, cancels synchronous obstruction;
(3) self-defined communication serial number;
(4) when receiving asynchronous returning result, handled respectively according to instruction type;
(5) if the serial number of matching, it is determined that this message is the asynchronous return for some instruction that APP was once sent Result, jump to step (4).
The present invention achieves half-duplex and called by packing primary API, refusal readjustment, cancels synchronous obstruction, self-defined Serial number is communicated, when receiving asynchronous returning result, is handled respectively according to instruction type, if the serial number of matching, it is determined that This message is the result of the asynchronous return for some instruction that APP was once sent and handled, it is achieved thereby that mobile APP with The full duplex asynchronous communication of Web page, it is to avoid obstruction thread, does not interfere with the performance of mobile device.
System in this way is additionally provided, it includes:
Module is packed, it configures to pack primary API, achieves half-duplex and calls;
Set and cancel module, it configures to refuse readjustment, cancel synchronous obstruction;
Serial number module is defined, it, which is configured, carrys out self-defined communication streams water number;
Processing module, it configures to receive during asynchronous returning result, handled respectively according to instruction type;
And if the serial number of matching, it is determined that this message is that the asynchronous of some instruction that APP was once sent is returned The result returned, is handled respectively according to instruction type.
Brief description of the drawings
Fig. 1 shows the mobile APP according to the present invention and the flow chart of the Web page means of communication.
Embodiment
As shown in figure 1, this mobile APP and the Web page means of communication, comprise the following steps:
(1) primary API is packed, half-duplex is achieved and calls;
(2) refusal readjustment, cancels synchronous obstruction;
(3) self-defined communication serial number;
(4) when receiving asynchronous returning result, handled respectively according to instruction type;
(5) if the serial number of matching, it is determined that this message is the asynchronous return for some instruction that APP was once sent Result, jump to step (4).
The present invention achieves half-duplex and called by packing primary API, refusal readjustment, cancels synchronous obstruction, self-defined Serial number is communicated, when receiving asynchronous returning result, is handled respectively according to instruction type, if the serial number of matching, it is determined that This message is the result of the asynchronous return for some instruction that APP was once sent and handled, it is achieved thereby that mobile APP with The full duplex asynchronous communication of Web page, it is to avoid obstruction thread, does not interfere with the performance of mobile device.
In addition, this method includes mobile APP end processing methods and Web page end processing method.
In addition, the mobile APP ends processing method includes sending out message to Web and receives the message from Web;
Comprise the following steps to Web hair message:
(a1) message object is switched into message character string;
(a2) it is message distribution communication serial number;
(a3) the embedded web browser handles of APP are obtained;
(a4) web browser handle acquiring communication is passed through;
(a5) communication serial number, message character string are transmitted to Web page;
The message from Web is received to comprise the following steps:
(b1) method that registration receives Web message;
(b2) message character string from Web is received;
(b3) message character string is parsed into JSON objects;
(b4) distribute and handle message;
(b5) if having found the message serial number of matching, this message is returned as asynchronous process
As a result handle.
In addition, Web page end processing method includes receiving the message from APP and sends out message to APP;
The message from APP is received to comprise the following steps:
(c1) message from APP is received according to agreement creation method;
(c2) message character string is received;
(c3) message serial number is recorded;
(c4) message character string is parsed into message object;
(c5) distribute and handle message;
Comprise the following steps to APP hair message:
(d1) method that message is sent to APP is created;
(d2) message object is obtained;
(d3) message object sequence is turned into message character string;
(d4) message character string is sent;
(d5) if related message serial number, message serial number collaboration message character string is sent together.
Can be with it will appreciated by the skilled person that realizing that all or part of step in above-described embodiment method is The hardware of correlation is instructed to complete by program, described program can be stored in a computer read/write memory medium, The program upon execution, includes each step of above-described embodiment method, and described storage medium can be:ROM/RAM, magnetic Dish, CD, storage card etc..Therefore, the method with the present invention is corresponding, and the present invention is also simultaneously including a kind of mobile APP and Web Page communication system, the system is generally represented in the form of the functional module corresponding with each step of method.Use this method System, it includes:
Module is packed, it configures to pack primary API, achieves half-duplex and calls;
Set and cancel module, it configures to refuse readjustment, cancel synchronous obstruction;
Serial number module is defined, it, which is configured, carrys out self-defined communication streams water number;
Processing module, it configures to receive during asynchronous returning result, handled respectively according to instruction type;And if The serial number matched somebody with somebody, it is determined that this message is the result of the asynchronous return for some instruction that APP was once sent, according to instruction type Handle respectively.
In addition, the system includes mobile APP end processing units and Web page end processing unit.
In addition, the mobile APP ends processing unit performs following steps:
Comprise the following steps to Web hair message:
(a1) message object is switched into message character string;
(a2) it is message distribution communication serial number;
(a3) the embedded web browser handles of APP are obtained;
(a4) web browser handle acquiring communication is passed through;
(a5) communication serial number, message character string are transmitted to Web page;
The message from Web is received to comprise the following steps:
(b1) method that registration receives Web message;
(b2) message character string from Web is received;
(b3) message character string is parsed into JSON objects;
(b4) distribute and handle message;
(b5) if having found the message serial number of matching, this message is handled as asynchronous process returning result.
In addition, Web page end processing unit performs following steps:
(c1) message from APP is received according to agreement creation method;
(c2) message character string is received;
(c3) message serial number is recorded;
(c4) message character string is parsed into message object;
(c5) distribute and handle message;
Comprise the following steps to APP hair message:
(d1) method that message is sent to APP is created;
(d2) message object is obtained;
(d3) message object sequence is turned into message character string;
(d4) message character string is sent;
(d5) if related message serial number, message serial number collaboration message character string is sent together.
It is described above, be only presently preferred embodiments of the present invention, any formal limitation not made to the present invention, it is every according to Any simple modification, equivalent variations and the modification made according to the technical spirit of the present invention to above example, still belong to the present invention The protection domain of technical scheme.

Claims (8)

1. a kind of mobile APP and the Web page means of communication, it is characterised in that:Comprise the following steps:
(1) primary API is packed, half-duplex is achieved and calls;
(2) refusal readjustment, cancels synchronous obstruction;
(3) self-defined communication serial number;
(4) when receiving asynchronous returning result, handled respectively according to instruction type;
(5) if the serial number of matching, it is determined that this message is the knot of the asynchronous return for some instruction that APP was once sent Really, step (4) is jumped to.
2. mobile APP according to claim 1 and the Web page means of communication, it is characterised in that:This method includes movement APP ends processing method and Web page end processing method.
3. mobile APP according to claim 2 and the Web page means of communication, it is characterised in that:At the mobile APP ends Cut method includes to Web hairs message and receives the message from Web;
Comprise the following steps to Web hair message:
(a1) message object is switched into message character string;
(a2) it is message distribution communication serial number;
(a3) the embedded web browser handles of APP are obtained;
(a4) web browser handle acquiring communication is passed through;
(a5) communication serial number, message character string are transmitted to Web page;
The message from Web is received to comprise the following steps:
(b1) method that registration receives Web message;
(b2) message character string from Web is received;
(b3) message character string is parsed into JSON objects;
(b4) distribute and handle message;
(b5) if having found the message serial number of matching, this message is handled as asynchronous process returning result.
4. mobile APP according to claim 3 and the Web page means of communication, it is characterised in that:At the Web page end Cut method includes receiving message from APP and to APP hair message;
The message from APP is received to comprise the following steps:
(c1) message from APP is received according to agreement creation method;
(c2) message character string is received;
(c3) message serial number is recorded;
(c4) message character string is parsed into message object;
(c5) distribute and handle message;
Comprise the following steps to APP hair message:
(d1) method that message is sent to APP is created;
(d2) message object is obtained;
(d3) message object sequence is turned into message character string;
(d4) message character string is sent;
(d5) if related message serial number, message serial number collaboration message character string is sent together.
5. a kind of mobile APP according to claim 1 and the system of the Web page means of communication, it is characterised in that:It is wrapped Include:
Module is packed, it configures to pack primary API, achieves half-duplex and calls;
Set and cancel module, it configures to refuse readjustment, cancel synchronous obstruction;
Serial number module is defined, it, which is configured, carrys out self-defined communication streams water number;
Processing module, it configures to receive during asynchronous returning result, handled respectively according to instruction type;
And if the serial number of matching, it is determined that this message is the asynchronous return for some instruction that APP was once sent As a result, handled respectively according to instruction type.
6. mobile APP according to claim 5 and Web page communication system, it is characterised in that:The system includes movement APP ends processing unit and Web page end processing unit.
7. mobile APP according to claim 6 and Web page communication system, it is characterised in that:At the mobile APP ends Manage unit and perform following steps:
Comprise the following steps to Web hair message:
(a1) message object is switched into message character string;
(a2) it is message distribution communication serial number;
(a3) the embedded web browser handles of APP are obtained;
(a4) web browser handle acquiring communication is passed through;
(a5) communication serial number, message character string are transmitted to Web page;
The message from Web is received to comprise the following steps:
(b1) method that registration receives Web message;
(b2) message character string from Web is received;
(b3) message character string is parsed into JSON objects;
(b4) distribute and handle message;
(b5) if having found the message serial number of matching, this message is handled as asynchronous process returning result.
8. mobile APP according to claim 7 and Web page communication system, it is characterised in that:At the Web page end Manage unit and perform following steps:
(c1) message from APP is received according to agreement creation method;
(c2) message character string is received;
(c3) message serial number is recorded;
(c4) message character string is parsed into message object;
(c5) distribute and handle message;
Comprise the following steps to APP hair message:
(d1) method that message is sent to APP is created;
(d2) message object is obtained;
(d3) message object sequence is turned into message character string;
(d4) message character string is sent;
(d5) if related message serial number, message serial number collaboration message character string is sent together.
CN201710445898.7A 2017-06-14 2017-06-14 Mobile APP and Web page communication method and system Active CN107222543B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710445898.7A CN107222543B (en) 2017-06-14 2017-06-14 Mobile APP and Web page communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710445898.7A CN107222543B (en) 2017-06-14 2017-06-14 Mobile APP and Web page communication method and system

Publications (2)

Publication Number Publication Date
CN107222543A true CN107222543A (en) 2017-09-29
CN107222543B CN107222543B (en) 2020-06-05

Family

ID=59948394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710445898.7A Active CN107222543B (en) 2017-06-14 2017-06-14 Mobile APP and Web page communication method and system

Country Status (1)

Country Link
CN (1) CN107222543B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990170A (en) * 2019-11-29 2020-04-10 广州市百果园信息技术有限公司 Data structure, communication method, device, storage medium and equipment
CN112995252A (en) * 2019-12-13 2021-06-18 阿里巴巴集团控股有限公司 Data transmission method, device, equipment and storage medium between page and client

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104135536A (en) * 2014-08-15 2014-11-05 浪潮电子信息产业股份有限公司 Data interaction method of Web management system based on Json data protocols
CN104378221A (en) * 2013-08-14 2015-02-25 沈阳中科博微自动化技术有限公司 Asynchronous calling method applied to integrated circuit production line monitoring system
CN105760405A (en) * 2014-12-19 2016-07-13 阿里巴巴集团控股有限公司 Methods and devices for obtaining network resource for loading web page and method and device for caching network resource
WO2017021123A1 (en) * 2015-08-03 2017-02-09 Siemens Aktiengesellschaft Method and system for providing information data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104378221A (en) * 2013-08-14 2015-02-25 沈阳中科博微自动化技术有限公司 Asynchronous calling method applied to integrated circuit production line monitoring system
CN104135536A (en) * 2014-08-15 2014-11-05 浪潮电子信息产业股份有限公司 Data interaction method of Web management system based on Json data protocols
CN105760405A (en) * 2014-12-19 2016-07-13 阿里巴巴集团控股有限公司 Methods and devices for obtaining network resource for loading web page and method and device for caching network resource
WO2017021123A1 (en) * 2015-08-03 2017-02-09 Siemens Aktiengesellschaft Method and system for providing information data

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990170A (en) * 2019-11-29 2020-04-10 广州市百果园信息技术有限公司 Data structure, communication method, device, storage medium and equipment
CN112995252A (en) * 2019-12-13 2021-06-18 阿里巴巴集团控股有限公司 Data transmission method, device, equipment and storage medium between page and client
CN112995252B (en) * 2019-12-13 2023-08-08 阿里巴巴集团控股有限公司 Method, device, equipment and storage medium for data transmission between page terminal and client terminal

Also Published As

Publication number Publication date
CN107222543B (en) 2020-06-05

Similar Documents

Publication Publication Date Title
CN104301443B (en) A kind of method and system that end ability interface is called on web page
CN105677335B (en) Improve the method and device that mobile terminal first powers on speed
JP6770063B2 (en) Methods and devices for implementing service functions
CN107870821B (en) Cross-platform calling method and system for application program
US9185077B2 (en) Isolation proxy server system
CN103179133B (en) Based on the client of entity class and the method for server communication
CN110417766A (en) A kind of method and apparatus of protocol analysis
CN109271125A (en) Screen display control method, device and the storage medium of split type terminal device
CN105487987B (en) A kind of concurrent sequence of processing reads the method and device of IO
CN107222543A (en) A kind of mobile APP and the Web page means of communication and system
US20150067013A1 (en) Methods for servicing web service requests using parallel agile web services and devices thereof
CN104768142A (en) Data communication method and terminal
CN104040995B (en) Multimedia redirection method, multimedia server, and computer system
CN104253788A (en) Data processing method and system, client, and page engine
WO2014206221A1 (en) Systems and methods for multi-device interaction
CN105718512A (en) Method for calling native language by using JS language in Ios system
CN108712320A (en) Information push method and device
CN107135167A (en) Data transmission method, data transmission device and server
CN106033551B (en) Data analysis method, apparatus and system
CN106412296B (en) Terminal equipment control method and device
CN108965905A (en) A kind of live data plug-flow and offer and the method, apparatus for obtaining plug-flow address
CN103685172B (en) Applications trigger method and apparatus, system
CN108667722A (en) Short message cancelling method, electronic device and computer readable storage medium
CN109946980A (en) Intelligent device management method, platform, system and computer readable storage medium
CN109995526A (en) A kind of storage method of key and the call method and device of device, key

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100070 No. 05, zone a, floor 1, No. 7, Kexing Road, Fengtai District, Beijing

Patentee after: Beijing open space times Technology Co.,Ltd.

Address before: Room 307, No. 7, Kexing Road, Fengtai District, Beijing 100029 (Park)

Patentee before: BEIJING ZHANGSHANG SHIHUI TECHNOLOGY Co.,Ltd.