Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Service registration and service discovery method for micro-service

A technology of service discovery and service registration, applied in the management field of external registry of microservices, which can solve the problems of registry downtime, external registry downtime, and difficulty in managing nodes at the same time.

Active Publication Date: 2020-01-10
荣邦科技有限公司 +1
View PDF5 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Moreover, the current mainstream registration center is cluster-centralized. This kind of service governance solution with one or a few external registration centers has the risk of the external registration center being down and causing the entire system to be paralyzed, especially when there are many nodes in the cluster. , it is difficult for the registration center to manage too many nodes at the same time, which is more likely to cause the registration center to go down

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Service registration and service discovery method for micro-service
  • Service registration and service discovery method for micro-service
  • Service registration and service discovery method for micro-service

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0105] Embodiment 1: It is now assumed that node C is the bootstrap node; for the convenience of description, it is assumed that the order of starting the five nodes is A, C, B, D, E. That is, when node A starts to send a PING message to C, C has not yet started and there is no response, A will retry after a timeout; while when BCDE sends a PING, C has started and will respond immediately, so BDE will start sending query service messages first. Such as figure 1 Shown is the flow chart of a query node query service. Assuming that the three nodes of BDE send query service messages in sequence, the following is a detailed description of the query service process:

[0106] Node B needs to consume service 1000, send B(1000) query service message to node C, and the forwarding flag is true. After node C receives B(1000)'s query service message, it queries its own service list HashMap and finds that it does not contain a value with a key of 1000, that is, it does not find the target...

Embodiment 2

[0109] Embodiment 2: Node D provides service 1101 and needs to consume services 1010 and 1000 at the same time. Assume that they send query service messages D(1101), D(1010), and D(1000) to node C in sequence, and the forwarding flag is true:

[0110] (1) After node C receives the query service message from D (1101), C's service list HashMap does not contain the value of key 1101, and the target service information is not found, so there is no need to send a registration message; it does not contain the value of key 1100 (after the last digit of 1101 is negated), that is, C is not a consumer of service 1101, and does not need to reply to a registration message, nor can it be added to the service list.

[0111] The service ID of D(1101) is 1101, the node ID of C node is 1111, their XOR distance is 1101 ⊕1111=0010, the range is [2^1,2^2), that is, the service route with the attribution sequence number 1 Table, take out the value of key 1 from the service routing table HashMap, ...

Embodiment 3

[0123] Embodiment 3: E-nodes need to consume services 1100 and 1000. Assume that they send query service messages E(1100), E(1010) to node C in sequence, and the forwarding flag is true. according to figure 1 After the query process and the above two points are processed, the service list and service routing table of the BCDE node are as follows: Figure 7 As shown in , the service lists and service routing tables of other A nodes not shown are empty.

[0124] Among them, it needs to be explained that when E(1000) joins the service routing table with the serial number of node C being 2, the routing table has two service ID information that are full: D(1010) and D(1000). Because the node IDs of D(1010) and D(1000) are the same as the XOR distance of node C, they are both 1001⊕1111=0110, so one can be randomly selected as the "maximum" here, and D(1000) is selected in this example ; The XOR distance between E node and C node is 1100⊕1111=0011, obviously 0110 is larger than 00...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a service registration and service discovery method for micro-service, which comprises the following steps: a service list and a service routing list are established at each node of a micro-service cluster, and a query node sends a query service ID starting response at the micro-service cluster; the query node sends a query service message to a target node responding to thequery service, wherein the query service message comprises query service ID information; a service ID corresponding to the query service ID is searched in a target service list, if yes and the targetservice list is not full, a registration message is sent to the query node to the service ID information of all key-value pairs in the target service list; and the query node analyzes the registration message to obtain a corresponding service ID, creates a next key-value pair of a service list of the query node by taking the corresponding service ID as a key, and is connected with a previous key-value pair through a pointer. According to the invention, the dependence of the micro-service on the registration center is eliminated, and the problem of system paralysis caused by downtime of the registration center or network problems is prevented.

Description

technical field [0001] The present invention relates to the field of management of microservice external registration centers, and more specifically, to a method for service registration and service discovery of microservices. Background technique [0002] Microservice is an architectural style. A large complex software application consists of one or more microservice modules. Each microservice module in the system can be independently packaged and deployed independently, and the coupling between each microservice module is low. Each microservice is only focused on doing one task and doing it well. In the microservice cluster, there are service provider nodes that provide services and consumer nodes that consume services; some of the nodes that both provide services and consume services are regarded as consumer nodes. [0003] The current mainstream strategy of microservice governance is to manage through an external independent registration center, that is, the registratio...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): H04L12/741H04L29/08H04L45/74
CPCH04L45/54H04L45/745H04L67/10H04L67/51
Inventor 何荣幸吴荣富
Owner 荣邦科技有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products