A distributed dual addressing method supporting a smooth transition

By introducing Java probe technology into the distributed microservice system, smooth over-service addressing of heterogeneous registration centers is achieved, solving the downtime problem during system updates and improving user experience and operation and maintenance efficiency.

CN115460207BActive Publication Date: 2025-10-17CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211152587.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-10-17
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

Distributed microservice systems require downtime during system updates and cannot support smooth transition of service addressing, affecting the user experience.

Method used

Java probe technology is introduced. The microservice end regularly checks the operating status and synchronizes data in heterogeneous registration centers. It registers to the new registration center through Java probes and closes registration in the old registration center. The channel end caches services from the two registration centers and queries the service address in the new registration center through service discovery. If it fails, it queries the old registration center.

Benefits of technology

It achieves smooth transition of service addressing without any downtime and user perception when updating distributed microservice systems, improving operation and maintenance efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115460207B_ABST
    Figure CN115460207B_ABST
Patent Text Reader

Abstract

The application provides a distributed double-addressing method and system supporting smooth transition, and relates to the technical field of microservices, and the method comprises the following steps: a microservice side regularly checks the running state of the microservice side to obtain a checking result, wherein the microservice side is registered to a first registration center; the first registration center synchronizes data to a heterogeneous second registration center; if the checking result is normal, the microservice side is registered to the second registration center through a Java probe, and the registration with the first registration center is closed; a channel side caches services in the first registration center and the second registration center; the channel side queries a service address of a service for calling in the second registration center through service discovery, and if the service address cannot be queried, the service address is queried in the first registration center. The application makes up for the deficiency in the field of double-addressing of heterogeneous registration centers of distributed microservices in the prior art, and achieves the technical effect of improving the smooth transition of microservice upgrading.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of microservices, and particularly relates to a distributed double-addressing method supporting smooth transition. BACKGROUND

[0002] Due to the flexibility and decentralization of the distributed microservice system, the centralized software development and maintenance architecture has been replaced in many fields, which can effectively improve the efficiency of software service development, expansion and innovation.

[0003] In the distributed microservice system, with the innovation of technology, the system update is often faced, and currently, the system update process generally needs to be stopped, which affects the user experience.

[0004] In the prior art, there is a technical problem that the distributed microservice system needs to be stopped during system update, cannot support smooth transition of service addressing, causes addressing damage, and affects user experience. SUMMARY

[0005] The present application provides a distributed double-addressing method supporting smooth transition, which is used to solve the technical problem that the distributed microservice system in the prior art needs to be stopped during system update, cannot support smooth transition of service addressing, causes addressing damage, and affects user experience.

[0006] In view of the above problems, the present application provides a distributed double-addressing method supporting smooth transition.

[0007] The first aspect of the present application provides a distributed double-addressing method supporting smooth transition, which comprises: a microservice end regularly checks the running state of itself to obtain a checking result, wherein the microservice end is registered to a first registration center through a service framework; the first registration center synchronizes data to a second registration center, wherein the first registration center and the second registration center are heterogeneous registration centers; if the checking result is normal, the microservice end is registered to the second registration center through a Java probe, and the registration with the first registration center is closed; a channel end caches services in the first registration center and the second registration center; the channel end queries a service address of a calling service in the second registration center through service discovery, and if the service address cannot be queried, the service address is queried in the first registration center.

[0008] In a second aspect of the present application, a distributed dual-addressing system supporting smooth transition is provided, and the system comprises: a micro-service state detection module configured to periodically check a running state of a micro-service side to obtain a checking result, wherein the micro-service side is registered to a first registration center through a service framework; a data synchronization module configured to synchronize data from the first registration center to a second registration center, wherein the first registration center and the second registration center are heterogeneous registration centers; a registration center replacement module configured to, if the checking result is normal, register the micro-service side to the second registration center through a Java probe and close registration with the first registration center; a registration service cache module configured to cache services in the first registration center and the second registration center by a channel side; and a dual-addressing module configured to query a service address of a service for calling by the channel side through service discovery in the second registration center, and if the service address cannot be queried, query the service address in the first registration center.

[0009] In a third aspect of the present application, an electronic device is provided, and the electronic device comprises a memory and a processor, the memory stores a computer program, and the computer program is executed by the processor to implement the steps of the method in the first aspect.

