WO2017000572A1 - 基于因特网内容适配协议的通信方法、客户端和服务器 - Google Patents

基于因特网内容适配协议的通信方法、客户端和服务器 Download PDF

Info

Publication number
WO2017000572A1
WO2017000572A1 PCT/CN2016/074699 CN2016074699W WO2017000572A1 WO 2017000572 A1 WO2017000572 A1 WO 2017000572A1 CN 2016074699 W CN2016074699 W CN 2016074699W WO 2017000572 A1 WO2017000572 A1 WO 2017000572A1
Authority
WO
WIPO (PCT)
Prior art keywords
icap
message
request message
client
sequence number
Prior art date
Application number
PCT/CN2016/074699
Other languages
English (en)
French (fr)
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 中兴通讯股份有限公司
Publication of WO2017000572A1 publication Critical patent/WO2017000572A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • H04L69/085Protocols for interworking; Protocol conversion specially adapted for interworking of IP-based networks with other networks

Definitions

  • This document relates to communication technologies based on the Internet Content Adaptation Protocol (ICAP), and more particularly to ICAP-based communication methods and corresponding clients and servers.
  • ICAP Internet Content Adaptation Protocol
  • ICAP Internet Engineering Task Force
  • the ICAP Client is a client that supports the ICAP protocol. It can be either a PC/terminal that supports the ICAP protocol software or a carrier-class network node device that implements the ICAP protocol. It obtains related resources for business processing by sending relevant request messages to the ICAP Server.
  • the ICAP Server is a server that supports the ICAP protocol, that is, a PC/terminal/commercial server that supports the ICAP protocol software, or a carrier-class network node device that implements the ICAP protocol. After performing related service processing on the ICAP protocol message sent by the ICAP client, it returns a response message to the ICAP Client, and carries relevant resources required by the ICAP client.
  • the current ICAP protocol sends a request message in a serial manner. It is required to send the next request message only after receiving the response message corresponding to the previous request message on a TCP link, as shown in Figure 1:
  • Step 1 The ICAP client sends a request message to the ICAP server.
  • Step 2 After receiving the request message (Request), the ICAP server sends a response message (Response) to the ICAP client.
  • Step N After receiving the response message, the ICAP client sends a request message to the ICAP server again.
  • Step N+1 After receiving the request message, the ICAP server sends a response message to the ICAP client again.
  • the ICAP client sends a request message A to the ICAP server, and after waiting for the response message of the ICAP server for the request message A to time out, the TCP link is marked as available by the ICAP client, and the ICAP client sends the message.
  • the next request message B is sent to the ICAP server, and after waiting for the ICAP server to respond to the request message B, the response message corresponding to the request message A is received on the TCP link (due to the network delay). Or the ICAP server responds slowly.
  • the ICAP client treats the response message of the request message A as the response message of the request message B, causing a system exception. Therefore, it is necessary to solve the problem of the out of order of the ICAP protocol request message and the response message.
  • the ICAP protocol requires a pair of request messages and response messages on a TCP link, and the next pair of request messages and response messages are in a serial relationship, the messages cannot be processed in parallel on one TCP link, resulting in a TCP chain. The use of the road is wasted.
  • the present invention will provide an ICAP-based communication method and corresponding client and server to solve at least one of the above problems.
  • the ICAP client generates a request message, and when the request message is generated, the ICAP client writes a message sequence number in the request message;
  • the ICAP client sends the generated request message to an ICAP server.
  • the step of the ICAP client writing the message sequence number in the request message includes:
  • the ICAP client writes the message sequence number in an extension field of the request message.
  • the method further includes:
  • the ICAP client starts a waiting timer for the request message and saves the request message
  • the ICAP client does not receive the response message returned by the ICAP server, and discards the saved request message, where the message sequence number in the response message is in the request message.
  • the message sequence number is the same.
  • the method further includes:
  • the ICAP client After receiving the response message returned by the ICAP server, the ICAP client searches for the request message with the same message sequence number as the message sequence number in the response message from the saved request message:
  • the response message is discarded.
  • the ICAP client performs messaging in a serial or parallel manner on the same TCP link to the ICAP server.
  • the message sequence number includes a digital serial number, or includes a timestamp and a digital serial number
  • the message sequence number is not repeated during the system runtime or during the set operating period.
  • An Internet Content Adaptation Protocol ICAP client includes a generating device and a transmitting device, wherein:
  • the generating means is configured to: generate a request message, and when the request message is generated, write a message sequence number in the request message;
  • the transmitting device is configured to: send the generated request message to the ICAP server.
  • the sending device is further configured to:
  • the response message returned by the ICAP server is not received, and the saved request message is discarded, wherein the message sequence number in the response message is the same as the message sequence number in the request message. .
  • the client further includes a receiving device, wherein
  • the receiving device is configured to: after receiving the response message returned by the ICAP server, look up the request message with the same message sequence number as the message sequence number in the response message from the saved request message:
  • the response message is discarded.
  • the sending device and the receiving device perform message transmission in a serial or parallel manner on the same TCP link of the ICAP client to the ICAP server.
  • the ICAP server After receiving the request message sent by the ICAP client, the ICAP server reads the message sequence number in the request message;
  • the ICAP server generates a response message corresponding to the request message, and writes the message sequence number in the response message;
  • the ICAP server sends the generated response message to the ICAP client.
  • the step of the ICAP server writing the message sequence number in the response message includes:
  • the ICAP server writes the message sequence number in an extension field of the response message.
  • An Internet content adaptation protocol ICAP server includes a receiving device, a generating device, and a transmitting device, wherein
  • the receiving device is configured to: after receiving a request message sent by the ICAP client, read the message sequence number in the request message;
  • the generating means is configured to: generate a response message corresponding to the request message, and write the message sequence number in the response message;
  • the sending device is configured to: send the generated response message to the ICAP client.
  • a computer program including program instructions, when the program instructions are executed by an ICAP client,
  • the ICAP client is enabled to perform any of the ICAP client-side ICAP-based communication methods described above.
  • a computer program comprising program instructions that, when executed by an ICAP server, cause the ICAP server to perform any of the ICAP server-side ICAP-based communication methods described above.
  • the foregoing solution can solve the out-of-order problem of the request message and the response message pair on the TCP link, and can also perform the message transmission and reception in a parallel manner, which significantly improves the usage rate of the TCP link.
  • Figure 1 is a flow chart of the standard signaling interaction of the current ICAP protocol.
  • Figure 2 is a flow chart of the current ICAP protocol occurrence message pair out of order.
  • FIG. 3 is a flowchart of a method for communication on an ICAP client side according to an embodiment of the present invention.
  • FIG. 4 is a block diagram of an ICAP client according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a communication method on the ICAP server side according to Embodiment 2 of the present invention.
  • FIG. 6 is a block diagram of an ICAP server according to Embodiment 2 of the present invention.
  • FIG. 7 is a flowchart of an application example signaling interaction according to the present invention.
  • This embodiment provides an ICAP-based communication method, which is applied to an ICAP client, as shown in FIG. 3, and includes:
  • Step 110 When the ICAP client generates the request message, write the message sequence number in the request message.
  • the message sequence number can be written in the extension field of the request message.
  • the message serial number may include a numeric serial number or a time stamp and a numeric serial number to ensure that it is not repeated during the system running time or during the set running time period (eg, 1 hour, 1 day, etc.).
  • the message sequence number includes a 16-bit timestamp (accurate to the second) and a 6-digit number sequence with a total of 20-bit strings.
  • the message sequence number is 20150621162401000001, ensuring that looping does not occur during system runtime.
  • Step 120 The ICAP client sends the generated request message to the ICAP server.
  • the message can be saved and discarded as follows:
  • the ICAP client has not received the response message with the message sequence number returned by the ICAP server and the message sequence number in the request message, and discards the saved request message.
  • the received response message may be processed as follows:
  • the ICAP client After receiving the response message returned by the ICAP server, the ICAP client searches for the request message with the same message sequence number as the message sequence number in the response message from the saved request message:
  • the response message is discarded.
  • each pair of request message and response message can be correctly matched, so that the ICAP client can perform message transmission in parallel on the same TCP link to the ICAP server.
  • the ICAP client When the message is sent and received in the serial mode, after the ICAP client sends a request message, it must receive the corresponding response message or the corresponding waiting timer expires before sending the next request message, and transmitting and receiving the message in parallel.
  • the ICAP client sends a request message, it does not need to receive the corresponding response message or the corresponding waiting timer expires, and the next request message can be sent.
  • the embodiment further provides an ICAP protocol client, as shown in FIG. 4, including:
  • the generating device 10 is configured to: when generating the request message, write the message serial number in the request message;
  • the transmitting device 20 is configured to: send the generated request message to the ICAP server.
  • the transmitting device 10 sends the generated request message to the ICAP server, it is further configured to: start a waiting timer for the request message, and save the request message; if the waiting timer expires, it has not received
  • the message sequence number returned by the ICAP server is the same as the message sequence number in the request message, and the saved request message is discarded.
  • the receiving device 30 is configured to: after receiving a response message returned by the ICAP server, search for a request message with the same message sequence number as the message sequence number in the response message from the saved request message: if found, the The response message is processed; if not found, the response message is discarded.
  • the transmitting device 20 and the receiving device 30 perform messaging in a serial or parallel manner on the same TCP link to the ICAP server.
  • This embodiment provides an ICAP-based communication method, which is applied to an ICAP server, as shown in FIG. 5, and includes:
  • Step 210 After receiving the request message sent by the ICAP client, the ICAP server reads the message sequence number in the request message.
  • the message sequence number can be written in the extension field of the response message.
  • Step 220 The ICAP server generates a response message corresponding to the request message, and writes the message sequence number in the response message.
  • Step 230 The ICAP server sends the generated response message to the ICAP client.
  • the embodiment further provides an ICAP server, as shown in FIG. 6, including:
  • the receiving device 50 is configured to: after receiving a request message sent by the ICAP client, read the message sequence number in the request message;
  • the generating device 60 is configured to: generate a response message corresponding to the request message, where the response is cancelled Writing the message serial number in the message;
  • the sending device 70 is configured to: send the generated response message to the ICAP client.
  • the above embodiment can solve the request message and the response message on the TCP link by writing the message sequence number in the extension field added in the request message and the response message, so that the ICAP client tag identifies each pair of request message and response message.
  • the message can be sent and received in parallel, which significantly improves the usage of the TCP link.
  • the ICAP client searches for the matching request message locally through the message sequence number, because the waiting request message A has been discarded. , the matching request message is not found, so the ICAP client discards the response message A;
  • the above request message and response message may be various types of request and response messages between the ICAP client and the ICAP server.
  • the embodiment of the invention also discloses a computer program, including program instructions, when the program instruction When executed by the ICAP client, the ICAP client can perform any of the ICAP client-side ICAP-based communication methods described above.
  • the embodiment of the invention also discloses a carrier carrying the computer program.
  • the embodiment of the invention also discloses a computer program, including program instructions, when the program instruction is executed by the ICAP server, so that the ICAP server can execute any ICAP server-side ICAP-based communication method.
  • the embodiment of the invention also discloses a carrier carrying the computer program.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the foregoing solution can solve the out-of-order problem of the request message and the response message pair on the TCP link, and can also perform the message transmission and reception in a parallel manner, which significantly improves the usage rate of the TCP link. Therefore, the present invention has strong industrial applicability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

