TWI720113B - Method and device for processing telegrams - Google Patents

Method and device for processing telegrams Download PDF

Info

Publication number
TWI720113B
TWI720113B TW106102246A TW106102246A TWI720113B TW I720113 B TWI720113 B TW I720113B TW 106102246 A TW106102246 A TW 106102246A TW 106102246 A TW106102246 A TW 106102246A TW I720113 B TWI720113 B TW I720113B
Authority
TW
Taiwan
Prior art keywords
result
message
server
stored
sender
Prior art date
Application number
TW106102246A
Other languages
Chinese (zh)
Other versions
TW201828669A (en
Inventor
任勇
Original Assignee
香港商阿里巴巴集團服務有限公司
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 香港商阿里巴巴集團服務有限公司 filed Critical 香港商阿里巴巴集團服務有限公司
Priority to TW106102246A priority Critical patent/TWI720113B/en
Publication of TW201828669A publication Critical patent/TW201828669A/en
Application granted granted Critical
Publication of TWI720113B publication Critical patent/TWI720113B/en

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

本申請實施例提供了一種電文處理方法和裝置。該電文處理方法包括:接收發送方發送的第一電文;當所述第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果;若是,則向所述發送方發送所述第一結果。本申請實施例透過在檢測接收到的電文為指定類型的電文時,不直接將電文透明化傳輸給後端伺服器,而是先在本地預儲存的結果中查找與該電文匹配的結果,如果查找到匹配的結果則直接將該結果反饋至發送方,而不再將該電文透明化傳輸給後端伺服器,從而減小了後端伺服器對該類電文的處理量,減小了後端伺服器的電文處理壓力。當該方法應用於對後端伺服器的HC場景中時,可以減小後端伺服器對HC請求的處理壓力。 The embodiments of the present application provide a method and device for processing a message. The message processing method includes: receiving a first message sent by a sender; when the first message is a specified type of message, searching for a pre-stored result whether there is a first result that matches the first message; if so , Then send the first result to the sender. The embodiment of this application does not directly transmit the message transparently to the back-end server when detecting that the received message is a specified type of message, but first searches for a result that matches the message in the locally pre-stored results, if If the matching result is found, the result will be directly fed back to the sender, instead of transparently transmitting the message to the back-end server, thereby reducing the amount of processing of this type of message by the back-end server and reducing the back-end server. The message processing pressure of the end server. When this method is applied to the HC scenario to the back-end server, the processing pressure of the back-end server to the HC request can be reduced.

Description

一種電文處理方法和裝置 Method and device for processing telegrams

本申請涉及通訊技術領域,特別是涉及一種電文處理方法和一種電文處理裝置。 This application relates to the field of communication technology, and in particular to a method for processing an electronic message and an electronic message processing device.

為了快速、準確的識別遠端服務的可用性,本地應用需要頻繁地對遠端服務發起健康檢查(Health Check,HC)請求,用以判斷遠端服務是否可用。 In order to quickly and accurately identify the availability of remote services, local applications need to frequently initiate Health Check (HC) requests to remote services to determine whether the remote services are available.

在雲端計算的大規模負載均衡的場景下,用戶透過伺服器負載平衡器(Server Load Balancer,SLB)創建的VIP會被配置在多個Linux虛擬伺服器(Linux Virtual Server,LVS)上,為了保證盡可能準確的知道後端伺服器是否可用,每個LVS上都會啟動一個健康檢查進程去對後端伺服器進行檢查。 In the large-scale load balancing scenario of cloud computing, the VIP created by the user through the server load balancer (Server Load Balancer, SLB) will be configured on multiple Linux virtual servers (Linux Virtual Server, LVS), in order to ensure To know as accurately as possible whether the back-end server is available, a health check process is started on each LVS to check the back-end server.

假設有m個LVS,配置成每n秒對後端伺服器進行一次健康檢查,那麼後端伺服器每秒都要承受m/n個健康檢查請求。從m/n可以看出,用戶後端伺服器承受的健康檢查請求的頻率與LVS的台數成正比,與健康檢查的間隔時間成反比。 Assuming there are m LVSs configured to perform a health check on the back-end server every n seconds, then the back-end server will accept m/n health check requests every second. It can be seen from m/n that the frequency of health check requests received by the user's back-end server is proportional to the number of LVS units, and inversely proportional to the interval of health checks.

在雲端產品環境中,LVS的數量會隨著用戶數和存取量增長而增長,也就是m始終在增長,而用戶又希望當後端伺服器出現問題時能儘快的停止LVS對其轉發請求,那就需要縮短健康檢查的間隔時間,即縮小n。也就是m/n這個值會越來越大,以至於導致健康檢查的請求對後端伺服器產生較大的壓力,極端情況下,甚至會因為健康檢查的請求過多,導致後端伺服器不可用。 In the cloud product environment, the number of LVS will grow with the growth of the number of users and access volume, that is, m is always growing, and users hope to stop LVS from forwarding requests as soon as possible when there is a problem with the back-end server , Then the interval between health checks needs to be shortened, that is, n is reduced. That is to say, the value of m/n will become larger and larger, so that the health check request will put greater pressure on the back-end server. In extreme cases, the back-end server may even become unavailable due to too many health check requests. use.

然而,在雲端環境中,透過控制m或n的方式來控制HC請求數量會導致服務的規模和靈活性受限,其中,控制最大的m會導致LVS集群的規模受限,控制n的方式會導致HC不敏感,後端服務出現問題時,無法及時的感知到。 However, in a cloud environment, controlling the number of HC requests by controlling m or n will limit the scale and flexibility of the service. Among them, controlling the largest m will limit the scale of the LVS cluster, and the way to control n will limit the scale of the LVS cluster. As a result, HC is not sensitive, and problems with back-end services cannot be detected in time.

本申請實施例的發明目的在於提供一種電文處理方法,能夠減小後端伺服器對HC請求的處理壓力。 The purpose of the invention of the embodiments of the present application is to provide a message processing method, which can reduce the processing pressure of the back-end server on the HC request.

相應的,本申請實施例還提供了一種電文處理裝置,用以保證上述方法的實現及應用。 Correspondingly, an embodiment of the present application also provides a message processing device to ensure the implementation and application of the above method.

為了解決上述問題,本申請公開了一種電文處理方法,包括:接收發送方發送的第一電文;當所述第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果;若是,則向所述發送方發送所述第一結果。 In order to solve the above problems, this application discloses a message processing method, which includes: receiving a first message sent by a sender; when the first message is a specified type of message, searching the pre-stored result whether there is a The first result of the first message matching; if it is, the first result is sent to the sender.

進一步,所述方法還包括:當所述預儲存的結果中不存在所述第一結果時,將所述第一電文發送至伺服器;接收所述伺服器反饋的第二結果;向所述發送方發送所述第二結果。 Further, the method further includes: when the first result does not exist in the pre-stored results, sending the first message to the server; receiving the second result fed back by the server; The sender sends the second result.

進一步,所述方法還包括:在所述預儲存的結果中添加所述第二結果。 Further, the method further includes: adding the second result to the pre-stored result.

進一步,所述在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果,包括:獲取所述第一電文中包含的請求資訊及有效期;在預儲存的結果中查找是否存在與所述請求資訊對應的結果;若存在,則判斷所述結果是否滿足所述有效期;若是,則確認所述結果為與所述第一電文匹配的第一結果,若否,則確認不存在所述第一結果。 Further, the searching for the pre-stored result whether there is a first result that matches the first message includes: obtaining the request information and the validity period contained in the first message; and searching for the existence of the pre-stored result The result corresponding to the requested information; if it exists, it is determined whether the result meets the validity period; if it is, it is confirmed that the result is the first result that matches the first message, if not, it is confirmed that it does not exist The first result.

進一步,所述方法還包括:基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定所述伺服器在當前週期內的服務可用性;依據所述當前週期內的服務可用性生成檢測的結果,對所述結果進行儲存。 Further, the method further includes: determining the service availability of the server in the current cycle based on a regular health check performed on a designated port or service program of the server; and generating a detected data based on the service availability in the current cycle As a result, the results are stored.

進一步,所述請求資訊包括請求類型、目的地IP地址和目的地埠口。 Further, the request information includes request type, destination IP address and destination port.

進一步,所述指定類型的電文為健康檢查HC請求電文。 Further, the specified type of telegram is a health check HC request telegram.

本申請還公開了一種電文處理裝置,包括:電文接收單元,被配置為接收發送方發送的第一電文;結果查找單元,被配置為當所述第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果;結果反饋單元,被配置為當所述查找單元查找到與所述第一電文匹配的第一結果是,向所述發送方發送所述第一結果。 The application also discloses a message processing device, which includes: a message receiving unit configured to receive a first message sent by a sender; and a result searching unit configured to perform a message in advance when the first message is a specified type of message. The stored results search for whether there is a first result matching the first message; the result feedback unit is configured to send to the first result when the search unit finds that the first result matches the first message The party sends the first result.

進一步,所述裝置還包括:發送單元,被配置為當所述預儲存的結果中不存在所述第一結果時,將所述第一電文發送至伺服器;結果接收單元,被配置為接收所述伺服器反饋的第二結果;結果發送單元,被配置為向所述發送方發送所述第二結果。 Further, the device further includes: a sending unit configured to send the first message to a server when the first result does not exist in the pre-stored result; and a result receiving unit configured to receive The second result fed back by the server; the result sending unit is configured to send the second result to the sender.

進一步,所述裝置還包括:增加單元,被配置為在所述預儲存的結果中添加所述第二結果。 Further, the device further includes: an adding unit configured to add the second result to the pre-stored result.

進一步,所述結果查找單元包括:提取子單元,被配置為獲取所述第一電文中包含的請求資訊及有效期;查找子單元,被配置為在預儲存的結果中查找是否存在與所述請求資訊對應的結果; 判定子單元,被配置為在預儲存的結果中查找到與所述請求資訊對應的結果時,判斷所述結果是否滿足所述有效期;若是,則確認所述結果為與所述第一電文匹配的第一結果,若否,則確認不存在所述第一結果。 Further, the result search unit includes: an extracting subunit configured to obtain the request information and an expiration date contained in the first message; the searching subunit is configured to search for the existence of the request information in the pre-stored result. The result corresponding to the information; the determination subunit is configured to determine whether the result meets the validity period when the result corresponding to the requested information is found in the pre-stored result; if so, confirm that the result is the same as the result The first result of the first message matching, if not, it is confirmed that the first result does not exist.

進一步,所述裝置還包括:服務檢測單元,被配置為基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定所述伺服器在當前週期內的服務可用性;結果儲存單元,被配置為依據所述當前週期內的服務可用性生成檢測的結果,對所述結果進行儲存。 Further, the device further includes: a service detection unit configured to determine the service availability of the server in the current cycle based on a health check performed on a designated port or service program of the server at regular intervals; and a result storage unit, It is configured to generate a detection result according to the service availability in the current period, and store the result.

進一步,所述請求資訊包括請求類型、目的地IP地址和目的地埠口。 Further, the request information includes request type, destination IP address and destination port.

進一步,所述指定類型的電文為健康檢查HC請求電文。 Further, the specified type of telegram is a health check HC request telegram.

與現有技術相比,本申請實施例包括以下優點:本申請實施例透過在檢測接收到的電文為指定類型的電文時,不直接將電文透明化傳輸給後端伺服器,而是先在本地預儲存的結果中查找與該電文匹配的結果,如果查找到匹配的結果則直接將該結果反饋至發送方,而不再將該電文透明化傳輸給後端伺服器,從而減小了後端伺服器對該類電文的處理量,減小了後端伺服器的電文處理壓力。當該方法應用於對後端伺服器的HC場景中時,可以減小後端伺服器對HC請求的處理壓力。 Compared with the prior art, the embodiments of the present application include the following advantages: The embodiments of the present application do not directly transparently transmit the text to the back-end server when detecting that the received text is a specified type of text, but first locally The pre-stored results search for the result that matches the message. If a matching result is found, the result will be directly fed back to the sender, instead of transparently transmitting the message to the back-end server, thereby reducing the back-end The server's processing volume of such messages reduces the pressure of the back-end server's message processing. When this method is applied to the HC scenario to the back-end server, the processing pressure of the back-end server to the HC request can be reduced.

501‧‧‧電文接收單元 501‧‧‧Text receiving unit

502‧‧‧結果查找單元 502‧‧‧Result search unit

503‧‧‧結果反饋單元 503‧‧‧Result feedback unit

601‧‧‧發送單元 601‧‧‧Sending unit

602‧‧‧結果接收單元 602‧‧‧Result receiving unit

603‧‧‧結果發送單元 603‧‧‧Result sending unit

604‧‧‧增加單元 604‧‧‧Additional unit

701‧‧‧提取子單元 701‧‧‧Extract subunit

702‧‧‧查找子單元 702‧‧‧Find subunit

703‧‧‧判定子單元 703‧‧‧Judgment subunit

801‧‧‧服務檢測單元 801‧‧‧Service Testing Unit

802‧‧‧結果儲存單元 802‧‧‧Result storage unit

圖1是本申請的一種電文處理方法實施例的步驟流程圖;圖2是本申請的另一種電文處理方法實施例的步驟流程圖;圖3是本申請中在預儲存的結果中查找是否存在與第一電文匹配的第一結果的方法實施例的步驟流程圖;圖4是本申請中兩個伺服器對後端伺服器發起HC請求示意圖;圖5是本申請的一種電文處理裝置實施例的結構方塊圖;圖6是本申請的另一種電文處理裝置實施例的結構方塊圖;圖7是本申請中一種結果查找單元的實施例的結構方塊圖;圖8是本申請的一種電文處理裝置優選實施例的結構方塊圖。 Figure 1 is a flowchart of the steps of an embodiment of a message processing method of this application; Figure 2 is a flowchart of steps of another embodiment of a message processing method of this application; Figure 3 is a search for existence in the pre-stored results in this application The flow chart of the method embodiment of the first result matching the first message; FIG. 4 is a schematic diagram of the two servers in this application initiating an HC request to the back-end server; FIG. 5 is an embodiment of a message processing device in this application Figure 6 is a structural block diagram of another embodiment of a message processing device of this application; Figure 7 is a structural block diagram of an embodiment of a result search unit in this application; Figure 8 is a message processing of this application A block diagram of the structure of a preferred embodiment of the device.

為使本申請的上述目的、特徵和優點能夠更加明顯易懂,下面結合附圖和具體實施方式對本申請作進一步詳細的說明。 In order to make the above objectives, features, and advantages of the application more obvious and understandable, the application will be further described in detail below in conjunction with the accompanying drawings and specific implementations.

參照圖1,示出了本申請的一種電文處理方法實施例的步驟流程圖,具體可以包括如下步驟: 1, it shows a flowchart of the steps of an embodiment of a method for processing a message according to the present application, which may specifically include the following steps:

步驟101,接收發送方發送的第一電文。 Step 101: Receive the first telegram sent by the sender.

本申請實施例中,用於進行電文處理的裝置(以下簡稱該裝置)可以是用於響應該電文的伺服器本身,或者設置在該伺服器內部的一模組,或者設置在該伺服器前端的獨立裝置且可以與伺服器進行互動。例如,在雲端計算的大規模負載均衡的場景中,各LVS伺服器和Proxy伺服器分別對後端伺服器發起HC的情況下,該裝置可以是後端伺服器本身或內置的一模組,也可以是設置在後端伺服器前的獨立裝置,例如健康檢查代理器(Health Check Proxy,HCP)。 In the embodiment of the present application, the device for processing the message (hereinafter referred to as the device) may be the server itself for responding to the message, or a module set inside the server, or set at the front end of the server Independent device and can interact with the server. For example, in the scenario of large-scale load balancing of cloud computing, when each LVS server and Proxy server respectively initiate HC to the back-end server, the device can be the back-end server itself or a built-in module. It can also be an independent device installed in front of the back-end server, such as a Health Check Proxy (HCP).

該裝置在本步驟中接收由發送方如LVS伺服器或Proxy伺服器等發送的第一電文,該第一電文可能是HC請求電文。 In this step, the device receives the first message sent by the sender, such as the LVS server or the proxy server, and the first message may be an HC request message.

步驟102,當第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與第一電文匹配的第一結果。 Step 102: When the first telegram is a designated type of telegram, search the pre-stored results for whether there is a first result matching the first telegram.

該裝置在接收到第一電文後,首先根據第一電文中包含的電文類型資訊確定該電文是否為指定類型的電文,如果是,則在預儲存的結果中查找是否存在與第一電文匹配的第一結果,如果不是,則可以根據電文類型資訊進行其它對應處理,或者將電文透明化傳輸給後端伺服器進行處理。 After the device receives the first telegram, it first determines whether the telegram is a designated type of telegram based on the telegram type information contained in the first telegram, and if so, searches the pre-stored results for whether there is a match with the first telegram The first result, if not, can perform other corresponding processing based on the message type information, or transparently transmit the message to the back-end server for processing.

其中,該指定類型的電文具體可以是HC請求電文。在其它應用場景,該指定類型的電文也可以是該裝置需要減少後端伺服器對該電文處理數量的電文。 Wherein, the specified type of message may specifically be an HC request message. In other application scenarios, the specified type of message may also be a message for which the device needs to reduce the number of messages processed by the back-end server.

該裝置預先儲存有與指定類型的電文相關聯的結果。其中,該結果的儲存步驟包括:基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定所述伺服器在當前週期內的服務可用性;依據所述當前週期內的服務可用性生成檢測的結果,對所述結果進行儲存。 The device pre-stores the results associated with the specified types of messages. Wherein, the step of storing the result includes: determining the service availability of the server in the current cycle based on a regular health check performed on the designated port or service program of the server; generating a detection based on the service availability in the current cycle The result of storing the result.

即該裝置可以定時對後端伺服器的指定埠口或服務做一次HC,來檢測伺服器在當前的定時週期內的服務是否可用,對應基於檢測得到的後端伺服器在這個週期內的服務可用性生成檢測結果進行儲存。或者後端伺服器基於該裝置的觸發定時進行自檢等,以確定自身在當前的定時週期內是否能夠提供服務,從而透過檢測得到的HC結果即後端伺服器在這個週期內的服務可用性,HC結果發送給該裝置進行儲存。透過上述裝置控制後端伺服器在一個週期內僅透過一次檢測確定該週期內的可用性即HC結果,在該週期內的各個HC請求均可使用該HC結果,而無需重複檢查,減小後端伺服器對HC請求的處理壓力。其中,所述服務指的是運行在伺服器上對外提供服務的服務程式。當接收到的第一電文為HC請求電文時,即可在該預先儲存的HC結果中查找是否存在與該第一電文相匹配的HC結果。具體請參見後續實施例的描述。 That is, the device can periodically perform an HC on the designated port or service of the back-end server to detect whether the service of the server is available in the current timing period, and correspond to the service of the back-end server in this period based on the detection. Usability generates test results for storage. Or the back-end server performs self-checks based on the trigger timing of the device to determine whether it can provide services in the current timing period, so that the HC result obtained through the detection is the service availability of the back-end server in this period. The HC results are sent to the device for storage. Through the above-mentioned device, the back-end server is controlled to determine the availability of the cycle, that is, the HC result, through only one test in a cycle. Each HC request in the cycle can use the HC result without repeating the check, reducing the back-end The server's processing pressure on HC requests. Wherein, the service refers to a service program running on the server to provide services to the outside. When the received first telegram is an HC request telegram, it is possible to find out whether there is an HC result matching the first telegram in the pre-stored HC results. For details, please refer to the description of the subsequent embodiments.

若查找到與第一電文匹配的第一結果則執行步驟103。 If the first result matching the first message is found, step 103 is executed.

步驟103,向發送方發送該第一結果。 Step 103: Send the first result to the sender.

該方法不僅可以應用於對後端伺服器的HC場景中, 還可以應用於其它需要減小後端伺服器對發送方週期性發送的同類型電文的處理場景中。 This method can not only be applied to the HC scenario of the back-end server, but also can be applied to other scenarios that need to reduce the processing of the same type of messages periodically sent by the back-end server to the sender.

本申請實施例透過在檢測接收到的電文為指定類型的電文時,不直接將電文透明化傳輸給後端伺服器,而是先在本地預儲存的結果中查找與該電文匹配的結果,如果查找到匹配的結果則直接將該結果反饋至發送方,而不再將該電文透明化傳輸給後端伺服器,從而減小了後端伺服器對該類電文的處理量,減小了後端伺服器的電文處理壓力。當該方法應用於對後端伺服器的HC場景中時,可以減小後端伺服器對HC請求的處理壓力。 The embodiment of this application does not directly transmit the message transparently to the back-end server when detecting that the received message is a specified type of message, but first searches for a result that matches the message in the locally pre-stored results, if If the matching result is found, the result will be directly fed back to the sender, instead of transparently transmitting the message to the back-end server, thereby reducing the amount of processing of this type of message by the back-end server and reducing the back-end server. The message processing pressure of the end server. When this method is applied to the HC scenario to the back-end server, the processing pressure of the back-end server to the HC request can be reduced.

在本申請的另一實施例中,當在預儲存的結果中不存在與第一電文匹配的第一結果時,如圖2所示,該方法還可以包括: In another embodiment of the present application, when there is no first result matching the first message among the pre-stored results, as shown in FIG. 2, the method may further include:

步驟201,當預儲存的結果中不存在第一結果時,將第一電文發送至伺服器。 Step 201: When the first result does not exist in the pre-stored results, the first message is sent to the server.

雖然會定時檢測後端伺服器來獲取HC結果,但是難免出現一些情況,使得在請求時無法查找到匹配的結果,此情況下為了及時獲取匹配的結果,該裝置在執行步驟102時,當查找的結果是預儲存的結果中不存在與第一電文匹配的第一結果時,此時該裝置無法直接向發送方反饋結果,而需要將第一電文透明化傳輸至(後端)伺服器,由(後端)伺服器進行處理。 Although the back-end server will be periodically checked to obtain the HC results, it is inevitable that there will be some situations that make it impossible to find the matching result when requested. In this case, in order to obtain the matching result in time, the device performs step 102 when searching The result of is that when there is no first result matching the first message among the pre-stored results, the device cannot directly feed back the result to the sender at this time, and the first message needs to be transparently transmitted to the (back-end) server. It is processed by the (backend) server.

步驟202,接收伺服器反饋的第二結果。 Step 202: Receive a second result fed back by the server.

(後端)伺服器按照現有方式對該第一電文進行處理, 並向該裝置返回處理獲得的第二結果。 The (back-end) server processes the first message in the existing manner, and returns the second result obtained by the processing to the device.

步驟203,向發送方發送第二結果。 Step 203: Send the second result to the sender.

該裝置在接收到第二結果後,向發送方反饋該第二結果。 After receiving the second result, the device feeds back the second result to the sender.

該裝置在執行步驟203的同時,也還可以進一步執行步驟204。 While the device performs step 203, it can also further perform step 204.

步驟204,在預儲存的結果中添加第二結果。 Step 204: Add a second result to the pre-stored results.

該裝置可以將該第二結果及其關聯資訊,例如結果獲取時間等增加至上述預儲存的結果中,或更新上述預儲存的結果,以便於後續可以利用該第二結果反饋發送方,而無需(後端)伺服器重複進行電文處理。 The device can add the second result and its associated information, such as the result acquisition time, to the above-mentioned pre-stored result, or update the above-mentioned pre-stored result, so that the second result can be subsequently used to feed back the sender without The (back-end) server repeats the message processing.

在本申請的另一實施例中,當第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與第一電文匹配的第一結果的過程,如圖3所示,可以包括: In another embodiment of the present application, when the first telegram is a designated type of telegram, the process of searching the pre-stored results for whether there is a first result matching the first telegram, as shown in FIG. 3, may include :

步驟301,獲取第一電文中包含的請求資訊及有效期。 Step 301: Obtain the request information and the validity period contained in the first message.

本實施例中,該請求資訊可以包括請求類型、目的地IP地址和目的地埠口。 In this embodiment, the request information may include the request type, destination IP address, and destination port.

以第一電文為HC請求電文為例,本實施例中可以在HC請求電文中增加表明HC請求電文類型的字節,例如,在HC請求的SYN(synchronous)電文中的TCP(Transmission Control Protocol,傳輸控制協議)Option中增加HC類型的字節:198-tcp,199-http,200-udp,除HC請求電文類型之外,還有有效期即interval資訊,表 明可以複用多長時間內的HC結果。 Taking the first message as an HC request message as an example, in this embodiment, a byte indicating the type of the HC request message can be added to the HC request message, for example, in the SYN (synchronous) message of the HC request, TCP (Transmission Control Protocol, Transmission control protocol) Add HC type bytes in Option: 198-tcp, 199-http, 200-udp, in addition to the HC request message type, there is also the validity period, ie interval information, indicating how long the HC can be reused result.

該裝置在接收到該第一電文後,即獲取該第一電文中的HC請求電文類型的字節,interval資訊,以及第一電文的RSIP(Real Server IP Address,目的地IP地址)和RSport(Real Server port,目的地埠口)。 After the device receives the first telegram, it obtains the bytes of the HC request telegram type in the first telegram, the interval information, and the RSIP (Real Server IP Address, destination IP address) and RSport ( Real Server port, destination port).

步驟302,在預儲存的結果中查找是否存在與請求資訊對應的結果。 Step 302: Search the pre-stored results for whether there is a result corresponding to the requested information.

該裝置中可以預先儲存有session表,該表中key為type-RSIP-RSport,value為更新時的結果和更新時間。 The device may pre-store a session table, in which the key is type-RSIP-RSport, and the value is the update result and update time.

本步驟首先根據上步驟獲得的HC請求電文類型的字節(type),以及RSIP和RSport,在session表中查找對應的value,如果查找到,則執行步驟303,如果沒有查找到則確認預儲存的結果中不存在與第一電文匹配的第一結果,繼而執行前述步驟201。 In this step, first, according to the byte (type) of the HC request message type obtained in the previous step, as well as RSIP and RSport, look up the corresponding value in the session table, if it is found, go to step 303, if it is not found, confirm the pre-storage There is no first result matching the first message among the results, and then the aforementioned step 201 is executed.

步驟303,判斷該結果是否滿足有效期。 Step 303: Determine whether the result meets the validity period.

在查找到對應的結果後,查看該結果的更新時間以及步驟301中獲得的有效期,例如interval是5s,則查看該結果的更新時間是否在5s以內,如果是,則確定該結果為與第一電文匹配的第一結果,然後執行前述步驟103;如果否,則該結果失效,確認預儲存的結果中不存在與第一電文匹配的第一結果,繼而執行前述步驟201。 After finding the corresponding result, check the update time of the result and the validity period obtained in step 301. For example, if the interval is 5s, check whether the update time of the result is within 5s. If so, determine that the result is the same as the first If the message matches the first result, then the aforementioned step 103 is executed; if not, the result is invalid, it is confirmed that there is no first result matching the first message among the pre-stored results, and then the aforementioned step 201 is executed.

下面以伺服器A、B分別對後端伺服器發起HC請求的情況為例進行說明。該裝置為HCP。 The following is an example in which servers A and B initiate HC requests to the back-end server respectively. The device is HCP.

如圖4所示,伺服器A、B分別發起HC請求,伺服 器A發起的HC請求中包含標識資訊及有效期資訊,具體為TCP OPT:type(199)interval(5)Src:192.168.0.1 DST:192.168.100.1:80。伺服器B發起的HC請求中包含標識資訊及有效期資訊,具體為TCP OPT:type(199)interval(5)Src:192.168.0.2 DST:192.168.100.1:80。HCP在接收到兩個HC請求後,分別在session表中查找對應的value,HCP查找到與伺服器B發送的HC請求匹配的結果,HCP直接將該結果返回至伺服器B,而不會將其HC請求發送給後端伺服器。HCP沒有查找到與伺服器A發送的HC請求匹配的結果,則將該HC請求發送至後端伺服器,後端伺服器進行處理後返回結果,HCP將該結果再反饋至伺服器A,並且HCP將該結果更新至其維護的session表中。 As shown in Figure 4, servers A and B respectively initiate HC requests. The HC request initiated by server A includes identification information and validity period information, specifically TCP OPT: type(199) interval(5) Src: 192.168.0.1 DST : 192.168.100.1:80. The HC request initiated by server B includes identification information and validity period information, specifically TCP OPT: type(199) interval(5) Src: 192.168.0.2 DST: 192.168.100.1:80. After HCP receives the two HC requests, it looks up the corresponding value in the session table. HCP finds the result that matches the HC request sent by server B, and HCP directly returns the result to server B instead of The HC request is sent to the back-end server. HCP does not find a result that matches the HC request sent by server A, then sends the HC request to the back-end server, and the back-end server returns the result after processing, and HCP feeds back the result to server A, and HCP updates the result to the session table it maintains.

該方法可以定時對後端伺服器的指定埠口或服務做一次HC,HC的結果作為後端伺服器在這個週期內的服務可用性,其他的HC請求方也都使用這個週期的檢查結果,不做重複檢查。本實施例透過在HC請求發起方和後端服務之間建立HCP的方式,做到在一個HC週期內,只允許一個HC請求到達後端伺服器,其他HC請求複用這個HC請求結果的方式,來到達減少後端伺服器對HC請求的處理量的目的。 This method can periodically perform HC on the designated port or service of the back-end server. The result of HC is used as the service availability of the back-end server in this period. Other HC requesters also use the check result of this period. Do repeated checks. In this embodiment, by establishing an HCP between the HC request initiator and the back-end service, only one HC request is allowed to reach the back-end server within an HC cycle, and other HC requests reuse the HC request result. , To achieve the purpose of reducing the processing volume of HC requests by the back-end server.

需要說明的是,對於方法實施例,為了簡單描述,故將其都表述為一系列的動作組合,但是本領域技術人員應該知悉,本申請實施例並不受所描述的動作順序的限制, 因為依據本申請實施例,某些步驟可以採用其他順序或者同時進行。其次,本領域技術人員也應該知悉,說明書中所描述的實施例均屬於優選實施例,所涉及的動作並不一定是本申請實施例所必須的。 It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should know that the embodiments of this application are not limited by the described sequence of actions, because According to the embodiments of the present application, certain steps may be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

參照圖5,示出了本申請一種電文處理裝置實施例的結構方塊圖,具體可以包括如下單元: Referring to FIG. 5, there is shown a structural block diagram of an embodiment of a message processing apparatus according to the present application, which may specifically include the following units:

電文接收單元501,被配置為接收發送方發送的第一電文。 The message receiving unit 501 is configured to receive the first message sent by the sender.

結果查找單元502,被配置為當所述第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果。 The result searching unit 502 is configured to search the pre-stored results for whether there is a first result matching the first message when the first message is a designated type of message.

結果反饋單元503,被配置為當所述查找單元查找到與所述第一電文匹配的第一結果是,向所述發送方發送所述第一結果。 The result feedback unit 503 is configured to send the first result to the sender when the search unit finds a first result that matches the first message.

本申請實施例中該裝置透過上述單元在檢測接收到的電文為指定類型的電文時,不直接將電文透明化傳輸給後端伺服器,而是先在本地預儲存的結果中查找與該電文匹配的結果,如果查找到匹配的結果則直接將該結果反饋至發送方,而不再將該電文透明化傳輸給後端伺服器,從而減小了後端伺服器對該類電文的處理量,減小了後端伺服器的電文處理壓力。當該裝置應用於對後端伺服器的HC場景中時,可以減小後端伺服器對HC請求的處理壓力。 In the embodiment of this application, when the device detects that the received message is a specified type of message through the above-mentioned unit, it does not directly transmit the message transparently to the back-end server, but first searches the local pre-stored results for the message. The matching result, if a matching result is found, the result will be directly fed back to the sender, instead of transparently transmitting the message to the back-end server, thereby reducing the back-end server's processing volume of this type of message , Which reduces the pressure on the back-end server to process messages. When the device is used in the HC scenario to the back-end server, the pressure of the back-end server to process the HC request can be reduced.

在另一實施例中,如圖6所示,該裝置還可以包括: In another embodiment, as shown in FIG. 6, the device may further include:

發送單元601,被配置為當所述預儲存的結果中不存 在所述第一結果時,將所述第一電文發送至伺服器; The sending unit 601 is configured to send the first message to the server when the first result does not exist in the pre-stored result;

結果接收單元602,被配置為接收所述伺服器反饋的第二結果; The result receiving unit 602 is configured to receive the second result fed back by the server;

結果發送單元603,被配置為向所述發送方發送所述第二結果。 The result sending unit 603 is configured to send the second result to the sender.

該裝置也還可以包括: The device may also include:

增加單元604,被配置為在所述預儲存的結果中添加所述第二結果。 The adding unit 604 is configured to add the second result to the pre-stored result.

在另一實施例中,如圖7所示,結果查找單元502可以進一步包括: In another embodiment, as shown in FIG. 7, the result search unit 502 may further include:

提取子單元701,被配置為獲取所述第一電文中包含的請求資訊及有效期。 The extraction subunit 701 is configured to obtain the request information and the validity period contained in the first message.

查找子單元702,被配置為在預儲存的結果中查找是否存在與所述請求資訊對應的結果。 The search sub-unit 702 is configured to search the pre-stored results for whether there is a result corresponding to the requested information.

判定子單元703,被配置為在預儲存的結果中查找到與所述請求資訊對應的結果時,判斷所述結果是否滿足所述有效期;若是,則確認所述結果為與所述第一電文匹配的第一結果,若否,則確認不存在所述第一結果。 The judging subunit 703 is configured to, when finding a result corresponding to the requested information in the pre-stored result, judge whether the result meets the validity period; if so, confirm that the result is the same as the first message The matched first result, if not, confirm that the first result does not exist.

在另一實施例中,如圖8所示,該裝置還可以包括: In another embodiment, as shown in FIG. 8, the device may further include:

服務檢測單元801,被配置為基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定所述伺服器在當前週期內的服務可用性。 The service detection unit 801 is configured to determine the service availability of the server in the current cycle based on a health check performed on a designated port or service program of the server at regular intervals.

結果儲存單元803,被配置為依據所述當前週期內的服務可用性生成檢測的結果,對所述結果進行儲存。 The result storage unit 803 is configured to generate a detection result according to the service availability in the current period, and store the result.

上述請求資訊可以包括請求類型、RSIP和RSport。 The above request information may include request type, RSIP and RSport.

上述指定類型的電文可以是HC請求電文。 The above specified type of message may be an HC request message.

本申請實施例還提供了一種電子設備,包括儲存器、收發器和處理器。 An embodiment of the present application also provides an electronic device, including a storage, a transceiver, and a processor.

處理器與收發器、儲存器透過匯流排相互連接;匯流排可以是ISA匯流排、PCI匯流排或EISA匯流排等。所述匯流排可以分為地址匯流排、資料匯流排、控制匯流排等。 The processor, the transceiver, and the storage are connected to each other through a bus; the bus can be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc.

其中,儲存器用於儲存一段程式,具體地,程式可以包括程式代碼,所述程式代碼包括計算機操作指令。儲存器可能包含高速RAM儲存器,也可能還包括非易失性記憶體(non-volatile memory),例如至少一個磁碟儲存器。 Wherein, the memory is used to store a program. Specifically, the program may include program code, and the program code includes computer operation instructions. The storage may include a high-speed RAM storage, and may also include a non-volatile memory (non-volatile memory), such as at least one magnetic disk storage.

收發器用於接收發送方發送的第一電文;向所述發送方發送第一結果。 The transceiver is used to receive the first message sent by the sender; and send the first result to the sender.

處理器用於讀取儲存器中的程式代碼,執行以下步驟:當所述第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與所述第一電文匹配的第一結果;若是,則通知收發器向發送方發送第一結果。 The processor is configured to read the program code in the memory, and perform the following steps: when the first message is a message of a specified type, search the pre-stored results for whether there is a first result that matches the first message; If so, the transceiver is notified to send the first result to the sender.

對於裝置實施例而言,由於其與方法實施例基本相似,所以描述的比較簡單,相關之處參見方法實施例的部分說明即可。 As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.

本說明書中的各個實施例均採用漸進的方式描述,每個實施例重點說明的都是與其他實施例的不同之處,各個 實施例之間相同相似的部分互相參見即可。 The various embodiments in this specification are described in a gradual manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other.

本領域內的技術人員應明白,本申請實施例的實施例可提供為方法、裝置、或計算機程式產品。因此,本申請實施例可採用完全硬體實施例、完全軟體實施例、或結合軟體和硬體方面的實施例的形式。而且,本申請實施例可採用在一個或多個其中包含有計算機可用程式代碼的計算機可用儲存媒體(包括但不限於磁碟儲存器、CD-ROM、光學儲存器等)上實施的計算機程式產品的形式。 Those skilled in the art should understand that the embodiments of the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the embodiments of the present application may adopt the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. form.

在一個典型的配置中,所述計算機設備包括一個或多個處理器(CPU)、輸入/輸出介面、網路介面和內存記憶體。內存記憶體可能包括計算機可讀媒體中的非永久性記憶體,隨機存取記憶體(RAM)和/或非易失性內存記憶體等形式,如唯讀記憶體(ROM)或快閃內存記憶體(flash RAM)。內存記憶體是計算機可讀媒體的示例。計算機可讀媒體包括永久性和非永久性、可移動和非可移動媒體可以由任何方法或技術來實現資訊儲存。資訊可以是計算機可讀指令、資料結構、程式的模組或其他資料。計算機的儲存媒體的例子包括,但不限於相變內存記憶體(PRAM)、靜態隨機存取記憶體(SRAM)、動態隨機存取記憶體(DRAM)、其他類型的隨機存取記憶體(RAM)、唯讀記憶體(ROM)、電可抹除可編程唯讀記憶體(EEPROM)、快閃記憶體或其他內存技術、唯讀光碟唯讀記憶體(CD-ROM)、數位多功能光碟(DVD)或其他光學儲存、磁盒式磁帶,磁帶磁碟儲存或其他磁性儲存設備或任何其他非傳 輸媒體,可用於儲存可以被計算設備存取的資訊。按照本文中的界定,計算機可讀媒體不包括非持續性的電腦可讀媒體(transitory media),如調變的資料信號和載波。 In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. Memory memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory. Memory (flash RAM). Memory memory is an example of computer-readable media. Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), and other types of random access memory (RAM). ), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital multi-function disc (DVD) or other optical storage, magnetic cassette tape, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-persistent computer-readable media (transitory media), such as modulated data signals and carrier waves.

本申請實施例是參照根據本申請實施例的方法、終端設備(系統)、和計算機程式產品的流程圖和/或方方塊圖來描述的。應理解可由計算機程式指令實現流程圖和/或方方塊圖中的每一流程和/或方塊、以及流程圖和/或方方塊圖中的流程和/或方塊的結合。可提供這些計算機程式指令到通用計算機、專用計算機、嵌入式處理機或其他可編程資料處理終端設備的處理器以產生一個機器,使得透過計算機或其他可編程資料處理終端設備的處理器執行的指令產生用於實現在流程圖一個流程或多個流程和/或方方塊圖一個方框或多個方框中指定的功能的裝置。 The embodiments of the present application are described with reference to the flowcharts and/or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing terminal equipment to generate a machine, so that the instructions can be executed by the processor of the computer or other programmable data processing terminal equipment A device for realizing the functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram is generated.

這些計算機程式指令也可儲存在能引導計算機或其他可編程資料處理終端設備以特定方式工作的計算機可讀儲存器中,使得儲存在該計算機可讀儲存器中的指令產生包括指令裝置的製造品,該指令裝置實現在流程圖一個流程或多個流程和/或方方塊圖一個方塊或多個方塊中指定的功能。 These computer program instructions can also be stored in a computer-readable storage that can guide a computer or other programmable data processing terminal equipment to work in a specific manner, so that the instructions stored in the computer-readable storage produce a manufactured product including the instruction device , The instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

