IP Library Granted Patent US 11,683,316
Granted Patent B2
US 11,683,316 · App. 17/596,420 · Granted Jun 20, 2023

Method and device for communication between microservices

Inventors: Yongkai Zhou (Shanghai, CN); Danni Jiang (Shanghai, CN); Gaolei Zhang (Shanghai, CN); Dongjie He (Shanghai, CN)
Assignee: CHINA UNIONPAY CO., LTD.
H04L63/101H04L63/20H04L67/10H04L9/40H04L63/10
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,683,316
App. No.
17/596,420
Granted
Jun 20, 2023
Kind
B2
Abstract

A method for communication between microservices, performed by a first host machine node, includes: obtaining a first microservice instance located on the first host machine node, determining a first microservice to which the first microservice instance belongs, and determining a list of triples corresponding to the first microservice according to the first microservice. The list of triples corresponding to the first microservice includes at least one triple, each triple of the at least one triple includes a visitor of the microservice, a visited party of the microservice, and an access port, and the visitor of the microservice of each triple included in the list of triples corresponding to the first microservice is the first microservice. The method also includes determining, by the first host machine node, an access policy of the first microservice instance according to the list of triples corresponding to the first microservice.

Claims (80)

1. A method for an optimized communication between microservices, comprising:

obtaining, by a first host machine node, a first microservice instance located on the first host machine node;

determining, by the first host machine node, a first microservice to which the first microservice instance belongs;

determining, by the first host machine node, a list of triples corresponding to the first microservice according to the first microservice, wherein the list of triples corresponding to the first microservice includes at least one triple, each triple of the at least one triple includes a visiting party of the microservice, a visited party of the microservice, and an access port, and the visiting party of the microservice of each triple included in the list of triples corresponding to the first microservice is the first microservice; and

determining, by the first host machine node, an access policy of the first microservice instance according to the list of triples corresponding to the first microservice.

2. The method according to claim 1 , after determining, by the first host machine node, the first microservice to which the first microservice instance belongs, further comprising:

sending, by the first host machine node, the first microservice to a server; and

receiving the list of triples corresponding to the first microservice returned by the server.

3. The method according to claim 1 , further comprising:

obtaining, by the first host machine node, a second microservice instance located on the first host machine node, wherein

when a microservice to which the second microservice instance belongs is the first microservice,

the first host machine node does not need to send the first microservice to the server; and

the first host machine node determines an access policy of the second microservice instance according to the list of triples corresponding to the first microservice.

4. The method according to claim 1 , further comprising:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has no other instances on the first host machine node:

deleting the list of triples corresponding to the first microservice; and

deleting, by the first host machine node, the access policy of the first microservice instance.

5. The method according to claim 1 , further comprising:

adding a third microservice instance on the first host machine node, when checking that a second microservice to which the third microservice instance belongs has no other instances on the first host machine node:

according to the second microservice, determining, by the first host machine node, a list of triples corresponding to the second microservice; and

according to the list of triples corresponding to the second microservice, determining, by the first host machine node, an access policy of the third microservice instance.

6. The method according to claim 1 , further comprising:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has an other instance on the first host machine node:

keeping, by the first host machine node, an access policy of the other instance of the first microservice determined according to the list of triples corresponding to the first microservice by the first host machine node.

7. The method according to claim 1 , further comprising:

adding a third microservice instance on the first host machine node, when checking that a second microservice to which the third microservice instance belongs has an other instance on the first host machine node:

keeping an access policy of the third microservice instance determined according to a list of triples corresponding to the second microservice by the first host machine node.

8. A computer device, comprising:

a memory, configured to store a program or an instruction; and

a processor, coupled with the memory and configured, when the program or the instruction is executed, to perform:

obtaining a first microservice instance located on a first host machine node;

determining a first microservice to which the first microservice instance belongs;

determining a list of triples corresponding to the first microservice according to the first microservice, wherein the list of triples corresponding to the first microservice includes at least one triple, each triple of the at least one triple includes a visiting party of the microservice, a visited party of the microservice, and an access port, and the visiting party of the microservice of each triple included in the list of triples corresponding to the first microservice is the first microservice; and

determining an access policy of the first microservice instance according to the list of triples corresponding to the first microservice.