[0010] In a fourth aspect of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the method in the first aspect.

[0011] The one or more technical solutions provided in the present application have at least the following technical effects or advantages:

[0012] This application detects the running status of the microservice end registered to the first registration center when the microservice system is updated, and synchronizes the data in the heterogeneous first registration center to the new second registration center. When the running status is normal, the microservice end registers to the second registration center through a Java probe and closes the registration with the first registration center. The channel end user caches the services in the first and second registration centers, and queries the service address of the calling service in the second registration center through service discovery. If the service address cannot be queried, the service address is queried in the first registration center. This application decouples the service from the code by introducing Java probe technology. It only needs to add some startup parameters when the business code is started. When upgrading the Java probe program, such as probe security vulnerability repair, defect repair, etc., there is no need for business cooperation to modify the code, which reduces the risks brought by business cross-border, and realizes smooth transition addressing when the distributed microservice system is updated and upgraded. It provides a new dual addressing method for heterogeneous service centers, so that the system architecture upgrade does not require downtime and the user is unaware, effectively improving the operation and maintenance efficiency, and achieving the technical effect of smooth transition service addressing and improving user service experience when the system is upgraded. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A schematic flow chart of a distributed dual addressing method supporting smooth transition provided in an embodiment of the present application;

[0014] Figure 2 An interactive diagram of a distributed dual addressing method supporting smooth transition provided by an embodiment of the present application;

[0015] Figure 3 A schematic diagram of a flow chart of distributed dual addressing in a distributed dual addressing method supporting smooth transition provided in an embodiment of the present application;

[0016] Figure 4 A schematic diagram of the structure of a distributed dual addressing system supporting smooth transition is provided for an embodiment of the present application;

[0017] Figure 5 Schematic diagram of the structure of an exemplary electronic device according to an embodiment of the present application.

[0018] Explanation of the accompanying drawings: microservice status detection module 11, data synchronization module 12, registration center replacement module 13, registration service cache module 14, dual addressing module 15, electronic device 300, memory 301, processor 302, communication interface 303, bus architecture 304. DETAILED DESCRIPTION

[0019] The application provides a distributed double-addressing method supporting smooth transition, which is used to solve the technical problems that the existing technology cannot accurately obtain the problems existing in the storage and maintenance of traditional Chinese medicine decoction pieces, cannot timely adjust the storage and maintenance conditions, and the storage and maintenance quality of the traditional Chinese medicine decoction pieces is poor.

[0020] Embodiment one

[0021] As shown in the figure, the application provides a distributed double-addressing method supporting smooth transition, which comprises the following steps: Figure 1

[0022] S100: periodically checking the running state of the micro service side to obtain a checking result, wherein the micro service side is registered to a first registration center through a service framework;

[0023] Figure 2 A possible interaction schematic diagram in the embodiment of the application is shown. As shown in the figure, in the embodiment of the application, the micro service side provider is one end of providing distributed services. The registration center provides service governance functions to realize the automatic registration and discovery of various micro services providing services, and the service registration function maintains a service list. The channel side consumer is a user who needs to call services and find service addresses in the registration center to obtain distributed micro service side services. Figure 2

[0024] Among them, Figure 2 Only as an example, in the actual architecture, there is more than one channel side consumer and more than one micro service side provider, the channel side consumer can also be a micro service side provider, and the micro service side provider can also be a channel side consumer.

[0025] Among them, the first registration center is an old registration center, the micro service side is registered to the first registration center through a service framework, an old distributed micro service system is formed, and micro services are provided for the channel side.

[0026] The second registration center is a new registration center, and the micro service side needs to be registered to the second registration center to form a new upgraded distributed micro service system. In the prior art, when upgrading, the channel side cannot address in the new second registration center, and needs to be shut down for updating and upgrading, which affects the service experience of the channel side.

[0027] ​​In the embodiment of the present application, in the current state, the micro-service side is registered to the first registration center through the service framework and maintains a long connection. When the micro-service architecture system needs to be upgraded, the health status of the micro-service side itself is checked in a timing cycle to obtain a check result. Among them, only when the micro-service is in a healthy state in the check result, the upgrade can be performed, so as to avoid the upgrade of the unusable micro-service side to the new distributed micro-service system, thereby affecting the system operation.

