[go: up one dir, main page]

CN107483538A - A kind of method and apparatus that access request bag is handled on the node of micro services cluster - Google Patents

A kind of method and apparatus that access request bag is handled on the node of micro services cluster Download PDF

Info

Publication number
CN107483538A
CN107483538A CN201710547119.4A CN201710547119A CN107483538A CN 107483538 A CN107483538 A CN 107483538A CN 201710547119 A CN201710547119 A CN 201710547119A CN 107483538 A CN107483538 A CN 107483538A
Authority
CN
China
Prior art keywords
mark
access request
port
request bag
empty
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710547119.4A
Other languages
Chinese (zh)
Other versions
CN107483538B (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.)
Poly Polytron Technologies Inc
Juhaokan Technology Co Ltd
Original Assignee
Poly Polytron Technologies Inc
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 Poly Polytron Technologies Inc filed Critical Poly Polytron Technologies Inc
Priority to CN201710547119.4A priority Critical patent/CN107483538B/en
Publication of CN107483538A publication Critical patent/CN107483538A/en
Application granted granted Critical
Publication of CN107483538B publication Critical patent/CN107483538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • 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
    • 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
    • H04L67/565Conversion or adaptation of application format or content

Landscapes

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

Abstract

The present embodiments relate to communication technical field, more particularly to a kind of method and apparatus that access request bag is handled on the node of micro services cluster, for realizing in the case where not increasing hardware cost, the access performance of service in micro services cluster is improved.In the embodiment of the present invention, the access request bag that Intranet client is sent is received, Intranet client is identical with the subnet mask of node;Identified according to the empty serve port carried in access request bag, determine destination service port-mark, and the empty serve port carried in access request bag is updated with destination service port-mark and is identified;The destination service port identified to destination service port-mark sends the access request bag after renewal.Therefore, the embodiment of the present invention does not need the access request bag of cluster entrance agency's forwarding Intranet client, and then can realize in the case where not increasing hardware cost, improves the access performance of service in micro services cluster.

Description

