CN104079707A - Communication method and electronic equipment - Google Patents

Communication method and electronic equipment Download PDF

Info

Publication number
CN104079707A
CN104079707A CN201310105253.0A CN201310105253A CN104079707A CN 104079707 A CN104079707 A CN 104079707A CN 201310105253 A CN201310105253 A CN 201310105253A CN 104079707 A CN104079707 A CN 104079707A
Authority
CN
China
Prior art keywords
data
server
submodule
processing module
internet
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
CN201310105253.0A
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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201310105253.0A priority Critical patent/CN104079707A/en
Publication of CN104079707A publication Critical patent/CN104079707A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a communication method and electronic equipment. The communication method is applied to the electronic equipment. The communication method comprises the following steps of: receiving a data access request, which is sent from an Internet application and is used for visiting a server; analyzing a content of the data access request; determining a processing module capable of processing the content of the data access request in an operating system; and establishing a bidirectional data channel with the server through the processing module.

Description

Communication means and electronic equipment
Technical field
The present invention relates to the field of electronic equipment, more specifically, the present invention relates to a kind of communication means and electronic equipment.
Background technology
Along with the development of mobile Internet, user can access the content on server on the Internet easily.For example, user can use such as the browser application accessed web page content easily on the mobile device of smart mobile phone etc.
But, on user's mobile device, can only be by the content on browser one direction accessing server.That is to say, in browser, can only realize one-way communication.
Therefore, expecting provides a kind of communication means and electronic equipment, and it can realize and the two-way communication of server in browser, thereby can expand the application type on browser, and can better save server resource and bandwidth and realize real time communication.
Summary of the invention
According to one embodiment of the invention, a kind of communication means is provided, be applied in electronic equipment, the method comprises:
Receive the data access request for access services device of sending from internet, applications;
Resolve the content of described data access request;
Determine in operating system the module of content that can processing said data access request; And
Bidirectional data path by described processing module foundation with server.
Preferably, described processing module is positioned at the intermediate layer of operating system, for receiving the described data access request of transmitting from internet, applications and being transferred to server, and receives the data of transmitting from server and is transferred to internet, applications.
Preferably, by the first submodule of described processing module, communicate with the communication module of operating system, and receive the content of the described data access request of transmitting by described communication module;
By the second submodule of described processing module, receive from the data of server transmission, and identify the port corresponding to data of this reception;
By described the first submodule, the data that receive are passed through to the communication module of this port transmission to operating system; And
By described communication module by the transfer of data of reception to internet, applications to show.
Preferably, record by the 3rd submodule of described processing module the bidirectional data path of having set up.
Preferably, described method also comprises:
After the bidirectional data path of foundation and server, automatic reception is from the pushed information of server transmission.
According to another embodiment of the present invention, a kind of electronic equipment is provided, comprising:
Internet, applications unit, for receiving the data access request of access services device;
Resolution unit, for resolving the content of described data access request;
Determining unit, for determining the processing module of the content that operating system can processing said data access request; And
Processing module unit, for setting up and the bidirectional data path of server.
Preferably, described processing module is positioned at the intermediate layer of operating system, for receiving the described data access request of transmitting from internet, applications unit and being transferred to server, and receives the data of transmitting from server and is transferred to internet, applications unit.
Preferably, described processing module also comprises:
The first submodule, for communicating with the communication module of operating system, and receives the content of the described data access request transmitted by described communication module;
The second submodule, for receiving from the data of server transmission, and identifies the port corresponding to data of this reception,
Wherein, described processing module is passed through the communication module of this port transmission to operating system by described the first submodule by the data that receive; And
By described communication module by the transfer of data of reception to internet, applications to show.
Preferably, described processing module also comprises the 3rd submodule, for recording the bidirectional data path of having set up.
Preferably, described processing module is after the bidirectional data path of foundation and server, and automatic reception is from the pushed information of server transmission.
Therefore,, according to communication means of the present invention and electronic equipment, can in internet, applications, realize and the two-way communication of server, thereby can expand the application type on browser, and can better save server resource and bandwidth and realize real time communication.
Brief description of the drawings
Fig. 1 describes according to the flow chart of the communication means of first embodiment of the invention;
Fig. 2 describes according to the schematic diagram of the processing module of first embodiment of the invention;
Fig. 3 describes according to the schematic diagram of the submodule of first embodiment of the invention;
Fig. 4 A-4C is the key diagram of the submodule in details drawing 3; And
Fig. 5 describes according to the functional block diagram of the electronic equipment of second embodiment of the invention.
Embodiment
Below, describe the preferred embodiments of the present invention in detail with reference to accompanying drawing.
Fig. 1 describes according to the flow chart of the communication means of first embodiment of the invention.
Be applied in electronic equipment according to the communication means 100 of first embodiment of the invention, this electronic equipment can be any electronic equipment, as long as this electronic equipment has network communications capability.The example of such electronic equipment comprises desktop computer, panel computer, smart mobile phone, intelligent television etc.
In addition, can be applicable to various operating system according to the communication means of first embodiment of the invention, preferably, can be applicable to the Mobile operating system such as Android, iOS etc.In this application, be described as example using Android operating system.
As shown in Figure 1, comprise according to the communication means 100 of first embodiment of the invention:
Step S101: receive the data access request for access services device of sending from internet, applications;
Step S102: the content of resolving described data access request;
Step S103: the module of determining in operating system content that can processing said data access request; And
Step S104: the bidirectional data path by described processing module foundation with server.
In step S101, receive the data access request for access services device of sending from internet, applications.Specifically, user starts after internet, applications (web application) in browser, and internet, applications can be called web socket interface, requires the server of certain particular web site of access, for example: http:// www.A.com/b.html.Then, browser can obtain this network address of access http:// www.A.com/b.htmlrequest.
Then, in step S102, the content of resolution data access request.Specifically, because initiated access network address in internet, applications in step S101 http:// www.A.com/b.htmlrequest, so browser need to resolve the content of this data access request be by web socket set up be connected with the data of far-end server.
In addition, the example of data access request can comprise the account on Telnet E-mail address, logon server, the account (as QQ, MSN, micro-letter account etc.) of log-in instant communication.
Then,, in step S103, determine in operating system the module of content that can processing said data access request.Specifically, as mentioned above, be applied to Android operating system as example using this communication means in this application, therefore, need to determine the module that can create socket (socket) in Android operating system, then by this module, set up internet, applications and be connected with the permanent of far-end server.Described processing module is positioned at the intermediate layer of operating system, for receiving the described data access request of sending from internet, applications from transmitting by browser and being transferred to server, and receive the data of transmitting from server and be transferred to internet, applications.For example, receive the message content returning from server, and process in internet, applications, then return to corresponding information.
Then, in step S104, the bidirectional data path by described processing module foundation with server.
Specifically, well-known, android operating system is used open source software webkit to be used as the resolver of browser.Use v8 engine as javascript resolver.Between them, contact by js interface module.
In addition, in webkit, developed the code of resolving for websocket, but how this part code to combine with android operating system, can use according to the communication means of the application the first embodiment.This webkit module can be as the example of the communication module of the system described in claim.At present, this webkit module can not realize the two-way communication of internet, applications and server.
For this reason, as shown in Figure 2, the application is all relevant to websocket mutual by providing an android http handler module to process, thereby realizes the two-way communication of internet, applications and server.This android http handler module is as the example of the described processing module in claim.
Specifically, as shown in Figure 3, this android http handler comprises three submodules: Socket Manager submodule, Socket Data Base submodule and Socket Hander submodule.
Operating system, by the first submodule of described processing module, communicates with the communication module of operating system, and receives the content of the described data access request of transmitting by described communication module.By the second submodule of described processing module, receive from the data of server transmission, and identify the port corresponding to data of this reception.By described the first submodule, the data that receive are passed through to the communication module of this port transmission to operating system.By described communication module by the transfer of data of reception to internet, applications to show.
Specifically, Socket Manager submodule and webkit module communicate, the handshake(that is responsible for websocket shakes hands), and the action of the websocket that parsing webkit calls or registers, for example new websocket, onmessage (), onopen (), close (), send () etc.In addition, the data that receive from server by Socket handler module are passed to webkit module by Socket Manager submodule.
Socket Data Base submodule is the database of being responsible for recording websocket, for recording the bidirectional data path of having set up.
Socket Hander submodule is responsible for receiving the data that pass over from server end, and which socket identification belong to, and the function that then calls corresponding websocket registration by Socket manager is processed.In addition, Socket Hander submodule by by Socket Manager submodule from webkit transmit transfer of data to server.
Socket Manager submodule is the example of the first submodule in claim, and Socket Data Base submodule is the example of the second submodule in claim, and Socket Hander submodule is the example of the 3rd submodule in claim.
Describe each submodule in detail with reference to Fig. 4 A-4C below.
As shown in Figure 4 A, in the time that Socket Manager submodule receives data input from webkit module, first determine that this data input is the data of which kind of type.
1) when data input is that New websocket(connects) time, Socket Manager submodule determines that internet, applications will connect with server.Now, the operation that Socket Manager submodule and server connect, and whether judgement connects successful.When connecting when successful, by the socket port of this bidirectional data path, the network address, agreement etc. content record in database.If unsuccessful, return to the information that instruction is failed.And carry out retry, successfully connect.
Specifically, when inputting network address in the internet, applications of user in browser http:// www.A.com/b.htmltime, Socket Manager submodule first determines that the port of server of this network address and address are whether in database.If do not existed, determine and need to connect with this server.
2) when data input is will send data to server time, Socket Manager submodule is inquired about socket port and the network address with destination server communication in database, and the port obtaining according to inquiry and network address transmission data.
Now, Socket Manager submodule is by network address http:// www.A.com/b.htmlsend to server, instruction will be obtained web page contents corresponding to this network address.
3) in the time receiving data from server, port identifiers is set in database, and calls onmessage function, the data of reception are sent to webkit module.
Now, when receiving network address from server http:// www.A.com/b.htmlcontent of pages time, call onmessage function, the data of reception are sent to webkit module, thereby in internet, applications, present network address http:// www.A.com/b.htmlcontent of pages.
4) in the time that data input is close port, Socket Manager submodule calls socket.onclose () function, thereby empties database.
As shown in Figure 4 B, Socket Data Base submodule comprises various functions, for recording the bidirectional data path of having set up.
In addition, as shown in Figure 4 C, Socket Hander submodule, in the time receiving data, first determines that this data input is the data of which kind of type.
1) when these data are that while sending data, these data are sent to server end by Socket Hander submodule.
2) when these data are that while receiving data, these data are sent to Socket Manager submodule by Socket Hander submodule.Then, send to webkit module by Socket Manager submodule.
3), in the time that these data are far-end close data, these data are sent to Socket Manager submodule by Socket Hander submodule.Then, by Socket Manager submodule close port.
Then, when internet, applications set up with the bidirectional data path of server after, can automatic reception from the pushed information of server transmission.For example, receive real-time data-pushing (stock market, weather forecast etc.) from the website of customization in advance.For example, above with website http:// www.A.comcontent of pages set up in the situation of two-way connection, the server of website can send the internet, applications in the various users' of pushing information to electronic equipment.For example, this internet, applications can be the plug-in unit small routine (plug-in program) in browser, and shows in real time the information such as stock market, weather forecast etc., and does not need user manually to go to website http:// www.A.comupper inquiry.
Alternately, can also realize real-time communication.For example, internet, applications and server only need to do an action of shaking hands, and then, have just formed an express passway between internet, applications and server.Transmit mutually with regard to directly carrying out data between the two.Now, the Header communicating with each other is very little, probably only has 2Bytes.In addition, internet, applications is querying server continually, thereby can save server resource and reduce bandwidth.
Therefore,, according to communication means of the present invention, can in internet, applications, realize and the two-way communication of server, thereby can expand the application type in internet, applications, and can better save server resource and bandwidth and realize real time communication.
< the second embodiment >
With reference to figure 5, the electronic equipment 200 according to second embodiment of the invention is described below.
Comprise according to the electronic equipment 200 of second embodiment of the invention:
Internet, applications unit 201, for receiving the data access request of access services device;
Resolution unit 202, for resolving the content of described data access request;
Determining unit 203, for determining the processing module of the content that operating system can processing said data access request; And
Processing module unit 204, for setting up and the bidirectional data path of server.
Preferably, described processing module 204 is positioned at the intermediate layer of operating system, for receiving the described data access request of transmitting from internet, applications unit and being transferred to server, and receive the data of transmitting from server and be transferred to internet, applications unit.
Preferably, described processing module 204 also comprises:
The first submodule 2041, for communicating with the communication module of operating system, and receives the content of the described data access request transmitted by described communication module;
The second submodule 2042, for receiving from the data of server transmission, and identifies the port corresponding to data of this reception,
Wherein, described processing module 204 is passed through the communication module of this port transmission to operating system by described the first submodule 2041 by the data that receive; And
By described communication module by the transfer of data of reception to internet, applications to show.
Preferably, described processing module 204 also comprises the 3rd submodule 2043, for recording the bidirectional data path of having set up.
Preferably, described processing module 204 is after the bidirectional data path of foundation and server, and automatic reception is from the pushed information of server transmission.
Therefore,, according to electronic equipment of the present invention, can in internet, applications, realize and the two-way communication of server, thereby can expand the application type on browser, and can better save server resource and bandwidth and realize real time communication.
It should be noted that embodiment is above only as example, the invention is not restricted to such example, but can carry out various variations.
It should be noted that, in this manual, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Finally, also it should be noted that, above-mentioned a series of processing not only comprise the processing of carrying out by time series with order described here, and comprise processing parallel or that carry out respectively instead of in chronological order.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add essential hardware platform by software and realize, and can certainly all implement by hardware.Based on such understanding, what technical scheme of the present invention contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM(read-only memory)/RAM(random access memory), magnetic disc, CD etc., comprise that some instructions (can be personal computers in order to make a computer equipment, server, or the network equipment etc.) carry out the method described in some part of each embodiment of the present invention or embodiment.
Above the present invention is described in detail, has applied specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept thereof; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.