一种基于因特网内容适配协议的通信方法、客户端和服务器,其中的通信方法包括:ICAP客户端生成请求消息时,在请求消息中写入消息序列号;所述ICAP客户端向ICAP服务器发送生成的请求消息。其中的ICAP客户端,包括:生成装置,设置成:生成请求消息时,在请求消息中写入消息序列号;发送装置,设置成:向ICAP服务器发送生成的请求消息。其中的ICAP服务器收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号,生成对应该请求消息的一响应消息时在该响应消息中写入所述消息序列号。本技术方案能够解决TCP链路上的请求消息与响应消息对的乱序问题。

Description

基于因特网内容适配协议的通信方法、客户端和服务器 技术领域
本文涉及基于基于因特网内容适配协议(ICAP:Internet Content Adaptation Protocol)的通信技术,更具体地,涉及基于ICAP的通信方法及相应的客户端和服务器。
背景技术
ICAP协议设计的目的是使Web内容设备能够互操作、共享数据和控制信息。这样就使得用户能够在分离的设备上实施某种服务,优化所执行的功能。ICAP是轻量级的基于HTTP的远程过程调用(RPC)协议,设备可以传送基于HTTP的内容(HTML)到ICAP服务器进行内容操作。
ICAP Client是支持ICAP协议的客户端,既可以是安装支持ICAP协议软件的PC机/终端,也可以是实现ICAP协议的电信级网络节点设备。其通过向ICAP Server发送相关请求消息,以获取相关资源用于业务处理。
ICAP Server是支持ICAP协议的服务器,即可以是安装支持ICAP协议软件的PC机/终端/商用服务器,也可以是实现ICAP协议的电信级网络节点设备。其对ICAP Client发送过来的ICAP协议消息进行相关业务处理后,返回给ICAP Client应答消息,携带ICAP Client所需要的相关资源。
目前的ICAP协议采用串行的方式发送请求消息,要求在一条TCP链路上,只有收到上一条请求消息对应的响应消息后,才允许发送下一条请求消息,如图1所示:
步骤1:ICAP客户端向ICAP服务器发送请求消息。
步骤2:ICAP服务器收到请求消息(Request)后,向ICAP客户端发送应答消息(Response)。
步骤N:ICAP客户端收到应答消息后,再次向ICAP服务器发送请求消息。
步骤N+1:ICAP服务器收到请求消息后,再次向ICAP客户端发送应答消息。
本发明的发明人在实现本发明的过程中,发现上面描述的ICAP协议消息流程,有两个问题:
如图2所示,假设ICAP客户端发出一请求消息A给ICAP服务器,等待ICAP服务器针对请求消息A的响应消息超时后,TCP链路又被ICAP客户端标记成可用,于是ICAP客户端会发送下一个请求消息B给ICAP服务器,发完以后并且等待ICAP服务器针对请求消息B的响应消息还没有超时的时候,在这条TCP链路上收到了请求消息A对应的响应消息(由于网络延时或者ICAP服务器响应慢等原因造成),在这种情况下,ICAP客户端会把请求消息A的响应消息当成请求消息B的响应消息去处理,造成系统异常。因此,需要解决ICAP协议请求消息和响应消息对乱序的问题。
此外,由于ICAP协议要求在一条TCP链路上的一对请求消息和响应消息,与下一对请求消息和响应消息是串行关系,无法在一条TCP链路上并行处理消息,造成了TCP链路的使用浪费。
发明内容
有鉴于此,本发明将提供一种基于ICAP的通信方法及相应的客户端和服务器,以解决上述问题中的至少一个。
为了解决上述技术问题,提供了以下技术方案。
一种基于因特网内容适配协议ICAP的通信方法,包括:
ICAP客户端生成请求消息,生成该请求消息时所述ICAP客户端在该请求消息中写入消息序列号;
所述ICAP客户端向ICAP服务器发送生成的所述请求消息。
可选地,所述ICAP客户端在该请求消息中写入消息序列号的步骤包括:
所述ICAP客户端在所述请求消息的扩展字段中写入所述消息序列号。
可选地,所述ICAP客户端向ICAP服务器发送生成的所述请求消息的步骤之后,该方法还包括:
所述ICAP客户端为该请求消息启动一个等待定时器,并保存该请求消息;
如该等待定时器超时时,所述ICAP客户端还没有收到所述ICAP服务器返回的响应消息,将保存的该请求消息丢弃,其中,所述响应消息中的消息序列号与该请求消息中的所述消息序列号相同。
可选地,所述方法还包括:
所述ICAP客户端收到所述ICAP服务器返回的响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:
如查找到,对该响应消息进行处理;
如查找不到,将该响应消息丢弃。
可选地,所述ICAP客户端在通往ICAP服务器的同一条TCP链路上,采用串行或并行的方式进行消息收发。
可选地,所述消息序列号包括数字序号,或者包括时间戳和数字序号;
所述消息序列号在系统运行时间内或在设定运行时段内不重复。
一种因特网内容适配协议ICAP客户端,包括生成装置和发送装置,其中:
所述生成装置设置成:生成请求消息,在生成该请求消息时,在该请求消息中写入消息序列号;
所述发送装置设置成:向ICAP服务器发送生成的该请求消息。
可选地,所述发送装置还设置成:
向所述ICAP服务器发送生成的该请求消息后,为该请求消息启动一个等待定时器,并保存该请求消息;
如该等待定时器超时时,还没有收到所述ICAP服务器返回的响应消息,将保存的该请求消息丢弃,其中,该响应消息中的消息序列号与该请求消息中所述消息序列号相同。
可选地,所述客户端还包括接收装置,其中
所述接收装置设置成:在收到所述ICAP服务器返回的响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:
如查找到,对该响应消息进行处理;
如查找不到,将该响应消息丢弃。
可选地,所述发送装置和接收装置在所述ICAP客户端通往ICAP服务器的同一条TCP链路上,采用串行或并行的方式进行消息收发。
一种基于因特网内容适配协议ICAP的通信方法,包括:
ICAP服务器收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
所述ICAP服务器生成对应该请求消息的一响应消息,在该响应消息中写入所述消息序列号;
所述ICAP服务器向所述ICAP客户端发送生成的该响应消息。
可选地,所述ICAP服务器在该响应消息中写入所述消息序列号的步骤包括:
所述ICAP服务器在该响应消息的扩展字段中写入所述消息序列号。
一种因特网内容适配协议ICAP服务器,包括接收装置、生成装置和发送装置,其中
所述接收装置设置成:在收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
所述生成装置设置成:生成对应该请求消息的一响应消息,在该响应消息中写入所述消息序列号;
所述发送装置设置成:向所述ICAP客户端发送生成的该响应消息。
一种计算机程序,包括程序指令,当该程序指令被ICAP客户端执行时, 使得该ICAP客户端可执行上述任意的ICAP客户端侧的基于ICAP的通信方法。
一种计算机程序,包括程序指令,当该程序指令被ICAP服务器执行时,使得该ICAP服务器可执行上述任意的ICAP服务器侧的基于ICAP的通信方法。
上述方案能够解决TCP链路上的请求消息与响应消息对的乱序问题,还可以采用并行的方式进行消息收发,显著提升TCP链路的使用率。
附图概述
图1为当前ICAP协议的标准信令交互的流程图。
图2为当前ICAP协议出现消息对乱序的流程图。
图3为本发明实施例一ICAP客户端一侧的通信方法的流程图。
图4为本发明实施例一ICAP客户端的模块图。
图5为本发明实施例二ICAP服务器一侧的通信方法的流程图。
图6为本发明实施例二ICAP服务器的模块图。
图7为本发明一应用示例信令交互的流程图。
本发明的较佳实施方式
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。
实施例一
本实施例提供一种基于ICAP的通信方法,应用于ICAP客户端,如图3所示,包括:
步骤110,ICAP客户端生成请求消息时,在请求消息中写入消息序列号;
消息序列号可以写入在请求消息的扩展字段中。消息序列号可以包括数字序号,或者包括时间戳和数字序号,以保证在系统运行时间内或在设定运行时段(如1个小时、1天等等)内不重复。
在一个示例中,消息序列号包括16位时间戳(精确到秒)和6位数字序号共20位字符串,例如,消息序列号为20150621162401000001,确保在系统运行时间内不会出现循环的问题。
步骤120,所述ICAP客户端向ICAP服务器发送生成的请求消息。
本实施例中,ICAP客户端向ICAP服务器发送一请求消息后,可以按以下方式进行消息的保存和丢弃:
为该请求消息启动一个等待定时器,并保存该请求消息;
如该等待定时器超时时,所述ICAP客户端还没有收到所述ICAP服务器返回的消息序列号与该请求消息中消息序列号相同的响应消息,将保存的该请求消息丢弃。
本实施例中,对于接收到的响应消息,可以按照以下方式处理:
ICAP客户端收到所述ICAP服务器返回的一响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:
如查找到,对该响应消息进行处理;
如查找不到,将该响应消息丢弃。
由于增加了消息序列号字段,能够正确匹配每一对请求消息和应答消息,使得ICAP客户端在通往ICAP服务器的同一条TCP链路上,可以采用并行的方式进行消息收发。在采用串行方式进行消息收发时,ICAP客户端发送一请求消息后,须接收到对应的响应消息或者相应的等待定时器超时后,才可以发送下一条请求消息,而采用并行方式进行消息收发时,ICAP客户端发送一请求消息后,无需接收到对应的响应消息或者相应的等待定时器超时,就可以发送下一条请求消息。
相应地,本实施例还提供了一种ICAP协议客户端,如图4所示,包括:
生成装置10,设置成:生成请求消息时,在请求消息中写入消息序列号;
发送装置20,设置成:向ICAP服务器发送生成的请求消息。可选地,发送装置10向ICAP服务器发送生成的一请求消息后,还设置成:为该请求消息启动一个等待定时器,并保存该请求消息;如该等待定时器超时时,还没有收到所述ICAP服务器返回的消息序列号与该请求消息中消息序列号相同的响应消息,将保存的该请求消息丢弃。
接收装置30,设置成:在收到所述ICAP服务器返回的一响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:如查找到,对该响应消息进行处理;如查找不到,将该响应消息丢弃。
可选地,发送装置20和接收装置30在到ICAP服务器的同一条TCP链路上,采用串行或并行的方式进行消息收发。
实施例二
本实施例提供一种基于ICAP的通信方法,应用于ICAP服务器,如图5所示,包括:
步骤210,ICAP服务器收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
消息序列号可以写入在响应消息的扩展字段中。
步骤220,所述ICAP服务器生成对应该请求消息的一响应消息,在该响应消息中写入所述消息序列号;
步骤230,所述ICAP服务器向所述ICAP客户端发送生成的该响应消息。
相应地,本实施例还提供了一种ICAP服务器,如图6所示,包括:
接收装置50,设置成:在收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
生成装置60,设置成:生成对应该请求消息的一响应消息,在该响应消 息中写入所述消息序列号;
发送装置70,设置成:向所述ICAP客户端发送生成的该响应消息。
上述实施例通过在请求消息和响应消息中增加的扩展字段中写入消息序列号,以便于ICAP客户端标记识别每一对请求消息和响应消息,从而可以解决TCP链路上请求消息与响应消息对的乱序问题,还可以采用并行的方式进行消息收发,显著提升TCP链路的使用率。
下面再通过一个应用示例进行说明。
本应用示例仍采用串行方式进行消息收发,请参见图7:
步骤201:ICAP客户端向ICAP服务器发送请求消息A,携带的消息序列号ID=1,为请求消息A启动的一等待定时器;
步骤202:ICAP客户端等待ICAP服务器响应超时(为请求消息A启动的等待定时器超时)后,丢弃请求消息A,向ICAP服务器发送下一请求消息B,携带的消息序列号ID=2,为请求消息B启动的一等待定时器;
步骤203:ICAP客户端收到了对应请求消息A的应答消息A,携带的消息序列号ID=1,ICAP客户端通过该消息序列号在本地查找匹配的请求消息,由于等待请求消息A已被丢弃,查找不到匹配的请求消息,因此ICAP客户端丢弃该应答消息A;
步骤204:在为请求消息B启动的一等待定时器超时前,ICAP客户端收到了对应请求消息B的应答消息B,携带的消息序列号ID=2,ICAP客户端通过该消息序列号在本地查找匹配的请求消息,成功与请求消息B配对,于是按照正常业务流程处理应答消息B。
上述请求消息和应答消息可以是ICAP客户端和ICAP服务器之间的各种类型的请求和应答消息。
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令 被ICAP客户端执行时,使得该ICAP客户端可执行上述任意的ICAP客户端侧的基于ICAP的通信方法。
本发明实施例还公开了一种载有所述的计算机程序的载体。
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令被ICAP服务器执行时,使得该ICAP服务器可执行上述任意的ICAP服务器侧的基于ICAP的通信方法。
本发明实施例还公开了一种载有所述的计算机程序的载体。
在阅读并理解了附图和详细描述后,可以明白其他方面。
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。
工业实用性
上述方案能够解决TCP链路上的请求消息与响应消息对的乱序问题,还可以采用并行的方式进行消息收发,显著提升TCP链路的使用率。因此本发明具有很强的工业实用性。

