WO2016180188A1 - Distributed link establishment method, apparatus and system - Google Patents

Distributed link establishment method, apparatus and system Download PDF

Info

Publication number
WO2016180188A1
WO2016180188A1 PCT/CN2016/079674 CN2016079674W WO2016180188A1 WO 2016180188 A1 WO2016180188 A1 WO 2016180188A1 CN 2016079674 W CN2016079674 W CN 2016079674W WO 2016180188 A1 WO2016180188 A1 WO 2016180188A1
Authority
WO
WIPO (PCT)
Prior art keywords
link
distribution
chain
service node
service
Prior art date
Application number
PCT/CN2016/079674
Other languages
French (fr)
Chinese (zh)
Inventor
李剑鹏
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016180188A1 publication Critical patent/WO2016180188A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • This paper relates to the field of distribution chain building technology, and in particular to a distribution chain building method, device and system.
  • HLR Home Location Register
  • IMS IP Multimedia Subsystem
  • the server cluster plans the access users in advance according to the user's IP address and port number range, and can evenly distribute the user's service requirements to each service node in the cluster for processing.
  • the server cluster forwards the user's link establishment request to the corresponding service node according to the user's IP address and port number range according to the prior planning, and the service node provides the service.
  • the IMS server cannot allocate the service node according to the IP address of the mobile terminal, which may cause the mobile terminal to fail.
  • the load of the service requests processed by the service nodes of the IMS server is seriously unbalanced, and some service nodes are running at full capacity, some service nodes are vacant, waste resources, and the whole is reduced. The responsiveness of the core network.
  • the main object of the present invention is to provide a distribution chain building method, device and system, aiming at solving In the related art, the server cluster has an unbalanced load and a slow response.
  • a distribution chain building method comprising the following steps:
  • the legal link request message is forwarded to the service node with the least load to establish a chain.
  • the method before the step of receiving the link establishment request message of the initiator, the method further includes:
  • the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
  • the dynamic load parameter of the service node is obtained, and the load sharing table is generated.
  • the method further includes:
  • the distribution link information is stored, and a distribution session table is generated, where the distribution session table is used for distribution of subsequent messages of the initiator.
  • the method further includes:
  • the service node that has been linked with the initiator is obtained according to the session, and the legal link request message is forwarded to the obtained
  • the service node performs chain building
  • the step of forwarding the legal chain-building request packet to the service node with the least load is performed according to the preset load sharing table.
  • a distribution chain building device comprising a receiving module, a screening module and a forwarding module, wherein
  • the receiving module is configured to: receive a link establishment request message of the initiator end;
  • the filtering module is configured to: obtain a legal connection request packet of the destination address and the destination port from the link request packet according to the preset dynamic segmentation;
  • the forwarding module is configured to: forward the legal link request message to the service node with the least load to establish a chain according to the preset load sharing table.
  • the distribution chaining device further includes a deployment module and an acquisition module, where
  • the deployment module is configured to: deploy the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
  • the acquiring module is configured to: acquire dynamic load parameters of each service node, and generate the load sharing table.
  • the distribution chaining device further includes a storage module, wherein
  • the storage module is configured to: store the current distribution link information, and generate a distribution session table, where the distribution session table is used for distribution of subsequent messages of the initiator.
  • the distribution chaining device further includes a determination module, wherein
  • the determining module is configured to: determine, according to the distribution session table, whether the originating end has been built;
  • the forwarding module is further configured to: if the originating end performs chain building, obtain a service node that has been linked with the originating end according to the session, and obtain the legal chain-building request The packet is forwarded to the obtained service node for chain construction; if the originating end is not chained, the legal chain-building request packet is forwarded to the service with the least load according to the preset load sharing table. The node is built.
  • a distribution chain building system includes an initiator and a server, wherein:
  • the initiator is configured to: send a link request message
  • the server includes an access side and a service side;
  • the access side includes any of the above-mentioned distribution and chain building devices
  • the service side is configured to: receive the link establishment request message, and establish a link with the initiator end.
  • the service side includes:
  • At least one service node at least one of the service nodes is configured to: send a dynamic load parameter to the access side, receive a link establishment request message forwarded by the access side, and according to the link establishment request message
  • the initiator is configured to receive a subsequent packet of the originating end forwarded by the access side.
  • the method, device and system for distributing and establishing a link receive a link request message of the originating end through the access side of the server cluster; and obtain the destination address from the link request message according to the preset dynamic sub-publishing A valid request for establishing a link with the destination port. Then, according to the preset load sharing table, the legal chain-building request packet is forwarded to the service node with the least load to establish a chain. Distribution.
  • the technical solution of the invention realizes the uniform distribution of the link requesting packets, thereby balancing the load of the service nodes of the server cluster, avoiding waste of resources caused by load imbalance, reducing the burden of the server cluster, and accelerating the server cluster. The responsiveness enhances the overall performance of the server cluster and gives users a better business experience.
  • FIG. 1 is a schematic flow chart of a first embodiment of a method for distributing and constructing a chain according to the present invention
  • FIG. 2 is a schematic flow chart of a second embodiment of a method for distributing and constructing a chain according to the present invention
  • FIG. 3 is a schematic flowchart of a third embodiment of a method for distributing and constructing a chain according to the present invention.
  • FIG. 4 is a schematic flowchart of a fourth embodiment of a method for distributing and constructing a chain according to the present invention.
  • FIG. 5 is a schematic diagram of functional modules of a first embodiment of a distribution chain building device of the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a second embodiment of a distribution chain building device of the present invention.
  • FIG. 7 is a schematic diagram of functional modules of a third embodiment of a distribution chain building device of the present invention.
  • FIG. 8 is a schematic diagram of functional modules of a fourth embodiment of a distribution chain building device of the present invention.
  • FIG. 9 is a schematic block diagram of a first embodiment of a distribution chain building system of the present invention.
  • FIG. 10 is a schematic diagram of an application scenario for a mobile phone client to request a service from an IMS core network according to an embodiment of the present invention
  • Figure 11 is a block diagram showing a second embodiment of the distribution chain building system of the present invention.
  • the main solution of the embodiment of the present invention is: receiving a link establishment request message of the originating end; and obtaining a legal link establishment request message of the destination address and the destination port from the link establishment request message according to the preset dynamic sub-publishing; According to the preset load sharing table, the legal link request message is forwarded to the service node with the least load to establish a chain.
  • the server cluster may fail to access or the load of each service node is unbalanced, resulting in slow service response and affecting the user experience.
  • the present invention provides a solution for the server cluster access side to uniformly distribute the link establishment request to each service node without knowing the address and port information of the initiator, thereby realizing load balancing of the service nodes of the server cluster. Improve the overall response speed of the server.
  • a first embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and building a chain, and the method for distributing and building a chain includes:
  • Step S10 Receive a link establishment request message of the initiator.
  • the embodiments of the present invention are mainly applied to a distributed system, and a user accesses a service cluster by establishing a chain with a server cluster.
  • the application scenario of the present invention may be that the user terminal initiates the establishment of the link-in service cluster, and the third-party server may initiate the establishment of the link-in service cluster, or may be the terminal-building access service of the service cluster intranet, and may be flexibly applied according to actual needs.
  • a PCT link is established between a user client and a core network, and the core network is accessed.
  • Bright the application scenario of the present invention is not limited to the PCT chain.
  • the client When the client needs to obtain the services of the core network, the client needs to establish a PCT link with the core network as the initiator.
  • the access side of the core network server cluster receives the link establishment request packet, and distributes the link establishment request message to the service node for establishing a link and providing a service.
  • the initiator sends a TCP SYN (synchronous) message to establish a link.
  • TCP SYN synchronous
  • the TCP SYN packet carries the local address of the originating end, the local port, and the destination address and destination port of the current link. It can also carry other information, such as this service request, and can be flexibly set according to actual needs.
  • the initiator can use WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or 3G.
  • WiMax Worldwide Interoperability for Microwave Access
  • WLAN Wireless Local Area Networks
  • HSPDA High Speed Downlink Packet Access
  • network cable or 3G.
  • the communication technology communicates with the core network and accesses the core network.
  • the access side receives the TCP SYN packet from the initiator. It should be noted that the access side may be a PC (personal computer), an interface board, or other devices with network packet forwarding capabilities, which can be flexibly set according to actual needs.
  • PC personal computer
  • interface board or other devices with network packet forwarding capabilities, which can be flexibly set according to actual needs.
  • Step S20 According to the preset dynamic sub-publishing, obtain a legal chain-building request message of the destination address and the destination port from the link-building request message.
  • the access side After receiving the TCP SYN packet from the initiating end, the access side resolves the TCP SYN of the initiating end, and obtains the destination address and destination port of the initiating link of the initiating end to determine whether the current TCP SYN packet is legal.
  • the access side preset has dynamic sub-publishing, and the dynamic sub-publishing records the destination address and destination port of the core network allowing access services.
  • the access side publishes the pre-deployed dynamic sub-distribution, and queries whether the destination address and destination port of the current TCP SYN packet are in dynamic sub-publishing.
  • the TCP SYN packet is invalid and discarded.
  • the TCP SYN packet is valid and can continue to be built.
  • the access side obtains a legitimate link request message of the destination address and the destination port.
  • Step S30 Forward the legal link request message to the service node with the least load according to the preset load sharing table to establish a chain.
  • the access side After the access side obtains a valid TCP SYN packet, the access side needs to forward the TCP SYN packet to the service node for chain establishment.
  • the access side queries the preset load sharing table.
  • the load sharing table is dynamically generated, and the load status of each service node in the cluster is recorded, and the dynamic update is performed in real time.
  • the access side selects the service node with the lowest current load.
  • the access side adopts a load sharing policy, and forwards the current TCP SYN packet to the selected service node to complete the distribution of the link establishment request message, and the selected service node performs TCP negotiation with the initiator.
  • the non-TCP packets of the subsequent service node and the initiator are directly forwarded by the access side to the current serving node.
  • the present invention is not limited to the construction of a user terminal and a server cluster, and can also be applied to a distribution chain within a server cluster.
  • the terminal that needs to obtain the service is used as the initiator, and the initiator sends the link request message.
  • each terminal has a uniquely identifiable identifier, such as a virtual IP address and port, so that the access side can identify different terminals based on the identifier.
  • a uniquely identifiable identifier such as a virtual IP address and port
  • the access side receives the link establishment request message of the initiator, and then publishes the destination IP address and port of the initiator connection request according to the preset dynamic distribution.
  • the link request packet is discarded.
  • the access side selects the service node with the least load according to the preset load sharing table, and forwards the link request message to the selected service. node.
  • the selected service node is chained with the initiator and provides corresponding services.
  • the server cluster access side receives the link establishment request message of the originating end; according to the preset dynamic sub-publishing, the source link request packet of the destination address and the destination port is obtained from the link establishment request message; Then, according to the preset load sharing table, the legal chain-building request packet is forwarded to the service node with the least load to establish a chain, and the access chain-building request is uniformly distributed.
  • the uniform distribution of the request packets is implemented, so that the load of the service nodes of the server cluster is balanced, the waste of resources caused by the load imbalance is avoided, the burden of the server cluster is reduced, and the response of the server cluster is accelerated. Speed, enhances the overall performance of the server cluster, and brings a better business experience to users.
  • the second embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing a chain.
  • the method further includes:
  • Step S40 Deploying the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port.
  • the server cluster is pre-configured with a server address and port that allows access to the service.
  • the access side records the server address and port that the local end allows to access the service as dynamic sub-publishing, and is deployed on the access side as the address and port for providing services.
  • the dynamic sub-publishing may include an IP address and a port for the server cluster to provide services to the external network, and the external network user terminal obtains the service; the dynamic sub-publishing may also include the virtual IP address and port of each terminal in the server cluster, and is used in the cluster.
  • the terminal can obtain the service; the dynamic sub-publishing can also include other identification information for identifying and finding the server providing the service, which can be flexibly set according to actual needs.
  • the access side queries the dynamic sub-publishing to find the destination address and destination port carried in the link-building request packet.
  • the access side finds the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and destination port carried by the originating end of the link establishment request packet are allowed by the server cluster.
  • the incoming address and the port determine that the originating request packet is valid.
  • the access destination does not find the destination address and the destination port carried in the link-building request packet of the initiator, the destination address and destination port of the link-building request packet of the initiator can be compared with the current server cluster.
  • the address and port of the service provided do not match, so the server cluster cannot The initiator builds the chain.
  • the link-building request packet of the originating end is regarded as an invalid packet and is discarded.
  • Step S50 Obtain a dynamic load parameter of each service node, and generate the load sharing table.
  • the access side acquires load parameters of each service node in the cluster, and generates a load sharing table.
  • each service node In a cluster server, the load status of each service node changes according to the real-time processing status. Therefore, each service node actively reports the load parameters of each service node to the access side in real time, and is used by the access side to generate a load sharing table.
  • the load parameter of each service node includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or may be the CPU usage rate and memory occupancy rate of each service node.
  • the parameter can also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
  • the load parameters of each service node also include service requests that each service node can handle.
  • the access side obtains a load sharing table updated in real time.
  • the load sharing table records the load parameters of each service node in the cluster, and is used to select the service node with the smallest load.
  • the access side distributes the link establishment request message according to the preset load sharing table, the service node capable of processing the service request of the originating end is selected; the access side selects the service node capable of processing the service request of the originating end.
  • the service node with the least load forwards the current link request message.
  • the access side deploys dynamic sub-publishing, and records the default legal link establishment destination address and destination port; the access side acquires dynamic load parameters of each service node, and generates a load sharing table, which is used according to each service node.
  • the load parameters are all related to the distribution link request message.
  • the access side obtains a valid link-building request message through the dynamic sub-publishing screening, selects the service node with the least load through the load sharing table, and evenly distributes the link request message, thereby realizing the load balancing of the server cluster and reducing the load.
  • the burden of the server cluster accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
  • a third embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and constructing a chain, based on the embodiment shown in FIG. 1 or FIG. 2 (the present invention is illustrated by using FIG. 1). Step After S30, it also includes:
  • Step S60 Store the current distribution link information, and generate a distribution session table, where the distribution session table is used for the distribution of subsequent messages of the initiator.
  • the access side After the link-building request packet is forwarded to the corresponding service node, the access side stores the information of the current distribution link and generates a distribution session table.
  • the access side forwards the link establishment request message, the related information of the current link establishment is stored.
  • the access side can store the local address, the local port, the destination address, the destination port, and the destination service node identification information of the packet forwarding information as the current distribution link information to generate the distribution session table. .
  • the access side After obtaining the relevant information of the current building chain, the access side generates a session segment and publishes it dynamically, and records the link establishment information in real time for the dynamic generation of the session segmentation.
  • the session sub-publishing can be used to forward the non-chain-building request packets of the subsequent initiator. Specifically, when the initiating end performs a session with the serving node, first, when the access side receives the non-building request message of the same originating end, the query session is published, and the service node that has been established with the initiating end is obtained.
  • the access side forwards the current packet to the obtained service node.
  • the service node After receiving the packet, the service node performs corresponding processing to provide services to the initiator.
  • the access side generates a distribution session table by using the current distribution link information to be used for subsequent distribution of the same originating end message.
  • the access side when the initiating end establishes a chain with the serving node, when the access side receives the subsequent non-established link request message from the initiating end, the access side can directly forward to the corresponding service node according to the distribution session table, thereby alleviating the server cluster.
  • the burden accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
  • the fourth embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and building a chain. After the step S20, the method further includes:
  • Step S70 Determine, according to the distribution session table, whether the originating end has been built.
  • the access side searches for the local address and the local port of the current initiator. Whether the sending session table records the destination service node identification information of the current originating link-building packet forwarding.
  • the access side If the access side successfully finds the destination service node identifier information of the current initiator connection packet forwarding in the distribution session table, it determines that the initiator has been chained with the server cluster;
  • the access side If the access side does not successfully find the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it determines that the originating end has not been chained with the server cluster.
  • the access side obtains the determination result.
  • Step S80 If the initiating end has been built, the service node that has been linked with the initiating end is obtained according to the session, and the legal chain-building request packet is forwarded to the The obtained service node performs chaining; if the originating end has not been chained, the process proceeds to step S30.
  • the access side publishes the service node identification information that has been chained with the current initiator, and forwards the link request packet to the obtained information according to the identifier information.
  • the service node is constructed by the obtained service node and the initiator.
  • the access side forwards the link request packet to the service node with the least load according to the preset load sharing table, and completes the distribution of the link request packet.
  • the selected service node performs TCP negotiation with the initiator.
  • the access side determines, according to the distribution session table, whether the initiator has been built. If the initiator performs the link establishment, the access side reports the link establishment request according to the preset load sharing table. The file is forwarded to the service node that has been chained with the initiator. If the initiator does not perform the link establishment, the access side forwards the link request packet to the load according to the preset load sharing table. The smallest service node is built. In this embodiment, the request for the establishment of the link establishment link is distributed to the service node that has been chained with the initiator, and the processing load of other service nodes in the cluster is reduced and balanced. The load of each service node in the cluster avoids the waste of resources caused by repeated packet distribution, accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
  • a first embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device, and the distribution chain-building device includes:
  • the receiving module 100 is configured to: receive a link establishment request message of the initiator.
  • the embodiments of the present invention are mainly applied to a distributed system, and a user accesses a service cluster by establishing a chain with a server cluster.
  • the application scenario of the present invention may be that the user terminal initiates the establishment of the link-in service cluster, and the third-party server may initiate the establishment of the link-in service cluster, or may be the terminal-building access service of the service cluster intranet, and may be flexibly applied according to actual needs.
  • a PCT link is established between the user client and the core network, and the core network is accessed for example.
  • the application scenario of the present invention is not limited to the PCT chain.
  • the client When the client needs to obtain the services of the core network, the client needs to establish a PCT link with the core network as the initiator.
  • the access side of the core network server cluster receives the link establishment request packet, and distributes the link establishment request message to the service node for establishing a link and providing a service.
  • the initiator sends a TCP SYN (synchronous) message to establish a link.
  • TCP SYN synchronous
  • the TCP SYN packet carries the local address of the originating end, the local port, and the destination address and destination port of the current link. It can also carry other information, such as this service request, and can be flexibly set according to actual needs.
  • the initiator can use WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or 3G.
  • WiMax Worldwide Interoperability for Microwave Access
  • WLAN Wireless Local Area Networks
  • HSPDA High Speed Downlink Packet Access
  • network cable or 3G.
  • the communication technology communicates with the core network and accesses the core network.
  • the receiving module 100 receives the TCP SYN packet of the initiator.
  • the distribution chain-building device of the present invention may be located on a PC (personal computer), or on an interface board, or on other devices with network packet forwarding capabilities, and may be flexibly set according to actual needs. set.
  • the screening module 200 is configured to: obtain a legal link request message from the destination address and the destination port from the link establishment request message according to the preset dynamic distribution.
  • the screening module 200 parses the TCP SYN of the initiating end, and obtains the destination address and the destination port of the initiating end of the initiating end, and sets the following to determine whether the current TCP SYN packet is legal.
  • the screening module 200 is pre-deployed with dynamic sub-publishing, and the dynamic sub-publishing records allow the core network to be connected. Destination address and destination port of the service.
  • the screening module 200 queries the pre-deployed dynamic sub-publishing to query whether the destination address and the destination port of the current TCP SYN packet are in the dynamic sub-publishing.
  • the TCP SYN packet is invalid and discarded.
  • the TCP SYN packet is valid and can continue to be built.
  • the screening module 200 obtains a legitimate link request message of the destination address and the destination port.
  • the forwarding module 300 is configured to: forward the legal link request message to the service node with the least load to establish a chain according to the preset load sharing table.
  • the forwarding module 300 needs to forward the TCP SYN packet to the service node for establishing a link.
  • the forwarding module 300 queries the preset load sharing table.
  • the load sharing table is dynamically generated, and the load status of each service node in the cluster is recorded, and the dynamic update is performed in real time.
  • the forwarding module 300 selects the service node with the lowest current load.
  • the forwarding module 300 uses the load sharing policy to forward the current TCP SYN packet to the selected service node, and completes the distribution of the link establishment request message, and the selected service node performs TCP negotiation with the initiator.
  • the non-TCP packets of the subsequent service node and the initiator are directly forwarded by the forwarding module 300 to the current serving node.
  • the distribution chaining device of the present invention is not limited to the construction of the user terminal and the server cluster, and can also be applied to the distribution and establishment of the server cluster.
  • the terminal that needs to obtain the service is used as the initiator, and the initiator sends the link request message.
  • each terminal has a uniquely identifiable identifier, such as a virtual IP address and port, such that the distribution chaining device of the present invention can identify different terminals based on the identification.
  • a uniquely identifiable identifier such as a virtual IP address and port
  • the receiving module 100 receives the link establishment request message of the initiator, and then the screening module 200 according to the preset The dynamic sub-publishing is to find the destination IP address and port of the initiator connection request.
  • the screening module 200 discards the link establishment request packet
  • the forwarding module 300 selects the service node with the least load according to the preset load sharing table, and forwards the link request message to the selected service. node.
  • the selected service node is chained with the initiator and provides corresponding services.
  • the server cluster receiving module 100 receives the link establishment request message of the originating end; the screening module 200 obtains the legal connection request of the destination address and the destination port from the link establishment request message according to the preset dynamic sub-publishing message.
  • the forwarding module 300 forwards the legal link-building request packet to the service node with the least load according to the preset load sharing table, and implements the chain-building request to uniformly distribute the access-building request.
  • the uniform distribution of the request packets is implemented, so that the load of the service nodes of the server cluster is balanced, the waste of resources caused by the load imbalance is avoided, the burden of the server cluster is reduced, and the response of the server cluster is accelerated. Speed, enhances the overall performance of the server cluster, and brings a better business experience to users.
  • the second embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device.
  • the distribution chain-building device further includes:
  • the deployment module 400 is configured to: deploy the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port.
  • the server cluster is pre-configured with a server address and port that allows access to the service.
  • the deployment module 400 records the server address and port that the local end allows access to the service as dynamic sub-publishing, and is deployed in the screening module 200 as the address and port for providing the service.
  • the dynamic sub-publishing may include an IP address and a port for the server cluster to provide services to the external network, and the external network user terminal obtains the service; the dynamic sub-publishing may also include the virtual IP address and port of each terminal in the server cluster, and is used in the cluster.
  • the terminal can obtain the service; the dynamic sub-publishing can also include other identification information for identifying and finding the server providing the service, which can be flexibly set according to actual needs.
  • the screening module 200 queries the dynamic sub-publishing to find the destination address and destination port carried in the link-building request packet.
  • the filtering module 200 finds the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and the destination port carried by the originating end of the link-building request packet are allowed by the server cluster. The filtering module 200 determines that the initiator establishes the chain request message legally.
  • the filtering module 200 does not find the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and the destination port of the link-building request packet of the originating end, and the current server cluster can The address and port of the service provided do not match, so the server cluster cannot be chained with the initiator.
  • the screening module 200 treats the link establishment request message of the originating end as an illegal packet and performs discard processing.
  • the obtaining module 500 is configured to: acquire dynamic load parameters of each service node, and generate the load sharing table.
  • the obtaining module 500 acquires load parameters of each service node in the cluster, and generates a load sharing table.
  • each service node In a cluster server, the load status of each service node changes according to the real-time processing status. Therefore, each service node actively reports the load parameters of each service node to the access side in real time, and is used by the access side to generate a load sharing table.
  • the load parameter of each service node includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or may be the CPU usage rate and memory occupancy rate of each service node.
  • the parameter can also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
  • the load parameters of each service node also include service requests that each service node can handle.
  • the acquisition module 500 obtains a load sharing table updated in real time.
  • the load sharing table records the load parameters of each service node in the cluster, and is used to select the service node with the smallest load.
  • the forwarding module 300 distributes the link establishment request message according to the preset load sharing table, first, the service node capable of processing the service request of the originating end is selected; and then, the forwarding module 300 is capable of processing the service request service of the originating end. In the node, the service node with the least load is selected to forward the request for establishing the link.
  • the deployment module 400 dynamically publishes and records the preset legal link destination.
  • the obtaining module 500 obtains the dynamic load parameters of each service node, generates a load sharing table, and sets the load request message according to the load parameters of each service node.
  • the distribution chain-building device obtains the legal chain-building request message through the dynamic sub-publishing screening, selects the service node with the least load through the load sharing table, and evenly distributes the chain-building request message, thereby realizing the load balancing of the server cluster and reducing the load.
  • the burden of the server cluster accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
  • the third embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device, based on the embodiment shown in FIG. 5 or FIG. 6 (the invention is illustrated by using FIG. 5).
  • the distribution chaining device also includes:
  • the storage module 600 is configured to: store the current distribution link information, and generate a distribution session table, where the distribution session table is used for the distribution of subsequent messages of the initiator.
  • the storage module 600 stores the information of the current link establishment and generates a distribution session table.
  • the storage module 600 stores the related information of the current link.
  • the storage module 600 can store the local address, the local port, the destination address, the destination port, and the destination service node identifier information of the packet forwarding information as the current distribution link information, and generate a distribution session table. .
  • the storage module 600 After obtaining the related information of the current link establishment, the storage module 600 generates a session sub-publishing and dynamically updates, and records the link-building information in real time for dynamic generation of the session sub-publishing.
  • the session sub-publishing can be used to forward the non-chain-building request packets of the subsequent initiator. Specifically, when the initiating end performs a session with the serving node, first, when the receiving module 100 receives the non-building request message of the same originating end, the forwarding module 300 queries the session sub-publishing and obtains the service node that has been established with the initiating end.
  • the forwarding module 300 forwards the current message to the obtained service node.
  • the service node After receiving the packet, the service node performs corresponding processing to provide services to the initiator.
  • the storage module 600 generates a distribution session table for storing the subsequent initiating end messages by storing the current distribution link information.
  • This embodiment implements the initiator and service section.
  • the receiving module 100 can directly forward the non-chain-building request message to the initiating end, and can be directly forwarded to the corresponding service node by the forwarding module 300 according to the distribution session table, thereby reducing the burden on the server cluster and speeding up the server.
  • the response speed of the cluster enhances the overall performance of the server cluster and provides users with a better business experience.
  • the fourth embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device.
  • the distribution chain-building device further includes:
  • the determining module 700 is configured to: determine, according to the distribution session table, whether the originating end has been built.
  • the determining module 700 searches whether the initiator has established a chain with the server cluster according to the dynamically generated distribution session table.
  • the determining module 700 searches the distribution session table according to the local address of the current originating end and the local port to record the destination service node identification information of the current originating link-building packet forwarding.
  • the determining module 700 successfully finds the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it is determined that the initiator end has been chained with the server cluster;
  • the determining module 700 does not successfully find the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it is determined that the originating end has not been chained with the server cluster.
  • the determination module 700 obtains the determination result.
  • the forwarding module 300 is further configured to: if the initiator performs chaining, obtain a service node that has been chained with the initiator according to the session, and establish the legal The chain request packet is forwarded to the obtained service node for chain establishment; if the initiator is not chained, the legal chain-building request packet is forwarded to the minimum load according to the preset load sharing table.
  • the service node is chained.
  • the forwarding module 300 publishes the service node identification information that has been chained with the current initiator, and forwards the link request packet to the obtained information according to the identifier information.
  • the service node is constructed by the obtained service node and the initiator.
  • the forwarding module 300 forwards the link request packet to the service node with the least load according to the preset load sharing table.
  • the distribution of the message is sought, and the selected service node performs TCP negotiation with the originating end.
  • the determining module 700 determines whether the originating end has been built according to the distribution session table. If the originating end performs the chain building, the accessing unit 300 of the forwarding module 300 will build the current load according to the preset load sharing table. The chain request packet is forwarded to the service node that has been chained with the initiator. If the initiator does not perform the link establishment, the forwarding module 300 will set the link request packet according to the preset load sharing table. Forward to the least loaded service node for chaining. In this embodiment, the request for the establishment of the link establishment link is distributed to the service node that has been chained with the initiator, and the processing load of other service nodes in the cluster is reduced and balanced. The load of each service node in the cluster avoids the waste of resources caused by repeated packet distribution, accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
  • a first embodiment of the distribution chain building system of the present invention provides a distribution chain building system, where the distribution chain building system includes an initiator A and a server B, wherein:
  • the initiator A is configured to send a link establishment request message.
  • the terminal that initiates the link establishment request and obtains the service to the server cluster serves as the initiator.
  • the originating terminal A can be divided into an external network terminal and an intranet terminal.
  • the external network terminal is a terminal such as a mobile terminal or a server that obtains a server cluster service outside the server cluster.
  • the external network terminal can pass WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or Communication technologies such as 3G communicate with server clusters.
  • WiMax Worldwide Interoperability for Microwave Access
  • WLAN Wireless Local Area Networks
  • HSPDA High Speed Downlink Packet Access
  • Network cable or Communication technologies such as 3G communicate with server clusters.
  • a broadband mobile terminal may obtain a service from a core network element by using a TCP protocol through a broadband network.
  • the intranet terminal is a terminal or node that obtains services within the server cluster. For example, a node in the core network needs to request a directory service from the UDS, and the UDS server provides the IP address and port of the local end. When the node requests the service, Server B will establish a link on the corresponding UDS server node according to the load sharing and provide related services.
  • the server B includes an access side B1 and a service side B2;
  • the access side B1 includes a receiving module 100, a screening module 200, a forwarding module 300, a deployment module 400, an obtaining module 500, a storage module 600, and a determining module 700;
  • the service side B2 is configured to receive the link establishment request message and establish a chain with the initiator end A.
  • the server B includes an access side B1 and a service side B2.
  • the access side B1 is configured to receive the link establishment request message of the initiator A and distribute it to the service side B2, and receive the response of the service side B2 and forward it to the initiator A.
  • the service side B2 is configured to receive and respond to the message distributed by the access side B1, and provide the corresponding service to the initiator A.
  • receiving packets and forwarding packets on the access side may be implemented by the same physical hardware or by different physical hardware combinations.
  • an application scenario of the present invention is used for requesting a service from a mobile phone client to an IMS core network.
  • the originating end A includes a plurality of mobile phone clients, and the mobile phone client requests the service service of the call restriction limiting function.
  • the mobile phone client accesses the IMS core network through the TCP link, and the interface board serves as the access side B1 to receive the link request message of the mobile phone client and distribute it.
  • the interface board performs session management based on SIP-I (Session Initiation Protocol).
  • SIP-I Session Initiation Protocol
  • a spare interface board SIP-I is included for handling an emergency situation.
  • the BSF/AP network element in the IMS core network serves as the service side B2 to provide trigger services for the mobile phone client.
  • Client-1, Client-2, and Client-N are used to represent the mobile client of each request service.
  • Client-1, Client-2, and Client-N request the IMS core network to enable the call restriction function.
  • This function needs to initiate a request to the BSF/AP network element through the HTTP protocol.
  • Client-1, Client-2, and Client-N need to establish a TCP link with the BSF/AP network element before the HTTP request is initiated.
  • Client-1, Client-2, ..., Client-N send a TCP SYN link establishment request message to the IMS core network.
  • the interface board After receiving the SYN packet sent by the mobile phone client, the interface board parses the destination IP address and port in the packet, and checks whether Client-1, Client-2, Client-N is the local end according to the preset dynamic distribution. The address and port that are allowed to access.
  • the interface board discards the SYN packet.
  • the interface board searches for the SMP (Symmetric Multi Processing) in the BSF/AP network element according to the preset load sharing table to obtain the service processing nodes.
  • the interface board is the link of Client-1, Client-2, and Client-N.
  • the service load node SMP with the smallest load is selected according to the load sharing table. It should be noted that the service processing node SMP selected by the interface board for Client-1, Client-2, Client-N, or the like may be the same or different.
  • the interface board forwards the SYN packets of Client-1, Client-2, and Client-N to the corresponding service processing node SMP.
  • the selected service processing node SMP performs a TCP three-way handshake with the initiators Client-1, Client-2, ... Client-N, respectively, and completes the TCP link establishment.
  • the interface board records the session of each mobile client and generates a session sub-publish.
  • the interface board receives the call-opening request message initiated by Client-1, Client-2, and Client-N. According to the IP address and port of each mobile client, the interface is published according to the session.
  • the client establishes the linked service processing node SMP and forwards the request message to the obtained service processing node SMP.
  • each service processing node SMP After receiving the call restriction request, each service processing node SMP processes the mobile client request and sends the processing result back to the mobile client.
  • the distribution chain building system includes an initiator A and a server B.
  • the initiator A initiates the link establishment request, and the server B uniformly distributes the link establishment request message through the access side B1, so that the service side B2 can uniformly process the link establishment request and the service request of the initiator A.
  • This embodiment implements load balancing of the server cluster, reduces the burden on the server cluster, speeds up the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
  • the second embodiment of the distribution chain-building system of the present invention provides a distribution chain-building system.
  • the service side B2 includes:
  • Each of the service nodes B21, the service node B21 is configured to send the dynamic load parameter to the access side B1, and receive the link establishment request message forwarded by the access side, and according to the link establishment request message Establishing a chain with the initiator A, and receiving subsequent packets of the originating end forwarded by the access side.
  • the service side B2 includes each service node B21 that provides a service.
  • Each service node B21 updates the load parameter in real time and reports it to the access side B1 in real time for the generation of the access side B1 load sharing table.
  • the load parameter of each service node B21 includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or the CPU usage rate, memory occupancy rate, etc. of each service node.
  • the technical parameters may also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
  • Each serving node B21 listens to the access side B1, and provides the access side B1 with service information that can be processed by each service node B21, and identification information of each service node B21, such as an IP address and a port.
  • the access side B1 can acquire the interception information of each service node B21, and obtain the service information and the representation information that each service node B21 can process.
  • the access side B1 can obtain the service node capable of processing the originating service request according to the service request of the link establishment request message and the interception information of each service node B21.
  • the service node with the smallest load is selected from the service nodes capable of processing the originating service request, and the message is forwarded according to the identification information of each service node B21.
  • each service node B21 After receiving the link establishment request message forwarded by the access side B1, each service node B21 establishes a link according to the link establishment request message through the access side B1 and the originating end A, and receives the subsequent message forwarded by the access side B1 and initiates the message. End A provides the corresponding service.
  • the application scenario of the present invention is used to obtain a service from a third-party application server to the core network, and an example is illustrated.
  • the service side B2 is a UDS distributed database system of a core network HLR (Home Location Register) network element
  • the access side B1 is a UDS interface board
  • the originating end A is a third-party application server.
  • AS server Such as AS server.
  • UDS provides a TCP-based directory query service for the AS server.
  • the AS server accesses the UDS through a standard LDAP (Lightweight Directory Access Protocol) interface.
  • LDAP Lightweight Directory Access Protocol
  • the AS server acquires the directory service from the UDS, the AS server already knows the service IP address and port number of the UDS server. The AS server needs to establish a TCP link before querying the directory.
  • the UDS interface board After receiving the TCP link request from the AS server, the UDS interface board firstly determines whether the TCP connection request packet of the AS server is legal according to the preset dynamic distribution.
  • the UDS interface board queries whether the AS server has been chained with the UDS server according to the distribution session table.
  • the UDS interface board will query the link load of each UDS service node according to the preset load sharing table, select the service node with the least load, and forward the chain connection request of the AS server to the selection.
  • the service node, the service node and the AS server forward the packet through the interface board to complete the TCP three-way handshake construction process.
  • the AS server After the link is successfully established, the AS server sends a query directory data request message to the server UDS through the TCP link. After receiving the query directory data request message, the UDS interface board queries the specific IP address and port number of the service node according to the TCP link. The service node forwards the request to the corresponding service node.
  • the service node receives the subsequent message of the initiator A forwarded by the access side B1, provides a directory query service, and responds the query result to the AS server.
  • the service side B2 includes each service node B21 that provides the service, and each service node B21 sends the dynamic load parameter to the access side B1 for the generation of the access side B1 load sharing table; each service node B21 receives The link-building request packet forwarded by the access side B1 is chained with the initiator A according to the link-building request message.
  • This embodiment implements load balancing of service nodes in the server cluster, reduces the burden on the server cluster, speeds up the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
  • the embodiment of the invention also discloses a computer program, comprising program instructions, when the program instruction is executed by the server, so that the server can execute any of the above-mentioned distribution and construction methods.
  • the embodiment of the invention also discloses a carrier carrying the computer program.
  • the computer program can be implemented in a computer readable storage medium, the computer program being executed on a corresponding hardware platform (such as a system, device, device, device, etc.), when executed, including One or a combination of the steps of the method embodiments.
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the technical solution of the invention realizes the uniform distribution of the link requesting packets, thereby balancing the load of the service nodes of the server cluster, avoiding waste of resources caused by load imbalance, reducing the burden of the server cluster, and accelerating the server cluster.
  • the responsiveness enhances the overall performance of the server cluster and gives users a better business experience. Therefore, the present invention has strong industrial applicability.

