CN113391820A - High-performance micro-service registration calling system and method - Google Patents

High-performance micro-service registration calling system and method Download PDF

Info

Publication number
CN113391820A
CN113391820A CN202110666489.6A CN202110666489A CN113391820A CN 113391820 A CN113391820 A CN 113391820A CN 202110666489 A CN202110666489 A CN 202110666489A CN 113391820 A CN113391820 A CN 113391820A
Authority
CN
China
Prior art keywords
micro
service
service information
services
registration
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.)
Pending
Application number
CN202110666489.6A
Other languages
Chinese (zh)
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.)
Zhejiang Baiying Technology Co Ltd
Original Assignee
Zhejiang Baiying Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Baiying Technology Co Ltd filed Critical Zhejiang Baiying Technology Co Ltd
Priority to CN202110666489.6A priority Critical patent/CN113391820A/en
Publication of CN113391820A publication Critical patent/CN113391820A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of computers, in particular to a high-performance micro-service registration calling system and a method, wherein the system comprises a registration center and at least two micro-services; the at least two micro-services upload respective service information to a registration center; when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally. The invention separately deploys the micro-services with different functions, reduces deployment times, reduces the influence generated by BUG, and improves the experience of users.

Description

High-performance micro-service registration calling system and method
Technical Field
The invention relates to the field of computers, in particular to a high-performance microservice registration calling system and a method.
Background
With the increasing of internet users, the traditional single application is not suitable for the current large-flow times, and because the reliability of the single application is poor, a fatal BUG appears in one module in a project, and the whole application is down.
Disclosure of Invention
In order to solve the above problems, the present invention provides a high performance microservice registration calling system and method.
In a first aspect, an embodiment of the present invention provides a high-performance microservice registration and invocation system, including a registration center and at least two microservices;
the at least two micro-services upload respective service information to a registration center;
when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
Preferably, the registry judges whether the uploaded service information exists, if not, the corresponding micro service is added into the heartbeat polling list, the last timestamp is the current time, and if so, the last timestamp of the corresponding micro service in the registry is updated to be the current time.
Preferably, the at least two microservices send a heartbeat to the registry every set time to update the last timestamp on the registry, and if the service information of the registry changes, the service information required by the microservices are acquired again.
Preferably, the registration center performs timestamp judgment on all currently registered micro-services at intervals, and if micro-services with last updated timestamps larger than a set number of detection intervals exist, marks the corresponding micro-services as offline.
Preferably, the micro service cannot acquire the service information of the offline micro service.
In a second aspect, an embodiment of the present invention provides a method for invoking microservice registration with high performance, where the method includes:
at least two micro-services upload respective service information to a registration center;
when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
Preferably, the registration center judges whether the uploaded service information exists, if not, the corresponding micro service is added into the heartbeat polling list, the last timestamp is the current time, and if so, the last timestamp of the corresponding micro service in the registration center is updated to be the current time.
Preferably, at least two microservices send a heartbeat to the registry every set time to update the last timestamp on the registry, and if the service information of the registry changes, the service information needed by the microservices are obtained again.
Preferably, the registration center performs timestamp judgment on all currently registered micro-services at intervals, and if micro-services with last updated timestamps larger than a set number of detection intervals exist, marks the corresponding micro-services as offline.
Preferably, the micro service cannot acquire the service information of the offline micro service.
The invention has the beneficial effects that: the invention adopts at least two micro services, and the at least two micro services upload respective service information to a registration center; when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if the micro services exist, the corresponding micro services are called according to the service information of the called micro services cached locally, the micro services with different functions are deployed separately, the deployment times are reduced, the influence of BUG is reduced, and the experience of a user is improved.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic structural diagram of a high-performance microservice registration call system according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a high-performance microservice registration invocation method according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited to these embodiments.
The basic idea of the invention is to adopt at least two micro-services, and the at least two micro-services upload respective service information to a registration center; when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if the micro services exist, the corresponding micro services are called according to the service information of the called micro services cached locally, the micro services with different functions are deployed separately, the deployment times are reduced, the influence of BUG is reduced, and the experience of a user is improved.
Based on the above idea, the present invention proposes to include a registry and at least two microservices, as shown in fig. 1. At least two micro-services upload respective service information to a registration center; when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
In this embodiment, the invention adopts at least two micro services, and realizes the application of different micro services by adopting registration and calling modes, and the micro services with different functions are separately deployed, thereby reducing the deployment times, reducing the influence generated by the BUG, and improving the experience of the user.
When the micro service is started for the first time, the self-owned service information (IP, port and owned service list of the current service) is sent to the registration center. And if the registration center does not exist, adding the micro service into a heartbeat polling list, wherein the last timestamp is the current time. And if the registration center has the micro service, the last time stamp of the micro service in the registration center is the current time, so that the registration of the micro service is realized.
The registration center judges the timestamp of all the registered micro services at intervals, if the last update timestamp of the micro services is larger than the set detection intervals, for example, 3 detection intervals, the micro services are marked as off-line, and other micro services cannot take the off-line micro services again when acquiring service information next time, so that the occupied resources of the registration center are reduced.
The registration center updates or reads data by using a read-write lock mode, when the micro service is on line for registering or changing service information, the write lock is adopted, and when the information is not changed or a read request is carried out, the read lock is adopted for operation, so that the method is suitable for high flow and high concurrency.
No data interaction exists among the registries, strong consistency is not researched, and the final consistency is aimed at. Transient inconsistencies do not affect the overall microservice invocation, but can greatly improve performance.
And (3) the client queries the registration center, and after the query information fails, the client isolates the failed registration center and preferentially requests other normal registration centers by adopting a combined mode of load balancing and retry.
The client-side orders the time consumption of each request for obtaining the registration information, and preferentially obtains the information from the registration center with smaller delay.
The registration center does not need data interaction with the registration center cluster, so that multiple registration centers can be directly expanded horizontally when the pressure of the registration centers is too high.
And each micro service sends heartbeat to the registration center at set time intervals to update the time stamp on the registration center, and meanwhile, if the micro service of the registration center changes, the required service information is pulled again.
When a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service of the local cache, and combining the service information of the local cache and the service information of the registration center to realize the quick calling of the micro service.
Based on the above system embodiment, correspondingly, as shown in fig. 2, the present invention further provides that the method includes the following steps:
s1: at least two micro-services upload respective service information to a registration center;
s2: when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
In an embodiment, the registration center judges whether the uploaded service information exists, if not, the corresponding micro service is added into a heartbeat polling list, the last timestamp is the current time, and if so, the last timestamp of the corresponding micro service in the registration center is updated to be the current time.
In an embodiment, at least two micro services respectively send a heartbeat to the registration center at set time intervals to update the last timestamp on the registration center, and if the service information of the registration center changes, the service information required by the micro services is obtained again.
In an embodiment, the registration center performs timestamp judgment on all currently registered micro-services at intervals, and if micro-services with last updated timestamps larger than a set number of detection intervals exist, marks the corresponding micro-services as offline.
In one embodiment, the micro service cannot acquire the service information of the offline micro service.
The specific schemes and the beneficial effects based on the method embodiments are all described in the system embodiments, and therefore, the detailed description is omitted.
Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (10)

