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

Micro-service health examination method and storage medium

A health check and micro-service technology, applied in the field of micro-service, can solve time-consuming problems, achieve the effect of reducing the amount of scanning, improving the efficiency and convenience of checking, and the effect of simple implementation

Active Publication Date: 2020-04-28
FUJIAN TIANQUAN EDUCATION TECH LTD
View PDF4 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, as the scale of the registration center continues to increase, if tens of thousands of microservices are accessed, the records in the list will increase a lot, and it will be more time-consuming to scan the full amount one by one every time

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
  • Micro-service health examination method and storage medium
  • Micro-service health examination method and storage medium
  • Micro-service health examination method and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0073] Please refer to figure 2 , the present embodiment provides a microservice health check method, which is used to efficiently and simply monitor whether the microservice times out in real time. The method can include:

[0074] S1: After the microservice starts, send its own intranet IP and port number to the registration center.

[0075] Each microservice has its own unique intranet IP and port number. Every time the microservice is started, it will send its own intranet IP + port to the registration center, and the registration center will record it in the registration list. The key of the registration list is the intranet IP + colon + port number of the microservice. This key is the unique identification mark of a microservice.

[0076] S2: The registration center adds a new record in the heartbeat list (the old table in this article), the key value of the record is the received intranet IP and port number, and the value value is the latest heartbeat packet received...

Embodiment 2

[0097] This embodiment provides a specific application scenario based on the method of Embodiment 1:

[0098] Assume that there are three microservices, A, B, and C, all of which register information with the registration center. Their ips are all 192.168.0.1, and their port numbers are 8001, 8002, and 8003, respectively. Then the unique identifiers of these three microservices are "192.168.0.1:8001", "192.168.0.1:8002" and "192.168.0.1:8003".

[0099] When they register in the registration center, they will first add the registration list records, and the keys corresponding to the three records correspond to the unique identification marks of the above three microservices.

[0100] After that, add the records of the heartbeat list (old table). The data structure of the old table is: key is the unique identification mark of the microservice, and value is an object. The list of fields in the object is as follows: new_key (represents the key information in the new table) , this...

Embodiment 3

[0104] This embodiment corresponds to Embodiment 1 and Embodiment 1, and provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it can implement the above-mentioned embodiment 1 or embodiment 2. The steps included in a method for microservice health check. The specific steps will not be repeated here, please refer to the descriptions of Embodiment 1 and Embodiment 2 for details.

[0105] In summary, the method and storage medium for microservice health check provided by the present invention can greatly reduce the number of traversals in each round, greatly improve the check efficiency while ensuring the check accuracy; furthermore, it can also obviously Save resources and improve service performance; finally, it also has the advantages of easy implementation and less memory usage.

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 provides a micro-service health examination method and a storage medium, and the method comprises: newly adding a new table of a treeset structure, enabling a key value recorded by the new table to be the time when a heartbeat packet is received last time, and enabling a value to be the unique identification of a micro-service; setting the new table to be sorted in an ascending orderaccording to the key values of the new table; when a heartbeat packet of the micro-service is received, updating the new table; polling the new table, and judging whether the corresponding value is overtime or not according to the recorded key value; and when a record which is not overtime is inquired, continuing to poll from the beginning. According to the method, the traversal frequency of eachround can be greatly reduced, and the inspection efficiency is greatly improved while the inspection accuracy is ensured; and, furthermore, resources can be obviously saved, and the service performance is improved.

Description

technical field [0001] The invention relates to the field of microservices, in particular to a method and a storage medium for microservice health checks. Background technique [0002] Microservice is an emerging software architecture that splits a large single application and service into dozens of supporting microservices. A microservices strategy can make life easier by scaling individual components rather than the entire application stack to meet service-level agreements. And because of the large number of microservices, it is necessary to use service governance or have a service center to manage these large number of microservices. The core data of the registration center is the name of the service and its corresponding network address. When the service registers multiple instances, we need to filter unhealthy instances or distribute traffic according to some characteristics of the instances. Some attributes such as health status and weight are stored on it. [0003]...

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): G06F16/22G06F16/23G06F16/2458
CPCG06F16/2282G06F16/23G06F16/2477
Inventor 刘德建林伟郭玉湖陈宏
Owner FUJIAN TIANQUAN EDUCATION TECH LTD
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