CN115185971A - Routing information hot updating method, device, equipment and medium - Google Patents

Routing information hot updating method, device, equipment and medium Download PDF

Info

Publication number
CN115185971A
CN115185971A CN202210903473.7A CN202210903473A CN115185971A CN 115185971 A CN115185971 A CN 115185971A CN 202210903473 A CN202210903473 A CN 202210903473A CN 115185971 A CN115185971 A CN 115185971A
Authority
CN
China
Prior art keywords
routing information
server
information
hot
route
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
CN202210903473.7A
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.)
Umeox Innovations Co ltd
Original Assignee
Umeox Innovations 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 Umeox Innovations Co ltd filed Critical Umeox Innovations Co ltd
Priority to CN202210903473.7A priority Critical patent/CN115185971A/en
Publication of CN115185971A publication Critical patent/CN115185971A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention relates to the technical field of gateway routing, and discloses a routing information hot updating method, a device, equipment and a medium, wherein the method is applied to a micro-service system and comprises the following steps: acquiring the routing information changed by the basic information server; synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component; and synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information. According to the invention, the routing information changed by the functional server is subjected to persistent storage and hot cache through the preset intermediate component, so that the hot update of the routing information between the gateway server and the basic information service is realized, the startup and shutdown processes in the process of changing the routing information are reduced, the flexibility of changing the routing information of the functional server is improved, and the stability of the system is improved.

Description