1. A high-performance micro-service registration calling system is characterized by comprising a registration center and at least two micro-services;
the at least two micro-services upload respective service information to a registration center;
when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
2. The high-performance microservice registration invocation system according to claim 1, wherein,
and the registration center judges whether the uploaded service information exists or not, if not, the corresponding micro service is added into a heartbeat polling list, the last timestamp is the current time, and if so, the last timestamp of the corresponding micro service in the registration center is updated to be the current time.
3. The high-performance microservice registration invocation system according to claim 1, wherein,
and the at least two micro services respectively send a heartbeat to the registration center at set intervals to update the last timestamp on the registration center, and if the service information of the registration center changes, the service information required by the micro services is acquired again.
4. The high-performance microservice registration invocation system according to claim 1, wherein,
and the registration center judges the time stamps of all the registered micro-services at intervals, and if the micro-services with the last updated time stamps larger than the detection intervals of the set times exist, the corresponding micro-services are marked as off-line.
5. The high performance microservice registration invocation system according to claim 4, wherein,
the micro service cannot acquire the service information of the off-line micro service.
6. A high-performance microservice registration calling method is characterized by comprising the following steps:
at least two micro-services upload respective service information to a registration center;
when a service is called, judging whether service information of the called micro service exists in a local cache, if not, acquiring the service information of the called micro service from a registration center, and calling the corresponding micro service according to the service information of the called micro service; if so, calling the corresponding micro service according to the service information of the called micro service cached locally.
7. The method of claim 6, wherein the step of invoking the microservice registration further comprises the step of,
the registration center judges whether the uploaded service information exists or not, if not, the corresponding micro service is added into a heartbeat polling list, the last timestamp is the current time, and if the uploaded service information exists, the last timestamp of the corresponding micro service in the registration center is updated to be the current time.
8. The method of claim 6, wherein the step of invoking the microservice registration further comprises the step of,
at least two micro services respectively send a heartbeat to the registration center at set time intervals to update the last time stamp on the registration center, and if the service information of the registration center changes, the service information required by the micro services is obtained again.
9. The method of claim 6, wherein the step of invoking the microservice registration further comprises the step of,
the registration center judges the time stamp of all the registered micro-services at intervals, and if the micro-services with the last updated time stamp larger than the detection interval of the set times exist, the corresponding micro-services are marked as off-line.
10. The method of claim 9, wherein the microservice cannot obtain the service information of the offline microservice.
CN202110666489.6A 2021-06-16 2021-06-16 High-performance micro-service registration calling system and method Pending CN113391820A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110666489.6A CN113391820A (en) 2021-06-16 2021-06-16 High-performance micro-service registration calling system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110666489.6A CN113391820A (en) 2021-06-16 2021-06-16 High-performance micro-service registration calling system and method