Abstract

A distributed link establishment method, apparatus and system. The method comprises: receiving a link establishment request packet of an initiation end; according to a pre-set dynamic distribution table, acquiring a valid link establishment request packet of a destination address and a destination port from the link establishment request packet; and, according to a pre-set load sharing table, forwarding the valid link establishment request packet to a serving node with a minimum load for link establishment. The technical solution of the present invention realizes the even distribution of link establishment request packets, thereby enabling loads of various serving nodes of a server cluster to reach a balance, increasing a response speed of the server cluster and bringing a better service experience to a user.

Description

分发建链方法、装置和系统Distribution chain building method, device and system 技术领域Technical field
本文涉及分发建链技术领域,尤其涉及一种分发建链方法、装置和系统。This paper relates to the field of distribution chain building technology, and in particular to a distribution chain building method, device and system.
背景技术Background technique
目前,移动、电信核心网通常使用服务器集群提供服务,例如HLR(Home Location Register,归属位置寄存器)、IMS(IP Multimedia Subsystem,IP多媒体子系统),通过分布式的架构提高了数据处理效率。用户在获取HLR、IMS提供的服务时,首先需要和HLR、IMS建立TCP(Transmission Control Protocol,传输控制协议)链接,与服务器集群进行通信。At present, mobile and telecom core networks usually use server clusters to provide services, such as HLR (Home Location Register) and IMS (IP Multimedia Subsystem), which improve data processing efficiency through a distributed architecture. When acquiring the services provided by the HLR and the IMS, the user first needs to establish a TCP (Transmission Control Protocol) link with the HLR and the IMS to communicate with the server cluster.
在分布式系统下,服务器集群根据用户的IP地址和端口号范围事先对接入的用户进行规划,能够将用户的服务需求均匀分配给集群中的各服务节点进行处理。当用户发起建链请求后,服务器集群根据用户的IP地址和端口号范围,按照事先的规划,将用户的建链请求转发给相应的服务节点,由服务节点提供服务。In a distributed system, the server cluster plans the access users in advance according to the user's IP address and port number range, and can evenly distribute the user's service requirements to each service node in the cluster for processing. After the user initiates the link establishment request, the server cluster forwards the user's link establishment request to the corresponding service node according to the user's IP address and port number range according to the prior planning, and the service node provides the service.
然而,随着业务的不断拓展与发展,用户的服务需求也日益增长,当服务器集群无法提前获知用户的IP地址和端口号范围时,相关技术的分发建链方式无法快速接入用户请求,严重影响了用户体验。However, with the continuous expansion and development of services, the service requirements of users are also increasing. When the server cluster cannot know the IP address and port number range of the user in advance, the distribution and establishment of the related technologies cannot quickly access the user request. Affects the user experience.
例如,当用户的移动终端在向IMS请求触发类业务时,由于移动终端的IP地址和端口都是动态分配的,IMS服务器不能根据移动终端的IP地址事先分配服务节点,有可能造成移动终端无法接入IMS服务器,或移动终端成功接入后IMS服务器后,IMS服务器的各个服务节点处理服务请求的负载严重不均衡,产生有些服务节点满负荷运行、有些服务节点空置,浪费资源,降低了整个核心网的响应能力。For example, when the user's mobile terminal requests the triggering service from the IMS, since the IP address and port of the mobile terminal are dynamically allocated, the IMS server cannot allocate the service node according to the IP address of the mobile terminal, which may cause the mobile terminal to fail. After accessing the IMS server, or after the mobile terminal successfully accesses the IMS server, the load of the service requests processed by the service nodes of the IMS server is seriously unbalanced, and some service nodes are running at full capacity, some service nodes are vacant, waste resources, and the whole is reduced. The responsiveness of the core network.
发明内容Summary of the invention
本发明的主要目的在于提供一种分发建链方法、装置和系统,旨在解决 相关技术中服务器集群负荷不均衡、响应慢的技术问题。The main object of the present invention is to provide a distribution chain building method, device and system, aiming at solving In the related art, the server cluster has an unbalanced load and a slow response.
为实现上述目的,采用如下技术方案:In order to achieve the above objectives, the following technical solutions are adopted:
一种分发建链方法,所述分发建链方法包括以下步骤:A distribution chain building method, the distribution chain building method comprising the following steps:
接收发起端的建链请求报文;Receiving a link establishment request message of the initiator;
根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文;Obtaining a legitimate link request message of the destination address and the destination port from the link request packet according to the preset dynamic sub-publishing;
根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。According to the preset load sharing table, the legal link request message is forwarded to the service node with the least load to establish a chain.
可选地,所述接收发起端的建链请求报文的步骤之前,该方法还包括:Optionally, before the step of receiving the link establishment request message of the initiator, the method further includes:
部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口;Deploying the dynamic sub-publishing, the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
获取服务节点的动态负荷参数,生成所述负荷分担表。The dynamic load parameter of the service node is obtained, and the load sharing table is generated.
可选地,所述根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链的步骤之后,该方法还包括:Optionally, after the step of forwarding the legal chain-building request packet to the service node with the least load, according to the preset load sharing table, the method further includes:
存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。The distribution link information is stored, and a distribution session table is generated, where the distribution session table is used for distribution of subsequent messages of the initiator.
可选地,所述根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文的步骤之后,该方法还包括:Optionally, after the step of obtaining the legal connection request packet of the destination address and the destination port from the link establishment request packet, the method further includes:
根据所述分发会话表,判断所述发起端是否进行过建链;Determining, according to the distribution session table, whether the originating end has been built;
若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;If the initiator is configured to perform the chaining, the service node that has been linked with the initiator is obtained according to the session, and the legal link request message is forwarded to the obtained The service node performs chain building;
若所述发起端未进行过建链,则执行所述根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链的步骤。If the initiator does not perform the chain establishment, the step of forwarding the legal chain-building request packet to the service node with the least load is performed according to the preset load sharing table.
一种分发建链装置,所述分发建链装置包括接收模块、筛选模块和转发模块,其中 A distribution chain building device, the distribution chain building device comprising a receiving module, a screening module and a forwarding module, wherein
所述接收模块设置成:接收发起端的建链请求报文;The receiving module is configured to: receive a link establishment request message of the initiator end;
所述筛选模块设置成:根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文;The filtering module is configured to: obtain a legal connection request packet of the destination address and the destination port from the link request packet according to the preset dynamic segmentation;
所述转发模块设置成:根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The forwarding module is configured to: forward the legal link request message to the service node with the least load to establish a chain according to the preset load sharing table.
可选地,所述分发建链装置还包括部署模块和获取模块,其中Optionally, the distribution chaining device further includes a deployment module and an acquisition module, where
所述部署模块设置成:部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口;The deployment module is configured to: deploy the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
所述获取模块设置成:获取各服务节点的动态负荷参数,生成所述负荷分担表。The acquiring module is configured to: acquire dynamic load parameters of each service node, and generate the load sharing table.
可选地,所述分发建链装置还包括存储模块,其中Optionally, the distribution chaining device further includes a storage module, wherein
所述存储模块设置成:存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。The storage module is configured to: store the current distribution link information, and generate a distribution session table, where the distribution session table is used for distribution of subsequent messages of the initiator.
可选地,所述分发建链装置还包括判定模块,其中Optionally, the distribution chaining device further includes a determination module, wherein
所述判定模块设置成:根据所述分发会话表,判断所述发起端是否进行过建链;The determining module is configured to: determine, according to the distribution session table, whether the originating end has been built;
所述转发模块还设置成:若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;若所述发起端未进行过建链,则根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The forwarding module is further configured to: if the originating end performs chain building, obtain a service node that has been linked with the originating end according to the session, and obtain the legal chain-building request The packet is forwarded to the obtained service node for chain construction; if the originating end is not chained, the legal chain-building request packet is forwarded to the service with the least load according to the preset load sharing table. The node is built.
一种分发建链系统,所述分发建链系统包括发起端和服务器,其中:A distribution chain building system includes an initiator and a server, wherein:
所述发起端设置成:发送建链请求报文;The initiator is configured to: send a link request message;
所述服务器包括接入侧和服务侧;The server includes an access side and a service side;
所述接入侧包括上述任意的分发建链装置;The access side includes any of the above-mentioned distribution and chain building devices;
所述服务侧设置成:接收所述建链请求报文,与所述发起端建链。 The service side is configured to: receive the link establishment request message, and establish a link with the initiator end.
可选地,所述服务侧包括:Optionally, the service side includes:
至少一个服务节点,至少一个所述服务节点设置成:将动态负荷参数发送给所述接入侧,接收所述接入侧转发的建链请求报文,并根据所述建链请求报文与所述发起端进行建链,接收所述接入侧转发的所述发起端的后续报文。At least one service node, at least one of the service nodes is configured to: send a dynamic load parameter to the access side, receive a link establishment request message forwarded by the access side, and according to the link establishment request message The initiator is configured to receive a subsequent packet of the originating end forwarded by the access side.
本发明技术方案提出的一种分发建链方法、装置和系统,通过服务器集群接入侧接收发起端的建链请求报文;根据预置的动态分发表,从建链请求报文中获取目的地址和目的端口合法的建链请求报文;然后,根据预置的负荷分担表,将合法的建链请求报文转发给负荷最小的服务节点进行建链,实现对接入的建链请求进行均匀的分发。本发明技术方案实现了对建链请求报文的均匀分发,从而使服务器集群各服务节点的负荷达到均衡,避免了负荷不均衡导致的资源浪费,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。The method, device and system for distributing and establishing a link according to the technical solution of the present invention receive a link request message of the originating end through the access side of the server cluster; and obtain the destination address from the link request message according to the preset dynamic sub-publishing A valid request for establishing a link with the destination port. Then, according to the preset load sharing table, the legal chain-building request packet is forwarded to the service node with the least load to establish a chain. Distribution. The technical solution of the invention realizes the uniform distribution of the link requesting packets, thereby balancing the load of the service nodes of the server cluster, avoiding waste of resources caused by load imbalance, reducing the burden of the server cluster, and accelerating the server cluster. The responsiveness enhances the overall performance of the server cluster and gives users a better business experience.
附图概述BRIEF abstract
图1为本发明分发建链方法第一实施例的流程示意图;1 is a schematic flow chart of a first embodiment of a method for distributing and constructing a chain according to the present invention;
图2为本发明分发建链方法第二实施例的流程示意图;2 is a schematic flow chart of a second embodiment of a method for distributing and constructing a chain according to the present invention;
图3为本发明分发建链方法第三实施例的流程示意图;3 is a schematic flowchart of a third embodiment of a method for distributing and constructing a chain according to the present invention;
图4为本发明分发建链方法第四实施例的流程示意图;4 is a schematic flowchart of a fourth embodiment of a method for distributing and constructing a chain according to the present invention;
图5为本发明分发建链装置第一实施例的功能模块示意图;5 is a schematic diagram of functional modules of a first embodiment of a distribution chain building device of the present invention;
图6为本发明分发建链装置第二实施例的功能模块示意图;6 is a schematic diagram of functional modules of a second embodiment of a distribution chain building device of the present invention;
图7为本发明分发建链装置第三实施例的功能模块示意图;7 is a schematic diagram of functional modules of a third embodiment of a distribution chain building device of the present invention;
图8为本发明分发建链装置第四实施例的功能模块示意图;8 is a schematic diagram of functional modules of a fourth embodiment of a distribution chain building device of the present invention;
图9为本发明分发建链系统第一实施例的模块示意图;9 is a schematic block diagram of a first embodiment of a distribution chain building system of the present invention;
图10为本发明实施例应用场景为手机客户端向IMS核心网请求服务的示意图; 10 is a schematic diagram of an application scenario for a mobile phone client to request a service from an IMS core network according to an embodiment of the present invention;
图11为本发明分发建链系统第二实施例的模块示意图。Figure 11 is a block diagram showing a second embodiment of the distribution chain building system of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
本发明的较佳实施方式Preferred embodiment of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例的主要解决方案是:接收发起端的建链请求报文;根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文;根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The main solution of the embodiment of the present invention is: receiving a link establishment request message of the originating end; and obtaining a legal link establishment request message of the destination address and the destination port from the link establishment request message according to the preset dynamic sub-publishing; According to the preset load sharing table, the legal link request message is forwarded to the service node with the least load to establish a chain.
由于相关技术在发起端的地址和端口范围不确定时,服务器集群会产生无法接入或各服务节点负荷不均衡的情况,导致服务响应缓慢,影响用户体验。When the address and port range of the related technology are uncertain, the server cluster may fail to access or the load of each service node is unbalanced, resulting in slow service response and affecting the user experience.
本发明提供一种解决方案,使服务器集群接入侧在不需要知道发起端的地址和端口信息的情况下,将建链请求均匀分发给各服务节点,实现了服务器集群的各服务节点负荷均衡,提高了服务器整体的响应速度。The present invention provides a solution for the server cluster access side to uniformly distribute the link establishment request to each service node without knowing the address and port information of the initiator, thereby realizing load balancing of the service nodes of the server cluster. Improve the overall response speed of the server.
参照图1,本发明分发建链方法第一实施例提供一种分发建链方法,所述分发建链方法包括:Referring to FIG. 1 , a first embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and building a chain, and the method for distributing and building a chain includes:
步骤S10、接收发起端的建链请求报文。Step S10: Receive a link establishment request message of the initiator.
本发明实施例主要应用于分布式系统中,用户通过与服务器集群建链,接入服务集群。本发明应用场景可以是用户终端发起建链接入服务集群,可以是第三方服务器发起建链接入服务集群,也可以是服务集群内网的终端建链获取服务,可根据实际需要灵活应用。The embodiments of the present invention are mainly applied to a distributed system, and a user accesses a service cluster by establishing a chain with a server cluster. The application scenario of the present invention may be that the user terminal initiates the establishment of the link-in service cluster, and the third-party server may initiate the establishment of the link-in service cluster, or may be the terminal-building access service of the service cluster intranet, and may be flexibly applied according to actual needs.
本实施例以用户客户端与核心网建立PCT链接,接入核心网进行举例说 明。当然,本发明应用场景不限定于PCT建链。In this embodiment, a PCT link is established between a user client and a core network, and the core network is accessed. Bright. Of course, the application scenario of the present invention is not limited to the PCT chain.
在客户端需要获取核心网的服务时,客户端作为发起端,首先需要和核心网建立PCT链接。核心网服务器集群的接入侧接收建链请求报文,并将建链请求报文分发给服务节点进行建链和提供服务。When the client needs to obtain the services of the core network, the client needs to establish a PCT link with the core network as the initiator. The access side of the core network server cluster receives the link establishment request packet, and distributes the link establishment request message to the service node for establishing a link and providing a service.
在部分实施例中,发起端发出建链请求报文TCP SYN(synchronous,握手信号)报文,发起建链。In some embodiments, the initiator sends a TCP SYN (synchronous) message to establish a link.
其中,TCP SYN报文中携带有发起端的本端地址、本端端口,和本次建链的目的地址、目的端口,还可以携带其他信息例如本次服务请求,可根据实际需要灵活设定。The TCP SYN packet carries the local address of the originating end, the local port, and the destination address and destination port of the current link. It can also carry other information, such as this service request, and can be flexibly set according to actual needs.
发起端可以通过WiMax(Worldwide Interoperability for Microwave Access,全球微波互联接入)、WLAN(Wireless Local Area Networks,无线局域网络)、HSPDA(High Speed Downlink Packet Access,高速下行分组接入)、网线、或3G等通信技术与核心网进行网络通信,接入核心网。The initiator can use WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or 3G. The communication technology communicates with the core network and accesses the core network.
接入侧接收发起端的TCP SYN报文。需要说明的是,接入侧可以是PC(personal computer,个人计算机),也可以是接口板,也可以是其他具有网络报文转发能力的设备,可根据实际需要灵活设定。The access side receives the TCP SYN packet from the initiator. It should be noted that the access side may be a PC (personal computer), an interface board, or other devices with network packet forwarding capabilities, which can be flexibly set according to actual needs.
步骤S20、根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文。Step S20: According to the preset dynamic sub-publishing, obtain a legal chain-building request message of the destination address and the destination port from the link-building request message.
在接入侧收到发起端的TCP SYN报文后,接入侧解析发起端的TCP SYN,获取发起端本次建链的目的地址和目的端口,用于判断本次TCP SYN报文是否合法。After receiving the TCP SYN packet from the initiating end, the access side resolves the TCP SYN of the initiating end, and obtains the destination address and destination port of the initiating link of the initiating end to determine whether the current TCP SYN packet is legal.
接入侧预置有动态分发表,动态分发表记录了核心网允许接入服务的目的地址和目的端口。The access side preset has dynamic sub-publishing, and the dynamic sub-publishing records the destination address and destination port of the core network allowing access services.
接入侧根据预先部署的动态分发表,查询本次TCP SYN报文的目的地址和目的端口是否在动态分发表中。The access side publishes the pre-deployed dynamic sub-distribution, and queries whether the destination address and destination port of the current TCP SYN packet are in dynamic sub-publishing.
若本次TCP SYN报文的目的地址和目的端口不在动态分发表中,则本次TCP SYN报文不合法,做丢弃处理;If the destination address and the destination port of the TCP SYN packet are not in the dynamic sub-publishing, the TCP SYN packet is invalid and discarded.
若本次TCP SYN报文的目的地址和目的端口在动态分发表中,则本次TCP SYN报文合法,可继续进行建链。 If the destination address and the destination port of the current TCP SYN packet are in dynamic distribution, the TCP SYN packet is valid and can continue to be built.
由此,接入侧获得目的地址和目的端口合法的建链请求报文。Therefore, the access side obtains a legitimate link request message of the destination address and the destination port.
步骤S30、根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。Step S30: Forward the legal link request message to the service node with the least load according to the preset load sharing table to establish a chain.
在接入侧获取合法的TCP SYN报文后,接入侧需要将TCP SYN报文转发给服务节点进行建链。After the access side obtains a valid TCP SYN packet, the access side needs to forward the TCP SYN packet to the service node for chain establishment.
在部分实施例中,接入侧查询预置的负荷分担表。In some embodiments, the access side queries the preset load sharing table.
其中,负荷分担表为动态生成的,记录了集群中各服务节点的负荷状况,实时动态更新。The load sharing table is dynamically generated, and the load status of each service node in the cluster is recorded, and the dynamic update is performed in real time.
接入侧选取当前负荷最小的服务节点。The access side selects the service node with the lowest current load.
接入侧采用负荷分担策略,将本次TCP SYN报文转发给选取的服务节点,完成本次建链请求报文的分发,由选取的服务节点与发起端进行TCP协商。The access side adopts a load sharing policy, and forwards the current TCP SYN packet to the selected service node to complete the distribution of the link establishment request message, and the selected service node performs TCP negotiation with the initiator.
若选取的服务节点与发起端TCP协商成功,则后续服务节点与发起端的非TCP报文,均由接入侧直接转发给当前服务节点。If the selected service node and the initiator TCP are successfully negotiated, the non-TCP packets of the subsequent service node and the initiator are directly forwarded by the access side to the current serving node.
当然,本发明不限定于用户终端与服务器集群的建链,也可以应用于服务器集群内部的分发建链。Of course, the present invention is not limited to the construction of a user terminal and a server cluster, and can also be applied to a distribution chain within a server cluster.
以服务器集群内部的分发建链进行举例说明,在部分实施例中,将需要获取服务的终端作为发起端,发起端发出建链请求报文。For example, in the embodiment, the terminal that needs to obtain the service is used as the initiator, and the initiator sends the link request message.
在服务器集群内部,各终端均有唯一可识别的标识,例如虚拟IP地址和端口,使接入侧可以根据此标识识别不同的终端。Within the server cluster, each terminal has a uniquely identifiable identifier, such as a virtual IP address and port, so that the access side can identify different terminals based on the identifier.
接入侧接收发起端的建链请求报文,然后根据预置的动态分发表,查找发起端本次建链请求的目的IP地址和端口。The access side receives the link establishment request message of the initiator, and then publishes the destination IP address and port of the initiator connection request according to the preset dynamic distribution.
若未成功找到发起端本次建链请求的目的IP地址和端口,则丢弃本次建链请求报文;If the destination IP address and port of the initiator connection request are not found, the link request packet is discarded.
若成功找到发起端本次建链请求的目的IP地址和端口,则接入侧根据预置的负荷分担表,选取负荷最小的服务节点,并将本次建链请求报文转发给选取的服务节点。If the destination IP address and port of the initiator connection request are successfully found, the access side selects the service node with the least load according to the preset load sharing table, and forwards the link request message to the selected service. node.
由该选取的服务节点与发起端进行建链,并提供相应服务。 The selected service node is chained with the initiator and provides corresponding services.
在本实施例中,通过服务器集群接入侧接收发起端的建链请求报文;根据预置的动态分发表,从建链请求报文中获取目的地址和目的端口合法的建链请求报文;然后,根据预置的负荷分担表,将合法的建链请求报文转发给负荷最小的服务节点进行建链,对接入的建链请求进行均匀的分发。本实施例实现了对建链请求报文的均匀分发,从而使服务器集群各服务节点的负荷达到均衡,避免了负荷不均衡导致的资源浪费,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the server cluster access side receives the link establishment request message of the originating end; according to the preset dynamic sub-publishing, the source link request packet of the destination address and the destination port is obtained from the link establishment request message; Then, according to the preset load sharing table, the legal chain-building request packet is forwarded to the service node with the least load to establish a chain, and the access chain-building request is uniformly distributed. In this embodiment, the uniform distribution of the request packets is implemented, so that the load of the service nodes of the server cluster is balanced, the waste of resources caused by the load imbalance is avoided, the burden of the server cluster is reduced, and the response of the server cluster is accelerated. Speed, enhances the overall performance of the server cluster, and brings a better business experience to users.
可选地,参照图2,本发明分发建链方法第二实施例提供一种分发建链方法,基于上述图1所示的实施例,所述步骤S10之前,还包括:Optionally, referring to FIG. 2, the second embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing a chain. According to the embodiment shown in FIG. 1 , before the step S10, the method further includes:
步骤S40、部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口。Step S40: Deploying the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port.
在本实施例中,服务器集群预设有允许接入服务的服务器地址和端口。In this embodiment, the server cluster is pre-configured with a server address and port that allows access to the service.
接入侧将本端允许接入服务的服务器地址和端口记录为动态分发表,作为提供服务的地址和端口,部署在接入侧。The access side records the server address and port that the local end allows to access the service as dynamic sub-publishing, and is deployed on the access side as the address and port for providing services.
其中,动态分发表可以包括服务器集群对外网提供服务的IP地址和端口,用于外网用户终端获取服务;动态分发表也可以包括服务器集群内各终端的虚拟IP地址和端口,用于集群内的终端获取服务;动态分发表也可以包括其他标识信息,用于标识、查找提供服务的服务器,可根据实际需要灵活设定。The dynamic sub-publishing may include an IP address and a port for the server cluster to provide services to the external network, and the external network user terminal obtains the service; the dynamic sub-publishing may also include the virtual IP address and port of each terminal in the server cluster, and is used in the cluster. The terminal can obtain the service; the dynamic sub-publishing can also include other identification information for identifying and finding the server providing the service, which can be flexibly set according to actual needs.
当发起端向服务器集群发起建链请求,接入侧查询动态分发表,查找本次建链请求报文携带的目的地址和目的端口。When the initiator initiates a link establishment request to the server cluster, the access side queries the dynamic sub-publishing to find the destination address and destination port carried in the link-building request packet.
若接入侧在动态分发表中查找到发起端的本次建链请求报文携带的目的地址和目的端口,则发起端本次建链请求报文携带的目的地址和目的端口是服务器集群允许接入的地址和端口,接入侧判定发起端本次建链请求报文合法。If the access side finds the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and destination port carried by the originating end of the link establishment request packet are allowed by the server cluster. The incoming address and the port determine that the originating request packet is valid.
若接入侧在动态分发表中未查找到发起端的本次建链请求报文携带的目的地址和目的端口,则发起端的本次建链请求报文目的地址和目的端口,与当前服务器集群能够提供服务的地址和端口不符,因此,服务器集群不能与 发起端建链。接入侧将发起端的本次建链请求报文视为非法报文,做丢弃处理。If the access destination does not find the destination address and the destination port carried in the link-building request packet of the initiator, the destination address and destination port of the link-building request packet of the initiator can be compared with the current server cluster. The address and port of the service provided do not match, so the server cluster cannot The initiator builds the chain. On the access side, the link-building request packet of the originating end is regarded as an invalid packet and is discarded.
步骤S50、获取各服务节点的动态负荷参数,生成所述负荷分担表。Step S50: Obtain a dynamic load parameter of each service node, and generate the load sharing table.
在本实施例中,接入侧获取集群中各服务节点的负荷参数,生成负荷分担表。In this embodiment, the access side acquires load parameters of each service node in the cluster, and generates a load sharing table.
在集群服务器中,各服务节点的负荷状况根据实时处理状态都会产生变动。因此,各服务节点实时主动向接入侧上报各服务节点的负荷参数,用于接入侧生成负荷分担表。In a cluster server, the load status of each service node changes according to the real-time processing status. Therefore, each service node actively reports the load parameters of each service node to the access side in real time, and is used by the access side to generate a load sharing table.
其中,各服务节点的负荷参数包括各服务节点的负荷状况,各服务节点的负荷状况可以是各服务节点上的TCP链接数,也可以是各服务节点上的CPU使用率、内存占用率等技术参数,也可以是其他标识各服务节点负荷状况的参数,可根据实际需要灵活设定。The load parameter of each service node includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or may be the CPU usage rate and memory occupancy rate of each service node. The parameter can also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
各服务节点的负荷参数还包括各服务节点能够处理的服务请求。The load parameters of each service node also include service requests that each service node can handle.
由此,接入侧得到实时更新的负荷分担表。其中,负荷分担表记录了集群中各服务节点的负荷参数,用于选取负荷最小的服务节点。Thereby, the access side obtains a load sharing table updated in real time. The load sharing table records the load parameters of each service node in the cluster, and is used to select the service node with the smallest load.
由此,在接入侧根据预置的负荷分担表,分发建链请求报文时,选取能够处理发起端的服务请求的服务节点;接入侧在能够处理发起端的服务请求的服务节点中,选取负荷最小的服务节点,转发本次建链请求报文。Therefore, when the access side distributes the link establishment request message according to the preset load sharing table, the service node capable of processing the service request of the originating end is selected; the access side selects the service node capable of processing the service request of the originating end. The service node with the least load forwards the current link request message.
在本实施例中,接入侧部署动态分发表,记录预设的合法建链目的地址和目的端口;接入侧获取各服务节点的动态负荷参数,生成负荷分担表,用于根据各服务节点的负荷参数均与分发建链请求报文。本实施例中接入侧通过动态分发表筛选获取合法的建链请求报文,通过负荷分担表选取负荷最小的服务节点,均匀分发建链请求报文,实现了服务器集群的负荷均衡,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the access side deploys dynamic sub-publishing, and records the default legal link establishment destination address and destination port; the access side acquires dynamic load parameters of each service node, and generates a load sharing table, which is used according to each service node. The load parameters are all related to the distribution link request message. In this embodiment, the access side obtains a valid link-building request message through the dynamic sub-publishing screening, selects the service node with the least load through the load sharing table, and evenly distributes the link request message, thereby realizing the load balancing of the server cluster and reducing the load. The burden of the server cluster accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
可选地,参照图3,本发明分发建链方法第三实施例提供一种分发建链方法,基于上述图1或图2所示的实施例(本发明以图1为例),所述步骤 S30之后,还包括:Optionally, referring to FIG. 3, a third embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and constructing a chain, based on the embodiment shown in FIG. 1 or FIG. 2 (the present invention is illustrated by using FIG. 1). Step After S30, it also includes:
步骤S60、存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。Step S60: Store the current distribution link information, and generate a distribution session table, where the distribution session table is used for the distribution of subsequent messages of the initiator.
在接入侧转发本次建链请求报文给相应的服务节点后,接入侧存储本次分发建链的信息,生成分发会话表。After the link-building request packet is forwarded to the corresponding service node, the access side stores the information of the current distribution link and generates a distribution session table.
在部分实施例中,接入侧转发本次建链请求报文后,将本次建链的相关信息进行存储。In some embodiments, after the access side forwards the link establishment request message, the related information of the current link establishment is stored.
接入侧可以将建链请求报文携带的本端地址、本端端口、目的地址、目的端口和报文转发的目的服务节点标识信息,作为本次分发建链信息进行存储,生成分发会话表。The access side can store the local address, the local port, the destination address, the destination port, and the destination service node identification information of the packet forwarding information as the current distribution link information to generate the distribution session table. .
在获取本次建链的相关信息后,接入侧生成会话分发表,并动态更新,实时记录建链信息用于会话分发表的动态生成。After obtaining the relevant information of the current building chain, the access side generates a session segment and publishes it dynamically, and records the link establishment information in real time for the dynamic generation of the session segmentation.
会话分发表可以用于后续发起端非建链请求报文的转发。具体的,在发起端与服务节点进行会话时,首先,接入侧接收到同一发起端的非建链请求报文时,查询会话分发表,获取已与发起端建链的服务节点。The session sub-publishing can be used to forward the non-chain-building request packets of the subsequent initiator. Specifically, when the initiating end performs a session with the serving node, first, when the access side receives the non-building request message of the same originating end, the query session is published, and the service node that has been established with the initiating end is obtained.
接入侧将本次报文转发给获取的服务节点。The access side forwards the current packet to the obtained service node.
服务节点收到报文后,进行相应的处理,向发起端提供服务。After receiving the packet, the service node performs corresponding processing to provide services to the initiator.
在本实施例中,接入侧通过存储本次分发建链信息,生成分发会话表,用于后续同一发起端报文的分发。本实施例实现了当发起端与服务节点建链时,接入侧再接收到发起端后续的非建链请求报文时,可直接根据分发会话表转发至相应的服务节点,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the access side generates a distribution session table by using the current distribution link information to be used for subsequent distribution of the same originating end message. In this embodiment, when the initiating end establishes a chain with the serving node, when the access side receives the subsequent non-established link request message from the initiating end, the access side can directly forward to the corresponding service node according to the distribution session table, thereby alleviating the server cluster. The burden accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
可选地,参照图4,本发明分发建链方法第四实施例提供一种分发建链方法,基于上述图3所示的实施例,所述步骤S20之后,还包括:Optionally, referring to FIG. 4, the fourth embodiment of the method for distributing and constructing a chain of the present invention provides a method for distributing and building a chain. After the step S20, the method further includes:
步骤S70、根据所述分发会话表,判断所述发起端是否进行过建链。Step S70: Determine, according to the distribution session table, whether the originating end has been built.
在接入侧获取合法的建链请求报文后,根据动态生成的分发会话表,查找发起端是否已和服务器集群建立过建链。After obtaining the valid link-building request packet on the access side, check whether the initiator has established a chain with the server cluster according to the dynamically generated distribution session table.
在部分实施例中,接入侧根据当前发起端的本端地址、本端端口查找分 发会话表是否记录了当前发起端建链报文转发的目的服务节点标识信息。In some embodiments, the access side searches for the local address and the local port of the current initiator. Whether the sending session table records the destination service node identification information of the current originating link-building packet forwarding.
若接入侧在分发会话表中成功查找到当前发起端建链报文转发的目的服务节点标识信息,则判定发起端已与服务器集群进行过建链;If the access side successfully finds the destination service node identifier information of the current initiator connection packet forwarding in the distribution session table, it determines that the initiator has been chained with the server cluster;
若接入侧在分发会话表中未成功查找到当前发起端建链报文转发的目的服务节点标识信息,则判定发起端未与服务器集群进行过建链。If the access side does not successfully find the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it determines that the originating end has not been chained with the server cluster.
由此,接入侧得到判定结果。Thereby, the access side obtains the determination result.
步骤S80、若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;若所述发起端未进行过建链,则转入执行步骤S30。Step S80: If the initiating end has been built, the service node that has been linked with the initiating end is obtained according to the session, and the legal chain-building request packet is forwarded to the The obtained service node performs chaining; if the originating end has not been chained, the process proceeds to step S30.
若发起端和服务器集群进行过建链,则接入侧根据会话分发表,获取已和当前发起端进行过建链的服务节点标识信息,并根据标识信息将建链请求报文转发给获取的服务节点,由获取的服务节点与发起端进行建链。If the initiator and the server cluster are connected to each other, the access side publishes the service node identification information that has been chained with the current initiator, and forwards the link request packet to the obtained information according to the identifier information. The service node is constructed by the obtained service node and the initiator.
若发起端和服务器集群未进行过建链,则接入侧根据预置的负荷分担表,将本次建链请求报文转发给负荷最小的服务节点,完成本次建链请求报文的分发,由选取的服务节点与发起端进行TCP协商。If the initiator and the server cluster have not been chained, the access side forwards the link request packet to the service node with the least load according to the preset load sharing table, and completes the distribution of the link request packet. The selected service node performs TCP negotiation with the initiator.
在本实施例中,接入侧根据分发会话表,判断发起端是否进行过建链;若发起端进行过建链,则接入侧根据预置的负荷分担表,将本次建链请求报文转发给已和发起端进行过建链的服务节点进行建链;若发起端未进行过建链,则接入侧根据预置的负荷分担表,将本次建链请求报文转发给负荷最小的服务节点进行建链。本实施例通过会话分发表的判定,将已进行过建链的发起端建链请求分发给已和发起端进行过建链的服务节点进行处理,减轻了集群中其他服务节点的处理负担,均衡了集群中各服务节点的负荷,从而避免报文重复分发造成资源浪费,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the access side determines, according to the distribution session table, whether the initiator has been built. If the initiator performs the link establishment, the access side reports the link establishment request according to the preset load sharing table. The file is forwarded to the service node that has been chained with the initiator. If the initiator does not perform the link establishment, the access side forwards the link request packet to the load according to the preset load sharing table. The smallest service node is built. In this embodiment, the request for the establishment of the link establishment link is distributed to the service node that has been chained with the initiator, and the processing load of other service nodes in the cluster is reduced and balanced. The load of each service node in the cluster avoids the waste of resources caused by repeated packet distribution, accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
参照图5,本发明分发建链装置第一实施例提供一种分发建链装置,所述分发建链装置包括: Referring to FIG. 5, a first embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device, and the distribution chain-building device includes:
接收模块100,设置成:接收发起端的建链请求报文。The receiving module 100 is configured to: receive a link establishment request message of the initiator.
本发明实施例主要应用于分布式系统中,用户通过与服务器集群建链,接入服务集群。本发明应用场景可以是用户终端发起建链接入服务集群,可以是第三方服务器发起建链接入服务集群,也可以是服务集群内网的终端建链获取服务,可根据实际需要灵活应用。The embodiments of the present invention are mainly applied to a distributed system, and a user accesses a service cluster by establishing a chain with a server cluster. The application scenario of the present invention may be that the user terminal initiates the establishment of the link-in service cluster, and the third-party server may initiate the establishment of the link-in service cluster, or may be the terminal-building access service of the service cluster intranet, and may be flexibly applied according to actual needs.
本实施例以用户客户端与核心网建立PCT链接,接入核心网进行举例说明。当然,本发明应用场景不限定于PCT建链。In this embodiment, a PCT link is established between the user client and the core network, and the core network is accessed for example. Of course, the application scenario of the present invention is not limited to the PCT chain.
在客户端需要获取核心网的服务时,客户端作为发起端,首先需要和核心网的建立PCT链接。核心网服务器集群的接入侧接收建链请求报文,并将建链请求报文分发给服务节点进行建链和提供服务。When the client needs to obtain the services of the core network, the client needs to establish a PCT link with the core network as the initiator. The access side of the core network server cluster receives the link establishment request packet, and distributes the link establishment request message to the service node for establishing a link and providing a service.
在部分实施例中,发起端发出建链请求报文TCP SYN(synchronous,握手信号)报文,发起建链。In some embodiments, the initiator sends a TCP SYN (synchronous) message to establish a link.
其中,TCP SYN报文中携带有发起端的本端地址、本端端口,和本次建链的目的地址、目的端口,还可以携带其他信息例如本次服务请求,可根据实际需要灵活设定。The TCP SYN packet carries the local address of the originating end, the local port, and the destination address and destination port of the current link. It can also carry other information, such as this service request, and can be flexibly set according to actual needs.
发起端可以通过WiMax(Worldwide Interoperability for Microwave Access,全球微波互联接入)、WLAN(Wireless Local Area Networks,无线局域网络)、HSPDA(High Speed Downlink Packet Access,高速下行分组接入)、网线、或3G等通信技术与核心网进行网络通信,接入核心网。The initiator can use WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or 3G. The communication technology communicates with the core network and accesses the core network.
接收模块100接收发起端的TCP SYN报文。需要说明的是,本发明分发建链装置可以位于PC(personal computer,个人计算机)上,也可以位于接口板上,也可以位于其他具有网络报文转发能力的设备上,可根据实际需要灵活设定。The receiving module 100 receives the TCP SYN packet of the initiator. It should be noted that the distribution chain-building device of the present invention may be located on a PC (personal computer), or on an interface board, or on other devices with network packet forwarding capabilities, and may be flexibly set according to actual needs. set.
筛选模块200,设置成:根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文。The screening module 200 is configured to: obtain a legal link request message from the destination address and the destination port from the link establishment request message according to the preset dynamic distribution.
在接收模块100收到发起端的TCP SYN报文后,筛选模块200解析发起端的TCP SYN,获取发起端本次建链的目的地址和目的端口,设置成:判断本次TCP SYN报文是否合法。After the receiving module 100 receives the TCP SYN packet of the originating end, the screening module 200 parses the TCP SYN of the initiating end, and obtains the destination address and the destination port of the initiating end of the initiating end, and sets the following to determine whether the current TCP SYN packet is legal.
筛选模块200预先部署有动态分发表,动态分发表记录了核心网允许接 入服务的目的地址和目的端口。The screening module 200 is pre-deployed with dynamic sub-publishing, and the dynamic sub-publishing records allow the core network to be connected. Destination address and destination port of the service.
筛选模块200根据预先部署的动态分发表,查询本次TCP SYN报文的目的地址和目的端口是否在动态分发表中。The screening module 200 queries the pre-deployed dynamic sub-publishing to query whether the destination address and the destination port of the current TCP SYN packet are in the dynamic sub-publishing.
若本次TCP SYN报文的目的地址和目的端口不在动态分发表中,则本次TCP SYN报文不合法,做丢弃处理;If the destination address and the destination port of the TCP SYN packet are not in the dynamic sub-publishing, the TCP SYN packet is invalid and discarded.
若本次TCP SYN报文的目的地址和目的端口在动态分发表中,则本次TCP SYN报文合法,可继续进行建链。If the destination address and the destination port of the current TCP SYN packet are in dynamic distribution, the TCP SYN packet is valid and can continue to be built.
由此,筛选模块200获得目的地址和目的端口合法的建链请求报文。Therefore, the screening module 200 obtains a legitimate link request message of the destination address and the destination port.
转发模块300,设置成:根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The forwarding module 300 is configured to: forward the legal link request message to the service node with the least load to establish a chain according to the preset load sharing table.
在筛选模块200获取合法的TCP SYN报文后,转发模块300需要将TCP SYN报文转发给服务节点进行建链。After the screening module 200 obtains a valid TCP SYN packet, the forwarding module 300 needs to forward the TCP SYN packet to the service node for establishing a link.
在部分实施例中,转发模块300查询预置的负荷分担表。In some embodiments, the forwarding module 300 queries the preset load sharing table.
其中,负荷分担表为动态生成的,记录了集群中各服务节点的负荷状况,实时动态更新。The load sharing table is dynamically generated, and the load status of each service node in the cluster is recorded, and the dynamic update is performed in real time.
转发模块300选取当前负荷最小的服务节点。The forwarding module 300 selects the service node with the lowest current load.
转发模块300采用负荷分担策略,将本次TCP SYN报文转发给选取的服务节点,完成本次建链请求报文的分发,由选取的服务节点与发起端进行TCP协商。The forwarding module 300 uses the load sharing policy to forward the current TCP SYN packet to the selected service node, and completes the distribution of the link establishment request message, and the selected service node performs TCP negotiation with the initiator.
若选取的服务节点与发起端TCP协商成功,则后续服务节点与发起端的非TCP报文,均由转发模块300直接转发给当前服务节点。If the selected service node and the initiator TCP are successfully negotiated, the non-TCP packets of the subsequent service node and the initiator are directly forwarded by the forwarding module 300 to the current serving node.
当然,本发明分发建链装置不限定于用户终端与服务器集群的建链,也可以应用于服务器集群内部的分发建链。Of course, the distribution chaining device of the present invention is not limited to the construction of the user terminal and the server cluster, and can also be applied to the distribution and establishment of the server cluster.
以服务器集群内部的分发建链进行举例说明,在部分实施例中,将需要获取服务的终端作为发起端,发起端发出建链请求报文。For example, in the embodiment, the terminal that needs to obtain the service is used as the initiator, and the initiator sends the link request message.
在服务器集群内部,各终端均有唯一可识别的标识,例如虚拟IP地址和端口,使本发明分发建链装置可以根据此标识识别不同的终端。Within the server cluster, each terminal has a uniquely identifiable identifier, such as a virtual IP address and port, such that the distribution chaining device of the present invention can identify different terminals based on the identification.
接收模块100接收发起端的建链请求报文,然后筛选模块200根据预置 的动态分发表,查找发起端本次建链请求的目的IP地址和端口。The receiving module 100 receives the link establishment request message of the initiator, and then the screening module 200 according to the preset The dynamic sub-publishing is to find the destination IP address and port of the initiator connection request.
若未成功找到发起端本次建链请求的目的IP地址和端口,则筛选模块200丢弃本次建链请求报文;If the destination IP address and the port of the initiator connection request are not successfully found, the screening module 200 discards the link establishment request packet;
若成功找到发起端本次建链请求的目的IP地址和端口,则转发模块300根据预置的负荷分担表,选取负荷最小的服务节点,并将本次建链请求报文转发给选取的服务节点。If the destination IP address and the port of the initiator connection request are successfully found, the forwarding module 300 selects the service node with the least load according to the preset load sharing table, and forwards the link request message to the selected service. node.
由该选取的服务节点与发起端进行建链,并提供相应服务。The selected service node is chained with the initiator and provides corresponding services.
在本实施例中,通过服务器集群接收模块100接收发起端的建链请求报文;筛选模块200根据预置的动态分发表,从建链请求报文中获取目的地址和目的端口合法的建链请求报文;转发模块300根据预置的负荷分担表,将合法的建链请求报文转发给负荷最小的服务节点进行建链,实现对接入的建链请求进行均匀的分发。本实施例实现了对建链请求报文的均匀分发,从而使服务器集群各服务节点的负荷达到均衡,避免了负荷不均衡导致的资源浪费,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the server cluster receiving module 100 receives the link establishment request message of the originating end; the screening module 200 obtains the legal connection request of the destination address and the destination port from the link establishment request message according to the preset dynamic sub-publishing message. The forwarding module 300 forwards the legal link-building request packet to the service node with the least load according to the preset load sharing table, and implements the chain-building request to uniformly distribute the access-building request. In this embodiment, the uniform distribution of the request packets is implemented, so that the load of the service nodes of the server cluster is balanced, the waste of resources caused by the load imbalance is avoided, the burden of the server cluster is reduced, and the response of the server cluster is accelerated. Speed, enhances the overall performance of the server cluster, and brings a better business experience to users.
可选地,参照图6,本发明分发建链装置第二实施例提供一种分发建链装置,基于上述图5所示的实施例,所述分发建链装置还包括:Optionally, referring to FIG. 6, the second embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device. According to the embodiment shown in FIG. 5, the distribution chain-building device further includes:
部署模块400,设置成:部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口。The deployment module 400 is configured to: deploy the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port.
在本实施例中,服务器集群预设有允许接入服务的服务器地址和端口。In this embodiment, the server cluster is pre-configured with a server address and port that allows access to the service.
部署模块400将本端允许接入服务的服务器地址和端口记录为动态分发表,作为提供服务的地址和端口,部署在筛选模块200。The deployment module 400 records the server address and port that the local end allows access to the service as dynamic sub-publishing, and is deployed in the screening module 200 as the address and port for providing the service.
其中,动态分发表可以包括服务器集群对外网提供服务的IP地址和端口,用于外网用户终端获取服务;动态分发表也可以包括服务器集群内各终端的虚拟IP地址和端口,用于集群内的终端获取服务;动态分发表也可以包括其他标识信息,用于标识、查找提供服务的服务器,可根据实际需要灵活设定。The dynamic sub-publishing may include an IP address and a port for the server cluster to provide services to the external network, and the external network user terminal obtains the service; the dynamic sub-publishing may also include the virtual IP address and port of each terminal in the server cluster, and is used in the cluster. The terminal can obtain the service; the dynamic sub-publishing can also include other identification information for identifying and finding the server providing the service, which can be flexibly set according to actual needs.
当发起端向服务器集群发起建链请求,筛选模块200查询动态分发表,查找本次建链请求报文携带的目的地址和目的端口。 When the initiator initiates a link establishment request to the server cluster, the screening module 200 queries the dynamic sub-publishing to find the destination address and destination port carried in the link-building request packet.
若筛选模块200在动态分发表中查找到发起端的本次建链请求报文携带的目的地址和目的端口,则发起端本次建链请求报文携带的目的地址和目的端口是服务器集群允许接入的地址和端口,筛选模块200判定发起端本次建链请求报文合法。If the filtering module 200 finds the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and the destination port carried by the originating end of the link-building request packet are allowed by the server cluster. The filtering module 200 determines that the initiator establishes the chain request message legally.
若筛选模块200在动态分发表中未查找到发起端的本次建链请求报文携带的目的地址和目的端口,则发起端的本次建链请求报文目的地址和目的端口,与当前服务器集群能够提供服务的地址和端口不符,因此,服务器集群不能与发起端建链。筛选模块200将发起端的本次建链请求报文视为非法报文,做丢弃处理。If the filtering module 200 does not find the destination address and the destination port carried in the link establishment request packet of the originating end in the dynamic sub-publishing, the destination address and the destination port of the link-building request packet of the originating end, and the current server cluster can The address and port of the service provided do not match, so the server cluster cannot be chained with the initiator. The screening module 200 treats the link establishment request message of the originating end as an illegal packet and performs discard processing.
获取模块500,设置成:获取各服务节点的动态负荷参数,生成所述负荷分担表。The obtaining module 500 is configured to: acquire dynamic load parameters of each service node, and generate the load sharing table.
在本实施例中,获取模块500获取集群中各服务节点的负荷参数,生成负荷分担表。In this embodiment, the obtaining module 500 acquires load parameters of each service node in the cluster, and generates a load sharing table.
在集群服务器中,各服务节点的负荷状况根据实时处理状态都会产生变动。因此,各服务节点实时主动向接入侧上报各服务节点的负荷参数,用于接入侧生成负荷分担表。In a cluster server, the load status of each service node changes according to the real-time processing status. Therefore, each service node actively reports the load parameters of each service node to the access side in real time, and is used by the access side to generate a load sharing table.
其中,各服务节点的负荷参数包括各服务节点的负荷状况,各服务节点的负荷状况可以是各服务节点上的TCP链接数,也可以是各服务节点上的CPU使用率、内存占用率等技术参数,也可以是其他标识各服务节点负荷状况的参数,可根据实际需要灵活设定。The load parameter of each service node includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or may be the CPU usage rate and memory occupancy rate of each service node. The parameter can also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
各服务节点的负荷参数还包括各服务节点能够处理的服务请求。The load parameters of each service node also include service requests that each service node can handle.
由此,获取模块500得到实时更新的负荷分担表。其中,负荷分担表记录了集群中各服务节点的负荷参数,用于选取负荷最小的服务节点。Thereby, the acquisition module 500 obtains a load sharing table updated in real time. The load sharing table records the load parameters of each service node in the cluster, and is used to select the service node with the smallest load.
由此,在转发模块300根据预置的负荷分担表,分发建链请求报文时,首先,选取能够处理发起端的服务请求的服务节点;然后,转发模块300在能够处理发起端的服务请求的服务节点中,选取负荷最小的服务节点,转发本次建链请求报文。Therefore, when the forwarding module 300 distributes the link establishment request message according to the preset load sharing table, first, the service node capable of processing the service request of the originating end is selected; and then, the forwarding module 300 is capable of processing the service request service of the originating end. In the node, the service node with the least load is selected to forward the request for establishing the link.
在本实施例中,部署模块400动态分发表,记录预设的合法建链目的地 址和目的端口;获取模块500获取各服务节点的动态负荷参数,生成负荷分担表,设置成:根据各服务节点的负荷参数均与分发建链请求报文。本实施例中分发建链装置通过动态分发表筛选获取合法的建链请求报文,通过负荷分担表选取负荷最小的服务节点,均匀分发建链请求报文,实现了服务器集群的负荷均衡,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the deployment module 400 dynamically publishes and records the preset legal link destination. The obtaining module 500 obtains the dynamic load parameters of each service node, generates a load sharing table, and sets the load request message according to the load parameters of each service node. In this embodiment, the distribution chain-building device obtains the legal chain-building request message through the dynamic sub-publishing screening, selects the service node with the least load through the load sharing table, and evenly distributes the chain-building request message, thereby realizing the load balancing of the server cluster and reducing the load. The burden of the server cluster accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better business experience to the user.
可选地,参照图7,本发明分发建链装置第三实施例提供一种分发建链装置,基于上述图5或图6所示的实施例(本发明以图5为例),所述分发建链装置还包括:Optionally, referring to FIG. 7, the third embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device, based on the embodiment shown in FIG. 5 or FIG. 6 (the invention is illustrated by using FIG. 5). The distribution chaining device also includes:
存储模块600,设置成:存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。The storage module 600 is configured to: store the current distribution link information, and generate a distribution session table, where the distribution session table is used for the distribution of subsequent messages of the initiator.
在转发模块300转发本次建链请求报文给相应的服务节点后,存储模块600存储本次分发建链的信息,生成分发会话表。After the forwarding module 300 forwards the link request message to the corresponding service node, the storage module 600 stores the information of the current link establishment and generates a distribution session table.
在部分实施例中,转发模块300转发本次建链请求报文后,存储模块600将本次建链的相关信息进行存储。In some embodiments, after the forwarding module 300 forwards the link request message, the storage module 600 stores the related information of the current link.
存储模块600可以将建链请求报文携带的本端地址、本端端口、目的地址、目的端口和报文转发的目的服务节点标识信息,作为本次分发建链信息进行存储,生成分发会话表。The storage module 600 can store the local address, the local port, the destination address, the destination port, and the destination service node identifier information of the packet forwarding information as the current distribution link information, and generate a distribution session table. .
在获取本次建链的相关信息后,存储模块600生成会话分发表,并动态更新,实时记录建链信息用于会话分发表的动态生成。After obtaining the related information of the current link establishment, the storage module 600 generates a session sub-publishing and dynamically updates, and records the link-building information in real time for dynamic generation of the session sub-publishing.
会话分发表可以用于后续发起端非建链请求报文的转发。具体的,在发起端与服务节点进行会话时,首先,接收模块100接收到同一发起端的非建链请求报文时,转发模块300查询会话分发表,获取已与发起端建链的服务节点。The session sub-publishing can be used to forward the non-chain-building request packets of the subsequent initiator. Specifically, when the initiating end performs a session with the serving node, first, when the receiving module 100 receives the non-building request message of the same originating end, the forwarding module 300 queries the session sub-publishing and obtains the service node that has been established with the initiating end.
转发模块300将本次报文转发给获取的服务节点。The forwarding module 300 forwards the current message to the obtained service node.
服务节点收到报文后,进行相应的处理,向发起端提供服务。After receiving the packet, the service node performs corresponding processing to provide services to the initiator.
在本实施例中,存储模块600通过存储本次分发建链信息,生成分发会话表,用于后续同一发起端报文的分发。本实施例实现了当发起端与服务节 点建链时,接收模块100再接收到发起端后续的非建链请求报文时,可直接根据分发会话表由转发模块300转发至相应的服务节点,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the storage module 600 generates a distribution session table for storing the subsequent initiating end messages by storing the current distribution link information. This embodiment implements the initiator and service section. When the point is established, the receiving module 100 can directly forward the non-chain-building request message to the initiating end, and can be directly forwarded to the corresponding service node by the forwarding module 300 according to the distribution session table, thereby reducing the burden on the server cluster and speeding up the server. The response speed of the cluster enhances the overall performance of the server cluster and provides users with a better business experience.
可选地,参照图8,本发明分发建链装置第四实施例提供一种分发建链装置,基于上述图7所示的实施例,所述分发建链装置还包括:Optionally, referring to FIG. 8, the fourth embodiment of the distribution chain-building device of the present invention provides a distribution chain-building device. The distribution chain-building device further includes:
判定模块700,设置成:根据所述分发会话表,判断所述发起端是否进行过建链。The determining module 700 is configured to: determine, according to the distribution session table, whether the originating end has been built.
在筛选模块200获取合法的建链请求报文后,判定模块700根据动态生成的分发会话表,查找发起端是否已和服务器集群建立过建链。After the filtering module 200 obtains the valid link establishment request message, the determining module 700 searches whether the initiator has established a chain with the server cluster according to the dynamically generated distribution session table.
在部分实施例中,判定模块700根据当前发起端的本端地址、本端端口查找分发会话表是否记录了当前发起端建链报文转发的目的服务节点标识信息。In some embodiments, the determining module 700 searches the distribution session table according to the local address of the current originating end and the local port to record the destination service node identification information of the current originating link-building packet forwarding.
若判定模块700在分发会话表中成功查找到当前发起端建链报文转发的目的服务节点标识信息,则判定发起端已与服务器集群进行过建链;If the determining module 700 successfully finds the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it is determined that the initiator end has been chained with the server cluster;
若判定模块700在分发会话表中未成功查找到当前发起端建链报文转发的目的服务节点标识信息,则判定发起端未与服务器集群进行过建链。If the determining module 700 does not successfully find the destination service node identifier information of the current originating link-building packet forwarding in the distribution session table, it is determined that the originating end has not been chained with the server cluster.
由此,判定模块700得到判定结果。Thereby, the determination module 700 obtains the determination result.
所述转发模块300还设置成:,若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;若所述发起端未进行过建链,则根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The forwarding module 300 is further configured to: if the initiator performs chaining, obtain a service node that has been chained with the initiator according to the session, and establish the legal The chain request packet is forwarded to the obtained service node for chain establishment; if the initiator is not chained, the legal chain-building request packet is forwarded to the minimum load according to the preset load sharing table. The service node is chained.
若发起端和服务器集群进行过建链,则转发模块300根据会话分发表,获取已和当前发起端进行过建链的服务节点标识信息,并根据标识信息将建链请求报文转发给获取的服务节点,由获取的服务节点与发起端进行建链。If the initiator and the server cluster are connected to each other, the forwarding module 300 publishes the service node identification information that has been chained with the current initiator, and forwards the link request packet to the obtained information according to the identifier information. The service node is constructed by the obtained service node and the initiator.
若发起端和服务器集群未进行过建链,则转发模块300根据预置的负荷分担表,将本次建链请求报文转发给负荷最小的服务节点,完成本次建链请 求报文的分发,由选取的服务节点与发起端进行TCP协商。If the initiator and the server cluster are not chained, the forwarding module 300 forwards the link request packet to the service node with the least load according to the preset load sharing table. The distribution of the message is sought, and the selected service node performs TCP negotiation with the originating end.
在本实施例中,判定模块700根据分发会话表,判断发起端是否进行过建链;若发起端进行过建链,则转发模块300接入侧根据预置的负荷分担表,将本次建链请求报文转发给已和发起端进行过建链的服务节点进行建链;若发起端未进行过建链,则转发模块300根据预置的负荷分担表,将本次建链请求报文转发给负荷最小的服务节点进行建链。本实施例通过会话分发表的判定,将已进行过建链的发起端建链请求分发给已和发起端进行过建链的服务节点进行处理,减轻了集群中其他服务节点的处理负担,均衡了集群中各服务节点的负荷,从而避免报文重复分发造成资源浪费,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the determining module 700 determines whether the originating end has been built according to the distribution session table. If the originating end performs the chain building, the accessing unit 300 of the forwarding module 300 will build the current load according to the preset load sharing table. The chain request packet is forwarded to the service node that has been chained with the initiator. If the initiator does not perform the link establishment, the forwarding module 300 will set the link request packet according to the preset load sharing table. Forward to the least loaded service node for chaining. In this embodiment, the request for the establishment of the link establishment link is distributed to the service node that has been chained with the initiator, and the processing load of other service nodes in the cluster is reduced and balanced. The load of each service node in the cluster avoids the waste of resources caused by repeated packet distribution, accelerates the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
参照图9,本发明分发建链系统第一实施例提供一种分发建链系统,所述分发建链系统包括发起端A和服务器B,其中:Referring to FIG. 9, a first embodiment of the distribution chain building system of the present invention provides a distribution chain building system, where the distribution chain building system includes an initiator A and a server B, wherein:
所述发起端A,用于发送建链请求报文。The initiator A is configured to send a link establishment request message.
在本实施例中,以向服务器集群发起建链请求、获取服务的终端作为发起端。In this embodiment, the terminal that initiates the link establishment request and obtains the service to the server cluster serves as the initiator.
根据本发明应用场景,发起端A可以分为外网终端和内网终端。According to the application scenario of the present invention, the originating terminal A can be divided into an external network terminal and an intranet terminal.
其中,外网终端为服务器集群外的、获取服务器集群服务的移动终端或服务器等终端。外网终端可以通过WiMax(Worldwide Interoperability for Microwave Access,全球微波互联接入)、WLAN(Wireless Local Area Networks,无线局域网络)、HSPDA(High Speed Downlink Packet Access,高速下行分组接入)、网线、或3G等通信技术与服务器集群进行通信。例如,宽带移动终端均可能通过宽带网络,使用TCP协议向核心网网元获取服务。The external network terminal is a terminal such as a mobile terminal or a server that obtains a server cluster service outside the server cluster. The external network terminal can pass WiMax (Worldwide Interoperability for Microwave Access), WLAN (Wireless Local Area Networks), HSPDA (High Speed Downlink Packet Access), network cable, or Communication technologies such as 3G communicate with server clusters. For example, a broadband mobile terminal may obtain a service from a core network element by using a TCP protocol through a broadband network.
内网终端为服务器集群内获取服务的终端或节点。例如,核心网内的节点需要向UDS请求目录服务,UDS服务器提供本端的IP和端口。当该节点请求服务的时候,服务器B将会根据负荷分担在相应的UDS服务器节点建立链接,并提供相关服务。The intranet terminal is a terminal or node that obtains services within the server cluster. For example, a node in the core network needs to request a directory service from the UDS, and the UDS server provides the IP address and port of the local end. When the node requests the service, Server B will establish a link on the corresponding UDS server node according to the load sharing and provide related services.
所述服务器B包括接入侧B1和服务侧B2; The server B includes an access side B1 and a service side B2;
所述接入侧B1包括接收模块100、筛选模块200、转发模块300、部署模块400、获取模块500、存储模块600和判定模块700;The access side B1 includes a receiving module 100, a screening module 200, a forwarding module 300, a deployment module 400, an obtaining module 500, a storage module 600, and a determining module 700;
所述服务侧B2,用于接收所述建链请求报文,与所述发起端A建链。The service side B2 is configured to receive the link establishment request message and establish a chain with the initiator end A.
服务器B包括接入侧B1和服务侧B2。其中,接入侧B1用于接收发起端A的建链请求报文并分发给服务侧B2,接收服务侧B2的应答并转发给发起端A.The server B includes an access side B1 and a service side B2. The access side B1 is configured to receive the link establishment request message of the initiator A and distribute it to the service side B2, and receive the response of the service side B2 and forward it to the initiator A.
服务侧B2用于接收接入侧B1分发的报文并应答,向发起端A提供相应的服务。The service side B2 is configured to receive and respond to the message distributed by the access side B1, and provide the corresponding service to the initiator A.
需要说明的是,接入侧的接收报文功能和转发报文功能可由同一物理硬件实现,也可由不同的物理硬件组合实现。It should be noted that the function of receiving packets and forwarding packets on the access side may be implemented by the same physical hardware or by different physical hardware combinations.
参照图10,以本发明应用场景为手机客户端向IMS核心网请求服务,进行举例说明。Referring to FIG. 10, an application scenario of the present invention is used for requesting a service from a mobile phone client to an IMS core network.
在本应用场景中,发起端A包括有多个手机客户端,手机客户端请求获取呼叫限制限制功能的服务业务。In this application scenario, the originating end A includes a plurality of mobile phone clients, and the mobile phone client requests the service service of the call restriction limiting function.
手机客户端通过TCP链接接入IMS核心网,接口板作为接入侧B1接收手机客户端的建链请求报文并进行分发。接口板基于SIP-I(Session Initiation Protocol,会话初始协议)进行会话管理。本实施例中包括有备用接口板SIP-I,用于处理突发情况。The mobile phone client accesses the IMS core network through the TCP link, and the interface board serves as the access side B1 to receive the link request message of the mobile phone client and distribute it. The interface board performs session management based on SIP-I (Session Initiation Protocol). In this embodiment, a spare interface board SIP-I is included for handling an emergency situation.
IMS核心网中的BSF/AP网元作为服务侧B2,为手机客户端提供触发业务。The BSF/AP network element in the IMS core network serves as the service side B2 to provide trigger services for the mobile phone client.
具体的,使用Client-1、Client-2……Client-N表征各请求服务的手机客户端。Specifically, Client-1, Client-2, and Client-N are used to represent the mobile client of each request service.
Client-1、Client-2……Client-N向IMS核心网请求开启呼叫限制功能的开启服务,该功能需要通过HTTP协议向BSF/AP网元发起请求。在HTTP请求发起前,Client-1、Client-2……Client-N需要和BSF/AP网元建立TCP链接。Client-1, Client-2, and Client-N request the IMS core network to enable the call restriction function. This function needs to initiate a request to the BSF/AP network element through the HTTP protocol. Client-1, Client-2, and Client-N need to establish a TCP link with the BSF/AP network element before the HTTP request is initiated.
作为一种实施方式,首先,Client-1、Client-2……Client-N向IMS核心网发出TCP SYN建链请求报文。As an implementation manner, first, Client-1, Client-2, ..., Client-N send a TCP SYN link establishment request message to the IMS core network.
接口板收到手机客户端发出的SYN报文以后,解析报文中的目的IP地址和端口,根据预置的动态分发表依次检查Client-1、Client-2……Client-N是否是本端允许接入的地址和端口。 After receiving the SYN packet sent by the mobile phone client, the interface board parses the destination IP address and port in the packet, and checks whether Client-1, Client-2, Client-N is the local end according to the preset dynamic distribution. The address and port that are allowed to access.
如果不是本端允许接入的地址和端口,接口板将丢弃SYN报文;If the address and port are not allowed to be accessed, the interface board discards the SYN packet.
如果是本端允许接入的地址和端口,则接口板根据预置的负荷分担表查找BSF/AP网元中服务处理节点SMP(Symmetric Multi Processing,对称多处理系统),得到各服务处理结点SMP-1、SMP-2……SMP-N。If the address and the port are allowed to be accessed by the local device, the interface board searches for the SMP (Symmetric Multi Processing) in the BSF/AP network element according to the preset load sharing table to obtain the service processing nodes. SMP-1, SMP-2...SMP-N.
接口板依次为Client-1、Client-2……Client-N的建链,根据负荷分担表选取相应的负荷最小的服务处理节点SMP。需要说明的是,接口板为Client-1、Client-2……Client-N建链所选取的服务处理节点SMP可以是相同的,也可以是不同的。The interface board is the link of Client-1, Client-2, and Client-N. The service load node SMP with the smallest load is selected according to the load sharing table. It should be noted that the service processing node SMP selected by the interface board for Client-1, Client-2, Client-N, or the like may be the same or different.
接口板分别将Client-1、Client-2……Client-N的SYN报文转发给相应的已选取的服务处理节点SMP。The interface board forwards the SYN packets of Client-1, Client-2, and Client-N to the corresponding service processing node SMP.
由选取的服务处理节点SMP分别与发起端Client-1、Client-2……Client-N进行TCP三次握手,完成TCP建链,接口板记录下每个手机客户端的会话,生成会话分发表。The selected service processing node SMP performs a TCP three-way handshake with the initiators Client-1, Client-2, ... Client-N, respectively, and completes the TCP link establishment. The interface board records the session of each mobile client and generates a session sub-publish.
接口板收到Client-1、Client-2……Client-N发起的开启呼叫限制请求报文,根据各个手机客户端的IP地址和端口,在建立好的会话中,根据会话分发表获取已和手机客户端建立过链接的服务处理节点SMP,并将请求报文转发到获取的服务处理节点SMP。The interface board receives the call-opening request message initiated by Client-1, Client-2, and Client-N. According to the IP address and port of each mobile client, the interface is published according to the session. The client establishes the linked service processing node SMP and forwards the request message to the obtained service processing node SMP.
各服务处理节点SMP收到开启呼叫限制请求后,处理手机客户端请求,并把处理结果发送回手机客户端。After receiving the call restriction request, each service processing node SMP processes the mobile client request and sends the processing result back to the mobile client.
在本实施例中,分发建链系统包括发起端A和服务器B。发起端A发起建链请求,服务器B通过接入侧B1均匀分发建链请求报文,使得服务侧B2能够均衡处理发起端A的建链请求和服务请求。本实施例实现了服务器集群的负荷均衡,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the distribution chain building system includes an initiator A and a server B. The initiator A initiates the link establishment request, and the server B uniformly distributes the link establishment request message through the access side B1, so that the service side B2 can uniformly process the link establishment request and the service request of the initiator A. This embodiment implements load balancing of the server cluster, reduces the burden on the server cluster, speeds up the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
可选地,参照图11,本发明分发建链系统第二实施例提供一种分发建链系统,基于上述图9所示的实施例,所述服务侧B2包括:Optionally, referring to FIG. 11, the second embodiment of the distribution chain-building system of the present invention provides a distribution chain-building system. Based on the embodiment shown in FIG. 9, the service side B2 includes:
各服务节点B21,所述各服务节点B21用于将动态负荷参数发送给所述接入侧B1,接收所述接入侧转发的建链请求报文,并根据所述建链请求报文 与所述发起端A进行建链,接收所述接入侧转发的所述发起端的后续报文。Each of the service nodes B21, the service node B21 is configured to send the dynamic load parameter to the access side B1, and receive the link establishment request message forwarded by the access side, and according to the link establishment request message Establishing a chain with the initiator A, and receiving subsequent packets of the originating end forwarded by the access side.
在本实施例中,服务侧B2包括提供服务的各服务节点B21。In the present embodiment, the service side B2 includes each service node B21 that provides a service.
各服务节点B21实时更新负荷参数,并实时上报给接入侧B1,用于接入侧B1负荷分担表的生成。Each service node B21 updates the load parameter in real time and reports it to the access side B1 in real time for the generation of the access side B1 load sharing table.
其中,各服务节点B21的负荷参数包括各服务节点的负荷状况,各服务节点的负荷状况可以是各服务节点上的TCP链接数,也可以是各服务节点上的CPU使用率、内存占用率等技术参数,也可以是其他标识各服务节点负荷状况的参数,可根据实际需要灵活设定。The load parameter of each service node B21 includes the load status of each service node, and the load status of each service node may be the number of TCP links on each service node, or the CPU usage rate, memory occupancy rate, etc. of each service node. The technical parameters may also be other parameters that identify the load status of each service node, and can be flexibly set according to actual needs.
各服务节点B21侦听接入侧B1,向接入侧B1提供各服务节点B21能够处理的服务信息,和各服务节点B21的标识信息,如IP地址和端口。接入侧B1可以获取各服务节点B21的侦听信息,得到各服务节点B21能够处理的服务信息和表示信息。Each serving node B21 listens to the access side B1, and provides the access side B1 with service information that can be processed by each service node B21, and identification information of each service node B21, such as an IP address and a port. The access side B1 can acquire the interception information of each service node B21, and obtain the service information and the representation information that each service node B21 can process.
由此,接入侧B1可以根据建链请求报文的服务请求和各服务节点B21的侦听信息,获取能够处理发起端服务请求的服务节点。Therefore, the access side B1 can obtain the service node capable of processing the originating service request according to the service request of the link establishment request message and the interception information of each service node B21.
从能够处理发起端服务请求的服务节点中选取负荷最小的服务节点,并根据各服务节点B21的标识信息转发报文。The service node with the smallest load is selected from the service nodes capable of processing the originating service request, and the message is forwarded according to the identification information of each service node B21.
各服务节点B21接收接入侧B1转发的建链请求报文后,根据建链请求报文通过接入侧B1与发起端A进行建链,接收接入侧B1转发的后续报文并向发起端A提供相应的服务。After receiving the link establishment request message forwarded by the access side B1, each service node B21 establishes a link according to the link establishment request message through the access side B1 and the originating end A, and receives the subsequent message forwarded by the access side B1 and initiates the message. End A provides the corresponding service.
以本发明应用场景为第三方应用服务器向核心网获取服务,进行举例说明。The application scenario of the present invention is used to obtain a service from a third-party application server to the core network, and an example is illustrated.
在本应用场景中,服务侧B2是核心网HLR(Home Location Register,归属位置寄存器)网元的UDS分布式数据库系统,接入侧B1为UDS接口板,而发起端A是第三方应用服务器,如AS服务器。In this application scenario, the service side B2 is a UDS distributed database system of a core network HLR (Home Location Register) network element, the access side B1 is a UDS interface board, and the originating end A is a third-party application server. Such as AS server.
UDS为AS服务器提供基于TCP的目录查询服务,AS服务器通过标准的LDAP(Lightweight Directory Access Protocol,轻量目录访问协议)接口访问UDS。UDS provides a TCP-based directory query service for the AS server. The AS server accesses the UDS through a standard LDAP (Lightweight Directory Access Protocol) interface.
作为一种实施方式,首先,AS服务器在向UDS获取目录服务的时候,已知道UDS服务器的服务IP地址和端口号。AS服务器在查询目录之前,需要先建立TCP链接。 As an implementation manner, first, when the AS server acquires the directory service from the UDS, the AS server already knows the service IP address and port number of the UDS server. The AS server needs to establish a TCP link before querying the directory.
UDS接口板在收到AS服务器的TCP链接请求后,首先,根据预置的动态分发表判断AS服务器的TCP建链请求报文是否合法。After receiving the TCP link request from the AS server, the UDS interface board firstly determines whether the TCP connection request packet of the AS server is legal according to the preset dynamic distribution.
若AS服务器的TCP建链请求报文合法,则UDS接口板根据分发会话表查询AS服务器是否已和UDS服务器进行过建链。If the TCP connection request packet of the AS server is valid, the UDS interface board queries whether the AS server has been chained with the UDS server according to the distribution session table.
若AS服务器未和UDS服务器进行过过建链,UDS接口板将根据预置的负荷分担表查询各个UDS服务节点的链接负荷,选取负荷最小的服务节点,将AS服务器的建链请求转发到选取的服务节点,由该服务节点和AS服务器通过接口板转发报文完成TCP三次握手建链过程。If the AS server has not been built with the UDS server, the UDS interface board will query the link load of each UDS service node according to the preset load sharing table, select the service node with the least load, and forward the chain connection request of the AS server to the selection. The service node, the service node and the AS server forward the packet through the interface board to complete the TCP three-way handshake construction process.
链接建立成功以后,AS服务器会通过TCP链接发送查询目录数据请求报文给服务器UDS,UDS接口板收到查询目录数据请求报文后,根据TCP链接的服务节点IP地址和端口号,查询到具体的服务节点,将请求转发给相应的服务节点。After the link is successfully established, the AS server sends a query directory data request message to the server UDS through the TCP link. After receiving the query directory data request message, the UDS interface board queries the specific IP address and port number of the service node according to the TCP link. The service node forwards the request to the corresponding service node.
由该服务节点接收接入侧B1转发的发起端A的后续报文,提供目录查询服务,并将查询结果应答给AS服务器。The service node receives the subsequent message of the initiator A forwarded by the access side B1, provides a directory query service, and responds the query result to the AS server.
在本实施例中,服务侧B2包括提供服务的各服务节点B21,各服务节点B21将动态负荷参数发送给接入侧B1,用于接入侧B1负荷分担表的生成;各服务节点B21接收接入侧B1转发的建链请求报文,并根据建链请求报文与发起端A进行建链。本实施例实现了服务器集群中各服务节点的负荷均衡,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。In this embodiment, the service side B2 includes each service node B21 that provides the service, and each service node B21 sends the dynamic load parameter to the access side B1 for the generation of the access side B1 load sharing table; each service node B21 receives The link-building request packet forwarded by the access side B1 is chained with the initiator A according to the link-building request message. This embodiment implements load balancing of service nodes in the server cluster, reduces the burden on the server cluster, speeds up the response speed of the server cluster, enhances the overall performance of the server cluster, and brings a better service experience to the user.
本发明实施例还公开了一种计算机程序,包括程序指令,当该程序指令被服务器执行时,使得该服务器可执行上述任意的分发建链方法。The embodiment of the invention also discloses a computer program, comprising program instructions, when the program instruction is executed by the server, so that the server can execute any of the above-mentioned distribution and construction methods.
本发明实施例还公开了一种载有所述的计算机程序的载体。The embodiment of the invention also discloses a carrier carrying the computer program.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计 算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or part of the steps of the above embodiments may be used. The computer program can be implemented in a computer readable storage medium, the computer program being executed on a corresponding hardware platform (such as a system, device, device, device, etc.), when executed, including One or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求所述的保护范围为准。Variations or substitutions are readily conceivable within the scope of the present invention by those skilled in the art and are within the scope of the present invention. Therefore, the scope of the invention should be determined by the scope of the claims.
工业实用性Industrial applicability
本发明技术方案实现了对建链请求报文的均匀分发,从而使服务器集群各服务节点的负荷达到均衡,避免了负荷不均衡导致的资源浪费,减轻了服务器集群的负担,加快了服务器集群的响应速度,增强了服务器集群的整体性能,给用户带来了更好的业务体验。因此本发明具有很强的工业实用性。 The technical solution of the invention realizes the uniform distribution of the link requesting packets, thereby balancing the load of the service nodes of the server cluster, avoiding waste of resources caused by load imbalance, reducing the burden of the server cluster, and accelerating the server cluster. The responsiveness enhances the overall performance of the server cluster and gives users a better business experience. Therefore, the present invention has strong industrial applicability.

Claims (10)

  1. 一种分发建链方法,所述分发建链方法包括以下步骤:A distribution chain building method, the distribution chain building method comprising the following steps:
    接收发起端的建链请求报文;Receiving a link establishment request message of the initiator;
    根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文;Obtaining a legitimate link request message of the destination address and the destination port from the link request packet according to the preset dynamic sub-publishing;
    根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。According to the preset load sharing table, the legal link request message is forwarded to the service node with the least load to establish a chain.
  2. 如权利要求1所述的分发建链方法,其中,所述接收发起端的建链请求报文的步骤之前,该方法还包括:The method of claim chaining according to claim 1, wherein before the step of receiving the link establishment request message of the initiator, the method further comprises:
    部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口;Deploying the dynamic sub-publishing, the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
    获取服务节点的动态负荷参数,生成所述负荷分担表。The dynamic load parameter of the service node is obtained, and the load sharing table is generated.
  3. 如权利要求1或2所述的分发建链方法,其中,所述根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链的步骤之后,该方法还包括:The distribution chain-building method according to claim 1 or 2, wherein after the step of forwarding the legal chain-building request message to the service node with the least load according to the preset load sharing table, The method also includes:
    存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。The distribution link information is stored, and a distribution session table is generated, where the distribution session table is used for distribution of subsequent messages of the initiator.
  4. 如权利要求3所述的分发建链方法,其中,所述根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文的步骤之后,该方法还包括:The method of claim 3, wherein the step of obtaining a valid link-building request message of the destination address and the destination port from the link-building request message according to the preset dynamic share publication The method also includes:
    根据所述分发会话表,判断所述发起端是否进行过建链;Determining, according to the distribution session table, whether the originating end has been built;
    若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;If the initiator is configured to perform the chaining, the service node that has been linked with the initiator is obtained according to the session, and the legal link request message is forwarded to the obtained The service node performs chain building;
    若所述发起端未进行过建链,则执行所述根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链的步骤。 If the initiator does not perform the chain establishment, the step of forwarding the legal chain-building request packet to the service node with the least load is performed according to the preset load sharing table.
  5. 一种分发建链装置,所述分发建链装置包括接收模块、筛选模块和转发模块,其中A distribution chain building device, the distribution chain building device comprising a receiving module, a screening module and a forwarding module, wherein
    所述接收模块设置成:接收发起端的建链请求报文;The receiving module is configured to: receive a link establishment request message of the initiator end;
    所述筛选模块设置成:根据预置的动态分发表,从所述建链请求报文中获取目的地址和目的端口合法的建链请求报文;The filtering module is configured to: obtain a legal connection request packet of the destination address and the destination port from the link request packet according to the preset dynamic segmentation;
    所述转发模块设置成:根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。The forwarding module is configured to: forward the legal link request message to the service node with the least load to establish a chain according to the preset load sharing table.
  6. 如权利要求5所述的分发建链装置,所述分发建链装置还包括部署模块和获取模块,其中The distribution chain-building device according to claim 5, wherein the distribution chain-building device further comprises a deployment module and an acquisition module, wherein
    所述部署模块设置成:部署所述动态分发表,所述动态分发表记录预设的合法建链目的地址和目的端口;The deployment module is configured to: deploy the dynamic sub-publishing, and the dynamic sub-publishing records a preset legal link establishment destination address and a destination port;
    所述获取模块设置成:获取各服务节点的动态负荷参数,生成所述负荷分担表。The acquiring module is configured to: acquire dynamic load parameters of each service node, and generate the load sharing table.
  7. 如权利要求5或6所述的分发建链装置,所述分发建链装置还包括存储模块,其中The distribution chain-building device according to claim 5 or 6, wherein the distribution chain-building device further comprises a storage module, wherein
    所述存储模块设置成:存储本次分发建链信息,生成分发会话表,所述分发会话表用于所述发起端后续报文的分发。The storage module is configured to: store the current distribution link information, and generate a distribution session table, where the distribution session table is used for distribution of subsequent messages of the initiator.
  8. 如权利要求7所述的分发建链装置,所述分发建链装置还包括判定模块,其中The distribution chain-building device according to claim 7, wherein said distribution chain-building device further comprises a determination module, wherein
    所述判定模块设置成:根据所述分发会话表,判断所述发起端是否进行过建链;The determining module is configured to: determine, according to the distribution session table, whether the originating end has been built;
    所述转发模块还设置成:若所述发起端进行过建链,则根据所述会话分发表,获取已与所述发起端进行过建链的服务节点,并将所述合法的建链请求报文转发给所述获取的服务节点进行建链;若所述发起端未进行过建链,则根据预置的负荷分担表,将所述合法的建链请求报文转发给负荷最小的服务节点进行建链。 The forwarding module is further configured to: if the originating end performs chain building, obtain a service node that has been linked with the originating end according to the session, and obtain the legal chain-building request The packet is forwarded to the obtained service node for chain construction; if the originating end is not chained, the legal chain-building request packet is forwarded to the service with the least load according to the preset load sharing table. The node is built.
  9. 一种分发建链系统,所述分发建链系统包括发起端和服务器,其中:A distribution chain building system includes an initiator and a server, wherein:
    所述发起端设置成:发送建链请求报文;The initiator is configured to: send a link request message;
    所述服务器包括接入侧和服务侧;The server includes an access side and a service side;
    所述接入侧包括如权利要求5-8中任一项所述的分发建链装置;The access side includes the distribution chain building device according to any one of claims 5-8;
    所述服务侧设置成:接收所述建链请求报文,与所述发起端建链。The service side is configured to: receive the link establishment request message, and establish a link with the initiator end.
  10. 如权利要求9所述的分发建链系统,所述服务侧包括:The distribution chain building system of claim 9, wherein the service side comprises:
    至少一个服务节点,至少一个所述服务节点设置成:将动态负荷参数发送给所述接入侧,接收所述接入侧转发的建链请求报文,并根据所述建链请求报文与所述发起端进行建链,接收所述接入侧转发的所述发起端的后续报文。 At least one service node, at least one of the service nodes is configured to: send a dynamic load parameter to the access side, receive a link establishment request message forwarded by the access side, and according to the link establishment request message The initiator is configured to receive a subsequent packet of the originating end forwarded by the access side.
PCT/CN2016/079674 2015-10-09 2016-04-19 Distributed link establishment method, apparatus and system WO2016180188A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510648879.5 2015-10-09
CN201510648879.5A CN106572132B (en) 2015-10-09 2015-10-09 Method, device and system for distributing and building link

Publications (1)

Publication Number Publication Date
WO2016180188A1 true WO2016180188A1 (en) 2016-11-17

Family

ID=57247642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/079674 WO2016180188A1 (en) 2015-10-09 2016-04-19 Distributed link establishment method, apparatus and system

Country Status (2)

Country Link
CN (1) CN106572132B (en)
WO (1) WO2016180188A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769150A (en) * 2018-05-14 2018-11-06 百度在线网络技术(北京)有限公司 Data processing method, device, clustered node and the storage medium of block chain network
CN111787079A (en) * 2020-06-19 2020-10-16 广州市百果园信息技术有限公司 Communication method, device, server, system and medium based on communication group
CN112104566A (en) * 2020-09-18 2020-12-18 网易(杭州)网络有限公司 Load balancing processing method and device
CN113507431A (en) * 2021-05-17 2021-10-15 新华三信息安全技术有限公司 Message management method, device, equipment and machine readable storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108881184A (en) * 2018-05-30 2018-11-23 努比亚技术有限公司 Access request processing method, terminal, server and computer readable storage medium
CN116204328B (en) * 2023-05-06 2023-07-04 深圳联友科技有限公司 Off-base load sharing processing method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7143169B1 (en) * 2002-04-04 2006-11-28 Cisco Technology, Inc. Methods and apparatus for directing messages to computer systems based on inserted data
US7328237B1 (en) * 2002-07-25 2008-02-05 Cisco Technology, Inc. Technique for improving load balancing of traffic in a data network using source-side related information
CN104683293A (en) * 2013-11-27 2015-06-03 杭州迪普科技有限公司 SYN attack defense method based on logic device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100502353C (en) * 2005-09-22 2009-06-17 中兴通讯股份有限公司 Signalling flow distributing method and signalling distributing processing unit
CN101247261A (en) * 2007-07-18 2008-08-20 北京高信达网络科技有限公司 Method and apparatus for preventing DDos attack
CN102291441B (en) * 2011-08-02 2015-01-28 杭州迪普科技有限公司 Method and security agent device for protecting against attack of synchronize (SYN) Flood
CN103347016A (en) * 2013-06-28 2013-10-09 天津汉柏汉安信息技术有限公司 Attack defense method
CN103618741A (en) * 2013-12-09 2014-03-05 惠州华阳通用电子有限公司 TCP long connection communication system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7143169B1 (en) * 2002-04-04 2006-11-28 Cisco Technology, Inc. Methods and apparatus for directing messages to computer systems based on inserted data
US7328237B1 (en) * 2002-07-25 2008-02-05 Cisco Technology, Inc. Technique for improving load balancing of traffic in a data network using source-side related information
CN104683293A (en) * 2013-11-27 2015-06-03 杭州迪普科技有限公司 SYN attack defense method based on logic device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108769150A (en) * 2018-05-14 2018-11-06 百度在线网络技术(北京)有限公司 Data processing method, device, clustered node and the storage medium of block chain network
CN108769150B (en) * 2018-05-14 2021-11-12 百度在线网络技术(北京)有限公司 Data processing method and device of block chain network, cluster node and storage medium
CN111787079A (en) * 2020-06-19 2020-10-16 广州市百果园信息技术有限公司 Communication method, device, server, system and medium based on communication group
CN111787079B (en) * 2020-06-19 2023-04-07 广州市百果园信息技术有限公司 Communication method, device, server, system and medium based on communication group
CN112104566A (en) * 2020-09-18 2020-12-18 网易(杭州)网络有限公司 Load balancing processing method and device
CN112104566B (en) * 2020-09-18 2024-02-27 网易(杭州)网络有限公司 Processing method and device for load balancing
CN113507431A (en) * 2021-05-17 2021-10-15 新华三信息安全技术有限公司 Message management method, device, equipment and machine readable storage medium
CN113507431B (en) * 2021-05-17 2024-02-09 新华三信息安全技术有限公司 Message management method, device, equipment and machine-readable storage medium

Also Published As

Publication number Publication date
CN106572132A (en) 2017-04-19
CN106572132B (en) 2020-12-29

Similar Documents

Publication Publication Date Title
US11765150B2 (en) End-to-end M2M service layer sessions
WO2016180188A1 (en) Distributed link establishment method, apparatus and system
WO2020228469A1 (en) Method, apparatus and system for selecting mobile edge computing node
CN107852604B (en) System for providing Global Virtual Network (GVN)
WO2023000935A1 (en) Data processing method, network element device, and readable storage medium
EP4055852A1 (en) Policy-based access and mobility management function (amf) selection using network slice selection assistance information (nssai) availability information
US10333780B2 (en) Method, apparatus and computer program product for updating load balancer configuration data
US9356912B2 (en) Method for load-balancing IPsec traffic
US10637794B2 (en) Resource subscription method, resource subscription apparatus, and resource subscription system
RU2464722C2 (en) Method, device and system for distribution of messages
WO2012151994A1 (en) Resource downloading method, device and system
WO2023151264A1 (en) Load balancing method and apparatus, node, and storage medium
WO2012065531A1 (en) Method, device, and system for implementing relay selection
JP2013501483A (en) Management method and management device for network address translation
CN116055311A (en) Communication method and device
CN116886588A (en) Communication method, device and system
CN112968965B (en) Metadata service method, server and storage medium for NFV network node
WO2021068937A1 (en) Service binding method and apparatus
WO2022179218A1 (en) Communication method and apparatus
US11558466B1 (en) Packet forwarding control protocol (PFCP) message service using a remote procedure call (RPC) based protocol suitable for PFCP connection sharing
WO2023109863A1 (en) Content delivery network system and content delivery method
CN115955716A (en) Data collection method, communication device and communication system

Legal Events

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

Ref document number: 16792038

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16792038

Country of ref document: EP

Kind code of ref document: A1