TW201131379A - Real-time communication method, system and apparatus - Google Patents

Real-time communication method, system and apparatus Download PDF

Info

Publication number
TW201131379A
TW201131379A TW99106786A TW99106786A TW201131379A TW 201131379 A TW201131379 A TW 201131379A TW 99106786 A TW99106786 A TW 99106786A TW 99106786 A TW99106786 A TW 99106786A TW 201131379 A TW201131379 A TW 201131379A
Authority
TW
Taiwan
Prior art keywords
server
login
client
attribute information
address
Prior art date
Application number
TW99106786A
Other languages
Chinese (zh)
Other versions
TWI502375B (en
Inventor
jian-xiang Mo
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to TW099106786A priority Critical patent/TWI502375B/en
Publication of TW201131379A publication Critical patent/TW201131379A/en
Application granted granted Critical
Publication of TWI502375B publication Critical patent/TWI502375B/en

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The present invention discloses a real-time communication method for solving the data interruption problem in the existing technology, namely the user end cannot automatically reconnect when losing communication with the registry server, The disclosed method includes: the first registry server receiving a registration request from the user end and carries out the real-time communication with the user end; when the real-time communication between the first registry server and the user end is interrupted, the registry distribution server is to obtain the IP address of the second registry server and sends out to the user end; the second registry server receives the interruption re-connecting command sent from the user end, and after the second registry server completes verification and approves the interruption re-connecting command, it then carries out the real-time communication with the user end.

Description

201131379 六、發明說明: 【發明所屬之技術領域】 本發明係關於即時通信技術領域,特別關於一種即時 通信的方法、系統及裝置。 【先前技術】 作爲通過網際網路和他人聯繫的一種方式,即時通信 系統(IM,Instant Message)已經得到廣泛應用。在目前 的即時通信系統包括:用戶端和伺服器端,其中,伺服器 端可以包括多台伺服器,例如:登錄分配伺服器,登錄伺 服器,資料庫伺服器。一般情況下,一個用戶只能登錄一 台登錄伺服器,即一台用戶端只能對應一台登錄伺服器’ 但一台登錄伺服器可以爲多台用戶端服務。參見圖1,用 戶的登錄過程包括: 步驟101:用戶端接收用戶輸入的用戶名,密碼等用 戶端帳戶資訊。 步驟102:用戶端向登錄分配伺服器請求待登錄伺服 器的位址列表。 步驟1 03 :用戶端從請求得到的待登錄伺服器的位址 列表中確定一個登錄伺服器的位址。 步驟1 04 :用戶端根據確定的登錄伺服器的位址,向 該登錄伺服器發送登錄請求。其中登錄請求包括:用戶端 帳戶資訊、以及用戶端生成的唯一的隨機資訊,即用戶端 密鑰 Key-Client。 201131379 步驟105:登錄伺服器接收到登錄請求後,對該登錄 請求進行驗證,當登錄請求通過驗證時,執行步驟106; 否則執行步驟108。 步驟106:登錄伺服器根據接收到的Key-Client,生成 另一個對應的隨機資訊,也就是伺服器密鑰Key-Server, 向用戶端返回驗證通過資訊,該驗證通過資訊包括Key-Server,並在記憶體中保存用戶端的屬性資訊,屬性資訊 包括:用戶端帳戶資訊,以及 步驟1 07 :用戶端根據接收到的驗證通過資訊,進入 即時通信過程中,並把接收到的Key-Client保存到記億體 中〇 步驟108:登錄伺服器向用戶端返回驗證失敗資訊。 即用戶端登錄失敗。 當用戶端登錄成功,進入即時通信過程中,伺服器端 的資料庫伺服器會記錄該用戶的即時通信資訊。 在即時通信過程中,當登錄伺服器因某種原因停止服 務的時候,例如:硬體故障或者手工停機維修,用戶端就 會失去與伺服器之間的會話,並退回到登錄介面,提示用 戶重新登錄。用戶必須向用戶端發送重新登錄的命令後’ 用戶端才能得到新的登錄伺服器位址,並向新的登錄伺服 器位址發送包括新Key-Client的重新登錄請求,驗證通過 後用戶端才能繼續即時通信過程,這樣,由於登錄伺服$ 停止服務,導致該登錄伺服器服務的所有用戶端斷線’影 響了用戶端的正常操作。並且,當同一時刻’所有斷線用 -6- 201131379 戶端重新登錄伺服器端時,也會給伺服器端帶來嚴重的負 荷壓力。 【發明內容】 本發明實施例提供一種即時通信的方法、系統及裝置 ,用以解決現有技術用戶端與登錄伺服器失去會話時,不 能自動重連,造成資料中斷的問題。 本發明實施例提供一種即時通信的方法,包括: 第一登錄伺服器接收用戶端的登錄請求,與所述用戶 端進行即時通信: 當所述第一登錄伺服器與所述用戶端的即時通信中斷 時,登錄分配伺服器獲取第二登錄伺服器的位址倂發送給 所述用戶端,所述第二登錄伺服器接收所述用戶端發送的 斷線重連命令; 當所述第二登錄伺服器對所述斷線重連命令進行校驗 通過後,與所述用戶端進行即時通信。 本發明實施例提供一種即時通信的方法,包括: 登錄伺服器接收到用戶端發送的斷線重連命令後,獲 取所述用戶端的第一屬性資訊; 所述登錄伺服器解析所述斷線重連命令,得到所述用 戶端的第二屬性資訊; 將所述第二屬性資訊與第一屬性資訊進行比對,當兩 者匹配時,對所述斷線重連命令進行驗證,當驗證通過時 ,向所述用戶端發送校驗通過消息’並與所述用戶端進行 201131379 即時通信。 本發明實施例提供一種即時通信的系統,包括: 第一登錄伺服器,用於接收用戶端的登錄請求,與所 述用戶端進行即時通信; 登錄分配伺服器,用於當所述第一登錄伺服器與所述 用戶端的即時通信中斷時,獲取第二登錄伺服器的位址倂 發送給所述用戶端; 第二登錄伺服器,用於接收所述用戶端發送的斷線重 連命令,對所述斷線重連命令進行校驗,當校驗通過時, 與所述用戶端進行即時通信》 本發明實施例提供一種即時通信的登錄伺服器,包括 接收單元,用於接收用戶端發送的斷線重連命令; 校驗單元,用於對接收的斷線重連命令進行校驗; 發送單元,用於向所述用戶端發送校驗回應消息。 本發明實施例提供一·種即時通信的用戶端,包括: 獲取單元,用於當與第一登錄伺服器即時通信中斷時 ,獲取第二登錄伺服器的位址; 發送單元,用於根據所述第二登錄伺服器的位址,向 所述第二登錄伺服器發送斷線重連命令; 接收單元,用於接收所述第二登錄伺服器對所述斷線 重連命令進行校驗,返回的校驗回應資訊。 本發明實施例中,第一登錄伺服器接收用戶端的登錄 請求,與所述用戶端進行即時通信,當所述第一登錄伺服 -8 - 201131379 器與所述用戶端的即時通信中斷時,登錄分配伺服器獲取 第二登錄伺服器的位址倂發送給所述用戶端,所述第二登 錄伺服器接收所述用戶端發送的斷線重連命令,當所述第 二登錄伺服器對所述斷線重連命令進行校驗通過後,與所 述用戶端進行即時通信。從而,當登錄伺服器因某種原因 停止服務的時候,用戶端失去與伺服器之間的會話後,並 不直接退回登錄介面,而是發起斷線重連過程,實現登錄 伺服器之間的自動切換,不會造成即時通信資料的中斷。 【實施方式】 本發明實施例中即時通信系統包括用戶端和伺服器端 ,其中,伺服器端可以包括多台伺服器,參見圖2,即時 通信系統包括:用戶端,登錄分配伺服器、登錄伺服器, 資料庫伺服器以及資訊儲存伺服器,其中,用戶端與一個 登錄伺服器進行即時通信。在這樣的即時通信系統中,當 用戶端與登錄伺服器的即時通信中斷後,用戶端可以自動 切換登錄到另外一台登錄伺服器,從而不會造成用戶端與 伺服器端之間資料丟失。參見圖3,本發明實施例中即時 通信的過程包括: 步驟301:用戶端登錄第一登錄伺服器,與第一登錄 伺服器進行即時通信。 這裏,用戶端接收到用戶輸入的用戶名、密碼等用戶 端帳戶資訊後,向登錄分配伺服器發送分配位址請求,登 錄分配伺服器根據該請求,獲取待登錄伺服器的第一位址 -9 - 201131379 列表,登錄分配伺服器獲取到第一位址列表後,也就是獲 取到可以登錄的部分登錄伺服器的位址列表後,從獲得的 第一位址列表中確定一個位址爲第一登錄伺服器的位址, 並將第一登錄伺服器的位址發送給用戶端,從而,用戶端 根據確定的第一登錄伺服器的位址,向第一登錄伺服器發 送登錄請求。其中登錄請求包括:用戶端帳戶資訊,以及 用戶端密鑰Key-Client。Key-Client是用戶端生成的唯一 的隨機資訊。 第一登錄伺服器接收到登錄請求後,對該登錄請求進 行驗證,當登錄請求通過驗證時,根據接收到的Key-Client,生成伺服器密鑰Key-Server,向用戶端返回驗證 通過資訊,該驗證通過資訊包括Key- Server,並在記憶體 中保存用戶端的第一屬性資訊,並將第一屬性資訊發送給 資訊儲存伺服器,其中,第一屬性資訊包括:用戶端帳戶 資訊,以及對應的Key-Server。Key-Server是第一登錄伺 服器根據收到的Key-Client,生成另一個對應的隨機資訊 ,也是唯一識別用戶端登錄狀態的資訊。 用戶端根據接收到的驗證通過資訊,與第一登錄伺服 器進行即時通信,並把接收到的Key- Server保存到記憶體 中〇 在即時通信的過程中,與該用戶相關的即時通信資訊 存入資料庫伺服器中。 步驟302:用戶端檢查到與第一登錄伺服器即時通信 中斷時,獲取第二登錄伺服器的位址。 -10- 201131379 當用戶端檢查到與第一登錄伺服器即時通信中 及時將要發送給第一登錄伺服器的資料存入緩存區 後向登錄分配伺服器發送分配位址請求,登錄分配 根據該請求,獲取待登錄伺服器的第二位址列表, 配伺服器獲取到第二位址列表後,也即是獲取到可 的部分登錄伺服器的位址列表後,從第二位址列表 一個位址作爲所述第二登錄伺服器的位址,並將第 伺服器的位址發送給用戶端;或登錄分配伺服器直 驟3 0 1中獲取的第一位址列表中再確定一個位址作 第二登錄伺服器的位址。這裏,第二登錄伺服器的 以與第一登錄伺服器的位址一致,即第二登錄伺月艮 就是第一登錄伺服器,當然,第二登錄伺服器的位 以與第一登錄伺服器的位址不一致。 這裏,用戶端將要發送給第一登錄伺服器的資 緩存區中後,還可以首先嘗試與第一登錄伺服器進 重連過程,當用戶端與第一登錄伺服器斷線重連失 再向登錄分配伺服器獲取待登錄伺服器的第二位址 從所述第二位址列表中確定一個位址爲所述第二登 器的位址,或再從步驟3 0 1中獲取的第一位址列表 定一個位址爲所述第二登錄伺服器的位址。這裏, 錄伺服器的位址與第一登錄伺服器的位址不一致。 步驟3 03 :用戶端向第二登錄伺服器發送斷線 令。斷線重連命令中攜帶了用戶端的第二屬性資訊 ,第二屬性資訊包括了第一登錄伺服器返回的Key- 斷後, 中,妖 I /I>N 伺服器 登錄分 以登錄 中確定 二登錄 接從步 爲所述 位址可 器可以 址也可 料存入 行斷線 敗後, 列表, 錄伺服 中再確 第二登 重連命 ,其中 Server -11 - 201131379 ,以及用戶端帳戶資訊。將這些資訊進行加密發送給第二 登錄伺服器。 步驟3 04 :第二登錄伺服器獲取所述用戶端的第一屬 性資訊。 這裏,第二登錄伺服器檢查本地記憶體中是否有用戶 端的第一屬性資訊,如本地記億體中有所述第一屬性資訊 時,則從本地記憶體中獲取用戶端的第一屬性資訊,否則 ,從資訊儲存伺服器中獲取用戶端的第一屬性資訊。 當第二登錄伺服器與第一登錄伺服器一致時,就可以 在本地記億體中查找到用戶端的第一屬性資訊,因此,第 二登錄伺服器直接從本地記億體中獲取用戶端的第一屬性 資訊。 當第二登錄伺服器與第一登錄伺服器不一致時,則第 二登錄伺服器的本地記憶體中沒有用戶端的第一屬性資訊 ,因此,第二登錄伺服器只能從資訊儲存伺服器中獲取用 戶端的第一屬性資訊。 步驟3 0 5 :第二登錄伺服器根據獲取的第一屬性資訊 ,對接收的斷線重連命令進行校驗,校驗通過後,執行步 驟306。否則,執行步驟3 08。 這裏’第二登錄伺服器首先解析接收的斷線重連命令 ’得到其攜帶的用戶端的第二屬性資訊,然後將步驟3〇4 中獲取的第一屬性資訊與解析得到的第二屬性資訊進行比 對’兩者一致’則對斷線重連命令進行驗證,驗證通過後 ,執行步驟306,驗證不能通過時,重連失敗,執行步驟 -12- 201131379 308。當兩者不一致,則不需對斷線重連 直接執行步驟3 08。 步驟3 06 :第二登錄伺服器從後臺的 獲取該用戶相關的即時通信資訊,並向用 過資訊,該校驗通過資訊也可以包括Key-當步驟304中,第二登錄伺服器是從 中獲取用戶端的第一屬性資訊,這裏,第 向用戶端返回校驗通過資訊前,還需將獲 一屬性資訊保存到第二登錄伺服器的本地 步驟3 07 ··用戶端根據接收到的校驗 二登錄伺服器進行即時通信。 用戶端接收到校驗通過資訊,也就是 用戶端將緩存區中的資料發送給第二登錄 時通信。在即時通信的過程中,與該用戶 通信資訊仍舊存入後臺的資料庫伺服器中 步驟3 08 :第二登錄伺服器向用戶端 訊。 步驟3 09 :用戶端接收到校驗失敗資 錄介面。也就是斷線重連失敗,需要用戶 錄,重新連接的過程了。 當然’本發明實施例中,登錄分配伺 伺服器的位址列表,可以通過定期給所有 命令,當接收到登錄伺服器返回的回應資 錄伺服器爲可登錄的伺服器,將該登錄伺 命令進行驗證, 資料庫伺服器中 戶端返回校驗通 Server ° 資訊儲存伺服器 二登錄伺服器在 取的用戶端的第 記憶體中。 通過資訊,與第 斷線重連成功, 伺服器,進行即 相關的新的即時 〇 返回校驗失敗資 訊後,退回到登 手動進行重新登 服器獲取待登錄 登錄伺服器發送 訊時,確定該登 服器的位址加入 -13- 201131379 到位址列表中。 這樣,登錄分配伺服器可以按順序從獲取的位址列表 中,選擇一個位址爲登錄伺服器的位址,也可以在獲取的 位址列表中,隨機選擇一個位址爲登錄伺服器的位址,還 可以在獲取的位址列表中,按照其他設定的規則選擇一個 位址爲登錄伺服器的位址。 由上所述,本發明實施例中,當登錄伺服器因某種原 因停止服務的時候,例如:硬體故障或則手工停機維修, 用戶端失去與伺服器之間的會話後,並不直接退回登錄介 面,而是發起斷線重連過程,實現登錄伺服器之間的自動 切換,從而不會造成用戶端與伺服器端之間資料丟失,也 不會由於多台用戶端同時重新登錄,對登錄伺服器造成壓 力過大。 下面結合說明書附圖對本發明實施例作進一步詳細描 述。 實施例一,參見圖4,即時通信的過程包括: 步驟401:用戶端登錄第一登錄伺服器,與第一登錄 伺服器進行即時通信。 用戶端登錄第一登錄伺服器時,在第一登錄伺服器的 本地記憶體中保存了用戶端的第一屬性資訊,同樣在遠端 的資訊儲存伺服器中也保存了用戶端的第一屬性資訊,其 中,第一屬性資訊包括:用戶端帳戶資訊,以及對應的 Key-S erver。在即時通信的過程中,與該用戶相關的即時 通信資訊存入後臺的資料庫伺服器中。 -14- 201131379 步驟402 :用戶端檢查到與第一登錄伺服器即時通信 中斷時,將待發送資料存入緩存區,並向登錄分配伺服器 發送位址分配請求。 ’ 步驟403 :登錄分配伺服器接收到位址分配請求後, 獲取待登錄伺服器的第二位址列表,確定一個位址爲所述 第二登錄伺服器的位址,並向用戶端發送第二登錄伺服器 的位址。 步驟404 :用戶端根據確定的位址,向第二登錄伺服 器發送斷線重連命令。斷線重連命令中攜帶了用戶端的第 二屬性資訊,即包括第一登錄伺服器返回的Key- Server, 以及用戶端帳戶資訊。用戶端將這些資訊加密後發送給第 二登錄伺服器。 步驟405:第二登錄伺服器檢查本地記憶體中是否有 用戶端的第一屬性資訊,如果有,執行步驟406 ;否則執 行步驟407。 步驟406 :第二登錄伺服器從本地記憶體中獲取用戶 端的第一屬性資訊,轉入執行409。 步驟4〇7 :第二登錄伺服器訪問遠端的資訊儲存伺服 器,檢查該資訊儲存伺服器中是否有用戶端的第一屬性資 訊,如果有,執行步驟408 ;否則執行步驟4 1 3。 步驟40 8:第二登錄伺服器從資訊儲存伺服器中獲取 用戶端的第一屬性資訊,執行步驟409。 步驟409 :第二登錄伺服器解析接收到的斷線重連命 令,將其攜帶的用戶端的第二屬性資訊與獲得的用戶端的 -15- 201131379 第一屬性資訊進行比較,當兩者一致,進行步驟4 1 0,否 則,執行步驟4 1 3 步驟4 1 0 :第二登錄伺服器對接收的斷線重連命令進 行驗證,驗證通過後,執行步驟4 1 1 ;否則,執行步驟4 1 3 〇 步驟4 1 1 :第二登錄伺服器從後臺的資料庫伺服器中 獲取該用戶相關的即時通信資訊,並向用戶端返回校驗通 過資訊,該校驗通過資訊也可以包括Key- Server。 當第二登錄伺服器是從資訊儲存伺服器中獲取用戶端 的第一屬性資訊,這裏,還需將獲取的用戶端的第一屬性 資訊保存到第二登錄伺服器的本地記憶體中。 步驟4 1 2 :用戶端根據接收到的校驗通過資訊,與第 二登錄伺服器進行即時通信。 用戶端接收到校驗通過資訊,也就是斷線重連成功, 用戶端將緩存區中的資料發送給第二登錄伺服器,進行即 時通信。在即時通信的過程中,與該用戶相關的新的即時 通信資訊仍舊存入後臺的資料庫伺服器中。 步驟413:第二登錄伺服器向用戶端返回校驗失敗資 訊》 步驟4 1 4 :用戶端接收到校驗失敗資訊後,退回到登 錄介面。也就是斷線重連失敗,需要用戶手動進行重新登 錄,重新連接的過程了。 實施二、參見圖5,即時通信的過程包括: 步驟501 :用戶端登錄第一登錄伺服器,與第一登錄 -16- 201131379 伺服器進行即時通信。 用戶端登錄第一登錄伺服器時,在第一登錄伺服器的 本地記憶體中保存了用戶端的第一·屬性資訊,同樣在遠端 的資訊儲存伺服器中也保存了用戶端的第一屬性資訊,其 中,第一屬性資訊包括:用戶端帳戶資訊,以及對應的 Key-Server。在即時通信的過程中,與該用戶相關的即時 通信資訊存入後臺的資料庫伺服器中。 步驟502 :用戶端檢查到與第一登錄伺服器即時通信 中斷時,將待發送資料存入緩存區,用戶端嘗試與第一登 錄伺服器斷線重連,當用戶端與第一登錄伺服器斷線重連 成功,則用戶端繼續與第一登錄伺服器即時通信,否則, 執行步驟5 0 3。 步驟5 03 :用戶端向登錄分配伺服器發送位址分配請 求。 步驟504 :登錄分配伺服器接收到位址分配請求後, 獲取待登錄伺服器的第二位址列表,確定一個位址爲所述 第二登錄伺服器的位址,並向用戶端發送第二登錄伺服器 的位址。 用戶端已經與第一登錄伺服器重連嘗試失敗了,這裏 ,第二伺服器的位址與第一伺服器的位址不一致。 步驟505:用戶端根據確定的位址,向第二登錄伺服 器發送斷線重連命令。斷線重連命令中攜帶了用戶端的第 二屬性資訊,即包括第一登錄伺服器返回的Key- Server ’ 以及用戶端帳戶資訊。用戶端將這些資訊加密後發送給第 -17- 201131379 二登錄伺服器。 步驟5 0 6 :第二登錄伺服器檢查本地記憶體中是否有 用戶端的第一屬性資訊,如果有,執行步驟5 07 ;否則執 行步驟5 0 8。 本實施例中,用戶端與第一登錄伺服器的斷線重連已 失敗,這裏,第二登錄伺服器不能在本地記憶體中查找到 用戶端的第一屬性資訊,執行步驟5 08。 步驟5 07 :第二登錄伺服器從本地記憶體中獲取用戶 端的第一屬性資訊,轉入執行5 1 0。 步驟508 :第二登錄伺服器訪問遠端的資訊儲存伺服 器,檢查該資訊儲存伺服器中是否有用戶端的第一屬性資 訊,如果有,執行步驟5 09 ;否則執行步驟514。 步驟5 09 :第二登錄伺服器從資訊儲存伺服器中獲取 用戶端的第一屬性資訊,執行步驟5 1 0。 步驟5 1 0 :第二登錄伺服器解析接收到的斷線重連命 令’將其攜帶的用戶端的第二屬性資訊與獲得的用戶端的 第一屬性資訊進行比較,當兩者一致,進行步驟5 1 1,否 則,執行步驟5 1 4 步驟511··第二登錄伺服器對接收的斷線重連命令進 行驗證,驗證通過後,執行步驟5 1 2 ;否則,執行步驟5 1 4 〇 步驟5 1 2 :第二登錄伺服器從後臺的資料庫伺服器中 獲取該用戶相關的即時通信資訊,並向用戶端返回校驗通 過資訊’該校驗通過資訊也可以包括Key- Server。 -18- 201131379 本實施例中,第二登錄伺服器是從資訊儲存伺服器中 獲取用戶端的第一屬性資訊,這裏,還需將獲取的用戶端 的第一屬性資訊保存到第二登錄伺服器的本地記憶體中。 步驟5 1 3 :用戶端根據接收到的校驗通過資訊,與第 二登錄伺服器進行即時通信。 用戶端接收到校驗通過資訊,也就是斷線重連成功, 用戶端將緩存區中的資料發送給第二登錄伺服器,進行即 時通信。在即時通信的過程中,與該用戶相關的新的即時 通信資訊仍舊存入後臺的資料庫伺服器中。 步驟514:第二登錄伺服器向用戶端返回校驗失敗資 訊。 步驟5 1 5 :用戶端接收到校驗失敗資訊後,退回到登 錄介面。也就是斷線重連失敗,需要用戶手動進行重新登 錄,重新連接的過程了。 上述實施例中,用戶端與第一登錄伺服器即時通信中 斷後,用戶端都是向登錄分配伺服器發送位址分配請求, 登錄分配伺服器接收到位址分配請求後,獲取待登錄伺服 器的第二位址列表,確定一個位址爲所述第二登錄伺服器 的位址。本發明實施例中,登錄分配伺服器還可以從獲得 的第一位址列表中,確定一個位址爲所述第二登錄伺服器 的位址,具體實施過程就不再累述。 參見圖6,在本發明實施例中的即時通信系統,包括 :第一登錄伺服器1〇〇,登錄分配伺服器200和第二登錄伺 服器3 00。其中, -19" 201131379 第一登錄伺服器1 00,用於接收用戶端的登錄請求, 與所述用戶端進行即時通信。 登錄分配伺服器200,用於當第一登錄伺服器100與用 戶端的即時通信中斷時,獲取第二登錄伺服器3 00的位址 倂發送給所述用戶端。 第二登錄伺服器300,用於接收所述用戶端發送的斷 線重連命令,對所述斷線重連命令進行校驗,當校驗通過 時,與所述用戶端進行即時通信。 其中,登錄分配伺服器200,還用於獲取待登錄伺服 器的第一位址列表,並從所述第一位址列表中確定所述第 一登錄伺服器的位址發送給用戶端。 第一登錄伺服器1〇〇,還用於接收用戶端發送的登錄 請求,對所述登錄請求進行驗證,當驗證通過時,將用戶 端1 00的第一屬性資訊存入本地記憶體中,並將所述第一 屬性資訊發送給資訊儲存伺服器,其中,所述登錄請求包 括:用戶端帳戶資訊,以及用戶端密鑰,所述第一屬性資 訊包括:所述用戶端帳戶資訊,以及根據所述用戶端密鑰 生成的伺服器密鑰,並向用戶端返回包括所述伺服器密鑰 的驗證通過資訊。因此,所述系統還包括:資訊儲存伺服 器400,用於儲存所述用戶端的屬性資訊。 登錄分配伺服器200,還用於獲取待登錄伺服器的第 二位址列表。則從所述第二位址列表中確定第二登錄伺服 器3 00的位址,還可以從所述第一位址列表中確定第二登 錄伺服器3 00的位址。 -20- 201131379 這樣,第二登錄伺服器300,用於獲取用戶端的第一 屬性資訊,並解析接收的斷線重連命令,得到用戶端的第 二屬性資訊,將所述第一屬性資訊與第二屬性資訊進行比 對,當兩者匹配時,對所述斷線重連命令進行驗證,當驗 證通過時,向用戶端返回校驗通過消息。 其中,第二登錄伺服器3 00在獲取用戶端的第一屬性 資訊時,檢查本地記憶體中是否有用戶端的第一屬性資訊 ,當所述本地記憶體中有所述第一屬性資訊時,從所述本 地記憶體中獲取用戶端的第一屬性資訊,否則,從資訊儲 存伺服器400中獲取用戶端的第一屬性資訊。 當然,本發明實施例中,參見圖7,應用於本發明實 施例即時通信系統中的用戶端包括:獲取單元7 1 0、發送 單元720、接收單元7 3 0。 獲取單元710,用於當與第一登錄伺服器即時通信中 斷時,獲取第二登錄伺服器的位址。 發送單元720,用於根據所述第二登錄伺服器的位址 ’向所述第二登錄伺服器發送斷線重連命令。 接收單元730,用於接收所述第二登錄伺服器對所述 斷線重連命令進行校驗,返回的校驗回應資訊。 其中,獲取單元7 1 〇,還用於獲取登錄分配伺服器從 待登錄伺服器的第一位址列表確定的第一登錄伺服器的位 址。 發送單元720,還用於根據所述第一登錄伺服器的位 址,向第一登錄伺服器發送登錄請求,其中,所述登錄請 -21 - 201131379 求包括:用戶端帳戶資訊,以及用戶端密鑰。 接收單元730,還用接收所述第一登錄伺服器對所述 登錄請求進行驗證,返回的驗證回應消息。 獲取單元710,還用於獲取登錄分配伺服器從所述第 —位址列表中確定的所述第二登錄伺服器的位址。 當然,獲取單元710還可以直接獲取登錄分配伺服器 從待登錄伺服器的第二位址列表中確定的所述第二登錄伺 服器的位址。 參見圖8,應用於本發明實施例即時通信系統中的登 錄伺服器包括:接收單元810、校驗單元820和發送單元 83 0 ° 接收單元810,用於接收用戶端發送的斷線重連命令 t 校驗單元8 2 0,用於對接收的斷線重連命令進行校驗 » 發送單元8 3 0,用於向所述用戶端發送校驗回應消息 〇 接收單元810,還用於接收所述用戶端發送的登錄請 求,所述登錄請求包括:用戶端帳戶資訊’以及用戶端密 鑰;校驗單元820 ’還用於對所述登錄請求進行驗證;發 送單元8 30,還用於當驗證通過時’將所述用戶端的第一 屬性資訊存入本地記憶體中’以及將所述第一屬性資訊發 送資訊儲存伺服器’其中’所述第一屬性資訊包括:所述 用戶端帳戶資訊,以及根據所述用戶端密输生成的伺服器 -22- 201131379 密鑰,並向所述用戶端發送包括所述伺服器密鑰的驗證通 過消息。 本發明實施例中校驗單元820可以包括獲取子單元, 解析子單元以及匹配驗證子單元,其中, 獲取子單元,用於獲取所述用戶端的第一屬性資訊。 解析子單元,用於解析所述斷線重連命令,得到用戶 端的第二屬性資訊。 匹配驗證子單元,用於將所述第一屬性資訊與第二屬 性資訊進行比對,當兩者匹配時,對所述斷線重連命令進 行驗證。 獲取子單元首先檢查本地記憶體中是否儲存所述用戶 端的第一屬性資訊,當本地記憶體中保存所述第一屬性資 訊,從本地記憶體中獲取所述第一屬性資訊,當本地記憶 體中沒有保存所述第一屬性資訊,從資訊儲存伺服器中獲 取所述用戶端的第一屬性資訊。 綜上所述,本發明實施例中,第一登錄伺服器接收用 戶端的登錄請求,與所述用戶端進行即時通信,當所述第 一登錄伺服器與所述用戶端的即時通信中斷時,登錄分配 伺服器獲取第二登錄伺服器的位址倂發送給所述用戶端, 所述第二登錄伺服器接收所述用戶端發送的斷線重連命令 ,當所述第二登錄伺服器對所述斷線重連命令進行校驗通 過後,與所述用戶端進行即時通信。從而,當登錄伺服器 因某種原因停止服務的時候,例如··硬體故障或則手工停 機維修,用戶端失去與伺服器之間的會話後,並不直接退 -23- 201131379 回登錄介面’而是發起斷線重連過程,實現登錄伺服器之 間的自動切換,不會造成用戶端與伺服器端之間資料丟失 ,也不會影響用戶體驗。 本發明是參照根據本發明實施例的方法、設備(系統 )、和電腦程式產品的流程圖和/或方框圖來描述的。應 理解可由電腦程式指令實現流程圖和/或方框圖中的每一 流程和/或方框、以及流程圖和/或方框圖中的流程和/ 或方框的結合。可提供這些電腦程式指令到通用電腦、專 用電腦、嵌入式處理機或其他可編程資料處理設備的處理 器以產生一個機器,使得通過電腦或其他可編程資料處理 設備的處理器執行的指令產生用於實現在流程圖一個流程 或多個流程和/或方框圖一個方框或多個方框中指定的功 能的裝置。 這些電腦程式指令也可儲存在能引導電腦或其他可編 程資料處理設備以特定方式工作的電腦可讀記憶體中,使 得儲存在該電腦可讀記憶體中的指令產生包括指令裝置的 製造品’該指令裝置實現在流程圖一個流程或多個流程和 /或方框圖一個方框或多個方框中指定的功能。 這些電腦程式指令也可裝載到電腦或其他可編程資料 處理設備上,使得在電腦或其他可編程設備上執行一系列 操作步驟以產生電腦實現的處理,從而在電腦或其他可編 程設備上執行的指令提供用於實現在流程圖一個流程或多 個流程和/或方框圖一個方框或多個方框中指定的功能的 步驟。 -24- 201131379 顯然,本領域的技術人員可以對本發明進行各種改動 和變型而不脫離本發明的精神和範圍。這樣,倘若對本發 明的這些修改和變型屬於本發明之申請專利範圍及其等同 技術的範圍之內,則本發明也意圖包含這些改動和變型在 內。 【圖式簡單說明】 圖1爲現有技術中用戶端登錄的流程圖; 圖2爲本發明實施例中即時通信系統的架構圖; 圖3爲本發明實施例中即時通信的流程圖; 圖4爲本發明第一實施例中即時通信的流程圖; 圖5爲本發明第二實施例中即時通信的流程圖; 圖6爲本發明實施例中即時通信系統的具體架構圖; 圖7爲本發明實施例中用戶端的結構圖; 圖8爲本發明實施例中登錄伺服器的結構圖。 【主要元件符號說明】 100 :第一登錄伺服器 2〇〇 :登錄分配伺服器 3〇〇 :第二登錄伺服器 40〇 :資訊儲存伺服器 7 1 0 :獲取單元 7 2 0 :發送單元 7 3 0 :接收單元 -25- 201131379 8 1 0 :接收單元 8 2 0 :校驗單元 8 3 0 :發送單元201131379 VI. Description of the invention:  TECHNICAL FIELD OF THE INVENTION The present invention relates to the field of instant messaging technology. Especially with regard to a method of instant messaging, System and device.  [Prior Art] As a way to connect with others through the Internet, Instant messaging system (IM, Instant Message has been widely used. The current instant messaging systems include: Client and server, among them, The server can include multiple servers. E.g: Log in to the distribution server, Log in to the server, Database server. In general, A user can only log in to one login server. That is, one client can only correspond to one login server', but one login server can serve multiple clients. See Figure 1, The user login process includes:  Step 101: The client receives the username entered by the user. User account information such as passwords.  Step 102: The client requests a list of addresses of the server to be logged in to the login assignment server.  Step 1 03: The client determines the address of a login server from the address list of the server to be queried that is requested.  Step 1 04 : The client is based on the determined address of the login server. Send a login request to the login server. The login request includes: Client account information, And the unique random information generated by the client. That is, the client key Key-Client.  201131379 Step 105: After the login server receives the login request, Verify the login request, When the login request passes verification, Perform step 106;  Otherwise, step 108 is performed.  Step 106: The login server is based on the received Key-Client. Generate another corresponding random information, That is, the server key Key-Server,  Return verification pass information to the client, The verification pass information includes Key-Server, And save the attribute information of the client in the memory. Property information includes: Client account information, And step 1 07: The client passes the information according to the received verification. Entering the instant messaging process, And save the received Key-Client to the record body. Step 108: The login server returns verification failure information to the client.  That is, the login of the client fails.  When the client login is successful, Entering the instant messaging process, The database server on the server side records the instant messaging information of the user.  In the process of instant messaging, When the login server stops the service for some reason, E.g: Hardware failure or manual shutdown maintenance, The client will lose the session with the server. And return to the login interface, Prompt the user to log in again. The user must send a re-login command to the client. The client can get the new login server address. And send a re-login request including the new Key-Client to the new login server address. After the verification is passed, the client can continue the instant communication process. such, Due to login servo $ stop service, The disconnection of all clients that caused the login server service has affected the normal operation of the client. and, When the same time 'all disconnection -6- 201131379 client re-login to the server end, It also puts a severe load on the server side.  SUMMARY OF THE INVENTION Embodiments of the present invention provide a method for instant messaging, Systems and devices, To solve the problem that the prior art client loses the session with the login server. Can't automatically reconnect, The problem of data interruption.  Embodiments of the present invention provide a method for instant messaging, include:  The first login server receives the login request of the client, Instant communication with the client:  When the instant communication between the first login server and the client is interrupted, Logging in to the distribution server to obtain the address of the second login server, and sending the address to the client, The second login server receives the disconnection reconnection command sent by the client;  After the second login server verifies the disconnection reconnection command, Instant communication with the client.  Embodiments of the present invention provide a method for instant messaging, include:  After the login server receives the disconnection reconnection command sent by the client, Obtaining the first attribute information of the client;  The login server parses the disconnection reconnection command, Obtaining second attribute information of the user end;  Comparing the second attribute information with the first attribute information, When the two match, Verifying the disconnection reconnection command, When the verification passes, A verification pass message ' is sent to the client side and 201131379 instant communication is performed with the client.  Embodiments of the present invention provide a system for instant communication, include:  First login server, Used to receive a login request from the client. Instant communication with the client;  Log in to the distribution server, When the instant communication between the first login server and the client is interrupted, Obtaining an address of the second login server, sending to the user terminal;  Second login server, And configured to receive a disconnection reconnection command sent by the client, Verifying the disconnection reconnection command, When the check passes,  Instant messaging with the user terminal. The embodiment of the invention provides a login server for instant communication. Including the receiving unit, Used to receive a disconnection reconnection command sent by the client;  Calibration unit, Used to verify the received disconnection reconnection command;  Sending unit, And configured to send a verification response message to the client.  The embodiment of the invention provides a user terminal for instant communication, include:  Acquisition unit, Used when the instant communication with the first login server is interrupted, Obtaining the address of the second login server;  Sending unit, For using the address of the second login server, Sending a disconnection reconnection command to the second login server;  Receiving unit, And receiving the second login server to verify the disconnection reconnection command, Return verification response information.  In the embodiment of the present invention, The first login server receives the login request of the client, Instant communication with the client, When the first login servo -8 - 201131379 is interrupted by the instant communication with the client, Logging in to the distribution server to obtain the address of the second login server, and sending it to the client, The second login server receives the disconnection reconnection command sent by the client, After the second login server verifies the disconnection reconnection command, Instant communication with the client. thereby, When the login server stops the service for some reason, After the client loses the session with the server, Do not return directly to the login interface. Instead, initiate a disconnection reconnection process, Implement automatic switching between logins, Will not cause interruption of instant messaging data.  [Embodiment] In an embodiment of the present invention, an instant messaging system includes a client end and a server end. among them, The server side can include multiple servers. See Figure 2, Instant messaging systems include: user terminal, Log in to the distribution server, Log in to the server,  Database server and information storage server, among them, The client communicates instantly with a login server. In such an instant messaging system, When the instant communication between the client and the login server is interrupted, The client can automatically switch to another login server. Therefore, data loss between the client and the server is not caused. See Figure 3, The process of instant messaging in the embodiment of the present invention includes:  Step 301: The client logs in to the first login server. Instant communication with the first login server.  Here, The user receives the username entered by the user, After the user account information such as password, Sending an allocation address request to the login distribution server, The login distribution server is based on the request, Get the first address of the server to be logged in -9 - 201131379 list, After logging in to the distribution server to obtain the first address list, That is, after obtaining a list of addresses of some of the login servers that can be logged in, Determining an address from the obtained first address list as the address of the first login server,  And sending the address of the first login server to the client. thereby, The user terminal determines the address of the first login server, A login request is sent to the first login server. The login request includes: Client account information, And the client key Key-Client. Key-Client is the only random information generated by the client.  After the first login server receives the login request, Verify the login request, When the login request passes verification, According to the received Key-Client, Generate the server key Key-Server, Return verification to the client. By information, The verification pass information includes Key-Server, And storing the first attribute information of the client in the memory, Sending the first attribute information to the information storage server. among them, The first attribute information includes: Client account information, And the corresponding Key-Server. Key-Server is the first login server based on the received Key-Client. Generate another corresponding random information, It is also the only information that identifies the login status of the client.  The client passes the information according to the received verification. Instant communication with the first login server, And save the received Key-Server to the memory. In the process of instant communication, The instant messaging information associated with the user is stored in the database server.  Step 302: When the client detects that the instant communication with the first login server is interrupted, Get the address of the second login server.  -10- 201131379 When the client detects the instant communication with the first login server, the data to be sent to the first login server is temporarily stored in the buffer area, and then the allocation address request is sent to the login distribution server. Login assignment According to the request, Get the second address list of the server to be logged in,  After the server obtains the second address list, That is, after obtaining the address list of the partial login server that can be obtained, From the second address list, an address is used as the address of the second login server, And sending the address of the server to the client; Or, in the first address list obtained in the login server direct sequence 310, an address is determined as the address of the second login server. Here, The second login server is consistent with the address of the first login server, That is, the second login server is the first login server. of course, The bit of the second login server does not match the address of the first login server.  Here, After the client sends it to the cache of the first login server, You can also try to reconnect with the first login server first. Determining a second address of the server to be logged in from the second address list when the UE is disconnected from the first login server and reconnecting to the login server, and determining an address from the second address list as the second register Address, Or, the address list of the first address obtained in step 301 is determined to be an address of the second login server. Here,  The address of the recording server does not match the address of the first login server.  Step 3 03 : The client sends a disconnect command to the second login server. The disconnection reconnection command carries the second attribute information of the user end, The second attribute information includes the Key-broken returned by the first login server.  in, Demon I /I> N server login points to log in to determine the second login, the slave step is the address, the address can be stored, the address can be stored, the line is broken,  List,  Recorded in the servo, the second is indeed the second life. Where Server -11 - 201131379 , And user account information. This information is encrypted and sent to the second login server.  Step 3 04 : The second login server obtains the first attribute information of the client.  Here, The second login server checks whether there is a first attribute information of the user in the local memory. If there is the first attribute information in the local body, Obtaining the first attribute information of the client from the local memory, Otherwise, Obtain the first attribute information of the client from the information storage server.  When the second login server is consistent with the first login server, It is possible to find the first attribute information of the client in the local body. therefore, The second login server obtains the first attribute information of the client directly from the local accounting entity.  When the second login server does not match the first login server, Then, the second attribute of the second login server does not have the first attribute information of the client. therefore, The second login server can only obtain the first attribute information of the user from the information storage server.  Step 3 0 5 : The second login server is based on the obtained first attribute information, Check the received disconnection reconnection command. After the verification is passed, Go to step 306. otherwise, Go to step 3 08.  Here, the second login server first parses the received disconnection reconnection command to obtain the second attribute information of the user terminal carried by the second login server. Then, comparing the first attribute information obtained in step 3〇4 with the second attribute information obtained by parsing, the two are consistent, and then verifying the disconnection reconnection command. After the verification is passed, Go to step 306, When verification cannot pass, Reconnection failed, Perform step -12- 201131379 308. When the two do not match, Then do not need to reconnect the disconnection directly to step 3 08.  Step 3 06 : The second login server obtains the instant communication information related to the user from the background. And used the information, The verification pass information may also include a Key-in step 304, The second login server obtains the first attribute information of the client from the website. Here, Before the first client returns the verification pass information, It is also necessary to save the obtained attribute information to the locality of the second login server. Step 3 07 · The user terminal performs instant communication according to the received verification second login server.  The client receives the verification pass information. That is, the client transmits the data in the buffer to the second login. In the process of instant messaging, The communication information with the user is still stored in the database server in the background. Step 3 08 : The second login server sends a message to the user.  Step 3 09 : The client receives the verification failure resource interface. That is, the disconnection fails to reconnect, Need user record, The process of reconnecting is gone.  Of course, in the embodiment of the present invention, Log in to the address list of the server that is assigned to the server. You can give all orders regularly, When the response server returned by the login server is received, the server can be logged in. Verify the login servo command.  In the database server, the client returns to the verification server. Server ° Information storage server The second login server is in the first memory of the client.  Through information, Reconnected successfully with the first broken line,  server, Perform a new instant related 〇 After returning the verification failure message, Go back to the log and manually re-register the device to get the login. When the login server sends the message, Make sure the address of the server is added to the address list from -13 to 201131379.  such, The login assignment server can be ordered from the list of addresses obtained, Select an address to log in to the server's address. Also in the list of obtained addresses, Randomly select an address as the address of the login server. Can also be in the list of addresses obtained, According to other set rules, select an address as the address of the login server.  As mentioned above, In the embodiment of the present invention, When the login server stops serving for some reason, E.g: Hardware failure or manual shutdown maintenance,  After the client loses the session with the server, Does not return directly to the login interface. Instead, initiate a disconnection reconnection process, Implement automatic switching between login servers, Therefore, data loss between the client and the server is not caused. Also, it will not be re-login at the same time due to multiple clients. Excessive pressure on the login server.  The embodiments of the present invention are further described in detail below with reference to the accompanying drawings.  Embodiment 1, See Figure 4, The process of instant messaging includes:  Step 401: The client logs in to the first login server. Instant communication with the first login server.  When the client logs in to the first login server, The first attribute information of the client is saved in the local memory of the first login server. The first attribute information of the client is also saved in the remote information storage server. among them, The first attribute information includes: Client account information, And the corresponding Key-S erver. In the process of instant messaging, The instant messaging information associated with the user is stored in the database server in the background.  -14- 201131379 Step 402: When the client detects that the instant communication with the first login server is interrupted, Store the data to be sent into the buffer area. And send an address allocation request to the login allocation server.  Step 403: After the login distribution server receives the address allocation request,  Get the second address list of the server to be logged in, Determining an address as the address of the second login server, And sending the address of the second login server to the client.  Step 404: The client is based on the determined address, Send a disconnection reconnection command to the second login server. The disconnection reconnection command carries the second attribute information of the user end, That is, including the Key-Server returned by the first login server.  And user account information. The client encrypts the information and sends it to the second login server.  Step 405: The second login server checks whether there is a first attribute information of the client in the local memory. If there is, Performing step 406; Otherwise, step 407 is performed.  Step 406: The second login server obtains the first attribute information of the user from the local memory. Go to execution 409.  Step 4〇7: The second login server accesses the remote information storage server. Check whether there is a first attribute information of the client in the information storage server. If there is, Go to step 408; Otherwise go to step 4 1 3.  Step 40 8: The second login server obtains the first attribute information of the client from the information storage server. Go to step 409.  Step 409: The second login server parses the received disconnection reconnection command, Comparing the second attribute information of the client carried by the user with the obtained first attribute information of the client -15-201131379, When the two are consistent, Go to step 4 1 0, Otherwise, Perform step 4 1 3 Step 4 1 0 : The second login server verifies the received disconnection reconnection command. After the verification is passed, Perform step 4 1 1 ; otherwise, Perform step 4 1 3 〇 Step 4 1 1 : The second login server obtains the instant communication information related to the user from the database server in the background. And returning the verification pass information to the client, The verification pass information may also include a Key-Server.  When the second login server obtains the first attribute information of the client from the information storage server, Here, The acquired first attribute information of the client is also saved to the local storage of the second login server.  Step 4 1 2 : The client passes the information according to the received verification. Instant communication with the second login server.  The client receives the verification pass information. That is, the disconnection is successfully reconnected.  The client sends the data in the buffer area to the second login server. Instant communication. In the process of instant messaging, The new instant messaging information associated with the user is still stored in the backend database server.  Step 413: The second login server returns the verification failure message to the client. Step 4 1 4 : After the client receives the verification failure information, Return to the login interface. That is, the disconnection fails to reconnect, Users need to manually re-login, The process of reconnecting is gone.  Implementation II See Figure 5, The process of instant messaging includes:  Step 501: The client logs in to the first login server. Instant communication with the first login -16- 201131379 server.  When the client logs in to the first login server, The first attribute information of the client is saved in the local memory of the first login server. The first attribute information of the client is also saved in the remote information storage server. among them, The first attribute information includes: Client account information, And the corresponding Key-Server. In the process of instant messaging, The instant messaging information associated with the user is stored in the database server in the background.  Step 502: When the client detects that the instant communication with the first login server is interrupted, Store the data to be sent into the buffer area. The client attempts to reconnect with the first login server. When the client and the first login server are disconnected successfully, Then the client continues to communicate with the first login server instantaneously. otherwise,  Go to step 5 0 3.  Step 5 03 : The client sends an address allocation request to the login allocation server.  Step 504: After the login distribution server receives the address allocation request,  Get the second address list of the server to be logged in, Determining an address as the address of the second login server, And sending the address of the second login server to the client.  The client has failed to reconnect with the first login server. Here , The address of the second server does not match the address of the first server.  Step 505: The client is based on the determined address, Send a disconnection reconnection command to the second login server. The disconnection reconnection command carries the second attribute information of the user end, That is, it includes the Key-Server ’ returned by the first login server and the client account information. The client encrypts the information and sends it to the -17-201131379 second login server.  Step 5 0 6 : The second login server checks whether there is a first attribute information of the client in the local memory. If there is, Perform step 5 07; Otherwise, go to step 5 0 8.  In this embodiment, The reconnection of the disconnection between the client and the first login server has failed. Here, The second login server cannot find the first attribute information of the client in the local memory. Go to step 5 08.  Step 5 07: The second login server obtains the first attribute information of the user from the local memory. Transfer to execution 5 1 0.  Step 508: The second login server accesses the remote information storage server. Check whether there is a first attribute information of the client in the information storage server. If there is, Perform step 5 09; Otherwise, step 514 is performed.  Step 5 09 : The second login server obtains the first attribute information of the client from the information storage server. Go to step 5 1 0.  Step 5 1 0 : The second login server parses the received disconnection reconnection command to compare the second attribute information of the client carried by the client with the obtained first attribute information of the client. When the two are consistent, Go to step 5 1 1, Otherwise, Step 5 1 4 Step 511 · The second login server verifies the received disconnection reconnection command. After the verification is passed, Perform step 5 1 2 ; otherwise, Perform step 5 1 4 〇 Step 5 1 2 : The second login server obtains the instant communication information related to the user from the database server in the background. And returning the verification pass information to the client. The verification pass information may also include the Key-Server.  -18- 201131379 In this embodiment, The second login server obtains the first attribute information of the client from the information storage server. Here, The acquired first attribute information of the client is also saved to the local storage of the second login server.  Step 5 1 3 : The client passes the information according to the received verification. Instant communication with the second login server.  The client receives the verification pass information. That is, the disconnection is successfully reconnected.  The client sends the data in the buffer area to the second login server. Instant communication. In the process of instant messaging, The new instant messaging information associated with the user is still stored in the backend database server.  Step 514: The second login server returns a verification failure message to the client.  Step 5 1 5 : After the client receives the verification failure information, Return to the login interface. That is, the disconnection fails to reconnect, Users need to manually re-login, The process of reconnecting is gone.  In the above embodiment, After the client communicates with the first login server, the instant communication is interrupted. The client sends an address allocation request to the login allocation server.  After the login distribution server receives the address allocation request, Get the second address list of the server to be logged in, Determining an address is the address of the second login server. In the embodiment of the present invention, The login assignment server can also be obtained from the list of first addresses obtained. Determining an address as the address of the second login server, The specific implementation process will not be repeated.  See Figure 6, In the instant messaging system in the embodiment of the present invention, Includes: The first login server is 1, The distribution server 200 and the second login server 3 00 are registered. among them,  -19"  201131379 First login server 1 00, Used to receive a login request from the client.  Instant communication with the client.  Log in to the distribution server 200, When the instant communication between the first login server 100 and the user is interrupted, The address of the second login server 300 is obtained and sent to the client.  The second login server 300, And configured to receive a disconnection reconnection command sent by the client, Verifying the disconnection reconnection command, When the check passes, Instant communication with the client.  among them, Log in to the distribution server 200, Also used to obtain a list of first addresses of the server to be logged in, And determining, from the first address list, that the address of the first login server is sent to the client.  The first login server is 1, Also used to receive a login request sent by the client. Verify the login request, When the verification passes, The first attribute information of the user terminal 100 is stored in the local memory. And sending the first attribute information to the information storage server. among them, The login request includes: Client account information, And the client key, The first attribute information includes: The user account information, And a server key generated according to the client key, And returning verification pass information including the server key to the client. therefore, The system also includes: Information storage server 400, Used to store attribute information of the client.  Log in to the distribution server 200, It is also used to get the second address list of the server to be logged in. Determining an address of the second login server 300 from the second address list, The address of the second login server 300 can also be determined from the first address list.  -20- 201131379 In this way, The second login server 300, Used to obtain the first attribute information of the client. And parsing the received disconnection reconnection command, Get the second attribute information of the client, Comparing the first attribute information with the second attribute information, When the two match, Verifying the disconnection reconnection command, When the verification is passed, A check pass message is returned to the client.  among them, When the second login server 3 00 obtains the first attribute information of the client, Check if the first attribute information of the client is in the local memory. When the first attribute information is included in the local memory, Obtaining the first attribute information of the user end from the local memory, otherwise, The first attribute information of the client is obtained from the information storage server 400.  of course, In the embodiment of the present invention, See Figure 7, The client used in the instant messaging system of the embodiment of the present invention includes: Acquisition unit 7 1 0, Sending unit 720, Receiving unit 7 3 0.  Acquisition unit 710, Used when interrupting instant communication with the first login server, Get the address of the second login server.  Sending unit 720, And means for transmitting a disconnection reconnection command to the second login server according to the address of the second login server.  Receiving unit 730, And receiving the second login server to verify the disconnection reconnection command, Return verification response information.  among them, Acquisition unit 7 1 〇, It is also used to obtain the address of the first login server determined by the login assignment server from the first address list of the server to be logged in.  Sending unit 720, Also used to determine the address of the first login server, Send a login request to the first login server, among them, The login please -21 - 201131379 Client account information, And the client key.  Receiving unit 730, And verifying the login request by receiving the first login server, The verification response message returned.  Acquisition unit 710, And is further configured to obtain an address of the second login server determined by the login allocation server from the first address list.  of course, The obtaining unit 710 can also directly obtain the address of the second login server determined by the login allocation server from the second address list of the server to be logged in.  See Figure 8, The login server used in the instant messaging system of the embodiment of the present invention includes: Receiving unit 810, Check unit 820 and transmitting unit 83 0 ° receiving unit 810, Used to receive the disconnection reconnection command sent by the client t t parity unit 8 2 0, Used to verify the received disconnection reconnection command » Sending unit 8 3 0, For sending a verification response message to the client 〇 receiving unit 810, And is further configured to receive a login request sent by the client, The login request includes: Client account information' and client key; The verification unit 820' is further configured to verify the login request; Sending unit 8 30, It is further configured to: store the first attribute information of the client into the local memory when the verification is passed, and send the first attribute information to the information storage server, wherein the first attribute information includes: The client account information, And the server -22-201131379 key generated according to the user terminal secret transmission, And transmitting a verification pass message including the server key to the client.  The verification unit 820 in the embodiment of the present invention may include an acquisition subunit,  Parsing subunits and matching verification subunits, among them,  Get the subunit, The first attribute information used to obtain the user end.  Parsing subunits, Used to parse the disconnection reconnection command, Get the second attribute information of the user.  Match the verification subunit, And comparing the first attribute information with the second attribute information, When the two match, The disconnection reconnection command is verified.  The obtaining subunit first checks whether the first attribute information of the user end is stored in the local memory. When the first attribute information is saved in the local memory, Obtaining the first attribute information from the local memory, When the first attribute information is not saved in the local memory, Obtaining the first attribute information of the client from the information storage server.  In summary, In the embodiment of the present invention, The first login server receives the login request of the user, Instant communication with the client, When the instant communication between the first login server and the client is interrupted, The login allocation server obtains the address of the second login server and sends it to the client.  The second login server receives the disconnection reconnection command sent by the client, After the second login server verifies the disconnection reconnection command, Instant communication with the client. thereby, When logging in to the server and stopping the service for some reason, For example, · hardware failure or manual maintenance, After the client loses the session with the server, Instead of directly retreating -23- 201131379 back to the login interface', it initiates the disconnection reconnection process. Implement automatic switching between login servers, Will not cause data loss between the client and the server. It also does not affect the user experience.  The present invention is directed to a method in accordance with an embodiment of the present invention, Equipment (system), And a flowchart and/or block diagram of a computer program product. It will be understood that each of the processes and/or blocks in the flowcharts and/or block diagrams can be implemented by computer program instructions. And a combination of processes and/or blocks in the flowcharts and/or block diagrams. These computer program instructions can be provided to a general-purpose computer, Dedicated computer, An embedded processor or processor of another programmable data processing device to produce a machine, The instructions executed by a processor of a computer or other programmable data processing device cause means for implementing the functions specified in one or more of the flow or blocks and/or blocks of the block diagram.  These computer program instructions can also be stored in computer readable memory that can boot a computer or other programmable data processing device to operate in a specific manner. The instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device. The instruction device implements the functions specified in a block or blocks of a flow or a flow and/or block diagram of the flowchart.  These computer program instructions can also be loaded onto a computer or other programmable data processing device. Enabling a series of operational steps on a computer or other programmable device to produce computer-implemented processing, Thus, instructions executed on a computer or other programmable device provide steps for implementing the functions specified in one or more blocks of a flow or a flow and/or block diagram of a flowchart.  -24- 201131379 Obviously, A person skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. such, If such modifications and variations of the present invention fall within the scope of the claims and the equivalents thereof The invention is also intended to cover such modifications and variations.  BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart of a user terminal login in the prior art;  2 is a structural diagram of an instant messaging system according to an embodiment of the present invention;  3 is a flowchart of instant communication in an embodiment of the present invention;  4 is a flow chart of instant communication in the first embodiment of the present invention;  FIG. 5 is a flowchart of instant communication in a second embodiment of the present invention; FIG.  6 is a specific structural diagram of an instant messaging system according to an embodiment of the present invention;  FIG. 7 is a structural diagram of a user end according to an embodiment of the present invention;  FIG. 8 is a structural diagram of a login server according to an embodiment of the present invention.  [Main component symbol description] 100 : The first login server 2〇〇: Log in to the distribution server 3〇〇 : The second login server 40〇: Information Storage Server 7 1 0 : Get unit 7 2 0 : Sending unit 7 3 0 : Receiving unit -25- 201131379 8 1 0 : Receiving unit 8 2 0 : Calibration unit 8 3 0 : Sending unit

Claims (1)

201131379 七、申請專利範圍: 1.—種即時通信的方法,其特徵在於,包括: 第一登錄伺服器接收用戶端的登錄請求,與該用戶端 進行即時通信; 當該第一登錄伺服器與該用戶端的即時通信中斷時’ 登錄分配伺服器獲取第二登錄伺服器的位址並發送給該用 戶端,該第二登錄伺服器接收該用戶端發送的斷線重連命 令; 當該第二登錄伺服器對該斷線重連命令進行校驗通過 後,與該用戶端進行即時通信。 2 .如申請專利範圍第1項之方法,其中,該第一登錄 伺服器接收用戶端的登錄請求包括: 該登錄分配伺服器獲取待登錄伺服器的第一位址列表 ,並從該第一位址列表中確定該第一登錄伺服器的位址發 送給用戶端; 該第一登錄伺服器接收用戶端發送的登錄請求,該登 錄請求包括:用戶端帳戶資訊,以及用戶端密鑰; 該第一登錄伺服器對該登錄請求進行驗證’當驗證通 過時,將該用戶端的第一屬性資訊存入本地記憶體中,並 將該第一屬性資訊發送給資訊儲存伺服器’其中,該第一 屬性資訊包括:該用戶端帳戶資訊’以及根據該用戶端密 鑰生成的伺服器密鑰; 該第一登錄伺服器向該用戶端傳回包括該伺服器密鑰 的驗證通過資訊。 -27- 201131379 3 .如申請專利範圍第2項之方法,其中,該斷線重連 命令攜帶該用戶端的第二屬性資訊,該第二屬性資訊包括 :該用戶端帳戶資訊,以及接收的該第一登錄伺服器傳回 的伺服器密鑰。 4 .如申請專利範圍第2項之方法,其中,該登錄分配 伺服器獲取第二登錄伺服器的位址包括: 該登錄分配伺服器獲取待登錄伺服器的第二位址列表 ,從該第二位址列表中確定該第二登錄伺服器的位址;或 > 從已獲取的第一位址列表中確定該第二登錄伺服器的 位址。 5. 如申請專利範圍第1項之方法,其中,該第二登錄 伺服器對該斷線重連命令進行校驗包括: 該第二登錄伺服器獲取該用戶端的第一屬性資訊: 該第二登錄伺服器解析該斷線重連命令,得到該用戶 端的第二屬性資訊; 將該第二屬性資訊與第一屬性資訊進行比對,當兩者 匹配時,對該斷線重連命令進行驗證。 6. —種即時通信的方法,其特徵在於,包括: 登錄伺服器接收到用戶端發送的斷線重連命令後,獲 取該用戶端的第一屬性資訊; 該登錄伺服器解析該斷線重連命令,得到該用戶端的 第二屬性資訊; 將該第二屬性資訊與第一屬性資訊進行比對,當兩者 -28- 201131379 匹配時’對該斷線重連命令進行驗證,當驗證通過時,向 該用戶端發送校驗通過消息,並與該用戶端進行即時通信 〇 7. 如申請專利範圍第6項之方法,其中,該方法還包 括: 該登錄伺服器接收到該用戶端發送的登錄請求後,對 該登錄請求進行驗證; 當驗證通過時,將該用戶端的第一屬性資訊存入本地 記憶體中,並將該第一屬性資訊發送給資訊儲存伺服器; 該登錄伺服器向該用戶端發送驗證通過資訊,與該用 戶端進行即時通信。 8. —種即時通信的系統,其特徵在於,包括: 第一登錄伺服器,用於接收用戶端的登錄請求,與該 用戶端進行即時通信; 登錄分配伺服器,用於當該第一登錄伺服器與該用戶 端的即時通信中斷時,獲取第二登錄伺服器的位址並發送 給該用戶端: 第二登錄伺服器,用於接收該用戶端發送的斷線重連 命令,對該斷線重連命令進行校驗,當校驗通過時,與該 用戶端進行即時通信。 9. 如申請專利範圍第8項之系統,其中, 該登錄分配伺服器,還用於獲取待登錄伺服器的第一 位址列表,並從該第一位址列表中確定該第一登錄伺服器 的位址發送給用戶端; -29- 201131379 該第一登錄伺服器,還用於接收用戶端發送的登錄請 求,對該登錄請求進行驗證’當驗證通過時,將該用戶端 的第一屬性資訊存入本地記憶體中,以及將該第一屬性資 訊發送給資訊儲存伺服器’其中’該登錄請求包括:用戶 端帳戶資訊,以及用戶端密鑰’該第一屬性資訊包括:該 用戶端帳戶資訊,以及根據該用戶端密鑰生成的伺服器密 鑰,並向該用戶端傳回包括該伺服器密鑰的驗證通過資訊 〇 1 0.如申請專利範圍第9項之系統,其中, 該登錄分配伺服器,還用於獲取待登錄伺服器的第二 位址列表,從該第二位址列表中確定該第二登錄伺服器的 位址,或從該第一位址列表中確定該第二登錄伺服器的位 址。 1 1 .如申請專利範圍第8項之系統,其中, 該第二登錄伺服器,還用於獲取該用戶端的第一屬性 資訊,並解析接收的斷線重連命令,得到該用戶端的第二 屬性資訊,將該第一屬性資訊與第二屬性資訊進行比對’ 當兩者匹配時,對該斷線重連命令進行驗證。 1 2.—種即時通信的登錄伺服器,其特徵在於,包括 接收單元,用於接收用戶端發送的斷線重連命令; 校驗單元,用於對接收的斷線重連命令進行校驗; 發送單元,用於向該用戶端發送校驗回應消息。 13.如申請專利範圍第12項之登錄伺服器,其中’ -30- 201131379 該接收單元,還用於接收該用戶端發送的登錄請求, 該登錄請求包括:用戶端帳戶資訊,以及用戶端密鑰; 該校驗單元,還用於對該登錄請求進行驗證; 該發送單元,還用於當驗證通過時,將該用戶端的第 一屬性資訊存入本地記憶體中,以及將該第一屬性資訊發 送資訊儲存伺服器,其中,該第一屬性資訊包括:該用戶 端帳戶資訊,以及根據該用戶端密鑰生成的伺服器密鑰, 並向該用戶端發送包括該伺服器密鑰的驗證通過消息。 14.如申請專利範圍第12項之登錄伺服器,其中,該 校驗單元包括: 獲取子單元,用於獲取該用戶端的第一屬性資訊; 解析子單元,用於解析該斷線重連命令,得到用戶端 的第二屬性資訊; 匹配驗證子單元,用於將該第一屬性資訊與第二屬性 資訊進行比對,當兩者匹配時,對該斷線重連命令進行驗 證。 1 5 ·—種即時通信的用戶端,其特徵在於,包括: 獲取單元,用於當與第一登錄伺服器即時通信中斷時 ,獲取第二登錄伺服器的位址; 發送單元,用於根據該第二登錄伺服器的位址,向該 第二登錄伺服器發送斷線重連命令; 接收單元,用於接收該第二登錄伺服器對該斷線重連 命令進行校驗,傳回的校驗回應資訊。 16.如申請專利範圍第1 5項之用戶端,其中, -31 - 201131379 該獲取單元,還用於獲取登錄分配伺服器從待登錄伺 服器的第一位址列表確定的第一登錄伺服器的位址,以及 獲取登錄分配伺服器從該第一位址列表中確定的該第二登 錄伺服器的位址。 I7.如申請專利範圍第15項之用戶端,其中, 該獲取單元’還用於獲取登錄分配伺服器從待登錄伺 服器的第二位址列表中確定的該第二登錄伺服器的位址。 -32-201131379 VII. Patent application scope: 1. A method for instant communication, characterized in that: the first login server receives a login request from a client, and performs instant communication with the client; when the first login server and the When the instant communication of the client is interrupted, the login registration server obtains the address of the second login server and sends the address to the client, and the second login server receives the disconnection reconnection command sent by the client; when the second login After the server verifies the disconnection reconnection command, it performs instant communication with the client. 2. The method of claim 1, wherein the first login server receives the login request of the client comprises: the login assignment server obtaining a first address list of the server to be logged in, and from the first Determining, in the address list, that the address of the first login server is sent to the user end; the first login server receives the login request sent by the user end, where the login request includes: user account information, and a client key; A login server verifies the login request. When the verification is passed, the first attribute information of the client is stored in the local memory, and the first attribute information is sent to the information storage server, where the first The attribute information includes: the client account information 'and a server key generated according to the client key; the first login server returns the verification pass information including the server key to the client. -27-201131379 3. The method of claim 2, wherein the disconnection reconnection command carries the second attribute information of the client, the second attribute information includes: the user account information, and the received The server key returned by the first login server. 4. The method of claim 2, wherein the login allocation server obtains the address of the second login server comprises: the login distribution server obtaining a second address list of the server to be logged in, from the Determining an address of the second login server in the address list; or > determining an address of the second login server from the obtained first address list. 5. The method of claim 1, wherein the second login server performs the verification of the disconnection reconnection command, the second login server obtains the first attribute information of the user end: the second The login server parses the disconnection reconnection command to obtain the second attribute information of the client; compares the second attribute information with the first attribute information, and when the two match, the disconnection reconnection command is verified . A method for instant communication, comprising: after receiving a disconnection reconnection command sent by a client, the login server acquires first attribute information of the client; the login server parses the disconnection reconnection The command obtains the second attribute information of the client; compares the second attribute information with the first attribute information, and when the two -28-201131379 match, 'verifies the disconnection reconnection command, when the verification passes Sending a verification pass message to the client, and performing instant communication with the client. 7. The method of claim 6, wherein the method further comprises: the login server receiving the sending by the client After the login request, the login request is verified; when the verification is passed, the first attribute information of the client is stored in the local memory, and the first attribute information is sent to the information storage server; the login server is The client sends an authentication pass message to perform instant communication with the client. 8. A system for instant messaging, comprising: a first login server, configured to receive a login request from a client, and perform instant communication with the client; and log in to the distribution server for use in the first login server Obtaining the address of the second login server and sending it to the client when the instant communication with the client is interrupted: the second login server is configured to receive the disconnection reconnection command sent by the client, and the disconnection is The reconnection command performs verification, and when the verification passes, it performs instant communication with the client. 9. The system of claim 8, wherein the login allocation server is further configured to obtain a first address list of the server to be logged in, and determine the first login servo from the first address list. The address of the device is sent to the client; -29- 201131379 The first login server is further configured to receive a login request sent by the client, and verify the login request. When the verification is passed, the first attribute of the client is used. The information is stored in the local memory, and the first attribute information is sent to the information storage server, where the login request includes: the client account information, and the client key. The first attribute information includes: the client Account information, and a server key generated according to the client key, and returning to the client a verification pass message including the server key. The system of claim 9 is as follows: The login allocation server is further configured to obtain a second address list of the server to be logged in, determine an address of the second login server from the second address list, or The address of the second login server is determined in the first address list. The system of claim 8, wherein the second login server is further configured to obtain the first attribute information of the user end, and parse the received disconnection reconnection command to obtain the second end of the user end. The attribute information compares the first attribute information with the second attribute information. When the two match, the disconnection reconnection command is verified. 1 2. A login server for instant communication, comprising: a receiving unit, configured to receive a disconnection reconnection command sent by the user end; and a verification unit, configured to perform verification on the received disconnection reconnection command a sending unit, configured to send a verification response message to the client. 13. The registration server of claim 12, wherein the receiving unit is further configured to receive a login request sent by the client, the login request includes: user account information, and user terminal confidentiality The verification unit is further configured to verify the login request. The sending unit is further configured to: when the verification is passed, store the first attribute information of the user end into the local memory, and the first attribute The information sending information storage server, wherein the first attribute information comprises: the client account information, and a server key generated according to the client key, and sending the verification including the server key to the client Through the message. 14. The registration server of claim 12, wherein the verification unit comprises: an acquisition subunit, configured to acquire first attribute information of the user end; and a parsing subunit, configured to parse the disconnection reconnection command The second attribute information of the user end is obtained; the matching verification subunit is configured to compare the first attribute information with the second attribute information, and when the two match, the disconnection reconnection command is verified. The user terminal of the instant messaging, comprising: an obtaining unit, configured to acquire an address of the second login server when the instant communication with the first login server is interrupted; and a sending unit, configured to The address of the second login server sends a disconnection reconnection command to the second login server; the receiving unit is configured to receive the second login server to verify the disconnection reconnection command, and return the Verify response information. 16. The client of claim 15, wherein the obtaining unit is further configured to obtain the first login server determined by the login allocation server from the first address list of the server to be logged in. An address, and an address of the second login server determined by the login allocation server from the first address list. I7. The client of claim 15 wherein the obtaining unit is further configured to obtain an address of the second login server determined by the login distribution server from the second address list of the server to be logged in. . -32-
TW099106786A 2010-03-09 2010-03-09 Instant messaging method, system and device TWI502375B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW099106786A TWI502375B (en) 2010-03-09 2010-03-09 Instant messaging method, system and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW099106786A TWI502375B (en) 2010-03-09 2010-03-09 Instant messaging method, system and device

Publications (2)

Publication Number Publication Date
TW201131379A true TW201131379A (en) 2011-09-16
TWI502375B TWI502375B (en) 2015-10-01

Family

ID=50180344

Family Applications (1)

Application Number Title Priority Date Filing Date
TW099106786A TWI502375B (en) 2010-03-09 2010-03-09 Instant messaging method, system and device

Country Status (1)

Country Link
TW (1) TWI502375B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI638269B (en) * 2014-12-08 2018-10-11 日本電氣股份有限公司 Wireless terminal and method for communicating

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050198379A1 (en) * 2001-06-13 2005-09-08 Citrix Systems, Inc. Automatically reconnecting a client across reliable and persistent communication sessions
US7636917B2 (en) * 2003-06-30 2009-12-22 Microsoft Corporation Network load balancing with host status information
US7594020B2 (en) * 2005-05-31 2009-09-22 Microsoft Corporation Re-establishing a connection for an application layer via a service layer
TW201010358A (en) * 2008-08-19 2010-03-01 Arcadyan Technology Corp Method of automatic reconnecting web interface for customer premises equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI638269B (en) * 2014-12-08 2018-10-11 日本電氣股份有限公司 Wireless terminal and method for communicating
US10779132B2 (en) 2014-12-08 2020-09-15 Nec Corporation Wireless terminal and method for messaging

Also Published As

Publication number Publication date
TWI502375B (en) 2015-10-01

Similar Documents

Publication Publication Date Title
JP5693576B2 (en) Managing instant messaging sessions
KR102039316B1 (en) Method and device for authentication using dynamic passwords
EP3073699B1 (en) System and method for controlling mutual access of smart devices
EP2705642B1 (en) System and method for providing access credentials
EP3346660B1 (en) Authentication information update method and device
EP3316544B1 (en) Token generation and authentication method, and authentication server
EP3297243B1 (en) Trusted login method and device
EP2629488A1 (en) Authentication system, authentication method, and network storage appliance
WO2016134657A1 (en) Operating method for push authentication system and device
US9148412B2 (en) Secure configuration of authentication servers
US10116649B2 (en) P2P connecting and establishing method and communication system using the same
KR20100013207A (en) The method for authenticating device and service and the system thereof
WO2011107013A1 (en) Method and communication device for accessing to devices in security
WO2018118029A1 (en) Authenticate a first device based on a push message to a second device
KR101506223B1 (en) Automatic Reconnection System For Virtualization Service
TWI502375B (en) Instant messaging method, system and device
JP6848275B2 (en) Program, authentication system and authentication cooperation system
JP6126062B2 (en) Network device and MAC address authentication method for network device
TW201824887A (en) System for using authentication server to implement free login in server group and method thereof
CN112333248B (en) Login failure verification method and related device
TWI656781B (en) Offline status without login verification system and method thereof
CN116233212A (en) Broadband network connection method, device, equipment and storage medium
CN116010910A (en) Software authorization method, data processing method, device, equipment and medium
CN117118606A (en) Token-based access verification method, token-based access verification system and storage medium
CN116668034A (en) Connection system and method for data service object, electronic equipment and storage medium

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees