CN110995829B - Instance calling method and device and computer storage medium - Google Patents

Instance calling method and device and computer storage medium Download PDF

Info

Publication number
CN110995829B
CN110995829B CN201911205159.6A CN201911205159A CN110995829B CN 110995829 B CN110995829 B CN 110995829B CN 201911205159 A CN201911205159 A CN 201911205159A CN 110995829 B CN110995829 B CN 110995829B
Authority
CN
China
Prior art keywords
instance
module
message
traffic
service node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911205159.6A
Other languages
Chinese (zh)
Other versions
CN110995829A (en
Inventor
刘智杰
姚灵芝
程文聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bigo Technology Pte Ltd
Original Assignee
Guangzhou Baiguoyuan Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN201911205159.6A priority Critical patent/CN110995829B/en
Publication of CN110995829A publication Critical patent/CN110995829A/en
Application granted granted Critical
Publication of CN110995829B publication Critical patent/CN110995829B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses an instance calling method, an instance calling device and a computer storage medium, and belongs to the technical field of communication. The method comprises the following steps: for each service node in the communication network, a traffic proxy module is bound to each instance deployed on the service node. The traffic agent module deployed on the first service node can communicate with the traffic agent module deployed on the second service node to obtain the identifier of the instance deployed by the other side. The method is equivalent to using the flow proxy module to replace a public gateway of the related art so as to realize request calling among a plurality of instances, and because each instance is bound with one flow proxy module, even if a certain flow proxy module fails to work, the method only affects the calling function of the instance bound with the flow proxy module and does not affect the calling functions of other instances.

Description

Instance calling method and device and computer storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for instance invocation, and a computer storage medium.
Background
One service is used to indicate a network function and one service node is used to implement one service, i.e. one service node corresponds to one service. In addition, a plurality of instances may be deployed on one service node, and the plurality of instances may respectively and independently implement a service corresponding to the service node, so as to perform load sharing on traffic in the network. In some scenarios, after traffic is processed based on one instance, one service node may need to invoke an instance deployed on another service node to continue to process traffic of the traffic, so as to complete complex processing of the traffic.
In the related art, for any service node, the service node needs to send its configuration information to a public gateway during initialization, where the configuration information includes information such as an identifier, an interface, and an IP (internet protocol) address of each instance deployed on the service node, and the public gateway stores the configuration information of the service node. Thus, the public gateway stores the configuration information of each service node. After a subsequent first service node performs service processing on a received message based on a first instance, if a second instance deployed on a second service node needs to be called currently to continue performing service processing on the message, the first service node needs to send a calling request to a public gateway, the calling request carries an identifier of the second instance and the message, the public gateway acquires information such as an interface and an IP address of the second instance according to the identifier of the second instance, forwards the message to the second service node according to the information such as the interface and the IP address of the second instance, and the second service node performs service processing on the message based on the second instance, so that the first service node calls the second instance on the second service node to perform service processing on the message. The first instance is any instance deployed on the first service node, the second instance is any instance deployed on the second service node, and the first service node and the second service node are any two service nodes.
In the above example invoking method, when the public gateway fails to work, any service node may be unable to invoke an example deployed on any other service node, which may lead to network crash.
Disclosure of Invention
The embodiment of the application provides an instance calling method, an instance calling device and a computer storage medium, and a flow proxy module can be used for realizing request calling among a plurality of instances. The technical scheme is as follows:
in one aspect, an instance calling method is provided, where a communication network includes a plurality of service nodes, each service node is deployed with a network filtering module, a plurality of instances, and a plurality of traffic proxy modules bound to the plurality of instances one by one, and a traffic proxy module deployed on a first service node can communicate with a traffic proxy module deployed on a second service node to obtain an identifier of an instance deployed by the other, where the first service node and the second service node are two service nodes in the plurality of service nodes;
the method comprises the following steps:
the first network filtering module receives a first message sent by a second network filtering module, where the first message carries an identifier of a first instance, the first network filtering module is a network filtering module deployed on the first service node, the second network filtering module is a network filtering module deployed on the second service node, the first instance is one instance currently called by the second instance among multiple instances deployed on the first service node, and the second instance is one of multiple instances deployed on the second service node;
and the first network filtering module sends the first message to the first instance so that the first instance performs service processing on the first message.
Optionally, the sending, by the first network filtering module, the first packet to the first instance includes:
forwarding the first message by taking the address of the first traffic proxy module bound with the first instance as a destination address so as to send the first message to the first traffic proxy module, and carrying out traffic monitoring on the first message by the first traffic proxy module;
and forwarding the first message by taking the address of the first instance as a destination address so as to send the first message returned by the first flow agent module to the first instance.
Optionally, before forwarding the first packet by using the address of the first traffic proxy module bound to the first instance as a destination address, the method further includes:
acquiring the flow type of the first message;
and if the acquired traffic type is TCP (Transmission control protocol) traffic, executing a step of forwarding the first message by taking the address of the first traffic agent module bound with the first instance as a destination address.
Optionally, after the obtaining of the traffic type of the first packet, the method includes:
and if the acquired flow type is non-TCP flow, forwarding the first message by taking the address of the first example as a target address so as to send the first message to the first example.
Optionally, after the first network filtering module sends the first packet to the first instance, the method further includes:
receiving a second message sent by the first instance, wherein the second message carries a processing result after the first instance performs service processing on the first message;
and sending the second message to the second network filtering module so that the second network filtering module sends the second message to the second instance.
Optionally, the sending the second packet to the second network filtering module includes:
forwarding the second message by taking the address of the first traffic proxy module as a destination address so as to send the second message to the first traffic proxy module, and carrying out traffic monitoring on the second message by the first traffic proxy module;
and forwarding the second message by taking the address of the second network filtering module as a destination address so as to send the second message returned by the first traffic agent module to the second network filtering module.
In another aspect, an instance invoking apparatus is provided, where the instance invoking apparatus is applied to a first network filtering module deployed on a first service node in a communication network, where the communication network includes multiple service nodes, the first service node is one of the multiple service nodes, each service node in the multiple service nodes is deployed with one network filtering module, multiple instances, and multiple traffic proxy modules bound to the multiple instances one by one, any traffic proxy module deployed on a second service node can communicate with any traffic proxy module deployed on the first service node to obtain an identifier of an instance bound to any traffic proxy module deployed on the first service node, and the second service node is one service node, except the first service node, in the multiple service nodes;
the device comprises:
a first receiving module, configured to receive a first packet sent by a second network filtering module deployed on the second service node, where the first packet carries an identifier of a first instance, the first instance is one of multiple instances deployed on the first service node, the identifier of the first instance is determined by a second traffic agent module bound to a second instance from an obtained identifier of the instance and is sent to the second network filtering module, and the second instance is one of multiple instances deployed on the second service node;
and the first sending module is used for sending the first message to the first instance so that the first instance performs service processing on the first message.
Optionally, the first sending module includes:
a first forwarding sub-module, configured to forward the first packet using an address of the first traffic proxy module bound to the first instance as a destination address, so as to send the first packet to the first traffic proxy module, where the first traffic proxy module performs traffic monitoring on the first packet;
and the second forwarding sub-module is used for forwarding the first message returned by the first traffic agent module by taking the address of the first instance as a destination address so as to send the first message returned by the first traffic agent module to the first instance.
Optionally, the sending module further includes:
the obtaining sub-module is used for obtaining the flow type of the first message;
and the third forwarding sub-module is used for executing the step of forwarding the first message by taking the address of the first traffic proxy module bound with the first instance as a destination address if the acquired traffic type is Transmission Control Protocol (TCP) traffic.
Optionally, after obtaining the traffic type of the first packet, the method includes:
and the fourth forwarding sub-module is configured to forward the first packet using the address of the first instance as a destination address if the acquired traffic type is non-TCP traffic, so as to send the first packet to the first instance.
Optionally, the apparatus further comprises:
a second receiving module, configured to receive a second packet sent by the first instance, where the second packet carries a processing result obtained after the first instance performs service processing on the first packet;
and the second sending module is used for sending the second message to the second network filtering module so as to enable the second network filtering module to send the second message to the second instance.
Optionally, the second sending module includes:
a fifth forwarding sub-module, configured to forward the second packet using the address of the first traffic proxy module as a destination address, so as to send the second packet to the first traffic proxy module, where the first traffic proxy module performs traffic monitoring on the second packet;
and the sixth forwarding sub-module is configured to forward the second packet returned by the first traffic proxy module by using the address of the second network filtering module as a destination address, so as to send the second packet returned by the first traffic proxy module to the second network filtering module.
In another aspect, an example apparatus is provided, the example invoking apparatus comprising a processor, a communication interface, a memory, and a communication bus;
the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory is used for storing computer programs;
the processor is used for executing the program stored on the memory so as to realize the method for providing the example calling.
In another aspect, a computer-readable storage medium is provided, in which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the example calling method provided in the foregoing.
The beneficial effects that technical scheme that this application embodiment brought include at least:
in an embodiment of the present application, for each service node in a communication network, a traffic proxy module is bound to each instance deployed on the service node. The traffic proxy module deployed on the first service node can communicate with the traffic proxy module deployed on the second service node to obtain the identifier of the instance deployed on the other side. That is, the service nodes discover each other's instances through the traffic proxy module, so that when a second instance on a second service node obtains an identifier of a first instance to be called, and sends a first message to a first network filtering module of the first service node through a second network filtering module, so as to enable the second instance to call the first instance. The method is equivalent to using the flow proxy module to replace a common gateway of the related art to realize request calling among a plurality of instances, and because each instance is bound with one flow proxy module, even if a certain flow proxy module fails to work, the method only affects the calling function of the instance bound by the flow proxy module and does not affect the calling functions of other instances.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is an architecture diagram of an example calling system according to an embodiment of the present application.
Fig. 2 is a flowchart of an example calling method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a packet forwarding path according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an example invoking device according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, an application scenario related to the embodiments of the present application will be described. When traffic is transported in a network, an instance on one service node typically needs to invoke an instance on another service node to process the traffic. For example, there are currently two service nodes, which are respectively labeled as a first service node and a second service node. The first service node is used for realizing login verification service, and the second service node is used for realizing login page display service. When an instance on the second service node acquires login information input by a user and needs to call the first service node to verify whether the login information is correct or not, the login information needs to be sent to an instance deployed on the first service node, the instance acquires stored login information from the data center, verifies whether the login information input by the user at the current moment is correct or not according to the stored login information, and then sends a verification result to the instance deployed on the first service node.
The following two scenarios may be used for the instance on one service node to call the instance on another service node:
in some scenarios, after performing service processing on a current packet based on an instance, one service node may need to invoke a specified instance deployed on another service node to continue performing service processing on traffic, so as to complete complex processing on the traffic.
In other scenarios, after performing service processing on a current packet based on one instance, one service node may need to invoke any one of multiple instances deployed on another service node to continue performing service processing on traffic, so as to complete complex processing on the traffic. Any one of the multiple instances is determined by a load sharing algorithm to achieve load sharing of traffic in the network by the multiple instances.
In the related art, the instance call between two service nodes can be realized only through a public gateway, and once the public gateway fails, the instance call between all the service nodes cannot be performed. Alternatively, an RPC protocol (remote procedure call) software framework needs to be deployed in the instances to enable an instance of one service node to directly call an instance on another service node. But this approach requires modifying the code of the instance to enable deployment of the RPC software framework in the instance. Modifying the code of an instance will result in an intrusion into the code in the instance, thereby affecting the security of the instance. The application provides an instance calling method based on the above scenario, so that instance calling can be performed without a public gateway, and the code of an instance does not need to be modified.
Fig. 1 is an architecture diagram of an example calling system according to an embodiment of the present application. As shown in fig. 1, the example calling system 100 includes a first service node 101, a second service node 102, and a control node 103.
The first service node 101 and the second service node 102 may be connected in a wireless or wired manner to perform communication, the control node 103 and the first service node 101 may be connected in a wired or wireless manner to perform communication, and the control node 103 and the second service node 102 may be connected in a wired or wireless manner to perform communication.
Each service node in the instance invocation system 100 shown in fig. 1 is deployed with a network filter module (netfilter), multiple instances, and multiple traffic proxy modules bound to the multiple instances one by one. Illustratively, for the first service node 101, the first service node includes a first network filtering module 1011, a plurality of first instances 1012, and a plurality of first traffic proxy modules 1013 bound to the plurality of first instances one to one. For the second service node 102, the second service node includes a second network filtering module 1021, a plurality of second instances 10222, and a plurality of second traffic proxy modules 1023 bound to the plurality of second instances one by one.
In the embodiment of the present application, to avoid the need of implementing instance invocation through a common gateway, for any service node, a traffic proxy module is bound to each instance deployed on the service node. The traffic proxy module deployed on the first service node can communicate with the traffic proxy module deployed on the second service node to obtain the identifier of the instance deployed on the other side. That is, the service nodes discover each other's instances through the traffic proxy module so that the instances of the call can be determined.
In a possible implementation manner, any one of the traffic proxy modules in the first service node 101 or the second service node 102 can communicate with the control node 103 to report the configuration information of the self-bound instance to the control node 103. In this way, the control node 103 stores configuration information of each instance in each service node, where the configuration information includes information such as an identifier, an interface, and an IP (internet protocol) address of the instance. At this time, the control node 103 may also be referred to as a registry.
Subsequently, for any instance on the first service node 101, if the instance needs to invoke an instance on the second service node 102, the traffic proxy module bound to any instance on the first service node 101 may obtain an identifier of the instance to be invoked from the control node 103, so as to forward the packet according to the identifier.
In the above implementation, each traffic proxy module obtains, through the control node, an identifier of an instance deployed on another service node.
In another possible implementation manner, any traffic proxy module deployed on the first service node 101 may also directly communicate with any traffic proxy module deployed on the second service node 102 to obtain an identifier of an instance deployed by the other side.
In addition, the control node 103 is further configured to obtain an instance invocation list of each instance based on the configuration of the backend management staff, where the instance invocation list is used to indicate which instances the corresponding instance can invoke. And issuing the instance calling lists of the instances to the corresponding flow agent modules. For example, for any instance on the first service node 101, the control node may obtain an instance invocation list of the instance, and issue the instance invocation list to the flow proxy module bound to the instance, so that the flow proxy module subsequently determines the instance to be invoked according to the instance invocation list. At this time, the control node 103 may also be referred to as a configuration center.
It should be noted that the control center and the registration center may be deployed on one server or two different servers, which is not specifically limited in this embodiment of the present application.
In addition, for the network filtering module in the first service node 101 or the second service node 102 in the example invoking system 100 in fig. 1, the network filtering module is configured to forward the received packet to other modules in the service node according to a certain routing rule, and forward the packet after the other modules process the packet. The network filtering module may also be referred to as a firewall (Linux Netfilter). That is, for any service node, before forwarding the packet to the traffic proxy module, the network filtering module forwards the packet according to the routing rule. After the network filtering module forwards the message according to the routing rule, the message can be forwarded to the flow agent module or the example, and the flow agent module or the example processes the service content of the message so as to complete 7-layer load balancing of the message. It should be noted that the network filtering module generally operates at the transport layer and the following layers of the network model, and therefore the network filtering module cannot register configuration information of each instance on other service nodes.
The following explains the example calling method provided in the embodiments of the present application in detail.
Fig. 2 is a flowchart of an example invoking method provided in an embodiment of the present application, where the method is applied to a first network filtering module deployed on a first service node shown in fig. 1. Referring to fig. 2, the method includes the following steps.
Step 201: the first network filtering module receives a first message sent by the second network filtering module.
The first packet carries an identifier of a first instance, the first network filtering module is a network filtering module deployed on a first service node, the second network filtering module is a network filtering module deployed on a second service node, the first instance is one instance called by a second instance currently in a plurality of instances deployed on the first service node, and the second instance is one of the plurality of instances deployed on the second service node.
In a possible implementation manner, after the second instance performs service processing on the received packet, if the first instance deployed on the first service node needs to be invoked to continue performing service processing on the packet, the traffic proxy module bound to the second instance needs to first obtain identifiers of multiple instances that can be invoked in the control node, select an identifier of the first instance to be invoked from the identifiers, and send the identifier first packet carrying the first instance to the second network filtering module, so as to implement invocation of the first instance by the second instance through the embodiment shown in fig. 2.
In another possible implementation manner, the traffic proxy module bound to the second instance may also directly communicate with the traffic proxy modules on other service nodes to obtain the identifiers of the multiple instances deployed on other service nodes, and select the identifier of the first instance to be invoked, so as to implement the invocation of the first instance by the second instance through the embodiment shown in fig. 2.
Step 202: and the first network filtering module sends the first message to the first instance so that the first instance performs service processing on the first message.
In a possible implementation manner, the first network filtering module may directly send the first packet to the first instance, so that the first instance performs service processing on the first packet.
In another possible implementation manner, since the communication network generally needs to monitor traffic in the network, in this embodiment, the traffic proxy module may also monitor traffic of the transport layer, report the monitoring result to the control center, and perform other processing by the control center according to the monitoring result. At this time, step 202 may be implemented by the following several steps.
(1) The first network filtering module forwards the first message by taking the address of the first traffic agent module bound with the first instance as a destination address so as to send the first message to the first traffic agent module, and the first traffic agent module monitors the traffic of the first message.
It should be noted that, when the first network filtering module sends the first packet to the first traffic agent module, the first traffic agent module is configured to perform traffic monitoring on the received first packet. The flow monitoring includes controlling the number of messages processed per second and monitoring the success rate of processing of the messages.
For example, the first instance is currently used to implement a login authentication service, and the second instance is currently used to implement a login page display service. When the first network filtering module forwards the first message to the first traffic proxy module, the first traffic proxy module forwards the first message to the first instance at a certain rate. For example, the rate may be 3000 times per second.
In a possible implementation manner, after monitoring the traffic of the first packet, the first traffic proxy module may return the first packet to the first network filtering module, and the first network filtering module receives the first packet returned by the first traffic proxy module, and forwards the first packet to the first instance through the following step (2).
Step (2): the first network filtering module forwards the first message by taking the address of the first instance as a destination address so as to send the first message returned by the first flow agent module to the first instance.
In a possible implementation manner, if the first traffic proxy module returns the first packet to the first network filtering module after monitoring the traffic of the first packet, at this time, in step (2), the first network filtering module forwards the first packet returned by the first traffic proxy to the first instance, and the first instance continues to perform service processing on the first packet processed by the second instance, thereby completing the call of the second instance to the first instance.
Optionally, because the communication network generally needs to monitor the traffic of the transport layer, in this embodiment of the present application, the traffic proxy module may only monitor the traffic of the transport layer, and report the monitoring result to the control center, and the control center performs other processing according to the monitoring result. Therefore, before forwarding the first packet, the first network filtering module needs to obtain the traffic type of the first packet in advance, and perform forwarding operations of different paths on the first packet according to the traffic type of the first packet.
In a possible scenario, if the traffic type of the acquired first packet is TCP traffic, the first packet is forwarded to the first instance through the steps (1) and (2). If the flow type of the acquired first message is non-TCP flow, the first message is directly sent to the first instance, and the process of monitoring the flow of the first message by the first flow agent module in the step (1) and the step (2) does not need to be executed.
Fig. 3 is a schematic diagram of a packet forwarding path according to an embodiment of the present application. As shown in fig. 3, a first packet is transmitted from a traffic ingress to a pre-routing unit deployed in a first network filtering module through a path 1, a traffic type of the first packet of the pre-routing unit (routing) deployed in the first network filtering module is determined, if the traffic type of the current first packet is determined to be TCP traffic, the first packet is transmitted to a proxy-inbound unit (proxy-inbound) through a path 2, the proxy-inbound unit is configured to determine whether a destination address of the packet is an address of a first instance, that is, whether the first packet is a packet requesting to invoke the first instance, if the destination address of the first packet is determined to be the destination address of the first instance, the first packet is transmitted to an internal proxy redirection unit (proxy-in-redirect) through a path 3, because the internal proxy redirection unit stores an identifier of the first traffic proxy module bound to the first instance, therefore, the internal proxy redirection unit transmits the first message to the first traffic proxy module through the path 4, and the first traffic proxy module performs traffic monitoring on the first message to complete request invocation of the first instance.
After the first traffic agent module processes the first packet, the first packet is transmitted to an output unit (out) deployed by the first network filtering module through a path 5, where the output unit is configured to determine whether a traffic type of the first packet processed by the first traffic agent module is TCP traffic, and when the traffic type of the first packet is determined to be TCP traffic, the first packet is transmitted to a proxy-output unit (proxy-output) through a path 6, where the proxy-output unit is configured to determine whether the first packet at the current time is a packet processed by the first traffic agent. When the agent outbound unit determines that the first packet at the current time is the first packet processed by the first traffic agent module, the agent outbound unit may continue to transmit the first packet through the path 7. When the first instance receives the first packet, the first packet may be subjected to service processing. And the processing result after the first instance processes the first message may be sent to the second instance through subsequent steps 203-204.
It should be noted that the agent outward unit may determine, based on the information carried in the first packet, whether the first packet at the current time is a packet processed by the first traffic agent module. For example, the determination may be made based on whether the current first packet carries an identifier of the first traffic proxy module, where the identifier may be a port identifier, an address identifier, a version identifier, and the like.
After the second instance calls the first instance through the steps 201 to 202 and the first instance performs the service processing on the first packet, the processing result may be returned to the second instance through the following steps 203 to 204.
Step 203: and the first network filtering module receives the second message sent by the first instance.
The second message carries a processing result after the first instance performs service processing on the first message; after the second instance calls the first instance to process the first message, the processing result can be sent to the second instance in the form of the second message.
It should be noted that, when the first instance needs to forward the second packet to the second instance, the second packet needs to be forwarded to the first network filtering module, and the first network filtering module executes a forwarding operation on the second packet, so as to ensure accuracy of a transmission path of the second packet.
For example, the first instance is used to implement a login authentication service, and the second instance is used to implement a login page display service. When the first instance receives a first message which is sent by the second instance and comprises login information input by a user, the first instance acquires the stored login information from the data center, verifies whether the login information input by the user is correct according to the stored login information, sends a verification result to the first instance in the form of a second message, and in the process of sending the second message to the second instance, the forwarding operation can be executed on the second message through the following step 204.
Step 204: and the first network filtering module sends the second message to the second network filtering module so that the second network filtering module sends the second message to the second instance.
In a possible implementation manner, the first network filtering module may directly send the second packet to the second network filtering module.
In another possible implementation manner, since the communication network generally needs to monitor traffic in the network, in this embodiment, the traffic proxy module may also monitor traffic of the transport layer, report the monitoring result to the control center, and perform other processing by the control center according to the monitoring result. At this time, step 204 may be implemented by the following several steps.
(1): the first network filtering module transmits the second message by taking the address of the first traffic agent module as a destination address so as to send the second message to the first traffic agent module, and the first traffic agent module monitors the traffic of the second message.
(2): the first network filtering module takes the address of the second network filtering module as a destination address to forward a second message so as to send the second message returned by the first flow agent module to the second network filtering module.
Optionally, because the communication network generally needs to monitor the traffic of the transport layer, in this embodiment of the present application, the traffic proxy module may only monitor the traffic of the transport layer, and report the monitoring result to the control center, and the control center performs other processing according to the monitoring result. Therefore, before forwarding the second packet, the first network filtering module needs to obtain the traffic type of the second packet in advance, and perform forwarding operations of different paths on the second packet according to the traffic type of the second packet.
In a possible scenario, if the traffic type of the obtained second packet is TCP traffic, the second packet is forwarded to the second instance through the above steps (1) and (2). And (3) if the flow type of the acquired first message is non-TCP flow, directly sending the second message to the second instance without executing the process of monitoring the flow of the second message by the first flow agent module in the step (1) and the step (2).
As shown in the schematic diagram of the packet forwarding path shown in fig. 3, when an output unit (out) deployed in the first network filtering module receives the second packet through a path 8, the output unit determines whether the second packet is TCP traffic based on a traffic type of the second packet, and if the output unit determines that the traffic type of the second packet at the current time is TCP traffic, the output unit transmits the second packet to a proxy-out unit (proxy-out) through a path 9, where the proxy-out unit is configured to determine whether the second packet at the current time is processed by the first traffic proxy module, and the determination process may refer to a determination process of the proxy-in unit on the first packet, which is not described herein again. And when judging that the current second message is not processed by the first traffic proxy module, transmitting the second message to a proxy-redirect unit (proxy-redirect) through a path 10, wherein the proxy-redirect unit stores the identifier of the first traffic proxy, and transmits the second message to the first traffic proxy module through a path 11 according to the identifier of the first traffic proxy, and the first traffic proxy module performs service processing on the second message.
In this embodiment of the application, after the first traffic agent performs service processing on the second packet, the second packet needs to be verified through the following process to ensure that the second packet performs service processing through the first agent module.
The verification process of the first network filtering module on the second packet returned by the first traffic proxy module may be: an output unit (out) deployed in the second network filtering module receives a second message returned by the first traffic proxy module through a path 12, and judges whether the second message is a TCP flow based on a traffic type of the second message at the current time, if the output unit judges that the traffic type of the current second message is the TCP flow, the second message is transmitted to a proxy-out unit (proxy-out) through a path 13, the external proxy module is used for judging whether the second message at the current time is processed by the first traffic proxy module, and when the second message is judged to be processed by the first traffic proxy module, the second message can be transmitted to a post-routing unit (routing) through a path 14, and then the routing unit sends the second message out from a traffic outlet through a path 15.
When the first network filtering module sends the second message out from the flow outlet, the address of the second network filtering module on the second service node is used as a destination address to forward the second message, and the second network filtering module forwards the second message to the second instance.
In addition, in step 202, if the traffic type of the obtained first packet is non-TCP traffic, and the traffic proxy module is not required to monitor the packet in the communication network, the address of the first traffic proxy module bound to the first instance is used as the destination address to forward the first packet. The process of performing service processing on the first packet by the first traffic agent module in step (1) and step (2) in step 202 does not need to be executed.
The possible implementation process of forwarding the first packet by using the first instance as the destination address is as follows: when the traffic type of the received first packet at the current time, which is judged by the pre-routing unit deployed in the current first network filtering module, is non-TCP traffic, the first packet is transmitted to an input unit (input) through a path 2 ', and then the input unit directly transmits the first packet to the first instance through a path 3', and when the first instance performs service processing on the packet and obtains a second packet, the second packet needs to be transmitted to a traffic outlet. Specifically, the process of transmitting the second message to the traffic outlet is as follows: transmitting the second message to an output unit deployed by the first network filtering module through a path 4 ', judging whether the second message at the current moment is TCP flow or not again by the output unit, transmitting the second message to a post-routing unit (routing) through a path 5 ' when judging that the second message at the current moment is non-TCP flow, and transmitting the second message to a flow outlet through a path 6 ' by the post-routing module
In an embodiment of the present application, for each service node in a communication network, a traffic proxy module is bound to each instance deployed on the service node. The traffic proxy module deployed on the first service node can communicate with the traffic proxy module deployed on the second service node to obtain the identifier of the instance deployed on the other side. That is, the service nodes discover each other's instances through the traffic proxy module, so that when the second instance on the second service node can obtain the identifier of the first instance to be called, and send the first packet to the first network filtering module of the first service node through the second network filtering module, after the first instance processes the first packet, the first instance returns the processing result to the second instance in the form of the second packet. The request call between the first instance and the second instance has been completed. The method is equivalent to using the flow proxy module to replace a public gateway of the related art so as to realize request calling among a plurality of instances, and because each instance is bound with one flow proxy module, even if a certain flow proxy module fails to work, the method only affects the calling function of the instance bound with the flow proxy module and does not affect the calling functions of other instances.
All the optional technical solutions can be combined arbitrarily to form an optional embodiment of the present application, which is not described in detail herein.
Fig. 4 is a schematic structural diagram of an example invoking device provided in the embodiment of the present application, where the example invoking device may be implemented by software, hardware, or a combination of the two. The example calling device comprises:
a first receiving module 401, configured to receive a first packet sent by a second network filtering module deployed on a second service node, where the first packet carries an identifier of a first instance, the first instance is one of multiple instances deployed on the first service node, the identifier of the first instance is determined by a second traffic agent module bound to a second instance from an obtained identifier of the instance, and is sent to the second network filtering module, and the second instance is one of multiple instances deployed on the second service node;
a first sending module 402, configured to send the first packet to the first instance, so that the first instance performs service processing on the first packet.
Optionally, the first sending module includes:
the first forwarding sub-module is used for forwarding the first message by taking the address of the first traffic proxy module bound with the first instance as a destination address so as to send the first message to the first traffic proxy module, and the first traffic proxy module performs traffic monitoring on the first message;
and the second forwarding submodule is used for forwarding the first message returned by the first traffic agent module by taking the address of the first example as a destination address so as to send the first message returned by the first traffic agent module to the first example.
Optionally, the first sending module further includes:
the obtaining sub-module is used for obtaining the flow type of the first message;
and the third forwarding submodule is used for executing the step of forwarding the first message by taking the address of the first traffic proxy module bound with the first instance as the destination address if the acquired traffic type is the Transmission Control Protocol (TCP) traffic.
Optionally, after the obtaining of the traffic type of the first packet, the method includes:
and the fourth forwarding sub-module is used for forwarding the first message by taking the address of the first instance as a target address if the acquired flow type is non-TCP flow so as to send the first message to the first instance.
Optionally, the apparatus further comprises:
the second receiving module is used for receiving a second message sent by the first example, and the second message carries a processing result after the first example performs service processing on the first message;
and the second sending module is used for sending the second message to the second network filtering module so that the second network filtering module sends the second message to the second instance.
Optionally, the second sending module includes:
the fifth forwarding sub-module is used for forwarding the second message by taking the address of the first traffic proxy module as a destination address so as to send the second message to the first traffic proxy module, and the first traffic proxy module monitors the traffic of the second message;
and the sixth forwarding submodule is used for forwarding the second message returned by the first traffic proxy module by taking the address of the second network filtering module as a destination address so as to send the second message returned by the first traffic proxy module to the second network filtering module.
In an embodiment of the present application, for each service node in a communication network, a traffic proxy module is bound to each instance deployed on the service node. The traffic proxy module deployed on the first service node can communicate with the traffic proxy module deployed on the second service node to obtain the identifier of the instance deployed on the other side. That is, the service nodes discover each other through the traffic proxy module, so that when the second instance on the second service node obtains the identifier of the first instance to be called, the second instance sends the first message to the first network filtering module of the first service node through the second network filtering module, so as to realize that the second instance calls the first instance. The method is equivalent to using the flow proxy module to replace a common gateway of the related art to realize request calling among a plurality of instances, and because each instance is bound with one flow proxy module, even if a certain flow proxy module fails to work, the method only affects the calling function of the instance bound by the flow proxy module and does not affect the calling functions of other instances.
It should be noted that: in the example calling apparatus provided in the above embodiment, only the division of the functional modules is illustrated when an example is called, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device for instance calling and the method embodiment for instance calling provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and will not be described herein again.
Fig. 5 is a schematic structural diagram of a server according to an embodiment of the present application. The server may be any service node provided in the embodiment of the present application, and the server may be one server in a background server cluster. Specifically, the method comprises the following steps:
the server 500 includes a Central Processing Unit (CPU)501, a memory 502, and a system bus 503 connecting the memory 502 and the central processing unit 501. Memory 502 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory or other solid state storage technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing.
The memory 502 also includes one or more programs, which are stored in the memory and configured to be executed by the CPU. The one or more programs include instructions for performing the file transfer method provided by the embodiments of the present application.
Embodiments of the present application further provide a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a server, enable the server to execute the method for instance invocation provided by the foregoing embodiments.
Embodiments of the present application further provide a computer program product containing instructions, which when run on a server, cause the server to execute the method for instance invocation provided by the foregoing embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. An instance calling method is characterized in that a communication network comprises a plurality of service nodes, each service node is provided with a network filtering module, a plurality of instances and a plurality of flow agent modules bound with the instances one by one, the flow agent module arranged on a first service node can directly communicate with any flow agent module arranged on a second service node to obtain the identification of any instance arranged on the second service node and select the identification of a first instance to be called from the identification, and the first service node and the second service node are two service nodes in the plurality of service nodes;
the method comprises the following steps:
a first network filtering module receives a first message sent by a second network filtering module, where the first message carries an identifier of the first instance, the first network filtering module is a network filtering module deployed on the first service node, the second network filtering module is a network filtering module deployed on the second service node, the first instance is one instance currently called by the second instance among multiple instances deployed on the first service node, and the second instance is one of multiple instances deployed on the second service node;
and the first network filtering module sends the first message to the first instance so that the first instance performs service processing on the first message.
2. The method of claim 1, wherein the first network filtering module sending the first packet to the first instance comprises:
forwarding the first message by taking the address of the first traffic proxy module bound with the first instance as a destination address so as to send the first message to the first traffic proxy module, and carrying out traffic monitoring on the first message by the first traffic proxy module;
and forwarding the first message by taking the address of the first instance as a destination address so as to send the first message returned by the first flow agent module to the first instance.
3. The method of claim 2, wherein prior to forwarding the first packet using the address of the first traffic proxy module bound to the first instance as a destination address, further comprising:
acquiring the flow type of the first message;
and if the acquired flow type is the Transmission Control Protocol (TCP) flow, executing the step of forwarding the first message by taking the address of the first flow agent module bound with the first instance as a destination address.
4. The method according to claim 3, wherein after obtaining the traffic type of the first packet, the method comprises:
and if the acquired flow type is non-TCP flow, forwarding the first message by taking the address of the first example as a target address so as to send the first message to the first example.
5. The method of claim 1, wherein after the first network filtering module sends the first packet to the first instance, further comprising:
receiving a second message sent by the first instance, wherein the second message carries a processing result after the first instance performs service processing on the first message;
and sending the second message to the second network filtering module so that the second network filtering module sends the second message to the second instance.
6. The method of claim 5, wherein said sending the second packet to the second network filtering module comprises:
forwarding the second message by taking the address of the first traffic proxy module as a destination address so as to send the second message to the first traffic proxy module, and carrying out traffic monitoring on the second message by the first traffic proxy module;
and forwarding the second message by taking the address of the second network filtering module as a destination address so as to send the second message returned by the first flow agent module to the second network filtering module.
7. An instance invoking device applied to a first network filtering module deployed on a first service node in a communication network, the communication network comprising a plurality of service nodes, the first service node being one of the plurality of service nodes, each service node in the plurality of service nodes is provided with a network filtering module, a plurality of instances and a plurality of flow agent modules bound with the instances one by one, any flow agent module arranged on the second service node can directly communicate with any flow agent module arranged on the first service node, to obtain an identification of any instance bound to any traffic proxy module deployed on the first service node, selecting an identifier of a first instance to be called from the identifiers, wherein the second service node is one service node except the first service node in the service nodes;
the device comprises:
a first receiving module, configured to receive a first packet sent by a second network filtering module deployed on the second service node, where the first packet carries an identifier of the first instance, the first instance is one of multiple instances deployed on the first service node, the identifier of the first instance is determined by a second traffic agent module bound to a second instance from an obtained identifier of the instance, and is sent to the second network filtering module, and the second instance is one of multiple instances deployed on the second service node;
and the first sending module is used for sending the first message to the first instance so that the first instance performs service processing on the first message.
8. The apparatus of claim 7, wherein the first transmitting module comprises:
a first forwarding sub-module, configured to forward the first packet using an address of a first traffic agent module bound to the first instance as a destination address, so as to send the first packet to the first traffic agent module, where the first traffic agent module performs traffic monitoring on the first packet;
and the second forwarding sub-module is used for forwarding the first message returned by the first traffic agent module by taking the address of the first instance as a destination address so as to send the first message returned by the first traffic agent module to the first instance.
9. An apparatus for instance invocation, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of the method of any one of the above claims 1 to 6.
10. A computer-readable storage medium having stored thereon instructions which, when executed by a processor, carry out the steps of the method of any of the preceding claims 1 to 6.
CN201911205159.6A 2019-11-29 2019-11-29 Instance calling method and device and computer storage medium Active CN110995829B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911205159.6A CN110995829B (en) 2019-11-29 2019-11-29 Instance calling method and device and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911205159.6A CN110995829B (en) 2019-11-29 2019-11-29 Instance calling method and device and computer storage medium

Publications (2)

Publication Number Publication Date
CN110995829A CN110995829A (en) 2020-04-10
CN110995829B true CN110995829B (en) 2022-07-22

Family

ID=70088589

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911205159.6A Active CN110995829B (en) 2019-11-29 2019-11-29 Instance calling method and device and computer storage medium

Country Status (1)

Country Link
CN (1) CN110995829B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615315A (en) * 2022-03-22 2022-06-10 深圳壹账通创配科技有限公司 Communication method, device, equipment and storage medium for online conversation
CN114615321B (en) * 2022-03-25 2024-03-12 度小满科技(北京)有限公司 Flow processing method and device
CN117675693A (en) * 2024-01-08 2024-03-08 北京瑞和云图科技有限公司 Network traffic processing method, device, equipment and computer readable storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486389A (en) * 2014-12-04 2015-04-01 上海斐讯数据通信技术有限公司 Communication channel establishing method and system between window management services and APP (Application)
CN106250199A (en) * 2016-07-26 2016-12-21 北京北森云计算股份有限公司 The dynamic micro services call method of a kind of multilingual cloud compiling and device
CN107277086A (en) * 2016-04-06 2017-10-20 阿里巴巴集团控股有限公司 Transaction processing system, method for processing business and service updating method
CN107770243A (en) * 2017-09-06 2018-03-06 北京奥鹏远程教育中心有限公司 From extension, adaptive micro services platform and its application process
CN107885604A (en) * 2017-10-23 2018-04-06 用友网络科技股份有限公司 Method and device, computer equipment and the storage medium of communications between heterogeneous systems
CN109246251A (en) * 2018-11-13 2019-01-18 杭州数梦工场科技有限公司 A kind of micro services call method, device, system, equipment and readable storage medium storing program for executing
CN109542645A (en) * 2018-11-20 2019-03-29 北京锐安科技有限公司 A kind of method, apparatus, electronic equipment and storage medium calling service
CN109561226A (en) * 2017-09-26 2019-04-02 华为技术有限公司 A kind of API mixing multi-tenant method for routing, system and API gateway
CN109688191A (en) * 2018-10-24 2019-04-26 华为技术有限公司 Traffic scheduling method and communication device
CN109788015A (en) * 2017-11-15 2019-05-21 阿里巴巴集团控股有限公司 Application service invocation system, method and device
CN109995817A (en) * 2017-12-29 2019-07-09 中移信息技术有限公司 A kind of service scheduling method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2149084B1 (en) * 2007-04-17 2019-03-27 Visa U.S.A. Inc. Method and system for authenticating a party to a transaction
US9660943B2 (en) * 2014-04-25 2017-05-23 International Business Machines Corporation Messaging based signaling for communications sessions

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104486389A (en) * 2014-12-04 2015-04-01 上海斐讯数据通信技术有限公司 Communication channel establishing method and system between window management services and APP (Application)
CN107277086A (en) * 2016-04-06 2017-10-20 阿里巴巴集团控股有限公司 Transaction processing system, method for processing business and service updating method
CN106250199A (en) * 2016-07-26 2016-12-21 北京北森云计算股份有限公司 The dynamic micro services call method of a kind of multilingual cloud compiling and device
CN107770243A (en) * 2017-09-06 2018-03-06 北京奥鹏远程教育中心有限公司 From extension, adaptive micro services platform and its application process
CN109561226A (en) * 2017-09-26 2019-04-02 华为技术有限公司 A kind of API mixing multi-tenant method for routing, system and API gateway
CN107885604A (en) * 2017-10-23 2018-04-06 用友网络科技股份有限公司 Method and device, computer equipment and the storage medium of communications between heterogeneous systems
CN109788015A (en) * 2017-11-15 2019-05-21 阿里巴巴集团控股有限公司 Application service invocation system, method and device
CN109995817A (en) * 2017-12-29 2019-07-09 中移信息技术有限公司 A kind of service scheduling method and device
CN109688191A (en) * 2018-10-24 2019-04-26 华为技术有限公司 Traffic scheduling method and communication device
CN109246251A (en) * 2018-11-13 2019-01-18 杭州数梦工场科技有限公司 A kind of micro services call method, device, system, equipment and readable storage medium storing program for executing
CN109542645A (en) * 2018-11-20 2019-03-29 北京锐安科技有限公司 A kind of method, apparatus, electronic equipment and storage medium calling service

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An Auto Scaling System for API Gateway Based on Kubernetes;Meina Song;《IEEE》;20181125;全文 *
一种基于新型图模型的API推荐系统;吕晨;《计算机学报》;20141202;全文 *

Also Published As

Publication number Publication date
CN110995829A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
US20220224646A1 (en) Method for implementing service continuity and related device
CN110995829B (en) Instance calling method and device and computer storage medium
US11818585B2 (en) Selection of a network slice instantiation for transmitting uplink packets
CN113301166B (en) Service calling method and device, storage medium and electronic device
CN112104754B (en) Network proxy method, system, device, equipment and storage medium
US20190089648A1 (en) Resource subscription method, resource subscription apparatus, and resource subscription system
EP3142306B1 (en) Openflow communication method, system, controller, and service gateway
CN103986638B (en) The method and apparatus of many public network links of ADVPN tunnel binding
US11296978B2 (en) Enablement of multi-path routing in virtual edge systems
CN110784434B (en) Communication method and device
CN112929264B (en) Service flow transmission method, system and network equipment
US11770325B2 (en) Automatically selecting an optimized communication channel for communications with a deflect in an overlay network
CN112968965B (en) Metadata service method, server and storage medium for NFV network node
WO2023151264A1 (en) Load balancing method and apparatus, node, and storage medium
US20230336377A1 (en) Packet forwarding method and apparatus, and network system
CN106970843B (en) Remote calling method and device
CN109768874B (en) Method and device for configuration change in network
US10581979B2 (en) Information transmission method and apparatus
CN115996187A (en) Routing information processing method and device, routing information interaction system and routing equipment
KR101883712B1 (en) Method, apparatus and computer program for managing a network function virtualization system
JP7254951B2 (en) DATA TRANSMISSION METHOD, TERMINAL DEVICE AND STORAGE MEDIUM
CN105812274B (en) Service data processing method and related equipment
WO2018001127A1 (en) Transmission method, device and system, and computer readable storage medium
EP4161207A1 (en) Base station device and method for operating base station device
EP4221155A1 (en) Service function chaining enhancement

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221129

Address after: 31a, 15 / F, building 30, maple mall, bangrang Road, Brazil, Singapore

Patentee after: Baiguoyuan Technology (Singapore) Co.,Ltd.

Address before: 511402 5-13 / F, West Tower, building C, 274 Xingtai Road, Shiqiao street, Panyu District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU BAIGUOYUAN INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right