Claims (15)

  1. 一种基于因特网内容适配协议ICAP的通信方法,包括:
    ICAP客户端生成请求消息,生成该请求消息时所述ICAP客户端在该请求消息中写入消息序列号;
    所述ICAP客户端向ICAP服务器发送生成的所述请求消息。
  2. 如权利要求1所述的基于ICAP的通信方法,其中,所述ICAP客户端在该请求消息中写入消息序列号的步骤包括:
    所述ICAP客户端在所述请求消息的扩展字段中写入所述消息序列号。
  3. 如权利要求1所述的基于ICAP的通信方法,其中:
    所述ICAP客户端向ICAP服务器发送生成的所述请求消息的步骤之后,该方法还包括:
    所述ICAP客户端为该请求消息启动一个等待定时器,并保存该请求消息;
    如该等待定时器超时时,所述ICAP客户端还没有收到所述ICAP服务器返回的响应消息,将保存的该请求消息丢弃,其中,所述响应消息中的消息序列号与该请求消息中的所述消息序列号相同。
  4. 如权利要求1-3中任一所述的基于ICAP的通信方法,所述方法还包括:
    所述ICAP客户端收到所述ICAP服务器返回的响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:
    如查找到,对该响应消息进行处理;
    如查找不到,将该响应消息丢弃。
  5. 如权利要求4所述的基于ICAP的通信方法,其中:
    所述ICAP客户端在通往ICAP服务器的同一条TCP链路上,采用串行或并行的方式进行消息收发。
  6. 如权利要求1-3、5中任一所述的基于ICAP的通信方法,其中:
    所述消息序列号包括数字序号,或者包括时间戳和数字序号;
    所述消息序列号在系统运行时间内或在设定运行时段内不重复。
  7. 一种因特网内容适配协议ICAP客户端,包括生成装置和发送装置,其中:
    所述生成装置设置成:生成请求消息,在生成该请求消息时,在该请求消息中写入消息序列号;
    所述发送装置设置成:向ICAP服务器发送生成的该请求消息。
  8. 如权利要求7所述的ICAP客户端,其中,所述发送装置还设置成:
    向所述ICAP服务器发送生成的该请求消息后,为该请求消息启动一个等待定时器,并保存该请求消息;
    如该等待定时器超时时,还没有收到所述ICAP服务器返回的响应消息,将保存的该请求消息丢弃,其中,该响应消息中的消息序列号与该请求消息中所述消息序列号相同。
  9. 如权利要求7或8所述的ICAP客户端,所述客户端还包括接收装置,其中
    所述接收装置设置成:在收到所述ICAP服务器返回的响应消息后,从保存的请求消息中查找消息序列号与该响应消息中消息序列号相同的请求消息:
    如查找到,对该响应消息进行处理;
    如查找不到,将该响应消息丢弃。
  10. 如权利要求9所述的ICAP客户端,其中:
    所述发送装置和接收装置在所述ICAP客户端通往ICAP服务器的同一条TCP链路上,采用串行或并行的方式进行消息收发。
  11. 一种基于因特网内容适配协议ICAP的通信方法,包括:
    ICAP服务器收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
    所述ICAP服务器生成对应该请求消息的一响应消息,在该响应消息中写入所述消息序列号;
    所述ICAP服务器向所述ICAP客户端发送生成的该响应消息。
  12. 如权利要求11所述的基于ICAP的通信方法,其中,所述ICAP服务器在该响应消息中写入所述消息序列号的步骤包括:
    所述ICAP服务器在该响应消息的扩展字段中写入所述消息序列号。
  13. 一种因特网内容适配协议ICAP服务器,包括接收装置、生成装置和发送装置,其中
    所述接收装置设置成:在收到ICAP客户端发送的一请求消息后,读取该请求消息中的消息序列号;
    所述生成装置设置成:生成对应该请求消息的一响应消息,在该响应消息中写入所述消息序列号;
    所述发送装置设置成:向所述ICAP客户端发送生成的该响应消息。
  14. 一种计算机程序,包括程序指令,当该程序指令被ICAP客户端执行时,使得该ICAP客户端可执行如权利要求1-6中任一项所述的基于ICAP的通信方法。
  15. 一种计算机程序,包括程序指令,当该程序指令被ICAP服务器执行时,使得该ICAP服务器可执行如权利要求11-12中任一项所述的基于ICAP的通信方法。
PCT/CN2016/074699 2015-06-29 2016-02-26 基于因特网内容适配协议的通信方法、客户端和服务器 WO2017000572A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510371520.8 2015-06-29
CN201510371520.8A CN106330833A (zh) 2015-06-29 2015-06-29 基于因特网内容适配协议的通信方法、客户端和服务器

Publications (1)

Publication Number Publication Date
WO2017000572A1 true WO2017000572A1 (zh) 2017-01-05

Family

ID=57607759

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/074699 WO2017000572A1 (zh) 2015-06-29 2016-02-26 基于因特网内容适配协议的通信方法、客户端和服务器

Country Status (2)

Country Link
CN (1) CN106330833A (zh)
WO (1) WO2017000572A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111953655B (zh) * 2017-02-28 2023-03-10 华为云计算技术有限公司 一种通信系统中服务器响应请求消息的方法及设备
CN109818905B (zh) * 2017-11-21 2022-06-03 中国移动通信有限公司研究院 一种传输层协议适配的方法、网元设备及系统
CN109905645B (zh) * 2017-12-08 2021-02-23 华为技术有限公司 视频监控设备目录交换方法和联网平台
CN109995745B (zh) * 2017-12-31 2023-02-24 国民技术股份有限公司 一种信息匹配方法、终端及计算机可读存储介质
CN117440028A (zh) * 2023-12-07 2024-01-23 四川湖山电器股份有限公司 基于tcp的上位设备和嵌入设备交互的通信方法及系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245031A1 (en) * 2006-02-27 2007-10-18 Zhiping Liu ICAP processing of partial content to identify security issues
CN102137309A (zh) * 2010-11-30 2011-07-27 广东星海数字家庭产业技术研究院有限公司 应用面向数字电视终端的内容描述语言的处理方法
CN104468594A (zh) * 2014-12-15 2015-03-25 北京奇虎科技有限公司 一种数据请求的方法、装置及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8948089B2 (en) * 2012-01-11 2015-02-03 Intel Corporation Device, system and method of communicating aggregate data units
CN103516673A (zh) * 2012-06-21 2014-01-15 腾讯科技(深圳)有限公司 一种网络数据通信方法、系统及客户端和服务器
CN103516723B (zh) * 2013-09-22 2017-08-11 大唐移动通信设备有限公司 Sip消息处理方法与装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245031A1 (en) * 2006-02-27 2007-10-18 Zhiping Liu ICAP processing of partial content to identify security issues
CN102137309A (zh) * 2010-11-30 2011-07-27 广东星海数字家庭产业技术研究院有限公司 应用面向数字电视终端的内容描述语言的处理方法
CN104468594A (zh) * 2014-12-15 2015-03-25 北京奇虎科技有限公司 一种数据请求的方法、装置及系统