[0028] S200: The first registration center synchronizes data to the second registration center, wherein the first registration center and the second registration center are heterogeneous registration centers.

[0029] When the distributed micro-service system is upgraded, including the upgrade of the registration center, the data in the first registration center needs to be synchronized to the new second registration center, so that the new second registration center can realize all the service functions of the old first registration center, so that the channel side can address and call services in the second registration center when service discovery.

[0030] Among them, the registration center of the same type can directly synchronize data, and in the prior art, the components of the registration center are numerous, such as eureka, zookeeper, nacos, consul, etc., and the upgrade of the heterogeneous registration center often occurs.

[0031] In the embodiment of the present application, the first registration center and the second registration center are heterogeneous registration centers. The method provided in the embodiment of the present application is preferably for the upgrade of the heterogeneous registration center.

[0032] Exemplarily, the first registration center is zookeeper, the database of the first registration center is oracle, the second registration center is nacos, and the database of the second registration center is mysql. Optionally, the first registration center and the second registration center can also be Eureka, etc.

[0033] Since the first registration center and the second registration center are heterogeneous, data synchronization is performed through a native synchronization tool. The step S200 in the method provided in the embodiment of the present application comprises;

[0034] S210: The first registration center synchronizes service metadata and the same data model to the second registration center through a data synchronization service.

[0035] Specifically, the first registration center synchronizes the data in it to the second registration center through a data synchronization service, and the data synchronization service specifically synchronizes service metadata, unified data models, etc.

[0036] S300: If the check result is normal, the microservice end registers with the second registration center through the Java probe and closes the registration with the first registration center;

[0037] Specifically, if the microservice periodically checks its own operating status and the results are normal, it registers with the new registry using a Java probe. During the registration process, the service status of the two registries is not guaranteed to be strongly consistent, only eventually consistent. During the registration with the new second registry, the registration with the old first registry is closed.

[0038] Among them, Java probes can dynamically modify bytecodes. The embodiment of the present application adopts Java probe technology to decouple the services of the microservice end from the business code project. It is only necessary to add some startup parameters when the business code is started. When upgrading the probe program, such as repairing probe security vulnerabilities and defects, there is no need for business cooperation to modify the code, which reduces the risks brought by business cross-border.

[0039] When the microservice closes registration with the first registration center, step S300 in the method provided in the embodiment of the present application includes:

[0040] S310: The microservice end uses a service framework to add registration switch control to the first registration center by belonging to different configuration files, and closes registration with the first registration center.

[0041] Specifically, the microservice physically isolates the registration parameters of the first and second registration centers by assigning them to different configuration files and adding switch control of the registration of the first registration center through the service framework. In the goal, the old registration center can be shut down through the switch shutdown logic to achieve the closure of registration with the first registration center and complete the upgrade iteration of the registration center.

[0042] S400: The channel end caches the services in the first registration center and the second registration center;

[0043] Specifically, after the channel is started, it initializes a service list formed by all services in the first and second registries and caches it for service discovery and invocation. This service list includes distributed microservices provided by all microservices registered with the first and second registries.

[0044] After the channel side caches the services in the first registration center and the second registration center, step S400 further includes:

[0045] S410: The channel side maintains a dynamic monitoring service status and updates the services in the cache in real time.

[0046] Specifically, the channel end keeps dynamically monitoring the service state and updating the services in the cache in real time. When the service call is monitored, the service addressing is performed in the second registration center to provide the corresponding service for the user. By updating the services in the cache in real time, the service list can be updated in time to provide the updated micro services.

[0047] S500: The channel end queries the service address of the service call in the second registration center through service discovery. If the service address cannot be queried, the service address is queried in the first registration center.

[0048] As shown in the method provided by the embodiment of the application, step S500 includes: Figure 3

[0049] S510: The channel end queries the service address in the second registration center through the service framework and the Java probe.

[0050] S520: If the service address cannot be queried, the service framework of the channel end does not issue an exception notification, and the service address is queried in the first registration center.