Routing information hot updating method, device, equipment and medium
Technical Field
The present invention relates to the field of gateway routing technologies, and in particular, to a method, an apparatus, a device, and a medium for hot updating routing information.
Background
With the continuous development of internet technology, the internet brings a change of covering the earth to our lives, the life style of consumers is increasingly digitalized, and people can realize various needs of lives through the internet, for example, users can use the network to carry out shopping experience at any time and any place, use the network to express self-demand by using social media, use the network to realize friend-making demand by using social application, and the like. As people realize various demands of life through the internet, the flow of the internet is also increasing.
In the face of fast growing demands, high-concurrency business mode processing of internet related background servers is also upgraded continuously, a flexible, extensible and high-reusability micro-service system is derived, and in the process of micro-service implementation of the micro-service system, all service entries need to pass through an API gateway first and are forwarded to corresponding servers through route matching.
However, when the routing information is changed, the routing needs to change the routing information by frequently starting the API gateway service, and in the process of frequently restarting the API gateway service, the routing and the API gateway service are suspended, so that the flexibility of changing the routing information is reduced, and the stability of the system is affected.
Disclosure of Invention
The invention mainly aims to provide a hot updating method, a device, equipment and a medium for routing information, aiming at improving the flexibility and stability of the routing information change.
In order to achieve the above object, the present invention provides a routing information hot update method, where the routing information hot update method is applied to a micro service system, and the micro service system at least includes: the routing information hot updating method comprises a basic information server, a gateway server and a function server, and comprises the following steps:
acquiring the route information changed by the basic information server;
synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
Preferably, the step of synchronizing the routing information to the gateway server and the corresponding function server based on the preset intermediate component includes:
determining routing information for persistent storage based on a preset data storage component;
synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
and synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
Preferably, the step of determining the route information for persistent storage based on the preset data storage component includes:
updating and modifying the basic information of the function server through a background management interface of the basic information server, and determining the routing information corresponding to the function server;
and storing the routing information into a preset data storage component MySQL, and determining the routing information for persistent storage.
Preferably, the step of synchronizing the route information stored in the persistent storage to a preset data cache component and determining the route information in the hot reserve cache area corresponding to the gateway server includes:
reading the routing information of the persistent storage in the MySQL based on a preset data cache component Redis;
based on the cache strategy of the data cache assembly Redis, the route information stored in a persistent mode is stored into a hot reserve cache region corresponding to the gateway server side, and the route information in the hot reserve cache region is determined.
Preferably, the step of synchronizing the routing information in the hot reserve cache region to the memory of the function server based on the preset data cache component includes:
reading the routing information in the hot reserve cache region corresponding to the gateway server data cache component Redis;
and loading the routing information in the hot reserve cache region into a memory of the functional server so as to synchronize the routing information in the hot reserve cache region with the information of the functional server.
Preferably, before the step of reading the route information stored persistently in the MySQL by using the preset data caching component Redis performed, the method for hot updating the route information further includes:
and defining a route change channel corresponding to the route information stored persistently in the data cache component Redis, and monitoring the route change channel in real time based on the data cache component Redis.
Preferably, the step of synchronously updating the predefined route change channel to the corresponding function server to perform hot update on the route information includes:
identifying the function server based on a preset route change channel, and determining a route change channel corresponding to the function server;
and sending the route change channel to a background management interface of the micro-service system for change prompt based on the subscription and release functions of the preset middleware Redis.
In addition, to achieve the above object, an embodiment of the present invention further provides a route updating apparatus, where the route updating apparatus includes:
the routing information acquisition module is used for acquiring the routing information changed by the basic information server;
the data transmission module is used for synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and the route change channel subscription module is used for synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
Preferably, the data transmission module includes:
determining routing information for persistent storage based on a preset data storage component;
synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
and synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
Preferably, the data transmission module includes:
the step of determining route information for persistent storage based on a preset data storage component includes:
updating and modifying the basic information of the function server through a background management interface of the basic information server, and determining the routing information corresponding to the function server;
and storing the routing information into a preset data storage component MySQL, and determining the routing information for persistent storage.
Preferably, the data transmission module includes:
reading the routing information of the persistent storage in the MySQL based on a preset data cache component Redis;
based on the cache strategy of the data cache component Redis, the route information stored in a persistent mode is stored into a hot reserve cache region corresponding to the gateway server side, and the route information in the hot reserve cache region is determined.
Preferably, the data transmission module includes:
the step of synchronizing the routing information in the hot reserve cache region to the memory of the function server based on the preset data cache component includes:
reading the routing information in the hot reserve cache region corresponding to the gateway server data cache component Redis;
and loading the routing information in the hot reserve cache region into a memory of the functional server so as to synchronize the routing information in the hot reserve cache region with the information of the functional server.
Preferably, the route change channel subscription module includes:
identifying the function server based on a preset route change channel, and determining a route change channel corresponding to the function server;
and sending the route change channel to a background management interface of the micro-service system for change prompt based on the subscription and release functions of the preset middleware Redis.
In addition, in order to achieve the above object, an embodiment of the present invention further provides an apparatus, where the apparatus includes a memory, a processor, and a route update program stored in the memory and executable on the processor, where the route update program is executed by the processor to implement the steps of the route information hot update method described above.
In addition, to achieve the above object, the present invention further provides a medium, which is a computer-readable storage medium having a routing update program stored thereon, and the routing update program, when executed by a processor, implements the steps of the routing information hot update method as described above.
The invention provides a routing information hot updating method, a device, equipment and a medium, wherein the routing information hot updating method is applied to a micro service system, and the micro service system at least comprises the following steps: the method comprises a basic information server, a gateway server and a function server, wherein the routing information hot update method comprises the following steps: acquiring the route information changed by the basic information server; synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component; and synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
Compared with the prior art that the basic information of the updating server needs to be synchronized at each end by frequently closing and starting the corresponding gateway server, the method and the system realize the hot updating of the routing information by storing the routing information changed by the basic information in the preset intermediate component, realizing the caching of the routing information through the preset intermediate component, and synchronizing the routing information to the corresponding gateway server and the corresponding function server through the preset intermediate component, thereby reducing the startup and shutdown process in the process of changing the routing information in the prior art, improving the flexibility of changing the routing information of the function server, and improving the stability of the system.
Drawings
Fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of a hot update method for routing information of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a hot update method for routing information according to the present invention;
fig. 3 is a schematic diagram of a specific flow of implementing synchronization of routing information between a gateway server and a server in a first embodiment of a method for hot update of routing information according to the present invention;
fig. 4 is a schematic flowchart illustrating a specific process of completing hot update of routing information according to a first embodiment of a hot update method of routing information in the present invention;
FIG. 5 is a flowchart illustrating a second embodiment of a method for hot updating routing information according to the present invention;
FIG. 6 is a sub-flowchart of step S21 in a second embodiment of the thermal routing information updating method of the present invention;
FIG. 7 is a sub-flowchart of step S22 in a second embodiment of the thermal routing information updating method of the present invention;
fig. 8 is a flowchart illustrating a specific implementation of step S22 in the second embodiment of the routing information hot update method according to the present invention;
FIG. 9 is a sub-flowchart of step S23 in the second embodiment of the thermal routing information updating method of the present invention;
fig. 10 is a flowchart illustrating a specific execution of step S23 in the second embodiment of the routing information hot update method according to the present invention;
FIG. 11 is a flowchart illustrating a third embodiment of a method for hot updating routing information according to the present invention;
fig. 12 is a functional block diagram of a routing update apparatus of a hot update method of routing information according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
Specifically, referring to fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the hot update method for routing information of the present invention.
Referring to fig. 1, the apparatus may include: a processor 1001, e.g. a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001 described previously.
The memory 1005 stores therein an operating system and a route update program, and when executed by the processor, the route update program implements the steps of:
acquiring the routing information changed by the basic information server;
synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
Further, the route update program in the memory 1005 when executed by the processor further performs the steps of:
determining routing information for persistent storage based on a preset data storage component;
synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
and synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
Further, the route update program in the memory 1005, when executed by the processor, further implements the steps of:
updating and modifying the basic information of the function server through a background management interface of the basic information server, and determining the routing information corresponding to the function server;
and storing the routing information into a preset data storage component MySQL, and determining the routing information for persistent storage.
Further, the route update program in the memory 1005, when executed by the processor, further implements the steps of:
reading the routing information of the persistent storage in the MySQL based on a preset data cache component Redis;
based on the cache strategy of the data cache component Redis, the route information stored in a persistent mode is stored into a hot reserve cache region corresponding to the gateway server side, and the route information in the hot reserve cache region is determined.
Further, the route update program in the memory 1005 when executed by the processor further performs the steps of:
reading the routing information in the hot reserve cache region corresponding to the gateway server data cache component Redis;
and loading the routing information in the hot reserve cache region into a memory of the function server so as to synchronize the routing information in the hot reserve cache region with the information of the function server.
Further, the route update program in the memory 1005, when executed by the processor, further implements the steps of:
and defining a route change channel corresponding to the route information stored persistently in the data cache component Redis, and monitoring the route change channel in real time based on the data cache component Redis.
Further, the route update program in the memory 1005, when executed by the processor, further implements the steps of:
identifying the function server based on a preset route change channel, and determining a route change channel corresponding to the function server;
and sending the route change channel to a background management interface of the micro-service system for change prompt based on a subscription and publication function of a preset middleware Redis.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Based on the above terminal device architecture but not limited to the above architecture, embodiments of the routing information hot update method of the present invention are proposed.
Specifically, referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a hot update method for routing information according to the present invention, where the hot update method for routing information includes:
step S10, obtaining the route information changed by the basic information server;
step S20, synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and step S30, synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
According to the routing information hot updating method, the routing information changed by the basic information is stored in the preset intermediate component, the caching of the routing information is realized through the preset intermediate component, and the routing information is synchronized to the corresponding gateway server and the corresponding function server through the preset intermediate component, so that the hot updating of the routing information is realized.
The respective steps will be described in detail below:
step S10, obtaining the route information changed by the basic information server;
the embodiment of the application is applied to a micro service system, and further, the micro service system mainly has the function of decomposing functions into discrete services, so that the coupling of the system is reduced, and more flexible service support is provided.
In this embodiment, the micro service system mainly includes each micro function server, an API Gateway, and a user side, and specifically, each micro server is connected to a memory to store corresponding basic information and service information; the API Gateway is used as a flow Gateway to execute a corresponding coupling strategy; the user side is used as the object for providing service for each service side.
Further, when the traffic information between each server and each client is communicated, the API Gateway serves as an intermediate interface to implement data transmission between each server and each client, but as the operation between the servers and the clients is continuously developed, the number of times of updating the basic information of the servers becomes more frequent.
Therefore, if the basic information of each function server needs to be modified correspondingly under the modification intention of a developer as the operation between the function server and the user side is continuously developed, the background management page of the basic information server connected with the server in the modification intention correspondingly modifies the basic information of the function server, and determines the corresponding routing information.
For example, there is a service end serving as a clothing wholesale service, and as the transaction amount between the service and the user end increases, it is necessary to separate a clothing stocking service and a clothing selling service included in the clothing wholesale service into two corresponding micro services, and at this time, basic information corresponding to the original clothing wholesale service is modified, and modified routing information is determined.
Step S20, synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
in a specific embodiment, the preset intermediate component at least includes a data storage component and a data cache component, persistent storage and hot reserve cache are respectively implemented on the obtained routing information through the data storage component and the data cache component, and the routing information is synchronized to the gateway server and the corresponding function server by performing persistent storage and hot reserve cache on the routing information through the data storage component and the data cache component.
Further, the data storage component may be a MySQL database, and the data caching component may be a Redis medium. Specifically, the routing information of the change of the basic information of the server side is durably stored through the MySQL database, and the basic information of the server side is durably changed; the routing information changed by the server in the MySQL database is loaded into the data cache component Redis for cache hot storage, so that the routing information is sent to the gateway server to perform gateway confirmation on the basic information of the functional server, and further the routing information is sent to memories corresponding to other corresponding functional servers, so that the routing information of the functional server for basic information change is synchronized.
Further, before the step of loading the routing information modified by the function server in the MySQL database into the data cache component Redis for performing cache hot storage, that is, before the step of reading the route information persistently stored in the MySQL in the data storage component based on the preset data cache component Redis, the method for hot updating the routing information further includes:
and defining a route change channel corresponding to the route information stored in the persistent mode in the data cache assembly Redis, and monitoring the route change channel in real time based on the data cache assembly Redis.
In a specific embodiment, the routing information needs to be defined, a corresponding routing change channel is determined, and the routing change channel is monitored in real time, if basic information of a function server corresponding to the routing information is correspondingly changed, the routing change channel monitors the change in real time, and determines routing information that is changed in real time.
And step S30, synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
In a specific embodiment, a predefined route change channel is used as notification content, and the route change channel is sent to each end in the micro service system through the subscription and publication function of the data cache module Redis, so as to implement information synchronization for changing corresponding route information by the service end basic information.
Further, the route change path is a route change path that defines, according to the route information, a corresponding server to change basic information while receiving corresponding route information through the data cache module Redis.
Referring to fig. 3, fig. 3 is a schematic diagram of a specific flow of the embodiment for implementing routing information synchronization through a basic information service and a gateway server based on a preset data storage component MySQL database and a data caching component Redis.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a specific flow of completing hot update of routing information according to this embodiment. On the basis of realizing the routing information synchronization through the basic information service and the gateway server based on the preset data storage component MySQL database and the data cache component Redis, the synchronous updating of the routing change channel on other corresponding servers is realized by using the publishing and/or subscribing functions of the data cache component Redis, and the hot updating of the routing information is completed.
In this embodiment, the routing information changed by the basic information is stored in the preset intermediate component, and the caching of the routing information is realized through the preset intermediate component, and the routing information is synchronized to the corresponding gateway server and the corresponding function server through the preset intermediate component, so that the hot update of the routing information is realized, the flexibility of changing the routing information of the server is improved, and the stability of the system is improved.
Further, based on the first embodiment of the hot update method for routing information in the embodiment of the present application, a second embodiment of the hot update method for routing information in the embodiment of the present application is provided.
The second embodiment of the routing information hot update method is different from the first embodiment of the routing information hot update method in that the present embodiment is a refinement of "synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component" in step S20, and with reference to fig. 5, the detailed description specifically includes:
step S21, determining routing information for persistent storage based on a preset data storage component;
step S22, synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
and step S23, synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
The method and the device for the routing information synchronization synchronize the routing information changed by the service point basic information to the gateway server and the corresponding server through the preset intermediate component.
The respective steps will be described in detail below:
step S21, determining routing information for persistent storage based on a preset data storage component;
further, the routing information subjected to persistent storage is determined to be used for a basic information server of the micro service system based on the preset data storage component.
Referring to fig. 6, step S21 includes:
step S211, updating and modifying the basic information of the function server through a background management interface of the basic information server, and determining the routing information corresponding to the function server;
step S212, storing the routing information into a preset data storage component MySQL, and determining the routing information for persistent storage.
In a specific embodiment, the basic information of the server is modified and changed correspondingly by starting the basic information service of the functional server to the background management page of the server, and corresponding routing information is obtained and transmitted to the data storage component MySQL.
Further, the data storage component MySQL is a relational database, and in this embodiment, the data storage component MySQL is used as a repository of the function server to implement persistent storage of server data, specifically, the function server data may include basic data of the function server, service data of the function server, and the like, and the routing information that the function server implements information change is synchronized to the data storage component MySQL to implement persistent storage.
Step S22, synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
further, referring to fig. 7, step S22 specifically includes:
step S221, based on a preset data cache component Redis, reading the route information of the persistent storage in the data storage component MySQL;
step S222, based on the cache policy of the data cache component Redis, storing the route information stored persistently into a hot reserve cache region corresponding to the gateway server, and determining the route information in the hot reserve cache region.
In a specific embodiment, the route information that is obtained by changing the basic information of the function server is loaded into a data cache assembly Redis for hot caching, further, the caching policy of the data cache assembly Redis supports master-slave synchronization, cached data can be synchronized from a master server to any number of slave servers, and a slave server can be a master server associated with other slave servers, so that the Redis can perform single-layer tree replication, and a disk storage can write data at a high rate. Since Redis fully implements a publish and/or subscribe mechanism, a slave database can subscribe to a channel and receive the complete message publication record of the master server when synchronizing trees anywhere.
Referring to fig. 8, fig. 8 is a schematic diagram illustrating a specific flow of step S22 in this embodiment. Specifically, through basic information service, the routing information modified by the basic information of the service end is loaded to a preset data cache component Redis from a preset data storage component MySQL, so that information synchronization of the routing information in the gateway service end is realized.
And step S23, synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
Further, the routing information in the hot reserve cache region is synchronized to the memory of the functional server and applied to the gateway server of the micro service system based on a preset data cache component.
Referring to fig. 9, step S23 specifically includes:
step S231, reading the routing information in the hot reserve cache region corresponding to the gateway server data cache component Redis;
step S232, loading the routing information in the thermal storage cache area into the memory of the functional server, so as to synchronize the routing information in the thermal storage cache area with the information of the functional server.
In a specific embodiment, the routing information loaded into the preset data cache module Redis and used for modifying the basic information of the functional server needs to be sent to memories of other servers corresponding to the functional server for storage, so as to implement information synchronization of the routing information at the other functional servers.
Referring to fig. 10, fig. 10 is a specific flowchart of step S23. And reading the routing information from the preset data cache module Redis by starting the gateway server, storing the routing information into a memory of the functional server, and simultaneously subscribing a predefined routing change channel.
In this embodiment, the routing information that the basic information of the functional server is changed is synchronized to the gateway server and the corresponding functional server through the preset intermediate component, so that multi-end synchronization of the routing information is realized on the premise that the gateway server does not need to be frequently started, the flexibility of changing the routing information is improved, and the stability of the system in the process of changing the basic information is improved.
Further, based on the first embodiment and the second embodiment of the routing information hot update method in the embodiment of the present application, a third embodiment of the routing information hot update method in the embodiment of the present application is proposed.
The third embodiment of the method for hot updating routing information is different from the first and second embodiments of the method for diagnosing and teaching, in that the third embodiment is a refinement of "synchronously updating the predefined routing change channel to the corresponding function server to perform hot updating on the routing information" in step S30, and with reference to fig. 11, the method specifically includes:
step S31, identifying the function server based on a preset route change channel, and determining a route change channel corresponding to the function server;
and step S32, based on the subscription and release functions of the preset middleware Redis, sending the route change channel to a background management interface of the micro-service system for change prompt.
In a specific embodiment, a publishing and/or subscribing mechanism is completely implemented based on the middleware data caching component Redis, so that when the routing information is synchronized to the preset middleware Redis, a predefined routing change channel can be sent to a corresponding functional server as a piece of publishing and/or subscribing information through the publishing/subscribing mechanism, and used as a prompt message for changing the basic information of the functional server.
Further, the route change channel is defined when the route information is sent to the data cache component Redis, specifically, when the data cache component Redis receives the corresponding route information, the route change channel is defined according to basic information of a modified functional server and functional servers before and after modification corresponding to the route information, and the like, the corresponding route change channel is determined, and the route change channel is sent to a background management interface of the corresponding server based on the data cache component Redis to perform a route information change prompt.
In this embodiment, the publishing/subscribing function of the route change channel corresponding to the route information changed by the basic information of the functional server is realized through the subscribing and publishing function of the middleware Redis, so that the integrity of the basic information change performed by the server in the microservice system is improved.
In addition, an embodiment of the present invention further provides a routing update apparatus, referring to fig. 12, fig. 12 is a schematic diagram of a functional module of the routing update apparatus according to the embodiment of the hot update method for routing information.
As shown in fig. 12, the route updating apparatus includes:
a routing information obtaining module 10, configured to obtain routing information that is changed by the basic information server;
a data transmission module 20, configured to synchronize the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and the route change channel subscription module 30 is configured to synchronously update the predefined route change channel to the corresponding function server, so as to perform hot update on the route information.
Further, the data transmission module includes:
the persistent storage unit is used for determining routing information for persistent storage based on a preset data storage component;
the hot reserve cache unit is used for synchronizing the route information stored in a persistent mode to a preset data cache component and determining the route information in a hot reserve cache region corresponding to the gateway server;
and the information synchronization unit is used for synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
Further, the persistent storage unit includes:
the routing information acquisition subunit is configured to update and modify the basic information of the function server through a background management interface of the basic information server, and determine routing information corresponding to the function server;
and the routing information persistent storage subunit is used for storing the routing information into a preset data storage component MySQL and determining the routing information for persistent storage.
Further, the hot reserve buffer unit includes:
the cache region routing information obtaining subunit is configured to read, based on a preset data cache component Redis, the persistently stored routing information in the data storage component MySQL;
and the cache region routing information storage subunit is configured to store, based on a cache policy of the data cache component Redis, the route information stored in the persistent manner into a hot reserve cache region corresponding to the gateway server, and determine the route information in the hot reserve cache region.
Further, the information synchronization unit includes:
a server-side routing information obtaining subunit, configured to read routing information in the hot reserve cache area corresponding to the gateway server-side data cache component Redis;
and the server routing information storage subunit is used for loading the routing information in the hot reserve cache region into a memory of the functional server so as to synchronize the routing information in the hot reserve cache region with the information of the functional server.
Further, the route change channel subscription module includes:
a change channel identification unit, configured to identify the function server based on a preset route change channel, and determine a route change channel corresponding to the function server;
and the change channel prompting unit is used for sending the route change channel to a background management interface of the micro-service system for change prompting based on a subscription and publishing function of a preset middleware Redis.
For the principle and implementation process of the method for implementing hot update of routing information in this embodiment, please refer to the above embodiments, which are not described herein again.
In addition, an apparatus according to an embodiment of the present invention is further provided, where the apparatus includes a memory, a processor, and a route update program stored in the memory and running on the processor, and when executed by the processor, the route update program implements the steps of the route information hot update method according to the foregoing embodiment.
In addition, to achieve the above object, the present invention also provides a medium, which is a computer readable storage medium, wherein the computer readable storage medium stores a route update program, and the route update program when executed by a processor implements the steps of the route information hot update method as described above.
Since the route update program is executed by the processor, all technical solutions of all the foregoing embodiments are adopted, so that at least all the beneficial effects brought by all the technical solutions of all the foregoing embodiments are achieved, and details are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention essentially or contributing to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A hot update method for routing information is applied to a micro service system, and the micro service system at least comprises: the routing information hot updating method comprises a basic information server, a gateway server and a function server, and comprises the following steps:
acquiring the routing information changed by the basic information server;
synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
2. The method for hot update of routing information according to claim 1, wherein the step of synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component includes:
determining routing information for persistent storage based on a preset data storage component;
synchronizing the route information stored persistently to a preset data cache component, and determining the route information in a hot reserve cache region corresponding to the gateway server;
and synchronizing the routing information in the hot reserve cache region to the memory of the function server based on a preset data cache component.
3. The method for hot updating routing information according to claim 2, wherein the step of determining the routing information for persistent storage based on a predetermined data storage component comprises:
updating and modifying the basic information of the function server through a background management interface of the basic information server, and determining the routing information corresponding to the function server;
and storing the routing information into a preset data storage component MySQL, and determining the routing information for persistent storage.
4. The method for hot updating routing information according to claim 3, wherein the step of synchronizing the persistently stored routing information to a predetermined data caching component and determining the routing information in the hot reserve cache corresponding to the gateway server includes:
reading the routing information of the persistent storage in the MySQL data storage component based on a preset data cache component Redis;
based on the cache strategy of the data cache component Redis, the route information stored in a persistent mode is stored into a hot reserve cache region corresponding to the gateway server side, and the route information in the hot reserve cache region is determined.
5. The method for hot updating routing information as claimed in claim 4, wherein the step of synchronizing the routing information in the hot reserve cache to the memory of the functional server based on the predetermined data cache component comprises:
reading the routing information in the hot reserve cache region corresponding to the gateway server data cache component Redis;
and loading the routing information in the hot reserve cache region into a memory of the function server so as to synchronize the routing information in the hot reserve cache region with the information of the function server.
6. A hot update method for routing information according to claim 4, wherein before the step of reading the persistently stored routing information in the data storage component MySQL based on a preset data caching component Redis, the hot update method for routing information further comprises:
and defining a route change channel corresponding to the route information stored in the persistent mode in the data cache assembly Redis, and monitoring the route change channel in real time based on the data cache assembly Redis.
7. The method for hot-updating routing information according to claim 1, wherein the step of synchronously updating the predefined route change channel to the corresponding function server to perform hot-updating on the routing information comprises:
identifying the function server based on a preset route change channel, and determining a route change channel corresponding to the function server;
and sending the route change channel to a background management interface of the micro-service system for change prompt based on a subscription and publication function of a preset middleware Redis.
8. A route update apparatus, characterized in that the route update apparatus comprises:
the routing information acquisition module is used for acquiring the routing information changed by the basic information server;
the data transmission module is used for synchronizing the routing information to the gateway server and the corresponding function server based on a preset intermediate component;
and the route change channel subscription module is used for synchronously updating the predefined route change channel to the corresponding function server so as to perform hot update on the route information.
9. An apparatus comprising a memory, a processor, and a routing update program stored on the memory and executable on the processor, the routing update program when executed by the processor implementing a routing information hot update method as recited in any of claims 1-7.
10. A medium being a computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a route update program, which when executed by a processor implements the steps of the route information hot update method according to any one of claims 1 to 7.
CN202210903473.7A 2022-07-27 2022-07-27 Routing information hot updating method, device, equipment and medium Pending CN115185971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210903473.7A CN115185971A (en) 2022-07-27 2022-07-27 Routing information hot updating method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210903473.7A CN115185971A (en) 2022-07-27 2022-07-27 Routing information hot updating method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115185971A true CN115185971A (en) 2022-10-14