Claims (10)

1. a communication means, is applied in electronic equipment, and the method comprises:
Receive the data access request for access services device of sending from internet, applications;
Resolve the content of described data access request;
Determine in operating system the processing module of content that can processing said data access request; And
Bidirectional data path by described processing module foundation with server.
2. the method for claim 1, wherein
Described processing module is positioned at the intermediate layer of operating system, for receiving the described data access request of transmitting from internet, applications and being transferred to server, and receives the data of transmitting from server and is transferred to internet, applications.
3. the method for claim 1, wherein
By the first submodule of described processing module, communicate with the communication module of operating system, and receive the content of the described data access request of transmitting by described communication module;
By the second submodule of described processing module, receive from the data of server transmission, and identify the port corresponding to data of this reception;
By described the first submodule, the data that receive are passed through to the communication module of this port transmission to operating system; And
By described communication module by the transfer of data of reception to internet, applications to show.
4. method as claimed in claim 3, wherein,
The 3rd submodule by described processing module records the bidirectional data path of having set up.
5. the method for claim 1, also comprises:
After the bidirectional data path of foundation and server, automatic reception is from the pushed information of server transmission.
6. an electronic equipment, comprising:
Internet, applications unit, for receiving the data access request of access services device;
Resolution unit, for resolving the content of described data access request;
Determining unit, for determining the processing module of the content that operating system can processing said data access request; And
Processing module unit, for setting up and the bidirectional data path of server.
7. electronic equipment as claimed in claim 6, wherein,
Described processing module is positioned at the intermediate layer of operating system, for receiving the described data access request of transmitting from internet, applications unit and being transferred to server, and receives the data of transmitting from server and is transferred to internet, applications unit.
8. electronic equipment as claimed in claim 6, wherein, described processing module also comprises:
The first submodule, for communicating with the communication module of operating system, and receives the content of the described data access request transmitted by described communication module;
The second submodule, for receiving from the data of server transmission, and identifies the port corresponding to data of this reception,
Wherein, described processing module is passed through the communication module of this port transmission to operating system by described the first submodule by the data that receive; And
By described communication module by the transfer of data of reception to internet, applications to show.
9. electronic equipment as claimed in claim 8, wherein, described processing module also comprises the 3rd submodule, for recording the bidirectional data path of having set up.
10. electronic equipment as claimed in claim 6, wherein, described processing module is after the bidirectional data path of foundation and server, and automatic reception is from the pushed information of server transmission.
CN201310105253.0A 2013-03-28 2013-03-28 Communication method and electronic equipment Pending CN104079707A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310105253.0A CN104079707A (en) 2013-03-28 2013-03-28 Communication method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310105253.0A CN104079707A (en) 2013-03-28 2013-03-28 Communication method and electronic equipment