9. The computer device according to claim 8 , wherein after determining the first microservice to which the first microservice instance belongs, the processor is further configured to perform:

sending the first microservice to a server; and

receiving the list of triples corresponding to the first microservice returned by the server.

10. The computer device according to claim 8 , wherein the processor is further configured to perform:

obtaining a second microservice instance located on the first host machine node, wherein

when a microservice to which the second microservice instance belongs is the first microservice,

the first host machine node does not need to send the first microservice to the server; and

the first host machine node determines an access policy of the second microservice instance according to the list of triples corresponding to the first microservice.

11. The computer device according to claim 8 , wherein the processor is further configured to perform:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has no other instances on the first host machine node:

deleting the list of triples corresponding to the first microservice; and

deleting the access policy of the first microservice instance.

12. The computer device according to claim 8 , wherein the processor is further configured to perform:

adding a third microservice instance on the first host machine node, when checking that a second microservice to which the third microservice instance belongs has no other instances on the first host machine node:

according to the second microservice, determining a list of triples corresponding to the second microservice; and

according to the list of triples corresponding to the second microservice, determining an access policy of the third microservice instance.

13. The computer device according to claim 8 , wherein the processor is further configured to perform:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has an other instance on the first host machine node:

keeping an access policy of the other instance of the first microservice determined according to the list of triples corresponding to the first microservice by the first host machine node.

14. The computer device according to claim 8 , wherein the processor is further configured to perform:

adding a third microservice instance on the first host machine node, when checking that a second microservice to which the third microservice instance belongs has an other instance on the first host machine node:

keeping an access policy of the third microservice instance determined according to a list of triples corresponding to the second microservice by the first host machine node.

15. A non-transitory computer readable storage medium, comprising a program or an instruction, wherein: when executed by a processor of a first host machine node, the program or the instruction causes the processor to perform:

obtaining a first microservice instance located on the first host machine node;

determining a first microservice to which the first microservice instance belongs;

determining a list of triples corresponding to the first microservice according to the first microservice, wherein the list of triples corresponding to the first microservice includes at least one triple, each triple of the at least one triple includes a visiting party of the microservice, a visited party of the microservice, and an access port, and the visiting party of the microservice of each triple included in the list of triples corresponding to the first microservice is the first microservice; and

determining an access policy of the first microservice instance according to the list of triples corresponding to the first microservice.

16. The storage medium according to claim 15 , wherein after determining the first microservice to which the first microservice instance belongs, the program or the instruction further causes the processor to perform:

sending the first microservice to a server; and

receiving the list of triples corresponding to the first microservice returned by the server.

17. The storage medium according to claim 15 , wherein the program or the instruction further causes the processor to perform:

obtaining a second microservice instance located on the first host machine node, wherein

when a microservice to which the second microservice instance belongs is the first microservice,

the first host machine node does not need to send the first microservice to the server; and

the first host machine node determines an access policy of the second microservice instance according to the list of triples corresponding to the first microservice.

18. The storage medium according to claim 15 , wherein the program or the instruction further causes the processor to perform:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has no other instances on the first host machine node:

deleting the list of triples corresponding to the first microservice; and

deleting the access policy of the first microservice instance.

19. The storage medium according to claim 15 , wherein the program or the instruction further causes the processor to perform:

adding a third microservice instance on the first host machine node, when checking that a second microservice to which the third microservice instance belongs has no other instances on the first host machine node:

according to the second microservice, determining a list of triples corresponding to the second microservice; and

according to the list of triples corresponding to the second microservice, determining an access policy of the third microservice instance.

20. The storage medium according to claim 15 , wherein the program or the instruction further causes the processor to perform:

when deleting the first microservice instance on the first host machine node and when checking that the first microservice to which the first microservice instance belongs has an other instance on the first host machine node:

keeping an access policy of the other instance of the first microservice determined according to the list of triples corresponding to the first microservice by the first host machine node.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2021
From: ZHOU, YONGKAI; JIANG, DANNI; ZHANG, GAOLEI; HE, DONGJIE
To: CHINA UNIONPAY CO., LTD.
Reel/Frame 058354/0125 →
Priority Claims (1)
CN 201910690826.8 · Jul 29, 2019 · national
Continuity (1)
Related Publication 20220311773A1 · Sep 29, 2022