业务处理单元和方法以及业务控制网关和负载均衡方法 Service processing unit and method, and service control gateway and load balancing method
本申请要求于 2010 年 10 月 27 日提交中国专利局、 申请号为 201010521499.2、 发明名称为 "业务处理单元和方法以及业务控制网关和负 载均衡方法" 的中国专利申请的优先权, 其全部内容通过引用结合在本申请 中。 技术领域This application claims the priority of the Chinese Patent Application filed on October 27, 2010, to the Chinese Patent Office, Application No. 201010521499.2, entitled "Business Processing Unit and Method, and Service Control Gateway and Load Balancing Method". The citations are incorporated herein by reference. Technical field
 本发明涉及负载均衡技术,尤其涉及一种业务处理单元和方法以及业务 控制网关和负载均衡方法。 背景技术 The present invention relates to load balancing techniques, and in particular, to a service processing unit and method, and a service control gateway and a load balancing method. Background technique
 移动终端例如移动电话或者笔记本计算机通过网络接入服务器 ( Network Access Server, NAS )接入到服务提供商 ( Service Provider, SP ) 的业务服务器 (例如门户网站服务器、 电子邮件服务器等) , 以使用 SP提 供的服务。 为了对用户访问 SP服务的过程进行控制和计费, 电信运营商在 网络接入服务器和 SP 业务服务器之间增加业务控制网关 (Service Control Gateway, SCG ) 。 A mobile terminal such as a mobile phone or a notebook computer accesses a service server (for example, a portal server, an email server, etc.) of a service provider (SP) through a network access server (NAS) to use the SP service provided. In order to control and charge the process of the user accessing the SP service, the telecommunication operator adds a Service Control Gateway (SCG) between the network access server and the SP service server.
 业务控制网关内部一般包含两种功能单元,分别为负载均衡单元和业务 处理单元, 其中业务处理单元往往配置多个, 以应对庞大的访问量。 The service control gateway generally contains two functional units, namely a load balancing unit and a service processing unit, where the service processing unit is often configured to cope with a large amount of access.
 负载均衡单元负责接收来自移动设备的业务请求数据包,并采用负载均 衡策略将业务请求数据包分发到合适的业务处理单元。 由于业务请求数据包 和针对该业务请求数据包而返回的业务应答数据包必须由同一业务处理单 元进行处理, 因此在分发业务请求数据包时, 负载均衡单元还需记录该业务 请求数据包与处理该业务请求数据包的业务处理单元之间的对应关系,以便 在收到针对该业务请求数据包而返回的业务应答数据包时,能够将该业务应 答数据包发往处理上述业务请求数据包的业务处理单元进行处理。 一般而 言, 负载均衡单元是通过记录业务请求数据包的源 IP地址与业务处理单元 之间的对应关系, 来记录业务请求数据包与业务处理单元之间的对应关系 的。The load balancing unit is responsible for receiving the service request data packet from the mobile device and distributing the service request data packet to the appropriate service processing unit by using the load balancing policy. Since the service request data packet and the service response data packet returned for the service request data packet must be processed by the same service processing unit, the load balancing unit needs to record the service request data packet and processing when distributing the service request data packet. The service requests a correspondence between the service processing units of the data packet, so that when the service response data packet returned for the service request data packet is received, the service can be  The data packet is sent to the service processing unit that processes the above service request data packet for processing. Generally, the load balancing unit records the correspondence between the service request data packet and the service processing unit by recording the correspondence between the source IP address of the service request data packet and the service processing unit.
 业务处理单元用于根据业务请求数据包进行业务处理操作(例如控制和 计费操作等) , 再将业务请求数据包返回负载均衡单元, 以便由负载均衡单 元发往业务服务器, 再由业务服务器提供真正的服务。 业务服务器在提供服 务时, 会返回业务应答数据包(例如包含用户所请求视频内容的业务应答数 据包)。 该业务应答数据包将路由至负载均衡单元, 负载均衡单元提取该业 务应答数据包的目的 IP地址, 该目的 IP地址即为该业务应答数据包所对应 的业务请求数据包的源 IP地址。 随后, 负载均衡单元便可根据记录的业务 请求数据包的源 IP地址与业务处理单元之间的对应关系确定应将该业务应 答数据包转发给哪一业务处理单元进行处理。在对业务应答数据包进行处理 之后, 业务处理单元将业务应答数据包返回给负载均衡单元, 由负载均衡单 元发往 NAS , 最后由 NAS发往移动终端。 The service processing unit is configured to perform service processing operations (such as control and charging operations, etc.) according to the service request data packet, and then return the service request data packet to the load balancing unit, so as to be sent by the load balancing unit to the service server, and then provided by the service server. Real service. When the service server provides the service, it returns a service response packet (for example, a service response packet containing the video content requested by the user). The service response data packet is routed to the load balancing unit, and the load balancing unit extracts the destination IP address of the service response data packet, where the destination IP address is the source IP address of the service request data packet corresponding to the service response data packet. Then, the load balancing unit determines, according to the correspondence between the source IP address of the service request packet and the service processing unit, which service processing unit should be forwarded to which service processing unit for processing. After processing the service response packet, the service processing unit returns the service response packet to the load balancing unit, and the load balancing unit sends the packet to the NAS, and finally the NAS sends the packet to the mobile terminal.
 由于负载均衡单元负责记录业务请求数据包的源 IP地址与业务处理单 元之间的对应关系, 因此返回的业务应答数据包必须先发送到负载均衡单元 才能确定该业务应答数据包应转发至哪一业务处理单元进行处理。如此一来 必然增加负载均衡单元的处理负担。更为严重的是,与业务请求数据包相比, 业务应答数据包的数量要大很多, 这无疑将导致负载均衡单元负担过重, 影 响业务请求数据包和业务应答数据包的转发,从而制约整个业务控制网关的 工作效率。 当业务应答数据包过多时, 负载均衡单元负担过重将导致用户发 出的业务请求无法得到及时的应答, 严重影响用户体验。 发明内容 Since the load balancing unit is responsible for recording the correspondence between the source IP address of the service request packet and the service processing unit, the returned service response packet must first be sent to the load balancing unit to determine which service packet should be forwarded to. The business processing unit processes. As a result, the processing load of the load balancing unit is inevitably increased. More seriously, compared with the service request data packet, the number of service response data packets is much larger, which will undoubtedly cause the load balancing unit to overburden, affecting the forwarding of service request data packets and service response data packets, thereby restricting The efficiency of the entire business control gateway. When the service response packet is too large, the load balancing unit is overburdened, and the service request sent by the user cannot be answered in time, which seriously affects the user experience. Summary of the invention
 有鉴于此, 实有必要提供一种业务处理单元, 能够提高业务控制网关的 工作效率。In view of this, it is necessary to provide a service processing unit that can improve the service control gateway.  Work efficiency.
 同时, 提供一种工作效率更高的业务控制网关。 At the same time, it provides a more efficient business control gateway.
 同时, 提供一种工作效率更高的业务处理方法。 At the same time, it provides a more efficient business processing method.
 同时, 提供一种工作效率更高的负载均衡方法。 At the same time, it provides a more efficient load balancing method.
 一种业务处理单元, 所述业务处理单元配置有至少一个网际协议 IP地址, 包括: A service processing unit, where the service processing unit is configured with at least one internet protocol IP address, including:
 业务处理模块, 用于接收业务请求数据包, 根据所述业务请求数据包生成 业务获取数据包, 并记录所述业务获取数据包的数据传输参数组与业务请求数 据包的数据传输参数组之间的对应关系; a service processing module, configured to receive a service request data packet, generate a service acquisition data packet according to the service request data packet, and record a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet Correspondence relationship;
 地址转换模块, 用于记录所述业务获取数据包的数据传输参数组中的源 IP 地址和源端口号, 在所述至少一个 IP地址和多个端口号中分别选择一 IP地址 和一端口号来对所述业务获取数据包的数据传输参数组中的源 ip 地址和源端 口号进行替换, 记录替换后的业务获取数据包的数据传输参数组与所述记录的 源 IP地址和源端口号之间的对应关系,并发出替换后的业务获取数据包,其中, 替换后的业务获取数据包的数据传输参数组是唯一的; 以及接收作为对替换后 的业务获取数据包的应答的业务承载数据包, 根据所述记录的替换后的业务获 取数据包的数据传输参数组与所述记录的源 IP 地址和源端口号之间的对应关 系, 由所述业务承载数据包的数据传输参数组获得记录的源 IP 地址和源端口 号, 依据记录的源 IP地址和源端口号替换所述业务承载数据包的目的 IP地址 和目的端口号; An address conversion module, configured to record a source IP address and a source port number in a data transmission parameter group of the service acquisition data packet, and select an IP address and a port number in the at least one IP address and the multiple port numbers respectively And replacing the source IP address and the source port number in the data transmission parameter group of the service acquisition data packet, and recording the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record. Corresponding relationship, and issuing the replaced service acquisition data packet, wherein the data transmission parameter group of the replaced service acquisition data packet is unique; and receiving the service bearer as a response to the replaced service acquisition data packet a data packet, a data transmission parameter group of the service bearer data packet, according to the correspondence between the data transmission parameter group of the replaced service acquisition packet and the source IP address and the source port number of the record Obtain the source IP address and source port number of the record, and replace the service bearer data according to the source IP address and source port number of the record. The destination IP address and destination port number of the packet;
 所述业务处理模块还用于根据记录的所述业务获取数据包的数据传输参数 组与业务请求数据包的数据传输参数组之间的对应关系, 由替换后的业务承载 数据包的数据传输参数组获得所述业务请求数据包的数据传输参数组, 并根据 替换后的业务承载数据包和所述业务请求数据包的数据传输参数组生成业务应 答数据包, 并发送所述业务应答数据包, 以作为对所述业务请求数据包的应答。 The service processing module is further configured to obtain, according to the recorded service, a correspondence between a data transmission parameter group of the data packet and a data transmission parameter group of the service request data packet, and a data transmission parameter of the replaced service bearer data packet. The group obtains a data transmission parameter group of the service request data packet, and generates a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sends the service response data packet, In response to the service request packet.
 一种业务控制网关, 包括:  多个业务处理单元, 每一业务处理单元配置有至少一个 IP地址; 负载均衡单元, 用于接收业务请求数据包, 根据预先设置的负载均衡策略 在所述多个业务处理单元中选择一业务处理单元作为目标业务处理单元, 将所 述业务请求数据包转发给所述目标业务处理单元;A service control gateway, including:  a plurality of service processing units, each of which is configured with at least one IP address; a load balancing unit, configured to receive a service request data packet, and select a service processing among the plurality of service processing units according to a preset load balancing policy The unit, as the target service processing unit, forwards the service request data packet to the target service processing unit;
 所述目标业务处理单元用于: The target service processing unit is configured to:
 接收业务请求数据包,根据所述业务请求数据包生成业务获取数据包, 并记录所述业务获取数据包的数据传输参数组与业务请求数据包的数据传 输参数组之间的对应关系; Receiving a service request data packet, generating a service acquisition data packet according to the service request data packet, and recording a correspondence between a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet;
 记录所述业务获取数据包的数据传输参数组中的源 IP 地址和源端口 号, 在所述至少一个 IP地址和多个端口号中分别选择一 IP地址和一端口 号来对所述业务获取数据包的数据传输参数组中的源 IP 地址和源端口号 进行替换, 记录替换后的业务获取数据包的数据传输参数组与所述记录的 源 IP地址和源端口号之间的对应关系, 并发出替换后的业务获取数据包, 其中, 替换后的业务获取数据包的数据传输参数组是唯一的; 以及接收作 为对替换后的业务获取数据包的应答的业务承载数据包, 根据所述记录的 替换后的业务获取数据包的数据传输参数组与所述记录的源 IP 地址和源 端口号之间的对应关系, 由所述业务承载数据包的数据传输参数组获得记 录的源 IP地址和源端口号, 依据记录的源 IP地址和源端口号替换所述业 务承载数据包的目的 IP地址和目的端口号; Recording a source IP address and a source port number in the data transmission parameter group of the service acquisition data packet, and selecting an IP address and a port number in the at least one IP address and the multiple port numbers to obtain the service The source IP address and the source port number in the data transmission parameter group of the data packet are replaced, and the correspondence between the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record is recorded. And sending the replaced service acquisition data packet, where the data transmission parameter group of the replaced service acquisition data packet is unique; and receiving the service bearer data packet as a response to the replaced service acquisition data packet, according to the Corresponding relationship between the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record, and the source IP address of the record obtained by the data transmission parameter group of the service bearer data packet And the source port number, replacing the destination IP address of the service bearer packet with the source IP address and the source port number of the record, and Port number;
 根据记录的所述业务获取数据包的数据传输参数组与业务请求数据包 的数据传输参数组之间的对应关系, 由替换后的业务承载数据包的数据传 输参数组获得所述业务请求数据包的数据传输参数组, 并根据替换后的业 务承载数据包和所述业务请求数据包的数据传输参数组生成业务应答数据 包, 并发送所述业务应答数据包, 以作为对所述业务请求数据包的应答。 一种业务处理方法, 包括: Obtaining, according to the recorded correspondence between the data transmission parameter group of the data packet and the data transmission parameter group of the service request data packet, obtaining the service request data packet by the data transmission parameter group of the replaced service bearer data packet And a data transmission parameter group, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sending the service response data packet as the data for the service request The response of the package. A business processing method, including:
 接收业务请求数据包, 根据所述业务请求数据包生成业务获取数据包, 并 记录所述业务获取数据包的数据传输参数组与业务请求数据包的数据传输参数 组之间的对应关系;Receiving a service request data packet, generating a service acquisition data packet according to the service request data packet, and  Recording a correspondence between a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet;
 记录所述业务获取数据包的数据传输参数组中的源 IP地址和源端口号,在 所述至少一个 IP地址和多个端口号中分别选择一 IP地址和一端口号来对所述 业务获取数据包的数据传输参数组中的源 IP地址和源端口号进行替换,记录替 换后的业务获取数据包的数据传输参数组与所述记录的源 IP 地址和源端口号 之间的对应关系, 并发出替换后的业务获取数据包, 其中, 替换后的业务获取 数据包的数据传输参数组是唯一的; 以及接收作为对替换后的业务获取数据包 的应答的业务承载数据包, 根据所述记录的替换后的业务获取数据包的数据传 输参数组与所述记录的源 IP地址和源端口号之间的对应关系, 由所述业务承载 数据包的数据传输参数组获得记录的源 IP地址和源端口号, 依据记录的源 IP 地址和源端口号替换所述业务承载数据包的目的 IP地址和目的端口号; Recording a source IP address and a source port number in the data transmission parameter group of the service acquisition data packet, and selecting an IP address and a port number in the at least one IP address and the multiple port numbers to obtain the service The source IP address and the source port number in the data transmission parameter group of the data packet are replaced, and the correspondence between the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record is recorded. And sending the replaced service acquisition data packet, where the data transmission parameter group of the replaced service acquisition data packet is unique; and receiving the service bearer data packet as a response to the replaced service acquisition data packet, according to the Corresponding relationship between the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record, and the source IP address of the record obtained by the data transmission parameter group of the service bearer data packet And the source port number, and the destination IP address and destination of the service bearer packet are replaced according to the source IP address and the source port number of the record. The port number;
 根据记录的所述业务获取数据包的数据传输参数组与业务请求数据包的数 据传输参数组之间的对应关系, 由替换后的业务承载数据包的数据传输参数组 获得所述业务请求数据包的数据传输参数组, 并根据替换后的业务承载数据包 和所述业务请求数据包的数据传输参数组生成业务应答数据包, 并发送所述业 务应答数据包, 以作为对所述业务请求数据包的应答。 Obtaining, according to the recorded correspondence between the data transmission parameter group of the data packet and the data transmission parameter group of the service request data packet, obtaining the service request data packet by the data transmission parameter group of the replaced service bearer data packet And a data transmission parameter group, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sending the service response data packet as the data for the service request The response of the package.
 一种负载均衡方法, 所述负载均衡方法应用于业务控制网关, 所述业务控 制网关包含负载均衡单元和多个业务处理单元, 其中, 每一业务处理单元配置 有至少一个 IP地址, 所述方法包括: A load balancing method, the load balancing method is applied to a service control gateway, where the service control gateway includes a load balancing unit and a plurality of service processing units, wherein each service processing unit is configured with at least one IP address, and the method Includes:
 所述负载均衡单元接收业务请求数据包, 根据预先设置的负载均衡策略在 所述多个业务处理单元中选择一业务处理单元作为目标业务处理单元, 将所述 业务请求数据包转发给所述目标业务处理单元; Receiving, by the load balancing unit, a service request data packet, selecting a service processing unit as the target service processing unit among the plurality of service processing units according to a preset load balancing policy, and forwarding the service request data packet to the target Business processing unit;
 所述目标业务处理单元接收业务请求数据包, 根据所述业务请求数据包生 成业务获取数据包, 并记录所述业务获取数据包的数据传输参数组与业务请求 数据包的数据传输参数组之间的对应关系;  所述目标业务处理单元记录所述业务获取数据包的数据传输参数组中的源Receiving, by the target service processing unit, a service request data packet, generating a service acquisition data packet according to the service request data packet, and recording a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet Correspondence relationship;  The target service processing unit records a source in a data transmission parameter group of the service acquisition data packet
IP地址和源端口号, 在所述至少一个 IP地址和多个端口号中分别选择一 IP地 址和一端口号来对所述业务获取数据包的数据传输参数组中的源 IP 地址和源 端口号进行替换, 记录替换后的业务获取数据包的数据传输参数组与所述记录 的源 IP地址和源端口号之间的对应关系, 并发出替换后的业务获取数据包, 其 中, 替换后的业务获取数据包的数据传输参数组是唯一的; 以及接收作为对替 换后的业务获取数据包的应答的业务承载数据包, 根据所述记录的替换后的业 务获取数据包的数据传输参数组与所述记录的源 IP 地址和源端口号之间的对 应关系, 由所述业务承载数据包的数据传输参数组获得记录的源 IP地址和源端 口号, 依据记录的源 IP地址和源端口号替换所述业务承载数据包的目的 IP地 址和目的端口号;An IP address and a source port number, respectively selecting an IP address and a port number among the at least one IP address and the plurality of port numbers to obtain a source IP address and a source port in a data transmission parameter group of the data packet for the service The replacement is performed, and the correspondence between the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record is recorded, and the replaced service acquisition data packet is sent, where the replaced The data transmission parameter group of the service acquisition data packet is unique; and receiving the service bearer data packet as a response to the replaced service acquisition data packet, and acquiring the data transmission parameter group of the data packet according to the replaced service of the record Corresponding relationship between the source IP address and the source port number of the record, the source IP address and the source port number of the record are obtained by the data transmission parameter group of the service bearer data packet, according to the source IP address and the source port number of the record. Replacing a destination IP address and a destination port number of the service bearer packet;
 所述目标业务处理单元根据记录的所述业务获取数据包的数据传输参数组 与业务请求数据包的数据传输参数组之间的对应关系, 由替换后的业务承载数 据包的数据传输参数组获得所述业务请求数据包的数据传输参数组, 并根据替 换后的业务承载数据包和所述业务请求数据包的数据传输参数组生成业务应答 数据包, 并发送所述业务应答数据包, 以作为对所述业务请求数据包的应答。 And the target service processing unit obtains a correspondence between the data transmission parameter group of the data packet and the data transmission parameter group of the service request data packet according to the recorded service, and is obtained by the data transmission parameter group of the replaced service bearer data packet. Transmitting a data transmission parameter group of the service request data packet, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and transmitting the service response data packet, as A response to the service request packet.
 本发明实施例通过执行地址替换操作,使得负载均衡单元仅负责向业务 处理单元分发业务请求数据包,而不再参与移动终端和业务服务器之间后续 业务数据的转发, 因此可大大降低负载均衡单元的任务量, 由此大大提高负 载均衡单元以及业务控制网关的工作效率。 附图说明 The embodiment of the present invention performs the address replacement operation, so that the load balancing unit is only responsible for distributing the service request data packet to the service processing unit, and no longer participates in the forwarding of the subsequent service data between the mobile terminal and the service server, thereby greatly reducing the load balancing unit. The amount of tasks, thereby greatly improving the efficiency of the load balancing unit and the service control gateway. DRAWINGS
 图 1是依据本发明一示范性实施例的业务处理单元的逻辑结构框图; 图 2是依据本发明一示范性实施例的业务控制网关的逻辑结构框图; 图 3 是依据本发明一示范性实施例的业务控制网关的应用场景的示意 图;  图 4是依据本发明一示范性实施例的业务处理方法的流程图; 图 5是依据本发明一示范性实施例的负载均衡方法的流程图。 具体实施方式1 is a logical structural block diagram of a service processing unit according to an exemplary embodiment of the present invention; FIG. 2 is a logical structural block diagram of a service control gateway according to an exemplary embodiment of the present invention; FIG. 3 is an exemplary implementation according to the present invention. A schematic diagram of an application scenario of a service control gateway;  4 is a flowchart of a service processing method according to an exemplary embodiment of the present invention. FIG. 5 is a flowchart of a load balancing method according to an exemplary embodiment of the present invention. detailed description
 图 1是依据本发明一示范性实施例的业务处理单元 100的逻辑结构框图。 业务处理单元 100配置有至少一个 IP ( Internet Protocol, 网际协议)地址, 如 图 1所示, 业务处理单元 100包括业务处理模块 102和地址转换模块 104。 FIG. 1 is a block diagram showing the logical structure of a service processing unit 100 in accordance with an exemplary embodiment of the present invention. The service processing unit 100 is configured with at least one IP (Internet Protocol) address. As shown in FIG. 1, the service processing unit 100 includes a service processing module 102 and an address translation module 104.
 业务处理模块 102用于接收业务请求数据包, 以及根据所述业务请求数据 包生成业务获取数据包, 并记录所述业务获取数据包的数据传输参数组与业务 请求数据包的数据传输参数组之间的对应关系。 The service processing module 102 is configured to receive a service request data packet, and generate a service acquisition data packet according to the service request data packet, and record a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet. Correspondence between the two.
 具体来说, 当用户想要访问服务提供商提供的业务(例如各种互联网应用) 时, 终端设备(例如移动电话、 笔记本计算机等移动终端) 需要构造对应的业 务请求数据包。应注意,此处提到的数据包为 OSI ( Open System Interconnection 开放系统互连)中网络层的协议数据单元。 其中, 该业务请求数据包的源 IP地 址为终端设备在接入数据通信网络时由网络接入服务器为该终端设备分配的 IP 地址, 源端口号为终端设备随机选择(也可采用其他预设方式选择) 的端口号 Specifically, when a user wants to access a service provided by a service provider (e.g., various Internet applications), a terminal device (e.g., a mobile terminal such as a mobile phone or a notebook computer) needs to construct a corresponding service request packet. It should be noted that the data packet mentioned here is the protocol data unit of the network layer in OSI (Open System Interconnection). The source IP address of the service request packet is an IP address assigned by the network access server to the terminal device when the terminal device accesses the data communication network, and the source port number is randomly selected by the terminal device (other presets may also be adopted) Mode selection) port number
(即 TCP/IP协议中定义的端口号, port ), 目的 IP地址和目的端口号为服务提 供商为用户想要访问的上述业务设置的监听 IP地址和监听端口号。 应注意, 上 述业务请求数据包的目的 IP地址并非一定是服务提供商业务服务器的 IP地址, 置的统一的业务访问 IP地址, 或者服务提供商出于其他目的而设置的 IP地址 (例如虚拟 IP地址)等等。(The port number, port defined in the TCP/IP protocol). The destination IP address and destination port number are the listening IP address and listening port number set by the service provider for the above services that the user wants to access. It should be noted that the destination IP address of the service request packet is not necessarily the IP address of the service provider service server, the unified service access IP address, or the IP address set by the service provider for other purposes (for example, virtual IP). Address) and so on.
 终端设备(例如移动电话、 笔记本计算机等移动终端)发出的业务请求数 据包在到达业务控制网关时, 将首先到达业务控制网关的负载均衡单元, 随后 由负载均衡单元转发给业务处理单元, 例如业务处理单元 100。 When the service request data packet sent by the terminal device (for example, a mobile terminal such as a mobile phone or a notebook computer) arrives at the service control gateway, it first arrives at the load balancing unit of the service control gateway, and then is forwarded by the load balancing unit to the service processing unit, for example, the service. Processing unit 100.
 业务处理模块 102用于接收业务请求数据包并对该业务请求数据包进行分 析, 以确定如何处理该业务请求数据包。 具体来说, 业务处理模块 102在收到 业务请求数据包后, 可根据预先设置的业务策略(例如务请求数据包的源 IP地 址和 /或目的 IP地址查找对应的业务策略), 并根据该业务策略生成与业务请求 数据包相对应的业务获取数据包。 与业务请求数据包相比, 业务获取数据包的 数据传输参数组以及数据载荷内容均有可能发生变化。 例如, 数据传输参数组 之中的源 IP地址、 源端口号、 目的 IP地址、 目的端口号、 OSI传输层协议类 型等均有可能发生变化, OSI应用层协议类型以及 OSI应用层数据也有可能不 同。 例如, 业务处理模块 102可通过对业务请求数据包进行分析(分析数据包 的数据传输参数组和 /或载荷数据 )获知用户想要访问的业务, 并进一步确定提 供该业务的业务服务器的 IP地址和该业务所对应的端口号(如上文所述, 业务 服务器的 IP地址可能并非业务请求数据包的目的 IP地址), 从而依据该 IP地 址和端口号构建业务获取数据包。 此外, 根据具体的业务控制策略例如业务路 由、 协议转换、 头增强等, 业务获取数据包与业务请求数据包中包含的具体载 荷内容也有可能发生改变。 根据业务请求数据包生成业务获取数据包的过程与 服务提供商制定的具体控制策略和 /或业务服务策略有关,和 /或与用户订制的具 体控制策略和 /或业务服务策略有关, 在此不再——赘述。 此时, 假设业务请求 数据包的数据传输参数组包含源 IP地址 源端口号 AP1、 传输层协议类型 X、 目的 IP地址 B !p2和目的端口号 BP2, 则业务获取数据包的数据传输参数组 包含源 IP地址 Awr , 源端口号 AP1,、 传输层协议类型 X,、 目的 IP地址 Bwv 和目的端口号 Bp2,。The service processing module 102 is configured to receive a service request data packet and divide the service request data packet.  Analyze to determine how to handle the business request packet. Specifically, after receiving the service request data packet, the service processing module 102 may search for a corresponding service policy according to a preset service policy (for example, searching for a source IP address and/or a destination IP address of the data packet), and according to the The business policy generates a service acquisition packet corresponding to the service request packet. Compared with the service request data packet, the data transmission parameter group of the service acquisition data packet and the data payload content may change. For example, the source IP address, source port number, destination IP address, destination port number, and OSI transport layer protocol type in the data transmission parameter group may change. The OSI application layer protocol type and OSI application layer data may also be different. . For example, the service processing module 102 can learn the service that the user wants to access by analyzing the service request data packet (analysing the data transmission parameter group and/or the payload data of the data packet), and further determining the IP address of the service server providing the service. The port number corresponding to the service (as described above, the IP address of the service server may not be the destination IP address of the service request packet), so that the service acquisition data packet is constructed according to the IP address and the port number. In addition, according to specific service control policies such as service routing, protocol conversion, header enhancement, etc., the specific payload contents included in the service acquisition data packet and the service request data packet may also be changed. The process of generating a service acquisition data packet according to the service request data packet is related to a specific control policy and/or a business service policy formulated by the service provider, and/or related to a specific control policy and/or a business service policy customized by the user, where No longer. At this point, assume that the data transmission parameter set of the service request packet contains the source IP address. The source port number AP1 , the transport layer protocol type X, the destination IP address B !p2 , and the destination port number BP2 , the data transmission parameter group of the service acquisition data packet includes the source IP address Awr , the source port number AP1 , Transport layer protocol type X, destination IP address Bwv and destination port number Bp2 .  为了使业务请求数据包的应答数据能够正常返回终端设备, 业务处理模块 102 需要记录所述业务请求数据包的数据传输参数组, 例如所述业务请求数据 包的源 IP地址、 源端口号、 目的 IP地址、 目的端口号、 OSI传输层协议类型 等等, 并记录业务获取数据包的数据传输参数组与业务请求数据包的数据传输 参数组之间的对应关系。 In order to enable the response data of the service request data packet to be returned to the terminal device normally, the service processing module 102 needs to record the data transmission parameter group of the service request data packet, for example, the source IP address, the source port number, and the destination of the service request data packet. The IP address, the destination port number, the OSI transport layer protocol type, and the like, and record the correspondence between the data transmission parameter group of the service acquisition data packet and the data transmission parameter group of the service request data packet.
 此外, 业务处理模块 102还用于根据所述业务请求数据包进行业务处理, 例如进行业务控制操作和 /或计费操作等。In addition, the service processing module 102 is further configured to perform service processing according to the service request data packet,  For example, a service control operation and/or a charging operation are performed.
 地址转换模块 104用于记录所述业务获取数据包的数据传输参数组中的源 IP地址和源端口号, 在所述至少一个 IP地址和多个端口号中分别选择一 IP地 址和一端口号来对所述业务获取数据包的数据传输参数组中的源 IP 地址和源 端口号进行替换, 记录替换后的业务获取数据包的数据传输参数组与所述记录 的源 IP地址和源端口号之间的对应关系, 并发出替换后的业务获取数据包, 其 中, 替换后的业务获取数据包的数据传输参数组是唯一的; 以及接收作为对替 换后的业务获取数据包的应答的业务承载数据包, 根据所述记录的替换后的业 务获取数据包的数据传输参数组与所述记录的源 IP 地址和源端口号之间的对 应关系, 由所述业务承载数据包的数据传输参数组获得所述记录的源 IP地址和 源端口号,依据记录的源 IP地址和源端口号替换所述业务承载数据包的目的 IP 地址和目的端口号。 The address conversion module 104 is configured to record a source IP address and a source port number in the data transmission parameter group of the service acquisition data packet, and select an IP address and a port number in the at least one IP address and the multiple port numbers respectively. And replacing the source IP address and the source port number in the data transmission parameter group of the service acquisition data packet, and recording the data transmission parameter group of the replaced service acquisition data packet and the source IP address and the source port number of the record. Corresponding relationship, and sending the replaced service acquisition data packet, wherein the data transmission parameter group of the replaced service acquisition data packet is unique; and receiving the service bearer as a response to the replaced service acquisition data packet a data packet, a data transmission parameter group of the service bearer data packet, according to the correspondence between the data transmission parameter group of the replaced service acquisition packet and the source IP address and the source port number of the record Obtaining the source IP address and the source port number of the record, and replacing the service bearer according to the source IP address and the source port number of the record. The destination IP address and destination port number of the packet.
 具体来说, 每一业务处理单元都配置有一 IP地址池, 该 IP地址池中包含 至少一个 IP地址。 不难理解, 在从上述至少一个 IP地址和多个端口号中选择 IP地址和端口号时,应保证包含所选的 IP地址与所选的端口号的替换后的业务 获取数据包的数据传输参数组是唯一的, 否则将导致数据传输发生混乱。 在根 据所选 IP地址和端口号对业务获取数据包的源 IP地址和源端口号进行替换之 后, 替换后的业务获取数据包将发往服务提供商的业务服务器。 在具体实现过 程中, 可采用多种方式从 IP地址池中选择 IP地址, 以及从多个端口号中选择 端口号, 在此不再——赘述。 此时, 当业务获取数据包的数据传输参数组包含 源 IP地址 A π ,、 源端口号 ΑΡ1,、 传输层协议类型 X,、 目的 IP地址 B 和目的 端口号 BP2,时, 则替换后的业务获取数据包的数据传输参数组将包含源 IP地址 A jp3、源端口号 Ap3、传输层协议类型 X,、目的 IP地址 B 和目的端口号 BP2, 。Specifically, each service processing unit is configured with an IP address pool, and the IP address pool includes at least one IP address. It is not difficult to understand that when selecting an IP address and a port number from the above at least one IP address and a plurality of port numbers, the data transmission of the replaced service acquisition data packet including the selected IP address and the selected port number should be guaranteed. The parameter group is unique, otherwise it will cause confusion in data transmission. After the source IP address and the source port number of the service acquisition data packet are replaced according to the selected IP address and port number, the replaced service acquisition data packet is sent to the service provider's service server. In a specific implementation process, an IP address can be selected from the IP address pool in multiple manners, and a port number is selected from multiple port numbers, which is not described here. At this time, when the data transmission parameter group of the service acquisition data packet includes the source IP address A π , the source port number ΑΡ1 , the transport layer protocol type X, the destination IP address B, and the destination port number BP2 , then the replacement is performed. The data transmission parameter set of the subsequent service acquisition data packet will include the source IP address A jp3 , the source port number Ap3 , the transport layer protocol type X, the destination IP address B, and the destination port number BP2 .
 业务服务器在对替换后的业务获取数据包进行处理之后, 将返回业务承载 数据包, 作为对替换后的业务获取数据包的应答。 例如, 若终端 (例如各种终 端设备(例如移动电话、 笔记本计算机等移动终端)请求访问多媒体内容, 则 业务承载数据包中将承载对应的多媒体数据。 根据业务获取数据包生成并返回 业务承载数据包的过程与服务提供商提供服务的方式有关,在此不再一一赘述。 当替换后的业务获取数据包的数据传输参数组包含源 IP地址 Ajp3、 源端口号 AP3、 传输层协议类型 X,、 目的 IP地址 B jp2,和目的端口号 BP2,时, 则业务承载 数据包的数据传输参数组将包含源 IP地址 B jp2,、 源端口号 BP2,、传输层协议类 型 X,、 目的 IP地址 Α π^和目的端口号 Ap3。After processing the replaced service acquisition data packet, the service server returns a service bearer data packet as a response to the replaced service acquisition data packet. For example, if a terminal (for example, a mobile terminal such as a mobile phone or a notebook computer) requests access to multimedia content,  The corresponding multimedia data will be carried in the service bearer data packet. The process of generating and returning a service bearer packet according to the service acquisition data packet is related to the manner in which the service provider provides the service, and will not be repeated here. When the data transmission parameter group of the replaced service acquisition data packet includes the source IP address Ajp3 , the source port number AP3 , the transport layer protocol type X, the destination IP address B jp2 , and the destination port number BP2 , then The data transmission parameter set of the service bearer packet will include the source IP address B jp2 , the source port number BP2 , the transport layer protocol type X, the destination IP address π π^, and the destination port number Ap3 .
 在收到作为对上述业务获取数据包的应答的业务承载数据包之后, 地址转 换模块 104根据所述记录的替换后的业务获取数据包的数据传输参数组与所述 记录的源 IP地址和源端口号之间的对应关系,由所述业务承载数据包的数据传 输参数组获得所述记录的源 IP地址和源端口号, 依据记录的源 IP地址和源端 口号替换所述业务承载数据包的目的 IP 地址和目的端口号。 在具体实现过程 中, 可通过比对业务承载数据包和替换后的业务获取数据包的数据传输参数组 来确定该业务承载数据包是否为该替换后的业务获取数据包的应答, 例如, 将 业务承载数据包的源 IP 地址和源端口号分别与替换后的业务获取数据包的目 的 IP地址和目的端口号进行比较, 并将业务承载数据包的目的 IP地址和目的 端口号分别与替换后的业务获取数据包的源 IP地址和源端口号进行比较,在此 基础上, 还可将业务承载数据包的 OSI传输层协议类型与替换后的业务获取数 据包的 OSI传输层协议类型进行比较。 如果比较结果均相同, 则说明业务承载 数据包为对替换后的业务获取数据包的应答。 当业务承载数据包的数据传输参 数组包含源 IP地址 B jpr ^源端口号 BP2,、传输层协议类型 X,、目的 IP地址 Aff3 和目的端口号 AP3, 则替换后的业务承载数据包的数据传输参数组将包含源 IP 地址 B 、 源端口号 Bp2,、 传输层协议类型 X,、 目的 IP地址 A ,和目的端口 号 ΑΡ1,。After receiving the service bearer data packet as a response to the foregoing service acquisition data packet, the address conversion module 104 acquires the data transmission parameter group of the data packet and the source IP address and source of the record according to the recorded replaced service. The source IP address and the source port number of the record are obtained by the data transmission parameter group of the service bearer data packet, and the service bearer data packet is replaced according to the source IP address and the source port number of the record. Destination IP address and destination port number. In a specific implementation process, the data transmission parameter group of the service bearer packet and the replaced service acquisition data packet may be used to determine whether the service bearer data packet is a response to the replaced service acquisition data packet, for example, The source IP address and the source port number of the service bearer packet are respectively compared with the destination IP address and the destination port number of the replaced service acquisition data packet, and the destination IP address and the destination port number of the service bearer data packet are respectively replaced with the destination port number. The service obtains the source IP address of the data packet and compares the source port number, and on the basis of this, compares the OSI transport layer protocol type of the service bearer data packet with the OSI transport layer protocol type of the replaced service acquisition data packet. . If the comparison result is the same, the service bearer data packet is a response to the data packet obtained by the replaced service. When the data transmission parameter group of the service bearer data packet includes the source IP address B jpr ^ source port number BP2 , the transport layer protocol type X, the destination IP address Aff3, and the destination port number AP3 , the replaced service bearer data The data transmission parameter set of the packet will contain the source IP address B, the source port number Bp2 , the transport layer protocol type X, the destination IP address A, and the destination port number ΑΡ1 .
 应注意,在依据记录的源 IP地址和源端口号替换所述业务承载数据包的目 的 IP地址和目的端口号之后, 地址转换模块 104将记录的源 IP地址和源端口 号删除。 此外, 若返回的业务承载数据包有多个, 则地址转换模块 104在依据 记录的源 IP地址和源端口号对最后一个业务^载数据包的目的 IP地址和目的 端口号进行替换之后, 再将记录的源 IP地址和源端口号删除。It should be noted that after replacing the destination IP address and the destination port number of the service bearer packet according to the recorded source IP address and source port number, the address translation module 104 deletes the recorded source IP address and source port number. In addition, if there are multiple service bearer data packets returned, the address translation module 104 is based on  After the source IP address and source port number of the record are replaced with the destination IP address and destination port number of the last service packet, the source IP address and source port number of the record are deleted.
 业务处理模块 102还用于根据记录的所述业务获取数据包的数据传输参数 组与业务请求数据包的数据传输参数组之间的对应关系, 由替换后的业务承载 数据包的数据传输参数组获得所述业务请求数据包的数据传输参数组, 并根据 替换后的业务承载数据包和所述业务请求数据包的数据传输参数组生成业务应 答数据包, 并发送所述业务应答数据包, 以作为对所述业务请求数据包的应答。 当替换后的业务承载数据包的数据传输参数组包含源 IP地址 B jp2,、 源端口号 BP2,、 传输层协议类型 X,、 目的 IP地址 A JM,和目的端口号 AP1,时, 业务应答数 据包的数据传输参数组将包含 BIP2、 源端口号 BP2、 传输层协议类型 X、 目的 IP地址 A n 和目的端口号 AP1。The service processing module 102 is further configured to obtain, according to the recorded service, a correspondence between a data transmission parameter group of the data packet and a data transmission parameter group of the service request data packet, and a data transmission parameter group of the replaced service bearer data packet. Obtaining a data transmission parameter group of the service request data packet, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sending the service response data packet, to As a response to the service request packet. When the data transmission parameter group of the replaced service bearer packet includes the source IP address B jp2 , the source port number BP2 , the transport layer protocol type X, the destination IP address A JM, and the destination port number AP1 , The data transmission parameter set of the service response data packet will include BIP2 , source port number BP2 , transport layer protocol type X, destination IP address A n and destination port number AP1 .
 具体来说, 业务处理模块 102可根据预先制定的业务控制策略(例如运营 商预先制定的业务控制策略)和 /或用户签约的业务控制策略, 对业务承载数据 包的载荷数据(例如 OSI应用层数据)进行修改, 例如进行协议转换、 内容适 配、 内容过滤等。 当然, 业务处理单元 102也可不对载荷数据进行任何修改, 这取决于预先制定的业务控制策略和 /或用户签约的业务控制策略。 随后, 业务 处理单元 102根据记录的所述业务获取数据包的数据传输参数组与业务请求数 据包的数据传输参数组之间的对应关系, 由所述替换后的业务承载数据包的数 据传输参数组获得所述业务请求数据包的数据传输参数组, 再根据所述业务请 求数据包的数据传输参数组和上述载荷数据生成所述业务应答数据包。 Specifically, the service processing module 102 may load data of the service bearer data according to a pre-defined service control policy (such as a service control policy pre-defined by the operator) and/or a service control policy subscribed by the user (for example, an OSI application layer). Data) is modified, such as protocol conversion, content adaptation, content filtering, and so on. Of course, the service processing unit 102 may also not make any modifications to the payload data, depending on the pre-defined service control policy and/or the user-contracted service control policy. Then, the service processing unit 102 acquires a correspondence between the data transmission parameter group of the data packet and the data transmission parameter group of the service request data packet according to the recorded service, and the data transmission parameter of the replaced service bearer data packet The group obtains a data transmission parameter group of the service request data packet, and generates the service response data packet according to the data transmission parameter group of the service request data packet and the payload data.
 具体来说, 由于业务承载数据包是对替换后的业务获取数据包的应答, 因 此业务承载数据包的数据传输参数组与替换后的业务获取数据包的数据传输参 数组是相互对应的。 例如, 业务承载数据包的源 IP地址和源端口号分别为替换 后的业务获取数据包的目的 IP地址和目的端口号, 业务承载数据包的目的 IP 地址和目的端口号分别为替换后的业务获取数据包的源 IP地址和源端口号,业 务承载数据包的传输层协议类型与替换后的业务获取数据包的传输层协议类型 相同。 在这种情况下, 在依据记录的源 IP地址和源端口号对业务承载数据包的 目的 IP地址和目的端口号进行替换之后,替换后的业务承载数据包的数据传输 参数组必然与业务获取数据包的数据传输参数组相对应。 例如, 替换后的业务 承载数据包的源 IP地址和源端口号为业务获取数据包的目的 IP地址和目的端 口号,替换后的业务承载数据包的目的 IP地址和目的端口号为业务获取数据包 的源 IP地址和源端口号,替换后的业务承载数据包的传输层协议类型与业务获 取数据包的传输层协议类型相同。 这样一来, 便可根据替换后的业务承载数据 包的数据传输参数组与业务获取数据包的数据传输参数组之间的对应关系, 结 合记录的业务请求数据包的数据传输参数组与业务获取数据包的数据传输参数 组之间的对应关系, 由替换后的业务承载数据包的数据传输参数组获得所述业 务请求数据包的数据传输参数组。Specifically, since the service bearer data packet is a response to the replaced service acquisition data packet, the data transmission parameter group of the service bearer data packet and the data transmission parameter group of the replaced service acquisition data packet correspond to each other. For example, the source IP address and the source port number of the service bearer data packet are respectively the destination IP address and the destination port number of the service acquisition data packet, and the destination IP address and the destination port number of the service bearer data packet are respectively replaced services. Obtain the source IP address and source port number of the data packet, the transport layer protocol type of the service bearer data packet, and the transport layer protocol type of the replaced service get data packet.  the same. In this case, after the destination IP address and the destination port number of the service bearer data packet are replaced according to the source IP address and the source port number of the record, the data transmission parameter group of the replaced service bearer data packet is inevitably acquired with the service. The data transmission parameter set of the packet corresponds. For example, the source IP address and the source port number of the service bearer data packet are the destination IP address and the destination port number of the service acquisition data packet, and the destination IP address and the destination port number of the replaced service bearer data packet are service acquisition data. The source IP address and source port number of the packet. The transport layer protocol type of the replaced service bearer packet is the same as the transport layer protocol type of the service get packet. In this way, according to the correspondence between the data transmission parameter group of the replaced service bearer data packet and the data transmission parameter group of the service acquisition data packet, the data transmission parameter group and the service acquisition of the recorded service request data packet are combined. Corresponding relationship between the data transmission parameter groups of the data packet, and the data transmission parameter group of the service request data packet is obtained by the data transmission parameter group of the replaced service bearer data packet.
 本领域的技术人员应当明白, 由于生成的业务应答数据包是对上述业务请 求数据包的应答, 因此业务应答数据包的源 IP地址和源端口号为上述业务请求 数据包的目的 IP地址和目的端口号, 业务应答数据包的目的 IP地址和目的端 口号为上述业务请求数据包的源 IP地址和源端口号,业务应答数据包的传输层 协议类型与业务请求数据包的传输层协议类型相同。 因此, 在生成业务应答数 据包时, 业务处理单元 102使用记录的业务请求数据包的数据传输参数组中的 源 IP地址和源端口号作为所述业务应答数据包的目的 IP地址和目的端口号, 使用记录的业务请求数据包的数据传输参数组中的目的 IP 地址和目的端口号 作为所述业务应答数据包的源 IP地址和源端口号,使用记录的业务请求数据包 的传输层协议类型作为所述业务应答数据包的传输层协议类型。 Those skilled in the art should understand that since the generated service response data packet is a response to the service request data packet, the source IP address and the source port number of the service response data packet are the destination IP address and destination of the service request data packet. The port number, the destination IP address and the destination port number of the service response packet are the source IP address and the source port number of the service request packet, and the transport layer protocol type of the service response packet is the same as the transport layer protocol type of the service request packet. . Therefore, when generating the service response data packet, the service processing unit 102 uses the source IP address and the source port number in the data transmission parameter group of the recorded service request data packet as the destination IP address and the destination port number of the service response data packet. Using the destination IP address and destination port number in the data transmission parameter group of the recorded service request packet as the source IP address and source port number of the service response packet, and using the transport layer protocol type of the recorded service request packet The type of transport layer protocol that is the service response packet.
 此外, 业务处理模块 102还用于根据所述业务应答数据包进行业务处理, 例如进行业务控制操作和 /或计费操作等。 In addition, the service processing module 102 is further configured to perform service processing according to the service response data packet, for example, perform a service control operation and/or a charging operation.
 应注意, 在生成业务应答数据包之后, 业务处理模块 102会将记录的数据 传输参数组删除。 应注意, 若生成的业务应答数据包有多个, 则业务处理模块 It should be noted that after generating the service response data packet, the service processing module 102 deletes the recorded data transmission parameter set. It should be noted that if there are multiple service response data packets generated, the service processing module
