[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104488240B - Session management method, address management method and relevant device - Google Patents

Session management method, address management method and relevant device Download PDF

Info

Publication number
CN104488240B
CN104488240B CN201380000539.0A CN201380000539A CN104488240B CN 104488240 B CN104488240 B CN 104488240B CN 201380000539 A CN201380000539 A CN 201380000539A CN 104488240 B CN104488240 B CN 104488240B
Authority
CN
China
Prior art keywords
terminal device
port
information
address
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201380000539.0A
Other languages
Chinese (zh)
Other versions
CN104488240A (en
Inventor
司·马可
李欢
于游洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN104488240A publication Critical patent/CN104488240A/en
Application granted granted Critical
Publication of CN104488240B publication Critical patent/CN104488240B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0894Policy-based network configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4535Network directories; Name-to-address mapping using an address exchange platform which sets up a session between two nodes, e.g. rendezvous servers, session initiation protocols [SIP] registrars or H.323 gatekeepers

Landscapes

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

Abstract

本发明公开了一种会话管理方法、地址管理方法及相关装置,该会话管理方法包括:接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;根据所述终端设备和/或端口的类型,向服务器发送会话管理请求;接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。本发明还公开了地址管理方法及相应的装置。可以根据终端设备和/或端口的类型请求服务器为该终端设备设置和下发相应的会话管理策略,根据该会话管理策略进行会话管理,完善了会话管理过程。

The invention discloses a session management method, an address management method and related devices. The session management method includes: when receiving a session request from a terminal device, according to the identification information, address information and address information of the terminal device carried in the session request. Port information, determining the type of the terminal device and/or port; sending a session management request to the server according to the type of the terminal device and/or port; receiving a session management response message sent by the server, and according to the session management In response to the session management policy included in the message, session management is performed on the terminal device. The invention also discloses an address management method and a corresponding device. According to the type of the terminal device and/or port, the server can be requested to set and issue a corresponding session management policy for the terminal device, and session management is performed according to the session management policy, which improves the session management process.

Description

一种会话管理方法、地址管理方法及相关装置A session management method, an address management method, and related devices

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种会话管理方法、地址管理方法及相关装置。The invention relates to the field of communication technology, in particular to a session management method, an address management method and related devices.

背景技术Background technique

在固定网络和移动网络融合的课题中,前提是用第三代合作伙伴计划(The 3rdGeneration Partnership Project,3GPP)系统中的策略和计费控制(Policy andCharging Control,PCC)架构来实现对于固定网络资源的控制。即策略和计费规则功能(Policy and Charging Rules Function,PCRF)作为策略控制实体,固定网络数据网关如宽带网络网关(Broadband Network Gateway,BNG)作为固定网络内策略执行体,实现PCRF对经过BNG的不同数据流的控制。In the subject of fixed network and mobile network convergence, the premise is to use the Policy and Charging Control (PCC) framework in the 3rd Generation Partnership Project (3GPP) system to realize the control of fixed network resources. control. That is, the policy and charging rules function (Policy and Charging Rules Function, PCRF) as a policy control entity, fixed network data gateways such as broadband network gateways (Broadband Network Gateway, BNG) as a fixed network Control of different data flows.

家庭网关(Residential Gateway,RG)与BNG之间为每个网络协议(InternetProtocol,IP)地址建立一个固定用户连接,同时,BNG与PCRF之间为每个IP地址建立一个IP连接访问网络(IP-Connectivity Access Network,IP-CAN)会话,IP-CAN会话与固定用户连接按照IP地址一一对应。A fixed user connection is established between the Residential Gateway (RG) and the BNG for each Internet Protocol (Internet Protocol, IP) address, and at the same time, an IP connection is established between the BNG and the PCRF for each IP address to access the network (IP- Connectivity Access Network, IP-CAN) session, IP-CAN session and fixed user connection correspond to each other according to IP address.

在实际部署的时候,RG可能工作在有地址转换的路由模式(Routed mode withNetwork Address Translation)下,在这种场景下,RG为连接到它的每一个终端设备都分配一个本地IP地址,但是连接到同一个RG的所有终端共享一个广域网(Wide AreaNetwork,WAN)IP地址,此时,一个RG与BNG之间只有一个固定用户连接。在RG为有地址转换的路由模式下,在RG接入的时候PCRF即为该RG建立一个IP-CAN会话,此后,各个终端设备从RG接入时,都不会触发新的IP-CAN会话建立过程,PCRF无法根据从RG接入的终端设备的签约制定策略,而是根据RG的签约制定策略,且不同的业务流经过网络端口地址转换(Network Address Port Translation,NAPT)之后都使用相同的IP地址和端口号,PCRF也不能够对不同的业务流制定不同的策略。In actual deployment, RG may work in Routed mode with Network Address Translation. In this scenario, RG assigns a local IP address to each terminal device connected to it, but the connection All terminals to the same RG share a wide area network (Wide Area Network, WAN) IP address. At this time, there is only one fixed user connection between an RG and the BNG. When the RG is in the routing mode with address translation, when the RG accesses, the PCRF establishes an IP-CAN session for the RG. After that, when each terminal device accesses from the RG, it will not trigger a new IP-CAN session. During the establishment process, PCRF cannot formulate policies based on the subscription of terminal equipment accessed from the RG, but formulates policies based on the subscription of the RG, and different service flows use the same IP address after Network Address Port Translation (NAPT). For IP address and port number, PCRF cannot formulate different policies for different service flows.

综上所述,如何更好地进行会话管理已成为业界迫切需要解决的问题。To sum up, how to better perform session management has become an urgent problem to be solved in the industry.

发明内容Contents of the invention

有鉴于此,本发明实施例提供了一种会话管理方法、地址管理方法及相关装置,用于解决现有技术存在着的无法很好地进行会话管理的问题。In view of this, the embodiments of the present invention provide a session management method, an address management method and related devices, which are used to solve the problem that session management cannot be performed well in the prior art.

第一方面,提供了一种会话管理方法,包括:In the first aspect, a session management method is provided, including:

接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;When receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request;

根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;Sending a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device;

接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

在第一种可能的实现方式中,所述接收到终端设备的会话请求,包括:In a first possible implementation manner, the receiving the session request of the terminal device includes:

检测到一个五元组数据包;或者,A five-tuple packet is detected; or,

接收到终端设备的地址匹配请求。An address matching request from a terminal device is received.

结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述检测到一个五元组数据包时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型,包括:With reference to the first possible implementation of the first aspect, in a second possible implementation, when a 5-tuple data packet is detected, according to the identification information of the terminal device carried in the session request, Address information and port information to determine the type of the terminal device and/or port, including:

向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息;Querying the PCP server for second address information and second port information corresponding to the first address information and first port information of the terminal device, and identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

结合第一方面的第一种可能的实现方式,在第三种可能的实现方式中,所述接收到终端设备的地址匹配请求之后,以及所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型之前,所述方法还包括:With reference to the first possible implementation of the first aspect, in a third possible implementation, after receiving the address matching request of the terminal device, and the Identification information, address information and port information, before determining the type of the terminal device and/or port, the method further includes:

如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。If the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the source address of the address matching request to the value in the PCP client address field , and send the address matching request to the PCP server.

结合第一方面的第一种可能的实现方式或第三种可能的实现方式,在第四种可能的实现方式中,所述接收到终端设备的地址匹配请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型,包括:With reference to the first possible implementation manner or the third possible implementation manner of the first aspect, in a fourth possible implementation manner, when receiving the address matching request of the terminal device, according to the The identification information, address information and port information of the terminal equipment determine the type of the terminal equipment and/or port, including:

向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息;Querying the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

结合第一方面的第四种可能的实现方式,在第五种可能的实现方式中,所述向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,包括:With reference to the fourth possible implementation of the first aspect, in a fifth possible implementation, the querying the PCP server for the second address information of the terminal device and the first address information corresponding to the second port information and first port information, including:

发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and judges that the terminal device identification information corresponding to the record is the same as the terminal device's Whether the identification information is consistent;

如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备;If the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receiving an address conflict error response message returned by the PCP server, and sending the address conflict error response message to the terminal device;

如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。If the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal device's Identification information.

结合第一方面的第二种可能的实现方式或第四种可能的实现方式,在第六种可能的实现方式中,所述根据查询结果确定所述终端设备和/或端口的类型,包括:With reference to the second possible implementation manner or the fourth possible implementation manner of the first aspect, in a sixth possible implementation manner, the determining the type of the terminal device and/or port according to the query result includes:

判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;Judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache;

如果判断结果为否,则确定所述终端设备为第一类型的终端设备;If the judgment result is no, then determining that the terminal device is a first type of terminal device;

如果判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;If the judgment result is yes, further judge whether there is a record corresponding to the second port information in the query result in the local cache;

如果进一步的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。If the further judgment result is no, it is determined that the terminal device is a second type of terminal device and that the port is a first type of port.

结合第一方面的第六种可能的实现方式,在第七种可能的实现方式中,所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求,包括:With reference to the sixth possible implementation manner of the first aspect, in a seventh possible implementation manner, the sending the session management request to the server according to the type of the terminal device and/or port includes:

如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;If it is determined that the terminal device is a first type of terminal device, sending a session establishment request to the server, where the session establishment request includes identification information and port information of the terminal device;

如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If the terminal device is a terminal device of the second type and the port is a port of the first type, a session modification request is sent to the server, where the session modification request includes identification information and port information of the terminal device.

结合第一方面的第六种可能的实现方式,在第八种可能的实现方式中,所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求,包括:With reference to the sixth possible implementation manner of the first aspect, in an eighth possible implementation manner, the sending the session management request to the server according to the type of the terminal device and/or port includes:

如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If it is determined that the terminal device is a terminal device of the first type, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, a session modification request is sent to the server, wherein the session modification request includes the Identification information and port information of the terminal device.

结合第一方面的第五种可能的实现方式或第一方面的第六种可能的实现方式或第一方面的第七种可能的实现方式或第一方面的第八种可能的实现方式,在第九种可能的实现方式中,所述方法还包括:In combination with the fifth possible implementation of the first aspect or the sixth possible implementation of the first aspect or the seventh possible implementation of the first aspect or the eighth possible implementation of the first aspect, in In a ninth possible implementation manner, the method further includes:

接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;receiving a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released;

向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;Sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list;

向所述服务器发送会话管理请求,并接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;Sending a session management request to the server, and receiving a response message returned by the server for performing session management on the port to be released;

释放所述待释放的端口占有的资源。Release the resource occupied by the port to be released.

结合第一方面的第九种可能的实现方式,在第十种可能的实现方式中,所述向所述服务器发送会话管理请求,包括:With reference to the ninth possible implementation manner of the first aspect, in a tenth possible implementation manner, the sending the session management request to the server includes:

如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;If the received session request sent by the terminal device indicates that all ports will be released, then send a session termination request to the server;

否则,向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。Otherwise, send a session modification request to the server, where the session modification request includes the identification information of the terminal device, the port number to be released, and a deletion flag.

第二方面,提供了一种地址管理方法,包括:In the second aspect, an address management method is provided, including:

接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录;receiving a query message from the session management device, where the query address list includes records of the second address information, the second port information, and the identification information of the terminal equipment carried in the query message;

如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备;If the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, return an address conflict error response message to the session management device, so that the session management device responds with the address conflict error The message is sent to the terminal device;

如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息,并将所述记录返回至所述会话管理装置。If the record does not include the identification information of the terminal device, adding the identification information of the terminal device to the record in the address list, and returning the record to the session management apparatus.

第三方面,提供了一种会话管理方法,包括:In a third aspect, a session management method is provided, including:

接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息;receiving a session management request sent by the session management device, where the session management request includes identification information and port information of the terminal device;

根据所述终端设备标识信息和端口信息,生成会话管理策略,并将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。Generate a session management policy according to the terminal device identification information and port information, and send a session management response message containing the session management policy to the session management apparatus.

在第一种可能的实现方式中,所述会话管理策略包括服务质量和/或计费策略。In a first possible implementation manner, the session management policy includes a quality of service and/or charging policy.

第四方面,提供了一种会话管理装置,包括:In a fourth aspect, a session management device is provided, including:

第一确定单元,用于接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;The first determining unit is configured to, when receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request;

第一发送单元,用于根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;A first sending unit, configured to send a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device;

第一接收单元,用于接收所述服务器发送的会话管理响应消息;a first receiving unit, configured to receive a session management response message sent by the server;

第一管理单元,用于根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。The first management unit is configured to perform session management on the terminal device according to the session management policy included in the session management response message.

在第一种可能的实现方式中,,所述接收到终端设备的会话请求,包括:In a first possible implementation manner, the receiving the session request of the terminal device includes:

检测到一个五元组数据包;或者,A five-tuple packet is detected; or,

接收到终端设备的地址匹配请求。An address matching request from a terminal device is received.

结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述第一确定单元包括:With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner, the first determining unit includes:

第一查询单元,用于检测到一个五元组数据包时,向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息;The first query unit is configured to query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device when a quintuple data packet is detected, and the The identification information of the terminal device;

第二确定单元,用于根据查询结果确定所述终端设备和/或端口的类型。The second determining unit is configured to determine the type of the terminal device and/or port according to the query result.

结合第四方面的第一种可能的实现方式,在第三种可能的实现方式中,所述装置还包括:With reference to the first possible implementation manner of the fourth aspect, in a third possible implementation manner, the device further includes:

修改单元,用于如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值;A modifying unit, configured to modify the source address of the address matching request to the PCP client address if the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request the value in the field;

第二发送单元,用于将所述地址匹配请求发送给PCP服务器。The second sending unit is configured to send the address matching request to the PCP server.

结合第四方面的第一种可能的实现方式或第三种可能的实现方式,在第四种可能的实现方式中,所述第一确定单元包括:With reference to the first possible implementation manner or the third possible implementation manner of the fourth aspect, in a fourth possible implementation manner, the first determining unit includes:

第二查询单元,用于接收到终端设备的地址匹配请求时,向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息;The second query unit is configured to, when receiving the address matching request of the terminal device, query the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the The identification information of the terminal device;

所述第二确定单元用于根据查询结果确定所述终端设备和/或端口的类型。The second determining unit is configured to determine the type of the terminal device and/or port according to the query result.

结合第四方面的第四种可能的实现方式,在第五种可能的实现方式中,所述第二查询单元包括:With reference to the fourth possible implementation of the fourth aspect, in a fifth possible implementation, the second query unit includes:

第三发送单元,用于发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;A third sending unit, configured to send a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and determines the terminal device identifier corresponding to the record Whether the information is consistent with the identification information of the terminal device;

第二接收单元,用于如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息;The second receiving unit is configured to receive an address conflict error response message returned by the PCP server if the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information;

第四发送单元,用于将所述地址冲突错误响应消息发送至所述终端设备;a fourth sending unit, configured to send the address conflict error response message to the terminal device;

第三接收单元,用于如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。A third receiving unit, configured to receive first address information and first port information corresponding to the second address information and second port information sent by the PCP server if the record does not include the identification information of the terminal device , and the identification information of the terminal device.

结合第四方面的第四种可能的实现方式,在第五种可能的实现方式中,所述第二确定单元包括:With reference to the fourth possible implementation manner of the fourth aspect, in a fifth possible implementation manner, the second determining unit includes:

第一判断单元,用于判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;A first judging unit, configured to judge whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache;

第三确定单元,用于如果判断结果为否,则确定所述终端设备为第一类型的终端设备;A third determining unit, configured to determine that the terminal device is a terminal device of the first type if the judgment result is no;

第二判断单元,用于如果所述第一判断单元的判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;The second judging unit is configured to further judge whether there is a record corresponding to the second port information in the query result in the local buffer if the judging result of the first judging unit is yes;

第四确定单元,用于如果所述第二判断单元的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。The fourth determination unit is configured to determine that the terminal device is a second type of terminal device and that the port is a first type of port if the determination result of the second determination unit is negative.

结合第四方面的第六种可能的实现方式,在第七种可能的实现方式中,所述第一发送单元包括:With reference to the sixth possible implementation manner of the fourth aspect, in a seventh possible implementation manner, the first sending unit includes:

第五发送单元,用于如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;A fifth sending unit, configured to send a session establishment request to a server if it is determined that the terminal device is a first type of terminal device, where the session establishment request includes identification information and port information of the terminal device;

第六发送单元,用于如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A sixth sending unit, configured to send a session modification request to the server if the terminal device is a second type of terminal device and the port is a first type port, wherein the session modification request includes the terminal device ID information and port information.

结合第四方面的第六种可能的实现方式,在第八种可能的实现方式中,所述第一发送单元还包括:With reference to the sixth possible implementation manner of the fourth aspect, in an eighth possible implementation manner, the first sending unit further includes:

第七发送单元,用于如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A seventh sending unit, configured to send a session modification request to the server if it is determined that the terminal device is a first type of terminal device and the terminal device is determined to be a fixed terminal device according to the identification information of the terminal device, wherein the The session modification request includes identification information and port information of the terminal device.

结合第四方面的第五种可能的实现方式或第四方面的第六种可能的实现方式或第四方面的第七种可能的实现方式或第四方面的第八种可能的实现方式,在第九种可能的实现方式中,所述装置还包括:In combination with the fifth possible implementation of the fourth aspect or the sixth possible implementation of the fourth aspect or the seventh possible implementation of the fourth aspect or the eighth possible implementation of the fourth aspect, in In a ninth possible implementation manner, the device further includes:

第四接收单元,用于接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;A fourth receiving unit, configured to receive a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released;

第八发送单元,用于向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;An eighth sending unit, configured to send a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list;

第九发送单元,用于向所述服务器发送会话管理请求;a ninth sending unit, configured to send a session management request to the server;

第五接收单元,用于接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;A fifth receiving unit, configured to receive a response message returned by the server for performing session management on the port to be released;

释放单元,用于释放所述待释放的端口占有的资源。A release unit, configured to release the resource occupied by the port to be released.

结合第四方面的第九种可能的实现方式,在第十种可能的实现方式中,所述第九发送单元包括:With reference to the ninth possible implementation manner of the fourth aspect, in a tenth possible implementation manner, the ninth sending unit includes:

第十发送单元,用于如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;A tenth sending unit, configured to send a session termination request to the server if the received session request sent by the terminal device indicates that all ports will be released;

第十一发送单元,用于如果所述接收到的终端设备发送的会话请求中指示部分端口将被释放,则向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。The eleventh sending unit is configured to send a session modification request to the server if the received session request sent by the terminal device indicates that some ports will be released, and the session modification request includes the terminal device's Identification information, the port number to be released, and the deletion flag.

第五方面,提供了一种地址管理服务器,包括:In the fifth aspect, an address management server is provided, including:

第六接收单元,用于接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录;The sixth receiving unit is configured to receive a query message from the session management device, and the query address list includes records of the second address information, the second port information, and the identification information of the terminal equipment carried in the query message;

第一返回单元,用于如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备;A first returning unit, configured to return an address conflict error response message to the session management apparatus if the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, so that the session management apparatus sending the address conflict error response message to the terminal device;

增加单元,用于如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息;an adding unit, configured to add the identification information of the terminal device to the record of the address list if the record does not include the identification information of the terminal device;

第二返回单元,用于将所述记录返回至所述会话管理装置。a second returning unit, configured to return the record to the session management device.

第六方面,提供了一种服务器,包括:In the sixth aspect, a server is provided, including:

第七接收单元,用于接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息;A seventh receiving unit, configured to receive a session management request sent by the session management device, where the session management request includes identification information and port information of the terminal device;

生成单元,用于根据所述终端设备标识信息和端口信息,生成会话管理策略;A generating unit, configured to generate a session management policy according to the terminal device identification information and port information;

第十二发送单元,用于将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。A twelfth sending unit, configured to send a session management response message including the session management policy to the session management apparatus.

在第一种可能的实现方式中,所述会话管理策略包括服务质量和/或计费策略。In a first possible implementation manner, the session management policy includes a quality of service and/or charging policy.

第七方面,提供了一种会话管理设备,其特征在于,包括:输入装置、输出装置、存储器和处理器,其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:A seventh aspect provides a session management device, which is characterized by comprising: an input device, an output device, a memory, and a processor, wherein a set of program codes is stored in the memory, and the processor is used to call the Program code stored in memory to perform the following operations:

接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;When receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request;

根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;Sending a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device;

接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

在第一种可能的实现方式中,所述接收到终端设备的会话请求,包括:In a first possible implementation manner, the receiving the session request of the terminal device includes:

检测到一个五元组数据包;或者,A five-tuple packet is detected; or,

接收到终端设备的地址匹配请求。An address matching request from a terminal device is received.

结合第七方面的第一种可能的实现方式,在第二种可能的实现方式中,所述处理器执行所述检测到一个五元组数据包时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤,包括:With reference to the first possible implementation manner of the seventh aspect, in a second possible implementation manner, when the processor detects a 5-tuple data packet, according to the terminal carried in the session request, The identification information, address information and port information of the device, and the step of determining the type of the terminal device and/or port include:

向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息;Querying the PCP server for second address information and second port information corresponding to the first address information and first port information of the terminal device, and identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

结合第七方面的第一种可能的实现方式,在第三种可能的实现方式中,所述处理器执行所述接收到终端设备的地址匹配请求的步骤之后,以及所述处理器执行所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤之前,还执行以下步骤:With reference to the first possible implementation manner of the seventh aspect, in a third possible implementation manner, after the processor executes the step of receiving the address matching request of the terminal device, and the processor executes the Before the step of determining the type of the terminal device and/or port according to the identification information, address information and port information of the terminal device carried in the session request, the following steps are further performed:

如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。If the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the source address of the address matching request to the value in the PCP client address field , and send the address matching request to the PCP server.

结合第七方面的第一种可能的实现方式或第三种可能的实现方式,在第四种可能的实现方式中,所述处理器执行所述接收到终端设备的地址匹配请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤,包括:With reference to the first possible implementation manner or the third possible implementation manner of the seventh aspect, in a fourth possible implementation manner, when the processor executes the address matching request received from the terminal device, according to the The identification information, address information and port information of the terminal device carried in the session request, and the step of determining the type of the terminal device and/or port include:

向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息;Querying the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

结合第七方面的第四种可能的实现方式,在第五种可能的实现方式中,所述处理器执行所述向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息的步骤,包括:With reference to the fourth possible implementation manner of the seventh aspect, in a fifth possible implementation manner, the processor performs the querying the PCP server for information corresponding to the second address information and the second port information of the terminal device. The steps of the first address information and the first port information include:

发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and judges that the terminal device identification information corresponding to the record is the same as the terminal device's Whether the identification information is consistent;

如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备;If the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receiving an address conflict error response message returned by the PCP server, and sending the address conflict error response message to the terminal device;

如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。If the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal device's Identification information.

结合第七方面的第二种可能的实现方式或第四种可能的实现方式,在第六种可能的实现方式中,所述处理器执行所述根据查询结果确定所述终端设备和/或端口的类型的步骤,包括:With reference to the second possible implementation manner or the fourth possible implementation manner of the seventh aspect, in a sixth possible implementation manner, the processor performs the determining the terminal device and/or port according to the query result. types of steps, including:

判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;Judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache;

如果判断结果为否,则确定所述终端设备为第一类型的终端设备;If the judgment result is no, then determining that the terminal device is a first type of terminal device;

如果判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;If the judgment result is yes, further judge whether there is a record corresponding to the second port information in the query result in the local cache;

如果进一步的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。If the further judgment result is no, it is determined that the terminal device is a second type of terminal device and that the port is a first type of port.

结合第七方面的第六种可能的实现方式,在第七种可能的实现方式中,所述处理器执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:With reference to the sixth possible implementation manner of the seventh aspect, in a seventh possible implementation manner, the processor performs the step of sending a session management request to a server according to the type of the terminal device and/or port, include:

如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;If it is determined that the terminal device is a first type of terminal device, sending a session establishment request to the server, where the session establishment request includes identification information and port information of the terminal device;

如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If the terminal device is a terminal device of the second type and the port is a port of the first type, a session modification request is sent to the server, where the session modification request includes identification information and port information of the terminal device.

结合第七方面的第六种可能的实现方式,在第八种可能的实现方式中,所述处理器执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:With reference to the sixth possible implementation manner of the seventh aspect, in an eighth possible implementation manner, the processor performs the step of sending a session management request to a server according to the type of the terminal device and/or port, include:

如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If it is determined that the terminal device is a terminal device of the first type, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, a session modification request is sent to the server, wherein the session modification request includes the Identification information and port information of the terminal device.

结合第七方面的第五种可能的实现方式或第七方面的第六种可能的实现方式或第七方面的第七种可能的实现方式或第七方面的第八种可能的实现方式,在第九种可能的实现方式中,所述处理器还执行以下步骤:In combination with the fifth possible implementation of the seventh aspect or the sixth possible implementation of the seventh aspect or the seventh possible implementation of the seventh aspect or the eighth possible implementation of the seventh aspect, in In a ninth possible implementation manner, the processor further performs the following steps:

接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;receiving a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released;

向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;Sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list;

向所述服务器发送会话管理请求,并接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;Sending a session management request to the server, and receiving a response message returned by the server for performing session management on the port to be released;

释放所述待释放的端口占有的资源。Release the resource occupied by the port to be released.

结合第七方面的第九种可能的实现方式,在第十种可能的实现方式中,所述处理器执行所述向所述服务器发送会话管理请求的步骤,包括:With reference to the ninth possible implementation manner of the seventh aspect, in a tenth possible implementation manner, the processor performing the step of sending the session management request to the server includes:

如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;If the received session request sent by the terminal device indicates that all ports will be released, then send a session termination request to the server;

否则,向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。Otherwise, send a session modification request to the server, where the session modification request includes the identification information of the terminal device, the port number to be released, and a deletion flag.

第八方面,提供了一种会话管理服务器,其特征在于,包括:输入装置、输出装置、存储器和处理器,其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:In an eighth aspect, a session management server is provided, which is characterized by comprising: an input device, an output device, a memory, and a processor, wherein a set of program codes are stored in the memory, and the processor is used to call the Program code stored in memory to perform the following operations:

接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录;receiving a query message from the session management device, where the query address list includes records of the second address information, the second port information, and the identification information of the terminal equipment carried in the query message;

如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备;If the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, return an address conflict error response message to the session management device, so that the session management device responds with the address conflict error The message is sent to the terminal device;

如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息,并将所述记录返回至所述会话管理装置。If the record does not include the identification information of the terminal device, adding the identification information of the terminal device to the record in the address list, and returning the record to the session management apparatus.

第九方面,提供了一种服务器,其特征在于,包括输入装置、输出装置、存储器和处理器,其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:A ninth aspect provides a server, which is characterized by including an input device, an output device, a memory, and a processor, wherein a set of program codes is stored in the memory, and the processor is used to call the program code stored in the memory. program code to do the following:

接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息;receiving a session management request sent by the session management device, where the session management request includes identification information and port information of the terminal device;

根据所述终端设备标识信息和端口信息,生成会话管理策略,并将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。Generate a session management policy according to the terminal device identification information and port information, and send a session management response message containing the session management policy to the session management apparatus.

在第一种可能的实现方式中,所述会话管理策略包括服务质量和/或计费策略。In a first possible implementation manner, the session management policy includes a quality of service and/or charging policy.

采用本发明提供的一种会话管理方法、地址管理方法及相关装置的技术方案,可以根据终端设备和/或端口的类型请求服务器为该终端设备设置和下发相应的会话管理策略,根据该会话管理策略进行会话管理,完善了会话管理过程。Using the technical solution of a session management method, address management method and related devices provided by the present invention, the server can be requested to set and issue a corresponding session management policy for the terminal device according to the type of the terminal device and/or port, and according to the session The management strategy implements session management, which improves the session management process.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为本发明一种会话管理方法的一个实施例的方法流程图;Fig. 1 is a method flowchart of an embodiment of a session management method of the present invention;

图2为本发明一种会话管理方法的另一个实施例的方法流程图;Fig. 2 is a method flowchart of another embodiment of a session management method of the present invention;

图3为本发明一种会话管理方法的又一个实施例的方法流程图;Fig. 3 is a method flowchart of another embodiment of a session management method of the present invention;

图4为本发明一种地址管理方法的实施例的方法流程图;Fig. 4 is a method flowchart of an embodiment of an address management method of the present invention;

图5为本发明一种会话管理方法的再一个实施例的方法流程图;Fig. 5 is a method flowchart of another embodiment of a session management method of the present invention;

图6为本发明一种会话管理装置的一个实施例的结构示意图;FIG. 6 is a schematic structural diagram of an embodiment of a session management device according to the present invention;

图7为本发明一种会话管理装置的另一个实施例的结构示意图;FIG. 7 is a schematic structural diagram of another embodiment of a session management device according to the present invention;

图8为本发明一种会话管理装置的又一个实施例的结构示意图;FIG. 8 is a schematic structural diagram of another embodiment of a session management device according to the present invention;

图9为本发明一种地址管理服务器的实施例的结构示意图;FIG. 9 is a schematic structural diagram of an embodiment of an address management server according to the present invention;

图10为本发明一种服务器的实施例的结构示意图;FIG. 10 is a schematic structural diagram of an embodiment of a server in the present invention;

图11为本发明提供的一种会话管理设备的一个实施例的结构示意图;FIG. 11 is a schematic structural diagram of an embodiment of a session management device provided by the present invention;

图12为本发明提供的一种会话管理服务器的一个实施例的结构示意图;FIG. 12 is a schematic structural diagram of an embodiment of a session management server provided by the present invention;

图13为本发明提供的一种服务器的一个实施例的结构示意图。Fig. 13 is a schematic structural diagram of an embodiment of a server provided by the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图1为本发明一种会话管理方法的一个实施例的方法流程图。如图1所示,该方法包括以下步骤:Fig. 1 is a method flowchart of an embodiment of a session management method of the present invention. As shown in Figure 1, the method includes the following steps:

步骤S101,接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型。Step S101, when receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information and port information of the terminal device carried in the session request.

在本实施例中,统一对终端设备的会话请求进行管理。接收到终端设备的会话请求可以是检测到一个五元组数据包,或者接收到终端设备的地址匹配请求。该会话请求携带终端设备的地址信息和端口信息,也可能还携带终端设备的标识信息。In this embodiment, session requests of terminal devices are managed uniformly. The reception of the session request of the terminal device may be the detection of a 5-tuple data packet, or the receipt of an address matching request of the terminal device. The session request carries address information and port information of the terminal device, and may also carry identification information of the terminal device.

终端设备的标识信息能唯一标识该终端设备;终端设备的地址信息包括NAPT前地址或NAPT后的地址,即本地IP地址或WAN IP地址,终端设备具有唯一的本地IP地址,连接一个RG的所有终端设备共享一个WAN IP地址;终端设备的端口信息包括NAPT前端口信息或NAPT后的端口信息。The identification information of the terminal device can uniquely identify the terminal device; the address information of the terminal device includes the address before NAPT or the address after NAPT, that is, the local IP address or WAN IP address. The terminal device has a unique local IP address. The terminal devices share a WAN IP address; the port information of the terminal devices includes port information before NAPT or port information after NAPT.

发自终端设备的会话请求,有可能是由新接入的终端设备发起的,也有可能是已连接的终端设备的新端口发起的,根据终端设备的标识信息、地址信息和端口信息,能够确定终端设备的类型为新连接的终端设备,或确定终端设备的类型为已连接的终端设备,以及端口的类型为新端口。The session request sent from the terminal device may be initiated by a newly connected terminal device, or it may be initiated by a new port of a connected terminal device. According to the identification information, address information and port information of the terminal device, it can be determined The type of the terminal device is a newly connected terminal device, or it is determined that the type of the terminal device is an already connected terminal device and the type of the port is a new port.

步骤S102,根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息。Step S102, according to the type of the terminal device and/or port, send a session management request to the server, where the session management request includes the identification information and port information of the terminal device.

对于终端设备和/或端口的类型是新接入的终端设备或已连接的终端设备的新端口,请求服务器为该终端设备设置会话管理策略,因此,根据终端设备和/或端口的类型,向服务器发送会话管理请求,该会话管理请求携带终端设备的标识信息和端口信息。For a terminal device and/or port whose type is a newly accessed terminal device or a new port of a connected terminal device, the server is requested to set a session management policy for the terminal device. Therefore, according to the type of the terminal device and/or port, the The server sends a session management request, where the session management request carries identification information and port information of the terminal device.

步骤S103,接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。Step S103, receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

接收服务器发送的会话管理响应消息,该会话管理响应消息为服务器对会话管理请求做出的响应,具体地,为终端设备的标识信息对应的终端设备设置相应的会话管理策略,会话管理策略包含在该会话管理响应消息中,根据该会话管理策略对终端设备进行会话管理。Receive the session management response message sent by the server. The session management response message is the server's response to the session management request. Specifically, set a corresponding session management policy for the terminal device corresponding to the identification information of the terminal device. The session management policy is included in In the session management response message, session management is performed on the terminal device according to the session management policy.

根据本发明实施例提供的一种会话管理方法,可以根据终端设备和/或端口的类型请求服务器为该终端设备设置和下发相应的会话管理策略,根据该会话管理策略进行会话管理,完善了会话管理过程。According to a session management method provided by an embodiment of the present invention, the server can be requested to set and issue a corresponding session management strategy for the terminal device according to the type of the terminal device and/or port, and session management is performed according to the session management strategy, which improves the Session management process.

图2为本发明一种会话管理方法的另一个实施例的方法流程图。如图2所示,该方法包括以下步骤:Fig. 2 is a method flowchart of another embodiment of a session management method of the present invention. As shown in Figure 2, the method includes the following steps:

步骤S201,检测到一个五元组数据包时,向PCP服务器查询终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息。Step S201, when a quintuple data packet is detected, query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device, as well as the identification information of the terminal device .

检测到一个五元组数据包,五元组是指由源IP地址、源端口、目的IP地址、目的端口和传输层协议号组成的集合。例如,由固定网络边缘数据网关(IP Edge)进行会话管理,IP Edge检测到一个新的五元组。A five-tuple data packet is detected, and the five-tuple refers to a set composed of source IP address, source port, destination IP address, destination port, and transport layer protocol number. For example, session management by a fixed network edge data gateway (IP Edge), which detects a new quintuple.

端口控制协议(Port Control Protocol,PCP)服务器统一对接入的终端设备的标识信息、地址信息和端口信息进行统一管理,根据终端设备的标识信息,对应存储有该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IPWAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。The port control protocol (Port Control Protocol, PCP) server uniformly manages the identification information, address information and port information of the connected terminal equipment, and according to the identification information of the terminal equipment, correspondingly stores the first/second The mapping relationship between address information and first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information respectively correspond to the address information and port information after NAPT, namely IPWAN address information and WAN port information; the second address information and the second port information respectively correspond to the address information and port information before NAPT , that is, local IP address information and local area network (Local Area Network, LAN) source port information.

根据该PCP服务器存储的第一/第二地址信息、第一/第二端口信息的映射关系,通过NAPT后的地址和端口信息能够查询到对应的NAPT前的地址和端口信息,以及终端设备的标识信息。According to the mapping relationship between the first/second address information and the first/second port information stored in the PCP server, the address and port information after NAPT can be used to query the corresponding address and port information before NAPT, as well as the terminal device's Identification information.

例如,IP Edge发送“PCP Query”请求消息到PCP服务器,其中携带该五元组数据包中的IP WAN地址和WAN源端口,PCP服务器查询与该会话请求中携带的WAN IP地址和WAN源端口相对应的地址列表中的记录,向IP Edge返回“PCP Query”响应消息,查询到的该记录包括终端设备的标识信息、WANIP地址、本地IP地址、WAN源端口和LAN源端口。For example, IP Edge sends a "PCP Query" request message to the PCP server, which carries the IP WAN address and WAN source port in the five-tuple packet, and the PCP server queries the WAN IP address and WAN source port carried in the session request The corresponding record in the address list returns a "PCP Query" response message to IP Edge, and the queried record includes terminal device identification information, WAN IP address, local IP address, WAN source port and LAN source port.

步骤S202,判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录,如果否,转至步骤S203;否则,则转至步骤S204。Step S202, judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache, if not, go to step S203; otherwise, go to step S204.

步骤S203,确定所述终端设备为第一类型的终端设备。Step S203, determining that the terminal device is a first type of terminal device.

步骤S204,判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录,如果是,则转至步骤S205;否则,转至步骤S206。Step S204, judging whether there is a record corresponding to the second port information in the query result in the local cache, if yes, go to step S205; otherwise, go to step S206.

步骤S205,结束。Step S205, end.

步骤S206,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。Step S206, determining that the terminal device is a second type of terminal device and that the port is a first type of port.

步骤S207,向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息。Step S207, sending a session establishment request to the server, wherein the session establishment request includes the identification information and port information of the terminal device.

步骤S208,向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。Step S208, sending a session modification request to the server, wherein the session modification request includes the identification information and port information of the terminal device.

步骤S209,接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。Step S209, receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

IP Edge之前每处理一个业务请求,便在其缓存区中存储终端设备的标识信息、地址信息和端口信息,但对于新的业务请求,没有存储其对应的记录,因此,根据终端设备的标识信息,判断缓存区中是否存在PCP服务器查询结果中的与该终端设备的标识信息对应的记录,如果判断的结果为否,则确定终端设备为第一类型的终端设备,该第一类型的终端设备为新接入的终端设备;如果判断的结果为是,则确定终端设备为第二类型的终端设备,并进一步判断缓存区中是否存在与PCP服务器查询结果中的LAN源端口信息对应的记录,如果判断的结果为否,则确定终端设备的端口为第一类型的端口,即该第二类型的终端设备为通过新端口发起会话请求的已接入的终端设备;如果判断的结果为是,则不作处理。Before IP Edge processed a service request, it stored the identification information, address information, and port information of the terminal device in its cache area, but for new service requests, it did not store its corresponding record. Therefore, according to the identification information of the terminal device , judging whether there is a record corresponding to the identification information of the terminal device in the PCP server query result in the cache area, if the result of the judgment is no, then determining that the terminal device is the first type of terminal device, the first type of terminal device be a newly accessed terminal device; if the result of the judgment is yes, then determine that the terminal device is a second type of terminal device, and further judge whether there is a record corresponding to the LAN source port information in the PCP server query result in the cache area, If the result of the judgment is no, then determine that the port of the terminal device is a port of the first type, that is, the terminal device of the second type is an accessed terminal device that initiates a session request through a new port; if the result of the judgment is yes, is not processed.

如果确定终端设备为新连接的终端设备,则向服务器发送会话建立请求,该会话建立请求携带终端设备的标识信息和端口信息,使得服务器针对该终端设备的标识信息对应的终端设备及其端口信息对应的端口设置会话管理策略;如果确定终端设备为已连接的终端设备,发送该会话请求的端口为新端口,则向服务器发送会话修改请求,该会话修改请求携带终端设备的标识信息和端口信息,以使服务器修改该终端设备的会话管理策略,为新增加的端口设置相应的会话管理策略。例如,该服务器为PCRF,PCRF根据终端设备的标识信息和端口信息制定策略或更新策略,该会话管理策略包括服务质量(Quality ofService)和/或计费信息,并向IP Edge发送会话管理响应消息,该消息中包含会话管理策略。IP Edge接收到该会话管理响应消息后,解析其中的会话管理策略,针对该终端设备执行该会话管理策略。If it is determined that the terminal device is a newly connected terminal device, a session establishment request is sent to the server, and the session establishment request carries the identification information and port information of the terminal device, so that the server is directed to the terminal device and its port information corresponding to the identification information of the terminal device Set the session management policy for the corresponding port; if it is determined that the terminal device is a connected terminal device and the port that sends the session request is a new port, then a session modification request is sent to the server, and the session modification request carries the identification information and port information of the terminal device , so that the server modifies the session management policy of the terminal device, and sets a corresponding session management policy for the newly added port. For example, the server is PCRF, and the PCRF formulates or updates policies according to the identification information and port information of the terminal equipment, the session management policy includes Quality of Service (QoS) and/or charging information, and sends a session management response message to IP Edge , which contains the session management policy. After receiving the session management response message, the IP Edge parses the session management policy therein, and executes the session management policy for the terminal device.

作为一种可能的实施方式,如果确定终端设备为第一类型的终端设备,以及根据终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求。As a possible implementation manner, if it is determined that the terminal device is the first type of terminal device, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, then a session modification request is sent to the server.

步骤S210,接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息。In step S210, a session request of the terminal device is received, and the session request includes identification information of the terminal device and port information to be released.

步骤S211,向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求。Step S211, sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list.

步骤S212,向所述服务器发送会话管理请求,并接收所述服务器返回的会话管理响应消息。Step S212, sending a session management request to the server, and receiving a session management response message returned by the server.

步骤S213,释放所述待释放的端口占有的资源。Step S213, releasing the resource occupied by the port to be released.

步骤S210至步骤S213为终端设备释放端口而引起的会话管理过程。Steps S210 to S213 are the session management process caused by the terminal device releasing the port.

一种情况是,终端设备释放一个或多个端口。在一个终端设备对应一个独立的IP-CAN会话的场景下,此场景包括终端设备释放一个或多个端口但不是释放所有端口的情况;在一个固定终端不对应一个独立的IP-CAN会话的场景下,此场景包括终端设备释放一个或多个或所有端口的情况。接收终端设备发送的会话请求,该请求消息携带终端设备的标识信息和待释放的端口信息,向PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求,PCP服务器接收到该请求消息后,在地址列表中删除与终端设备的标识信息和待释放的端口信息相对应的记录,然后,IP Edge向服务器发送会话管理请求,如果终端设备释放的是一个或多个端口,该会话管理请求为会话修改请求,该会话修改请求包括终端设备的标识信息和待释放的端口号,并接收服务器返回的根据待释放的端口进行会话管理策略更新的会话管理响应消息,最后,会话管理装置根据该响应消息,释放待释放的端口占有的资源,删除缓存区中与终端设备的标识信息和待释放的端口信息相对应的记录。该会话管理请求为会话修改请求,会话修改请求中包括终端设备的标识信息,待释放的端口号,以及删除标志。In one case, the end device releases one or more ports. In the scenario where a terminal device corresponds to an independent IP-CAN session, this scenario includes the case where the terminal device releases one or more ports but not all ports; in the scenario where a fixed terminal does not correspond to an independent IP-CAN session In this case, this scenario includes the situation where the end device releases one or more or all ports. Receive the session request sent by the terminal device, the request message carries the identification information of the terminal device and the port information to be released, and send to the PCP server to delete the address list corresponding to the identification information of the terminal device and the port information to be released After receiving the request message, the PCP server deletes the record corresponding to the identification information of the terminal device and the port information to be released in the address list. Then, IP Edge sends a session management request to the server. If the terminal device One or more ports are released, and the session management request is a session modification request, which includes the identification information of the terminal device and the port number to be released, and receives the session management policy update returned by the server according to the port to be released Finally, according to the response message, the session management device releases the resource occupied by the port to be released, and deletes the record corresponding to the identification information of the terminal device and the port information to be released in the cache area. The session management request is a session modification request, and the session modification request includes identification information of the terminal device, a port number to be released, and a deletion flag.

另一种情况是,终端设备释放所有的端口。终端设备释放所有的端口而引起的会话管理过程,与终端设备释放一个或多个端口而引起的会话管理过程的不同在于,给服务器发送的会话管理请求为会话终止请求,请求服务器终止该终端设备的IP-CAN会话。In another case, the end device releases all ports. The session management process caused by the terminal device releasing all ports is different from the session management process caused by the terminal device releasing one or more ports in that the session management request sent to the server is a session termination request, requesting the server to terminate the terminal device IP-CAN session.

根据本发明实施例提供的一种会话管理方法,通过根据五元组数据包携带的终端设备的标识信息、地址信息和端口信息,确定终端设备和/或端口的类型,根据该终端设备和/或端口的类型,请求服务器根据终端设备标识信息和端口信息生成对应的会话管理策略,根据该会话管理策略对终端设备进行会话管理,完善了会话管理过程。According to a session management method provided by an embodiment of the present invention, the terminal device and/or port type is determined according to the identification information, address information and port information of the terminal device carried in the five-tuple data packet, and according to the terminal device and/or or port type, request the server to generate a corresponding session management policy according to the terminal device identification information and port information, and perform session management on the terminal device according to the session management policy, which improves the session management process.

图3为本发明一种会话管理方法的又一个实施例的方法流程图。如图3所示,该方法包括以下步骤:Fig. 3 is a method flowchart of another embodiment of a session management method according to the present invention. As shown in Figure 3, the method includes the following steps:

步骤S301,接收到终端设备的地址匹配请求。Step S301, receiving an address matching request from a terminal device.

步骤S302,判断所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值是否一致,如果是,则转至步骤S304;否则,转至步骤S303。Step S302, judging whether the source address of the address matching request is consistent with the value in the PCP client address field in the address matching request, if yes, go to step S304; otherwise, go to step S303.

步骤S303,将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。Step S303, modifying the source address of the address matching request to the value in the address field of the PCP client, and sending the address matching request to the PCP server.

步骤S304,发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致。Step S304, sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and determines that the terminal device identification information corresponding to the record is the same as the Whether the identification information of the terminal equipment is consistent.

步骤S305,如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器向返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备。Step S305, if the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receive the address conflict error response message returned by the PCP server, and send the address conflict error response message to the terminal equipment.

步骤S306,如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及终端标识信息。Step S306, if the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal identification information information.

步骤S301至步骤S306为对终端设备进行地址匹配的过程。接收到终端设备的地址匹配请求,将该地址匹配请求发送至PCP服务器以进行地址匹配。Step S301 to step S306 are the process of performing address matching on the terminal device. The address matching request of the terminal device is received, and the address matching request is sent to the PCP server for address matching.

在本实施例中,以IP Edge对终端设备进行会话管理为例,其中,PCP服务器可以与IP Edge合设,也可以分设。In this embodiment, the IP Edge performs session management on the terminal equipment as an example, wherein the PCP server can be set up together with the IP Edge, or can be set up separately.

RG为接入的3GPP移动终端或固定终端分配本地IP地址,在RG为有地址转换的路由模式下,通常同一个固定网络数据网关会与多个RG相连,如果这些RG都工作在有地址转换的路由模式下,连接到不同RG的终端设备可能被分配同样的本地IP地址,在这种地址冲突的情况下,固定网络数据网关仅凭本地IP地址和端口号无法区分连接到不同RG的终端设备,因此,分配的本地IP地址需要由PCP服务器进行地址匹配,以确保其不与其它的终端设备的本地IP地址冲突。The RG allocates local IP addresses for the connected 3GPP mobile terminals or fixed terminals. When the RG is in the routing mode with address translation, usually the same fixed network data gateway will be connected to multiple RGs. If these RGs are all working with address translation In the routing mode, terminal devices connected to different RGs may be assigned the same local IP address. In this case of address conflict, the fixed network data gateway cannot distinguish terminals connected to different RGs only by local IP addresses and port numbers. The device, therefore, needs to be assigned a local IP address by the PCP server for address matching to ensure that it does not conflict with the local IP address of other end devices.

IP Edge发送“PCP MAP”请求消息到PCP服务器,其中携带终端设备的标识信息,包括终端标识和终端的设备标识中的一种或多种。该请求消息经过RG,由RG转发,RG可以在其中添加RG标识,以及终端设备的地址信息和端口信息,其中,终端设备可以有多个端口,那么该端口信息包括多个端口的标识信息。如果终端设备与RG之间使用了其它通用即插即用(Universal Plug and Play,UPnP)协议,则UE与RG之间的交互消息将替换成相应UPnP协议的交互消息。The IP Edge sends a "PCP MAP" request message to the PCP server, which carries identification information of the terminal device, including one or more of the terminal identification and the terminal equipment identification. The request message passes through the RG and is forwarded by the RG. The RG can add the RG identifier, and the address information and port information of the terminal device. Wherein, the terminal device can have multiple ports, and the port information includes the identification information of multiple ports. If other universal plug and play (Universal Plug and Play, UPnP) protocols are used between the terminal device and the RG, the interaction message between the UE and the RG will be replaced by the interaction message of the corresponding UPnP protocol.

PCP服务器在任一终端设备接入时,接收并存储了对应RG发送的该终端设备NAPT前后的地址信息和端口信息,形成NAPT映射表,即存储了该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IP WAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。When any terminal device accesses, the PCP server receives and stores the address information and port information of the terminal device before and after NAPT sent by the corresponding RG, and forms a NAPT mapping table, which stores the first/second address information of the terminal device, The mapping relationship of the first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information respectively correspond to the address information and port information after NAPT, that is, IP WAN address information and WAN port information; the second address information and the second port information respectively correspond to the address information and port information before NAPT Information, that is, local IP address information and local area network (Local Area Network, LAN) source port information.

PCP服务器接收到“PCP MAP”请求消息后,查询自身存储的NAPT映射表,查找到包含请求消息中的本地IP地址和NAPT前的端口信息的记录,判断该记录所对应的标识信息与请求消息中的终端设备的标识信息不一致,则接收PCP服务器发送的地址冲突错误响应消息,并转发给终端设备;如果该记录未包含终端设备的标识信息,则PCP服务器将终端设备的标识信息填写在此条记录中。地址匹配成功后,接收PCP服务器发送的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及确定的终端设备的标识信息。After receiving the "PCP MAP" request message, the PCP server queries the NAPT mapping table stored by itself, finds the record containing the local IP address in the request message and the port information before NAPT, and judges the identification information corresponding to the record and the request message If the identification information of the terminal device in the record is inconsistent, it will receive the address conflict error response message sent by the PCP server and forward it to the terminal device; if the record does not contain the identification information of the terminal device, the PCP server will fill in the identification information of the terminal device here records. After the address matching is successful, the second address information and the second port information corresponding to the first address information and the first port information sent by the PCP server, and the identification information of the determined terminal device are received.

另外,在发送查询消息到PCP服务器之前,如果“PCP MAP”请求消息的源IP地址(source IP Address)与请求消息中的PCP客户端IP地址(PCP Client’s IP Address)域中的取值不一致,PCP服务器不返回地址冲突错误消息,而是通过这两个地址不一致知道该请求消息经过了NAT,按照消息内的参数PCP Client’s IP Address域的值来查询,并将地址匹配请求发送给PCP服务器。In addition, before sending the query message to the PCP server, if the source IP address (source IP Address) of the "PCP MAP" request message is inconsistent with the value in the PCP Client's IP Address field in the request message, The PCP server does not return an address conflict error message, but knows that the request message has passed through NAT through the inconsistency of the two addresses, queries according to the value of the parameter PCP Client's IP Address field in the message, and sends the address matching request to the PCP server.

通过该地址匹配过程,可以避免终端设备之间的本地IP地址和本地端口发生冲突。Through this address matching process, conflicts between local IP addresses and local ports between terminal devices can be avoided.

步骤S307,判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录,如果是,则转至步骤S308;否则,转至步骤S309。Step S307, judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache, if yes, go to step S308; otherwise, go to step S309.

步骤S308,确定所述终端设备为第一类型的终端设备。Step S308, determining that the terminal device is a first type of terminal device.

步骤S309,判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录,如果是,则转至步骤S310,结束;否则,转至步骤S311。Step S309, judging whether there is a record corresponding to the second port information in the query result in the local cache, if yes, go to step S310, and end; otherwise, go to step S311.

步骤S310,结束。Step S310, end.

步骤S311,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。Step S311, determining that the terminal device is a second type of terminal device and that the port is a first type of port.

步骤S312,向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备标识信息和端口信息。Step S312, sending a session establishment request to the server, wherein the session establishment request includes the terminal device identification information and port information.

步骤S313,向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备标识信息和端口信息。Step S313, sending a session modification request to the server, wherein the session modification request includes the terminal device identification information and port information.

步骤S314,接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。Step S314, receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

IP Edge接收到PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息以及终端设备的标识信息后,即将接收到的地址信息和端口信息与IP Edge本地缓存区中的地址信息和端口信息进行比较,确定终端设备和/或端口的类型,从而根据确定的终端设备和/或端口的类型向服务器发送会话管理请求,接收服务器发送的会话管理策略,对终端设备进行会话管理,步骤S307至步骤S314的进行会话管理的过程与前述实施例的步骤S202至步骤S209相同或类似,在此不再赘述。After the IP Edge receives the first address information and first port information corresponding to the second address information and the second port information sent by the PCP server, and the identification information of the terminal device, the received address information and port information will be compared with the IP Edge local The address information in the cache area is compared with the port information to determine the type of terminal device and/or port, so as to send a session management request to the server according to the determined type of terminal device and/or port, receive the session management policy sent by the server, and The terminal device performs session management, and the process of performing session management from step S307 to step S314 is the same as or similar to step S202 to step S209 in the foregoing embodiment, and will not be repeated here.

根据本发明实施例提供的一种会话管理方法,在地址匹配过程中,根据获取的地址匹配成功后的终端设备的标识信息、地址信息和端口信息,确定终端设备和/或端口的类型,根据该终端设备和/或端口的类型,请求服务器根据终端设备标识信息和端口信息生成对应的会话管理策略,根据该会话管理策略对终端设备进行会话管理,完善了会话管理过程;同时,进行地址匹配,可以避免地址冲突。According to a session management method provided by an embodiment of the present invention, in the address matching process, the terminal device and/or port type is determined according to the acquired identification information, address information and port information of the terminal device after the address matching is successful, according to The type of the terminal device and/or port requests the server to generate a corresponding session management strategy according to the terminal device identification information and port information, and performs session management on the terminal device according to the session management strategy, which improves the session management process; at the same time, performs address matching , to avoid address conflicts.

图4为本发明一种地址管理方法的实施例的方法流程图。如图4所示,该方法包括以下步骤:Fig. 4 is a method flowchart of an embodiment of an address management method according to the present invention. As shown in Figure 4, the method includes the following steps:

步骤S401,接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录。Step S401, receiving a query message from the session management device, and the query address list includes records of the second address information, the second port information and the identification information of the terminal equipment carried in the query message.

步骤S402,如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备。Step S402, if the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, return an address conflict error response message to the session management device, so that the session management device will use the address A conflict error response message is sent to the end device.

步骤S403,如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息,并将所述记录返回至所述会话管理装置。Step S403, if the record does not include the identification information of the terminal device, add the identification information of the terminal device to the record in the address list, and return the record to the session management apparatus.

步骤S401至步骤S403为PCP服务器进行地址管理的过程。Steps S401 to S403 are the process of address management by the PCP server.

会话管理装置发送“PCP MAP”请求消息到PCP服务器,其中携带终端设备的标识信息,包括终端标识和终端的设备标识中的一种或多种。该请求消息经过RG,由RG转发,RG可以在其中添加RG标识,以及终端设备的地址信息和端口信息,其中,终端设备可以有多个端口,那么该端口信息包括多个端口的标识信息。如果终端设备与RG之间使用了其它通用即插即用(Universal Plug and Play,UPnP)协议,则UE与RG之间的交互消息将替换成相应UPnP协议的交互消息。The session management device sends a "PCP MAP" request message to the PCP server, which carries identification information of the terminal equipment, including one or more of the terminal identification and the terminal equipment identification. The request message passes through the RG and is forwarded by the RG. The RG can add the RG identifier, and the address information and port information of the terminal device. Wherein, the terminal device can have multiple ports, and the port information includes the identification information of multiple ports. If other universal plug and play (Universal Plug and Play, UPnP) protocols are used between the terminal device and the RG, the interaction message between the UE and the RG will be replaced by the interaction message of the corresponding UPnP protocol.

PCP服务器在任一终端设备接入时,接收并存储了对应RG发送的该终端设备NAPT前后的地址信息和端口信息,形成NAPT映射表,即存储了该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IP WAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。When any terminal device accesses, the PCP server receives and stores the address information and port information of the terminal device before and after NAPT sent by the corresponding RG, and forms a NAPT mapping table, which stores the first/second address information of the terminal device, The mapping relationship of the first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information correspond to the address information and port information after NAPT respectively, that is, IP WAN address information and WAN port information; the second address information and the second port information correspond to the address information and port information before NAPT respectively. Information, that is, local IP address information and local area network (Local Area Network, LAN) source port information.

PCP服务器接收到“PCP MAP”请求消息后,查询自身存储的NAPT映射表,查找到包含请求消息中的本地IP地址和NAPT前的端口信息的记录,判断该记录所对应的标识信息与请求消息中的终端设备的标识信息不一致,则接收PCP服务器发送的地址冲突错误响应消息,并转发给终端设备;如果该记录未包含终端设备的标识信息,则PCP服务器将终端设备的标识信息填写在此条记录中。地址匹配成功后,接收PCP服务器发送的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及确定的终端设备的标识信息。After receiving the "PCP MAP" request message, the PCP server queries the NAPT mapping table stored by itself, finds the record containing the local IP address in the request message and the port information before NAPT, and judges the identification information corresponding to the record and the request message If the identification information of the terminal device in the record is inconsistent, it will receive the address conflict error response message sent by the PCP server and forward it to the terminal device; if the record does not contain the identification information of the terminal device, the PCP server will fill in the identification information of the terminal device here records. After the address matching is successful, the second address information and the second port information corresponding to the first address information and the first port information sent by the PCP server, and the identification information of the determined terminal device are received.

根据本发明实施例提供的一种地址管理方法,通过该地址匹配过程,可以避免终端设备之间的本地IP地址和本地端口发生冲突。According to an address management method provided by an embodiment of the present invention, through the address matching process, conflicts between local IP addresses and local ports between terminal devices can be avoided.

图5为本发明一种会话管理方法的再一个实施例的方法流程图。如图5所示,该方法包括以下步骤:Fig. 5 is a method flowchart of another embodiment of a session management method according to the present invention. As shown in Figure 5, the method includes the following steps:

步骤S501,接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息。Step S501, receiving a session management request sent by a session management device, where the session management request includes identification information and port information of a terminal device.

步骤S502,根据所述终端设备标识信息和端口信息,生成会话管理策略,并将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。Step S502: Generate a session management policy according to the terminal device identification information and port information, and send a session management response message including the session management policy to the session management apparatus.

在本实施例中,服务器接收会话管理装置发送的会话管理请求,该会话管理请求包含终端设备的标识信息,可能还包括端口信息。其中,终端设备的标识信息能唯一标识该终端设备;一个终端设备可能具有多个端口,该端口信息可以包括多个端口的标识信息。In this embodiment, the server receives the session management request sent by the session management device, where the session management request includes identification information of the terminal device, and may also include port information. Wherein, the identification information of the terminal device can uniquely identify the terminal device; one terminal device may have multiple ports, and the port information may include the identification information of the multiple ports.

该会话管理请求对应的终端设备可以为任意的终端设备,可能为新的终端设备,或者,该会话管理请求对应的终端设备可能为已连接的终端设备,但其端口可能为新端口,服务器需要根据终端设备的标识信息,可能还包括的端口信息,生成会话管理策略。该会话管理策略发送给会话管理装置,使得会话管理装置根据该会话管理策略对会话请求进行管理。The terminal device corresponding to the session management request may be any terminal device, possibly a new terminal device, or the terminal device corresponding to the session management request may be a connected terminal device, but its port may be a new port, and the server needs to A session management policy is generated according to the identification information of the terminal device, which may also include port information. The session management policy is sent to the session management device, so that the session management device manages the session request according to the session management policy.

该会话管理请求包括会话建立请求和会话修改请求。对应新的终端设备,会话管理装置发送会话建立请求给服务器,服务器根据终端设备的标识信息及端口信息,为该新的终端设备设置新的会话管理策略,通过会话管理响应消息将该会话管理策略发送给会话管理装置。对应已连接的终端设备的新端口,会话管理装置向服务器发送会话修改请求给服务器,服务器根据终端设备的标识信息查询到对应的该终端设备的会话管理策略,修改该会话管理策略,在其中扩展新端口对应的会话管理策略,通过会话管理响应消息将该会话管理策略发送给会话管理装置。其中,该服务器可以是PCRF。该会话管理策略包括服务质量,还可以包括计费策略。The session management request includes a session establishment request and a session modification request. Corresponding to a new terminal device, the session management device sends a session establishment request to the server, and the server sets a new session management strategy for the new terminal device according to the identification information and port information of the terminal device, and uses the session management response message to set the session management strategy sent to the session management device. Corresponding to the new port of the connected terminal device, the session management device sends a session modification request to the server, and the server queries the corresponding session management strategy of the terminal device according to the identification information of the terminal device, modifies the session management strategy, and expands the session management strategy in it. The session management policy corresponding to the new port is sent to the session management device through a session management response message. Wherein, the server may be PCRF. The session management policy includes quality of service, and may also include a charging policy.

当接收到会话管理装置的会话管理请求时,如果该会话管理请求为会话修改请求,指示删除相应的端口,或该会话管理请求为会话终止请求,则PCRF删除这些端口的对应资源,并调整会话管理策略。When receiving the session management request from the session management device, if the session management request is a session modification request indicating deletion of the corresponding ports, or the session management request is a session termination request, the PCRF deletes the corresponding resources of these ports and adjusts the session management strategy.

根据本发明实施例提供的一种会话管理方法,服务器接收会话管理装置发送的请求为新的终端设备或已连接的终端设备的新端口设置会话管理策略的请求,为该终端设备设置会话管理策略,使得接收到该会话管理策略的会话管理装置可以根据该会话管理策略对该终端设备进行会话管理,完善了会话管理过程。According to a session management method provided by an embodiment of the present invention, the server receives a request sent by the session management device to set a session management policy for a new terminal device or a new port of a connected terminal device, and sets the session management policy for the terminal device , so that the session management apparatus that receives the session management policy can perform session management on the terminal device according to the session management policy, which improves the session management process.

图6为本发明一种会话管理装置的一个实施例的结构示意图。如图6所示,该装置1000包括:Fig. 6 is a schematic structural diagram of an embodiment of a session management device according to the present invention. As shown in Figure 6, the device 1000 includes:

第一确定单元101,用于接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型。The first determining unit 101 is configured to, when receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information and port information of the terminal device carried in the session request.

在本实施例中,统一对终端设备的会话请求进行管理。接收到终端设备的会话请求可以是检测到一个五元组数据包,或者接收到终端设备的地址匹配请求。该会话请求携带终端设备的地址信息和端口信息,也可能还携带终端设备的标识信息。In this embodiment, session requests of terminal devices are managed uniformly. The reception of the session request of the terminal device may be the detection of a 5-tuple data packet, or the receipt of an address matching request of the terminal device. The session request carries address information and port information of the terminal device, and may also carry identification information of the terminal device.

终端设备的标识信息能唯一标识该终端设备;终端设备的地址信息包括NAPT前地址或NAPT后的地址,即本地IP地址或WAN IP地址,终端设备具有唯一的本地IP地址,连接一个RG的所有终端设备共享一个WAN IP地址;终端设备的端口信息包括NAPT前端口信息或NAPT后的端口信息。The identification information of the terminal device can uniquely identify the terminal device; the address information of the terminal device includes the address before NAPT or the address after NAPT, that is, the local IP address or WAN IP address. The terminal device has a unique local IP address. The terminal devices share a WAN IP address; the port information of the terminal devices includes port information before NAPT or port information after NAPT.

发自终端设备的会话请求,有可能是由新接入的终端设备发起的,也有可能是已连接的终端设备的新端口发起的,根据终端设备的标识信息、地址信息和端口信息,能够确定终端设备的类型为新连接的终端设备,或确定终端设备的类型为已连接的终端设备,以及端口的类型为新端口。The session request sent from the terminal device may be initiated by a newly connected terminal device, or it may be initiated by a new port of a connected terminal device. According to the identification information, address information and port information of the terminal device, it can be determined The type of the terminal device is a newly connected terminal device, or it is determined that the type of the terminal device is an already connected terminal device and the type of the port is a new port.

第一发送单元102,用于根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息。The first sending unit 102 is configured to send a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device.

对于终端设备和/或端口的类型是新接入的终端设备或已连接的终端设备的新端口,请求服务器为该终端设备设置会话管理策略,因此,根据终端设备和/或端口的类型,向服务器发送会话管理请求,该会话管理请求携带终端设备的标识信息和端口信息。For a terminal device and/or port whose type is a newly accessed terminal device or a new port of a connected terminal device, the server is requested to set a session management policy for the terminal device. Therefore, according to the type of the terminal device and/or port, the The server sends a session management request, where the session management request carries identification information and port information of the terminal device.

第一接收单元103,用于接收所述服务器发送的会话管理响应消息。The first receiving unit 103 is configured to receive the session management response message sent by the server.

第一管理单元104,用于根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。The first management unit 104 is configured to perform session management on the terminal device according to the session management policy included in the session management response message.

接收服务器发送的会话管理响应消息,该会话管理响应消息为服务器对会话管理请求做出的响应,具体地,为终端设备的标识信息对应的终端设备设置相应的会话管理策略,会话管理策略包含在该会话管理响应消息中,根据该会话管理策略对终端设备进行会话管理。Receive the session management response message sent by the server. The session management response message is the server's response to the session management request. Specifically, set a corresponding session management policy for the terminal device corresponding to the identification information of the terminal device. The session management policy is included in In the session management response message, session management is performed on the terminal device according to the session management policy.

根据本发明实施例提供的一种会话管理装置,可以根据终端设备和/或端口的类型请求服务器为该终端设备设置和下发相应的会话管理策略,根据该会话管理策略进行会话管理,完善了会话管理过程。According to a session management device provided by an embodiment of the present invention, the server can be requested to set and issue a corresponding session management strategy for the terminal device according to the type of the terminal device and/or port, and perform session management according to the session management strategy, which improves the Session management process.

图7为本发明一种会话管理装置的另一个实施例的结构示意图。如图7所示,该装置2000包括:Fig. 7 is a schematic structural diagram of another embodiment of a session management device according to the present invention. As shown in Figure 7, the device 2000 includes:

第一查询单元201,用于检测到一个五元组数据包时,向PCP服务器查询终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息。The first query unit 201 is configured to query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device when a quintuple data packet is detected, and the Identification information of the terminal device.

检测到一个五元组数据包,五元组是指由源IP地址、源端口、目的IP地址、目的端口和传输层协议号组成的集合。例如,由固定网络边缘数据网关(IP Edge)进行会话管理,IP Edge检测到一个新的五元组。A five-tuple data packet is detected, and the five-tuple refers to a set composed of source IP address, source port, destination IP address, destination port, and transport layer protocol number. For example, session management by a fixed network edge data gateway (IP Edge), which detects a new quintuple.

端口控制协议(Port Control Protocol,PCP)服务器统一对接入的终端设备的标识信息、地址信息和端口信息进行统一管理,根据终端设备的标识信息,对应存储有该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IPWAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。The port control protocol (Port Control Protocol, PCP) server uniformly manages the identification information, address information and port information of the connected terminal equipment, and according to the identification information of the terminal equipment, correspondingly stores the first/second The mapping relationship between address information and first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information respectively correspond to the address information and port information after NAPT, namely IPWAN address information and WAN port information; the second address information and the second port information respectively correspond to the address information and port information before NAPT , that is, local IP address information and local area network (Local Area Network, LAN) source port information.

根据该PCP服务器存储的第一/第二地址信息、第一/第二端口信息的映射关系,通过NAPT后的地址和端口信息能够查询到对应的NAPT前的地址和端口信息,以及终端设备的标识信息。According to the mapping relationship between the first/second address information and the first/second port information stored in the PCP server, the address and port information after NAPT can be used to query the corresponding address and port information before NAPT, as well as the terminal device's Identification information.

例如,IP Edge发送“PCP Query”请求消息到PCP服务器,其中携带该五元组数据包中的IP WAN地址和WAN源端口,PCP服务器查询与该会话请求中携带的WAN IP地址和WAN源端口相对应的地址列表中的记录,向IP Edge返回“PCP Query”响应消息,查询到的该记录包括终端设备的标识信息、WANIP地址、本地IP地址、WAN源端口和LAN源端口。For example, IP Edge sends a "PCP Query" request message to the PCP server, which carries the IP WAN address and WAN source port in the five-tuple packet, and the PCP server queries the WAN IP address and WAN source port carried in the session request The corresponding record in the address list returns a "PCP Query" response message to IP Edge, and the queried record includes terminal device identification information, WAN IP address, local IP address, WAN source port and LAN source port.

第二确定单元202,用于根据查询结果确定所述终端设备和/或端口的类型。The second determining unit 202 is configured to determine the type of the terminal device and/or port according to the query result.

在本实施例中,第二确定单元202包括:第一判断单元2021、第三确定单元2022、第二判断单元2023和第四确定单元2024。In this embodiment, the second determination unit 202 includes: a first determination unit 2021 , a third determination unit 2022 , a second determination unit 2023 and a fourth determination unit 2024 .

第一判断单元2021,用于判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录。The first judging unit 2021 is configured to judge whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache.

第三确定单元2022,用于如果判断结果为否,则确定所述终端设备为第一类型的终端设备。The third determining unit 2022 is configured to determine that the terminal device is the first type of terminal device if the determination result is no.

第二判断单元2023,用于如果所述第一判断单元的判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录。The second judging unit 2023 is configured to further judge whether there is a record corresponding to the second port information in the query result in the local buffer if the judging result of the first judging unit is yes.

第四确定单元2024,用于如果所述第二判断单元的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。The fourth determination unit 2024 is configured to determine that the terminal device is the second type of terminal device and the port is the first type of port if the determination result of the second determination unit is negative.

第五发送单元203,用于如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息。The fifth sending unit 203 is configured to send a session establishment request to the server if it is determined that the terminal device is a first type of terminal device, where the session establishment request includes identification information and port information of the terminal device.

第六发送单元204,用于如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A sixth sending unit 204, configured to send a session modification request to the server if the terminal device is a second type of terminal device and the port is a first type port, where the session modification request includes the terminal The identification information and port information of the device.

第七发送单元205,用于如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。The seventh sending unit 205 is configured to send a session modification request to the server if it is determined that the terminal device is a first type of terminal device, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, wherein, The session modification request includes identification information and port information of the terminal device.

第一接收单元206,用于接收所述服务器发送的会话管理响应消息。The first receiving unit 206 is configured to receive the session management response message sent by the server.

第一管理单元207,用于根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。The first management unit 207 is configured to perform session management on the terminal device according to the session management policy included in the session management response message.

IP Edge之前每处理一个业务请求,便在其缓存区中存储终端设备的标识信息、地址信息和端口信息,但对于新的业务请求,没有存储其对应的记录,因此,根据终端设备的标识信息,判断缓存区中是否存在PCP服务器查询结果中的与该终端设备的标识信息对应的记录,如果判断的结果为否,则确定终端设备为第一类型的终端设备,该第一类型的终端设备为新接入的终端设备;如果判断的结果为是,则确定终端设备为第二类型的终端设备,并进一步判断缓存区中是否存在与PCP服务器查询结果中的LAN源端口信息对应的记录,如果判断的结果为否,则确定终端设备的端口为第一类型的端口,即该第二类型的终端设备为通过新端口发起会话请求的已接入的终端设备;如果判断的结果为是,则不作处理。Before IP Edge processed a service request, it stored the identification information, address information, and port information of the terminal device in its cache area, but for new service requests, it did not store its corresponding record. Therefore, according to the identification information of the terminal device , judging whether there is a record corresponding to the identification information of the terminal device in the PCP server query result in the cache area, if the result of the judgment is no, then determining that the terminal device is the first type of terminal device, the first type of terminal device be a newly accessed terminal device; if the result of the judgment is yes, then determine that the terminal device is a second type of terminal device, and further judge whether there is a record corresponding to the LAN source port information in the PCP server query result in the cache area, If the result of the judgment is no, then determine that the port of the terminal device is a port of the first type, that is, the terminal device of the second type is an accessed terminal device that initiates a session request through a new port; if the result of the judgment is yes, is not processed.

如果确定终端设备为新连接的终端设备,则向服务器发送会话建立请求,该会话建立请求携带终端设备的标识信息和端口信息,使得服务器针对该终端设备的标识信息对应的终端设备及其端口信息对应的端口设置会话管理策略;如果确定终端设备为已连接的终端设备,发送该会话请求的端口为新端口,则向服务器发送会话修改请求,该会话修改请求携带终端设备的标识信息和端口信息,以使服务器修改该终端设备的会话管理策略,为新增加的端口设置相应的会话管理策略。例如,该服务器为PCRF,PCRF根据终端设备的标识信息和端口信息制定策略或更新策略,该会话管理策略包括服务质量(Quality ofService)和/或计费信息,并向IP Edge发送会话管理响应消息,该消息中包含会话管理策略。IP Edge接收到该会话管理响应消息后,解析其中的会话管理策略,针对该终端设备执行该会话管理策略。If it is determined that the terminal device is a newly connected terminal device, a session establishment request is sent to the server, and the session establishment request carries the identification information and port information of the terminal device, so that the server is directed to the terminal device and its port information corresponding to the identification information of the terminal device Set the session management policy for the corresponding port; if it is determined that the terminal device is a connected terminal device and the port that sends the session request is a new port, then a session modification request is sent to the server, and the session modification request carries the identification information and port information of the terminal device , so that the server modifies the session management policy of the terminal device, and sets a corresponding session management policy for the newly added port. For example, the server is PCRF, and the PCRF formulates or updates policies according to the identification information and port information of the terminal equipment, the session management policy includes Quality of Service (QoS) and/or charging information, and sends a session management response message to IP Edge , which contains the session management policy. After receiving the session management response message, the IP Edge parses the session management policy therein, and executes the session management policy for the terminal device.

作为一种可能的实施方式,如果确定终端设备为第一类型的终端设备,以及根据终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求。As a possible implementation manner, if it is determined that the terminal device is the first type of terminal device, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, then a session modification request is sent to the server.

第四接收单元208,用于接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息。The fourth receiving unit 208 is configured to receive the session request of the terminal device, where the session request includes the identification information of the terminal device and the port information to be released.

第八发送单元209,用于向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求。The eighth sending unit 209 is configured to send a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list.

第九发送单元210,用于向所述服务器发送会话管理请求。A ninth sending unit 210, configured to send a session management request to the server.

作为一种实施方式,第九发送单元210还可以包括:第十发送单元2101和第十一发送单元2102。As an implementation manner, the ninth sending unit 210 may further include: a tenth sending unit 2101 and an eleventh sending unit 2102 .

其中,第十发送单元2101,用于如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;Wherein, the tenth sending unit 2101 is configured to send a session termination request to the server if the received session request sent by the terminal device indicates that all ports will be released;

第十一发送单元2102,用于如果所述接收到的终端设备发送的会话请求中指示部分端口将被释放,则向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。The eleventh sending unit 2102 is configured to send a session modification request to the server if the received session request sent by the terminal device indicates that some ports will be released, and the session modification request includes the terminal device The identification information, the port number to be released, and the deletion flag.

第五接收单元211,用于接收所述服务器返回的针对待释放的端口进行会话管理的响应消息。The fifth receiving unit 211 is configured to receive a response message returned by the server for performing session management on the port to be released.

释放单元212,用于释放所述待释放的端口占有的资源。The release unit 212 is configured to release the resource occupied by the port to be released.

一种情况是,终端设备释放一个或多个端口。在一个终端设备对应一个独立的IP-CAN会话的场景下,此场景包括终端设备释放一个或多个端口但不是释放所有端口的情况;在一个固定终端不对应一个独立的IP-CAN会话的场景下,此场景包括终端设备释放一个或多个或所有端口的情况。接收终端设备发送的会话请求,该请求消息携带终端设备的标识信息和待释放的端口信息,向PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求,PCP服务器接收到该请求消息后,在地址列表中删除与终端设备的标识信息和待释放的端口信息相对应的记录,然后,IP Edge向服务器发送会话管理请求,如果终端设备释放的是一个或多个端口,该会话管理请求为会话修改请求,该会话修改请求包括终端设备的标识信息和待释放的端口号,并接收服务器返回的根据待释放的端口进行会话管理策略更新的会话管理响应消息,最后,会话管理装置根据该响应消息,释放待释放的端口占有的资源,删除缓存区中与终端设备的标识信息和待释放的端口信息相对应的记录。该会话管理请求为会话修改请求,会话修改请求中包括终端设备的标识信息,待释放的端口号,以及删除标志。In one case, the end device releases one or more ports. In the scenario where a terminal device corresponds to an independent IP-CAN session, this scenario includes the case where the terminal device releases one or more ports but not all ports; in the scenario where a fixed terminal does not correspond to an independent IP-CAN session In this case, this scenario includes the situation where the end device releases one or more or all ports. Receive the session request sent by the terminal device, the request message carries the identification information of the terminal device and the port information to be released, and send to the PCP server to delete the address list corresponding to the identification information of the terminal device and the port information to be released After receiving the request message, the PCP server deletes the record corresponding to the identification information of the terminal device and the port information to be released in the address list. Then, IP Edge sends a session management request to the server. If the terminal device One or more ports are released, and the session management request is a session modification request, which includes the identification information of the terminal device and the port number to be released, and receives the session management policy update returned by the server according to the port to be released Finally, according to the response message, the session management device releases the resource occupied by the port to be released, and deletes the record corresponding to the identification information of the terminal device and the port information to be released in the cache area. The session management request is a session modification request, and the session modification request includes identification information of the terminal device, a port number to be released, and a deletion flag.

另一种情况是,终端设备释放所有的端口。终端设备释放所有的端口而引起的会话管理过程,与终端设备释放一个或多个端口而引起的会话管理过程的不同在于,给服务器发送的会话管理请求为会话终止请求,请求服务器终止该终端设备的IP-CAN会话。In another case, the end device releases all ports. The session management process caused by the terminal device releasing all ports is different from the session management process caused by the terminal device releasing one or more ports in that the session management request sent to the server is a session termination request, requesting the server to terminate the terminal device IP-CAN session.

根据本发明实施例提供的一种会话管理装置,通过根据五元组数据包携带的终端设备的标识信息、地址信息和端口信息,确定终端设备和/或端口的类型,根据该终端设备和/或端口的类型,请求服务器根据终端设备标识信息和端口信息生成对应的会话管理策略,根据该会话管理策略对终端设备进行会话管理,完善了会话管理过程。According to a session management device provided in an embodiment of the present invention, the type of the terminal device and/or port is determined according to the identification information, address information and port information of the terminal device carried in the quintuple data packet, and according to the terminal device and/or or port type, request the server to generate a corresponding session management policy according to the terminal device identification information and port information, and perform session management on the terminal device according to the session management policy, which improves the session management process.

图8为本发明一种会话管理装置的又一个实施例的结构示意图。如图8所示,该装置3000包括:Fig. 8 is a schematic structural diagram of another embodiment of a session management device according to the present invention. As shown in Figure 8, the device 3000 includes:

修改单元301,用于接收到终端设备的地址匹配请求时,如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值;The modifying unit 301 is configured to, when receiving an address matching request from a terminal device, if the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the address matching request The source address of is modified to the value in the PCP client address field;

第二发送单元302,用于将所述地址匹配请求发送给PCP服务器。The second sending unit 302 is configured to send the address matching request to the PCP server.

第二查询单元303,用于向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。The second query unit 303 is configured to query the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the identification information of the terminal device.

第二查询单元303包括:第三发送单元3011、第二接收单元3012、第四发送单元3013和第三接收单元3014。The second query unit 303 includes: a third sending unit 3011 , a second receiving unit 3012 , a fourth sending unit 3013 and a third receiving unit 3014 .

第三发送单元3011,用于发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致。The third sending unit 3011 is configured to send a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and determines the terminal device corresponding to the record Whether the identification information is consistent with the identification information of the terminal device.

第二接收单元3012,用于如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息。The second receiving unit 3012 is configured to receive an address conflict error response message returned by the PCP server if the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information.

第四发送单元3013,用于将所述地址冲突错误响应消息发送至所述终端设备。The fourth sending unit 3013 is configured to send the address conflict error response message to the terminal device.

第三接收单元3014,用于如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。The third receiving unit 3014 is configured to receive the first address information and the first port corresponding to the second address information and the second port information sent by the PCP server if the record does not include the identification information of the terminal device information, and the identification information of the terminal device.

第二查询单元303为对终端设备进行地址匹配。接收到终端设备的地址匹配请求,将该地址匹配请求发送至PCP服务器以进行地址匹配。The second query unit 303 performs address matching on the terminal device. The address matching request of the terminal device is received, and the address matching request is sent to the PCP server for address matching.

在本实施例中,以IP Edge对终端设备进行会话管理为例,其中,PCP服务器可以与IP Edge合设,也可以分设。In this embodiment, the IP Edge performs session management on the terminal equipment as an example, wherein the PCP server can be set up together with the IP Edge, or can be set up separately.

RG为接入的3GPP移动终端或固定终端分配本地IP地址,在RG为有地址转换的路由模式下,通常同一个固定网络数据网关会与多个RG相连,如果这些RG都工作在有地址转换的路由模式下,连接到不同RG的终端设备可能被分配同样的本地IP地址,在这种地址冲突的情况下,固定网络数据网关仅凭本地IP地址和端口号无法区分连接到不同RG的终端设备,因此,分配的本地IP地址需要由PCP服务器进行地址匹配,以确保其不与其它的终端设备的本地IP地址冲突。The RG allocates local IP addresses for the connected 3GPP mobile terminals or fixed terminals. When the RG is in the routing mode with address translation, usually the same fixed network data gateway will be connected to multiple RGs. If these RGs are all working with address translation In the routing mode, terminal devices connected to different RGs may be assigned the same local IP address. In this case of address conflict, the fixed network data gateway cannot distinguish terminals connected to different RGs only by local IP addresses and port numbers. The device, therefore, needs to be assigned a local IP address by the PCP server for address matching to ensure that it does not conflict with the local IP address of other end devices.

IP Edge发送“PCP MAP”请求消息到PCP服务器,其中携带终端设备的标识信息,包括终端标识和终端的设备标识中的一种或多种。该请求消息经过RG,由RG转发,RG可以在其中添加RG标识,以及终端设备的地址信息和端口信息,其中,终端设备可以有多个端口,那么该端口信息包括多个端口的标识信息。如果终端设备与RG之间使用了其它通用即插即用(Universal Plug and Play,UPnP)协议,则UE与RG之间的交互消息将替换成相应UPnP协议的交互消息。The IP Edge sends a "PCP MAP" request message to the PCP server, which carries identification information of the terminal device, including one or more of the terminal identification and the terminal equipment identification. The request message passes through the RG and is forwarded by the RG. The RG can add the RG identifier, and the address information and port information of the terminal device. Wherein, the terminal device can have multiple ports, and the port information includes the identification information of multiple ports. If other universal plug and play (Universal Plug and Play, UPnP) protocols are used between the terminal device and the RG, the interaction message between the UE and the RG will be replaced by the interaction message of the corresponding UPnP protocol.

PCP服务器在任一终端设备接入时,接收并存储了对应RG发送的该终端设备NAPT前后的地址信息和端口信息,形成NAPT映射表,即存储了该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IP WAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。When any terminal device accesses, the PCP server receives and stores the address information and port information of the terminal device before and after NAPT sent by the corresponding RG, and forms a NAPT mapping table, which stores the first/second address information of the terminal device, The mapping relationship of the first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information respectively correspond to the address information and port information after NAPT, that is, IP WAN address information and WAN port information; the second address information and the second port information respectively correspond to the address information and port information before NAPT Information, that is, local IP address information and local area network (Local Area Network, LAN) source port information.

PCP服务器接收到“PCP MAP”请求消息后,查询自身存储的NAPT映射表,查找到包含请求消息中的本地IP地址和NAPT前的端口信息的记录,判断该记录所对应的标识信息与请求消息中的终端设备的标识信息不一致,则接收PCP服务器发送的地址冲突错误响应消息,并转发给终端设备;如果该记录未包含终端设备的标识信息,则PCP服务器将终端设备的标识信息填写在此条记录中。地址匹配成功后,接收PCP服务器发送的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及确定的终端设备的标识信息。After receiving the "PCP MAP" request message, the PCP server queries the NAPT mapping table stored by itself, finds the record containing the local IP address in the request message and the port information before NAPT, and judges the identification information corresponding to the record and the request message If the identification information of the terminal device in the record is inconsistent, it will receive the address conflict error response message sent by the PCP server and forward it to the terminal device; if the record does not contain the identification information of the terminal device, the PCP server will fill in the identification information of the terminal device here records. After the address matching is successful, the second address information and the second port information corresponding to the first address information and the first port information sent by the PCP server, and the identification information of the determined terminal device are received.

另外,在发送查询消息到PCP服务器之前,如果“PCP MAP”请求消息的源IP地址(source IP Address)与请求消息中的PCP客户端IP地址(PCP Client’s IP Address)域中的取值不一致,PCP服务器不返回地址冲突错误消息,而是通过这两个地址不一致知道该请求消息经过了NAT,按照消息内的参数PCP Client’s IP Address域的值来查询,并将地址匹配请求发送给PCP服务器。In addition, before sending the query message to the PCP server, if the source IP address (source IP Address) of the "PCP MAP" request message is inconsistent with the value in the PCP Client's IP Address field in the request message, The PCP server does not return an address conflict error message, but knows that the request message has passed through NAT through the inconsistency of the two addresses, queries according to the value of the parameter PCP Client's IP Address field in the message, and sends the address matching request to the PCP server.

通过该地址匹配过程,可以避免终端设备之间的本地IP地址和本地端口发生冲突。Through this address matching process, conflicts between local IP addresses and local ports between terminal devices can be avoided.

第二确定单元304,用于根据查询结果确定所述终端设备和/或端口的类型。The second determining unit 304 is configured to determine the type of the terminal device and/or port according to the query result.

第二确定单元304用于根据查询结果确定所述终端设备和/或端口的类型。The second determining unit 304 is configured to determine the type of the terminal device and/or port according to the query result.

在本实施例中,第二确定单元304包括:第一判断单元3041、第三确定单元3042、第二判断单元3043和第四确定单元3044。In this embodiment, the second determination unit 304 includes: a first determination unit 3041 , a third determination unit 3042 , a second determination unit 3043 and a fourth determination unit 3044 .

第一判断单元3041,用于判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录。The first judging unit 3041 is configured to judge whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache.

第三确定单元3042,用于如果判断结果为否,则确定所述终端设备为第一类型的终端设备。The third determining unit 3042 is configured to determine that the terminal device is the first type of terminal device if the determination result is no.

第二判断单元3043,用于如果所述第一判断单元的判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录。The second judging unit 3043 is configured to further judge whether there is a record corresponding to the second port information in the query result in the local buffer if the judging result of the first judging unit is yes.

第四确定单元3044,用于如果所述第二判断单元的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。The fourth determination unit 3044 is configured to determine that the terminal device is a terminal device of the second type and that the port is a port of the first type if the determination result of the second determination unit is negative.

第五发送单元305,用于如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息。The fifth sending unit 305 is configured to send a session establishment request to the server if it is determined that the terminal device is a first type of terminal device, where the session establishment request includes identification information and port information of the terminal device.

第六发送单元306,用于如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A sixth sending unit 306, configured to send a session modification request to the server if the terminal device is a second type of terminal device and the port is a first type port, where the session modification request includes the terminal The identification information and port information of the device.

第七发送单元307,用于如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。The seventh sending unit 307 is configured to send a session modification request to the server if it is determined that the terminal device is a first type of terminal device, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, wherein, The session modification request includes identification information and port information of the terminal device.

第一接收单元308,用于接收所述服务器发送的会话管理响应消息。The first receiving unit 308 is configured to receive the session management response message sent by the server.

第一管理单元309,用于根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。The first management unit 309 is configured to perform session management on the terminal device according to the session management policy included in the session management response message.

IP Edge接收到PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息以及终端设备的标识信息后,即将接收到的地址信息和端口信息与IP Edge本地缓存区中的地址信息和端口信息进行比较,确定终端设备和/或端口的类型,从而根据确定的终端设备和/或端口的类型向服务器发送会话管理请求,接收服务器发送的会话管理策略,对终端设备进行会话管理,步骤S307至步骤S314的进行会话管理的过程与前述实施例的步骤S202至步骤S209相同或类似,在此不再赘述。After the IP Edge receives the first address information and first port information corresponding to the second address information and the second port information sent by the PCP server, and the identification information of the terminal device, the received address information and port information will be compared with the IP Edge local The address information in the cache area is compared with the port information to determine the type of terminal device and/or port, so as to send a session management request to the server according to the determined type of terminal device and/or port, receive the session management policy sent by the server, and The terminal device performs session management, and the process of performing session management from step S307 to step S314 is the same as or similar to step S202 to step S209 in the foregoing embodiment, and will not be repeated here.

根据本发明实施例提供的一种会话管理装置,在地址匹配过程中,根据获取的地址匹配成功后的终端设备的标识信息、地址信息和端口信息,确定终端设备和/或端口的类型,根据该终端设备和/或端口的类型,请求服务器根据终端设备标识信息和端口信息生成对应的会话管理策略,根据该会话管理策略对终端设备进行会话管理,完善了会话管理过程;同时,进行地址匹配,可以避免地址冲突。According to a session management device provided by an embodiment of the present invention, during the address matching process, the type of the terminal device and/or port is determined according to the acquired identification information, address information and port information of the terminal device after the address matching is successful, according to The type of the terminal device and/or port requests the server to generate a corresponding session management strategy according to the terminal device identification information and port information, and performs session management on the terminal device according to the session management strategy, which improves the session management process; at the same time, performs address matching , to avoid address conflicts.

图9为本发明一种地址管理服务器的实施例的结构示意图。如图9所示,该地址管理服务器4000包括:Fig. 9 is a schematic structural diagram of an embodiment of an address management server according to the present invention. As shown in Figure 9, the address management server 4000 includes:

第六接收单元401,用于接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录。The sixth receiving unit 401 is configured to receive a query message from the session management device, and the query address list includes records of the second address information, the second port information and the identification information of the terminal equipment carried in the query message.

第一返回单元402,用于如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备。The first returning unit 402 is configured to return an address conflict error response message to the session management apparatus if the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, so that the session management The device sends the address conflict error response message to the terminal device.

增加单元403,用于如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息。The adding unit 403 is configured to add the identification information of the terminal device to the record of the address list if the record does not include the identification information of the terminal device.

第二返回单元404,用于将所述记录返回至所述会话管理装置。The second returning unit 404 is configured to return the record to the session management device.

在本实施例中,该会话管理服务器可以是PCP服务器。In this embodiment, the session management server may be a PCP server.

会话管理装置发送“PCP MAP”请求消息到PCP服务器,其中携带终端设备的标识信息,包括终端标识和终端的设备标识中的一种或多种。该请求消息经过RG,由RG转发,RG可以在其中添加RG标识,以及终端设备的地址信息和端口信息,其中,终端设备可以有多个端口,那么该端口信息包括多个端口的标识信息。如果终端设备与RG之间使用了其它通用即插即用(Universal Plug and Play,UPnP)协议,则UE与RG之间的交互消息将替换成相应UPnP协议的交互消息。The session management device sends a "PCP MAP" request message to the PCP server, which carries identification information of the terminal equipment, including one or more of the terminal identification and the terminal equipment identification. The request message passes through the RG and is forwarded by the RG. The RG can add the RG identifier, and the address information and port information of the terminal device. Wherein, the terminal device can have multiple ports, and the port information includes the identification information of multiple ports. If other universal plug and play (Universal Plug and Play, UPnP) protocols are used between the terminal device and the RG, the interaction message between the UE and the RG will be replaced by the interaction message of the corresponding UPnP protocol.

PCP服务器在任一终端设备接入时,接收并存储了对应RG发送的该终端设备NAPT前后的地址信息和端口信息,形成NAPT映射表,即存储了该终端设备的第一/第二地址信息、第一/第二端口信息的映射关系。当终端设备的标识信息为空时,说明该终端设备为新接入的终端设备,还未发送PCP MAP消息来注册该终端设备的标识信息。其中,第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,即IP WAN地址信息和WAN端口信息;第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息,即本地IP地址信息和局域网(Local Area Network,LAN)源端口信息。When any terminal device accesses, the PCP server receives and stores the address information and port information of the terminal device before and after NAPT sent by the corresponding RG, and forms a NAPT mapping table, which stores the first/second address information of the terminal device, The mapping relationship of the first/second port information. When the identification information of the terminal device is empty, it means that the terminal device is a newly accessed terminal device, and no PCP MAP message has been sent to register the identification information of the terminal device. Wherein, the first address information and the first port information respectively correspond to the address information and port information after NAPT, that is, IP WAN address information and WAN port information; the second address information and the second port information respectively correspond to the address information and port information before NAPT Information, that is, local IP address information and local area network (Local Area Network, LAN) source port information.

PCP服务器接收到“PCP MAP”请求消息后,查询自身存储的NAPT映射表,查找到包含请求消息中的本地IP地址和NAPT前的端口信息的记录,判断该记录所对应的标识信息与请求消息中的终端设备的标识信息不一致,则接收PCP服务器发送的地址冲突错误响应消息,并转发给终端设备;如果该记录未包含终端设备的标识信息,则PCP服务器将终端设备的标识信息填写在此条记录中。地址匹配成功后,接收PCP服务器发送的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及确定的终端设备的标识信息。After receiving the "PCP MAP" request message, the PCP server queries the NAPT mapping table stored by itself, finds the record containing the local IP address in the request message and the port information before NAPT, and judges the identification information corresponding to the record and the request message If the identification information of the terminal device in the record is inconsistent, it will receive the address conflict error response message sent by the PCP server and forward it to the terminal device; if the record does not contain the identification information of the terminal device, the PCP server will fill in the identification information of the terminal device here records. After the address matching is successful, the second address information and the second port information corresponding to the first address information and the first port information sent by the PCP server, and the identification information of the determined terminal device are received.

根据本发明实施例提供的一种地址管理服务器,通过该地址匹配过程,可以避免终端设备之间的本地IP地址和本地端口发生冲突。According to an address management server provided by an embodiment of the present invention, through the address matching process, conflicts between local IP addresses and local ports between terminal devices can be avoided.

图10为本发明一种服务器的实施例的结构示意图。如图10所示,该服务器5000包括:FIG. 10 is a schematic structural diagram of an embodiment of a server according to the present invention. As shown in Figure 10, the server 5000 includes:

第七接收单元501,用于接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息。The seventh receiving unit 501 is configured to receive a session management request sent by the session management apparatus, where the session management request includes identification information and port information of the terminal device.

生成单元502,用于根据所述终端设备标识信息和端口信息,生成会话管理策略。The generating unit 502 is configured to generate a session management policy according to the terminal device identification information and port information.

第十二发送单元503,用于将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。A twelfth sending unit 503, configured to send a session management response message including the session management policy to the session management apparatus.

在本实施例中,服务器接收会话管理装置发送的会话管理请求,该会话管理请求包含终端设备的标识信息,可能还包括端口信息。其中,终端设备的标识信息能唯一标识该终端设备;一个终端设备可能具有多个端口,该端口信息可以包括多个端口的标识信息。In this embodiment, the server receives the session management request sent by the session management device, where the session management request includes identification information of the terminal device, and may also include port information. Wherein, the identification information of the terminal device can uniquely identify the terminal device; one terminal device may have multiple ports, and the port information may include the identification information of the multiple ports.

该会话管理请求对应的终端设备可以为任意的终端设备,可能为新的终端设备,或者,该会话管理请求对应的终端设备可能为已连接的终端设备,但其端口可能为新端口,服务器需要根据终端设备的标识信息,可能还包括的端口信息,生成会话管理策略。该会话管理策略发送给会话管理装置,使得会话管理装置根据该会话管理策略对会话请求进行管理。The terminal device corresponding to the session management request may be any terminal device, possibly a new terminal device, or the terminal device corresponding to the session management request may be a connected terminal device, but its port may be a new port, and the server needs to A session management policy is generated according to the identification information of the terminal device, which may also include port information. The session management policy is sent to the session management device, so that the session management device manages the session request according to the session management policy.

该会话管理请求包括会话建立请求和会话修改请求。对应新的终端设备,会话管理装置发送会话建立请求给服务器,服务器根据终端设备的标识信息及端口信息,为该新的终端设备设置新的会话管理策略,通过会话管理响应消息将该会话管理策略发送给会话管理装置。对应已连接的终端设备的新端口,会话管理装置向服务器发送会话修改请求给服务器,服务器根据终端设备的标识信息查询到对应的该终端设备的会话管理策略,修改该会话管理策略,在其中扩展新端口对应的会话管理策略,通过会话管理响应消息将该会话管理策略发送给会话管理装置。其中,该服务器可以是PCRF。该会话管理策略包括服务质量,还可以包括计费策略。The session management request includes a session establishment request and a session modification request. Corresponding to a new terminal device, the session management device sends a session establishment request to the server, and the server sets a new session management policy for the new terminal device according to the identification information and port information of the terminal device, and uses the session management response message to set the session management policy sent to the session management device. Corresponding to the new port of the connected terminal device, the session management device sends a session modification request to the server, and the server queries the corresponding session management strategy of the terminal device according to the identification information of the terminal device, modifies the session management strategy, and expands the session management strategy in it. The session management policy corresponding to the new port is sent to the session management device through a session management response message. Wherein, the server may be PCRF. The session management policy includes quality of service, and may also include a charging policy.

当接收到会话管理装置的会话管理请求时,如果该会话管理请求为会话修改请求,指示删除相应的端口,或该会话管理请求为会话终止请求,则PCRF删除这些端口的对应资源,并调整会话管理策略。When receiving the session management request from the session management device, if the session management request is a session modification request indicating deletion of the corresponding ports, or the session management request is a session termination request, the PCRF deletes the corresponding resources of these ports and adjusts the session management strategy.

根据本发明实施例提供的一种服务器,该服务器接收会话管理装置发送的请求为新的终端设备或已连接的终端设备的新端口设置会话管理策略的请求,为该终端设备设置会话管理策略,使得接收到该会话管理策略的会话管理装置可以根据该会话管理策略对该终端设备进行会话管理,完善了会话管理过程。According to a server provided in an embodiment of the present invention, the server receives a request sent by a session management device to set a session management policy for a new terminal device or a new port of a connected terminal device, and sets a session management policy for the terminal device, The session management device that receives the session management policy can perform session management on the terminal device according to the session management policy, thereby perfecting the session management process.

图11为本发明提供的一种会话管理设备的一个实施例的结构示意图。如图11所示,该设备6000包括:Fig. 11 is a schematic structural diagram of an embodiment of a session management device provided by the present invention. As shown in Figure 11, the device 6000 includes:

输入装置601、输出装置602、存储器603和处理器604(会话管理设备中的处理器604的数量可以一个或多个,图11中以一个处理器为例)。在本发明的一些实施例中,输入装置601、输出装置602、存储器603和处理器604可通过总线或其它方式连接,其中,图11中以通过总线连接为例。An input device 601 , an output device 602 , a memory 603 and a processor 604 (the number of processors 604 in the session management device may be one or more, one processor is taken as an example in FIG. 11 ). In some embodiments of the present invention, the input device 601 , the output device 602 , the memory 603 and the processor 604 may be connected through a bus or in other ways, wherein connection through a bus is taken as an example in FIG. 11 .

其中,存储器603中存储一组程序代码,且处理器604用于调用存储器603中存储的程序代码,用于执行以下操作:Wherein, a set of program codes are stored in the memory 603, and the processor 604 is used to call the program codes stored in the memory 603 to perform the following operations:

接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;When receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request;

根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;Sending a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device;

接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理。receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message.

作为一种实施方式,所述接收到终端设备的会话请求,包括:As an implementation manner, the receiving the session request of the terminal device includes:

检测到一个五元组数据包;或者,A five-tuple packet is detected; or,

接收到终端设备的地址匹配请求。An address matching request from a terminal device is received.

作为一种实施方式,处理器604执行所述检测到一个五元组数据包时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤,包括:As an implementation manner, when the processor 604 executes the detection of a 5-tuple data packet, according to the identification information, address information and port information of the terminal device carried in the session request, determine the terminal device and/or or port type steps, including:

向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息;Querying the PCP server for second address information and second port information corresponding to the first address information and first port information of the terminal device, and identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

作为一种实施方式,处理器604执行所述接收到终端设备的地址匹配请求的步骤之后,以及所述处理器执行所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤之前,还执行以下步骤:As an implementation manner, after the processor 604 executes the step of receiving the address matching request of the terminal device, and the processor executes the identification information, address information and Port information, before the step of determining the type of the terminal device and/or port, the following steps are also performed:

如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。If the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the source address of the address matching request to the value in the PCP client address field , and send the address matching request to the PCP server.

作为一种实施方式,处理器604执行所述接收到终端设备的地址匹配请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤,包括:As an implementation manner, when the processor 604 executes receiving the address matching request of the terminal device, according to the identification information, address information and port information of the terminal device carried in the session request, the terminal device and/or or port type steps, including:

向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息;Querying the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the identification information of the terminal device;

根据查询结果确定所述终端设备和/或端口的类型。Determine the type of the terminal device and/or port according to the query result.

作为一种实施方式,处理器604执行所述向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息的步骤,包括:As an implementation manner, the processor 604 performs the step of querying the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, including:

发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and judges that the terminal device identification information corresponding to the record is the same as the terminal device's Whether the identification information is consistent;

如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备;If the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receiving an address conflict error response message returned by the PCP server, and sending the address conflict error response message to the terminal device;

如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。If the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal device's Identification information.

作为一种实施方式,处理器604执行所述根据查询结果确定所述终端设备和/或端口的类型的步骤,包括:As an implementation manner, the processor 604 performing the step of determining the type of the terminal device and/or port according to the query result includes:

判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;Judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache;

如果判断结果为否,则确定所述终端设备为第一类型的终端设备;If the judgment result is no, then determining that the terminal device is a first type of terminal device;

如果判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;If the judgment result is yes, further judge whether there is a record corresponding to the second port information in the query result in the local cache;

如果进一步的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。If the further judgment result is no, it is determined that the terminal device is a second type of terminal device and that the port is a first type of port.

作为一种实施方式,处理器604执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:As an implementation manner, the processor 604 executes the step of sending a session management request to the server according to the type of the terminal device and/or port, including:

如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;If it is determined that the terminal device is a first type of terminal device, sending a session establishment request to the server, where the session establishment request includes identification information and port information of the terminal device;

如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If the terminal device is a terminal device of the second type and the port is a port of the first type, a session modification request is sent to the server, where the session modification request includes identification information and port information of the terminal device.

作为一种实施方式,处理器604执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:As an implementation manner, the processor 604 executes the step of sending a session management request to the server according to the type of the terminal device and/or port, including:

如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If it is determined that the terminal device is a terminal device of the first type, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, a session modification request is sent to the server, wherein the session modification request includes the Identification information and port information of the terminal device.

作为一种实施方式,处理器604还执行以下步骤:As an implementation manner, the processor 604 also performs the following steps:

接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;receiving a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released;

向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;Sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list;

向所述服务器发送会话管理请求,并接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;Sending a session management request to the server, and receiving a response message returned by the server for performing session management on the port to be released;

释放所述待释放的端口占有的资源。Release the resource occupied by the port to be released.

作为一种实施方式,处理器604执行所述向所述服务器发送会话管理请求的步骤,包括:As an implementation manner, the processor 604 performing the step of sending the session management request to the server includes:

如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;If the received session request sent by the terminal device indicates that all ports will be released, then send a session termination request to the server;

否则,向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。Otherwise, send a session modification request to the server, where the session modification request includes the identification information of the terminal device, the port number to be released, and a deletion flag.

可以理解的是,本实施例的会话管理设备6000的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。It can be understood that the functions of the functional modules of the session management device 6000 in this embodiment can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, and will not be repeated here. .

根据本发明提供的一种会话管理设备的一个实施例,可以根据终端设备和/或端口的类型请求服务器为该终端设备设置和下发相应的会话管理策略,根据该会话管理策略进行会话管理,完善了会话管理过程。According to an embodiment of a session management device provided by the present invention, the server may be requested to set and issue a corresponding session management policy for the terminal device according to the type of the terminal device and/or port, and perform session management according to the session management policy, Improved the session management process.

图12为本发明提供的一种会话管理服务器的一个实施例的结构示意图。如图12所示,该会话管理服务器7000包括:Fig. 12 is a schematic structural diagram of an embodiment of a session management server provided by the present invention. As shown in Figure 12, the session management server 7000 includes:

输入装置701、输出装置702、存储器703和处理器704(服务器中的处理器704的数量可以一个或多个,图12中以一个处理器为例)。在本发明的一些实施例中,输入装置701、输出装置702、存储器703和处理器704可通过总线或其它方式连接,其中,图12中以通过总线连接为例。An input device 701 , an output device 702 , a memory 703 and a processor 704 (the number of processors 704 in the server can be one or more, one processor is taken as an example in FIG. 12 ). In some embodiments of the present invention, the input device 701 , the output device 702 , the memory 703 and the processor 704 may be connected through a bus or in other ways, wherein connection through a bus is taken as an example in FIG. 12 .

其中,存储器703中存储一组程序代码,且处理器704用于调用存储器703中存储的程序代码,用于执行以下操作:Wherein, a set of program codes are stored in the memory 703, and the processor 704 is used to call the program codes stored in the memory 703 to perform the following operations:

接收会话管理装置的查询消息,查询地址列表中包含所述查询消息携带的第二地址信息、第二端口信息和终端设备的标识信息的记录;receiving a query message from the session management device, where the query address list includes records of the second address information, the second port information, and the identification information of the terminal equipment carried in the query message;

如果所述记录所对应的终端设备的标识信息与所述终端设备的标识信息不一致,则向所述会话管理装置返回地址冲突错误响应消息,以使所述会话管理装置将所述地址冲突错误响应消息发送给终端设备;If the identification information of the terminal equipment corresponding to the record is inconsistent with the identification information of the terminal equipment, return an address conflict error response message to the session management device, so that the session management device responds with the address conflict error The message is sent to the terminal device;

如果所述记录未包括终端设备的标识信息,则在地址列表的所述记录中增加所述终端设备的标识信息,并将所述记录返回至所述会话管理装置。If the record does not include the identification information of the terminal device, adding the identification information of the terminal device to the record in the address list, and returning the record to the session management apparatus.

该会话管理服务器可以是PCP服务器。The session management server may be a PCP server.

根据本发明实施例提供的一种会话管理服务器,通过该地址匹配过程,可以避免终端设备之间的本地IP地址和本地端口发生冲突。According to a session management server provided by an embodiment of the present invention, through the address matching process, conflicts between local IP addresses and local ports between terminal devices can be avoided.

图13为本发明提供的一种服务器的一个实施例的结构示意图。如图13所示,该服务器8000包括:Fig. 13 is a schematic structural diagram of an embodiment of a server provided by the present invention. As shown in Figure 13, the server 8000 includes:

输入装置801、输出装置802、存储器803和处理器804(服务器中的处理器804的数量可以一个或多个,图13中以一个处理器为例)。在本发明的一些实施例中,输入装置801、输出装置802、存储器803和处理器804可通过总线或其它方式连接,其中,图13中以通过总线连接为例。An input device 801 , an output device 802 , a memory 803 and a processor 804 (the number of processors 804 in the server may be one or more, one processor is taken as an example in FIG. 13 ). In some embodiments of the present invention, the input device 801 , the output device 802 , the memory 803 and the processor 804 may be connected through a bus or in other ways, wherein connection through a bus is taken as an example in FIG. 13 .

其中,存储器803中存储一组程序代码,且处理器804用于调用存储器803中存储的程序代码,用于执行以下操作:Wherein, a set of program codes are stored in the memory 803, and the processor 804 is used to call the program codes stored in the memory 803 to perform the following operations:

接收会话管理装置发送的会话管理请求,所述会话管理请求包含终端设备的标识信息和端口信息;receiving a session management request sent by the session management device, where the session management request includes identification information and port information of the terminal device;

根据所述终端设备标识信息和端口信息,生成会话管理策略,并将包含所述会话管理策略的会话管理响应消息发送给所述会话管理装置。Generate a session management policy according to the terminal device identification information and port information, and send a session management response message containing the session management policy to the session management apparatus.

其中,会话管理策略包括服务质量和/或计费策略。Wherein, the session management policy includes service quality and/or charging policy.

根据本发明实施例提供的一种服务器,该服务器接收会话管理装置发送的请求为新的终端设备或已连接的终端设备的新端口设置会话管理策略的请求,为该终端设备设置会话管理策略,使得接收到该会话管理策略的会话管理装置可以根据该会话管理策略对该终端设备进行会话管理,完善了会话管理过程。According to a server provided in an embodiment of the present invention, the server receives a request sent by a session management device to set a session management policy for a new terminal device or a new port of a connected terminal device, and sets a session management policy for the terminal device, The session management device that receives the session management policy can perform session management on the terminal device according to the session management policy, thereby perfecting the session management process.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的设备和模块的具体工作过程,可以参考前述方法实施例中的对应过程描述,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the foregoing method embodiments, and details are not repeated here.

在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个设备中,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined or May be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or modules may be in electrical, mechanical or other forms.

所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部,模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

以上对本发明实施例所提供的一种会话管理方法及相关装置的技术方案进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The technical solutions of a session management method and related devices provided by the embodiments of the present invention have been described above in detail. In this paper, specific examples are used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for To help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification It should not be construed as a limitation of the invention.

Claims (24)

1.一种会话管理方法,其特征在于,包括:1. A session management method, characterized in that, comprising: 接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;When receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request; 根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;Sending a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device; 接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理;receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message; 所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型,包括:The determining the type of the terminal device and/or port according to the identification information, address information and port information of the terminal device carried in the session request includes: 检测到一个五元组数据包时,向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息、或接收到终端设备的地址匹配请求时,向所述PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息,所述第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,所述第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息;When a quintuple data packet is detected, query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device, as well as the identification information of the terminal device, or when receiving an address matching request from a terminal device, querying the PCP server for the first address information and first port information corresponding to the second address information and second port information of the terminal device, and the terminal device's Identification information, the first address information and the first port information correspond to address information and port information after NAPT respectively, and the second address information and second port information correspond to address information and port information before NAPT respectively; 根据查询结果确定所述终端设备和/或端口的类型;determining the type of the terminal device and/or port according to the query result; 所述根据查询结果确定所述终端设备和/或端口的类型,包括:The determining the type of the terminal device and/or port according to the query result includes: 判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;Judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache; 如果判断结果为否,则确定所述终端设备为第一类型的终端设备;If the judgment result is no, then determining that the terminal device is a first type of terminal device; 如果判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;If the judgment result is yes, further judge whether there is a record corresponding to the second port information in the query result in the local cache; 如果进一步的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。If the further judgment result is no, it is determined that the terminal device is a second type of terminal device and that the port is a first type of port. 2.如权利要求1所述的方法,其特征在于,所述接收到终端设备的会话请求,包括:2. The method according to claim 1, wherein the receiving the session request of the terminal device comprises: 检测到一个五元组数据包;或者,A five-tuple packet is detected; or, 接收到终端设备的地址匹配请求。An address matching request from a terminal device is received. 3.如权利要求2所述的方法,其特征在于,所述接收到终端设备的地址匹配请求之后,以及所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型之前,还包括:3. The method according to claim 2, wherein after receiving the address matching request of the terminal device, and the identification information, address information and port information of the terminal device carried in the session request , before determining the type of the terminal device and/or port, further comprising: 如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。If the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the source address of the address matching request to the value in the PCP client address field , and send the address matching request to the PCP server. 4.如权利要求1所述的方法,其特征在于,所述向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,包括:4. The method according to claim 1, wherein the querying the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device comprises: 发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and judges that the terminal device identification information corresponding to the record is the same as the terminal device's Whether the identification information is consistent; 如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备;If the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receiving an address conflict error response message returned by the PCP server, and sending the address conflict error response message to the terminal device; 如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。If the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal device's Identification information. 5.如权利要求1所述的方法,其特征在于,所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求,包括:5. The method according to claim 1, wherein the sending a session management request to the server according to the type of the terminal device and/or port comprises: 如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;If it is determined that the terminal device is a first type of terminal device, sending a session establishment request to the server, where the session establishment request includes identification information and port information of the terminal device; 如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If the terminal device is a terminal device of the second type and the port is a port of the first type, a session modification request is sent to the server, where the session modification request includes identification information and port information of the terminal device. 6.如权利要求1所述的方法,所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求,包括:6. The method according to claim 1, said sending a session management request to the server according to the type of the terminal device and/or port, comprising: 如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If it is determined that the terminal device is a terminal device of the first type, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, a session modification request is sent to the server, wherein the session modification request includes the Identification information and port information of the terminal device. 7.如权利要求4-6任一项所述的方法,其特征在于,还包括:7. The method according to any one of claims 4-6, further comprising: 接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;receiving a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released; 向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;Sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list; 向所述服务器发送会话管理请求,并接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;Sending a session management request to the server, and receiving a response message returned by the server for performing session management on the port to be released; 释放所述待释放的端口占有的资源。Release the resource occupied by the port to be released. 8.如权利要求7所述的方法,其特征在于,所述向所述服务器发送会话管理请求,包括:8. The method according to claim 7, wherein the sending a session management request to the server comprises: 如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;If the received session request sent by the terminal device indicates that all ports will be released, then send a session termination request to the server; 否则,向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。Otherwise, send a session modification request to the server, where the session modification request includes the identification information of the terminal device, the port number to be released, and a deletion flag. 9.一种会话管理装置,其特征在于,包括:9. A session management device, comprising: 第一确定单元,用于接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;The first determining unit is configured to, when receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request; 第一发送单元,用于根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;A first sending unit, configured to send a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device; 第一接收单元,用于接收所述服务器发送的会话管理响应消息;a first receiving unit, configured to receive a session management response message sent by the server; 第一管理单元,用于根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理;a first management unit, configured to perform session management on the terminal device according to the session management policy included in the session management response message; 所述第一确定单元包括:第一查询单元或第二查询单元,以及第二确定单元,其中:The first determination unit includes: a first query unit or a second query unit, and a second determination unit, wherein: 第一查询单元,用于检测到一个五元组数据包时,向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息;The first query unit is configured to query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device when a quintuple data packet is detected, and the The identification information of the terminal device; 第二查询单元,用于接收到终端设备的地址匹配请求时,向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息;The second query unit is configured to, when receiving the address matching request of the terminal device, query the PCP server for the first address information and the first port information corresponding to the second address information and the second port information of the terminal device, and the The identification information of the terminal device; 第二确定单元,用于根据查询结果确定所述终端设备和/或端口的类型;a second determining unit, configured to determine the type of the terminal device and/or port according to the query result; 所述第二确定单元包括:The second determination unit includes: 第一判断单元,用于判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;A first judging unit, configured to judge whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache; 第三确定单元,用于如果判断结果为否,则确定所述终端设备为第一类型的终端设备;A third determining unit, configured to determine that the terminal device is a terminal device of the first type if the judgment result is no; 第二判断单元,用于如果所述第一判断单元的判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;The second judging unit is configured to further judge whether there is a record corresponding to the second port information in the query result in the local buffer if the judging result of the first judging unit is yes; 第四确定单元,用于如果所述第二判断单元的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口;A fourth determining unit, configured to determine that the terminal device is a second type of terminal device and that the port is a first type of port if the judgment result of the second judgment unit is negative; 其中,所述第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,所述第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息。Wherein, the first address information and first port information respectively correspond to address information and port information after NAPT, and the second address information and second port information respectively correspond to address information and port information before NAPT. 10.如权利要求9所述的装置,其特征在于,所述接收到终端设备的会话请求,包括:10. The apparatus according to claim 9, wherein the receiving the session request of the terminal device comprises: 检测到一个五元组数据包;或者,A five-tuple packet is detected; or, 接收到终端设备的地址匹配请求。An address matching request from a terminal device is received. 11.如权利要求10所述的装置,其特征在于,还包括:11. The apparatus of claim 10, further comprising: 修改单元,用于如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值;A modifying unit, configured to modify the source address of the address matching request to the PCP client address if the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request the value in the field; 第二发送单元,用于将所述地址匹配请求发送给PCP服务器。The second sending unit is configured to send the address matching request to the PCP server. 12.如权利要求9所述的装置,其特征在于,所述第二查询单元包括:12. The device according to claim 9, wherein the second query unit comprises: 第三发送单元,用于发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;A third sending unit, configured to send a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and determines the terminal device identifier corresponding to the record Whether the information is consistent with the identification information of the terminal device; 第二接收单元,用于如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息;The second receiving unit is configured to receive an address conflict error response message returned by the PCP server if the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information; 第四发送单元,用于将所述地址冲突错误响应消息发送至所述终端设备;a fourth sending unit, configured to send the address conflict error response message to the terminal device; 第三接收单元,用于如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。A third receiving unit, configured to receive first address information and first port information corresponding to the second address information and second port information sent by the PCP server if the record does not include the identification information of the terminal device , and the identification information of the terminal device. 13.如权利要求9所述的装置,其特征在于,所述第一发送单元包括:13. The device according to claim 9, wherein the first sending unit comprises: 第五发送单元,用于如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;A fifth sending unit, configured to send a session establishment request to a server if it is determined that the terminal device is a first type of terminal device, where the session establishment request includes identification information and port information of the terminal device; 第六发送单元,用于如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A sixth sending unit, configured to send a session modification request to the server if the terminal device is a second type of terminal device and the port is a first type port, wherein the session modification request includes the terminal device ID information and port information. 14.如权利要求9所述的装置,所述第一发送单元还包括:14. The apparatus according to claim 9, the first sending unit further comprising: 第七发送单元,用于如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。A seventh sending unit, configured to send a session modification request to the server if it is determined that the terminal device is a first type of terminal device and the terminal device is determined to be a fixed terminal device according to the identification information of the terminal device, wherein the The session modification request includes identification information and port information of the terminal device. 15.如权利要求12-14任一项所述的装置,其特征在于,还包括:15. The device according to any one of claims 12-14, further comprising: 第四接收单元,用于接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;A fourth receiving unit, configured to receive a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released; 第八发送单元,用于向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;An eighth sending unit, configured to send a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list; 第九发送单元,用于向所述服务器发送会话管理请求;a ninth sending unit, configured to send a session management request to the server; 第五接收单元,用于接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;A fifth receiving unit, configured to receive a response message returned by the server for performing session management on the port to be released; 释放单元,用于释放所述待释放的端口占有的资源。A release unit, configured to release the resource occupied by the port to be released. 16.如权利要求15所述的装置,其特征在于,所述第九发送单元包括:16. The device according to claim 15, wherein the ninth sending unit comprises: 第十发送单元,用于如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;A tenth sending unit, configured to send a session termination request to the server if the received session request sent by the terminal device indicates that all ports will be released; 第十一发送单元,用于如果所述接收到的终端设备发送的会话请求中指示部分端口将被释放,则向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。The eleventh sending unit is configured to send a session modification request to the server if the received session request sent by the terminal device indicates that some ports will be released, and the session modification request includes the terminal device's Identification information, the port number to be released, and the deletion flag. 17.一种会话管理设备,其特征在于,包括:输入装置、输出装置、存储器和处理器,其中,所述存储器中存储一组程序代码,且所述处理器用于调用所述存储器中存储的程序代码,用于执行以下操作:17. A session management device, characterized in that it comprises: an input device, an output device, a memory, and a processor, wherein a set of program codes are stored in the memory, and the processor is used to call a program code stored in the memory Program code to do the following: 接收到终端设备的会话请求时,根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型;When receiving a session request from a terminal device, determine the type of the terminal device and/or port according to the identification information, address information, and port information of the terminal device carried in the session request; 根据所述终端设备和/或端口的类型,向服务器发送会话管理请求,所述会话管理请求包括所述终端设备的标识信息和端口信息;Sending a session management request to a server according to the type of the terminal device and/or port, where the session management request includes identification information and port information of the terminal device; 接收所述服务器发送的会话管理响应消息,根据所述会话管理响应消息包含的会话管理策略,对所述终端设备进行会话管理;receiving a session management response message sent by the server, and performing session management on the terminal device according to the session management policy included in the session management response message; 所述处理器执行所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤,包括:The processor executes the step of determining the type of the terminal device and/or port according to the identification information, address information and port information of the terminal device carried in the session request, including: 检测到一个五元组数据包时,向PCP服务器查询所述终端设备的第一地址信息和第一端口信息所对应的第二地址信息和第二端口信息,以及所述终端设备的标识信息、或接收到终端设备的地址匹配请求时,向所述PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息,所述第一地址信息和第一端口信息分别对应NAPT后的地址信息和端口信息,所述第二地址信息和第二端口信息分别对应NAPT前的地址信息和端口信息;When a quintuple data packet is detected, query the PCP server for the second address information and the second port information corresponding to the first address information and the first port information of the terminal device, as well as the identification information of the terminal device, or when receiving an address matching request from a terminal device, querying the PCP server for the first address information and first port information corresponding to the second address information and second port information of the terminal device, and the terminal device's Identification information, the first address information and the first port information correspond to address information and port information after NAPT respectively, and the second address information and second port information correspond to address information and port information before NAPT respectively; 根据查询结果确定所述终端设备和/或端口的类型;determining the type of the terminal device and/or port according to the query result; 所述处理器执行所述根据查询结果确定所述终端设备和/或端口的类型的步骤,包括:The processor executes the step of determining the type of the terminal device and/or port according to the query result, including: 判断本地缓存区中是否存在与所述查询结果中的终端设备的标识信息对应的记录;Judging whether there is a record corresponding to the identification information of the terminal device in the query result in the local cache; 如果判断结果为否,则确定所述终端设备为第一类型的终端设备;If the judgment result is no, then determining that the terminal device is a first type of terminal device; 如果判断结果为是,进一步判断所述本地缓存区中是否存在与所述查询结果中的第二端口信息对应的记录;If the judgment result is yes, further judge whether there is a record corresponding to the second port information in the query result in the local cache; 如果进一步的判断结果为否,确定所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口。If the further judgment result is no, it is determined that the terminal device is a second type of terminal device and that the port is a first type of port. 18.如权利要求17所述的会话管理设备,其特征在于,所述接收到终端设备的会话请求,包括:18. The session management device according to claim 17, wherein the receiving the session request of the terminal device comprises: 检测到一个五元组数据包;或者,A five-tuple packet is detected; or, 接收到终端设备的地址匹配请求。An address matching request from a terminal device is received. 19.如权利要求18所述的会话管理设备,其特征在于,所述处理器执行所述接收到终端设备的地址匹配请求的步骤之后,以及所述处理器执行所述根据所述会话请求携带的所述终端设备的标识信息、地址信息和端口信息,确定所述终端设备和/或端口的类型的步骤之前,还执行以下步骤:19. The session management device according to claim 18, wherein after the processor executes the step of receiving the address matching request of the terminal device, and the processor executes the carrying The identification information, address information and port information of the terminal equipment, before the step of determining the type of the terminal equipment and/or port, the following steps are also performed: 如果所述地址匹配请求的源地址与所述地址匹配请求中PCP客户端地址域中的取值不一致,则将所述地址匹配请求的源地址修改为所述PCP客户端地址域中的取值,并将所述地址匹配请求发送给PCP服务器。If the source address of the address matching request is inconsistent with the value in the PCP client address field in the address matching request, modify the source address of the address matching request to the value in the PCP client address field , and send the address matching request to the PCP server. 20.如权利要求17所述的会话管理设备,其特征在于,所述处理器执行所述向PCP服务器查询所述终端设备的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息的步骤,包括:20. The session management device according to claim 17, wherein the processor performs the querying the PCP server for the first address information and the first address information corresponding to the second address information and the second port information of the terminal device. The steps of the first port information include: 发送查询消息到PCP服务器,以使所述PCP服务器查询地址列表中包含所述第二地址信息和第二端口信息的记录,并判断所述记录所对应的终端设备标识信息与所述终端设备的标识信息是否一致;sending a query message to the PCP server, so that the PCP server queries the record containing the second address information and the second port information in the address list, and judges that the terminal device identification information corresponding to the record is the same as the terminal device's Whether the identification information is consistent; 如果所述记录所对应的终端设备标识信息与所述终端设备的标识信息不一致,则接收所述PCP服务器返回的地址冲突错误响应消息,将所述地址冲突错误响应消息发送至所述终端设备;If the terminal device identification information corresponding to the record is inconsistent with the terminal device identification information, receiving an address conflict error response message returned by the PCP server, and sending the address conflict error response message to the terminal device; 如果所述记录未包括所述终端设备的标识信息,则接收所述PCP服务器发送的第二地址信息和第二端口信息所对应的第一地址信息和第一端口信息,以及所述终端设备的标识信息。If the record does not include the identification information of the terminal device, receiving the first address information and the first port information corresponding to the second address information and the second port information sent by the PCP server, and the terminal device's Identification information. 21.如权利要求17所述的会话管理设备,其特征在于,所述处理器执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:21. The session management device according to claim 17, wherein the processor executes the step of sending a session management request to a server according to the type of the terminal device and/or port, comprising: 如果确定所述终端设备为第一类型的终端设备,则向服务器发送会话建立请求,其中,所述会话建立请求包括所述终端设备的标识信息和端口信息;If it is determined that the terminal device is a first type of terminal device, sending a session establishment request to the server, where the session establishment request includes identification information and port information of the terminal device; 如果所述终端设备为第二类型的终端设备以及所述端口为第一类型的端口,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If the terminal device is a terminal device of the second type and the port is a port of the first type, a session modification request is sent to the server, where the session modification request includes identification information and port information of the terminal device. 22.如权利要求17所述的会话管理设备,所述处理器执行所述根据所述终端设备和/或端口的类型向服务器发送会话管理请求的步骤,包括:22. The session management device according to claim 17, said processor executing said step of sending a session management request to a server according to the type of said terminal device and/or port, comprising: 如果确定所述终端设备为第一类型的终端设备,以及根据所述终端设备的标识信息确定该终端设备为固定终端设备,则向服务器发送会话修改请求,其中,所述会话修改请求包括所述终端设备的标识信息和端口信息。If it is determined that the terminal device is a terminal device of the first type, and it is determined according to the identification information of the terminal device that the terminal device is a fixed terminal device, a session modification request is sent to the server, wherein the session modification request includes the Identification information and port information of the terminal device. 23.如权利要求20-22任一项所述的会话管理设备,其特征在于,所述处理器还执行以下步骤:23. The session management device according to any one of claims 20-22, wherein the processor further performs the following steps: 接收到所述终端设备的会话请求,所述会话请求中包括所述终端设备的标识信息和待释放的端口信息;receiving a session request from the terminal device, where the session request includes identification information of the terminal device and port information to be released; 向所述PCP服务器发送删除所述地址列表中与所述终端设备的标识信息和待释放的端口信息相对应的记录的请求;Sending a request to the PCP server to delete a record corresponding to the identification information of the terminal device and the port information to be released in the address list; 向所述服务器发送会话管理请求,并接收所述服务器返回的针对待释放的端口进行会话管理的响应消息;Sending a session management request to the server, and receiving a response message returned by the server for performing session management on the port to be released; 释放所述待释放的端口占有的资源。Release the resource occupied by the port to be released. 24.如权利要求23所述的会话管理设备,其特征在于,所述处理器执行所述向所述服务器发送会话管理请求的步骤,包括:24. The session management device according to claim 23, wherein the processor performing the step of sending a session management request to the server comprises: 如果所述接收到的终端设备发送的会话请求中指示所有端口都将被释放,则向所述服务器发送会话终止请求;If the received session request sent by the terminal device indicates that all ports will be released, then send a session termination request to the server; 否则,向所述服务器发送会话修改请求,所述会话修改请求中包括所述终端设备的标识信息,待释放的端口号,以及删除标志。Otherwise, send a session modification request to the server, where the session modification request includes the identification information of the terminal device, the port number to be released, and a deletion flag.
CN201380000539.0A 2013-06-17 2013-06-17 Session management method, address management method and relevant device Active CN104488240B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/077302 WO2014201600A1 (en) 2013-06-17 2013-06-17 Session management method, address management method and relevant device

Publications (2)

Publication Number Publication Date
CN104488240A CN104488240A (en) 2015-04-01
CN104488240B true CN104488240B (en) 2017-04-26

Family

ID=52103775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201380000539.0A Active CN104488240B (en) 2013-06-17 2013-06-17 Session management method, address management method and relevant device

Country Status (2)

Country Link
CN (1) CN104488240B (en)
WO (1) WO2014201600A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11071167B2 (en) 2017-06-26 2021-07-20 Huawei Technologies Co., Ltd. Method, apparatus, system, and device for managing a session corresponding to multiple session management function network elements
US12040979B2 (en) 2019-04-28 2024-07-16 Huawei Technologies Co., Ltd. Communications method, apparatus, and system

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161251B (en) * 2016-06-14 2019-06-07 国家计算机网络与信息安全管理中心 Message safety analytical method and device
CN110417840B (en) * 2018-04-28 2020-10-09 华为技术有限公司 An information processing method and device
CN109617753B (en) * 2019-02-26 2022-03-22 深信服科技股份有限公司 Network platform management method, system, electronic equipment and storage medium
CN114500341B (en) * 2021-12-28 2024-05-14 福建升腾资讯有限公司 Terminal real-time management and control method under wide area network and management and control server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980252A (en) * 2005-12-06 2007-06-13 华为技术有限公司 Address-conflict detection realizing method and address conflict detection agent apparatus
CN101035070A (en) * 2007-02-05 2007-09-12 华为技术有限公司 Method, device and NAT device for notifying the network terminal after aging session
CN101068160A (en) * 2007-06-15 2007-11-07 杭州华三通信技术有限公司 A method and proxy device for managing dynamic address equipment
CN101132424A (en) * 2007-09-29 2008-02-27 杭州华三通信技术有限公司 Network address conversion method and device thereof
CN101170556A (en) * 2006-10-26 2008-04-30 阿尔卡特朗讯公司 Method and communication client for establishing a communication session between communication clients
CN101197808A (en) * 2006-12-08 2008-06-11 上海贝尔阿尔卡特股份有限公司 Method for sustaining NAT address in SIP network system and device thereof
CN101222343A (en) * 2008-01-30 2008-07-16 中兴通讯股份有限公司 Policy and charging control system and control method for media gateway

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW588532B (en) * 2002-03-29 2004-05-21 Realtek Semiconductor Corp Management device and method of NAT/NAPT session
CN1870569B (en) * 2005-05-25 2012-02-08 国际商业机器公司 Network system and its management method, communication terminal and message sending method
CN101729388B (en) * 2008-10-22 2012-01-25 华为技术有限公司 A method for implementing network address translation, media gateway and network system
CN102387081B (en) * 2011-11-18 2014-04-02 华为技术有限公司 Communication service QoS assurance method, device and system in NAT scene

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1980252A (en) * 2005-12-06 2007-06-13 华为技术有限公司 Address-conflict detection realizing method and address conflict detection agent apparatus
CN101170556A (en) * 2006-10-26 2008-04-30 阿尔卡特朗讯公司 Method and communication client for establishing a communication session between communication clients
CN101197808A (en) * 2006-12-08 2008-06-11 上海贝尔阿尔卡特股份有限公司 Method for sustaining NAT address in SIP network system and device thereof
CN101035070A (en) * 2007-02-05 2007-09-12 华为技术有限公司 Method, device and NAT device for notifying the network terminal after aging session
CN101068160A (en) * 2007-06-15 2007-11-07 杭州华三通信技术有限公司 A method and proxy device for managing dynamic address equipment
CN101132424A (en) * 2007-09-29 2008-02-27 杭州华三通信技术有限公司 Network address conversion method and device thereof
CN101222343A (en) * 2008-01-30 2008-07-16 中兴通讯股份有限公司 Policy and charging control system and control method for media gateway

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11071167B2 (en) 2017-06-26 2021-07-20 Huawei Technologies Co., Ltd. Method, apparatus, system, and device for managing a session corresponding to multiple session management function network elements
US11606839B2 (en) 2017-06-26 2023-03-14 Huawei Technologies Co., Ltd. Method, apparatus, system, and device for managing a session corresponding to multiple session management function network elements
US12040979B2 (en) 2019-04-28 2024-07-16 Huawei Technologies Co., Ltd. Communications method, apparatus, and system

Also Published As

Publication number Publication date
WO2014201600A1 (en) 2014-12-24
CN104488240A (en) 2015-04-01

Similar Documents

Publication Publication Date Title
CN109413640B (en) Session information query method, network element and computer storage medium
CN104488240B (en) Session management method, address management method and relevant device
EP2949109B1 (en) Methods, systems, and computer readable media for using a diameter routing agent (dra) to obtain mappings between mobile subscriber identification information and dynamically assigned internet protocol (ip) addresses and for making the mappings accessible to applications
CN101420674B (en) Implementation method of NAT technology in PCC architecture, PCRF and AF
CN105101176B (en) A session binding method, device and system in a roaming scenario
WO2020253631A1 (en) Configuration method, device, and system for ip address
CN102334355B (en) Policy control method and equipment
CN104348826A (en) Session management method, AF (application function) entity, policy server and PC (protocol converter)
CN114095430B (en) Access message processing method, system and working node
EP3113539A1 (en) Load balancing user plane traffic in a telecommunication network
WO2019154017A1 (en) Multipath establishing method and apparatus
CN105357180A (en) Network system, attack message intercepting method, attack message intercepting apparatus, and device
CN110035040B (en) Method and device for signaling addressing
CN102014039B (en) Data transmission method and access point
WO2015103919A1 (en) Resource allocation method, controller and system
CN102918817B (en) The method of IPv6 address assignment and equipment
CN105897758A (en) Container access control method and device
US20120300776A1 (en) Method for creating virtual link, communication network element, and ethernet network system
CN103051544A (en) Method and equipment for access of Internet protocol version 4 (IPv4) private network to Internet protocol version 6 (IPv6) network
TWI607337B (en) Firewall command rule optimization system and method
CN105812272B (en) Processing method, device and the system of business chain
CN109660459B (en) Physical gateway and method for multiplexing IP address
CN116032992A (en) Session information updating method, device, storage medium and electronic equipment
EP3322124A1 (en) Control method for application feature rules and application feature server
CN102083173A (en) Network access control method, equipment and gateway GPRS support node

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant