CN112882738A - Configuration information updating method and device under micro-service architecture and electronic equipment - Google Patents

Configuration information updating method and device under micro-service architecture and electronic equipment Download PDF

Info

Publication number
CN112882738A
CN112882738A CN202110302172.4A CN202110302172A CN112882738A CN 112882738 A CN112882738 A CN 112882738A CN 202110302172 A CN202110302172 A CN 202110302172A CN 112882738 A CN112882738 A CN 112882738A
Authority
CN
China
Prior art keywords
configuration information
updating
server
information corresponding
instruction
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
CN202110302172.4A
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.)
17win Network Technology Co ltd
Original Assignee
17win Network 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 17win Network Technology Co ltd filed Critical 17win Network Technology Co ltd
Priority to CN202110302172.4A priority Critical patent/CN112882738A/en
Publication of CN112882738A publication Critical patent/CN112882738A/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
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Abstract

The application discloses a method, a device, a system, an electronic device and a computer readable storage medium for updating configuration information under a micro service architecture, which comprises the following steps: when the micro-service application is started, acquiring configuration information corresponding to the micro-service application from a server side, and storing the configuration information into a memory; when an update instruction of configuration information pushed by a target cluster of a server is received, sending a download request of the configuration information corresponding to the update instruction to the server; and receiving configuration information corresponding to the updating instruction sent by the server, and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction. The method only obtains the configuration information corresponding to the updating instruction from the server side, does not need to download all the configuration information, improves the efficiency of obtaining the configuration information, stores the configuration information in the memory, does not need to obtain the configuration information from the server side when the configuration is used each time, reduces the information interaction between the server side and the client side, and saves the network resource cost.

Description

Configuration information updating method and device under micro-service architecture and electronic equipment
Technical Field
The present invention relates to the field of distributed microservice technologies, and in particular, to a method, an apparatus, a system, an electronic device, and a computer-readable storage medium for updating configuration information under a microservice architecture.
Background
In the internet micro-service scene, the application service is increasingly complex, and the program contains various types of configuration information: middleware configuration, framework configuration, application configuration, black and white lists, grayscale switches, and the like. In a non-distributed environment, a single machine is deployed, and the single machine can take effect in real time only by modifying a configuration file on one server and restarting service configuration. However, in a distributed environment, one microservice may need to be deployed to thousands of machines, which is a huge workload, and many application parameters need to be dynamically updated at runtime.
In the related art, under a micro service architecture, a configuration is stored as a record in a relational database such as Mysql or a NoSql database such as Mongodb, and a client application needs to actively initiate a request for downloading configuration information each time the configuration is used. When the configuration information of the server is sent and changed, the application service of the client needs to download all the configuration information from the server, and under the condition of high concurrency, the network return delay will affect the performance of the system, and the client cannot acquire the required configuration information in time, so that the client cannot respond to the service in time, and the user experience is poor.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a system, an electronic device, and a computer-readable storage medium for updating configuration information under a micro-service architecture, which can improve efficiency of obtaining configuration information, store the configuration information in a memory, and do not need to obtain the configuration information from a server every time a configuration is used, thereby reducing information interaction between the server and a client and saving network resource cost. The specific scheme is as follows:
in a first aspect, the present application discloses a method for updating configuration information under a micro service architecture, including:
when a micro service application is started, acquiring configuration information corresponding to the micro service application from a server side, and storing the configuration information into a memory;
when an update instruction of the configuration information pushed by a target cluster of the server is received, sending a download request of the configuration information corresponding to the update instruction to the server;
and receiving configuration information corresponding to the updating instruction sent by the server, and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
Optionally, updating the configuration information in the current memory according to the configuration information corresponding to the update instruction includes:
and acquiring the affected object list from the resource attribute configurator, and updating the attribute values of the object list in the configuration information corresponding to the updating instruction.
Optionally, before updating the configuration information in the current memory according to the configuration information corresponding to the update instruction, the method further includes:
judging whether the modification time of the configuration information corresponding to the updating instruction is greater than the modification time of the configuration information in the current memory;
and if so, executing the step of updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
Optionally, after updating the configuration information in the current memory according to the configuration information corresponding to the update instruction, the method further includes:
and performing callback updating on the service logic associated with the configuration information corresponding to the updating instruction.
Optionally, the method further includes:
and when the target cluster of the server is unavailable, acquiring the configuration information backed up in the database of the server.
Optionally, the target cluster is a consul cluster or a zookeeper cluster.
In a second aspect, the present application discloses a device for updating configuration information under a micro-service architecture, including:
the acquisition module is used for acquiring the configuration information corresponding to the micro service application from a server side when the micro service application is started, and storing the configuration information into a memory;
the sending module is used for sending a downloading request of the configuration information corresponding to the updating instruction to the server when the updating instruction of the configuration information pushed by the target cluster of the server is received;
and the updating module is used for receiving the configuration information corresponding to the updating instruction sent by the server and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
In a third aspect, the present application discloses a system for updating configuration information under a micro-service architecture, including:
the server is used for receiving a downloading request of the configuration information corresponding to the updating instruction sent by the client and sending the configuration information corresponding to the updating instruction to the client; the server is deployed with a target cluster and used for pushing an update instruction of the configuration information to the client;
the client is configured to implement the steps of the configuration information updating method under the micro service architecture when executing the computer program.
In a fourth aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the configuration information updating method under the micro service architecture when executing the computer program.
In a fifth aspect, the present application discloses a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the configuration information updating method under the above microservice architecture.
The application provides a method for updating configuration information under a micro-service architecture, which comprises the following steps: when a micro service application is started, acquiring configuration information corresponding to the micro service application from a server side, and storing the configuration information into a memory; when an update instruction of the configuration information pushed by a target cluster of the server is received, sending a download request of the configuration information corresponding to the update instruction to the server; and receiving configuration information corresponding to the updating instruction sent by the server, and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
It can be seen that, according to the configuration information storage method and device, the configuration information is stored in the memory, when an update instruction of the configuration information pushed by a target cluster is received, the configuration information corresponding to the update instruction is only obtained from the server side, and all the configuration information does not need to be downloaded, so that the efficiency of obtaining the configuration information is improved, the defects that in the related art, when the configuration information is changed, all the configuration information needs to be obtained from the server side, the efficiency of obtaining the configuration information is low due to high concurrent network delay, and the application service cannot be responded in time are avoided, the influence on the system performance is reduced, the configuration information is stored in the memory, the configuration information does not need to be obtained from the server side each time the configuration is used, the information interaction between the server side and the client side is reduced, the network resource cost is saved, and the operation and maintenance. The application also provides a device, a system, an electronic device and a computer readable storage medium for updating configuration information under the micro service architecture, which have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a configuration information updating method under a micro service architecture according to an embodiment of the present application;
fig. 2 is a system architecture diagram of a client and a server according to an embodiment of the present disclosure;
fig. 3 is a specific workflow diagram of information interaction between a client and a server according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a configuration information updating apparatus under a micro service architecture according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The microservice architecture is a computer architecture that disassembles system functionality into individual sub-services. Each microservice is a minimal unit of application management, and applications can be independently developed, designed, and released. Configuration hot-update means that the configuration information is validated in real time without restarting the server when the configuration information is modified. There are two main ways to implement configuration hot update currently: one way is to store the configuration as a record in a relational database such as Mysql or a NoSql database such as Mongodb, and update the record to realize the hot update of the configuration. Although the configuration is stored in the database as a record in this way, the application in the cluster can actively obtain the dynamic change information of the configuration by initiating a request, but the method has high code intrusiveness and no expandability. Meanwhile, the application needs to actively initiate a request every time the application uses the configuration, and the network return delay generated under high concurrency has influence on the system performance. The other mode is that the Spring Cloud is a complete microservice solution based on a Spring Boot framework, and is a configuration management mode for storing configuration file information based on Git, a configServer caches the configuration files, an application obtains configuration through a ConfigClient, and the configuration modification does not need to restart service. The distributed configuration center with SpringCloud can solve the problem of configuration hot update, but the webhook method relying on the publish subscription of RabbitMq or the git code warehouse is needed to push the change of the configuration center to the cluster service. And a flexible and easy-to-use configuration management platform is lacked to manage the configuration, so that the management cost is high.
Based on the above technical problem, this embodiment provides a method for updating configuration information under a micro service architecture, which can improve efficiency of obtaining configuration information, reduce information interaction between a server and a client, save network resource cost, and reduce operation and maintenance cost, specifically referring to fig. 1, where fig. 1 is a flowchart of a method for updating configuration information under a micro service architecture provided in this embodiment of the present application, and specifically includes:
s101, when the micro-service application is started, obtaining configuration information corresponding to the micro-service application from a server side, and storing the configuration information into a memory.
The embodiment is not limited to the specific object of the micro service application, and may be any micro service, such as tax. In this embodiment, the configuration information may be configuration information of a configuration item, or configuration information of a configuration file. In the embodiment, after the micro service is started, the required configuration information is acquired from the server, and then the configuration information is stored in the memory, so that information interaction between the client and the server can be reduced, the configuration information does not need to be acquired from the server every time the configuration is used, the possibility of information transmission is reduced, and network bandwidth resources are saved.
S102, when an updating instruction of the configuration information pushed by a target cluster of the server is received, a downloading request of the configuration information corresponding to the updating instruction is sent to the server.
The target cluster in this embodiment is deployed at the server, and the configuration information of the server is stored in the target cluster, when the configuration information of the server sends a change, the target cluster will push a change message, that is, an update instruction, to the client, and after receiving the update instruction, the client sends a download request of the configuration information corresponding to the update instruction to the server. The target cluster in this embodiment refers to a consul cluster or a zookeeper cluster; it can be understood that Consul is an open source tool developed by Go language, realizes service discovery and configuration of a distributed system, has the characteristics of being distributed and capable of being horizontally expanded, and provides functions of service discovery, monitoring and checking, key value pair storage, security service, multiple data centers, and the like. Zookeeper is a high-performance open-source distributed application coordination service. It provides simple primitive functionality based on which a distributed application can implement more advanced services such as synchronization, configuration management, cluster management, namespaces. When the configuration information of the server is sent and changed, the client only downloads the updated part of the configuration information from the server, and the rest of the configuration information is stored in the local memory, so that the client does not need to download all the configuration information, the efficiency of acquiring the configuration information can be effectively improved, the influence on the system can be reduced under the condition of high concurrent network delay, and the client can acquire the configuration information in time and respond to the microservice application. It should be understood that the embodiment does not limit the specific content of the update instruction, and may be a code or a communication protocol, as long as the client can be triggered to send a download request for obtaining the changed configuration information.
S103, receiving configuration information corresponding to the updating instruction sent by the server, and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
The embodiment does not limit the specific process of updating the current memory configuration information, and may be determined according to the specific content of the changed configuration information. For example, after receiving the changed configuration information sent by the server, that is, the configuration information corresponding to the update instruction, where the changed configuration information is the information of the configuration item, the configuration information of the configuration item may be added to the configuration information in the current memory; if the changed configuration information is the configuration information of a certain configuration file in the current memory, the changed configuration information can replace the configuration information of the corresponding configuration file in the current memory to realize updating.
In a specific embodiment, updating the configuration information in the current memory according to the configuration information corresponding to the update instruction may include:
and acquiring the affected object list from the resource attribute configurator, and updating the attribute value of the object list in the configuration information corresponding to the updating instruction.
In this embodiment, the client acquires the affected object list from the resource attribute configurator according to the acquired new configuration information, that is, the configuration information corresponding to the update instruction, and then updates the attribute value of the affected object list in the changed configuration information, so as to update the configuration information of the current memory.
In a specific embodiment, in order to ensure that the updated configuration information version is higher than the configuration information version of the current memory, before updating the configuration information in the current memory according to the configuration information corresponding to the update instruction, the method may further include:
judging whether the modification time of the configuration information corresponding to the updating instruction is greater than the modification time of the configuration information in the current memory;
and if so, executing the step of updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
That is, in this embodiment, before updating the configuration information summarized in the current memory according to the configuration information corresponding to the update instruction, it is further determined whether the modification time of the changed configuration information is greater than the modification time of the configuration information in the current memory, that is, whether the version of the configuration information corresponding to the update instruction is newer than the version of the configuration information in the current memory, and if so, the operation of updating the configuration information in the current memory is executed. The updated configuration information version can be ensured to be updated, the micro-service application of the client side is better met, and the user experience is improved.
In a specific embodiment, in order to prevent the situation that the service cannot be used after the configuration information is changed, after the configuration information in the current memory is updated according to the configuration information corresponding to the update instruction, the method may further include:
and calling back and updating the service logic associated with the configuration information corresponding to the updating instruction.
That is, in this embodiment, after the configuration information in the current memory is updated, the service logic associated with the updated configuration information is also updated in a callback manner, so that the service associated with the changed configuration information can be updated in time, the service can be used normally, the situation that the service cannot be used after the configuration information is changed is prevented, the customer requirements can be better met, and the user experience is improved.
In a specific embodiment, in order to ensure stable operation of the client microservice application, the method may further include:
and when the target cluster of the server is unavailable, acquiring the configuration information backed up in the database of the server.
In this embodiment, when the target cluster of the server is unavailable, the configuration information backed up in the database of the server may be obtained, that is, when the target cluster is unavailable and the client cannot obtain the configuration information from the target cluster of the server, the server backs up the configuration information in the database and performs persistent configuration, and at this time, the client may obtain the backed-up configuration information from the database, thereby ensuring high availability of the configuration center of the server and ensuring stable operation of the microservice application of the client.
Based on the above embodiment, the configuration information is stored in the memory, when the update instruction of the configuration information pushed by the target cluster is received, the configuration information corresponding to the update instruction is only obtained from the server side, and all the configuration information does not need to be downloaded, so that the efficiency of obtaining the configuration information is improved, the configuration information is stored in the memory, and the configuration information does not need to be obtained from the server side every time the configuration is used, so that the information interaction between the server side and the client side is reduced, the network resource cost is saved, and the operation and maintenance cost is reduced.
A specific embodiment is provided below, where a consul cluster is selected as a target cluster, and the process includes an interaction process between a client and a server after the client is started. Fig. 2 is a system architecture diagram of a client and a server according to the present embodiment. The server is an independent service platform and provides capabilities of configuration management, configuration release, authority management and the like; the client is a component that provides for applications that need to support microservice configuration hot updates.
The client component can be composed of five functional modules, including a configuration initialization module, a configuration download module, a configuration monitoring module and a configuration hot update module, wherein the configuration hot update module is the most core function. The client startup process in this embodiment includes four steps:
1. scanning fields needing hot update comments in the microservice application and placing the fields into a memory;
2. downloading configuration information from a server console through an HTTP (hyper text transport protocol) and storing the configuration information in a memory;
3. a node is created on a Consul cluster according to each configuration data in a memory and monitored, once the data of the node is changed, a client receives an update instruction pushed by the Consul cluster, and the client triggers to download the changed configuration information, namely the configuration information corresponding to the update instruction, to a server so as to update the configuration information in the current memory;
4. and initializing and configuring a corresponding callback updating function.
The configuration updating process of the server side console can be divided into three steps:
1. the user updates the configuration information on the server console;
2. the server side console sends the updated configuration information to a corresponding node on the consul cluster, and the consul cluster informs the client side of the configuration change information, namely sends an update instruction to the client side;
3. and the server side sends the configuration information corresponding to the updating instruction to the client side.
Fig. 3 is a specific work flow diagram of information interaction between the client and the server according to this embodiment. The P1 configuration initialization process includes: creating configuration, scanning application, HTTP request downloading configuration, monitoring configuration, configuration pushing, callback updating and other processes.
P1S1, the establishment configuration is initiated by the micro-service operation and maintenance development, the operation server page establishes configuration information and makes the configuration persistent, and the initialization configuration is provided for the downstream micro-service startup to ensure that the downstream micro-service startup can be started normally;
P1S2, scanning the application after the micro service is started, and acquiring the required configuration information from the configuration center of the server;
P1S3, the client side sends an HTTP downloading request to the server side, and the downloading configuration information is stored to a designated folder in a file form;
the P1S4 and the server respond to the HTTP downloading request;
P1S5, creating nodes on the consul cluster by the client aiming at each configuration and registering the listener on the nodes;
P1S6, when the configuration information of the node is changed, pushing the node to the client in real time;
P1S7, the client side pushes the update instruction to the microservice;
P1S8, the configuration of the client for setting callback update processes the logic after callback.
The PS2 configuration change process is as follows:
the change of the P2S1 and the configuration information is initiated by micro-service operation and maintenance development or service responsible personnel, the configuration information is changed and the configuration is made persistent by operating the page of the service end;
the P2S2 and the server side operate the node state by using a consul API and inform the client side of the change of the node data in real time;
the P2S3 receives the change message, namely the update instruction;
P2S4, initiating an HTTP downloading request for changing information to a server, comparing modification time of two new and old files, namely configuration information corresponding to an updating instruction and configuration information in a current memory, and if the modification time of the new file is greater than the modification time of the old file, notifying a rewritten resource attribute configurator to acquire an affected attribute and an affected object list;
the P2S5 and the client update the attribute value corresponding to the affected object according to the changed configuration information;
P2S6, the configuration of the client for setting callback updates processes the logic after the callback.
Based on the above embodiments, the method for updating configuration information under the micro service architecture provided by the present application has the following performance: maintainability, which realizes centralized management of configuration information of different applications, different environments and different clusters under a micro service architecture; configuration hot update provides a method for pushing modified configuration information to the micro-service in real time without restarting the server configuration to take effect in real time, thereby greatly reducing the operation and maintenance cost; the authority management is realized, all the applications and the configurations increase the authority management and the auditing mechanism, and the possibility of artificial errors is reduced; version management, wherein all configurations of different environments, different applications and different clusters are subjected to version configuration, so that the configurations are convenient to rollback; the configuration among different versions provides a difference comparison function, so that the problems caused by configuration change can be conveniently and quickly checked; a client configuration thermal updating component and a server management and control platform are developed around the method, and the server is an independent micro-service platform and is used for configuration management, configuration release and authority management; the client is an infrastructure of each micro-service, and can realize the configured hot update only by configuring the component in the dependence file without intruding business codes; the configuration open platform opens the API capability of configuration management to the outside, and the heterogeneous system can be quickly accessed to the configuration center through the API.
Based on all the embodiments, the configuration real-time hot update is realized based on the consul cluster under the micro-service architecture, and the micro-service does not need to be restarted. The configuration information is published to the consul node through the server, and the micro-service dynamically acquires the configuration information as a subscriber, so that centralized management of configuration and dynamic update of configuration are realized. By updating the configuration information on the server-side distributed configuration center, the updating instruction can reach all micro-service applications in a broadcasting mode, and configuration hot updating can be realized during operation without repackaging and restarting the micro-service, so that the release cost is reduced; and the configuration hot update function can be realized only by adding a dependent item of the client component in the dependent configuration of the service code and configuring and uploading the dependent item to a distributed configuration center of the server, and the process of the application node in each cluster senses the configuration change. The service is separated from the configuration, the local configuration information is preferentially read, even if the server is unavailable, the client application can normally run, and the whole architecture is more stable. And the high availability of the configuration center is ensured by the server under the micro-service architecture through database persistent configuration.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a configuration information updating apparatus under a micro service architecture according to an embodiment of the present disclosure, where the configuration information updating apparatus under the micro service architecture described below and the configuration information updating method under the micro service architecture described above are referred to in correspondence, and all related modules are disposed therein, and the schematic structural diagram of the configuration information updating apparatus under the micro service architecture provided by the embodiment of the present disclosure includes:
in some specific embodiments, the method specifically includes:
the acquiring module 401 is configured to acquire configuration information corresponding to the micro service application from the server when the micro service application is started, and store the configuration information in the memory;
a sending module 402, configured to send, when receiving an update instruction of the configuration information pushed by a target cluster of the server, a download request of the configuration information corresponding to the update instruction to the server;
the update module 403 is configured to receive the configuration information corresponding to the update instruction sent by the server, and update the configuration information in the current memory according to the configuration information corresponding to the update instruction.
In some specific embodiments, the update module 403 includes:
and acquiring the affected object list from the resource attribute configurator, and updating the attribute value of the object list in the configuration information corresponding to the updating instruction.
In some specific embodiments, the method further comprises:
and the judging module is used for judging whether the modification time of the configuration information corresponding to the updating instruction is greater than the modification time of the configuration information in the current memory.
In some specific embodiments, the method further comprises:
and the callback updating module is used for carrying out callback updating on the service logic associated with the configuration information corresponding to the updating instruction.
In some specific embodiments, the method further comprises:
and the backup configuration obtaining module is used for obtaining the backup configuration information in the database of the server when the target cluster of the server is unavailable.
In some specific embodiments, the target cluster is a consul cluster or a zookeeper cluster.
Since the embodiment of the configuration information updating apparatus portion under the micro service architecture corresponds to the embodiment of the configuration information updating method portion under the micro service architecture, for the embodiment of the configuration information updating apparatus portion under the micro service architecture, reference is made to the description of the embodiment of the configuration information updating method portion under the micro service architecture, and details are not repeated here.
The application also discloses a system for updating configuration information under the micro-service architecture, which comprises:
the server is used for receiving a downloading request of the configuration information corresponding to the updating instruction sent by the client and sending the configuration information corresponding to the updating instruction to the client; the server is deployed with a target cluster and used for pushing an update instruction of the configuration information to the client;
and the client is used for realizing the steps of the configuration information updating method under the micro service architecture when executing the computer program.
Since the embodiment of the configuration information updating system portion under the micro service architecture corresponds to the embodiment of the configuration information updating method portion under the micro service architecture, for the embodiment of the configuration information updating system portion under the micro service architecture, reference is made to the description of the embodiment of the configuration information updating method portion under the micro service architecture, and details are not repeated here.
In the following, an electronic device provided by an embodiment of the present application is introduced, and the electronic device described below and the configuration information updating method under the micro service architecture described above may be referred to correspondingly.
The application provides an electronic device, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the configuration information updating method under the micro service architecture when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the configuration information updating method portion under the microservice architecture, for the embodiment of the electronic device portion, reference is made to the description of the embodiment of the configuration information updating method portion under the microservice architecture, and details are not repeated here.
The application also discloses a computer readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the above method.
Since the embodiment of the computer-readable storage medium portion and the embodiment of the method portion correspond to each other, please refer to the description of the embodiment of the method portion for the embodiment of the computer-readable storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method, the apparatus, the system, the electronic device and the computer-readable storage medium for updating configuration information under a micro service architecture provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A method for updating configuration information under a micro-service architecture is characterized by comprising the following steps:
when a micro service application is started, acquiring configuration information corresponding to the micro service application from a server side, and storing the configuration information into a memory;
when an update instruction of the configuration information pushed by a target cluster of the server is received, sending a download request of the configuration information corresponding to the update instruction to the server;
and receiving configuration information corresponding to the updating instruction sent by the server, and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
2. The method according to claim 1, wherein the updating the configuration information in the current memory according to the configuration information corresponding to the update instruction includes:
and acquiring the affected object list from the resource attribute configurator, and updating the attribute values of the object list in the configuration information corresponding to the updating instruction.
3. The method according to claim 1, further comprising, before updating the configuration information in the current memory according to the configuration information corresponding to the update instruction:
judging whether the modification time of the configuration information corresponding to the updating instruction is greater than the modification time of the configuration information in the current memory;
and if so, executing the step of updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
4. The method according to claim 1, further comprising, after updating the configuration information in the current memory according to the configuration information corresponding to the update instruction:
and performing callback updating on the service logic associated with the configuration information corresponding to the updating instruction.
5. The method for updating configuration information under micro-service architecture according to claim 1, further comprising:
and when the target cluster of the server is unavailable, acquiring the configuration information backed up in the database of the server.
6. The method for updating configuration information under the microservice architecture according to any one of claims 1 to 5, wherein the target cluster is a Consul cluster or a zookeeper cluster.
7. An apparatus for updating configuration information under a micro-service architecture, comprising:
the acquisition module is used for acquiring the configuration information corresponding to the micro service application from a server side when the micro service application is started, and storing the configuration information into a memory;
the sending module is used for sending a downloading request of the configuration information corresponding to the updating instruction to the server when the updating instruction of the configuration information pushed by the target cluster of the server is received;
and the updating module is used for receiving the configuration information corresponding to the updating instruction sent by the server and updating the configuration information in the current memory according to the configuration information corresponding to the updating instruction.
8. A system for updating configuration information under a micro-service architecture is characterized by comprising:
the server is used for receiving a downloading request of the configuration information corresponding to the updating instruction sent by the client and sending the configuration information corresponding to the updating instruction to the client; the server is deployed with a target cluster and used for pushing an update instruction of the configuration information to the client;
the client, configured to implement the steps of the configuration information updating method under the microservice architecture according to any one of claims 1 to 6 when executing the computer program.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for updating configuration information under the microservice architecture of any of claims 1 to 6 when executing said computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the configuration information updating method under a microservice architecture according to any one of claims 1 to 6.
CN202110302172.4A 2021-03-22 2021-03-22 Configuration information updating method and device under micro-service architecture and electronic equipment Pending CN112882738A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110302172.4A CN112882738A (en) 2021-03-22 2021-03-22 Configuration information updating method and device under micro-service architecture and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110302172.4A CN112882738A (en) 2021-03-22 2021-03-22 Configuration information updating method and device under micro-service architecture and electronic equipment