[0051] Specifically, the channel end calls the required service through service discovery, queries the corresponding service address in the new second registration center, and specifically negotiates a unified addressing interface through the service framework and the Java probe. The service framework is responsible for initiating the call, and the Java probe is responsible for strengthening the addressing interface logic to realize the addressing in the second registration center.

[0052] If the addressing fails, the service framework does not throw an exception but re-performs the addressing from the old first registration center. The addressing logic in the first registration center is not changed. In this way, the successful addressing of the channel end in the micro service system upgrade process can be ensured.

[0053] In summary, the embodiment of the application has at least the following technical effects:

[0054] The Java probe technology is introduced in the embodiment of the application to decouple the service and the code, and the business code is not intruded. Only some start parameters need to be added when the business code is started. Only the Java probe program needs to be upgraded, such as the repair of security vulnerabilities and defects. The business does not need to modify the code, the risk caused by the business cross is reduced, the smooth transition of the addressing during the update and upgrade of the distributed micro service system is realized, the blank in the field of distributed double addressing of heterogeneous registration centers is filled, a new double addressing method of heterogeneous service center is provided, the system architecture upgrade does not need to be stopped and the user does not need to be aware, the operation and maintenance efficiency is effectively improved, and the technical effects of smoothly transitioning the service addressing during the system upgrade and improving the user service experience are achieved.​

[0055] Embodiment Two

[0056] Based on the same inventive concept as the distributed dual-addressing method supporting smooth transition in the foregoing embodiment, as shown in the accompanying drawings, the present application provides a distributed dual-addressing system supporting smooth transition, wherein the system comprises: Figure 4 a microservice state detection module 11 configured to periodically check a running state of the microservice side and obtain a checking result, wherein the microservice side is registered to a first registration center through a service framework;

[0057] a data synchronization module 12 configured to synchronize data from the first registration center to a second registration center, wherein the first registration center and the second registration center are heterogeneous registration centers;

[0058] a registration center replacement module 13 configured to, if the checking result is normal, register the microservice side to the second registration center through a Java probe and close the registration with the first registration center;

[0059] a registration service caching module 14 configured to cache services in the first registration center and the second registration center by the channel side;

[0060] a dual-addressing module 15 configured to query a service address of a service for calling by the channel side through service discovery in the second registration center, and query the service address in the first registration center if the service address cannot be queried.

[0061] wherein the first registration center is a zookeeper, and a database of the first registration center is an oracle.

[0062] wherein the second registration center is a nacos, and a database of the second registration center is a mysql.

[0063] Further, the data synchronization module 12 is configured to implement the following functions:

[0064] the first registration center synchronizes service metadata and the same data model to the second registration center through a data synchronization service.

[0065] Further, the registration center replacement module 13 is further configured to implement the following functions:

[0066] the microservice side adopts a service framework to increase a registration switch control of the first registration center through different configuration files, and closes the registration with the first registration center.

[0067]

[0068] ​Further, the registration service caching module 14 is further configured to implement the following functions:

[0069] The channel end keeps dynamically monitoring the service state and updating the service in the cache in real time.

[0070] Further, the dual addressing module 15 is further configured to implement the following functions:

[0071] The channel end queries the service address in the second registration center through the service framework and the Java probe.

[0072] If the service address cannot be queried, the service framework of the channel end does not send an exception notification, and queries the service address in the first registration center.

[0073] Embodiment three

[0074] As shown in Figure 5 the same inventive concept as the foregoing embodiment, the present application also provides an electronic device 300, which comprises a memory 301 and a processor 302, the memory 301 stores a computer program, and the computer program is executed by the processor 302 to implement the steps of the method of one embodiment.

[0075] The electronic device 300 comprises a processor 302, a communication interface 303, and a memory 301. Optionally, the electronic device 300 can further comprise a bus architecture 304. The communication interface 303, the processor 302, and the memory 301 can be connected to each other through the bus architecture 304. The bus architecture 304 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus architecture 304 can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 5 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0076] The processor 302 can be a CPU, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the programs of the present application.

[0077] The communication interface 303, using any transceiver-like device, is used to communicate with other devices or communication networks, such as an Ethernet network, a radio access network (RAN), a wireless local area network (WLAN), a wired access network, etc.