Publications (1)

Publication Number Publication Date
CN113391820A true CN113391820A (en) 2021-09-14

Family

ID=77621382

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110666489.6A Pending CN113391820A (en) 2021-06-16 2021-06-16 High-performance micro-service registration calling system and method

Country Status (1)

Country Link
CN (1) CN113391820A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629637A (en) * 2022-03-09 2022-06-14 航天科工智慧产业发展有限公司 Method for micro-service safety management and application system thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234666A (en) * 2018-01-16 2018-06-29 云宏信息科技股份有限公司 A kind of micro services calling system, method and computer storage media
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN109714319A (en) * 2018-12-06 2019-05-03 深圳市中农网有限公司 Management system, method, apparatus, computer equipment and the storage medium of micro services
CN111488420A (en) * 2020-04-02 2020-08-04 中国科学院地理科学与资源研究所 Flood early warning water information system for decentralized micro-service area and integration method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108234666A (en) * 2018-01-16 2018-06-29 云宏信息科技股份有限公司 A kind of micro services calling system, method and computer storage media
CN108282368A (en) * 2018-01-24 2018-07-13 云宏信息科技股份有限公司 A kind of micro services management system, method and computer storage media
CN109714319A (en) * 2018-12-06 2019-05-03 深圳市中农网有限公司 Management system, method, apparatus, computer equipment and the storage medium of micro services
CN111488420A (en) * 2020-04-02 2020-08-04 中国科学院地理科学与资源研究所 Flood early warning water information system for decentralized micro-service area and integration method thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629637A (en) * 2022-03-09 2022-06-14 航天科工智慧产业发展有限公司 Method for micro-service safety management and application system thereof

Similar Documents

Publication Publication Date Title
CN112087333B (en) Micro-service registry cluster and information processing method thereof
CN112286503B (en) Method, device, equipment and medium for unified management of microservices of multiple registries
US7716353B2 (en) Web services availability cache
CN107317830B (en) Service discovery processing method and device
US8635185B2 (en) System and method for providing session affinity in a clustered database environment
WO2020147331A1 (en) Micro-service monitoring method and system
US8959385B2 (en) Synchronized failover for active-passive applications
US7720931B2 (en) System and method of remotely managing and loading artifacts
US20040030739A1 (en) Database remote replication for multi-tier computer systems by homayoun yousefi'zadeh
US7912858B2 (en) Data synchronization method
EP0926608A2 (en) Distributed persistent storage for intermittently connected clients
US20140229626A1 (en) Re-establishing push notification channels via user identifiers
US20120158825A1 (en) Scalable push-based architecture for web applications
JP2005531855A (en) OPC server redirection manager
CN107341044A (en) A kind of distributive data center unified monitoring framework and method
US10069941B2 (en) Scalable event-based notifications
WO2009062414A1 (en) Integrate client and method of desktop application communicating with net web application
JP2005500615A (en) Maintaining persistence while switching between styles
CN110719311B (en) Distributed coordination service method, system and computer readable storage medium
CN106681861A (en) New environment isolation configuration data management method and system
CN110830582B (en) Cluster owner selection method and device based on server
CN113391820A (en) High-performance micro-service registration calling system and method
CN113938464B (en) Access request method and terminal
CN116112569B (en) Micro-service scheduling method and management system
CN111857979B (en) Information management method, system, storage medium and equipment of distributed system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210914

RJ01 Rejection of invention patent application after publication