Publications (1)

Publication Number Publication Date
CN112882738A true CN112882738A (en) 2021-06-01

Family

ID=76041642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110302172.4A Pending CN112882738A (en) 2021-03-22 2021-03-22 Configuration information updating method and device under micro-service architecture and electronic equipment

Country Status (1)

Country Link
CN (1) CN112882738A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422358A (en) * 2022-01-26 2022-04-29 中国农业银行股份有限公司 API gateway configuration updating method and equipment
CN115129740A (en) * 2022-09-01 2022-09-30 山东大学 Method and system for updating distributed micro-service database in cloud native environment
CN115361279A (en) * 2022-08-12 2022-11-18 广州博冠信息科技有限公司 Configuration data updating method and device, electronic equipment and computer readable medium
CN117082068A (en) * 2023-08-25 2023-11-17 北京神州云合数据科技发展有限公司 Elastic expansion method and system for tax return server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714188A (en) * 2018-11-02 2019-05-03 中国平安人寿保险股份有限公司 Configuration data management method, equipment and storage medium based on Zookeeper
CN109857427A (en) * 2018-12-29 2019-06-07 深圳云天励飞技术有限公司 Configure update method and Related product
CN109995586A (en) * 2019-03-25 2019-07-09 江苏电力信息技术有限公司 Refresh model with dynamic configuration parameters based on the unified configuration under micro services framework
CN110677475A (en) * 2019-09-26 2020-01-10 亿企赢网络科技有限公司 Micro-service processing method, device, equipment and storage medium
CN111541561A (en) * 2020-04-09 2020-08-14 珠海格力电器股份有限公司 Microservice configuration information management system, microservice configuration information management method, microservice configuration information management server, and storage medium
WO2020237797A1 (en) * 2019-05-31 2020-12-03 烽火通信科技股份有限公司 Dynamic configuration management method and system in microservice framework
CN112187923A (en) * 2020-09-28 2021-01-05 浪潮云信息技术股份公司 Government affair cloud platform micro-service configuration method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714188A (en) * 2018-11-02 2019-05-03 中国平安人寿保险股份有限公司 Configuration data management method, equipment and storage medium based on Zookeeper
CN109857427A (en) * 2018-12-29 2019-06-07 深圳云天励飞技术有限公司 Configure update method and Related product
CN109995586A (en) * 2019-03-25 2019-07-09 江苏电力信息技术有限公司 Refresh model with dynamic configuration parameters based on the unified configuration under micro services framework
WO2020237797A1 (en) * 2019-05-31 2020-12-03 烽火通信科技股份有限公司 Dynamic configuration management method and system in microservice framework
CN110677475A (en) * 2019-09-26 2020-01-10 亿企赢网络科技有限公司 Micro-service processing method, device, equipment and storage medium
CN111541561A (en) * 2020-04-09 2020-08-14 珠海格力电器股份有限公司 Microservice configuration information management system, microservice configuration information management method, microservice configuration information management server, and storage medium
CN112187923A (en) * 2020-09-28 2021-01-05 浪潮云信息技术股份公司 Government affair cloud platform micro-service configuration method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
梅璇: "基于spring Cloud的微服务调用研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》, no. 2019, pages 139 - 77 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422358A (en) * 2022-01-26 2022-04-29 中国农业银行股份有限公司 API gateway configuration updating method and equipment
CN114422358B (en) * 2022-01-26 2024-01-30 中国农业银行股份有限公司 API gateway configuration updating method and equipment
CN115361279A (en) * 2022-08-12 2022-11-18 广州博冠信息科技有限公司 Configuration data updating method and device, electronic equipment and computer readable medium
CN115129740A (en) * 2022-09-01 2022-09-30 山东大学 Method and system for updating distributed micro-service database in cloud native environment
CN115129740B (en) * 2022-09-01 2022-11-04 山东大学 Method and system for updating distributed micro-service database in cloud native environment
CN117082068A (en) * 2023-08-25 2023-11-17 北京神州云合数据科技发展有限公司 Elastic expansion method and system for tax return server
CN117082068B (en) * 2023-08-25 2024-03-29 北京神州云合数据科技发展有限公司 Elastic expansion method and system for tax return server

Similar Documents

Publication Publication Date Title
CN112882738A (en) Configuration information updating method and device under micro-service architecture and electronic equipment
CN108170448B (en) System for automatically and efficiently releasing software update version
US20180373517A1 (en) Systems, methods, and apparatuses for docker image downloading
US9229701B2 (en) Local store data versioning
US10069942B2 (en) Method and apparatus for changing configurations
US20040230670A1 (en) Method and system for representing, configuring and deploying distributed applications
CN105335171A (en) Method and device for long residence of application program in background of operating system
CN111064626B (en) Configuration updating method, device, server and readable storage medium
CN112261101B (en) Method for introducing rule engine into MQTT message center
US10942831B2 (en) Automating and monitoring rolling cluster reboots
CN114448895B (en) Application access method, device, equipment and medium
CN112463290A (en) Method, system, apparatus and storage medium for dynamically adjusting the number of computing containers
CN106850724B (en) Data pushing method and device
CN115576599A (en) Configuration method and system for software development and computer equipment
CN111666134A (en) Method and system for scheduling distributed tasks
CN107463390B (en) Software upgrading method and upgrading server
CN114546588A (en) Task deployment method and device, storage medium and electronic device
WO2023071999A1 (en) User matching method and apparatus, and device and storage medium
CN108418857B (en) Zookeeper cluster system and connection method and device thereof
CN115729590A (en) Service deployment method, device, equipment and computer readable storage medium
CN110798358A (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN114461424A (en) Inter-unit service discovery method, device and system under unitized deployment architecture
CN114461249A (en) Micro-service deployment method, device, code server and storage medium
CN112511595B (en) Message pushing method and message service system
CN114978902A (en) Information processing method, apparatus, device, storage medium, and program product

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