CN105471927A - Method for processing service routing message, and service node - Google Patents
Method for processing service routing message, and service node Download PDFInfo
- Publication number
- CN105471927A CN105471927A CN201410240822.7A CN201410240822A CN105471927A CN 105471927 A CN105471927 A CN 105471927A CN 201410240822 A CN201410240822 A CN 201410240822A CN 105471927 A CN105471927 A CN 105471927A
- Authority
- CN
- China
- Prior art keywords
- socket
- message
- unit
- application program
- processed
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
- H04L69/32—Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
- H04L69/321—Interlayer communication protocols or service data unit [SDU] definitions; Interfaces between layers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种对业务路由报文进行处理的方法,包括:业务节点SN中的套接字单元创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文包括业务路由信息和待处理报文;保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;从所述SN中的应用程序单元接收报文获取请求,根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文;通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。本发明实施例提供的对业务路由报文进行处理的方法,可以避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。
The invention discloses a method for processing service routing messages, comprising: a socket unit in a service node SN creates a first socket, and the first socket is used to monitor the first message , the first message includes service routing information and a message to be processed; storing the correspondence between the message to be processed and a second socket, wherein the second socket corresponds to the service routing information ; Receive a message acquisition request from the application program unit in the SN, and determine that the message to be processed is a requested message according to the message acquisition request and the corresponding relationship; by sending the message to the application program unit Sending the message to be processed to the application program unit according to the manner of responding to the message acquisition request. The method for processing the service routing message provided by the embodiment of the present invention can prevent the relevant information of the service routing from being exposed to the application program units in the SN, and improve the security of the service routing.
Description
技术领域technical field
本发明涉及数据处理技术领域,具体涉及一种对业务路由报文进行处理的方法和业务节点。The invention relates to the technical field of data processing, in particular to a method and a service node for processing service routing messages.
背景技术Background technique
业务链(英文为ServiceChaining)技术,是一种引导网络业务报文次序通过多个业务节点(英文为ServiceNode,英文缩写为SN)的转发技术,其中,业务报文在各个节点之间的转发行为称为业务路由。Service Chaining (ServiceChaining in English) technology is a forwarding technology that guides network service packets to pass through multiple service nodes (ServiceNode in English, abbreviated as SN in English). Called business routing.
目前,业务报文在各SN之间进行转发时,需要给原始报文封装上业务路由头中,该业务路由头用于指导业务报文的转发行为,同时,也会在封装信息中携带元数据(英文为metadata),元数据可以是业务路由器(英文为ServiceRouter,英文缩写为SR)产生或SN自身产生,并可以被修改。At present, when a service message is forwarded between SNs, the original message needs to be encapsulated in a service routing header. The service routing header is used to guide the forwarding behavior of the service message. Data (metadata in English), and metadata can be generated by a service router (ServiceRouter in English, abbreviated as SR) or by the SN itself, and can be modified.
对于SN的入口报文标准,大体上可以分为两类,一类是:到达SN的报文是原始报文时,SN可以直接接收、处理并发送。另一类是:到达SN的报文是带有业务路由头信息及元数据的业务路由报文,这时,SN需要在接收到业务路由报文时,能够识别并剥离业务路由头,对原始报文处理完成后,能够为原始报文封装适当的业务路由头,并发送至SR。The ingress message standards of the SN can be roughly divided into two categories, one is: when the message arriving at the SN is an original message, the SN can directly receive, process and send it. The other type is: the message arriving at the SN is a service routing message with service routing header information and metadata. At this time, the SN needs to be able to identify and strip the service routing header when receiving the service routing message. After the packet processing is completed, the original packet can be encapsulated with an appropriate service routing header and sent to the SR.
现有技术方案中,SN中的应用(英文为Application,英文缩写为APP)层直接通过网络驱动层获取业务路由报文,自行剥离业务路由头,识别原始报文并处理,处理完成后,APP层自行为报文封装适当的业务路由头,并通过网络驱动层发出。In the existing technical solution, the application (Application in English, APP for English abbreviation) layer in the SN directly obtains the service routing message through the network driver layer, strips the service routing header by itself, identifies and processes the original message, and after the processing is completed, the APP The layer encapsulates the appropriate service routing header for the packet by itself, and sends it out through the network driver layer.
本发明的发明人发现,现有技术中业务路由的相关信息全部暴露给APP层,存在安全隐患。The inventors of the present invention found that in the prior art, all relevant information of service routing is exposed to the APP layer, which has potential security risks.
发明内容Contents of the invention
本发明实施例提供一种对业务路由报文进行处理的方法,可以由业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。本发明实施例还提供了相应的业务节点。The embodiment of the present invention provides a method for processing the service routing message. The socket unit in the service node SN can process the service routing information on the service routing message, and the application program unit in the SN does not need to know the service routing information. The routing related information is only processed for the business, thereby preventing the business routing related information from being exposed to the application unit in the SN, and improving the security of the business routing. The embodiment of the present invention also provides a corresponding service node.
本发明第一方面提供一种对业务路由报文进行处理的方法,包括:The first aspect of the present invention provides a method for processing service routing packets, including:
业务节点SN中的套接字单元创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文;The socket unit in the service node SN creates a first socket, and the first socket is used to monitor the first message, and the first message is a service routing message belonging to the first service routing type The first message includes service routing information and a message to be processed;
所述套接字单元根据所述第一套接字确定所述SN接收到所述第一报文;The socket unit determines according to the first socket that the SN has received the first message;
所述套接字单元保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;The socket unit saves the corresponding relationship between the message to be processed and a second socket, wherein the second socket corresponds to the service routing information;
所述套接字单元从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;The socket unit receives a message acquisition request from the application program unit in the SN, and the message acquisition request is used to request the pending message corresponding to the second socket;
所述套接字单元根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文;The socket unit determines that the message to be processed is a requested message according to the message acquisition request and the corresponding relationship;
所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。The socket unit sends the message to be processed to the application program unit by sending a response to the message acquisition request to the application program unit.
结合第一方面,在第一种可能的实现方式中,所述方法还包括:With reference to the first aspect, in a first possible implementation manner, the method further includes:
所述套接字单元从所述应用程序单元接收与所述第二套接字对应的已处理报文,所述已处理报文是由所述应用程序单元对所述待处理报文进行处理而得到的;The socket unit receives the processed message corresponding to the second socket from the application program unit, and the processed message is processed by the application program unit on the message to be processed obtained;
所述套接字单元根据与所述已处理报文相对应的所述第二套接字,确定所述业务路由信息;The socket unit determines the service routing information according to the second socket corresponding to the processed message;
向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述业务路由信息。Sending a second packet to the service router SR, where the second packet is a service routing packet including the processed packet, and the service routing information of the second packet includes the service routing information.
结合第一方面或第一方面第一种可能的实现方式,在第二种可能的实现方式中,所述套接字单元保存所述待处理报文和所述第二套接字的对应关系具体包括:With reference to the first aspect or the first possible implementation of the first aspect, in a second possible implementation, the socket unit saves the corresponding relationship between the message to be processed and the second socket Specifically include:
所述套接字单元在接收到所述第一报文时,如果所述套接字单元中未保存所述第二套接字,则创建所述第二套接字,并将所述待处理报文添加至与所述第二套接字对应的报文队列中。When the socket unit receives the first message, if the second socket is not saved in the socket unit, create the second socket, and store the pending The processed message is added to the message queue corresponding to the second socket.
结合第一方面或第一方面第一种可能的实现方式,在第三种可能的实现方式中,所述套接字单元保存所述待处理报文和所述第二套接字的对应关系具体包括:With reference to the first aspect or the first possible implementation of the first aspect, in a third possible implementation, the socket unit stores the corresponding relationship between the message to be processed and the second socket Specifically include:
所述套接字单元在接收到所述第一报文时,如果所述套接字单元中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。When the socket unit receives the first message, if the second socket is stored in the socket unit, add the message to be processed to the second In the message queue corresponding to the socket.
结合第一方面、第一方面第一种至第三种可能的实现方式中的任意一种,在第四种可能的实现方式中,所述套接字单元从所述SN中的应用程序单元接收包括所述第二套接字的报文获取请求之前,所述方法还包括:With reference to the first aspect, any one of the first to the third possible implementations of the first aspect, in a fourth possible implementation, the socket unit receives from the application unit in the SN Before receiving the packet acquisition request including the second socket, the method further includes:
所述套接字单元向所述应用程序单元发送所述第二套接字。The socket unit sends the second socket to the application unit.
结合第一方面、第一方面第一种至第四种可能的实现方式中的任意一种,在第五种可能的实现方式中,所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文,包括:With reference to the first aspect, any one of the first to fourth possible implementations of the first aspect, in a fifth possible implementation, the socket unit sends a target The manner in which the message obtains a response to the request is to send the message to be processed to the application program unit, including:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the storage address of the message to be processed;
所述应用程序单元根据所述存储地址,获取所述待处理报文。The application program unit obtains the message to be processed according to the storage address.
结合第一方面、第一方面第一种至第五种可能的实现方式中的任意一种,在第六种可能的实现方式中,所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文,包括:With reference to the first aspect, any one of the first to the fifth possible implementations of the first aspect, in a sixth possible implementation, the socket unit sends a target The manner in which the message obtains a response to the request is to send the message to be processed to the application program unit, including:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the message to be processed.
本发明第二方面提供一种业务节点,包括:套接字单元和应用程序单元;The second aspect of the present invention provides a service node, including: a socket unit and an application program unit;
所述套接字单元包括:The socket unit includes:
创建子单元,用于创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文;Create a subunit, used to create a first socket, the first socket is used to monitor the first message, the first message is a service routing message belonging to the first service routing type, so The first message includes service routing information and messages to be processed;
确定子单元,用于根据所述创建子单元创建的所述第一套接字确定所述SN接收到所述第一报文;a determining subunit, configured to determine, according to the first socket created by the creating subunit, that the SN has received the first message;
保存子单元,用于保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;A saving subunit, configured to save the correspondence between the message to be processed and a second socket, where the second socket corresponds to the service routing information;
接收子单元,用于从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;a receiving subunit, configured to receive a message acquisition request from an application program unit in the SN, where the message acquisition request is used to request the pending message corresponding to the second socket;
所述确定子单元,还用于根据所述接收子单元接收的所述报文获取请求和所述保存子单元保存的所述对应关系确定所述待处理报文为被请求的报文;The determining subunit is further configured to determine that the message to be processed is a requested message according to the message acquisition request received by the receiving subunit and the correspondence stored by the saving subunit;
发送子单元,用于通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述确定子单元确定的所述待处理报文。The sending subunit is configured to send the message to be processed determined by the determining subunit to the application program unit by sending a response to the message acquisition request to the application program unit.
结合第二方面,在第一种可能的实现方式中,In combination with the second aspect, in the first possible implementation,
所述接收子单元,还用于从所述应用程序单元接收与所述第二套接字对应的已处理报文,所述已处理报文是由所述应用程序单元对所述待处理报文进行处理而得到的;The receiving subunit is further configured to receive a processed message corresponding to the second socket from the application program unit, and the processed message is processed by the application program unit to the message to be processed obtained by processing the text;
所述确定子单元,还用于根据与所述接收子单元接收的所述已处理报文相对应的所述第二套接字,确定所述业务路由信息;The determining subunit is further configured to determine the service routing information according to the second socket corresponding to the processed message received by the receiving subunit;
所述发送子单元,还用于向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述确定子单元确定的所述业务路由信息。The sending subunit is further configured to send a second message to the service router SR, the second message is a service routing message including the processed message, and the service routing information of the second message includes The service routing information determined by the determining subunit.
结合第二方面或第二方面第一种可能的实现方式,在第二种可能的实现方式中,In combination with the second aspect or the first possible implementation of the second aspect, in the second possible implementation,
所述创建子单元,还用于在所述接收子单元接收到所述第一报文时,如果所述保存子单元中未保存所述第二套接字,则创建所述第二套接字;The creating subunit is further configured to create the second socket if the second socket is not saved in the saving subunit when the receiving subunit receives the first message Character;
所述保存子单元,具体用于将所述待处理报文添加至与所述创建子单元创建的所述第二套接字对应的报文队列中。The saving subunit is specifically configured to add the message to be processed to the message queue corresponding to the second socket created by the creating subunit.
结合第二方面或第二方面第一种可能的实现方式,在第三种可能的实现方式中,In combination with the second aspect or the first possible implementation of the second aspect, in the third possible implementation,
所述保存子单元,具体用于在所述接收子单元接收到所述第一报文时,如果所述保存子单元中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。The saving subunit is specifically configured to save the message to be processed if the second socket is saved in the saving subunit when the receiving subunit receives the first message Add to the message queue corresponding to the second socket.
结合第二方面、第二方面第一种至第三种可能的实现方式中的任意一种,在第四种可能的实现方式中,In combination with the second aspect, any one of the first to third possible implementations of the second aspect, in a fourth possible implementation,
所述发送子单元,还用于从所述SN中的应用程序单元接收包括所述第二套接字的报文获取请求之前,向所述应用程序单元发送所述第二套接字。The sending subunit is further configured to send the second socket to the application program unit before receiving the packet acquisition request including the second socket from the application program unit in the SN.
结合第二方面、第二方面第一种至第四种可能的实现方式中的任意一种,在第五种可能的实现方式中,In combination with the second aspect, any one of the first to fourth possible implementations of the second aspect, in a fifth possible implementation,
所述发送子单元,用于向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;The sending subunit is configured to send a response to the message acquisition request to the application program unit, the response carrying the storage address of the message to be processed;
所述应用程序单元,用于根据所述存储地址,获取所述待处理报文。The application unit is configured to obtain the message to be processed according to the storage address.
结合第二方面、第二方面第一种至第五种可能的实现方式中的任意一种,在第六种可能的实现方式中,In combination with the second aspect, any one of the first to fifth possible implementations of the second aspect, in a sixth possible implementation,
所述发送子单元,用于向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。The sending subunit is configured to send a response to the message acquisition request to the application program unit, the response carrying the message to be processed.
本发明实施例业务节点SN中的套接字单元创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文;所述套接字单元根据所述第一套接字确定所述SN接收到所述第一报文;所述套接字单元保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;所述套接字单元从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;所述套接字单元根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文;所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。与现有技术中业务路由的相关信息全部暴露给APP层,存在安全隐患相比,本发明实施例提供的对业务路由报文进行处理的方法,可以由业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。The socket unit in the service node SN in the embodiment of the present invention creates a first socket, and the first socket is used to monitor the first message, and the first message belongs to the first service routing type A service routing message, the first message includes service routing information and a message to be processed; the socket unit determines according to the first socket that the SN has received the first message; The socket unit saves the corresponding relationship between the message to be processed and the second socket, wherein the second socket corresponds to the service routing information; the socket unit obtains from the SN The application program unit receives a message acquisition request, and the message acquisition request is used to request the pending message corresponding to the second socket; the socket unit according to the message acquisition request and The corresponding relationship determines that the message to be processed is a requested message; the socket unit sends a response to the message acquisition request to the application program unit, Send the message to be processed. Compared with the related information of service routing in the prior art, which is all exposed to the APP layer and has security risks, the method for processing service routing messages provided by the embodiment of the present invention can be processed by the socket unit in the service node SN. The service routing message is used to process the service routing information, and the application unit in the SN does not need to know the relevant information of the service route, but only processes the service, thereby avoiding the exposure of the relevant information of the service route to the application program unit in the SN, and improving the Security of service routing.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本发明实施例中对业务路由报文进行处理的方法的一实施例示意图;FIG. 1 is a schematic diagram of an embodiment of a method for processing a service routing message in an embodiment of the present invention;
图2是本发明实施例中对业务路由报文进行处理的方法的一实施例示意图;FIG. 2 is a schematic diagram of an embodiment of a method for processing a service routing message in an embodiment of the present invention;
图3是本发明实施例中对业务路由报文进行处理的方法的一实施例示意图;FIG. 3 is a schematic diagram of an embodiment of a method for processing a service routing message in an embodiment of the present invention;
图4是本发明实施例中业务节点的示意图;Fig. 4 is a schematic diagram of a service node in an embodiment of the present invention;
图5是本发明实施例中业务节点的示意图。Fig. 5 is a schematic diagram of a service node in an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供对业务路由报文进行处理的方法,可以由业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不会获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。本发明实施例还提供了相应的业务节点。以下分别进行详细说明。The embodiment of the present invention provides a method for processing the service routing message, the socket unit in the service node SN can process the service routing information on the service routing message, and the application program unit in the SN will not know about the service routing Relevant information only processes services, thereby avoiding exposure of relevant information of service routing to application program units in the SN, and improving the security of service routing. The embodiment of the present invention also provides a corresponding service node. Each will be described in detail below.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 those skilled in the art without creative efforts fall within the protection scope of the present invention.
参阅图1,本发明实施例提供的对业务路由报文进行处理的方法的一实施例包括:Referring to Fig. 1, an embodiment of a method for processing a service routing message provided by an embodiment of the present invention includes:
本发明实施例提供了一种新的第一套接字(英文为socket)协议族,用于在驱动层协助应用层完成业务路由报文的部分处理,可以将该新的业务路由socket协议族命名为AF_SR,当然,也可以用其他名字命名。The embodiment of the present invention provides a new first socket (socket in English) protocol family, which is used to assist the application layer in the driver layer to complete the partial processing of service routing messages, and the new service routing socket protocol family can be Named AF_SR, of course, can also be named with other names.
业务路由器SR在与业务节点SN间传输业务路由报文时,本发明实施例在SN中引入了一套新的业务路由socket协议栈,该协议栈对APP提供的应用程序接口(英文名称为ApplicationProgrammingInterface,英文缩写为API)集合定义为SRsocketAPI。When the service router SR transmits service routing messages with the service node SN, the embodiment of the present invention introduces a set of new service routing socket protocol stacks in the SN. , the English abbreviation is API) set is defined as SRsocketAPI.
API的处理模块为业务路由器套接字模块(英文为SRsocketModule),以下简称为SRM。The processing module of the API is a service router socket module (SRsocketModule in English), hereinafter referred to as SRM.
如图1所示,业务节点SN包括两部分,一部分为套接字单元,一部分为应用程序单元,套接字单元包括SRsocketAPI和SRM两部分。As shown in Figure 1, the service node SN includes two parts, one part is a socket unit, the other part is an application program unit, and the socket unit includes two parts: SRsocketAPI and SRM.
参阅图2,本发明实施例提供的对业务路由报文进行处理的方法的一实施例包括:Referring to FIG. 2, an embodiment of the method for processing service routing packets provided by the embodiment of the present invention includes:
S100、业务节点SN30中的套接字单元301创建第一套接字。S100. The socket unit 301 in the service node SN30 creates a first socket.
所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文。The first socket is used to monitor the first message, the first message is a service routing message belonging to the first service routing type, and the first message includes service routing information and pending messages arts.
套接字单元301创建第一套接字的具体过程可以包括如下内容。The specific process of creating the first socket by the socket unit 301 may include the following content.
应用程序单元302向套接字单元301发送第一套接字的创建指令,这个步骤结合图1可以理解为是:应用程序单元调用SRsocketAPI中的业务路由socketAPI。The application program unit 302 sends the first socket creation instruction to the socket unit 301. This step can be understood in conjunction with FIG. 1 as: the application program unit invokes the service routing socketAPI in the SRsocketAPI.
套接字单元301根据所述第一套接字的创建指令,创建所述第一套接字。The socket unit 301 creates the first socket according to the first socket creation instruction.
套接字单元301创建第一套接字后,可以开始接收属于第一业务路由类型的第一报文,这个接收第一报文的指令可以由应用程序单元302通过第一套接字的调用指令向所述套接字单元301触发,所述套接字单元301接收到所述第一套接字的调用指令后,就可以获知可以接收第一业务路由类型的第一报文。After the socket unit 301 creates the first socket, it can start to receive the first message belonging to the first service routing type, and the instruction for receiving the first message can be called by the application program unit 302 through the first socket The instruction is triggered to the socket unit 301, and after receiving the invocation instruction of the first socket, the socket unit 301 can know that the first packet of the first service route type can be received.
举例来说,本发明实施例中的业务路由类型可以是:业务路由承载层的传输类型和/或传输方式等。For example, the service routing type in this embodiment of the present invention may be: the transmission type and/or transmission mode of the service routing bearer layer.
通常一个应用程序单元具有对属于一个业务路由类型的业务路由报文中的待处理报文的处理能力,当然,也可以具有属于多种业务路由类型的业务路由报文中的待处理报文的处理能力,一个SN中可以有多个应用程序单元。Usually, an application program unit has the ability to process the packets to be processed in the service routing packets belonging to one service routing type. Of course, it may also have the capability to process the packets to be processed in the service routing packets belonging to multiple service routing types. Processing capacity, there can be multiple application program units in one SN.
套接字单元301创建第一套接字的具体过程还可以包括:不由应用程序单元发起创建过程,而是由套接字单元根据所述第一业务路由类型,主动创建所述第一套接字。例如,套接字单元可以在其所在的SN启动后主动创建所述第一套接字,也可以在到达某个预定时间后主动创建所述第一套接字。The specific process of creating the first socket by the socket unit 301 may also include: instead of initiating the creation process by the application unit, the socket unit actively creates the first socket according to the first service route type Character. For example, the socket unit may actively create the first socket after the SN where it is located is started, or may actively create the first socket after a certain predetermined time is reached.
此外,套接字单元301还可以根据网络中控制器的指令来创建所述第一套接字。In addition, the socket unit 301 may also create the first socket according to an instruction of a controller in the network.
对所述第一套接字的创建过程可以包括创建一个套接字的操作,还可以继续包括对所述已创建的套接字进行配置的操作。The process of creating the first socket may include the operation of creating a socket, and may further include the operation of configuring the created socket.
S102、业务路由器SR40向业务节点30发送所述第一报文。S102. The service router SR40 sends the first packet to the service node 30.
S105、所述套接字单元301根据所述第一套接字确定所述SN30接收到所述第一报文。S105. The socket unit 301 determines according to the first socket that the SN30 has received the first packet.
第一套接字对应第一业务路由类型,所述第一报文为属于第一业务路由类型的业务路由报文,当套接字单元301接收到的报文的业务路由类型为第一业务路由类型时,则可以确定该报文为第一报文。The first socket corresponds to the first service routing type, and the first message is a service routing message belonging to the first service routing type. When the service routing type of the message received by the socket unit 301 is the first service If the routing type is not specified, then it can be determined that the packet is the first packet.
可选地,套接字单元301在获知第一业务路由类型后,才开始从SR接收该第一业务路由类型的第一报文。Optionally, the socket unit 301 starts to receive the first packet of the first service route type from the SR after learning the first service route type.
这个步骤参阅图1可以理解为是:SRM按照第一业务路由类型从SR接收第一报文。Referring to FIG. 1, this step can be understood as: the SRM receives the first message from the SR according to the first service route type.
S110、所述套接字单元在接收到所述第一报文时,判断所述套接字单元中是否保存有第二套接字。如果否则执行步骤S115,如果是则执行步骤S120。S110. When receiving the first message, the socket unit determines whether the second socket is stored in the socket unit. If not, execute step S115, and if yes, execute step S120.
本发明实施例中的第二套接字附属于第一套接字,第一套接字对应第一业务路由类型,第二套接字对应该属于第一业务路由类型的一个会话。可以有多个会话均属于所述第一业务路由类型。In the embodiment of the present invention, the second socket is attached to the first socket, the first socket corresponds to the first service routing type, and the second socket corresponds to a session that should belong to the first service routing type. There may be multiple sessions all belonging to the first service routing type.
本发明实施例中,套接字单元在接收到所述第一报文后,可以对该第一报文进行解析并将该第一报文中的业务路由信息和待处理报文分离,也可以不执行分离的过程。In the embodiment of the present invention, after receiving the first message, the socket unit may analyze the first message and separate the service routing information in the first message from the message to be processed, or The process of separating may not be performed.
业务路由信息携带在第一报文的业务路由头中,待处理报文可以包括没有任何路由信息的原始报文,也可以包括没有任何路由信息的原始报文和元数据。The service routing information is carried in the service routing header of the first message, and the message to be processed may include an original message without any routing information, or may include an original message and metadata without any routing information.
这个步骤参阅图1可以理解为是SRM所执行的过程。Referring to FIG. 1, this step can be understood as a process performed by the SRM.
S115、如果所述套接字单元中未保存所述第二套接字,则创建所述第二套接字,并将所述待处理报文添加至与所述第二套接字对应的报文队列中。S115. If the second socket is not stored in the socket unit, create the second socket, and add the message to be processed to the corresponding in the message queue.
业务路由信息与第二套接字的对应关系是唯一的,每个业务路由信息都会唯一对应一个第二套接字。一个业务路由信息可以对应多个待处理报文,可以针对一个第二套接字建立一个待处理报文的队列,将同一个业务路由信息下的所述待处理报文都存储到该队列中。The corresponding relationship between service routing information and the second socket is unique, and each service routing information will uniquely correspond to a second socket. A service routing information can correspond to multiple pending messages, and a queue of pending messages can be established for a second socket, and all pending messages under the same service routing information are stored in the queue .
可以参阅表1所提供的业务路由映射表来理解第二套接字、业务路由类型、业务路由信息和待处理报文队列的对应关系。You can refer to the service route mapping table provided in Table 1 to understand the corresponding relationship between the second socket, service route type, service route information and message queue to be processed.
表1:业务路由映射表Table 1: Service routing mapping table
从表1中可以看出,每个第二套接字都对应一个业务路由信息,该业务路由信息要属于S100中的第一业务路由类型。每个第二套接字标识还对应着该业务路由信息下的所有待处理报文的队列。It can be seen from Table 1 that each second socket corresponds to a piece of service routing information, and the service routing information must belong to the first service routing type in S100. Each second socket identifier also corresponds to a queue of all pending packets under the service routing information.
当套接字单元确定到第一报文中的业务路由信息在套接字单元中不存在时,也就可以理解为在表1中不存在该业务路由信息的表项,这时就需要在表1中建立该业务路由信息对应的表项。When the socket unit determines that the service routing information in the first message does not exist in the socket unit, it can be understood that there is no entry for the service routing information in Table 1. Table 1 establishes an entry corresponding to the service routing information.
这个步骤参阅图1可以理解为是SRM所执行的过程。Referring to FIG. 1, this step can be understood as a process performed by the SRM.
表1还可以包含业务路由类型,加入业务路由类型后可以参阅表2进行理解。Table 1 may also include service routing types, and after adding service routing types, you can refer to Table 2 for understanding.
表2:业务路由映射表Table 2: Business routing mapping table
S120、所述套接字单元在接收到所述第一报文时,如果所述套接字单元中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。S120. When the socket unit receives the first message, if the second socket is stored in the socket unit, add the message to be processed to the In the message queue corresponding to the second socket.
所述业务路由信息在套接字单元中存在时,就可以理解为在表1中已经存在了该业务路由信息的表项,不需要再重新建立,只需要将该待处理报文存储到该业务路由信息对应的待处理报文队列中。例如:当表1中保存有第二套接字1和报文队列Q1的对应关系,则可以将所述待处理报文添加到Q1队列中。When the service routing information exists in the socket unit, it can be understood that the table entry of the service routing information already exists in Table 1, and it does not need to be re-established, only the message to be processed needs to be stored in the In the queue of pending packets corresponding to the service routing information. For example: when the corresponding relationship between the second socket 1 and the message queue Q1 is stored in Table 1, the pending message may be added to the Q1 queue.
这个步骤参阅图1可以理解为是SRM所执行的过程。Referring to FIG. 1, this step can be understood as a process performed by the SRM.
S125、所述套接字单元301向所述应用程序单元302发送所述第二套接字。S125. The socket unit 301 sends the second socket to the application program unit 302.
本步骤可以是:套接字单元301接收所述应用程序单元302发送的第二套接字获取指令,然后套接字单元301根据所述第二套接字获取指令,向所述应用程序单元302发送所述第二套接字。This step may be: the socket unit 301 receives the second socket acquisition instruction sent by the application program unit 302, and then the socket unit 301 sends the instruction to the application program unit according to the second socket acquisition instruction. 302 Send the second socket.
例如:应用程序单元302需要处理待处理报文时,先向套接字单元发送第二套接字获取指令。For example: when the application program unit 302 needs to process a message to be processed, it first sends a second socket acquisition instruction to the socket unit.
这个步骤结合图1可以理解为是:应用程序单元调用SRsocketAPI中的第二套接字创建接口。This step can be understood in conjunction with FIG. 1 as: the application program unit calls the second socket creation interface in SRsocketAPI.
套接字单元301接收到该第二套接字获取指令后,通常会按照第二套接字生成的顺序向应用程序单元302发送第二套接字标识。After receiving the second socket acquisition instruction, the socket unit 301 usually sends the second socket identification to the application program unit 302 in the order in which the second sockets are generated.
当然也可以是其他的预置策略,例如:先发送第二套接字是奇数的,再发送第二套接字是偶数的。Of course, other preset strategies are also possible, for example: first send the second socket with an odd number, and then send the second socket with an even number.
这个步骤参阅图1可以理解为是SRM所执行的过程。Referring to FIG. 1, this step can be understood as a process performed by the SRM.
所述套接字单元向所述应用程序单元发送所述第二套接字还可以包括:套接字单元301在生成第二套接字后,在没有收到所述第二套接字获取指令的情况下,主动向所述应用程序单元302发送所述第二套接字。The socket unit sending the second socket to the application unit may further include: after the socket unit 301 generates the second socket, if the second socket acquisition is not received In the case of an instruction, actively send the second socket to the application unit 302.
S130、所述套接字单元301从所述SN中的应用程序单元302接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文。S130. The socket unit 301 receives a message acquisition request from the application program unit 302 in the SN, and the message acquisition request is used to request the pending message corresponding to the second socket .
本发明实施例中的所述报文获取请求可以直接携带所述报文获取请求,也可以不携带所述第二套接字,而是由套接字单元301从对应该第二套接字的专用接口接收所述报文获取请求。通过上述两种方式,套接字单元301都可以确定该请求与第二套接字的关系,即用于请求与所述第二套接字对应的所述待处理报文。The message acquisition request in the embodiment of the present invention may directly carry the message acquisition request, or may not carry the second socket, but the socket unit 301 obtains the request from the corresponding second socket The dedicated interface of the device receives the packet acquisition request. Through the above two methods, the socket unit 301 can determine the relationship between the request and the second socket, that is, to request the pending message corresponding to the second socket.
S135、所述套接字单元301根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文。S135. The socket unit 301 determines, according to the packet acquisition request and the correspondence relationship, that the packet to be processed is a requested packet.
所述套接字单元先根据所述报文获取请求确定所述第二套接字,然后再根据所述第二套接字,以及所述第二套接字和所述待处理报文的所述对应关系就可以确定第二套接字对应的待处理报文。由于所述待处理报文是保存在报文队列中的,因此所述第二套接字和所述待处理报文的所述对应关系也可以表现为所述第二套接字与所述报文队列标识的对应关系。相应地,就可以根据所述第二套接字和所述第二套接字与所述报文队列标识的对应关系来确定所述待处理报文。例如:根据第二套接字1就可以确定报文队列为Q1中的待处理报文为被请求报文。The socket unit first determines the second socket according to the message acquisition request, and then determines the second socket according to the second socket, the second socket and the message to be processed The corresponding relationship can determine the message to be processed corresponding to the second socket. Since the message to be processed is stored in the message queue, the corresponding relationship between the second socket and the message to be processed may also be expressed as the relationship between the second socket and the Correspondence between message queue IDs. Correspondingly, the message to be processed may be determined according to the second socket and the corresponding relationship between the second socket and the message queue identifier. For example, according to the second socket 1, it can be determined that the pending packets in the packet queue Q1 are requested packets.
S140、所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。S140. The socket unit sends the message to be processed to the application program unit by sending a response to the message acquisition request to the application program unit.
步骤S140的一种方案可以是:A scheme of step S140 may be:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;所述应用程序单元根据所述存储地址,获取所述待处理报文。这样,套接字单元和应用程序单元就不需要直接传输待处理数据,可以提高针对所述请求的响应速度。The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the storage address of the message to be processed; the application program unit obtains the message according to the storage address The pending message. In this way, the socket unit and the application program unit do not need to directly transmit the data to be processed, and the response speed for the request can be improved.
步骤S140的另一种方案可以是:Another scheme of step S140 may be:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。该种方案中,套接字单元可以在针对所述请求的响应中直接携带所述待处理报文,就不需要应用程序单元再去查找该待处理报文。The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the message to be processed. In this solution, the socket unit may directly carry the message to be processed in the response to the request, and the application program unit does not need to search for the message to be processed.
因为一个报文队列中可以有很多个待处理报文,所以在发送针对所述报文获取请求的响应时,可以是按照待处理报文存入报文队列的先后顺序,优先发送先进入队列的待处理报文的响应,直到该队列待处理报文发送完毕。Because there can be many pending packets in a packet queue, when sending the response to the packet acquisition request, it can be sent according to the order in which the packets to be processed are stored in the packet queue, and the queue is sent first. The response to the pending packets until the queue of pending packets is sent.
这个步骤参阅图1可以理解为是SRM所执行的过程。Referring to FIG. 1, this step can be understood as a process performed by the SRM.
S145、应用程序单元302将所述待处理报文处理成已处理报文。S145. The application program unit 302 processes the message to be processed into a processed message.
应用程序单元获取到待处理报文后,将该待处理报文处理成已处理报文。After the application program unit obtains the message to be processed, it processes the message to be processed into a processed message.
S150、所述套接字单元301从所述应用程序单元302接收与所述第二套接字对应的已处理报文。S150. The socket unit 301 receives from the application program unit 302 a processed message corresponding to the second socket.
所述已处理报文是由所述应用程序单元302对所述待处理报文进行处理而得到的。The processed message is obtained by the application program unit 302 processing the message to be processed.
所述套接字单元301从所述应用程序单元302接收与所述第二套接字对应的已处理报文的一种方案可以是:A solution for the socket unit 301 to receive the processed message corresponding to the second socket from the application program unit 302 may be:
套接字单元301从所述应用程序单元302接收包括所述已处理报文的存储地址以及第二套接字的报文或消息,还可以是接收包括已处理报文本身和第二套接字的报文或消息。由于所述已处理报文和所述第二套接字均被套接字单元301获得,因此套接字单元301可以确定所述已处理报文和所述第二套接字是相对应的。The socket unit 301 receives a message or message including the storage address of the processed message and the second socket from the application unit 302, and may also receive a message including the processed message itself and the second socket words or messages. Since both the processed message and the second socket are obtained by the socket unit 301, the socket unit 301 can determine that the processed message and the second socket are corresponding .
所述套接字单元301从所述应用程序单元302接收与所述第二套接字对应的已处理报文的另一种方案还可以是:套接字单元301从所述应用程序单元302之间的第二套接字专用接口接收所述已处理报文的存储地址或者已处理报文,并根据所述第二套接字的专用接口确定所述已处理报文是与所述第二套接子相对应的。Another solution for the socket unit 301 to receive the processed message corresponding to the second socket from the application program unit 302 may also be: the socket unit 301 receives from the application program unit 302 The second socket dedicated interface between receives the storage address of the processed message or the processed message, and determines whether the processed message is related to the first socket according to the dedicated interface of the second socket The two sockets correspond to each other.
S155、所述套接字单元301根据与所述已处理报文相对应的所述第二套接字,确定所述业务路由信息。S155. The socket unit 301 determines the service routing information according to the second socket corresponding to the processed packet.
如表1所示,当第二套接字确定后,就可以确定对应的业务路由信息,如第二套接字为1时,则可以确定对应的业务路由信息为业务路由信息1。As shown in Table 1, when the second socket is determined, the corresponding service routing information can be determined. For example, when the second socket is 1, the corresponding service routing information can be determined as service routing information 1.
S160、套接字单元向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述业务路由信息。S160. The socket unit sends a second message to the service router SR, where the second message is a service routing message including the processed message, and the service routing information of the second message includes the service routing information.
套接字单元301可以使用步骤S155中确定的所述业务路由信息对已处理报文进行封装,也可以不进行封装,直接将所述已处理报文和所述业务路由信息发送给SR,但需要对所述已处理报文和所述业务路由信息分别进行标识,以使SR40能够分别识别出所述已处理报文和所述业务路由信息。The socket unit 301 may use the service routing information determined in step S155 to encapsulate the processed message, or directly send the processed message and the service routing information to the SR without encapsulation, but The processed packets and the service routing information need to be identified separately, so that the SR40 can separately identify the processed packets and the service routing information.
需要说明的是,步骤S130至S140,与步骤S150至S160没有先后顺序,针对不同的业务路由报文可以步骤S130至S140与步骤S150至S160同时执行,也可以步骤S150至S160先执行。It should be noted that steps S130 to S140 are not in sequence with steps S150 to S160. For different service routing packets, steps S130 to S140 and steps S150 to S160 can be executed at the same time, or steps S150 to S160 can be executed first.
S170、套接字单元301接收所述应用程序单元302发送的第二套接字关闭指令。S170. The socket unit 301 receives the second socket closing instruction sent by the application program unit 302.
所述第二套接字关闭指令中可以携带第二套接字,也可以通过第二套接字的专用接口接收所述第二套接字关闭指令。The second socket closing instruction may carry the second socket, or the second socket closing instruction may be received through a dedicated interface of the second socket.
S175、套接字单元301根据所述第二套接字关闭指令,删除所述第一业务路由类型下的第二套接字、业务路由信息与报文队列的对应关系。S175. The socket unit 301 deletes the correspondence between the second socket under the first service routing type, the service routing information, and the message queue according to the second socket closing instruction.
一个会话结束后,如果应用程序单元指示关闭本次会话,则可以删除表1或表2中与本次会话有关的表项。After a session ends, if the application unit instructs to close the session, the entry in Table 1 or Table 2 related to the session may be deleted.
S180、套接字单元301接收所述应用程序单元302发送的第一套接字关闭指令。S180. The socket unit 301 receives the first socket closing instruction sent by the application program unit 302.
所述第一套接字关闭指令中可以携带所述第一业务路由类型,也可以不携带该第一业务路由类型,而是通过第一套接字的专用接口接收该第二套接字关闭指令。The first socket close instruction may carry the first service route type, or may not carry the first service route type, but the second socket close instruction is received through the dedicated interface of the first socket instruction.
S185、根据所述第一套接字关闭指令,删除与所述第一业务路由类型下的第二套接字、业务路由信息与报文队列的对应关系。S185. According to the first socket closing instruction, delete the corresponding relationship with the second socket under the first service routing type, service routing information, and message queue.
如果应用程序单元指示关闭已经创建的业务路由socket,则删除表1或表2中与该第一业务路由类型有关的表项。If the application unit instructs to close the created service routing socket, delete the entry in Table 1 or Table 2 related to the first service routing type.
本实施例中的业务节点SN30和业务路由器SR可以是相互独立的两台物理设备,也可以是在同一个物理设备或物理系统中实现的两个虚拟设备。此外,随着技术的发展,业务节点和业务路由器的名称可能会发生变化。因此,只要当一个物理的或者虚拟的设备执行了本实施例中的业务节点SN30执行的操作,那么即使这个物理的或者虚拟的设备的名称并不是“业务节点”,它也应当被理解为是本发明实施例中的业务节点SN30。业务路由器的确定标准和业务节点30的标准相同,即只要一台设备执行了本实施例中业务路由器SR40所执行的操作,那么这台设备就应当被理解为业务路由器。一台目标设备是否能被理解为本实施例中的设备,与目标设备在行业中的名称无关,与目标设备执行的操作和具备的功能相关。The service node SN30 and the service router SR in this embodiment may be two independent physical devices, or two virtual devices implemented in the same physical device or physical system. In addition, with the development of technology, the names of service nodes and service routers may change. Therefore, as long as a physical or virtual device executes the operation performed by the service node SN30 in this embodiment, even if the name of the physical or virtual device is not "service node", it should be understood as The service node SN30 in the embodiment of the present invention. The determination standard of the service router is the same as that of the service node 30, that is, as long as a device executes the operations performed by the service router SR40 in this embodiment, then this device should be understood as a service router. Whether a target device can be understood as the device in this embodiment has nothing to do with the name of the target device in the industry, but is related to the operations performed and functions possessed by the target device.
与现有技术中业务路由的相关信息全部暴露给APP层,存在安全隐患相比,本发明实施例提供的对业务路由报文进行处理的方法,可以由业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。Compared with the related information of service routing in the prior art, which is all exposed to the APP layer and has security risks, the method for processing service routing messages provided by the embodiment of the present invention can be processed by the socket unit in the service node SN. The service routing message is used to process the service routing information, and the application unit in the SN does not need to know the relevant information of the service route, but only processes the service, thereby avoiding the exposure of the relevant information of the service route to the application program unit in the SN, and improving the Security of service routing.
参阅图3,本发明实施例提供的一种对业务路由报文进行处理的方法的另一实施例包括:Referring to FIG. 3, another embodiment of a method for processing service routing packets provided by an embodiment of the present invention includes:
201、业务节点SN中的套接字单元创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文。201. The socket unit in the service node SN creates a first socket, the first socket is used to monitor the first message, and the first message is a service belonging to the first service routing type Routing packets, the first packet includes service routing information and packets to be processed.
202、所述套接字单元根据所述第一套接字确定所述SN接收到所述第一报文。202. The socket unit determines according to the first socket that the SN has received the first packet.
203、所述套接字单元保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应。203. The socket unit stores the correspondence between the packet to be processed and a second socket, where the second socket corresponds to the service routing information.
204、所述套接字单元从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文。204. The socket unit receives a packet acquisition request from the application program unit in the SN, where the packet acquisition request is used to request the pending packet corresponding to the second socket.
205、所述套接字单元根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文。205. The socket unit determines, according to the packet acquisition request and the correspondence relationship, that the packet to be processed is a requested packet.
206、所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。206. The socket unit sends the message to be processed to the application program unit by sending a response to the message acquisition request to the application program unit.
本发明实施例业务节点SN中的套接字单元创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文;所述套接字单元根据所述第一套接字确定所述SN接收到所述第一报文;所述套接字单元保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;所述套接字单元从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;所述套接字单元根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文;所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。与现有技术中业务路由的相关信息全部暴露给APP层,存在安全隐患相比,本发明实施例提供的对业务路由报文进行处理的方法,可以由业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。The socket unit in the service node SN in the embodiment of the present invention creates a first socket, and the first socket is used to monitor the first message, and the first message belongs to the first service routing type A service routing message, the first message includes service routing information and a message to be processed; the socket unit determines according to the first socket that the SN has received the first message; The socket unit saves the corresponding relationship between the message to be processed and the second socket, wherein the second socket corresponds to the service routing information; the socket unit obtains from the SN The application program unit receives a message acquisition request, and the message acquisition request is used to request the pending message corresponding to the second socket; the socket unit according to the message acquisition request and The corresponding relationship determines that the message to be processed is a requested message; the socket unit sends a response to the message acquisition request to the application program unit, Send the message to be processed. Compared with the related information of service routing in the prior art, which is all exposed to the APP layer and has security risks, the method for processing service routing messages provided by the embodiment of the present invention can be processed by the socket unit in the service node SN. The service routing message is used to process the service routing information, and the application unit in the SN does not need to know the relevant information of the service route, but only processes the service, thereby avoiding the exposure of the relevant information of the service route to the application program unit in the SN, and improving the Security of service routing.
可选地,在上述图3对应的实施例的基础上,本发明实施例提供的对业务路由报文进行处理的方法的另一实施例中,所述方法还可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 , in another embodiment of the method for processing service routing packets provided by the embodiment of the present invention, the method may further include:
所述套接字单元从所述应用程序单元接收与所述第二套接字对应的已处理报文,所述已处理报文是由所述应用程序单元对所述待处理报文进行处理而得到的;The socket unit receives the processed message corresponding to the second socket from the application program unit, and the processed message is processed by the application program unit on the message to be processed obtained;
所述套接字单元根据与所述已处理报文相对应的所述第二套接字,确定所述业务路由信息;The socket unit determines the service routing information according to the second socket corresponding to the processed message;
向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述业务路由信息。Sending a second packet to the service router SR, where the second packet is a service routing packet including the processed packet, and the service routing information of the second packet includes the service routing information.
可选地,在上述图3对应的实施例或可选实施例的基础上,本发明实施例提供的报文处理的方法的另一实施例中,所述套接字单元保存所述待处理报文和所述第二套接字的对应关系具体可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 or an optional embodiment, in another embodiment of the method for processing packets provided by the embodiment of the present invention, the socket unit saves the pending The correspondence between the message and the second socket may specifically include:
所述套接字单元在接收到所述第一报文时,如果所述套接字单元中未保存所述第二套接字,则创建所述第二套接字,并将所述待处理报文添加至与所述第二套接字对应的报文队列中。When the socket unit receives the first message, if the second socket is not saved in the socket unit, create the second socket, and store the pending The processed message is added to the message queue corresponding to the second socket.
可选地,在上述图3对应的实施例或可选实施例的基础上,本发明实施例提供的报文处理的方法的另一实施例中,所述套接字单元保存所述待处理报文和所述第二套接字的对应关系具体可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 or an optional embodiment, in another embodiment of the method for processing packets provided by the embodiment of the present invention, the socket unit saves the pending The correspondence between the message and the second socket may specifically include:
所述套接字单元在接收到所述第一报文时,如果所述套接字单元中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。When the socket unit receives the first message, if the second socket is stored in the socket unit, add the message to be processed to the second In the message queue corresponding to the socket.
可选地,在上述图3对应的实施例或可选实施例的基础上,本发明实施例提供的报文处理的方法的另一实施例中,所述套接字单元从所述SN中的应用程序单元接收包括所述第二套接字的报文获取请求之前,所述方法还可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 or an optional embodiment, in another embodiment of the method for processing packets provided by the embodiment of the present invention, the socket unit obtains from the SN Before the application program unit receives the packet acquisition request including the second socket, the method may further include:
所述套接字单元向所述应用程序单元发送所述第二套接字。The socket unit sends the second socket to the application unit.
可选地,在上述图3对应的实施例或可选实施例的基础上,本发明实施例提供的报文处理的方法的另一实施例中,所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文,可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 or an optional embodiment, in another embodiment of the method for processing packets provided by the embodiment of the present invention, the socket unit sends the application The manner in which the program unit sends a response to the message acquisition request, sending the message to be processed to the application program unit may include:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the storage address of the message to be processed;
所述应用程序单元根据所述存储地址,获取所述待处理报文。The application program unit obtains the message to be processed according to the storage address.
可选地,在上述图3对应的实施例或可选实施例的基础上,本发明实施例提供的报文处理的方法的另一实施例中,所述套接字单元通过向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文,可以包括:Optionally, on the basis of the above-mentioned embodiment corresponding to FIG. 3 or an optional embodiment, in another embodiment of the method for processing packets provided by the embodiment of the present invention, the socket unit sends the application The manner in which the program unit sends a response to the message acquisition request, sending the message to be processed to the application program unit may include:
所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。The socket unit sends a response to the message acquisition request to the application program unit, and the response carries the message to be processed.
本发明实施例所描述的对业务路由报文进行处理的方法,可以参阅图1和图2部分的描述进行理解,本发明实施例中不做过多赘述。The method for processing service routing packets described in the embodiments of the present invention can be understood by referring to the descriptions in FIG. 1 and FIG. 2 , and will not be described in detail in the embodiments of the present invention.
图4所示为本发明实施例提供的业务节点SN30的示意图。图4所示的业务节点SN30即为图1和图2所示的业务节点SN30,也可以为与图3对应的实施例中的业务节点。该示意图中的各个单元和子单元可以被理解为是根据逻辑功能的不同来划分的逻辑单元。业务节点SN30包括套接字单元301和应用程序单元302。FIG. 4 is a schematic diagram of the service node SN30 provided by the embodiment of the present invention. The service node SN30 shown in FIG. 4 is the service node SN30 shown in FIGS. 1 and 2 , and may also be the service node in the embodiment corresponding to FIG. 3 . Each unit and subunit in the schematic diagram can be understood as a logical unit divided according to different logical functions. The service node SN30 includes a socket unit 301 and an application program unit 302 .
所述套接字单元301包括:The socket unit 301 includes:
创建子单元3011,用于创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文,所述第一报文可以是由业务路由器SR40发送至业务节点SN30的,业务节点SN30和业务路由器SN40属于同一个系统;Create subunit 3011, configured to create a first socket, the first socket is used to monitor the first message, the first message is a service routing message belonging to the first service routing type, The first message includes service routing information and a message to be processed, and the first message may be sent to the service node SN30 by the service router SR40, and the service node SN30 and the service router SN40 belong to the same system;
确定子单元3012,用于根据所述创建子单元3011创建的所述第一套接字确定所述SN接收到所述第一报文;A determining subunit 3012, configured to determine according to the first socket created by the creating subunit 3011 that the SN has received the first message;
保存子单元3013,用于保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;The saving subunit 3013 is configured to save the corresponding relationship between the message to be processed and the second socket, where the second socket corresponds to the service routing information;
接收子单元3014,用于从所述SN中的应用程序单元302接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;The receiving subunit 3014 is configured to receive a message acquisition request from the application program unit 302 in the SN, where the message acquisition request is used to request the pending message corresponding to the second socket;
所述确定子单元3012,还用于根据所述接收子单元3014接收的所述报文获取请求和所述保存子单元保存的所述对应关系确定所述待处理报文为被请求的报文;The determining subunit 3012 is further configured to determine that the message to be processed is a requested message according to the message acquisition request received by the receiving subunit 3014 and the corresponding relationship stored by the saving subunit ;
发送子单元3015,用于通过向所述应用程序单元302发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述确定子单元确定的所述待处理报文。The sending subunit 3015 is configured to send the message to be processed determined by the determining subunit to the application program unit by sending a response to the message acquisition request to the application program unit 302 .
以上内容可以被理解为图4所示的SN30的第一部分内容。The above content can be understood as the first part of the content of SN30 shown in FIG. 4 .
根据上述内容可知,与现有技术中业务路由的相关信息全部暴露给APP层,存在安全隐患相比,本发明实施例提供业务节点SN可以由套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。According to the above content, it can be seen that, compared with the related information of service routing in the prior art, which is all exposed to the APP layer and has potential safety hazards, the embodiment of the present invention provides that the service node SN can use the socket unit to perform service routing information on service routing messages. The application unit in the SN does not need to know the relevant information of the service routing, but only processes the service, thereby avoiding the exposure of the relevant information of the service route to the application unit in the SN, and improving the security of the service routing.
本实施例可以进一步包括第一可选方案,所述第一可选方案包括所述SN30的第一部分内容。此外,在第一可选方案中,所述接收子单元3014还用于从所述应用程序单元302接收与所述第二套接字对应的已处理报文,所述已处理报文是由所述应用程序单元对所述待处理报文进行处理而得到的;所述确定子单元3012还用于根据与所述接收子单元3014接收的所述已处理报文相对应的所述第二套接字,确定所述业务路由信息;所述发送子单元3015还用于向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述确定子单元3012确定的所述业务路由信息。This embodiment may further include a first option, where the first option includes the first part of the content of the SN30. In addition, in the first optional solution, the receiving subunit 3014 is further configured to receive from the application program unit 302 a processed packet corresponding to the second socket, the processed packet is generated by obtained by the application program unit processing the message to be processed; the determining subunit 3012 is further configured to, according to the second a socket to determine the service routing information; the sending subunit 3015 is also configured to send a second message to the service router SR, where the second message is a service routing message including the processed message, The service routing information of the second packet includes the service routing information determined by the determining subunit 3012.
本实施例可以进一步包括第二可选方案,所述第二可选方案包括所述SN30的第一部分内容或所述第一可选方案。此外,在第二可选方案中,所述创建子单元3011还用于在所述接收子单元3014接收到所述第一报文时,如果所述保存子单元3013中未保存所述第二套接字,则创建所述第二套接字;所述保存子单元3013具体用于将所述待处理报文添加至与所述创建子单元3011创建的所述第二套接字对应的报文队列中。This embodiment may further include a second option, where the second option includes the first part of the content of the SN30 or the first option. In addition, in the second optional solution, the creating subunit 3011 is further configured to, when the receiving subunit 3014 receives the first message, if the saving subunit 3013 does not save the second socket, create the second socket; the saving subunit 3013 is specifically configured to add the message to be processed to the second socket corresponding to the creation subunit 3011 in the message queue.
本实施例可以进一步包括第三可选方案,所述第三可选方案包括所述SN30的第一部分内容、所述第一可选方案或所述第二可选方案。此外,在第三可选方案中,所述保存子单元3013,具体用于在所述接收子单元3014接收到所述第一报文时,如果所述保存子单元3013中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。This embodiment may further include a third option, where the third option includes the first part of the content of the SN30, the first option or the second option. In addition, in the third optional solution, the storing subunit 3013 is specifically configured to, when the receiving subunit 3014 receives the first message, if the storing subunit 3013 stores the second socket, add the message to be processed to the message queue corresponding to the second socket.
本实施例可以进一步包括第四可选方案,所述第四可选方案包括所述SN30的第一部分内容、所述第一可选方案、所述第二可选方案或所述第三可选方案。此外,在第四可选方案中,所述发送子单元3015还用于从所述SN中的应用程序单元302接收包括所述第二套接字的报文获取请求之前,向所述应用程序单元发送所述第二套接字。This embodiment may further include a fourth option, the fourth option includes the first part of the content of the SN30, the first option, the second option or the third option Program. In addition, in the fourth optional solution, the sending subunit 3015 is further configured to send the application program The unit sends the second socket.
本实施例可以进一步包括第五可选方案,所述第五可选方案包括所述SN30的第一部分内容、所述第一可选方案、所述第二可选方案、所述第三可选方案或所述第四可选方案。此外,在第五可选方案中,所述发送子单元3015用于向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;所述应用程序单元302,用于根据所述存储地址,获取所述待处理报文。This embodiment may further include a fifth option, the fifth option includes the first part of the content of the SN30, the first option, the second option, and the third option scheme or the fourth alternative. In addition, in a fifth optional solution, the sending subunit 3015 is configured to send a response to the message acquisition request to the application program unit, where the response carries the storage address of the message to be processed; The application program unit 302 is configured to obtain the message to be processed according to the storage address.
基于上述SN30的第一部分内容或任意一种可选方案,所述发送子单元3015用于向所述应用程序单元302发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。Based on the content of the first part of the above SN30 or any optional solution, the sending subunit 3015 is configured to send a response to the message acquisition request to the application program unit 302, and the response carries the to-be-processed message.
本发明实施例所描述的业务节点,可以参阅图1和图2部分的描述进行理解,本发明实施例中不做过多赘述。The service nodes described in the embodiments of the present invention can be understood by referring to the descriptions in FIG. 1 and FIG. 2 , and will not be described in detail in the embodiments of the present invention.
需要说明的是,图4所示的业务节点30能够实现图1、图2所示的业务节点30以及与图3对应的实施例中的业务节点的全部操作和功能。由于图4是从逻辑功能的角度来体现一个业务节点的,因此所述全部操作和功能可以图4所示的各个单元和子单元共同实现。至于所述全部操作和功能具体由哪个单元和子单元分别实现,这仅是逻辑上的划分,即把业务节点30在与图1、图2或图3中执行到操作划分或补充到一个逻辑单元中,其划分方法非常灵活。在任何一种划分方式都应当被视为是本实施例的一部分。It should be noted that the service node 30 shown in FIG. 4 can realize all operations and functions of the service node 30 shown in FIG. 1 and FIG. 2 and the service node in the embodiment corresponding to FIG. 3 . Since FIG. 4 shows a service node from the perspective of logical functions, all the operations and functions described above can be jointly implemented by the units and subunits shown in FIG. 4 . As for which unit and sub-unit are specifically implemented by the above-mentioned all operations and functions, this is only a logical division, that is, to divide or supplement the operation of the service node 30 in FIG. 1, FIG. 2 or FIG. 3 into a logical unit Among them, the division method is very flexible. Any division method should be regarded as a part of this embodiment.
图5是业务节点30的结构示意图。业务节点30可包括输入设备310、输出设备320、处理器330和存储器340。图5所示的业务节点30和图4所示的业务节点30可以是相同的业务节点,但是图4是从逻辑功能的角度来体现这个业务节点,而图5是从物理实现的角度来体现这个业务节点。FIG. 5 is a schematic structural diagram of a service node 30 . The service node 30 may include an input device 310 , an output device 320 , a processor 330 and a memory 340 . The service node 30 shown in FIG. 5 and the service node 30 shown in FIG. 4 may be the same service node, but FIG. 4 embodies this service node from the perspective of logical functions, while FIG. 5 embodies it from the perspective of physical implementation This business node.
存储器340可以包括只读存储器和/或随机存取存储器,并向处理器330提供指令和数据。存储器340的一部分还可以包括非易失性随机存取存储器(NVRAM)。Memory 340 may include read-only memory and/or random-access memory, and provides instructions and data to processor 330 . A portion of memory 340 may also include non-volatile random access memory (NVRAM).
存储器340存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:The memory 340 stores the following elements, executable modules or data structures, or their subsets, or their extended sets:
操作指令:包括各种操作指令,用于实现各种操作。Operation instructions: include various operation instructions for realizing various operations.
操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。Operating system: includes various system programs for implementing various basic services and processing hardware-based tasks.
在本发明实施例中,处理器330通过调用存储器340存储的操作指令(该操作指令可存储在操作系统中),执行如下操作:In the embodiment of the present invention, the processor 330 executes the following operations by calling the operation instruction stored in the memory 340 (the operation instruction can be stored in the operating system):
创建第一套接字,所述第一套接字用于对第一报文进行监听,所述第一报文为属于第一业务路由类型的业务路由报文,所述第一报文包括业务路由信息和待处理报文;Create a first socket, the first socket is used to monitor the first message, the first message is a service routing message belonging to the first service routing type, and the first message includes Service routing information and pending packets;
根据所述第一套接字确定所述SN接收到所述第一报文;determining, according to the first socket, that the SN has received the first message;
通过存储器340保存所述待处理报文和第二套接字的对应关系,其中所述第二套接字与所述业务路由信息相对应;storing the corresponding relationship between the message to be processed and the second socket through the memory 340, wherein the second socket corresponds to the service routing information;
通过输入设备310从所述SN中的应用程序单元接收报文获取请求,所述报文获取请求用于请求与所述第二套接字对应的所述待处理报文;receiving a packet acquisition request from the application program unit in the SN through the input device 310, where the packet acquisition request is used to request the pending packet corresponding to the second socket;
所述套接字单元根据所述报文获取请求和所述对应关系确定所述待处理报文为被请求的报文;The socket unit determines that the message to be processed is a requested message according to the message acquisition request and the corresponding relationship;
通过输出设备320向所述应用程序单元发送针对所述报文获取请求的响应的方式,向所述应用程序单元发送所述待处理报文。The message to be processed is sent to the application program unit by means of the output device 320 sending a response to the message acquisition request to the application program unit.
本发明实施例提供的业务节点SN中的套接字单元对业务路由报文进行业务路由信息的处理,SN中的应用程序单元不需要获知业务路由的相关信息,只对业务进行处理,从而避免业务路由的相关信息暴露给SN中的应用程序单元,提高了业务路由的安全性。The socket unit in the service node SN provided by the embodiment of the present invention processes the service routing information on the service routing message, and the application program unit in the SN does not need to know the relevant information of the service routing, but only processes the service, thereby avoiding The relevant information of the service routing is exposed to the application unit in the SN, which improves the security of the service routing.
处理器330控制业务节点SN30的操作,处理器330还可以称为CPU(CentralProcessingUnit,中央处理单元)。存储器340可以包括只读存储器和随机存取存储器,并向处理器330提供指令和数据。存储器340的一部分还可以包括非易失性随机存取存储器(NVRAM)。具体的应用中,业务节点SN30的各个组件通过总线系统350耦合在一起,其中总线系统350除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统350。The processor 330 controls the operation of the service node SN30, and the processor 330 may also be called a CPU (Central Processing Unit, central processing unit). Memory 340 may include read-only memory and random-access memory, and provides instructions and data to processor 330 . A portion of memory 340 may also include non-volatile random access memory (NVRAM). In a specific application, various components of the service node SN30 are coupled together through the bus system 350, wherein the bus system 350 may include a power bus, a control bus, and a status signal bus in addition to a data bus. However, for clarity of illustration, the various buses are labeled as bus system 350 in the figure.
上述本发明实施例揭示的方法可以应用于处理器330中,或者由处理器330实现。处理器330可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器330中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器330可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器340,处理器330读取存储器340中的信息,结合其硬件完成上述方法的步骤。The methods disclosed in the foregoing embodiments of the present invention may be applied to the processor 330 or implemented by the processor 330 . The processor 330 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 330 or instructions in the form of software. The above-mentioned processor 330 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps and logic block diagrams disclosed in the embodiments of the present invention may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the methods disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 340, and the processor 330 reads the information in the memory 340, and completes the steps of the above method in combination with its hardware.
可选地,所述输入设备310还用于从所述应用程序单元接收与所述第二套接字对应的已处理报文,所述已处理报文是由所述应用程序单元对所述待处理报文进行处理而得到的;Optionally, the input device 310 is further configured to receive a processed message corresponding to the second socket from the application program unit, and the processed message is generated by the application program unit to the Obtained by processing the pending message;
所述处理器330还用于根据与所述已处理报文相对应的所述第二套接字,确定所述业务路由信息;The processor 330 is further configured to determine the service routing information according to the second socket corresponding to the processed message;
所述输出设备320还用于向业务路由器SR发送第二报文,所述第二报文为包括所述已处理报文的业务路由报文,所述第二报文的业务路由信息包括所述业务路由信息。The output device 320 is further configured to send a second packet to the service router SR, the second packet is a service routing packet including the processed packet, and the service routing information of the second packet includes the The service routing information described above.
可选地,所述处理器具体用于在所述套接字单元在接收到所述第一报文时,如果所述套接字单元中未保存所述第二套接字,则创建所述第二套接字;Optionally, the processor is specifically configured to, when the socket unit receives the first message, if the second socket is not saved in the socket unit, create the the second socket;
所述存储器340具体用于将所述待处理报文添加至与所述第二套接字对应的报文队列中。The memory 340 is specifically configured to add the message to be processed to the message queue corresponding to the second socket.
可选地,所述存储器340具体用于在所述套接字单元在接收到所述第一报文时,如果所述套接字单元中保存有所述第二套接字,则将所述待处理报文添加至与所述第二套接字对应的报文队列中。Optionally, the memory 340 is specifically configured to, when the socket unit receives the first message, if the second socket is stored in the socket unit, store the Add the message to be processed to the message queue corresponding to the second socket.
可选地,所述输出设备320用于向所述应用程序单元发送所述第二套接字。Optionally, the output device 320 is configured to send the second socket to the application unit.
可选地,所述输出设备320具体用于所述套接字单元向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文的存储地址;Optionally, the output device 320 is specifically used for the socket unit to send a response to the message acquisition request to the application program unit, where the response carries the storage address of the message to be processed;
所述应用程序单元根据所述存储地址,获取所述待处理报文。The application program unit obtains the message to be processed according to the storage address.
可选地,所述输出设备320具体用于向所述应用程序单元发送针对所述报文获取请求的响应,所述响应中携带所述待处理报文。Optionally, the output device 320 is specifically configured to send a response to the message acquisition request to the application program unit, where the response carries the message to be processed.
此外,图4所示的业务节点30中的套接字单元301和应用程序单元302可是被认为是由处理器330根据存储器340中保存的可读指令和需要被使用的数据来实现的。存储器340中可以保存实现套接字单元301和应用程序单元302所需的全部指令和数据。处理读取相应的指令,按照指令进行操作,从而实现套接字单元301和应用程序单元302。In addition, the socket unit 301 and the application program unit 302 in the service node 30 shown in FIG. 4 can be considered to be implemented by the processor 330 according to the readable instructions stored in the memory 340 and the data to be used. The memory 340 can store all the instructions and data required to implement the socket unit 301 and the application program unit 302 . The processing reads the corresponding instructions, and operates according to the instructions, so as to realize the socket unit 301 and the application program unit 302 .
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:ROM、RAM、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: ROM, RAM, disk or CD, etc.
以上对本发明实施例所提供的对业务路由报文进行处理的方法和业务节点进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The method and service nodes for processing service routing messages 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 used 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, this specification The content should not be construed as a limitation of the invention.
Claims (14)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410240822.7A CN105471927B (en) | 2014-05-30 | 2014-05-30 | The method and service node that a kind of pair of business routing message is handled |
PCT/CN2015/078518 WO2015180560A1 (en) | 2014-05-30 | 2015-05-08 | Service router packet processing method and service node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410240822.7A CN105471927B (en) | 2014-05-30 | 2014-05-30 | The method and service node that a kind of pair of business routing message is handled |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105471927A true CN105471927A (en) | 2016-04-06 |
CN105471927B CN105471927B (en) | 2019-01-08 |
Family
ID=54698063
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410240822.7A Active CN105471927B (en) | 2014-05-30 | 2014-05-30 | The method and service node that a kind of pair of business routing message is handled |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105471927B (en) |
WO (1) | WO2015180560A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10917255B2 (en) | 2016-05-10 | 2021-02-09 | Huawei Technologies Co., Ltd. | Packet switched service identification method and terminal |
CN114422415A (en) * | 2020-10-09 | 2022-04-29 | 瞻博网络公司 | Egress node processing flows in segmented routing |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114221898B (en) * | 2021-12-29 | 2023-11-10 | 优刻得科技股份有限公司 | Message processing method and network system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1674538A (en) * | 2004-03-25 | 2005-09-28 | 联想(北京)有限公司 | Network storing system based on local network and its method for reading and writing data |
US20090228970A1 (en) * | 2008-03-07 | 2009-09-10 | Nec Corporation | Gateway device having socket library for monitoring, communication method of gateway device having socket library for monitoring, and communication program of gateway device having socket library for monitoring |
CN102638395A (en) * | 2012-03-19 | 2012-08-15 | 华为技术有限公司 | Message forwarding method and message forwarding equipment |
CN103796078A (en) * | 2014-01-23 | 2014-05-14 | 深圳创维-Rgb电子有限公司 | Multicast video playing method and video playing terminal |
-
2014
- 2014-05-30 CN CN201410240822.7A patent/CN105471927B/en active Active
-
2015
- 2015-05-08 WO PCT/CN2015/078518 patent/WO2015180560A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1674538A (en) * | 2004-03-25 | 2005-09-28 | 联想(北京)有限公司 | Network storing system based on local network and its method for reading and writing data |
US20090228970A1 (en) * | 2008-03-07 | 2009-09-10 | Nec Corporation | Gateway device having socket library for monitoring, communication method of gateway device having socket library for monitoring, and communication program of gateway device having socket library for monitoring |
CN102638395A (en) * | 2012-03-19 | 2012-08-15 | 华为技术有限公司 | Message forwarding method and message forwarding equipment |
CN103796078A (en) * | 2014-01-23 | 2014-05-14 | 深圳创维-Rgb电子有限公司 | Multicast video playing method and video playing terminal |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10917255B2 (en) | 2016-05-10 | 2021-02-09 | Huawei Technologies Co., Ltd. | Packet switched service identification method and terminal |
CN114422415A (en) * | 2020-10-09 | 2022-04-29 | 瞻博网络公司 | Egress node processing flows in segmented routing |
US11611506B2 (en) | 2020-10-09 | 2023-03-21 | Juniper Networks, Inc. | Processing a flow at the egress node in segment routing |
Also Published As
Publication number | Publication date |
---|---|
WO2015180560A1 (en) | 2015-12-03 |
CN105471927B (en) | 2019-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105657748B (en) | Communication method and network device based on tunnel binding | |
CN108432194B (en) | Congestion processing method, host and system | |
CN113709057B (en) | Network congestion notification method, proxy node, network node and computer equipment | |
US11750515B2 (en) | Data transmission method and apparatus | |
CN110999265B (en) | Manage network connectivity between cloud computing service endpoints and virtual machines | |
CN106101023B (en) | A kind of VPLS message processing method and equipment | |
CN110022264B (en) | Method, access device, and computer-readable storage medium for controlling network congestion | |
WO2018058677A1 (en) | Message processing method, computing device, and message processing apparatus | |
US11757832B2 (en) | IP address allocation system and method | |
CN106549871A (en) | A kind of method, apparatus and system of Message processing | |
WO2021135397A1 (en) | Message transfer method and related device | |
CN104521220B (en) | Message processing method and equipment | |
WO2015085576A1 (en) | Method for processing address resolution protocol message, forwarder and controller | |
CN106878181A (en) | A kind of message transmitting method and device | |
WO2021244356A1 (en) | Data transmission method and apparatus | |
WO2015196923A1 (en) | Method for sending information and network device | |
CN110417632B (en) | Network communication method, system and server | |
CN111614505A (en) | Packet processing method and gateway device | |
CN105471927A (en) | Method for processing service routing message, and service node | |
WO2018090980A1 (en) | Packet forwarding | |
CN112995053A (en) | Method and device for sending message | |
CN108768849B (en) | Message processing method and device | |
CN108471374B (en) | Data message forwarding method and device | |
WO2017173899A1 (en) | Terminal, device server, network message processing method, system, and storage medium | |
CN105656814A (en) | SDN (Software-Defined Network) forwarding system and method |
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 |