這些計算機程式指令也可裝載到計算機或其他可編程資料處理終端設備上,使得在計算機或其他可編程終端設備上執行一系列操作步驟以產生計算機實現的處理,從而在計算機或其他可編程終端設備上執行的指令提供用於實現在流程圖一個流程或多個流程和/或方方塊圖一個方框 或多個方框中指定的功能的步驟。 These computer program instructions can also be loaded on a computer or other programmable data processing terminal equipment, so that a series of operation steps are executed on the computer or other programmable terminal equipment to produce computer-implemented processing, so that the computer or other programmable terminal equipment The instructions executed above provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

儘管已描述了本申請實施例的優選實施例,但本領域內的技術人員一旦得知了基本創造性概念,則可對這些實施例做出另外的變更和修改。所以,所附權利要求意欲解釋為包括優選實施例以及落入本申請實施例範圍的所有變更和修改。 Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.

最後,還需要說明的是,在本文中,諸如第一和第二等之類的關係術語僅僅用來將一個實體或者操作與另一個實體或操作區分開來,而不一定要求或者暗示這些實體或操作之間存在任何這種實際的關係或者順序。而且,術語“包括”、“包含”或者其任何其他變體意在涵蓋非排他性的包含,從而使得包括一系列要件的過程、方法、物品或者終端設備不僅包括那些要件,而且還包括沒有明確列出的其他要件,或者是還包括為這種過程、方法、物品或者終端設備所固有的要件。在沒有更多限制的情況下,由語句“包括一個......”限定的要件,並不排除在包括所述要件的過程、方法、物品或者終端設備中還存在另外的相同要件。 Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities. Or there is any such actual relationship or sequence between operations. Moreover, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes those elements that are not explicitly listed. The other elements listed, or also include elements inherent to this process, method, article, or terminal device. If there are no more restrictions, the elements defined by the sentence "including a..." do not exclude the existence of other identical elements in the process, method, article, or terminal device that includes the elements.