Publications (1)

Publication Number Publication Date
CN104079707A true CN104079707A (en) 2014-10-01

Family

ID=51600745

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310105253.0A Pending CN104079707A (en) 2013-03-28 2013-03-28 Communication method and electronic equipment

Country Status (1)

Country Link
CN (1) CN104079707A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933766A (en) * 2016-01-21 2016-09-07 上海东方明珠新媒体股份有限公司 WebOS system based on set top box and set top box

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534419A (en) * 2009-04-17 2009-09-16 北京四创多元网络科技有限公司 Method for browsing pages in digital television and system thereof
CN102215259A (en) * 2011-05-31 2011-10-12 佘培嘉 Intelligent network household appliance system
CN102271123A (en) * 2010-06-01 2011-12-07 阿里巴巴集团控股有限公司 Communication method, system and equipment
CN102299967A (en) * 2011-09-08 2011-12-28 中兴通讯股份有限公司 Mobile position system, gateway, mobile terminal and method for realizing mobile position
CN102314502A (en) * 2011-09-01 2012-01-11 百度在线网络技术(北京)有限公司 Method and equipment for displaying webpage main content on mobile terminal
CN102413436A (en) * 2011-09-14 2012-04-11 华为技术有限公司 Method and system for transmitting information, and browser on mobile terminal
CN102685303A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Communication method and device
EP2860951A1 (en) * 2013-10-11 2015-04-15 Samsung Electronics Co., Ltd Communication service operating method and electronic device supporting the same

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101534419A (en) * 2009-04-17 2009-09-16 北京四创多元网络科技有限公司 Method for browsing pages in digital television and system thereof
CN102271123A (en) * 2010-06-01 2011-12-07 阿里巴巴集团控股有限公司 Communication method, system and equipment
CN102685303A (en) * 2011-03-09 2012-09-19 腾讯科技(深圳)有限公司 Communication method and device
CN102215259A (en) * 2011-05-31 2011-10-12 佘培嘉 Intelligent network household appliance system
CN102314502A (en) * 2011-09-01 2012-01-11 百度在线网络技术(北京)有限公司 Method and equipment for displaying webpage main content on mobile terminal
CN102299967A (en) * 2011-09-08 2011-12-28 中兴通讯股份有限公司 Mobile position system, gateway, mobile terminal and method for realizing mobile position
CN102413436A (en) * 2011-09-14 2012-04-11 华为技术有限公司 Method and system for transmitting information, and browser on mobile terminal
EP2860951A1 (en) * 2013-10-11 2015-04-15 Samsung Electronics Co., Ltd Communication service operating method and electronic device supporting the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933766A (en) * 2016-01-21 2016-09-07 上海东方明珠新媒体股份有限公司 WebOS system based on set top box and set top box