[0078] The memory 301 can be a ROM, or other type of static storage device that can store static information and instructions; a RAM, or other type of dynamic storage device that can store information and instructions; a EEPROM, a compact disc read only memory (CD ROM) or other optical disk storage; a magnetic disk storage or other magnetic storage devices, or any other medium capable of storing desired program code in the form of instructions or data structures and that can be accessed by a computer, but not limited to. The memory can exist independently, and be connected with the processor through the bus architecture 304. The memory can also be integrated with the processor.

[0079] The memory 301 is configured to store computer-executed instructions for implementing the solutions of the present application, and the processor 302 is configured to control the execution of the computer-executed instructions stored in the memory 301. The processor 302 is configured to execute the computer-executed instructions stored in the memory 301, so as to implement the method of the present application.

[0080] Embodiment Four

[0081] Based on the same inventive concept as the method for supporting smooth transition of distributed dual addressing in the foregoing embodiments, the present application further provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to implement the steps of the method in Embodiment One.

[0082] The specification and drawings are only exemplary of the present application, and any and all modifications, variations or equivalent arrangements that are within the scope of the application should be considered to be within the scope of the application. It should be apparent that there are some variations and modifications within the scope of the application, which can be apparent to one of ordinary skill in the art. Such variations and modifications are intended to be within the scope of the application. Accordingly, the application is intended to cover all such modifications and variations of this application combined within the scope of the application and its equivalents.

Claims

1. A distributed dual addressing method supporting smooth transition, characterized in that: The method comprises: The microservice end periodically checks its own operating status and obtains the inspection result, wherein the microservice end is registered with the first registration center through the service framework; The first registration center synchronizes the service metadata and the unified data model to the second registration center through a data synchronization service, wherein the first registration center and the second registration center are heterogeneous registration centers; If the check result is normal, the microservice end registers with the second registration center through a Java probe and closes the registration with the first registration center; wherein the probe is used to decouple the service from the code; The channel end caches the services in the first registration center and the second registration center. After caching, the channel end also includes: The channel side keeps dynamic monitoring of the service status and updates the services in the cache in real time; The channel end searches the second registration center for the service address of the calling service through service discovery. If the service address cannot be found, the channel end searches the first registration center for the service address. Querying the service address of the calling service in the second registration center includes: The channel end queries the service address in the second registration center through the service framework and Java probe; If the service address cannot be found, the service framework of the channel side does not issue an abnormal notification, and searches the first registration center for the service address; Close registration with the first registration center, including: The microservice end uses a service framework to add registration switch control to the first registration center by belonging to different configuration files, and closes registration with the first registration center.

2. The method according to claim 1, characterized in that The first registration center is Zookeeper, and the database of the first registration center is Oracle.

3. The method according to claim 1, characterized in that The second registration center is nacos, and the database of the second registration center is mysql.

4. A distributed dual addressing system supporting smooth transition, characterized in that: The system comprises: A microservice status detection module is used for the microservice end to regularly check its own operating status and obtain the inspection result, wherein the microservice end is registered with the first registration center through the service framework; A data synchronization module, configured for the first registration center to synchronize service metadata and a unified data model to a second registration center through a data synchronization service, wherein the first registration center is a heterogeneous registration center; A registration center replacement module, configured to register the microservice end with the second registration center through a Java probe and close the registration with the first registration center if the check result is normal; wherein the probe is used to decouple the service from the code; The registration service cache module is used for the channel end to cache the services in the first registration center and the second registration center. After caching, it also includes: The channel side keeps dynamic monitoring of the service status and updates the services in the cache in real time; A dual addressing module, configured for the channel end to query the service address of the calling service in the second registration center through service discovery, and if the service address cannot be found, query the service address in the first registration center; Querying the service address of the calling service in the second registration center includes: The channel end queries the service address in the second registration center through the service framework and Java probe; If the service address cannot be found, the service framework of the channel side does not issue an abnormal notification, and searches the first registration center for the service address; Close registration with the first registration center, including: The microservice end uses a service framework to add registration switch control to the first registration center by belonging to different configuration files, and closes registration with the first registration center.

5. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of any one of the methods of claims 1 to 3 are implemented.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the methods of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Service registration system and method

    CN110365750A

  • Service address response method, device and system, equipment and storage medium

    CN110391940A