以上對本申請所提供的一種電文處理方法和一種電文處理裝置,進行了詳細介紹,本文中應用了具體個例對本申請的原理及實施方式進行了闡述,以上實施例的說明只是用於幫助理解本申請的方法及其核心思想;同時,對於本領域的一般技術人員,依據本申請的思想,在具體實施方式及應用範圍上均會有改變之處,綜上所述,本說明書 內容不應理解為對本申請的限制。 The text processing method and the text processing device provided by this application are described in detail above. Specific examples are used in this article to explain the principle and implementation of the application. The description of the above embodiments is only used to help understand this application. The method of application and its core idea; meanwhile, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood It is a restriction on this application.

Claims (12)

一種電文處理方法,其特徵在於,包括:接收發送方發送的第一電文;當該第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與該第一電文匹配的第一結果,其中該預儲存的結果為依據在當前週期內的服務可用性生成檢測的結果;若是,則向該發送方發送該第一結果;當該預儲存的結果中不存在該第一結果時,將該第一電文發送至伺服器;接收該伺服器反饋的第二結果;向該發送方發送該第二結果。 A message processing method, characterized by comprising: receiving a first message sent by a sender; when the first message is a specified type of message, searching for a pre-stored result whether there is a first message that matches the first message. As a result, the pre-stored result is the result of the detection based on the service availability in the current period; if it is, the first result is sent to the sender; when the first result does not exist in the pre-stored result, Sending the first message to the server; receiving the second result fed back by the server; sending the second result to the sender. 根據申請專利範圍第1項所述的方法,其中,該方法還包括:在該預儲存的結果中添加該第二結果。 The method according to item 1 of the scope of patent application, wherein the method further comprises: adding the second result to the pre-stored result. 根據申請專利範圍第1項所述的方法,其中,該在預儲存的結果中查找是否存在與該第一電文匹配的第一結果,包括:獲取該第一電文中包含的請求資訊及有效期;在預儲存的結果中查找是否存在與該請求資訊對應的結果;若存在,則判斷該結果是否滿足該有效期;若是,則確認該結果為與該第一電文匹配的第一結果,若否,則確認不存在該第一結果。 The method according to item 1 of the scope of patent application, wherein the searching of the pre-stored results for whether there is a first result matching the first message includes: obtaining the request information and the validity period contained in the first message; Search in the pre-stored results whether there is a result corresponding to the requested information; if so, determine whether the result meets the validity period; if it is, confirm that the result is the first result that matches the first message, if not, It is confirmed that the first result does not exist. 根據申請專利範圍第1項所述的方法,其中,該方 法還包括:基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定該伺服器在當前週期內的服務可用性;依據該當前週期內的服務可用性生成檢測的結果,對該結果進行儲存。 According to the method described in item 1 of the scope of patent application, the party The method also includes: determining the service availability of the server in the current cycle based on a regular health check performed on the designated port or service program of the server; generating a detection result based on the service availability in the current cycle, and performing the result store. 根據申請專利範圍第3項所述的方法,其中,該請求資訊包括請求類型、目的地IP地址和目的地埠口。 According to the method described in item 3 of the scope of patent application, the request information includes the request type, the destination IP address and the destination port. 根據申請專利範圍第1至5項中任意一項所述的方法,其中,該指定類型的電文為健康檢查HC請求電文。 The method according to any one of items 1 to 5 in the scope of patent application, wherein the specified type of telegram is a health check HC request telegram. 一種電文處理裝置,其特徵在於,包括:電文接收單元,被配置為接收發送方發送的第一電文;結果查找單元,被配置為當該第一電文為指定類型的電文時,在預儲存的結果中查找是否存在與該第一電文匹配的第一結果,其中該預儲存的結果為依據在當前週期內的服務可用性生成檢測的結果;結果反饋單元,被配置為當該查找單元查找到與該第一電文匹配的第一結果是,向該發送方發送該第一結果;發送單元,被配置為當該預儲存的結果中不存在該第一結果時,將該第一電文發送至伺服器;結果接收單元,被配置為接收該伺服器反饋的第二結果;結果發送單元,被配置為向該發送方發送該第二結果。 A message processing device, which is characterized by comprising: a message receiving unit configured to receive a first message sent by a sender; and a result searching unit configured to store a message in a pre-stored message when the first message is of a specified type Find in the result whether there is a first result that matches the first message, wherein the pre-stored result is the result of the detection generated based on the service availability in the current period; the result feedback unit is configured to when the search unit finds the The first result of the first message matching is to send the first result to the sender; the sending unit is configured to send the first message to the server when the first result does not exist in the pre-stored results The result receiving unit is configured to receive the second result fed back by the server; the result sending unit is configured to send the second result to the sender. 根據申請專利範圍第7項所述的裝置,其中,該裝置還包括:增加單元,被配置為在該預儲存的結果中添加該第二結果。 The device according to item 7 of the scope of patent application, wherein the device further includes an adding unit configured to add the second result to the pre-stored result. 根據申請專利範圍第7項所述的裝置,其中,該結果查找單元包括:提取子單元,被配置為獲取該第一電文中包含的請求資訊及有效期;查找子單元,被配置為在預儲存的結果中查找是否存在與該請求資訊對應的結果;判定子單元,被配置為在預儲存的結果中查找到與該請求資訊對應的結果時,判斷該結果是否滿足該有效期;若是,則確認該結果為與該第一電文匹配的第一結果,若否,則確認不存在該第一結果。 The device according to item 7 of the scope of patent application, wherein the result search unit includes: an extraction sub-unit configured to obtain the request information and the validity period contained in the first message; and the search sub-unit is configured to pre-store Find in the result of whether there is a result corresponding to the request information; the determination sub-unit is configured to find a result corresponding to the request information in the pre-stored result, determine whether the result meets the validity period; if so, confirm The result is the first result matching the first message. If not, it is confirmed that the first result does not exist. 根據申請專利範圍第7項所述的裝置,其中,該裝置還包括:服務檢測單元,被配置為基於定時對伺服器的指定埠口或服務程式執行的健康檢查,確定該伺服器在當前週期內的服務可用性;結果儲存單元,被配置為依據該當前週期內的服務可用性生成檢測的結果,對該結果進行儲存。 The device according to item 7 of the scope of patent application, wherein the device further includes: a service detection unit configured to determine that the server is in the current cycle based on a regular health check performed on a designated port or service program of the server The result storage unit is configured to generate a detection result according to the service availability in the current period, and store the result. 根據申請專利範圍第9項所述的裝置,其中,該請求資訊包括請求類型、目的地IP地址和目的地埠口。 The device according to item 9 of the scope of patent application, wherein the request information includes request type, destination IP address and destination port. 根據申請專利範圍第7至11項中任意一項所述的裝 置,其中,該指定類型的電文為健康檢查HC請求電文。 According to the device described in any one of items 7 to 11 in the scope of the patent application The specified type of telegram is a health check HC request telegram.
TW106102246A 2017-01-20 2017-01-20 Method and device for processing telegrams TWI720113B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106102246A TWI720113B (en) 2017-01-20 2017-01-20 Method and device for processing telegrams

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106102246A TWI720113B (en) 2017-01-20 2017-01-20 Method and device for processing telegrams