Family

ID=83520479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210903473.7A Pending CN115185971A (en) 2022-07-27 2022-07-27 Routing information hot updating method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115185971A (en)

Similar Documents

Publication Publication Date Title
US20220100494A1 (en) Providing access to a hybrid application offline
US20090240698A1 (en) Computing environment platform
US20100235321A1 (en) Programming model for synchronizing browser caches across devices and web services
CA2954294A1 (en) Website access method, apparatus, and website system
US20140006487A1 (en) Methods for making ajax web applications bookmarkable and crawable and devices thereof
CN102722439B (en) Method, device and system for improving running stability of FLASH assembly
JP2016529599A (en) Content clipboard synchronization
US8868680B2 (en) Methods for recommending personalized content based on profile and context information and devices thereof
US20140304384A1 (en) Uploading large content items
CN113886743B (en) Method, device and system for refreshing cache resources
JP2005530258A (en) System and method for resynchronization while refreshing a client device from a server
KR102022665B1 (en) Method of managing digital media content, Computer readable storage medium of recording the method and User apparatus.
CN110619101B (en) Method and apparatus for processing information
CN115185971A (en) Routing information hot updating method, device, equipment and medium
CN111767495A (en) Method and system for synthesizing webpage
CA2620453C (en) System and method for managing databases associated with respective personal information manager service accounts
CN112949326B (en) Information query method, device, equipment and computer readable medium
WO2016178920A1 (en) Insertion of unsaved content via content channel
CN112203158A (en) Image display method, device, system, equipment and medium
CN111343172A (en) Network access authority dynamic processing method and device
US20240152504A1 (en) Data interaction method, apparatus, and electronic device
Moss et al. Integrating cloud computing and mobile applications: a comparative study based on icloud and sanscode
CN112306516A (en) Method and apparatus for updating code
CN113486116A (en) Data synchronization method and device, electronic equipment and computer readable medium
CN117714541A (en) iOS application network data caching method and system based on request link interception

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