A kind of method and apparatus that access request bag is handled on the node of micro services cluster
Technical field
The present embodiments relate to field of cloud computer technology, more particularly to a kind of handled on the node of micro services cluster to visit The method and apparatus for asking request bag.
Background technology
Applied in traditional services into cloud computing micro services cluster transition process, due to the deployed many clothes of production environment Business application, it is difficult to once move to whole production environment in cloud computing micro services cluster, part of service is applied due to itself Reason can not be moved in cluster, and is present in outside cluster.And consider for micro services cluster safety, inside and outside micro services cluster Network will be isolated from each other, and therefore, the client outside micro services cluster can not directly be accessed in cluster and serviced.Outside micro services cluster Client include Intranet client and outer net client;Outer net client is referred to micro services cluster not in a network Client interior and outside cluster;Intranet client refers to the visitor in a network and outside cluster with micro services cluster Family end.
In the prior art, when the client outside micro services cluster accesses business in cluster, Intranet client and outer net client End by Nginx, HAProxy etc. increase income agent software be used as cluster entrance act on behalf of, that is to say, that cluster entrance agency needs All requests for forwarding Intranet client and outer net client to send, it is this that the pattern for concentrating forwarding is acted on behalf of by cluster entrance Readily become system bottleneck, for example cluster entrance Proxy load is too high, causes whole product systems hydraulic performance decline, has influence on whole The access of service in individual micro services cluster.In order to solve system bottleneck, cluster entrance agency to be done in itself in the prior art superfluous Remaining part is affixed one's name to, before again plus one layer of load-balancing device, can thus increase network complexity and hardware cost.
Therefore, a kind of method that access request bag is handled on the node of micro services cluster is needed badly, realizing is not increasing firmly In the case of part cost, the access performance of service in micro services cluster is improved.
The content of the invention
The embodiment of the present invention provides a kind of method and apparatus that access request bag is handled on the node of micro services cluster, real In the case of not increasing hardware cost now, the access performance of service in micro services cluster is improved.
The embodiment of the present invention provides a kind of method that access request bag is handled on the node of micro services cluster, including:Connect The access request bag that Intranet client is sent is received, the Intranet client is identical with the subnet mask of the node;According to described The empty serve port mark carried in access request bag, determines destination service port-mark, and with the destination service port Mark updates the empty serve port mark carried in the access request bag;The mesh identified to the destination service port-mark Mark serve port and send the access request bag after renewal.
The embodiment of the present invention provides a kind of device that access request bag is handled on the node of micro services cluster, including forwarding Module;The forwarding module includes:Receiving unit, for receiving the access request bag of Intranet client transmission;Wherein, in described Net client is identical with the subnet mask of the node;Processing unit, for being taken according to the void carried in the access request bag Business port-mark, destination service port-mark is determined, and the access request bag is updated with the destination service port-mark The empty serve port mark of middle carrying;Transmitting element, the destination service port identified to the destination service port-mark are sent out Send the access request bag after renewal.
The access request bag that the embodiment of the present invention is sent due to receiving Intranet client, the Intranet client and the section The subnet mask of point is identical;Identified according to the empty serve port carried in the access request bag, determine destination service port Mark, and the empty serve port carried in the access request bag is updated with the destination service port-mark and is identified;To described The destination service port that destination service port-mark is identified sends the access request bag after renewal.It is provided in an embodiment of the present invention Method is not as acting on behalf of the access request bag for receiving Intranet client by cluster entrance in the prior art, therefore can reduce collection The load of group's entrance agency's forwarding access request.So, it is possible to achieve in the case where not increasing hardware cost, improve micro services The access performance of service in cluster.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly introduced.
Fig. 1 is a kind of system architecture schematic diagram for accessing service in micro services cluster provided in an embodiment of the present invention;
Fig. 2 is a kind of method stream that access request bag is handled on the node of micro services cluster provided in an embodiment of the present invention Journey schematic diagram;
Fig. 3 is another processing access request bag on the first node of micro services cluster provided in an embodiment of the present invention Method flow schematic diagram;
Fig. 4 is a kind of device knot that access request bag is handled on the node of micro services cluster provided in an embodiment of the present invention Structure schematic diagram.
Embodiment
In order that the purpose of the present invention, technical scheme and beneficial effect are more clearly understood, below in conjunction with accompanying drawing and implementation Example, the present invention will be described in further detail.
The system architecture that Fig. 1 illustrates service in a kind of applicable access micro services cluster of the embodiment of the present invention is shown It is intended to.
The system architecture of service includes micro services cluster, Intranet client in access micro services cluster in the embodiment of the present invention End and outer net client, micro services cluster includes at least one node, for handling the access request bag outside cluster.Such as Fig. 1 institutes Show, service access system architecture 100 includes in the micro services cluster:Registration center 110, cluster entrance generation in micro services cluster Reason 120, node 130, node 140, node 150, the Intranet client 160 outside micro services cluster, and outer net client 170. Wherein, node 130 includes server instance 131, forwarding module 132 and incoming end bridge 133;Node 140 includes server instance 141st, forwarding module 142 and incoming end bridge 143;Node 150 includes server instance 151, forwarding module 152 and incoming end bridge 153。
In the embodiment of the present invention, the node in micro services cluster is in same subnet, by the node institute in micro services cluster Subnet be referred to as Intranet, the all-ones subnet in addition to the subnet where node is referred to as outer net.Registration in micro services cluster Intranet client 160 outside center 110, cluster entrance agency 120, node 130, node 140, node 150 and micro services cluster In Intranet, outer net client 170 is in outer net.Because outer net and Intranet are spaced, so the outer netter in outer net Family end 170 needs to access the server instance in micro services cluster by cluster entrance agency 120, and in Intranet in incognito Intranet client outside business cluster can not directly access the server instance in micro services cluster.
In micro services cluster in service access system architecture 100, the annexation of each network equipment is as follows:In registration The connecting node 130 of the heart 110, node 140 and node 150.Alternatively, on the one hand, the clothes in the connecting node 130 of registration center 110 Business device example 131, the server instance 141 in node 140, the server instance 151 in node 150.Registration center 110 passes through The registration request and heartbeat request that the reception server example 131, server instance 141 and server instance 151 are initiated, safeguard clothes Node listing corresponding to business device example list, each server instance, and the distribution of the server instance to be run on each node Empty serve port;One empty serve port corresponds to M server instance, and wherein M is natural number.Include at least one on each node Individual real serve port;One real serve port connects N number of server instance, and wherein N is natural number.On the other hand, registration center The incoming end bridge 143 in incoming end bridge 133, node 140, the incoming end bridge 153 in node 150 in 110 connecting nodes 130. Incoming end bridge 133, incoming end bridge 143, incoming end bridge 153 are periodically obtained corresponding to each server instance from registration center Empty serve port mark, and real serve port mark corresponding to each server instance, for node 130, node 140 and section Each node in point 150, the incoming end bridge on the node map according to the empty serve port of acquisition mark and server instance Relation, and real serve port identifies and the mapping relations of server instance, the real serve port mark on the real-time update node Know the first mapping relations with empty serve port mark.
Cluster entrance agency 120, on the one hand outer net client 170 of the connection in outer net, receives outer net client 170 The the second access request bag sent.On the other hand, the node 130 in the connection micro services cluster of cluster entrance agency 120, node 140 and node 150.Optionally, the server instance 131 in the difference connecting nodes 130 of cluster entrance agency 120, in node 140 Server instance 141 and node 150 in server instance 151.Cluster entrance agency 120 accesses receive second please The server instance for asking bag to be forwarded in micro services cluster, is handled by server instance.
The connecting node 130 of Intranet client 160, node 140 and node 150;Optionally, Intranet client 160 connects respectively Connect the forwarding module 132 in node 130, the forwarding module 142 in node 140, the forwarding module 152 in node 150.Interior netter Family end 160 sends the first access request bag to the forwarding module on each node, for node 130, node 140 and node 150 In each node, after the forwarding module on the node receives access request, access request is sent into the clothes to the node Business device example, is handled by server instance.
Fig. 2 is illustrated provided in an embodiment of the present invention a kind of handles access request on the node of micro services cluster The method flow schematic diagram of bag.
Based on the system architecture shown in Fig. 1, as shown in Fig. 2 the node provided in an embodiment of the present invention in micro services cluster The method of upper processing access request bag, comprises the following steps:
Step 201:Receive the access request bag that Intranet client is sent;Wherein, the subnet of Intranet client and node is covered Code-phase is same;
Step 202:Identified according to the empty serve port carried in access request bag, determine destination service port-mark, And the empty serve port carried in access request bag is updated with destination service port-mark and is identified;
Step 203:The destination service port identified to destination service port-mark sends the access request bag after renewal.
In the embodiment of the present invention, the node in micro services cluster is in same subnet, by the node institute in micro services cluster Subnet be referred to as Intranet, the all-ones subnet in addition to the subnet where node is referred to as outer net.In above-mentioned steps 201, Intranet Client is the client with node in same subnet.
In above-mentioned steps 202, update access request bag in carry empty serve port mark mode have it is a variety of.The present invention It is first to delete the empty serve port mark in access request bag that embodiment, which provides a kind of optional update mode, then adds target Serve port identifies.The embodiment of the present invention also provides a kind of optional update mode as directly in the position of empty serve port mark Put, substituting empty serve port with destination service port identifies.
The subnet of the access request bag that the embodiment of the present invention is sent due to receiving Intranet client, Intranet client and node Mask is identical;Identified according to the empty serve port carried in access request bag, determine destination service port-mark, and with target The empty serve port mark carried in serve port mark renewal access request bag;The mesh identified to destination service port-mark Mark serve port and send the access request bag after renewal.Method provided in an embodiment of the present invention is not as passing through collection in the prior art Group entrance agency receives the access request bag of Intranet client, therefore can reduce the negative of cluster entrance agency's forwarding access request Carry.So, it is possible to achieve in the case where not increasing hardware cost, improve the access performance of service in micro services cluster.
In the embodiment of the present invention, access request bag of the node except handling the transmission of Intranet client in micro services cluster, Also handle the access request bag that outer net client is sent.Wherein, outer net client is not in the visitor in same subnet with node Family end.In order to distinguish the access request bag that Intranet client and outer net client are sent, in embodiments of the present invention, by interior netter The access request bag that family end is sent is referred to as the first access request bag, and the access request bag that outer net client is sent is referred to as into the second visit Ask request bag.Wherein, " first " and " second " is intended merely to distinguish the access request bag that two kinds of client is sent, not Limiting meaning with quantity.
In specific embodiment, outer net client acts on behalf of the second access request bag of forwarding to micro services cluster by cluster entrance Interior node, the method for node processing the second access request bag in micro services cluster is same as the prior art, no longer superfluous herein State.The the first access request the bag how node in micro services cluster handles the transmission of Intranet client is mainly introduced below.
In a kind of optional embodiment, the empty clothes carried in the first access request bag are updated with destination service port-mark Business port-mark includes:Receive after the first access request bag of transport layer protocol transmission, to be searched in the first access request bag The position of empty serve port mark;After the opening position deletes empty serve port mark, destination service port-mark is set up.Such as This, the concrete mode of the destination service port-mark after a kind of renewal of offer of the embodiment of the present invention in the first access request bag, just The first access request after forwarding module is according to the first access request processing renewal after renewal.
Alternatively, any one node at least one node included for micro services cluster, the bag on each node Include forwarding module and real serve port.A kind of optional implementation is:Forwarding module can be the IP packets that kernel integrates Filtration system (Iptables), this programme make use of its forwarding capability to handle the first access request of Intranet client transmission Bag.
After forwarding module (Iptables) receives the first access request bag, reflected according to stored in forwarding module first Relation is penetrated, the first access request bag is handled, such as, it is determined which real serve port is the first access request is sent to. Wherein, the first mapping relations include the mapping relations of empty serve port mark and real serve port mark.
In a kind of optional embodiment, identified, determined according to the empty serve port carried in the first access request bag Destination service port-mark, including:The empty serve port carried in first access request bag is identified with being mapped included in first Empty serve port mark in relation is matched;When the empty serve port carried in the first access request bag is identified with being included in Empty serve port mark in first mapping relations is when the match is successful, the empty serve port mark from included in the first mapping relations Know the destination service port-mark jumped to empty serve port identity map.That is, the destination service port-mark is For the real serve port of the empty serve port identity map with the carrying in the first access request bag in the first mapping relations.It Afterwards, the destination service port that the destination service port-mark of forwarding module to empty serve port identity map is identified sends renewal The first access request bag afterwards.
It will be understood by a person skilled in the art that Nginx, HAProxy that cluster entrance agency of the prior art uses etc., Operate mainly on 7 layers of network, after reception of the data packet, it is necessary to be handled by load equalizer, 4 layers of processing, 7 layers, Back-end server is reached afterwards.So packet of the prior art forwarding and treatment effeciency are relatively low, and to CPU, interior Deposit, the resource requirement such as IO it is higher.And directly using in kernel module Iptables/Netfilter forwardings in the embodiment of the present invention First access request bag of net client, it is not necessary to by any load equalizer processes, the processing links that directly forwarding is passed through Less, so forward efficiency of the embodiment of the present invention than using cluster entrance agency's the first access request bag of forwarding in the prior art It is high.
In specific embodiment, at least one real serve port is included on node, each real serve port has one to preset Mark.After destination service port is determined from the first mapping relations, forwarding module is marked to destination service port-mark The destination service port of knowledge sends the first access request bag after renewal, and the optional embodiment of one of which is:Forwarding module The each real serve port included on to node sends the first access request bag after renewal.Afterwards, after each receiving renewal The real serve port of first access request bag, the default mark of itself and the destination service port in the first access request bag are entered Row matching, if it fails to match, the real serve port is not destination service port, and first visits after the real serve port will update Ask that request bag abandons;If the match is successful, the real serve port is exactly destination service port, and the real serve port continues with more First access request after new.In a kind of optional embodiment, destination service port receives the first access request bag after renewal; The destination service port-mark carried in the first access request bag after renewal matches with the default mark of destination service port During success, sent to destination service port subnet mask identical server instance in the first access request bag after renewal Request data, and server instance is different from the subnet mask of node.
In the embodiment of the present invention, at least one and destination service port subnet mask identical is also included in micro services cluster Server instance.That is, to destination service port subnet mask identical server instance send renewal after first Request data in access request bag, including at least following two situations.
The first situation, there was only one with destination service port subnet mask identical server instance, for example, than Destination service port-mark after such as updating in the first access request bag is 32, if the target with the destination service port-mark 32 One server instance of serve port subnet mask identical is server instance 3, then destination service port is received including mesh Mark serve port is identified as after 32 renewal after the first access request bag, the request after this is updated in the first access request bag Data are sent to server instance 3.
Second of situation, have with destination service port subnet mask identical server instance it is multiple, for example, such as Destination service port-mark after renewal in the first access request bag is 51, if being taken with the target of the destination service port-mark 51 Business port subnet mask identical server instance has three, is respectively:Server instance 4, server instance 5 and server are real Example 6.Destination service port receive including destination service port-mark be 51 renewal after the first access request bag when, by this more First request sends real to the subnet mask identical server with the destination service end of the destination service port-mark 51 after new One in example 4, server instance 5 and server instance 6.A kind of optional sending method is:Destination service port can be by solid Fixed sequencing, three server instances of subnet mask identical for giving the destination service port send the first visit after renewal Ask the request data in request bag.For example destination service port is by the first access request bag after receive first renewal Request data be sent to server instance 4, by receive second renewal after the first access request bag in request data Server instance 5 is sent to, the request data in the first access request bag after the receive the 3rd renewal is sent to service Device example 6, the request data in the first access request bag after the receive the 4th renewal is sent to server instance 4, with This analogizes.
In a kind of optional embodiment, micro services cluster also includes registration center, each service in micro services cluster After device example starts, registration request can be sent from trend registration center.Server instance upon registration, can be regularly to registration Center sends heartbeat request, informs that registration center's book server example is online (survival).Registration center is real by the reception server The registration request and heartbeat request that example is initiated, node listing, list of server instances etc. are safeguarded, and it is empty for server instance distribution Serve port.
For example, such as, within the period 1, micro services cluster includes 3 nodes, respectively node A, node B With node C.Wherein, node A includes server instance 1, server instance 2, server instance 3, and node B includes server Example 4, node C include server instance 5, server instance 6, include 6 server instances in the micro services cluster altogether. During running, such as second round, in fact it could happen that registration center is not receiving node A clothes more than preset duration The heartbeat request of business device example 2, node A server instance 2 may fail, and now need the server for safeguarding registration center Server instance 2 removes in example list.May also registration center receive registration that server instance 7 in node B is sent please Ask, illustrate that node B adds a server instance 7, the list of server instances for now needing to safeguard registration center is added Server instance 7.
In the embodiment of the present invention, registration center receive micro services cluster include server instance registration message it Afterwards, following information is dynamically updated in registration center:In micro services cluster on each node include list of server instances and Second mapping relations of server instance and empty end serve port mark.
Alternatively, each node in micro services cluster also includes incoming end bridge.In a kind of optional embodiment, access Bridge is held as the application program of the first mapping relations on renewal forwarding module (Iptables) can be achieved.The embodiment of the present invention provides Micro services cluster in service access method also include:The second mapping relations that periodic receipt updates in registration center;Root The first mapping relations are updated according to the second mapping relations of renewal.In this way, the incoming end bridge of deployment on each node can be timely The second mapping relations of above-mentioned renewal are obtained from registration center, and then the first mapping stored on the Iptables that upgrades in time is closed System, the dynamic change (such as capacity reducing, dilatation, hang etc.) because of the list of server instances in micro services cluster can be avoided, and Cause can not find the first access request that server instance processing Intranet client corresponding to correct destination service port is sent The situation of bag.
For example, so that micro services cluster includes node A as an example, 5 real serve ports, real service are included on node A Port-mark is respectively a, b, c, d, e.In the period 1, node A includes server instance 1, server instance 2, server Example 3.Registration center be server instance 1, server instance 2 distribute empty serve port be identified as 20, be server instance 3 That distributes empty serve port is identified as 22.First mapping relations of period 1 forwarding module are:Empty port-mark 20 maps reality Serve port a, empty port-mark 22 map real serve port c.The first mapping stored according to the forwarding module of period 1 is closed System's the first access request bag of processing includes:The empty serve port carried in first access request bag mark 20 is updated to real service Port a.
One server instance 4 of dilatation in second round, node A, connect real serve port mark d, registration center Empty serve port, which is distributed, for server instance 4 is identified as 31.Second round, the incoming end bridge renewal forwarding module on node A are deposited First mapping relations of storage, empty serve port mark 31 and real serve port mark d mapping are added in the first mapping relations Relation.The first mapping relations are after renewal:Empty port-mark 20 maps real serve port a, and empty port-mark 22 maps real service Port c, the empty real serve port mark d of the mapping of serve port mark 31.
If the first mapping relations on second round node A do not update, it is possible to problems with occur:Such as second Cycle forwarding module receives the empty serve port of carrying and is identified as 31 the first access request bag, but does not find destination service end Mouthful, cause node A can not handle the first access request bag.And scheme provided in an embodiment of the present invention have updated in second round First mapping relations, can avoid receiving when empty serve port is identified as 31 the first access request bag can not timely processing Problem.
Above method flow is introduced in order to clearer, the embodiment of the present invention provides the example below.
Fig. 3 illustrates another kind provided in an embodiment of the present invention and visit is handled on the first node of micro services cluster The method flow schematic diagram of request bag is asked, based on the system architecture shown in Fig. 1, first node includes incoming end bridge, destination service Port, forwarding module etc..As shown in figure 3, another kind provided in an embodiment of the present invention is located on the first node of micro services cluster The method for managing access request bag, comprises the following steps:
Step 301:Incoming end bridge periodically obtains the second mapping relations from registration center;
Step 302:Incoming end bridge compares the second mapping relations of current period acquisition and the second of acquisition of previous cycle is reflected Whether identical penetrate relation;If so, then perform step 303;If it is not, then perform step 304;
Step 303:Incoming end bridge does not update the first mapping relations stored on forwarding module;Afterwards, step 305 is performed;
Step 304:The second mapping relations that incoming end bridge obtains according to current period, first updated on forwarding module are reflected Penetrate relation;Afterwards, step 305 is performed;
Step 305:Forwarding module receives the first access request bag of Intranet client transmission in current period;Intranet client End is identical with the subnet mask of node;
Step 306:Forwarding module identifies the empty serve port carried in the first access request bag with being reflected included in first The empty serve port mark penetrated in relation is matched;Wherein, the first mapping relations include empty serve port mark and real service The mapping relations of port-mark;
Step 307:The empty serve port mark carried in first access request bag is with being included in the first mapping relations Empty serve port identifies whether that the match is successful;If so, then perform step 308;If it is not, then perform step 309;
Step 308:Empty serve port mark from included in the first mapping relations jumps to be identified with empty serve port The destination service port-mark of mapping;Afterwards, step 310 is performed;
Step 309:Abandon the first access request bag;Afterwards, terminate;
Step 310:The destination service port that forwarding module is identified to destination service port-mark sends the after renewal One access request bag;
Step 311:Destination service port receives the first access request bag after the renewal;
Step 312:Destination service port determines the destination service port mark carried in the first access request bag after renewal The match is successful for the default mark of knowledge and destination service port;If so, then perform step 313;If it is not, then perform step 314;
Step 313:Destination service port sends renewal to destination service port subnet mask identical server instance The request data in the first access request bag afterwards,;Server instance is different from the subnet mask of node;
Step 314:Abandon the first access request bag after updating;Afterwards, terminate.
After above-mentioned steps 314, if Intranet client does not receive the processing of the first access request bag in preset duration Data, then send the first access request bag to section point, and section point handles the flow and first segment of the first access request bag The handling process of point is identical, and section point is any one node in addition to first node in micro services cluster.
First node receives the first access request bag that Intranet client is sent, and the second visit that outer net client is sent After asking request bag, main handling process includes following two aspects:On the one hand, first node receives Intranet client and sent The first access request bag, by handling the first access request with the subnet mask identical server instance of destination service port Bag, after obtaining the first processing data, sends the forwarding module to node by the first processing data, is sent by forwarding module To Intranet client.On the other hand, the server instance on first node is visited in receive the agency's forwarding of cluster entrance second After asking that request bag, the second access request bag of processing obtain second processing data, second processing data are sent to cluster entrance Agency, by cluster entrance, agency is sent to outer net client.
On the one hand the embodiment of the present invention, due to the node in micro services cluster, receives the first visit that Intranet client is sent Request bag is asked, is not as acting on behalf of the access request bag for receiving Intranet client by cluster entrance in the prior art, therefore can be with Reduce the load of cluster entrance agency's forwarding access request;On the other hand, due to described in the node processing in micro services cluster One access request bag obtains the first processing data, and first processing data is sent to Intranet client, is not as existing Inside net client forward process data are acted on behalf of by cluster entrance in technology, therefore cluster entrance can be reduced and acted on behalf of at forwarding Manage the load of data;In this way, the embodiment of the present invention does not need the first access request of cluster entrance agency's forwarding Intranet client Bag, it is possible to achieve in the case where not increasing hardware cost, improve the access performance of service in micro services cluster.
Based on above example and same idea, Fig. 4 is a kind of processing access request bag that the embodiment of the present application provides Apparatus structure schematic diagram.
As shown in figure 4, the device 400 can also be chip or circuit, for example may be disposed on the node of micro services cluster Chip or circuit.The device 400 can correspond to the node in the above method, can also correspond in above-mentioned Fig. 1 130,140, Any one in 150.The device 400 can realize any one as shown in figure 2 above or appoint it is multinomial corresponding to terminal in method Step performed by equipment.The device 400 can include forwarding module 410.Wherein forwarding module 410 include receiving unit 411, Processing unit 412 and transmitting element 413.Alternatively, the device 400 can also include destination service port 520 and incoming end bridge 530。
Receiving unit, for receiving the access request bag of Intranet client transmission;Wherein, the Intranet client with it is described The subnet mask of node is identical;Processing unit, for being identified according to the empty serve port carried in the access request bag, it is determined that Go out destination service port-mark, and the empty service end carried in the access request bag is updated with the destination service port-mark Mouth mark;Transmitting element, the access that the destination service port identified to the destination service port-mark sends after renewal please Seek bag.
The access request bag that the embodiment of the present invention is sent due to receiving Intranet client, the Intranet client and the section The subnet mask of point is identical;Identified according to the empty serve port carried in the access request bag, determine destination service port Mark, and the empty serve port carried in the access request bag is updated with the destination service port-mark and is identified;To described The destination service port that destination service port-mark is identified sends the access request bag after renewal.It is provided in an embodiment of the present invention Method is not as acting on behalf of the access request bag for receiving Intranet client by cluster entrance in the prior art, therefore can reduce collection The load of group's entrance agency's forwarding access request.So, it is possible to achieve in the case where not increasing hardware cost, improve micro services The access performance of service in cluster.
Alternatively, the processing unit, for will be carried in the access request bag empty serve port mark with comprising Empty serve port mark in the first mapping relations is matched;Wherein, first mapping relations include empty serve port The mapping relations of mark and real serve port mark;When the empty serve port carried in the access request bag is identified with being included in Empty serve port mark in first mapping relations is when the match is successful, the empty serve port mark from included in the first mapping relations Know the destination service port-mark jumped to empty serve port identity map.
Alternatively, the node also includes destination service port, for receiving the access request bag after the renewal;Work as institute State the default mark of the destination service port-mark and destination service port carried in the access request bag after renewal When the match is successful, to sending the access request bag after the renewal with the destination service port subnet mask identical server In request data, and the server is different from the subnet mask of the node.
Alternatively, the processing unit, for receiving with after the access request bag of transport layer protocol transmission, from described The position of empty serve port mark is searched in access request bag;After the empty serve port mark is deleted in the position, set up Destination service port-mark.
Alternatively, incoming end bridge, the second mapping relations updated for periodic receipt in registration center;According to described The second mapping relations after renewal update first mapping relations;Second mapping relations include empty serve port mark and The mapping relations of server instance.
The related concept of technical scheme provided to the embodiment of the present application involved by the device, explain and detailed description and Other steps refer to the description as described in these contents in preceding method or other embodiment, do not repeat herein.
It should be understood that the division of above unit is only a kind of division of logic function, can be whole when actually realizing Or be partially integrated on a physical entity, can also be physically separate.In the above-described embodiments, can lead to whole or in part Cross software, hardware, firmware or its any combination to realize, when being realized using software program, can whole or in part with The form of computer program product is realized.Computer program product includes one or more instruct.Load and hold on computers During row computer program instructions, flow or function according to the embodiment of the present invention are produced whole or in part.Computer can be All-purpose computer, special-purpose computer, computer network or other programmable devices.Instruction can be stored in computer storage In medium, or the transmission from a computer-readable storage medium to another computer-readable storage medium, for example, instruction can be from one Web-site, computer, server or data center by wired (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or Wirelessly (such as infrared, wireless, microwave etc.) mode is passed to another web-site, computer, server or data center It is defeated.Computer-readable storage medium can be any usable medium that computer can access or can use Jie comprising one or more The data storage devices such as the integrated server of matter, data center.Usable medium can be magnetic medium, (for example, floppy disk, hard disk, Tape, magneto-optic disk (MO) etc.), optical medium (for example, CD, DVD, BD, HVD etc.) or semiconductor medium (such as ROM, EPROM, EEPROM, nonvolatile memory (NAND FLASH), solid state hard disc (Solid State Disk, SSD)) etc..
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program production Product.Therefore, in terms of the embodiment of the present invention can use complete hardware embodiment, complete software embodiment or combine software and hardware Embodiment form.Moreover, the embodiment of the present invention can use wherein includes computer available programs generation in one or more The meter implemented in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of code The form of calculation machine program product.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, equipment (system) and computer program product Flow chart and/or block diagram describe.It should be understood that can be by computer program instructions implementation process figure and/or block diagram Each flow and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These calculating can be provided Processing of the machine programmed instruction to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices Device is to produce a machine so that the instruction for passing through computer or the computing device of other programmable data processing devices produces For realizing the function of being specified in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames Device.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
Obviously, those skilled in the art can carry out various changes and modification without departing from this Shen to the embodiment of the present invention Spirit and scope please.So, if these modifications and variations of the embodiment of the present invention belong to the application claim and its waited Within the scope of technology, then the application is also intended to comprising including these changes and modification.

Claims (10)

  1. A kind of 1. method that access request bag is handled on the node of micro services cluster, it is characterised in that including:
    The access request bag that Intranet client is sent is received, the Intranet client is identical with the subnet mask of the node;
    Identified according to the empty serve port carried in the access request bag, determine destination service port-mark, and with described Destination service port-mark updates the empty serve port mark carried in the access request bag;
    The destination service port identified to the destination service port-mark sends the access request bag after renewal.
  2. 2. the method as described in claim 1, it is characterised in that described according to the empty service end carried in the access request bag Mouth mark, determines destination service port-mark, including:
    The empty serve port carried in the access request bag is identified and the empty serve port included in the first mapping relations Mark is matched;Wherein, first mapping relations include the mapping pass of empty serve port mark and real serve port mark System;
    When the empty serve port mark and the empty serve port included in the first mapping relations that are carried in the access request bag When the match is successful, the empty serve port mark from included in the first mapping relations jumps to reflects mark with empty serve port mark The destination service port-mark penetrated.
  3. 3. the method as described in claim 1-2, it is characterised in that the mesh identified to the destination service port-mark After mark serve port sends the access request bag for updating and being obtained after the destination service port-mark, in addition to:
    The destination service port receives the access request bag after the renewal;
    The destination service port-mark carried in access request bag after the renewal and the destination service port Default mark is when the match is successful, to after sending the renewal with the destination service port subnet mask identical server instance Access request bag in request data, and the server instance is different from the subnet mask of the node.
  4. 4. method as claimed in claim 3, it is characterised in that described that the access is updated with the destination service port-mark The empty serve port mark carried in request bag, including:
    Receive so that after the access request bag of transport layer protocol transmission, empty serve port mark is searched in the access request bag The position of knowledge;
    After the empty serve port mark is deleted in the position, destination service port-mark is set up.
  5. 5. the method as described in claim 2 or 4, it is characterised in that methods described also includes:
    The second mapping relations that periodic receipt updates in registration center;
    First mapping relations are updated according to the second mapping relations of the renewal;Second mapping relations include empty service The mapping relations of port-mark and server instance.
  6. 6. a kind of device that access request bag is handled on the node of micro services cluster, it is characterised in that including forwarding module;Institute Stating forwarding module includes:
    Receiving unit, for receiving the access request bag of Intranet client transmission;Wherein, the Intranet client and the node Subnet mask it is identical;
    Processing unit, for being identified according to the empty serve port carried in the access request bag, determine destination service port Mark, and the empty serve port carried in the access request bag is updated with the destination service port-mark and is identified;
    Transmitting element, the destination service port identified to the destination service port-mark send the access request after renewal Bag.
  7. 7. device as claimed in claim 6, it is characterised in that the processing unit, be used for:
    The empty serve port carried in the access request bag is identified and the empty serve port included in the first mapping relations Mark is matched;Wherein, first mapping relations include the mapping pass of empty serve port mark and real serve port mark System;
    When the empty serve port mark and the empty serve port included in the first mapping relations that are carried in the access request bag When the match is successful, the empty serve port mark from included in the first mapping relations jumps to reflects mark with empty serve port mark The destination service port-mark penetrated.
  8. 8. the device as described in claim 6-7, it is characterised in that the node also includes destination service port, is used for:
    Receive the access request bag after the renewal;
    The destination service port-mark carried in access request bag after the renewal and the destination service port Default mark is when the match is successful, to sending the visit after the renewal with the destination service port subnet mask identical server The request data in request bag is asked, and the server is different from the subnet mask of the node.
  9. 9. device as claimed in claim 8, it is characterised in that the processing unit, be used for:
    Receive so that after the access request bag of transport layer protocol transmission, empty serve port mark is searched from the access request bag The position of knowledge;
    After the empty serve port mark is deleted in the position, destination service port-mark is set up.
  10. 10. the device as described in claim 7-9, it is characterised in that the node also includes incoming end bridge, is used for:
    The second mapping relations that periodic receipt updates in registration center;
    First mapping relations are updated according to the second mapping relations after the renewal;Second mapping relations include empty take The mapping relations of business port-mark and server instance.
CN201710547119.4A 2017-07-06 2017-07-06 Method and device for processing access request packet on node of micro-service cluster Active CN107483538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710547119.4A CN107483538B (en) 2017-07-06 2017-07-06 Method and device for processing access request packet on node of micro-service cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710547119.4A CN107483538B (en) 2017-07-06 2017-07-06 Method and device for processing access request packet on node of micro-service cluster

Publications (2)

Publication Number Publication Date
CN107483538A true CN107483538A (en) 2017-12-15
CN107483538B CN107483538B (en) 2021-01-01

Family

ID=60595673

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710547119.4A Active CN107483538B (en) 2017-07-06 2017-07-06 Method and device for processing access request packet on node of micro-service cluster

Country Status (1)

Country Link
CN (1) CN107483538B (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services
CN108712464A (en) * 2018-04-13 2018-10-26 中国科学院信息工程研究所 A kind of implementation method towards cluster micro services High Availabitity
CN108833462A (en) * 2018-04-13 2018-11-16 中国科学院信息工程研究所 A system and method for microservice-oriented self-registration service discovery
CN109302469A (en) * 2018-09-26 2019-02-01 平安科技(深圳)有限公司 Micro services management method, device, computer equipment and storage medium
CN110880091A (en) * 2018-09-05 2020-03-13 易保网络技术(上海)有限公司 Micro-service flow processing method and device
CN111431956A (en) * 2019-01-10 2020-07-17 阿里巴巴集团控股有限公司 Cross-network service access method, device, system and storage medium
CN112055039A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Data access method, device and system and computing equipment
CN112615849A (en) * 2020-12-15 2021-04-06 平安科技(深圳)有限公司 Micro-service access method, device, equipment and storage medium
US11082526B2 (en) 2019-08-19 2021-08-03 International Business Machines Corporation Optimizing large parameter passing in a service mesh
CN113472823A (en) * 2020-03-30 2021-10-01 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
CN113590236A (en) * 2021-08-03 2021-11-02 聚好看科技股份有限公司 Server and micro-service declarative interface timeout configuration method
CN113806104A (en) * 2021-08-02 2021-12-17 北京房江湖科技有限公司 Interface access request processing method, API gateway, server and system
CN114422510A (en) * 2020-10-13 2022-04-29 腾讯科技(深圳)有限公司 Service processing method and device
CN114465895A (en) * 2022-03-03 2022-05-10 上海微盟企业发展有限公司 Request distribution method, device, equipment and storage medium based on micro service
CN115361368A (en) * 2022-07-25 2022-11-18 上海钐昆网络科技有限公司 Data processing method, device, equipment and storage medium
CN115720224A (en) * 2022-11-07 2023-02-28 中科方德软件有限公司 Access method, device, electronic device and medium based on desktop cloud
CN119254840A (en) * 2024-12-04 2025-01-03 天翼云科技有限公司 Microservice application access method, device, computer equipment, medium and product

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011140028A1 (en) * 2010-05-03 2011-11-10 Brocade Communications Systems, Inc. Virtual cluster switching
CN102420867A (en) * 2011-12-01 2012-04-18 浪潮电子信息产业股份有限公司 Cluster storage entry resolution method based on real-time load balancing mechanism
CN102469110A (en) * 2010-11-01 2012-05-23 英业达股份有限公司 Load balancing method applied to cluster system
CN103051529A (en) * 2012-12-20 2013-04-17 华为技术有限公司 Method and device for processing messages
US20130148511A1 (en) * 2011-12-09 2013-06-13 Brocade Communications Systems, Inc. Ampp active profile presentation
CN104579973A (en) * 2014-12-24 2015-04-29 北京华为数字技术有限公司 Message forwarding method and device of virtual cluster
CN105721566A (en) * 2016-01-29 2016-06-29 华为技术有限公司 Method for redirecting port, server and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011140028A1 (en) * 2010-05-03 2011-11-10 Brocade Communications Systems, Inc. Virtual cluster switching
CN102986172A (en) * 2010-05-03 2013-03-20 博科通讯系统有限公司 Virtual cluster switching
CN102469110A (en) * 2010-11-01 2012-05-23 英业达股份有限公司 Load balancing method applied to cluster system
CN102420867A (en) * 2011-12-01 2012-04-18 浪潮电子信息产业股份有限公司 Cluster storage entry resolution method based on real-time load balancing mechanism
US20130148511A1 (en) * 2011-12-09 2013-06-13 Brocade Communications Systems, Inc. Ampp active profile presentation
CN103051529A (en) * 2012-12-20 2013-04-17 华为技术有限公司 Method and device for processing messages
CN104579973A (en) * 2014-12-24 2015-04-29 北京华为数字技术有限公司 Message forwarding method and device of virtual cluster
CN105721566A (en) * 2016-01-29 2016-06-29 华为技术有限公司 Method for redirecting port, server and system

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712464A (en) * 2018-04-13 2018-10-26 中国科学院信息工程研究所 A kind of implementation method towards cluster micro services High Availabitity
CN108833462A (en) * 2018-04-13 2018-11-16 中国科学院信息工程研究所 A system and method for microservice-oriented self-registration service discovery
CN108664343B (en) * 2018-05-09 2022-08-23 顺丰科技有限公司 State calling method and device for micro-service
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services
CN110880091A (en) * 2018-09-05 2020-03-13 易保网络技术(上海)有限公司 Micro-service flow processing method and device
CN109302469A (en) * 2018-09-26 2019-02-01 平安科技(深圳)有限公司 Micro services management method, device, computer equipment and storage medium
CN111431956A (en) * 2019-01-10 2020-07-17 阿里巴巴集团控股有限公司 Cross-network service access method, device, system and storage medium
CN111431956B (en) * 2019-01-10 2022-07-05 阿里巴巴集团控股有限公司 Cross-network service access method, device, system and storage medium
CN112055039A (en) * 2019-06-06 2020-12-08 阿里巴巴集团控股有限公司 Data access method, device and system and computing equipment
US11082526B2 (en) 2019-08-19 2021-08-03 International Business Machines Corporation Optimizing large parameter passing in a service mesh
CN113472823A (en) * 2020-03-30 2021-10-01 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
CN113472823B (en) * 2020-03-30 2023-06-27 深圳Tcl数字技术有限公司 Server access method and device, intelligent terminal and storage medium
CN114422510B (en) * 2020-10-13 2024-04-30 腾讯科技(深圳)有限公司 Service processing method and device
CN114422510A (en) * 2020-10-13 2022-04-29 腾讯科技(深圳)有限公司 Service processing method and device
CN112615849B (en) * 2020-12-15 2022-04-26 平安科技(深圳)有限公司 Micro-service access method, device, equipment and storage medium
CN112615849A (en) * 2020-12-15 2021-04-06 平安科技(深圳)有限公司 Micro-service access method, device, equipment and storage medium
CN113806104A (en) * 2021-08-02 2021-12-17 北京房江湖科技有限公司 Interface access request processing method, API gateway, server and system
CN113590236A (en) * 2021-08-03 2021-11-02 聚好看科技股份有限公司 Server and micro-service declarative interface timeout configuration method
CN113590236B (en) * 2021-08-03 2023-10-31 聚好看科技股份有限公司 Server and microservice declarative interface timeout configuration method
CN114465895A (en) * 2022-03-03 2022-05-10 上海微盟企业发展有限公司 Request distribution method, device, equipment and storage medium based on micro service
CN115361368A (en) * 2022-07-25 2022-11-18 上海钐昆网络科技有限公司 Data processing method, device, equipment and storage medium
CN115720224A (en) * 2022-11-07 2023-02-28 中科方德软件有限公司 Access method, device, electronic device and medium based on desktop cloud
CN119254840A (en) * 2024-12-04 2025-01-03 天翼云科技有限公司 Microservice application access method, device, computer equipment, medium and product
CN119254840B (en) * 2024-12-04 2025-05-06 天翼云科技有限公司 Microservice application access method, device, computer equipment, medium and product

Also Published As

Publication number Publication date
CN107483538B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN107483538A (en) A kind of method and apparatus that access request bag is handled on the node of micro services cluster
US12301443B2 (en) Automated route propagation among networks attached to scalable virtual traffic hubs
US12316477B2 (en) Virtual traffic hub management
US20240095865A1 (en) Resource usage monitoring, billing and enforcement for virtual private label clouds
US10797989B2 (en) Scalable virtual traffic hub interconnecting isolated networks
US12010195B2 (en) Efficient flow management utilizing control packets
CN105264865B (en) Method and distributed load balancer system for distributed load balancing
US10581703B2 (en) Method for controlling on-demand service provisioning
US20210075727A1 (en) Multi-account gateway
JP3963690B2 (en) Packet relay processor
CN105657081B (en) The method, apparatus and system of DHCP service are provided
JP5931908B2 (en) Techniques for managing traffic in routers
CN104811392B (en) For handling the method and system of the resource access request in network
CN105308929A (en) Distributed load balancer
CN108965007A (en) API gateway interface configures update method and device
JP2016110628A (en) Content placement in hierarchical networks of caches
JP2016152453A (en) Communication control system, communication method, and gateway device
JP2016111703A (en) Content arrangement in information centric network
WO2024066676A1 (en) Inference method and apparatus for neural network model, and related device
CN111555987B (en) Current limiting configuration method, device, equipment and computer storage medium
CN109120556A (en) A kind of method and system of cloud host access object storage server
CN113032576B (en) Knowledge graph management method, device, equipment and storage medium
US20140328342A1 (en) Privacy Preserving Query Method and System for Use in Federated Coalition Networks
JP6546566B2 (en) Parallel load distribution system, parallel load distribution method, SDN controller host and program
CN113722084B (en) Data processing method, device, electronic device and computer storage medium

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