Publications (2)

Publication Number Publication Date
TW201828669A TW201828669A (en) 2018-08-01
TWI720113B true TWI720113B (en) 2021-03-01

Family

ID=63960372

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106102246A TWI720113B (en) 2017-01-20 2017-01-20 Method and device for processing telegrams

Country Status (1)

Country Link
TW (1) TWI720113B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932444A (en) * 2012-10-29 2013-02-13 上海银商资讯有限公司 Load balancing module in financial real-time trading system
CN103181129A (en) * 2011-10-25 2013-06-26 华为技术有限公司 Data message processing method and system, message forwarding device
CN104301184A (en) * 2014-10-31 2015-01-21 北京百度网讯科技有限公司 Link health checking method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103181129A (en) * 2011-10-25 2013-06-26 华为技术有限公司 Data message processing method and system, message forwarding device
CN102932444A (en) * 2012-10-29 2013-02-13 上海银商资讯有限公司 Load balancing module in financial real-time trading system
CN104301184A (en) * 2014-10-31 2015-01-21 北京百度网讯科技有限公司 Link health checking method and device

Also Published As

Publication number Publication date
TW201828669A (en) 2018-08-01

Similar Documents

Publication Publication Date Title
WO2017080386A1 (en) Method and device for processing message
CN110839078B (en) Proxy push
WO2017114206A1 (en) Method and device for processing short link, and short link server
US10110538B2 (en) Method and apparatus for message transmission
TWI679550B (en) Account login method and device
WO2017045538A1 (en) Http-based cache, request and response methods, and corresponding apparatuses
EP3490304B1 (en) Method for identifying access point and hotspot, and related products
EP3159803B1 (en) Data storage method and network interface card
US8364756B1 (en) Connection sharing
JP2019510247A5 (en) System and method for multimodal transmission of packetized data
US10291527B2 (en) Fragmented packet processing resource determination
JP2016525257A5 (en)
CN113259479B (en) Data processing method and equipment
WO2017218659A1 (en) Generating and transmitting back-to-source routing information
US20190205976A1 (en) Account number registration method, apparatus, and system
CN103401946A (en) HTTP (hyper text transfer protocol) uploading acceleration method and system
TW201933832A (en) Communication method and apparatus, and electronic device
JP6687802B2 (en) Service processing method and apparatus
CN110943876B (en) URL state detection method, device, equipment and system
TWI720113B (en) Method and device for processing telegrams
WO2017088294A1 (en) Method and device for establishing wireless connection
US9876859B1 (en) Client session timeout with automatic refresh
US9866390B2 (en) Data transmitting method suitable to client and server, data transmitting system and data transmitting method for client suitable to transmit and receive data to and from server
CN104618324A (en) Method and device for transmitting data and detecting data legality
CN109660589B (en) Request processing method and device and electronic equipment