Also Published As

Publication number Publication date
CN106330833A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2017000572A1 (zh) 基于因特网内容适配协议的通信方法、客户端和服务器
US9578081B2 (en) System and method for providing an actively invalidated client-side network resource cache
US9800691B2 (en) Stream processing using a client-server architecture
US8554855B1 (en) Push notification delivery system
CN104009938B (zh) 基于路由层面的长连接的方法和系统
FR2802373B1 (fr) Systeme et methode pour personnaliser la qualite des services en fonction des clients dans un environnement informatique collaboratif
US9762667B2 (en) Distributed server election with imperfect clock synchronization
US20150296014A1 (en) Picture download method and apparatus
US9582561B2 (en) Size-based data synchronization
US20160359950A1 (en) Systems and methods for improved trivial file transfer protocol
WO2016155266A1 (zh) 虚拟桌面的数据共享方法和装置
JP5961471B2 (ja) 複数の情報システムおける出力比較方法
CN107733979B (zh) 数据推送方法、服务器及系统
CN112929453B (zh) 一种共享session数据的方法和装置
CN114900489B (zh) 一种消息处理方法、装置、电子设备及存储介质
CN114390095A (zh) 远端设备控制方法以及物联网设备管理平台、系统
CN107395583B (zh) 基于自然语言实现不同应用之间通信的方法及装置
US11764993B2 (en) Apparatus, system, and method for providing simultaneous delivery of output communications
US8738049B1 (en) Converged dialog in hybrid mobile applications
US20240152504A1 (en) Data interaction method, apparatus, and electronic device
Lubbers et al. Using the WebSocket API
CN116308671A (zh) 基于mqtt协议的在线竞价方法、电子设备及存储介质
CN114416383A (zh) 一种多进程通信方法及装置
CN117082047A (zh) 一种数据处理方法、装置
CN113726827A (zh) 基于分布式集群的数据包处理方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16816937

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16816937

Country of ref document: EP

Kind code of ref document: A1