102会在最后一个业务应答数据包生成之后, 将记录的数据传输参数组删除。  本发明实施例由业务处理单元执行地址替换操作, 将业务获取数据包的源102 deletes the recorded data transmission parameter set after the last service response packet is generated.  In the embodiment of the present invention, the service processing unit performs an address replacement operation, and the service obtains the source of the data packet.
IP地址和源端口号替换为该业务处理单元配置的 IP地址和端口号,因此作为对 该业务获取数据包的应答的业务承载数据包可直接返回该业务处理单元, 而无 需经负载均衡单元转发。 这样一来, 负载均衡单元便可以仅负责向业务处理单 元分发业务请求数据包, 而不再参与移动终端和业务服务器之间后续业务数据 的转发, 因此可大大降低负载均衡单元的任务量, 由此大大提高负载均衡单元 以及业务控制网关的工作效率。 此外, 负载均衡单元以往执行的转发操作被多 个业务处理单元执行的地址替换操作所取代, 由于业务处理单元数量较多, 并 且有负载均衡单元在多个业务处理单元之间进行负载均衡调度, 因此分摊到每 一业务处理单元上的地址替换操作的任务量并不大, 因此产生性能瓶颈的可能 性要远小于负载均衡单元转发业务应答数据包时可能产生的性能瓶颈, 并且可 以通过简单的增加业务处理单元来进行扩容。The IP address and the source port number are replaced by the IP address and port number configured by the service processing unit. Therefore, the service bearer data packet as a response to the service packet can be directly returned to the service processing unit without being forwarded by the load balancing unit. . In this way, the load balancing unit can only be responsible for distributing the service request data packet to the service processing unit, and no longer participate in the forwarding of the subsequent service data between the mobile terminal and the service server, thereby greatly reducing the workload of the load balancing unit. This greatly improves the efficiency of the load balancing unit and the service control gateway. In addition, the forwarding operation performed by the load balancing unit in the past is replaced by an address replacement operation performed by multiple service processing units. Since the number of service processing units is large, and the load balancing unit performs load balancing scheduling among multiple service processing units, Therefore, the task of the address replacement operation allocated to each service processing unit is not large, so the possibility of generating a performance bottleneck is far less than the performance bottleneck that may occur when the load balancing unit forwards the service response packet, and can be simple. Add a service processing unit to expand capacity.
 图 2是依据本发明一示范性实施例的业务控制网关 200的逻辑结构框图。 如图 2所示, 业务控制网关 200 包括负载均衡单元 202和多个业务处理单元 204〜208, 其中, 每一业务处理单元均配置有至少一个 IP地址。 2 is a block diagram showing the logical structure of a service control gateway 200 in accordance with an exemplary embodiment of the present invention. As shown in FIG. 2, the service control gateway 200 includes a load balancing unit 202 and a plurality of service processing units 204-208, wherein each service processing unit is configured with at least one IP address.
 负载均衡单元 202用于接收业务请求数据包, 根据预先设置的负载均衡策 略在所述多个业务处理单元 204〜208中选择一业务处理单元(例如业务处理单 元 206 )作为目标业务处理单元, 将所述业务请求数据包转发给所述目标业务 处理单元。 应注意, 本领域的技术人员应当明白, 此处所说的转发是指在 OSI 数据链路层上执行的转发, 即将封装有业务请求数据包的帧的源 MAC (媒体访 问控制, Media Access Control )地址修改为负载均衡单元的 MAC地址, 目的 MAC地址修改为业务处理单元的 MAC地址, 从而将该帧从负载均衡单元 202 发送到目标业务处理单元。 The load balancing unit 202 is configured to receive a service request data packet, and select a service processing unit (for example, the service processing unit 206) as the target service processing unit among the plurality of service processing units 204 to 208 according to a preset load balancing policy. The service request data packet is forwarded to the target service processing unit. It should be noted that those skilled in the art should understand that the forwarding referred to herein refers to forwarding performed on the OSI data link layer, that is, the source MAC of the frame in which the service request packet is encapsulated (Media Access Control, Media Access Control) The address is modified to the MAC address of the load balancing unit, and the destination MAC address is modified to the MAC address of the service processing unit, thereby transmitting the frame from the load balancing unit 202 to the target service processing unit.
 具体来说, 在收到业务请求数据包后, 负载均衡单元 202可首先根据所述 业务请求数据包的源 IP地址在负载均衡对应表中查找对应的业务处理单元,在 未找到所述业务处理单元时, 根据所述负载均衡策略在所述多个业务处理单元  204〜208中选择所述业务处理单元作为所述目标业务处理单元, 并将所述目标 业务处理单元与所述源 IP地址之间的对应关系写入所述负载均衡对应表。而在 找到所述业务处理单元时, 将找到的所述业务处理单元作为所述目标业务处理 单元。 在具体实现过程中, 上述负载均衡对应表可采用下列数据结构来实现:Specifically, after receiving the service request data packet, the load balancing unit 202 may first search for a corresponding service processing unit in the load balancing correspondence table according to the source IP address of the service request data packet, where the service processing is not found. Unit, according to the load balancing policy, in the plurality of service processing units  The service processing unit is selected as the target service processing unit from 204 to 208, and the correspondence between the target service processing unit and the source IP address is written into the load balancing correspondence table. And when the service processing unit is found, the found service processing unit is used as the target service processing unit. In the specific implementation process, the foregoing load balancing correspondence table may be implemented by using the following data structures:
 表 1 可选的, 也可在网络接入服务器根据终端设备发出的接入请求向终端设备 分配 IP地址后, 由负载均衡单元针对该 IP地址分配固定的业务处理单元, 并 将该 IP 地址与该业务处理单元之间的对应关系写入上述负载均衡对应表。 例 如, 在网络接入服务器向终端设备分配 IP地址后, 网^^入服务器通过 Radius Table 1 Optionally, after the network access server allocates an IP address to the terminal device according to the access request sent by the terminal device, the load balancing unit allocates a fixed service processing unit for the IP address, and associates the IP address with the IP address. The correspondence between the service processing units is written in the load balancing correspondence table. For example, after the network access server assigns an IP address to the terminal device, the network enters the server through Radius.
