CN102739560B - Instant communication method, system and device - Google Patents

Instant communication method, system and device Download PDF

Info

Publication number
CN102739560B
CN102739560B CN201110092108.4A CN201110092108A CN102739560B CN 102739560 B CN102739560 B CN 102739560B CN 201110092108 A CN201110092108 A CN 201110092108A CN 102739560 B CN102739560 B CN 102739560B
Authority
CN
China
Prior art keywords
server
data
client
relay server
long
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.)
Active
Application number
CN201110092108.4A
Other languages
Chinese (zh)
Other versions
CN102739560A (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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201110092108.4A priority Critical patent/CN102739560B/en
Publication of CN102739560A publication Critical patent/CN102739560A/en
Application granted granted Critical
Publication of CN102739560B publication Critical patent/CN102739560B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses instant communication method, system and device: after user utilizes a client X to log in, client X sets up and is connected with the length between Relay Server; When user writes data at every turn, client X sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to operations server; Operations server is set up and is connected with short between Relay Server, and the data of write is passed through set up short connection and send to Relay Server; The data separate of write self is sent to instant communication server with long connection of setting up between instant communication server by Relay Server; After receiving instant communication server and returning to the data of client X, Relay Server utilizes long connection of setting up between self with client X that the data returned are sent to client X.Application the method for the invention, system and device, can saving network flow.

Description

Instant communication method, system and device
Technical field
The present invention relates to network technology, particularly instant communication method, system and device.
Background technology
In prior art, user can utilize various immediate communication tool, as Tencent QQ, microsoft network service (MSN, Microsoft Service Network) come to carry out communication with good friend etc.
Specifically, user utilizes client to carry out logging in rear client and can periodically (such as every 1s) set up and be connected with short between Relay Server, if receive the data returned, then Relay Server can utilize set up short connection to send it to client, otherwise notice client is without the data returned.For short connection, namely disconnect after a secondary data is sent, long connection then continuous several times can send data, connects therebetween and remains.
Can find out, in aforesaid way, even without the data returned, when arriving predetermined instant, also to set up between Relay Server short is connected for client, will send owing to not having data, this short connection reality is useless short connection, thus causes the waste of network wandering.
Summary of the invention
In view of this, main purpose of the present invention is to provide a kind of instant communication method, can saving network flow.
Another object of the present invention is to provide a kind of instant communicating system, can saving network flow.
Another object of the present invention is to provide a kind of client, can saving network flow.
Another object of the present invention is to provide a kind of Relay Server, can saving network flow.
For achieving the above object, technical scheme of the present invention is achieved in that
A kind of instant communication method, comprising:
After user utilizes a client X to log in, described client X sets up and is connected with the length between Relay Server;
When user writes data at every turn, described client X sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to described operations server; Described operations server is set up and is connected with short between described Relay Server, and the data of write is passed through set up short connection and send to described Relay Server; The data separate of write self is sent to described instant communication server with long connection of setting up between instant communication server by described Relay Server;
After receiving described instant communication server and returning to the data of described client X, described Relay Server utilizes long connection of setting up between self with described client X that the data returned are sent to described client X.
A kind of instant communicating system, comprising: client, Relay Server, operations server and instant communication server; Wherein, the number of described client is more than one;
Each client X, is respectively used to after user utilizes and self logs in, and sets up and is connected with long between described Relay Server; When user writes data at every turn, set up and be connected with short between described operations server, the data of write are passed through set up short connection and send to described operations server, and by receiving with long connection of setting up between described Relay Server the data that described instant communication server that described Relay Server sends returns to self;
Described operations server, for when after the data receiving write, sets up and is connected with short between described Relay Server, and the data of write is passed through set up short connection and send to described Relay Server;
Described Relay Server, for the data separate of write self is sent to described instant communication server with long connection of setting up between described instant communication server, and after receiving described instant communication server and returning to the data of described client X, utilize long connection of setting up between self with described client X that the data returned are sent to described client X.
A kind of client, comprising: the first processing unit and the second processing unit;
Described first processing unit, after utilizing as user and self logging in, sets up and is connected with long between Relay Server;
Described second processing unit, for when user writes data at every turn, sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to described operations server;
Described first processing unit is further used for, and receives by described long connection the data that instant communication server that described Relay Server sends returns to self.
A kind of Relay Server, comprising: the 3rd processing unit and fourth processing unit;
Described 3rd processing unit, for the short data being connected user's write that the described operations server of reception is sent by setting up between self with operations server, the data separate of write self is sent to described instant communication server with long connection of setting up between instant communication server;
Described fourth processing unit, for after receiving described instant communication server and returning to the data of any client, utilizes long connection of setting up between self with described client that the data returned are sent to described client.
Visible, adopt technical scheme of the present invention, client by obtaining with long connection of setting up between Relay Server the data that instant communication server returns to self, thus avoids and sets up useless short connection one after another, and then saves network traffics.
Accompanying drawing explanation
The flow chart of Fig. 1 instant communication method embodiment of the present invention.
Fig. 2 is that client X of the present invention sets up and the long process schematic be connected between Relay Server.
Fig. 3 is that Relay Server of the present invention is set up and the long process schematic be connected between instant communication server.
Fig. 4 is the composition structural representation of instant communicating system embodiment of the present invention.
Embodiment
For problems of the prior art, the instant messaging scheme after a kind of improvement is proposed in the present invention, can saving network flow.
For make technical scheme of the present invention clearly, understand, to develop simultaneously embodiment referring to accompanying drawing, scheme of the present invention be described in further detail.
The flow chart of Fig. 1 instant communication method embodiment of the present invention.As shown in Figure 1, comprise the following steps:
Step 11: after user utilizes a client X to log in, client X sets up and is connected with the length between Relay Server.
In the present embodiment, adopt the mode of HTML (Hypertext Markup Language) (HTTP, HyperText Transfer Protocol) long connecting analog socket communication.
Fig. 2 is that client X of the present invention sets up and the long process schematic be connected between Relay Server.As shown in Figure 2, comprising:
Step 201: client X sends link order to Relay Server.
Described link order can be GET/abc@qq.com HTTP/1.1.
Step 202: Relay Server returns welcome message to client X.
Described welcome message can be <script>hello (); </script>.
So far, connection establishment.
Step 12: when user writes data at every turn, client X sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to operations server; Operations server is set up and is connected with short between Relay Server, and the data of write is passed through set up short connection and send to Relay Server.
In the present embodiment, the read-write operation of user is separated, and the corresponding server disposing difference in functionality, i.e. operations server and Relay Server.
When user writes data at every turn, to set up between operations server short is connected for client X, by this short connection, the data of write sent to operations server; Operations server simply unpacks process to it after receiving the data of write, and sets up and be connected with short between Relay Server, and the data after unpacking are sent to Relay Server.
Step 13: the data separate of write self is sent to instant communication server with long connection of setting up between instant communication server by Relay Server.
Fig. 3 is that Relay Server of the present invention is set up and the long process schematic be connected between instant communication server.As shown in Figure 3, comprising:
Step 301: Relay Server sends link order to instant communication server.
Described link order can be USR abc@qq.com.
Step 302: instant communication server returns welcome message to Relay Server.
Described welcome message can be OK.
So far, connection establishment.
After data after what Relay Server received that operations server sends unpack, package again can be carried out to it, namely be encapsulated as the form meeting instant communication server requirement, and pass through set up long connection and send to instant communication server.
Follow-up, how instant communication server is treated to prior art to the data received.
Step 14: after receiving instant communication server and returning to the data of client X, Relay Server utilizes long connection of setting up between self with client X that the data returned are sent to client X.
In this step, Relay Server is by being connected with the length set up between client X, and data instant communication server being returned to client X send to client X.
In addition, in embodiment illustrated in fig. 1, in order to saving resource, Relay Server also periodically can travel through set up between self with each client all long and be connected, and for each long connection Y traversed, determines whether it is in disabled state respectively, if not, then do not deal with, if, then send to the long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect long connection Y, thus the resource discharged shared by it, if success, then do not deal with.
Wherein, for each long connection Y traversed, Relay Server can obtain its last active time, if the duration at interval is greater than the threshold value preset between this last active time and current time, then can determine that the long Y that connects is in disabled state (possible user's off-line).The concrete value of described threshold value can be decided according to the actual requirements.
Based on above-mentioned introduction, invention also provides a kind of instant communicating system.
Fig. 4 is the composition structural representation of instant communicating system embodiment of the present invention.As shown in Figure 4, comprising: client 41, Relay Server 42, operations server 43 and instant communication server 44; Wherein, the number of client 41 is more than one, namely one or more, for simplifying accompanying drawing, show but one in Fig. 4.
Each client X 41, is respectively used to after user utilizes and self logs in, and sets up and is connected with long between Relay Server 42; When user writes data at every turn, set up and be connected with short between operations server 43, the data of write are passed through set up short connection and send to operations server 43, and by receiving with long connection of setting up between Relay Server 42 data that instant communication server 44 that Relay Server 42 sends returns to self;
Operations server 43, for when after the data receiving write, sets up and is connected with short between Relay Server 42, and the data of write is passed through set up short connection and send to Relay Server 42;
Relay Server 42, for the data separate of write self is sent to instant communication server 44 with long connection of setting up between instant communication server 44, and after receiving instant communication server 44 and returning to the data of client X 41, utilize long connection of setting up between self with client X 41 that the data returned are sent to client X 41.
Above-mentioned Relay Server 42 also can be further used for, periodically travel through set up between self with each client 41 all long to be connected, for each long connection Y traversed, determine whether it is in disabled state respectively, if so, then send to the long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect long connection Y.
Invention also provides a kind of client, comprising: the first processing unit and the second processing unit;
Wherein, the first processing unit, after utilizing as user and self logging in, sets up and is connected with long between Relay Server;
Second processing unit, for when user writes data at every turn, sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to operations server;
Above-mentioned first processing unit is further used for, and receives by described long connection the data that instant communication server that Relay Server sends returns to self.
Invention also provides a kind of Relay Server, comprising: the 3rd processing unit and fourth processing unit;
Wherein, 3rd processing unit, for the short data being connected user's write that reception operations server is sent by setting up between self with operations server, the data separate of write self is sent to instant communication server with long connection of setting up between instant communication server;
Fourth processing unit, for after receiving instant communication server and returning to the data of any client, utilizes long connection of setting up between self with this client that the data returned are sent to this client.
In addition, also can comprise further in this Relay Server:
5th processing unit, be connected for periodically traveling through set up between self with each client all long, for each long connection Y traversed, determine whether it is in disabled state respectively, if so, then send to the long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect long connection Y.
Specifically, the 5th processing unit can obtain the long last active time connecting Y, if the duration at interval is greater than the threshold value preset between this last active time and current time, then determines that the long Y that connects is in disabled state.
The specific works flow process of said system and device embodiment please refer to the respective description in embodiment of the method shown in Fig. 1, repeats no more herein.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (9)

1. an instant communication method, is characterized in that, comprising:
After user utilizes a client X to log in, described client X sets up and is connected with the length between Relay Server;
When user writes data at every turn, described client X sets up and is connected with short between operations server, and the data of write is passed through set up short connection and send to described operations server; Described operations server is set up and is connected with short between described Relay Server, and the data of write is passed through set up short connection and send to described Relay Server; The data separate of write self is sent to described instant communication server with long connection of setting up between instant communication server by described Relay Server;
After receiving described instant communication server and returning to the data of described client X, described Relay Server utilizes long connection of setting up between self with described client X that the data returned are sent to described client X.
2. method according to claim 1, is characterized in that, the method comprises further:
Described Relay Server periodically travels through set up between self with each client all long and is connected, for each long connection Y traversed, determine whether it is in disabled state respectively, if, then send to the described long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect described long connection Y.
3. method according to claim 2, is characterized in that, the described each long connection Y for traversing, and determines whether it is in disabled state and comprises respectively:
Obtain the described long last active time connecting Y, if the duration at interval is greater than the threshold value preset between described last active time and current time, then determine that the described long Y that connects is in disabled state.
4. an instant communicating system, is characterized in that, comprising: client, Relay Server, operations server and instant communication server; Wherein, the number of described client is more than one;
Each client X, is respectively used to after user utilizes and self logs in, and sets up and is connected with long between described Relay Server; When user writes data at every turn, set up and be connected with short between described operations server, the data of write are passed through set up short connection and send to described operations server, and by receiving with long connection of setting up between described Relay Server the data that described instant communication server that described Relay Server sends returns to self;
Described operations server, for when after the data receiving write, sets up and is connected with short between described Relay Server, and the data of write is passed through set up short connection and send to described Relay Server;
Described Relay Server, for the data separate of write self is sent to described instant communication server with long connection of setting up between described instant communication server, and after receiving described instant communication server and returning to the data of described client X, utilize long connection of setting up between self with described client X that the data returned are sent to described client X.
5. system according to claim 4, it is characterized in that, described Relay Server is further used for, and periodically travels through set up between self with each client all long and is connected, for each long connection Y traversed, determine whether it is in disabled state respectively, if so, then send to the described long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect described long connection Y.
6. a client, is characterized in that, comprising: the first processing unit and the second processing unit;
Described first processing unit, after utilizing as user and self logging in, sets up and is connected with long between Relay Server;
Described second processing unit, for when user writes data at every turn, set up and be connected with short between operations server, and the data of write are passed through set up short connection and send to described operations server, so that described operations server utilizes and being shortly connected of setting up between described Relay Server, the data of write are sent to described Relay Server, and then by described Relay Server, the data separate of write self is sent to described instant communication server with long connection of setting up between instant communication server;
Described first processing unit is further used for, and receives by described long connection the data that instant communication server that described Relay Server sends returns to self.
7. a Relay Server, is characterized in that, comprising: the 3rd processing unit and fourth processing unit;
Described 3rd processing unit, for the short data being connected user's write that the described operations server of reception is sent by setting up between self with operations server, the data separate of write self is sent to described instant communication server with long connection of setting up between instant communication server;
Described fourth processing unit, for after receiving described instant communication server and returning to the data of any client, utilizes long connection of setting up between self with described client that the data returned are sent to described client.
8. Relay Server according to claim 7, is characterized in that, described Relay Server comprises further:
5th processing unit, be connected for periodically traveling through set up between self with each client all long, for each long connection Y traversed, determine whether it is in disabled state respectively, if so, then send to the described long Y of connection and wake instruction up, and determine whether to send successfully, if unsuccessful, then disconnect described long connection Y.
9. Relay Server according to claim 8, it is characterized in that, described 5th processing unit obtains the described long last active time connecting Y, if the duration at interval is greater than the threshold value preset between described last active time and current time, then determine that the described long Y that connects is in disabled state.
CN201110092108.4A 2011-04-13 2011-04-13 Instant communication method, system and device Active CN102739560B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110092108.4A CN102739560B (en) 2011-04-13 2011-04-13 Instant communication method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110092108.4A CN102739560B (en) 2011-04-13 2011-04-13 Instant communication method, system and device

Publications (2)

Publication Number Publication Date
CN102739560A CN102739560A (en) 2012-10-17
CN102739560B true CN102739560B (en) 2015-09-09

Family

ID=46994372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110092108.4A Active CN102739560B (en) 2011-04-13 2011-04-13 Instant communication method, system and device

Country Status (1)

Country Link
CN (1) CN102739560B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024056B (en) * 2012-12-17 2016-01-20 山东中创软件商用中间件股份有限公司 Data processing method, load equalizer and cloud system
WO2015180051A1 (en) * 2014-05-28 2015-12-03 华为技术有限公司 Data sending method and device
CN104486291B (en) * 2014-11-24 2018-08-17 北京奇安信科技有限公司 Establish the method, apparatus and system of connection
CN105991421A (en) * 2015-03-02 2016-10-05 中国移动通信集团贵州有限公司 Method, equipment and system for pushing message in group communication circle
CN104780171A (en) * 2015-04-15 2015-07-15 天脉聚源(北京)传媒科技有限公司 Message transferring method, device and system
CN106209951A (en) * 2015-05-08 2016-12-07 北京娜迦信息科技发展有限公司 Information transferring method, client and server
CN107529229B (en) * 2016-06-21 2021-08-31 中兴通讯股份有限公司 Data transmission method, device and system
CN106899652B (en) * 2016-07-20 2020-08-21 阿里巴巴集团控股有限公司 Method and device for pushing service processing result
CN107766035A (en) * 2016-08-18 2018-03-06 北京北信源软件股份有限公司 A kind of cross-platform instant messaging SDK access systems
CN110413676B (en) * 2019-07-25 2022-03-11 中国工商银行股份有限公司 Database access method and device, electronic equipment and medium
CN112422698B (en) * 2021-01-25 2021-06-22 游密科技(深圳)有限公司 Communication connection method, communication connection device, electronic equipment and storage medium
CN113783769B (en) * 2021-09-14 2023-07-25 阿波罗智能技术(北京)有限公司 Method and device for transmitting message in automatic driving and relay equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006126221A1 (en) * 2005-05-27 2006-11-30 Telecom Italia S.P.A. System and method for performing mobile services, in particular push and pull services, in a wireless communication network
CN101291348A (en) * 2008-06-12 2008-10-22 巴别塔(北京)科技有限公司 Prompt method for wireless channel awaking
CN101426181A (en) * 2008-11-12 2009-05-06 中国移动通信集团广东有限公司 Intelligent multimedia information mobile phone viewing system having instant interaction and implementation method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006126221A1 (en) * 2005-05-27 2006-11-30 Telecom Italia S.P.A. System and method for performing mobile services, in particular push and pull services, in a wireless communication network
CN101291348A (en) * 2008-06-12 2008-10-22 巴别塔(北京)科技有限公司 Prompt method for wireless channel awaking
CN101426181A (en) * 2008-11-12 2009-05-06 中国移动通信集团广东有限公司 Intelligent multimedia information mobile phone viewing system having instant interaction and implementation method

Also Published As

Publication number Publication date
CN102739560A (en) 2012-10-17

Similar Documents

Publication Publication Date Title
CN102739560B (en) Instant communication method, system and device
EP3208974A1 (en) Power line carrier communication terminal control device, system and method
CN104023020B (en) TypeB messages for mobile device subscribe to supplying system and correlation method
CN103916442A (en) Message pushing achieving method, mobile terminal and message pushing system
CN105991412B (en) Information push method and device
EP0909069A3 (en) System for reliable communication of object state updates over a computer network
CN103096271A (en) Information pushing system and information pushing method
CN103457843A (en) Communication method, communication system, relay gateway device, application server and client side
US20170085473A1 (en) OPENFLOW Communication Method and System, Controller, and Service Gateway
WO2001049047A3 (en) A messaging service
CN105119810A (en) Instant communication method based on XMPP protocol and system thereof
CN103095550A (en) Method, system and device for instant messaging
CN104937896A (en) Method for processing address resolution protocol message, forwarder and controller
CN102868609A (en) Maximum transmission unit consultation method and data terminal
CN105933435A (en) Real-time query method based on Internet of Things
CN102209039A (en) Method and equipment for transmitting file
CN103037000B (en) Publish-subscribe system and notification message processing method thereof
CN103516788A (en) Data pushing method and Flash client terminal and server thereof
CN101547214A (en) Method and network side equipment for pushing inside data of enterprise
CN103516766A (en) Method and system of communication between client-side and application server
CN102571868A (en) Instant messaging method, device and system
CN103533001A (en) Communication method and communication system based on HTTP multi-proxy, and intermediate proxy server
CN110417875B (en) Method, system, equipment and storage medium for docking between cloud servers
CN104734939A (en) Session keep-alive method and device
CN112714159A (en) Message forwarding method and device, storage medium and electronic device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200825

Address after: 518057 Nanshan District science and technology zone, Guangdong, Zhejiang Province, science and technology in the Tencent Building on the 1st floor of the 35 layer

Co-patentee after: TENCENT CLOUD COMPUTING (BEIJING) Co.,Ltd.

Patentee after: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Address before: Shenzhen Futian District City, Guangdong province 518044 Zhenxing Road, SEG Science Park 2 East Room 403

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right