CN102571376B - Method and system for implementing multi-window chat - Google Patents
Method and system for implementing multi-window chat Download PDFInfo
- Publication number
- CN102571376B CN102571376B CN201210042469.2A CN201210042469A CN102571376B CN 102571376 B CN102571376 B CN 102571376B CN 201210042469 A CN201210042469 A CN 201210042469A CN 102571376 B CN102571376 B CN 102571376B
- Authority
- CN
- China
- Prior art keywords
- sleep
- connects
- server
- liveness
- length
- 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.)
- Expired - Fee Related
Links
Landscapes
- Information Transfer Between Computers (AREA)
- Telephonic Communication Services (AREA)
Abstract
The invention provides a method and a system for implementing multi-window chat. The method comprises the following steps that: a server establishes at least one connection corresponding to user windows with a client; the server regularly calculates the activity of a connection which is not activated currently and sets the state of the connection which is not activated currently according to the activity; and if receiving the activate request of a sleeping connection transmitted by the client in the sleeping time of any sleeping connection, the server activates the sleeping connection.
Description
Technical field
The invention belongs to instant messaging field, relate in particular to a kind of implementation method and system of multi-window chat.
Background technology
Along with the continuous progress of Network Society, increasing network communication tool is applied in work and life, such as Fetion, MSN, QQ etc.In various communications applications instruments, because the instant messaging of webpage version does not need mounting software, easy to use, be subject to people's favor.In the daily use of webpage version instant messaging, when realizing a plurality of browser window chat, there is certain limitation.In the prior art, many browser window chats are not supported in the communication of part webpage version, such as having logged in after account at window 1, then log in same account at window 2, and the account of window 1 can be forced to roll off the production line.Or the chat of many browser windows is supported in the instant messaging of webpage version, but each window set up one with server and has been connected, and caused the waste of server resource.Under the prerequisite of making rational use of resources, how to realize under many browser windows and chatting, improve the convenient degree that user uses, become the problem that needs solution.
Summary of the invention
The invention provides a kind of implementation method and system of multi-window chat, to address the above problem.
The invention provides a kind of implementation method of multi-window chat.Said method comprises the following steps: server set up with client between at least one is connected corresponding with user window; Server regularly calculates the liveness of non-current activation connection and sets according to described liveness the state that non-current activation connects; If receive the activation request that the described sleep of client transmission connects in the length of one's sleep that server connects in arbitrary sleep, server activates described sleep and connects.
The present invention also provides a kind of system that realizes of multi-window chat, comprises client and server.Client connection server.Server comprises receiver, timer, calculator and processor, and receiver connects calculator, and calculator connects respectively processor and timer.Receiver for set up with client between at least one is connected corresponding with user window.Calculator is for regularly calculating the liveness of non-current activation connection and setting according to described liveness the state that non-current activation connects by timer.During activation request that processor connects for the described sleep that receives client in the length of one's sleep connecting in arbitrary sleep and send, activate described sleep and connect.
Compared to prior art, according to the implementation method of multi-window chat provided by the invention and system, server regularly calculates the liveness of non-current activation connection and sets according to described liveness the state that non-current activation connects.In addition, if receive the activation request that this sleep of client transmission connects in the length of one's sleep that server connects in any one sleep, activate this sleep and connect.If server does not receive the activation request of client within the described length of one's sleep, disconnect this sleep and connect; After surpassing the length of one's sleep of described sleep connection, client is initiated to connect the request of setting up to server again, and server is set up new connection.Server to the inactive connection calculating of the length of one's sleep, has kept only theactivewindow to have normal connection by regularly, has realized multi-window chat function, and has effectively avoided the waste of server resource.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms the application's a part, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Figure 1 shows that the flow chart of the implementation method of the multi-window chat that preferred embodiment according to the present invention provides;
Figure 2 shows that the schematic diagram of the system that realizes of the multi-window chat that preferred embodiment according to the present invention provides.
Embodiment
Hereinafter with reference to accompanying drawing, also describe the present invention in detail in conjunction with the embodiments.It should be noted that, in the situation that not conflicting, embodiment and the feature in embodiment in the application can combine mutually.
Figure 1 shows that the flow chart of the implementation method of the multi-window chat that preferred embodiment according to the present invention provides.The implementation method of the multi-window chat that as shown in Figure 1, preferred embodiment of the present invention provides comprises step 101~103.
Step 101: server set up with client between at least one is connected corresponding with user window.
Particularly, user opens after first browser window login in client, user end to server is initiated connection request, server is revised described user's state for obtaining described user's online friend information after online, and foundation first connection corresponding with first browser window of described client.For example, user opens the page www.ppmeet.com of video conferencing system login first, after server authentication user name password success, revise User Status for online and obtain described user's online friend information, server is successfully set up with first of client and is connected.In this, server returns to user's online friend information to first browser window of described client, and sends user's notice of reaching the standard grade to described user's online good friend.In addition, server receives the follow-up connection request of described client and sets up follow-up other while connecting, and client is obtained described user's online friend information from browser rs cache.
Step 102: server regularly calculates the liveness of non-current activation connection and sets according to described liveness the state that non-current activation connects.
In the present embodiment, when existing at least one to be connected between server and client, server regularly calculates the liveness that non-current activation connects, and sets the corresponding state connecting according to the liveness obtaining, for example, disconnect or sleep.Wherein, liveness is determined by the message number and the data traffic that connect in timing length, described timing length.Particularly, the table of comparisons that server prestores liveness and the length of one's sleep, and server determines according to the table of comparisons whether connection reaches sleep request.If connect, do not reach sleep request, server disconnects.The table of comparisons example of liveness and the length of one's sleep is as shown in the table.
Liveness | The length of one's sleep |
Liveness > 0.5 | 1800 seconds |
0.3 < liveness <=0.5 | 1200 seconds |
0.15 < liveness <=0.3 | 600 seconds |
0.01 < liveness <=0.15 | 300 seconds |
Liveness <=0.01 | Do not sleep, directly disconnect |
Wherein, described liveness has different account forms according to timing length.That is, when timing length is less than 1800 seconds, liveness=(the data traffic * 10 in the message count+timing length in timing length)/timing length; When timing length is more than or equal to 1800 seconds, liveness=(in 1800 seconds message count+1800 second in data traffic * 10)/1800.Wherein, message count and data traffic in 1800 seconds in above-mentioned 1800 seconds, be message count and the data traffic in 1800 seconds before the calculating constantly of liveness.Yet the present invention is not limited thereto.In other embodiment, message count and data traffic in 1800 seconds in described 1800 seconds, can be also message count mean value and the data traffic mean value of every 1800 seconds in timing length.In addition, the obtaining value method of described message count and data traffic, can arrange according to practical application, and the present invention is also not construed as limiting in this.In addition, the table of comparisons of above-mentioned liveness and the length of one's sleep can be set according to actual needs, and the present invention is also not limited to this.
For example, in the time of 10, between server and client, exist three to be connected A~C, wherein connect A in state of activation.If the timing of server is 1 hour (that is, 3600 seconds), server can be at 11 states that calculate current inactive connection.Particularly, if connect C in state of activation at 11, connect A and B in unactivated state, server can calculate and connect A and the liveness that is connected B.Wherein, because the timing length of server is greater than 1800 seconds, therefore connects A and the liveness that is connected B and calculate according to (in 1800 seconds message count+1800 second in data traffic * 10)/1800.For example, in 1800 seconds, user adds up to 500 by connecting the message of A sending and receiving, and the uninterrupted of described message is 0.5M, the data traffic that Video chat produces is 50M, and the liveness that connects A is: (500+ (50+0.5) * 10)/1800=0.56; User adds up to 200 by connecting the message of B sending and receiving, and the uninterrupted of described message is 0.2M, and the data traffic that Video chat produces is 20M, and the liveness that connects B is (200+ (20+0.2) * 10)/1800=0.22.Known according to the table of comparisons of above-mentioned liveness and the length of one's sleep, be 1800 seconds the length of one's sleep that connects A, and be 600 seconds the length of one's sleep that connects B.Afterwards, when reaching at 12, server calculates the connection of current unactivated state again.
Step 103: if receive the activation request that the described sleep of described client transmission connects in the length of one's sleep that server connects in arbitrary sleep, server activates described sleep and connects.
Particularly, if do not receive the activation request that the described sleep of client transmission connects in the length of one's sleep that server connects in sleep, server disconnects described sleep connection.If client surpasses the activation request that sends this sleep connection after the length of one's sleep that described sleep connects to described server, described server receives after described activation request and re-establishes with the new of described client and be connected.
The connection A of take described in step 102 is example, and server calculates and obtains the length of one's sleep that connects A in the time of 11 is 1800 seconds, if server received the activation request of the connection A that client sends in 1800 seconds, server activates and connects A.If A starts the 1809th second after sleep in connection, user end to server sends the activation request that connects A, and now, server has disconnected A, and server need to be set up with the new of client and be connected.
Figure 2 shows that the schematic diagram of the system that realizes of the multi-window chat that preferred embodiment according to the present invention provides.The system that realizes of the multi-window chat that as shown in Figure 2, preferred embodiment of the present invention provides comprises client 1 and server 2.Client 1 connection server 2.Server 2 comprises receiver 21, calculator 22, processor 23 and timer 24.Receiver 21 connects calculator 22, and calculator 22 connects processor 23 and timer 24.Receiver 21 for set up with client 1 between at least one is connected corresponding with user window.Calculator 22 is for regularly calculating the liveness of non-current activation connection and setting according to described liveness the state that non-current activation connects by timer 24.During activation request that processor 23 connects for the sleep that receives described client 1 in the length of one's sleep connecting in arbitrary sleep and send, activated sleep connects.About the specific operation process of said system with described in said method, therefore repeat no more in this.
In sum, the implementation method of the multi-window chat that preferred embodiment provides according to the present invention and system, server regularly calculates the liveness of non-current activation connection and sets according to described liveness the state that non-current activation connects.In addition, if receive the activation request that this sleep of client transmission connects in the length of one's sleep that server connects in any one sleep, activate this sleep and connect.If server does not receive the activation request of client within the described length of one's sleep, disconnect this sleep and connect; After surpassing the length of one's sleep of described sleep connection, client is initiated to connect the request of setting up to server again, and server is set up new connection.Server to the inactive connection calculating of the length of one's sleep, has kept only theactivewindow to have normal connection by regularly, has realized multi-window chat function, and has effectively avoided the waste of server resource.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.
Claims (6)
1. an implementation method for multi-window chat, is characterized in that, comprises the following steps:
Server set up with client between at least one is connected corresponding with user window;
Described server regularly calculates the liveness of non-current activation connection and sets according to described liveness the state that non-current activation connects; Wherein, the state that described non-current activation connects is sleep or disconnection, and sets the length of one's sleep that sleep connects;
If receive the activation request that the described sleep of described client transmission connects in the length of one's sleep that described server connects in arbitrary sleep, described server activates described sleep and connects;
Wherein, described liveness is determined by the message number and the data traffic that connect in timing length, described timing length;
When if timing length is less than 1800 seconds, liveness=(the data traffic * 10 in the message count+timing length in timing length)/timing length; When timing length is more than or equal to 1800 seconds, liveness=(in 1800 seconds message count+1800 second in data traffic * 10)/1800; Wherein, message count and data traffic in 1800 seconds in above-mentioned 1800 seconds, be message count and the data traffic in 1800 seconds before the calculating constantly of liveness.
2. method according to claim 1, is characterized in that, if described server does not receive the activation request that client sends within the length of one's sleep in dormant connection, described server disconnects described sleep connection.
3. method according to claim 2, it is characterized in that, if described client sends activation request to described server after surpassing the length of one's sleep that described sleep connects, described server receives after described activation request and re-establishes with the new of described client and be connected.
4. method according to claim 1, it is characterized in that, the table of comparisons that described server prestores liveness and the length of one's sleep, described server is set described non-current activation connection status according to the described table of comparisons, if described non-current activation connects, do not reach described sleep request, described server disconnects described non-current activation and connects.
5. method according to claim 1, it is characterized in that, described server is set up with after first of described client is connected, described server returns to described client by described user's online friend information, described server is set up after other is connected with described client, and described client is obtained the online friend information of described user from browser rs cache.
6. the system that realizes of a multi-window chat, it is characterized in that, comprise client and server, described client connects described server, described server comprises receiver, timer, calculator and processor, described receiver connects described calculator, and described calculator connects respectively described processor and described timer
Described receiver, for set up with client between at least one is connected corresponding with user window,
Described calculator, for regularly calculating the liveness of non-current activation connection by described timer and setting according to described liveness the state that non-current activation connects, wherein, the state that described non-current activation connects is sleep or disconnection, and sets the length of one's sleep that sleep connects;
Described processor, when receiving the activation request that described sleep that described client sends connects in the length of one's sleep connecting in arbitrary sleep, activates described sleep and connects;
Wherein, described liveness is determined by the message number and the data traffic that connect in timing length, described timing length;
When if timing length is less than 1800 seconds, liveness=(the data traffic * 10 in the message count+timing length in timing length)/timing length; When timing length is more than or equal to 1800 seconds, liveness=(in 1800 seconds message count+1800 second in data traffic * 10)/1800; Wherein, message count and data traffic in 1800 seconds in above-mentioned 1800 seconds, be message count and the data traffic in 1800 seconds before the calculating constantly of liveness.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210042469.2A CN102571376B (en) | 2012-02-24 | 2012-02-24 | Method and system for implementing multi-window chat |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210042469.2A CN102571376B (en) | 2012-02-24 | 2012-02-24 | Method and system for implementing multi-window chat |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102571376A CN102571376A (en) | 2012-07-11 |
CN102571376B true CN102571376B (en) | 2014-12-03 |
Family
ID=46415914
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210042469.2A Expired - Fee Related CN102571376B (en) | 2012-02-24 | 2012-02-24 | Method and system for implementing multi-window chat |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102571376B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102594732B (en) * | 2012-02-17 | 2015-01-21 | 苏州阔地网络科技有限公司 | Method and system for multiwindow chatting |
CN104766256B (en) * | 2015-04-13 | 2018-08-24 | 天脉聚源(北京)教育科技有限公司 | A kind of method and device of determining liveness |
CN105610950B (en) * | 2015-12-30 | 2020-07-24 | 腾讯科技(深圳)有限公司 | Conversation processing method and system in motorcade trip |
CN106534132B (en) * | 2016-11-17 | 2021-05-18 | 京东方科技集团股份有限公司 | Video processing method, device, server and system based on taxi taking order |
CN110011791B (en) * | 2019-02-18 | 2021-07-09 | 西安电子科技大学 | D2D-based electronic credential secure circulation method and system and electronic credential system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101009670A (en) * | 2007-01-22 | 2007-08-01 | 阿里巴巴公司 | A method and system for implementing the group communication based on the instant communication |
CN101188577A (en) * | 2007-12-29 | 2008-05-28 | 腾讯科技(深圳)有限公司 | Multi-page instant communication method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7380218B2 (en) * | 2003-03-27 | 2008-05-27 | International Business Machines Corporation | Method and apparatus for managing windows |
-
2012
- 2012-02-24 CN CN201210042469.2A patent/CN102571376B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101009670A (en) * | 2007-01-22 | 2007-08-01 | 阿里巴巴公司 | A method and system for implementing the group communication based on the instant communication |
CN101188577A (en) * | 2007-12-29 | 2008-05-28 | 腾讯科技(深圳)有限公司 | Multi-page instant communication method and system |
Also Published As
Publication number | Publication date |
---|---|
CN102571376A (en) | 2012-07-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102710554B (en) | The service state detection method of distributed information system and distributed information system | |
US9712632B2 (en) | Method for receiving data, method for sending data, mobile terminal, and server | |
CN102571376B (en) | Method and system for implementing multi-window chat | |
US10834031B2 (en) | Information exchange method, client, and apparatus | |
CN102684949B (en) | Method and device for processing heartbeat data packet under persistent connection, and client | |
CN102238108B (en) | Off-line message transmission method | |
CN103001860A (en) | Achieving system for converged communication Web instant messages | |
EP2942988B1 (en) | Method and device for group information sending | |
CN102185801A (en) | Information processing method in instant messaging and instant messaging tool | |
CN1972252A (en) | A method for maintaining communication connection in mobile instant communication | |
CN103312528A (en) | Heartbeat message sending method and user terminal | |
CN101594320A (en) | A kind of method for message interaction based on snmp protocol | |
CN101252499A (en) | Mail server dynamic state polling method for checking whether mail server has new mail arrive or not | |
CN104468380A (en) | Interface communication method of access point device and server interaction | |
CN103491512A (en) | Implementation method and device for information pushing | |
CN102185701A (en) | Method and system for realizing group information interaction | |
CN103312586B (en) | A kind of method of instant messaging, system and server | |
CN103516766A (en) | Method and system of communication between client-side and application server | |
CN104486819A (en) | Wireless network access method and system | |
CN102594731B (en) | Method and system for realizing multi-window chatting | |
CN101699911A (en) | Mobile instant messaging image compression method | |
CN102594894B (en) | Multi-window chatting method and system | |
CN102594732B (en) | Method and system for multiwindow chatting | |
CN101436953B (en) | Management method and processing module for on-line announcement message of network appliance | |
CN103023746A (en) | IM (Instant Messaging) system and drawing board implementation method based on same |
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 | ||
C56 | Change in the name or address of the patentee | ||
CP01 | Change in the name or title of a patent holder |
Address after: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee after: CODYY EDUCATION TECHNOLOGY Co.,Ltd. Address before: Suzhou City, Jiangsu province 215121 Fengting Avenue Suzhou Industrial Park No. 666 Weiting Intelligent Industrial Park Building 8 Patentee before: SUZHOU CODYY NETWORK SCIENCE & TECHNOLOGY Co.,Ltd. |
|
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20141203 |
|
CF01 | Termination of patent right due to non-payment of annual fee |