(远程拨入用户认证月良务, Remote Authentication Dial In User Service )协议或 者 Diameter (直径)协议将分配的 IP地址发送给业务控制网关中的负载均衡单 元。 在收到该 IP地址之后, 负载均衡单元根据预先设置的负载均衡策略查找合 适的业务处理单元,并将该 IP地址与该业务处理单元之间的对应关系写入负载 均衡对应表。如此一来,在随后接收到来自上述终端设备的业务请求数据包后, 负载均衡单元根据负载均衡对应表中记录的对应关系, 直接将该业务请求数据 包转发给对应的业务处理单元进行处理。 而在终端设备下线时, 网络接入服务 器通过 Radius协议或者 Diameter协议向业务控制网关中的负载均衡单元发送包 含下线终端设备的 IP地址的下线通知,再由负载均衡单元将负载均衡对应表中 该 IP地址与对应业务处理单元之间的对应关系删除。The Remote Authentication Dial In User Service protocol or the Diameter protocol sends the assigned IP address to the load balancing unit in the Service Control Gateway. After receiving the IP address, the load balancing unit searches for a suitable service processing unit according to the preset load balancing policy, and writes the correspondence between the IP address and the service processing unit to the load balancing correspondence table. In this way, after receiving the service request data packet from the terminal device, the load balancing unit directly forwards the service request data packet to the corresponding service processing unit for processing according to the correspondence relationship recorded in the load balancing correspondence table. When the terminal device goes offline, the network access server sends a downline notification including the IP address of the offline terminal device to the load balancing unit in the service control gateway through the Radius protocol or the Diameter protocol, and then the load balancing unit performs load balancing correspondingly. The correspondence between the IP address and the corresponding service processing unit in the table is deleted.
 在具体实现过程中, 负载均衡单元 202可采用任意的负载均衡策略在业务 处理单元 204〜208中选择合适的业务处理单元作为目标业务处理单元。 例如, 上述负载均衡策略可以是在业务处理单元 204〜208中选择负载最小(当前任务 数最少) 的业务处理单元作为目标业务处理单元。 此外, 上述负载均衡策略还 可以是在业务处理单元 204〜208 中选择当前负载与额定负载比值小于预设阀 值的业务处理单元作为目标业务处理单元。 若当前负载与额定负载比值小于预 设阀值的业务处理单元有多个, 则可采用随机选取的方式从当前负载与额定负 载比值小于预设阀值的多个业务处理单元中选择一业务处理单元作为目标业务 处理单元。In a specific implementation process, the load balancing unit 202 may select an appropriate service processing unit as the target service processing unit in the service processing units 204 to 208 by using any load balancing policy. For example, the above load balancing policy may be that the load is selected in the service processing units 204 to 208 (current task)  The least number of business processing units serve as the target business processing unit. In addition, the load balancing policy may be that the service processing units 204 to 208 select a service processing unit whose current load and rated load ratio are less than a preset threshold as the target service processing unit. If there are multiple service processing units whose current load and rated load ratio are less than the preset threshold, a random selection method may be used to select a service processing from multiple service processing units whose current load and rated load ratio are less than a preset threshold. The unit acts as the target business processing unit.
 此外, 在执行负载均衡操作时, 负载均衡单元 202可以是 OSI传输层负载 均衡单元, 也可以是 OSI应用层负载均衡单元。 OSI传输层负载均衡单元主要 分析业务请求数据包的源 IP地址和 /或目的 IP地址及传输层 TCP( Transmission Control Protocol, 传输控制协议) /UDP ( User Datagram Protocol, 用户数据报 协议) 的信息, 以便对业务请求数据包进行均衡分发; OSI应用层负载均衡单 元除支持 OSI传输层负载均衡单元的功能以外, 还要分析具体业务所关心的应 用层信息来对业务请求数据包进行均衡分发,例如解析 Radius或 Diameter协议 报文中的用户标识及用户设备 IP地址、 HTTP ( Hypertext Transfer Protocol, 超 文本传输协议)报文中的 URI (统一资源标识符)或 Cookie (用户名密码信息) 等信息, 以便对业务请求数据包进行均衡分发。 In addition, when performing load balancing operations, the load balancing unit 202 may be an OSI transport layer load balancing unit or an OSI application layer load balancing unit. The OSI transport layer load balancing unit mainly analyzes the source IP address and/or the destination IP address of the service request packet and the transmission layer protocol (Transmission Control Protocol) / UDP (User Datagram Protocol) information. In order to distribute the service request data packet in a balanced manner, the OSI application layer load balancing unit not only supports the function of the OSI transport layer load balancing unit, but also analyzes the application layer information of the specific service to perform balanced distribution of the service request data packet, for example, Parsing the user ID and the user device IP address in the Radius or Diameter protocol packets, the URI (Uniform Resource Identifier) in the HTTP (Hypertext Transfer Protocol) message, or the cookie (user name and password information). In order to distribute the service request packets in a balanced manner.
 所述目标业务处理单元用于: The target service processing unit is configured to:
 接收业务请求数据包, 根据所述业务请求数据包生成业务获取数据包, 并 记录所述业务获取数据包的数据传输参数组与业务请求数据包的数据传输参数 组之间的对应关系; Receiving a service request data packet, generating a service acquisition data packet according to the service request data packet, and recording a correspondence between a data transmission parameter group of the service acquisition data packet and a data transmission parameter group of the service request data packet;
 具体来说, 所述目标业务处理单元用于根据预先设置的业务策略, 使用所 述业务请求数据包生成所述业务获取数据包。 此外, 所述数据传输参数组包括 源 IP地址、 源端口号、 目的 IP地址、 目的端口号和传输层协议类型。 Specifically, the target service processing unit is configured to generate the service acquisition data packet by using the service request data packet according to a preset service policy. In addition, the data transmission parameter group includes a source IP address, a source port number, a destination IP address, a destination port number, and a transport layer protocol type.
 记录所述业务获取数据包的数据传输参数组中的源 IP地址和源端口号,在 所述至少一个 IP地址和多个端口号中分别选择一 IP地址和一端口号来对所述 业务获取数据包的数据传输参数组中的源 IP地址和源端口号进行替换,记录替 换后的业务获取数据包的数据传输参数组与所述记录的源 IP 地址和源端口号 之间的对应关系, 并发出替换后的业务获取数据包, 其中, 替换后的业务获取 数据包的数据传输参数组是唯一的; 以及接收作为对替换后的业务获取数据包 的应答的业务承载数据包, 根据所述记录的替换后的业务获取数据包的数据传 输参数组与所述记录的源 IP地址和源端口号之间的对应关系, 由所述业务承载 数据包的数据传输参数组获得所述记录的源 IP地址和源端口号,依据记录的源 IP地址和源端口号替换所述业务承载数据包的目的 IP地址和目的端口号;Recording a source IP address and a source port number in the data transmission parameter group of the service acquisition data packet, and selecting an IP address and a port number in the at least one IP address and the multiple port numbers to obtain the service The source IP address and the source port number in the data transmission parameter group of the data packet are replaced, and the record is replaced.  And the exchanged service obtains the correspondence between the data transmission parameter group of the data packet and the source IP address and the source port number of the record, and sends the replaced service acquisition data packet, where the replaced service obtains the data packet. The data transmission parameter set is unique; and receiving a service bearer data packet as a response to the replaced service acquisition data packet, and acquiring a data transmission parameter group of the data packet and the source of the record according to the recorded replaced service Corresponding relationship between the IP address and the source port number, the source IP address and the source port number of the record are obtained by the data transmission parameter group of the service bearer data packet, and the source IP address and the source port number are replaced according to the recorded source IP address and the source port number. The destination IP address and destination port number of the service bearer packet;
 具体来说, 根据记录的所述业务获取数据包的数据传输参数组与业务请求 数据包的数据传输参数组之间的对应关系, 根据替换后的业务承载数据包的数 据传输参数组获得所述业务请求数据包的数据传输参数组, 并根据替换后的业 务承载数据包和所述业务请求数据包的数据传输参数组生成业务应答数据包, 并发送所述业务应答数据包, 以作为对所述业务请求数据包的应答。 Specifically, the corresponding relationship between the data transmission parameter group of the service acquisition data packet and the data transmission parameter group of the service request data packet is obtained according to the data transmission parameter group of the replaced service bearer data packet. a data transmission parameter group of the service request data packet, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sending the service response data packet to serve as a The response of the service request packet.
 目标业务处理单元相关操作的细节内容已经在图 1 中进行了详细的描述, 因此此处不再赘述。 The details of the operations related to the target service processing unit have been described in detail in FIG. 1, and therefore will not be described herein.
 应注意, 虽然图 2所示的业务控制网关仅包含三个业务处理单元, 但是本 领域的技术人员应当明白, 在具体实现过程中, 业务处理单元的数量可根据具 体的业务量随意设置。 因此, 图 2所示业务处理单元的数量仅用于举例, 而并 非用于限制本发明的范围。 It should be noted that although the service control gateway shown in FIG. 2 includes only three service processing units, those skilled in the art should understand that in a specific implementation process, the number of service processing units can be arbitrarily set according to a specific traffic volume. Thus, the number of service processing units shown in Figure 2 is for example only and is not intended to limit the scope of the invention.
 在现有业务控制网关中, 缺乏将业务承载数据包直接返回业务处理单元的 有效手段, 因此必须由负载均衡单元对业务请求数据包的源 IP地址与业务处理 单元之间的对应关系进行记录并根据该对应关系进行转发, 才能使作为对业务 获取数据包(业务获取数据包是根据业务请求数据包生成的) 的应答的业务承 载数据包被发送到对应的业务处理单元。 而在本发明实施例中, 通过将业务获 取数据包的源 IP地址和源端口号修改为业务处理单元配置的 IP地址和端口号, 作为对业务获取数据包的应答的业务承载数据包可直接返回业务处理单元, 而 无需经负载均衡单元进行转发。 如此一来便可降低负载均衡单元的处理量, 提 高整个业务控制网关的工作效率。In the existing service control gateway, there is no effective means for directly returning the service bearer data packet to the service processing unit. Therefore, the load balancing unit must record the correspondence between the source IP address of the service request data packet and the service processing unit. According to the correspondence, the service bearer data packet that is a response to the service acquisition data packet (the service acquisition data packet is generated according to the service request data packet) is transmitted to the corresponding service processing unit. In the embodiment of the present invention, by changing the source IP address and the source port number of the service acquisition data packet to the IP address and port number configured by the service processing unit, the service bearer data packet as a response to the service acquisition data packet may be directly Return to the business processing unit without forwarding via the load balancing unit. In this way, the processing capacity of the load balancing unit can be reduced,  High overall business control gateway efficiency.
 本发明实施例负载均衡单元在分发业务请求数据包时, 首先在负载均衡单 元中查找是否存在业务请求数据包的源 IP地址对应的业务处理单元,并在找到 对应的业务处理单元时,将业务请求数据包发往找到的业务处理单元进行处理。 如此一来, 来自同一终端设备(由源 IP地址标识)的所有业务请求数据包将交 由同一业务处理单元进行处理, 从而有助于简化对终端设备进行的业务控制。 例如, 在由本发明实施例提供的业务控制网关对终端设备的业务访问行为进行 计费时, 通过将来自同一终端设备的所有业务请求数据包交由同一业务处理单 元进行处理, 可有效解决由不同业务处理单元处理来自同一终端设备的不同业 务请求数据包时产生的计费操作需同步的问题,方便对业务设备进行统一计费。 When the service equalization unit distributes the service request data packet, the load balancing unit first searches the load balancing unit for the service processing unit corresponding to the source IP address of the service request data packet, and when the corresponding service processing unit is found, the service is used. The request packet is sent to the found service processing unit for processing. In this way, all service request packets from the same terminal device (identified by the source IP address) will be processed by the same service processing unit, thereby facilitating the simplified service control of the terminal device. For example, when the service control gateway provided by the embodiment of the present invention charges the service access behavior of the terminal device, by processing all the service request data packets from the same terminal device to the same service processing unit, the difference can be effectively solved. When the service processing unit processes different service request data packets from the same terminal device, the charging operation needs to be synchronized, which facilitates unified charging of the service device.
 图 3是依据本发明一示范性实施例的业务控制网关的应用场景 300的示意 图。 如图 3所示, 应用场景 300中示出了终端设备 302〜304, 通信网络 306, 业务控制网关 308和业务服务器 310〜314。 其中, 终端设备 302〜304以及业 务服务器 310〜314均通过通信网络 306与业务控制网关 308通信连接,业务控 制网关 308进一步包括负载均衡单元 3082以及业务处理单元 3084〜3088。 FIG. 3 is a schematic diagram of an application scenario 300 of a service control gateway, in accordance with an exemplary embodiment of the present invention. As shown in FIG. 3, terminal devices 302-304, communication network 306, service control gateway 308, and service servers 310-314 are shown in application scenario 300. The terminal devices 302-304 and the service servers 310-314 are all connected to the service control gateway 308 through the communication network 306. The service control gateway 308 further includes a load balancing unit 3082 and service processing units 3084~3088.
 终端设备 302〜304之中的每一个用于发出业务请求数据包。有关终端设备 生成并发出业务请求数据包以及该业务请求数据包中数据传输参数组的具体细 节内容已经在上文结合图 1的描述中进行了详细的描述, 因此此处不再赘述。 Each of the terminal devices 302 to 304 is for issuing a service request packet. The specific details of the terminal device generating and issuing the service request data packet and the data transmission parameter group in the service request data packet have been described in detail in the above description with reference to FIG. 1, and therefore will not be described herein.
 业务控制网关 308用于接收业务请求数据包,由其负载均衡单元 3082将该 业务请求数据包转发给业务处理单元 3084〜3088中一业务处理单元进行处理, 由该业务处理单元生成业务获取数据包, 并由该业务处理单元将该业务获取数 据包发往业务服务器 310〜314其中之一。其中, 业务处理单元生成的业务获取 数据包的源 IP地址和源端口号为该业务处理单元配置的 IP地址和端口号。 有 关负载均衡单元 3082转发业务请求数据包,以及业务处理单元对业务请求数据 包进行处理、 生成业务获取数据包的内容已经在前文结合图 1和图 2进行了详 细的描述, 因此此处不再赘述。  业务服务器 310〜314之中接收上述业务获取数据包的业务服务器用于对 该业务获取数据包进行处理, 生成作为应答的业务承载数据包。 由于业务获取 数据包的源 IP地址和源端口号为业务处理单元所配置的 IP地址和端口号, 因 此业务承载数据包的目的 IP 地址和目的端口号就是上述业务处理单元所配置 的上述 IP地址和端口号。 这样一来, 该业务承载数据包将直接到达上述业务处 理单元, 而无需经过负载均衡单元 3082进行转发。上述业务处理单元在根据上 述业务承载数据包生成业务应答数据包后,将该业务应答数据包返回终端设备。 有关业务处理单元对业务承载数据包进行的处理已经在前文结合图 1和图 2进 行了详细的描述, 因此此处不再赘述。The service control gateway 308 is configured to receive the service request data packet, and the load balancing unit 3082 forwards the service request data packet to a service processing unit in the service processing unit 3084~3088 for processing, and the service processing unit generates a service acquisition data packet. And the service processing unit sends the service acquisition data packet to one of the service servers 310-314. The source IP address and the source port number of the service acquisition data packet generated by the service processing unit are the IP address and port number configured by the service processing unit. The content that the load balancing unit 3082 forwards the service request data packet and the service processing unit processes the service request data packet and generates the service acquisition data packet has been described in detail in the foregoing with reference to FIG. 1 and FIG. 2, so Narration.  The service server that receives the service acquisition data packet among the service servers 310 to 314 is configured to process the service acquisition data packet to generate a service bearer data packet as a response. The source IP address and the source port number of the service data packet are the IP address and port number configured by the service processing unit. Therefore, the destination IP address and destination port number of the service bearer data packet are the foregoing IP address configured by the service processing unit. And port number. In this way, the service bearer data packet will directly reach the service processing unit without being forwarded by the load balancing unit 3082. After the service processing unit generates the service response data packet according to the service bearer data packet, the service processing unit returns the service response data packet to the terminal device. The processing performed by the service processing unit on the service bearer data packet has been described in detail in the foregoing with reference to FIG. 1 and FIG. 2, and therefore will not be described herein.
 应注意, 虽然图 3所示的应用场景 300中仅示出了两个终端设备, 三个业 务服务器, 且业务控制网关仅包含三个业务处理单元, 但是本领域的技术人员 应当明白, 在具体实现过程中, 终端设备和业务服务器的数量均没有具体的限 制, 业务处理单元的数量也可根据具体的业务量随意设置。 因此, 图 3所示的 应用场景 300中终端设备、 业务服务器以及业务控制网关中的业务处理单元的 具体数量仅用于举例, 而并非用于限制本发明的范围。 It should be noted that although only two terminal devices, three service servers are shown in the application scenario 300 shown in FIG. 3, and the service control gateway includes only three service processing units, those skilled in the art should understand that During the implementation process, there is no specific limit on the number of terminal devices and service servers, and the number of service processing units can also be arbitrarily set according to specific traffic. Therefore, the specific number of service processing units in the terminal device, the service server, and the service control gateway in the application scenario 300 shown in FIG. 3 is for example only, and is not intended to limit the scope of the present invention.
 图 4是依据本发明一示范性实施例的业务处理方法 400的流程图。 业务处 理方法 400与图 1中描述的业务处理单元相对应。 4 is a flow diagram of a service processing method 400 in accordance with an exemplary embodiment of the present invention. The business process method 400 corresponds to the business process unit depicted in FIG.
 步骤 402, 业务处理模块接收来自终端设备的业务请求数据包; Step 402: The service processing module receives a service request data packet from the terminal device.
 具体来说, 步骤 402还可进一步包括, 业务处理模块根据所述业务请求数 据包执行业务处理操作。 Specifically, the step 402 may further include: the service processing module performing a service processing operation according to the service request data packet.
 步骤 404, 业务处理模块根据所述业务请求数据包生成业务获取数据包, 并记录所述业务获取数据包的数据传输参数组与业务请求数据包的数据传输参 数组之间的对应关系; Step 404: The service processing module generates a service acquisition data packet according to the service request data packet, and records a correspondence between a data transmission parameter group of the service acquisition data packet and a data transmission parameter array of the service request data packet.
 具体来说, 业务处理模块根据预先设置的业务策略, 使用所述业务请求数 据包生成所述业务获取数据包。 Specifically, the service processing module generates the service acquisition data packet by using the service request data packet according to a preset service policy.
 此外, 所述数据传输参数组包括源 IP地址、 源端口号、 目的 IP地址、 目 的端口号和传输层协议类型In addition, the data transmission parameter group includes a source IP address, a source port number, a destination IP address, and a destination.  Port number and transport layer protocol type
 步骤 406, 地址转换模块记录所述业务获取数据包的数据传输参数组中的 源 IP地址和源端口号; Step 406: The address conversion module records a source IP address and a source port number in a data transmission parameter group of the service acquisition data packet.
 步骤 408, 地址转换模块根据配置的至少一个 IP地址和多个端口号中分别 选择一 IP地址和一端口号对所述业务获取数据包的数据传输参数组中的源 IP 地址和源端口号进行替换, 并发出替换后的业务获取数据包到业务服务器, 其 中, 替换后的业务获取数据包的数据传输参数组是唯一的; Step 408: The address translation module selects an IP address and a port number according to the configured at least one IP address and the plurality of port numbers, and performs source IP address and source port number in the data transmission parameter group of the service acquisition data packet. Substituting, and issuing the replaced service to obtain the data packet to the service server, where the data transmission parameter group of the replaced service acquisition data packet is unique;
 步骤 410, 地址转换模块从业务服务器接收作为对替换后的业务获取数据 包的应答的业务承载数据包, 根据所述记录的替换后的业务获取数据包的数据 传输参数组与所述记录的源 IP地址和源端口号之间的对应关系,由所述业务承 载数据包的数据传输参数组获得所述记录的源 IP地址和源端口号,依据记录的 源 IP地址和源端口号替换所述业务^ ^载数据包的目的 IP地址和目的端口号; 步骤 412, 业务处理模块根据记录的所述业务获取数据包的数据传输参数 组与业务请求数据包的数据传输参数组之间的对应关系, 由替换后的业务承载 数据包的数据传输参数组获得所述业务请求数据包的数据传输参数组, 并根据 替换后的业务承载数据包和所述业务请求数据包的数据传输参数组生成业务应 答数据包, 并发送所述业务应答数据包给终端设备, 以作为对所述业务请求数 据包的应答。 Step 410: The address translation module receives, from the service server, a service bearer data packet that is a response to the replaced service acquisition data packet, and obtains a data transmission parameter group of the data packet according to the recorded replaced service and the source of the record. Corresponding relationship between the IP address and the source port number, the source IP address and the source port number of the record are obtained by the data transmission parameter group of the service bearer data packet, and the source IP address and the source port number are replaced according to the recorded source IP address and the source port number. The service ^ ^ carries the destination IP address and the destination port number of the data packet; Step 412: The service processing module acquires the correspondence between the data transmission parameter group of the data packet and the data transmission parameter group of the service request data packet according to the recorded service Obtaining, by the data transmission parameter group of the replaced service bearer data packet, a data transmission parameter group of the service request data packet, and generating a service according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet Responding to the data packet, and sending the service response data packet to the terminal device Service request response data packet.
 具体来说, 步骤 412还可进一步包括, 业务处理模块根据替换后的业务应 答数据包执行业务处理操作。 Specifically, the step 412 may further include: the service processing module performing a service processing operation according to the replaced service response data packet.
 业务处理方法 400各步骤的细节内容已经在前文结合图 1进行的描述中进 行了详细的介绍, 因此此处不再赘述。 The details of each step of the service processing method 400 have been described in detail in the foregoing description with reference to Fig. 1, and therefore will not be described again here.
 图 5是依据本发明一示范性实施例的负载均衡方法 500的流程图。 负载均 衡方法 500应用于图 2中描述的业务控制网关。 如上文所述, 业务控制网关包 含负载均衡单元和多个业务处理单元, 其中, 每一业务处理单元配置有至少一 个 IP地址。  步骤 502, 负载均衡单元接收业务请求数据包, 根据预先设置的负载均衡 策略在所述多个业务处理单元中选择一业务处理单元作为目标业务处理单元, 将所述业务请求数据包转发给所述目标业务处理单元;FIG. 5 is a flow diagram of a load balancing method 500 in accordance with an exemplary embodiment of the present invention. The load balancing method 500 is applied to the traffic control gateway depicted in FIG. As described above, the service control gateway includes a load balancing unit and a plurality of service processing units, wherein each of the service processing units is configured with at least one IP address.  Step 502: The load balancing unit receives the service request data packet, selects a service processing unit among the multiple service processing units as the target service processing unit according to the preset load balancing policy, and forwards the service request data packet to the Target business processing unit;
 具体来说, 步骤 502还可进一步包括, 负载均衡单元根据所述业务请求数 据包的源 IP地址在负载均衡对应表中查找对应的业务处理单元,在未找到所述 业务处理单元时, 根据所述负载均衡策略在所述多个业务处理单元中选择所述 业务处理单元作为所述目标业务处理单元, 并将所述目标业务处理单元与所述 源 IP地址之间的对应关系写入所述负载均衡对应表。 负载均衡单元在所述负载 均衡对应表中找到所述业务处理单元时, 将所述业务处理单元作为所述目标业 务处理单元。 Specifically, the step 502 may further include: the load balancing unit searching for the corresponding service processing unit in the load balancing correspondence table according to the source IP address of the service request data packet, where the service processing unit is not found, according to the The load balancing policy selects the service processing unit as the target service processing unit among the plurality of service processing units, and writes a correspondence between the target service processing unit and the source IP address into the Load balancing correspondence table. When the load balancing unit finds the service processing unit in the load balancing correspondence table, the service processing unit is used as the target service processing unit.
 步骤 504, 目标业务处理单元接收来自负载均衡单元的业务请求数据包; 步骤 506, 目标业务处理单元根据所述业务请求数据包生成业务获取数据 包, 并记录所述业务获取数据包的数据传输参数组与业务请求数据包的数据传 输参数组之间的对应关系; Step 504: The target service processing unit receives the service request data packet from the load balancing unit. Step 506: The target service processing unit generates a service acquisition data packet according to the service request data packet, and records a data transmission parameter of the service acquisition data packet. The correspondence between the group and the data transmission parameter group of the service request packet;
 具体来说, 目标业务处理单元根据预先设置的业务策略, 使用所述业务请 求数据包生成所述业务获取数据包。 Specifically, the target service processing unit generates the service acquisition data packet by using the service request data packet according to a preset service policy.
 此外, 所述数据传输参数组包括源 IP地址、 源端口号、 目的 IP地址、 目 的端口号和传输层协议类型。 In addition, the data transmission parameter group includes a source IP address, a source port number, a destination IP address, a destination port number, and a transport layer protocol type.
 步骤 508, 目标业务处理单元记录业务获取数据包的数据传输参数组中的 源 IP地址和源端口号; Step 508: The target service processing unit records a source IP address and a source port number in a data transmission parameter group of the service acquisition data packet.
 步骤 510, 目标业务处理单元在所述至少一个 IP地址和多个端口号中分别 选择一 IP 地址和一端口号来对所述业务获取数据包的数据传输参数组中的源 IP地址和源端口号进行替换, 记录替换后的业务获取数据包的数据传输参数组 与所述记录的源 IP地址和源端口号之间的对应关系,并发出替换后的业务获取 数据包到业务服务器, 其中, 替换后的业务获取数据包的数据传输参数组是唯 一的;  步骤 512, 目标业务处理单元接收作为对替换后的业务获取数据包的应答 的业务承载数据包, 根据所述记录的替换后的业务获取数据包的数据传输参数 组与所述记录的源 IP地址和源端口号之间的对应关系, 由所述业务承载数据包 的数据传输参数组获得所述记录的源 IP地址和源端口号, 依据记录的源 IP地 址和源端口号替换所述业务承载数据包的目的 IP地址和目的端口号;Step 510: The target service processing unit selects an IP address and a port number in the at least one IP address and the multiple port numbers respectively to obtain a source IP address and a source port in a data transmission parameter group of the data packet. The replacement is performed, and the correspondence between the data transmission parameter group of the service acquisition data packet and the source IP address and the source port number of the record is recorded, and the replaced service acquisition data packet is sent to the service server, where The data transmission parameter set of the replaced service acquisition data packet is unique;  Step 512: The target service processing unit receives a service bearer data packet as a response to the replaced service data packet, and obtains a data transmission parameter group of the data packet and the source IP address of the record according to the recorded replaced service. Corresponding to the source port number, the source IP address and the source port number of the record are obtained by the data transmission parameter group of the service bearer data packet, and the service bearer is replaced according to the source IP address and the source port number of the record. Destination IP address and destination port number of the packet;
 步骤 514, 目标业务处理单元根据记录的所述业务获取数据包的数据传输 参数组与业务请求数据包的数据传输参数组之间的对应关系, 由替换后的业务 承载数据包的数据传输参数组获得所述业务请求数据包的数据传输参数组, 并 根据替换后的业务承载数据包和所述业务请求数据包的数据传输参数组生成业 务应答数据包, 并发送所述业务应答数据包到终端设备, 以作为对所述业务请 求数据包的应答。 Step 514: The target service processing unit acquires a correspondence between a data transmission parameter group of the data packet and a data transmission parameter group of the service request data packet according to the recorded service, and the data transmission parameter group of the replaced service bearer data packet Obtaining a data transmission parameter group of the service request data packet, and generating a service response data packet according to the replaced service bearer data packet and the data transmission parameter group of the service request data packet, and sending the service response data packet to the terminal The device, in response to the service request packet.
 负载均衡方法 500各步骤的细节内容已经在前文结合图 2进行的描述中进 行了详细的介绍, 因此此处不再赘述。 The details of each step of the load balancing method 500 have been described in detail in the foregoing description with reference to Fig. 2, and therefore will not be described again here.
 应注意, 尽管上述实施例都是以终端设备向业务服务器发起业务请求为例 进行描述的, 但是本领域的技术人员应当明白, 对业务服务器主动向终端设备 发起服务请求的情形, 本发明实施例提供的技术方案也同样适用。 It should be noted that although the above embodiments are described by taking the terminal device as a service request to the service server, the person skilled in the art should understand that the service server actively initiates a service request to the terminal device, and the embodiment of the present invention The technical solutions provided are also applicable.
 本领域普通技术人员可知, 上述方法中的全部或部分步骤可以通过程序指 令相关的硬件完成, 该程序可以存储于一计算机可读存储介质中, 该计算机可 读存储介质如 ROM、 RAM和光盘等。 A person skilled in the art may know that all or part of the above steps may be completed by hardware related to program instructions, and the program may be stored in a computer readable storage medium such as a ROM, a RAM, an optical disc, or the like. .
 综上所述, 以上仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。 In conclusion, the above is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.