Similar Documents

Publication Publication Date Title
RU2498520C2 (en) Method of providing peer-to-peer communication on web page
KR101362384B1 (en) The method and system for browsing things of internet of things on ip using web platform
EP2487874A1 (en) Mobile broadband device and method for manageing mobile broadband device
CN104378399B (en) A kind of data push method, Platform Server, client and system
CN102158541B (en) Shared information acquisition method, device, mobile terminal and server
US20100257232A1 (en) Method of managing communication between an electronic token and a remote web server
CN106549989B (en) Data transmission method and system, user terminal and application server
CN104079597A (en) Transfer method of media stream and user equipment
CN112702336A (en) Security control method and device for government affair service, security gateway and storage medium
CN112261111A (en) Method and system for realizing cross-domain access of browser in application program
CN103207877A (en) Decoding method and device
CN102594886A (en) Method and device for direct communication between browsers, and communication system
CN112015383A (en) Login method and device
CN104753998A (en) Terminal, social application server and information sharing method
CN108880992A (en) Data transmission method, computer equipment and storage medium
US20140280853A1 (en) Mobile Broadband Device and Method for Processing Mobile Broadband Service of the Mobile Broadband Device
CN104079707A (en) Communication method and electronic equipment
CN110572476A (en) Remote control method, device and equipment
CN106487861B (en) Network data providing method and device
CN103914453A (en) Method and device for local resource access and electronic device
CN109600452B (en) Server cluster, message pushing method and related server
CN113992641A (en) Data processing method, device, equipment and storage medium
CN105915584A (en) Business request method based on proxy server and system
CN105323216A (en) Method and apparatus for transmitting communication links, and terminal
CN101917476A (en) Hyper text transmission protocol (HTTP) message processing method and client system thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141001