WO2020237797A1 - 一种微服务框架下动态配置管理方法及系统 - Google Patents

一种微服务框架下动态配置管理方法及系统 Download PDF

Info

Publication number
WO2020237797A1
WO2020237797A1 PCT/CN2019/096107 CN2019096107W WO2020237797A1 WO 2020237797 A1 WO2020237797 A1 WO 2020237797A1 CN 2019096107 W CN2019096107 W CN 2019096107W WO 2020237797 A1 WO2020237797 A1 WO 2020237797A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
service
instance
level
center
Prior art date
Application number
PCT/CN2019/096107
Other languages
English (en)
French (fr)
Inventor
王昊
王权
Original Assignee
烽火通信科技股份有限公司
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 烽火通信科技股份有限公司 filed Critical 烽火通信科技股份有限公司
Publication of WO2020237797A1 publication Critical patent/WO2020237797A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Definitions

  • the invention relates to the technical field of microservice management, in particular to a dynamic configuration management method and system under a microservice framework.
  • Microservice technology splits large business applications into several small microservices. Microservices only focus on a single responsibility function, deploy and run independently in a single process, and use a lightweight communication mechanism to communicate between services and services, with very low coupling, and easy development and operation and maintenance.
  • each microservice has its own business configuration that it depends on.
  • the service configuration often needs to be dynamically adjusted according to the actual operating environment.
  • the traditional service configuration management method is to save the configuration information in the configuration file and package and run with the application code. Once the configuration parameters are modified, it needs to be repackaged and used and the service restarted, which reduces development efficiency and increases the difficulty of operation and maintenance.
  • the emergence of the dynamic configuration center solves this problem. All microservice configurations are stored in the configuration center for management. During the service operation, the corresponding configuration is pulled from the configuration center. At the same time, when the configuration parameters on the configuration center change, the configuration update will be pushed to the service application in real time.
  • the configuration center solves the limitation that the traditional configuration mode cannot be applied and cannot be dynamically loaded configuration, which greatly improves the timeliness of application loading business configuration.
  • each project contains different environments, such as development, testing, production, etc.
  • Each environment contains multiple services, and a service can have multiple service instances.
  • Service configuration data is divided into three levels of configuration: environment, service, and service instance according to the microservice architecture.
  • environment-level configuration can be used by all services in the environment Sharing
  • service-level configuration can be shared by all service instances of the service; service configurations between different environments are isolated from each other, configurations between different services in the same environment are isolated from each other, and configurations between service instances in the same environment and services are isolated from each other.
  • the configuration center component does not provide historical configuration query and recovery functions. Once the incorrect configuration is released and loaded by the service instance due to misoperation, the operation and maintenance personnel cannot retrospectively query the released historical configuration and roll back the specified historical configuration record. Greater difficulty in operation and maintenance.
  • the purpose of the present invention is to provide a dynamic configuration management method and system under a microservice framework to realize the sharing and isolation of environment, service and service instance-level configuration, high flexibility of configuration management, and data convenience maintain.
  • the technical solution adopted by the present invention is: a dynamic configuration management method under a microservice framework, including the following steps:
  • Obtain the service configuration file of each microservice instance define the path key of the environment-level, service-level, and service-instance-level root nodes according to the service configuration file, and send a long polling request to the configuration center; open the monitoring mechanism in the configuration center and use To monitor the update of all sub-node configuration items under the root node corresponding to the path key in the long polling request;
  • the monitoring mechanism of the configuration center monitors the configuration item update under the root node, it pushes the configuration item update information to the microservice instance client.
  • the service configuration file includes the registration information of the microservice instance and the corresponding configuration center IP address and port; the registration information includes the environment name, service name, and service instance ID of the service instance.
  • the method further includes the following steps:
  • the analysis of the current data and historical data of the configuration items in the database to obtain the configuration item update information specifically includes the following steps:
  • If it is a rollback operation read the historical data of the specified rollback configuration item and the last released historical data of the configuration item from the database, compare the two to obtain the configuration level of the configuration item and update information of the configuration content, as the configuration Item update information.
  • the method further includes the following steps: building a three-level configuration cache of environment, service, and service instance in the microservice instance;
  • the microservice instance When the microservice instance receives the configuration item update information pushed by the configuration center, it updates the configuration item to the configuration cache of the corresponding level according to the configuration item configuration level.
  • the method further includes the following steps: when the configuration is read from the three-level configuration cache of the microservice instance, it is loaded according to the priority of the service instance, service, and environment from high to low.
  • the present invention also provides a dynamic configuration management system under a microservice framework, including a microservice instance client, a configuration center, and a configuration supervision center:
  • the microservice instance client includes a client proxy module, which is used to: obtain the service configuration file of each microservice instance, define the environment-level, service-level, and service-instance-level root node path keys according to the service configuration file, and send Long polling request to the configuration center;
  • the configuration center includes a root node creation module and an update monitoring module, where:
  • the root node creation module is used to establish environment-level, service-level, and service-instance-level configuration root nodes in the configuration center respectively, for storing configuration items of corresponding levels;
  • the update monitoring module is used to: enable a monitoring mechanism in the configuration center to monitor the update of all sub-node configuration items under the root node corresponding to the path key in the long polling request; the monitoring mechanism monitors when there is a configuration item update under the root node , Push the configuration item update information to the microservice instance client;
  • the configuration monitoring center includes a service communication module and a configuration management module, wherein:
  • the service communication module is used to interact with the API interface provided by the configuration center;
  • the configuration management module is used to: obtain the user's operation on the configuration item, bind the configuration item information to the corresponding environment, service or service instance, and save it in the database; analyze the current data and historical data of the configuration item in the database to obtain The configuration item update information is synchronized to the configuration center by calling the configuration center API interface through the service communication module.
  • the service configuration file includes the registration information of the microservice instance and the corresponding configuration center IP address and port; the registration information includes the environment name, service name, and service instance ID of the service instance.
  • the microservice instance client further includes a registration agent module, and the configuration supervision center further includes a registration information management module;
  • the registration agent module is configured to: according to the service configuration file, call the configuration center API interface to remotely register the registration information of the microservice instance with the configuration center;
  • the registration information management module is used to: start the polling task, call the configuration center API interface through the service communication module regularly, obtain the registration information of all environments, services and service instances in the system, save it in the cache and update it in real time; from the cache Obtain all registration information in the system, compose a list of corresponding environments, services, and service instances, and return it to the configuration management interface.
  • the configuration management module analyzes the current data and historical data of the configuration items in the database to obtain configuration item update information, which specifically includes the following steps:
  • If it is a rollback operation read the historical data of the specified rollback configuration item and the last released historical data of the configuration item from the database, compare the two to obtain the configuration level of the configuration item and update information of the configuration content, as the configuration Item update information.
  • the client proxy module is also used to: build a three-level configuration cache of environment, service, and service instance in the microservice instance; when the microservice instance receives the configuration item update information pushed by the configuration center, follow Configuration item configuration level, update the configuration item to the configuration cache of the corresponding level.
  • the client proxy module is also used to load the configuration from the three-level configuration cache of the microservice instance according to the priority of the service instance, service, and environment from high to low.
  • microservice instance After the microservice instance obtains the configuration, it uses a hierarchical cache to store the configuration, and reads it according to the priority of the service instance-service-environment, which avoids the conflict of configuration items with the same name in different levels of cache and improves The efficiency of system loading configuration;
  • the present invention has good scalability, and the coupling between the configuration supervision center, configuration center and microservice instance client in the system is low.
  • the service communication module and The polling request module and the registration agent module of the microservice instance client are extended to adapt to the API interface provided by the new configuration center, and the system can work normally, reducing development costs;
  • the present invention provides an effective historical configuration item query and configuration parameter rollback function of any historical version, which greatly reduces the loss caused by misoperation by operation and maintenance personnel and improves the ease of use of the configuration system.
  • FIG. 1 is a schematic diagram of the framework of a dynamic configuration system according to an embodiment of the present invention
  • FIG. 2 is a diagram of a hierarchical structure of a client cache of a microservice instance according to an embodiment of the invention
  • FIG. 3 is a schematic flowchart of a dynamic configuration management method under a microservice framework according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of the configuration release flow of the dynamic configuration management method under the microservice framework of the embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a configuration rollback flow diagram of a dynamic configuration management method under a microservice framework according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of a configuration cache reading flow diagram of a dynamic configuration management method under a microservice framework according to an embodiment of the present invention.
  • the embodiment of the present invention provides a dynamic configuration management method under a microservice framework, which includes the following steps:
  • the environment-level, service-level, and service-instance-level configuration root nodes are respectively established in the configuration center;
  • Obtain the service configuration file of each microservice instance define the path key of the environment-level, service-level, and service-instance-level root nodes according to the service configuration file, and send a long polling request to the configuration center; open the monitoring mechanism in the configuration center and use To monitor the update of all sub-node configuration items under the root node corresponding to the path key in the long polling request;
  • the monitoring mechanism of the configuration center monitors the configuration item update under the root node, it pushes the configuration item update information to the microservice instance client.
  • the service configuration file includes the registration information of the microservice instance and the corresponding IP address and port of the configuration center; the registration information includes the name of the environment to which the service instance belongs, the service name and the service instance ID.
  • the method further includes the following steps:
  • the analysis of the current data and historical data of the configuration items in the database to obtain configuration item update information specifically includes the following steps:
  • the method further includes the following steps: building a three-level configuration cache of environment, service, and service instance in the microservice instance;
  • the microservice instance When the microservice instance receives the configuration item update information pushed by the configuration center, it updates the configuration item to the configuration cache of the corresponding level according to the configuration item configuration level.
  • the method further includes the following step: when the configuration is read from the three-level configuration cache of the microservice instance, it is loaded in the order of priority of the service instance, service, and environment from high to low.
  • a dynamic configuration management method under a microservice framework in an embodiment of the present invention specifically includes the following steps:
  • the microservice instance defines the service configuration file, recording the service instance environment name, service name, service instance ID, service registration and configuration center IP address and port;
  • the microservice instance starts, the registration agent module reads the content of the configuration file, registers the IP address and port of the pre-configuration center according to the service registration, calls the remote interface of the configuration center, registers the service instance information, and the service registration information includes: the environment to which the service instance belongs Name, service name and service instance ID;
  • S3 Client-side proxy module construction environment-service-service instance three-level configuration cache
  • the client agent module defines the environment-level, service-level, and service-instance-level root node path keys according to the environment name, service name, and service instance ID recorded in the read configuration file, and sends long polling for each level of root node path Request to the configuration center;
  • the configuration center receives the request in step S3, and triggers the update monitoring mechanism of the sub-node configuration items under the key path for the environment-level, service-level, and service-instance-level root node path keys in the request;
  • S6 Start the configuration supervision center service process, the registration information management module periodically calls the configuration center API interface through the service communication module to obtain real-time registration information of all environments, services and service instances in the system, and save it in the cache;
  • the configuration management module on the configuration supervision center obtains all service registration information in the system from the cache, forms a list of corresponding environments, services, and service instances, and returns it to the configuration management interface;
  • S8 The user creates or modifies configuration items through the configuration management interface, binds them to the corresponding environment, service or service instance, and stores relevant information in the current configuration table of the database;
  • the configuration management module reads the current information of the configuration item from the database and compares and calculates the historical configuration data released by the configuration item to obtain the configuration item configuration level and configuration content update information;
  • the configuration management module reads the historical information of the specified rollback configuration item from the database and compares and calculates the historical configuration data released by the configuration item to obtain the configuration item configuration level and configuration content update information;
  • the configuration management module obtains the root node path key of the configuration to be updated according to the configuration information to be updated, redefines it in combination with the configuration item key, calls the service communication module, and synchronizes to the configuration center;
  • step S5 the configuration center monitoring mechanism is triggered, the root node path key or its sub-configuration items are detected to be updated, a long polling link is established through S4, and the configuration item updates are pushed to the corresponding microservice instance client;
  • the microservice instance client receives the configuration update, and the client proxy module updates the cache at the corresponding level in step S3 according to the configuration item configuration level, for reading and loading by other functional modules of the microservice instance.
  • the release operation for a specified configuration item in S9 involves the current configuration table of the database and the historical release configuration table.
  • the former records the current content of the configuration item: configuration item key value, configuration content, configuration level and last release history Version number
  • the latter records all historical release records of configuration items: configuration key value, configuration content, configuration level and historical version number.
  • the configuration management module extracts the configuration items to be released from the current configuration table, and reads the historical release records in the historical configuration table according to the latest release history version number recorded in the configuration items;
  • the configuration update content is synchronized to the configuration center.
  • the configuration management module records the latest historical release version number in the current configuration table, and reads the corresponding historical configuration items from the historical release configuration table;
  • the client proxy module module of the microservice instance client in S12 reads the configuration from the cache, and loads it in the order of service instance-service-environment, and priority from high to low.
  • the specific process is shown in S121 ⁇ in Figure 6 As shown in S126, the steps are as follows:
  • the embodiment of the present invention also provides a dynamic configuration management system under a microservice framework, including a microservice instance client, a configuration center, and a configuration supervision center:
  • Microservice instance client
  • the microservice instance client includes a client proxy module, which is used to: obtain the service configuration file of each microservice instance, define the environment-level, service-level, and service-instance-level root node path keys according to the service configuration file, and send a long round Inquiry request to configuration center;
  • the configuration center is responsible for storing service instance registration information and dynamic configuration parameters in the system; it can be third-party open source service components, such as consul, zookeeper, etcd, etc., which can be deployed and run independently through a high-availability cluster;
  • the configuration center includes a root node creation module and an update monitoring module, where:
  • the root node creation module is used to establish environment-level, service-level, and service-instance-level configuration root nodes in the configuration center respectively, for storing configuration items of corresponding levels;
  • the update monitoring module is used to: enable a monitoring mechanism in the configuration center to monitor the update of all sub-node configuration items under the root node corresponding to the path key in the long polling request; the monitoring mechanism monitors when there is a configuration item update under the root node , Push the configuration item update information to the microservice instance client;
  • the configuration monitoring center includes a service communication module and a configuration management module, wherein:
  • the service communication module is used to interact with the API interface provided by the configuration center;
  • the configuration management module is used to: obtain user operations on configuration items, bind the configuration item information to the corresponding environment, service or service instance, and save it in the database; analyze the current data and historical data of the configuration items in the database to obtain Configuration item update information, the configuration item update information is synchronized to the configuration center through the service communication module calling the configuration center API interface.
  • the service configuration file includes the registration information of the microservice instance and the corresponding IP address and port of the configuration center; the registration information includes the environment name, service name, and service instance ID of the service instance to which the service instance belongs.
  • the microservice instance client further includes a registration agent module
  • the configuration monitoring center further includes a registration information management module
  • the registration agent module is configured to: according to the service configuration file, call the configuration center API interface to remotely register the registration information of the microservice instance with the configuration center;
  • the registration information management module is used to: start the polling task, call the configuration center API interface through the service communication module regularly, obtain the registration information of all environments, services and service instances in the system, save it in the cache and update it in real time; from the cache Obtain all registration information in the system, compose a list of corresponding environments, services, and service instances, and return it to the configuration management interface.
  • the configuration management module analyzes the current data and historical data of the configuration items in the database to obtain configuration item update information, which specifically includes the following steps:
  • If it is a rollback operation read the historical data of the specified rollback configuration item and the last released historical data of the configuration item from the database, compare the two to obtain the configuration level of the configuration item and update information of the configuration content, as the configuration Item update information.
  • the client proxy module is also used to: build a three-level configuration cache of environment, service, and service instance in the microservice instance; when the microservice instance receives the configuration item update information pushed by the configuration center, it is configured according to the configuration item configuration level , Update the configuration items to the configuration cache of the corresponding level.
  • the client proxy module is further configured to: when reading the configuration from the three-level configuration cache of the microservice instance, load it according to the priority of the service instance, service, and environment from high to low.
  • the embodiments of the present application provide a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, all or some of the method steps of the dynamic configuration management method under the microservice framework are realized .
  • the present invention realizes all or part of the process in the dynamic configuration management method under the microservice framework, and can also be completed by instructing related hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms.
  • the computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access Memory (RAM, Random Access Memory), electric carrier signal, telecommunications signal, software distribution medium, etc.
  • computer-readable media can be appropriately added or deleted in accordance with the requirements of the legislation and patent practice in the jurisdiction.
  • computer-readable media does not include Electric carrier signal and telecommunications signal.
  • an embodiment of the present application also provides an electronic device, including a memory and a processor, the memory stores a computer program running on the processor, and the processor executes the computer program to implement a dynamic configuration management method under the microservice framework All method steps or part of method steps in.
  • the so-called processor can be a central processing unit (Central Processing Unit, CP U), other general-purpose processors, digital signal processors (Digital Signal Proc essor, DSP), application specific integrated circuits (ASIC) , Ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • the processor is the control center of the computer device and connects various parts of the entire computer device by various interfaces and lines.
  • the memory may be used to store computer programs and/or modules, and the processor implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory and calling data stored in the memory.
  • the memory may mainly include a storage program area and a storage data area, where the storage program area can store the operating system, at least one application program (such as sound playback function, image playback function, etc.) required by the function; the storage data area can be stored according to the mobile phone Use the created data (such as audio data, video data, etc.).
  • the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disks, memory, plug-in hard disks, smart media cards (SMC), and secure digital (SD) cards. , Flash Card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
  • the embodiments of the present invention can be provided as methods, systems, servers, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本发明公开了一种微服务框架下动态配置管理方法及系统,涉及微服务管理技术领域,本发明针对大型微服务项目中微服务实例数量庞大且依赖度高情况,用户通过配置监管中心的配置管理模块,对指定微服务实例的动态参数进行配置,用户体验好,提高了运维效率;且提供一种灵活的配置隔离与共享的模型,该模型能够实现环境、服务和服务实例级粒度的配置的共享与隔离,适配不同第三方配置中心K/V存储系统,在服务种类多且依赖复杂,服务实例数量庞大情况下,保证了微服务实例能够获取相应的公有与私有配置。

Description

一种微服务框架下动态配置管理方法及系统 技术领域
本发明涉及微服务管理技术领域,具体涉及一种微服务框架下动态配置管理方法及系统。
背景技术
随着移动互联网、云技术的不断发展,软件系统中应用程序复杂度加大,引导了微服务技术框架出现和不断完善,微服务技术将大型业务应用拆分为若干个小型微服务,每个微服务仅仅专注于单一职责功能,在单一进程独立部署运行,服务与服务之间采用轻量级通讯机制通信,耦合度非常低,易于开发和运维。
在微服务架构中,每个微服务都有自己依赖的业务配置,服务运行期间,服务配置往往需要根据实际运行环境进行动态调整。传统的服务配置管理方式是将配置信息保存在配置文件中和应用程序代码一起打包运行,一旦配置参数修改,需要重新打包运用并重启服务,降低了开发效率,增加了运维难度。
动态配置中心出现解决了这个问题,所有微服务配置都存储在配置中心进行管理,服务运行期间,从配置中心拉取相应配置。同时,当配置中心上配置参数发生变更时,会实时将配置更新推送至服务应用程序。配置中心解决了传统配置模式下无法应用无法动态加载配置的局限性,极大地提高了应用加载业务配置时效性。
在大型微服务项目中,每个项目都包含了不同环境,例如:开发、测试、生产等,每个环境都包含了多个服务,而一个服务又可以存在 多个服务实例。服务配置数据依照微服务体系结构,分为环境、服务、服务实例三个层次配置。实际应用中,服务往往会根据业务场景灵活地调整运行配置参数,也需要加载公共配置参数:配置数据可见性按照环境-服务-服务实例层次来实现,即环境级配置能够被该环境下所有服务共享,服务级配置能够被该服务所有服务实例共享;不同环境之间服务配置彼此隔离,同一环境不同服务之间的配置彼此隔离,同一环境和服务中服务实例之间的配置彼此隔离。
在这种情况下,单纯依靠现有第三方配置中心提解决方案,无法提供这种细颗粒度的配置管理机制,达到环境、服务和服务实例之间配置共享与隔离目的。现有技术及系统存在配置管理灵活度低,数据维护难度大等问题:
1、项目中服务类型多且依赖关系复杂,服务实例数量庞大,导致配置参数类型多而难于管理,运维人员需要手动对系统中环境、服务和服务实例配置进行管理,增加了运维开销;
2、各配置中心组件提供的可视化界面的操作入口、配置管理方式等等不尽相同,一旦配置中心组件发生迁移,需要维护人员重新熟悉新的配置中心的配置管理方式,维护成本高、难度大;
3、配置中心组件没有提供历史配置查询与恢复功能,一旦误操作导致错误配置的发布并被服务实例加载后,运维人员无法对其发布历史配置进行回溯查询并回滚指定历史配置记录,加大了运维难度。
发明内容
针对现有技术中存在的缺陷,本发明的目的在于提供一种微服务框架下动态配置管理方法及系统,实现环境、服务和服务实例级配置的共享与隔离,配置管理灵活度高,便于数据维护。
为达到以上目的,本发明采取的技术方案是:一种微服务框架下 动态配置管理方法,包括以下步骤:
在配置中心分别建立环境级、服务级和服务实例级配置根节点;
获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点的路径key,发送长轮询请求至配置中心;在配置中心开启监听机制,用于监听长轮询请求中路径key对应的根节点下所有子节点配置项的更新;
获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,将配置项更新信息同步至配置中心;
配置中心的监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端。
在上述方案的基础上,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
在上述方案的基础上,所述方法还包括以下步骤:
根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
启动轮询任务,定时调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;
从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
在上述方案的基础上,所述分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级 别和配置内容的更新信息,作为配置项更新信息;
如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
在上述方案的基础上,所述方法还包括以下步骤:在微服务实例中构建环境、服务、服务实例三级配置缓存;
微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
在上述方案的基础上,所述方法还包括以下步骤:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
本发明还提供一种微服务框架下动态配置管理系统,包括微服务实例客户端、配置中心和配置监管中心:
所述微服务实例客户端包括客户端代理模块,其用于:获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点路径key,发送长轮询请求至配置中心;
所述配置中心包括根节点创建模块和更新监听模块,其中:
所述根节点创建模块用于:在配置中心分别建立环境级、服务级和服务实例级配置根节点,用于存储对应级别的配置项;
所述更新监听模块用于:在配置中心开启监听机制,用于监听长轮询请求中路径key对应的根节点下所有子节点配置项的更新;监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端;
所述配置监管中心包括服务通讯模块和配置管理模块,其中:
所述服务通讯模块用于:与配置中心提供的API接口进行交互;
所述配置管理模块用于:获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,将配置项更新信息通过服务通讯模块调用配置中心API接口,同步至配置中心。
在上述方案的基础上,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
在上述方案的基础上,所述微服务实例客户端还包括注册代理模块,所述配置监管中心还包括注册信息管理模块;
所述注册代理模块用于:根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
所述注册信息管理模块用于:启动轮询任务,定时通过服务通讯模块调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
在上述方案的基础上,所述配置管理模块分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息;
如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
在上述方案的基础上,所述客户端代理模块还用于:在微服务实例中构建环境、服务、服务实例三级配置缓存;微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
在上述方案的基础上,所述客户端代理模块还用于:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
与现有技术相比,本发明的优点在于:
(1)针对大型微服务项目中微服务实例数量庞大且依赖度高情况,用户通过配置监管中心的配置管理模块,对指定微服务实例的动态参数进行配置,用户体验好,提高了运维效率;
(2)提供了一种灵活的配置隔离与共享的模型,该模型能够实现环境、服务和服务实例级粒度的配置的共享与隔离,适配不同第三方配置中心K/V存储系统,在服务种类多且依赖复杂,服务实例数量庞大情况下,保证了微服务实例能够获取相应的公有与私有配置;
(3)微服务实例获取配置后,采用分层缓存对配置进行存储,按照服务实例-服务-环境的优先级进行读取,即避免了不同级别缓存中同名配置项存在冲突的问题,提高了系统加载配置的效率;
(4)本发明具有良好扩展性,系统中配置监管中心、配置中心与微服务实例客户端三者之间耦合度低,对于不同配置中心迁移情况,仅需要对配置监管中心的服务通讯模块和微服务实例客户端的轮询请求模块、注册代理模块进行扩展,以适配新的配置中心提供的API接口,系统就可以正常工作,降低了开发成本;
(5)本发明提供了行之有效的针对历史配置项查询和任意历史版本配置参数回滚功能,极大减少了运维人员由于误操作带来的损 失,提高了配置系统易用性。
附图说明
图1为本发明实施例的动态配置系统框架示意图;
图2为本发明实施例的微服务实例客户端缓存分级结构图;
图3为本发明实施例的微服务框架下动态配置管理方法的流程示意图;
图4为本发明实施例的微服务框架下动态配置管理方法的配置发布的流程示意图;
图5为本发明实施例的微服务框架下动态配置管理方法的配置回滚的流程示意图;
图6为本发明实施例的微服务框架下动态配置管理方法的配置缓存读取的流程示意图。
具体实施方式
以下结合附图对本发明的实施例作进一步详细说明。
本发明实施例提供一种微服务框架下动态配置管理方法,包括以下步骤:
参见图1所示,在配置中心分别建立环境级、服务级和服务实例级配置根节点;
获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点的路径key,发送长轮询请求至配置中心;在配置中心开启监听机制,用于监听长轮询请求中路径key对应的根节点下所有子节点配置项的更新;
获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和 历史数据,得到配置项更新信息,将配置项更新信息同步至配置中心;
配置中心的监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端。
优选的,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
优选的,所述方法还包括以下步骤:
根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
启动轮询任务,定时调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;
从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
优选的,所述分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息;
如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
优选的,参见图2所示,所述方法还包括以下步骤:在微服务实例中构建环境、服务、服务实例三级配置缓存;
微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
优选的,所述方法还包括以下步骤:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
作为优选的实施方式,参见图3所示,本发明实施例中一种微服务框架下动态配置管理方法,具体包括以下步骤:
S1:微服务实例定义服务配置文件,记录服务实例环境名称、服务名称、服务实例ID、服务注册与配置中心IP地址与端口;
S2:微服务实例启动,注册代理模块读取配置文件内容,根据服务注册预配置中心IP地址与端口,调用的配置中心的远程接口,注册服务实例信息,服务注册信息包括:该服务实例所属环境名称、服务名称和服务实例ID;
S3:客户端代理模块构建环境--服务--服务实例三级配置缓存;
S4:客户端代理模块按照读取配置文件中记录的环境名称、服务名称和服务实例ID,定义环境级、服务级和服务实例级根节点路径key,对每个级别根节点路径发送长轮询请求至配置中心;
S5:配置中心收到步骤S3中请求,针对请求中环境级、服务级和服务实例级根节点路径key,触发key路径下子节点配置项更新监听机制;
S6:启动配置监管中心服务进程,注册信息管理模块通过服务通讯模块定时调用配置中心API接口,获取系统内所有环境、服务和服务实例的实时注册信息,保存至缓存中;
S7:配置监管中心上配置管理模块从缓存中获取到系统中所有服务注册信息,组成对应环境、服务和服务实例列表,返回给配置管理界面;
S8:用户通过配置管理界面,创建或修改配置项,绑定至相应环 境、服务或服务实例,相关信息存储至数据库当前配置表中;
S9:用户通过管理界面对指定配置项执行发布或回滚操作:
发布操作,配置管理模块从数据库中读取配置项当前信息和该配置项最近一次发布的历史配置数据进行比较计算,得到配置项配置级别和配置内容更新信息;
回滚操作,配置管理模块从数据库中读取指定回滚配置项历史信息和该配置项最近一次发布的历史配置数据进行比较计算,得到配置项配置级别和配置内容更新信息;
S10:配置管理模块根据配置待更新信息中,得到待更新配置根节点路径key,结合配置项key进行重定义,调用服务通讯模块,同步至配置中心;
S11:步骤S5中触发配置中心监听机制,检测到根节点路径key或其子配置项发生更新,通过S4建立长轮询链接,将配置项更新推送给对应的微服务实例客户端;
S12:微服务实例客户端收到配置更新,客户端代理模块按照配置项配置级别,更新存储至步骤S3对应级别的缓存,供微服务实例其他功能模块读取加载。
作为优选的实施方式,S9中针对指定配置项的发布操作,涉及数据库当前配置表和历史发布配置表,前者记录了配置项当前内容:配置项key值、配置内容、配置级别和最近一次发布历史版本号,后者记录了配置项所有历史发布记录:配置key值,配置内容、配置级别和历史版本号。具体流程如图4中S901~S909所示,步骤如下:
1、配置管理模块从当前配置表提取待发布配置项,根据配置项中记录的最近一次发布历史版本号,读取历史配置表中历史发布记录;
2、将待发布配置项和历史配置项的配置内容和配置级别进行比较,得到配置更新;
3、新建历史版本号和配置项历史发布记录,保存至历史发布配置表;
4、将当前配置项中的最近历史发布版本号更新为新建历史版本号;
5、配置更新内容被同步至配置中心。
作为优选的实施方式,S9中针对指定配置项回滚操作,具体流程如图5中S911~S917所示,步骤如下:
1、配置管理模块根据当前配置表中记录最近一次历史发布版本号,从历史发布配置表读取相应历史配置项;
2、将待回滚配置项和历史配置项的配置项内容和配置级别信息进行比较,得到配置更新内容;
3、将当前配置表配置项最近历史发布版本号更新为待回滚配置项历史版本号;
4、同步配置更新内容至配置中心。
作为优选的实施方式,S12中微服务实例客户端的客户端代理模块模块从缓存读取配置,按照服务实例-服务-环境、优先级由高到低的顺序加载,具体流程如图6中S121~S126所示,步骤如下:
1.服务实例级别缓存查找指定配置项key,
2.如果存在直接返回,否则查找服务级别缓存,
3.如果存在直接返回,否则查找环境级缓存。
本发明实施例还提供了一种微服务框架下动态配置管理系统,包括微服务实例客户端、配置中心和配置监管中心:
1、微服务实例客户端:
微服务实例客户端包括客户端代理模块,其用于:获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点路径key,发送长轮询请求至配置中心;
2、配置中心:
配置中心负责存储系统中服务实例注册信息和动态配置参数;可以为第三方开源服务组件,例如:consul、zookeeper,etcd等,通过高可用集群方式独立部署运行;
所述配置中心包括根节点创建模块和更新监听模块,其中:
所述根节点创建模块用于:在配置中心分别建立环境级、服务级和服务实例级配置根节点,用于存储对应级别的配置项;
所述更新监听模块用于:在配置中心开启监听机制,用于监听长轮询请求中路径key对应的根节点下所有子节点配置项的更新;监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端;
3、配置监管中心:
所述配置监管中心包括服务通讯模块和配置管理模块,其中:
所述服务通讯模块用于:与配置中心提供的API接口进行交互;
所述配置管理模块用于:获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,将配置项更新信息通过服务通讯模块调用配置中心API接口同步至配置中心。
优选的,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
优选的,所述微服务实例客户端还包括注册代理模块,所述配置 监管中心还包括注册信息管理模块;
所述注册代理模块用于:根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
所述注册信息管理模块用于:启动轮询任务,定时通过服务通讯模块调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
优选的,所述配置管理模块分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息;
如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
优选的,所述客户端代理模块还用于:在微服务实例中构建环境、服务、服务实例三级配置缓存;微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
优选的,所述客户端代理模块还用于:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
基于同一发明构思,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现微服务 框架下动态配置管理方法的所有方法步骤或部分方法步骤。
本发明实现上述微服务框架下动态配置管理方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质可以包括:能够携带计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
基于同一发明构思,本申请实施例还提供一种电子设备,包括存储器和处理器,存储器上储存有在处理器上运行的计算机程序,处理器执行计算机程序时实现微服务框架下动态配置管理方法中的所有方法步骤或部分方法步骤。
所称处理器可以是中央处理单元(Central Processing Unit,CP U),还可以是其他通用处理器、数字信号处理器(Digital Signal Proc essor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,处理器是计算机装置的控制中心,利用各种接口和线路连 接整个计算机装置的各个部分。
存储器可用于存储计算机程序和/或模块,处理器通过运行或执行存储在存储器内的计算机程序和/或模块,以及调用存储在存储器内的数据,实现计算机装置的各种功能。存储器可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、视频数据等)等。此外,存储器可以包括高速随机存取存储器,还可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、服务器或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、服务器和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (12)

  1. 一种微服务框架下动态配置管理方法,其特征在于,包括以下步骤:
    在配置中心分别建立环境级、服务级和服务实例级配置根节点;
    获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点的路径key,发送长轮询请求至配置中心;在配置中心开启监听机制,用于监听长轮询请求中路径key对应的根节点下所有子节点配置项的更新;
    获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,将配置项更新信息同步至配置中心;
    配置中心的监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端。
  2. 如权利要求1所述的方法,其特征在于,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
  3. 如权利要求2所述的方法,其特征在于,所述方法还包括以下步骤:
    根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
    启动轮询任务,定时调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;
    从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
  4. 如权利要求1所述的方法,其特征在于,所述分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
    如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息;
    如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
  5. 如权利要求1所述的方法,其特征在于,所述方法还包括以下步骤:在微服务实例中构建环境、服务、服务实例三级配置缓存;
    微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
  6. 如权利要求5所述的方法,其特征在于,所述方法还包括以下步骤:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
  7. 一种微服务框架下动态配置管理系统,其特征在于,包括微服务实例客户端、配置中心和配置监管中心:
    所述微服务实例客户端包括客户端代理模块,其用于:获取每个微服务实例的服务配置文件,根据所述服务配置文件定义环境级、服务级和服务实例级根节点路径key,发送长轮询请求至配置中心;
    所述配置中心包括根节点创建模块和更新监听模块,其中:
    所述根节点创建模块用于:在配置中心分别建立环境级、服务级和服务实例级配置根节点,用于存储对应级别的配置项;
    所述更新监听模块用于:在配置中心开启监听机制,用于监听长 轮询请求中路径key对应的根节点下所有子节点配置项的更新;监听机制监听到根节点下有配置项更新时,将配置项更新信息推送给微服务实例客户端;
    所述配置监管中心包括服务通讯模块和配置管理模块,其中:
    所述服务通讯模块用于:与配置中心提供的API接口进行交互;
    所述配置管理模块用于:获取用户对配置项的操作,将配置项信息绑定至相应的环境、服务或服务实例,并保存至数据库;分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,将配置项更新信息通过服务通讯模块调用配置中心API接口,同步至配置中心。
  8. 如权利要求7所述的系统,其特征在于,所述服务配置文件包括该微服务实例的注册信息以及对应的配置中心IP地址与端口;所述注册信息包括该服务实例所属环境名称、服务名称和服务实例ID。
  9. 如权利要求8所述的系统,其特征在于,所述微服务实例客户端还包括注册代理模块,所述配置监管中心还包括注册信息管理模块;
    所述注册代理模块用于:根据所述服务配置文件,调用配置中心API接口,向配置中心远程注册该微服务实例的注册信息;
    所述注册信息管理模块用于:启动轮询任务,定时通过服务通讯模块调用配置中心API接口,获取系统内所有环境、服务和服务实例的注册信息,保存在缓存中并实时更新;从缓存中获取到系统中所有注册信息,组成对应的环境、服务和服务实例的列表,返回给配置管理界面。
  10. 如权利要求7所述的系统,其特征在于,所述配置管理模块 分析数据库中配置项的当前数据和历史数据,得到配置项更新信息,具体包括以下步骤:
    如果是发布操作,从数据库中读取配置项的当前数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息;
    如果是回滚操作,从数据库中读取指定回滚配置项历史数据和该配置项最近一次发布的历史数据,二者进行比较计算,得到配置项的配置级别和配置内容的更新信息,作为配置项更新信息。
  11. 如权利要求7所述的系统,其特征在于,所述客户端代理模块还用于:在微服务实例中构建环境、服务、服务实例三级配置缓存;微服务实例收到配置中心推送的配置项更新信息时,按照配置项配置级别,更新配置项至对应级别的配置缓存。
  12. 如权利要求11所述的系统,其特征在于,所述客户端代理模块还用于:从微服务实例的三级配置缓存读取配置时,按照服务实例、服务、环境的优先级由高到低的顺序加载。
PCT/CN2019/096107 2019-05-31 2019-07-16 一种微服务框架下动态配置管理方法及系统 WO2020237797A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910472282.8 2019-05-31
CN201910472282.8A CN112019369A (zh) 2019-05-31 2019-05-31 一种微服务框架下动态配置管理方法及系统

Publications (1)

Publication Number Publication Date
WO2020237797A1 true WO2020237797A1 (zh) 2020-12-03

Family

ID=73506237

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096107 WO2020237797A1 (zh) 2019-05-31 2019-07-16 一种微服务框架下动态配置管理方法及系统

Country Status (2)

Country Link
CN (1) CN112019369A (zh)
WO (1) WO2020237797A1 (zh)

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112540838A (zh) * 2020-12-18 2021-03-23 南京中兴力维软件有限公司 系统资源调度方法及装置、计算机存储介质
CN112579319A (zh) * 2020-12-07 2021-03-30 中国民航信息网络股份有限公司 一种基于LRU Cache优化的服务调用方法及装置
CN112600936A (zh) * 2020-12-29 2021-04-02 山东省计算中心(国家超级计算济南中心) 一种云计算系统服务的量化和评估方法
CN112612804A (zh) * 2020-12-22 2021-04-06 新华三大数据技术有限公司 一种服务治理参数更新方法及装置
CN112711540A (zh) * 2021-01-11 2021-04-27 杭州萤石软件有限公司 一种应用的配置项的同步方法、装置、设备及存储介质
CN112764774A (zh) * 2020-12-31 2021-05-07 炬星科技(深圳)有限公司 一种制品信息管理方法、管理系统、电子设备及存储介质
CN112882738A (zh) * 2021-03-22 2021-06-01 亿企赢网络科技有限公司 一种微服务架构下的配置信息更新方法、装置及电子设备
CN112988274A (zh) * 2021-03-25 2021-06-18 北京滴普科技有限公司 微服务网关插件动态加载方法、装置、系统及其存储介质
CN113014433A (zh) * 2021-03-02 2021-06-22 电子科技大学 基于消息传播的服务注册发现方法
CN113114639A (zh) * 2021-03-29 2021-07-13 北京达佳互联信息技术有限公司 配置服务注册中心的方法、装置、电子设备及存储介质
CN113285849A (zh) * 2021-04-06 2021-08-20 武汉虹信科技发展有限责任公司 基于微服务的设备测试方法及装置
CN113342423A (zh) * 2021-06-29 2021-09-03 北京奇艺世纪科技有限公司 一种配置文件更新方法及装置
CN113364706A (zh) * 2021-06-03 2021-09-07 上海中通吉网络技术有限公司 服务流量集中的方法
CN113485767A (zh) * 2021-07-09 2021-10-08 绿盟科技集团股份有限公司 一种控制配置更新方法、系统及电子设备
CN113641678A (zh) * 2021-08-25 2021-11-12 杭州每刻科技有限公司 一种基于多维表单的动态服务配置方法和系统
CN113672371A (zh) * 2021-08-24 2021-11-19 广州华多网络科技有限公司 任务引擎执行方法及其装置、设备与介质
CN113691616A (zh) * 2021-08-23 2021-11-23 上海浦东发展银行股份有限公司 一种基于长轮询的微服务同步方法、装置及存储介质
CN113691599A (zh) * 2021-08-16 2021-11-23 银清科技有限公司 一种服务实例间数据同步的方法及装置
CN113992742A (zh) * 2021-09-17 2022-01-28 深圳云天励飞技术股份有限公司 接口接入方法、装置、设备及存储介质
CN114268533A (zh) * 2021-12-27 2022-04-01 山石网科通信技术股份有限公司 网络设备的配置同步方法及装置、存储介质
CN114301919A (zh) * 2021-12-30 2022-04-08 百融云创科技股份有限公司 一种基于Kubernetes的ICE框架改进方法
CN114356427A (zh) * 2022-01-06 2022-04-15 成都新希望金融信息有限公司 一种扫描过滤方法、装置、电子设备及存储介质
CN114465896A (zh) * 2022-03-30 2022-05-10 深信服科技股份有限公司 一种配置信息处理方法、装置、设备及可读存储介质
CN114547052A (zh) * 2022-02-14 2022-05-27 山东浪潮超高清视频产业有限公司 一种分布式系统缓存更新的方法
CN114650317A (zh) * 2020-12-15 2022-06-21 中国移动通信有限公司研究院 一种微服务系统以及微服务注册、发现和保活方法
CN114650318A (zh) * 2022-02-24 2022-06-21 阿里巴巴(中国)有限公司 开关推送方法
CN115061663A (zh) * 2022-06-17 2022-09-16 中国兵器工业信息中心 基于客户需求的微服务划分方法、装置、电子设备及介质
US11558250B2 (en) * 2019-07-29 2023-01-17 Microsoft Technology Licensing, Llc Configuration change control for computing environments
CN115757552A (zh) * 2022-11-29 2023-03-07 广发银行股份有限公司 基于分布式微服务的银行历史数据管理系统
CN115858012A (zh) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 程序变量配置方法、装置、电子设备及存储介质
CN115904361A (zh) * 2022-09-28 2023-04-04 建信金融科技有限责任公司 应用于微服务的数据处理方法、装置、设备和介质
CN116069264A (zh) * 2023-03-13 2023-05-05 南京飓风引擎信息技术有限公司 一种应用程序数据信息存储控制系统
CN116112403A (zh) * 2022-12-30 2023-05-12 中国电信股份有限公司 应用服务的云服务管理系统、方法、电子设备及存储介质
CN116136756A (zh) * 2023-04-18 2023-05-19 浪潮通用软件有限公司 一种基于分层结构的微服务组装方法、装置、设备及介质
CN116166756A (zh) * 2023-04-26 2023-05-26 浪潮通用软件有限公司 一种微服务应用数据的共享方法、装置及设备
CN116582872A (zh) * 2023-07-07 2023-08-11 北京集度科技有限公司 数据发送装置、方法、数据接收装置及存储介质
CN117255136A (zh) * 2023-11-15 2023-12-19 博泰车联网(南京)有限公司 一种路由方法、微服务系统、设备及存储介质
CN117278640A (zh) * 2023-09-05 2023-12-22 北京长河数智科技有限责任公司 一种基于数据归集的api接口调用方法及系统

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114840264A (zh) * 2021-01-14 2022-08-02 宝能汽车集团有限公司 配置数据管理方法、配置数据管理装置和车辆管理系统
CN113900727A (zh) * 2021-09-06 2022-01-07 浪潮软件股份有限公司 应用程序动态配置的对接系统及动态配置系统
CN114900511B (zh) * 2022-04-25 2023-02-03 湖南大学 工业机器人数据同步采集加载中间件装置及方法
CN114827277B (zh) * 2022-05-06 2023-12-01 北京思特奇信息技术股份有限公司 基于多机房容器部署的微服务系统及方法
CN114944986B (zh) * 2022-07-01 2024-05-28 中国邮政储蓄银行股份有限公司 服务隔离方法、装置和微服务系统
CN115905314B (zh) * 2022-11-04 2023-09-08 易保网络技术(上海)有限公司 配置数据处理方法、系统、设备及计算机可读存储介质
CN116389262B (zh) * 2023-06-02 2023-08-18 新华三技术有限公司 一种配置回滚方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107947960A (zh) * 2017-10-13 2018-04-20 用友网络科技股份有限公司 配置信息的推送方法及系统、配置信息的接收方法及系统
CN108540529A (zh) * 2018-03-07 2018-09-14 江苏电力信息技术有限公司 一种基于微服务架构下的不重启动态参数刷新方法
US20180329729A1 (en) * 2017-05-09 2018-11-15 Intel Corporation Software-defined microservices
CN109669703A (zh) * 2018-12-25 2019-04-23 鼎信信息科技有限责任公司 微服务信息配置方法、装置、计算机设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180329729A1 (en) * 2017-05-09 2018-11-15 Intel Corporation Software-defined microservices
CN107947960A (zh) * 2017-10-13 2018-04-20 用友网络科技股份有限公司 配置信息的推送方法及系统、配置信息的接收方法及系统
CN108540529A (zh) * 2018-03-07 2018-09-14 江苏电力信息技术有限公司 一种基于微服务架构下的不重启动态参数刷新方法
CN109669703A (zh) * 2018-12-25 2019-04-23 鼎信信息科技有限责任公司 微服务信息配置方法、装置、计算机设备和存储介质

Cited By (57)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11558250B2 (en) * 2019-07-29 2023-01-17 Microsoft Technology Licensing, Llc Configuration change control for computing environments
CN112579319A (zh) * 2020-12-07 2021-03-30 中国民航信息网络股份有限公司 一种基于LRU Cache优化的服务调用方法及装置
CN112579319B (zh) * 2020-12-07 2023-09-08 中国民航信息网络股份有限公司 一种基于LRU Cache优化的服务调用方法及装置
CN114650317A (zh) * 2020-12-15 2022-06-21 中国移动通信有限公司研究院 一种微服务系统以及微服务注册、发现和保活方法
CN112540838A (zh) * 2020-12-18 2021-03-23 南京中兴力维软件有限公司 系统资源调度方法及装置、计算机存储介质
CN112540838B (zh) * 2020-12-18 2024-04-09 南京中兴力维软件有限公司 系统资源调度方法及装置、计算机存储介质
CN112612804A (zh) * 2020-12-22 2021-04-06 新华三大数据技术有限公司 一种服务治理参数更新方法及装置
CN112600936B (zh) * 2020-12-29 2023-01-31 山东省计算中心(国家超级计算济南中心) 一种云计算系统服务的量化和评估方法
CN112600936A (zh) * 2020-12-29 2021-04-02 山东省计算中心(国家超级计算济南中心) 一种云计算系统服务的量化和评估方法
CN112764774A (zh) * 2020-12-31 2021-05-07 炬星科技(深圳)有限公司 一种制品信息管理方法、管理系统、电子设备及存储介质
CN112764774B (zh) * 2020-12-31 2024-05-14 炬星科技(深圳)有限公司 一种制品信息管理方法、管理系统、电子设备及存储介质
CN112711540A (zh) * 2021-01-11 2021-04-27 杭州萤石软件有限公司 一种应用的配置项的同步方法、装置、设备及存储介质
CN113014433A (zh) * 2021-03-02 2021-06-22 电子科技大学 基于消息传播的服务注册发现方法
CN112882738A (zh) * 2021-03-22 2021-06-01 亿企赢网络科技有限公司 一种微服务架构下的配置信息更新方法、装置及电子设备
CN112988274B (zh) * 2021-03-25 2023-01-31 北京滴普科技有限公司 微服务网关插件动态加载方法、装置、系统及其存储介质
CN112988274A (zh) * 2021-03-25 2021-06-18 北京滴普科技有限公司 微服务网关插件动态加载方法、装置、系统及其存储介质
CN113114639A (zh) * 2021-03-29 2021-07-13 北京达佳互联信息技术有限公司 配置服务注册中心的方法、装置、电子设备及存储介质
CN113114639B (zh) * 2021-03-29 2023-01-20 北京达佳互联信息技术有限公司 配置服务注册中心的方法、装置、电子设备及存储介质
CN113285849A (zh) * 2021-04-06 2021-08-20 武汉虹信科技发展有限责任公司 基于微服务的设备测试方法及装置
CN113285849B (zh) * 2021-04-06 2022-09-27 武汉虹信科技发展有限责任公司 基于微服务的设备测试方法及装置
CN113364706A (zh) * 2021-06-03 2021-09-07 上海中通吉网络技术有限公司 服务流量集中的方法
CN113342423A (zh) * 2021-06-29 2021-09-03 北京奇艺世纪科技有限公司 一种配置文件更新方法及装置
CN113342423B (zh) * 2021-06-29 2023-09-05 北京奇艺世纪科技有限公司 一种配置文件更新方法及装置
CN113485767A (zh) * 2021-07-09 2021-10-08 绿盟科技集团股份有限公司 一种控制配置更新方法、系统及电子设备
CN113691599A (zh) * 2021-08-16 2021-11-23 银清科技有限公司 一种服务实例间数据同步的方法及装置
CN113691616A (zh) * 2021-08-23 2021-11-23 上海浦东发展银行股份有限公司 一种基于长轮询的微服务同步方法、装置及存储介质
CN113672371A (zh) * 2021-08-24 2021-11-19 广州华多网络科技有限公司 任务引擎执行方法及其装置、设备与介质
CN113672371B (zh) * 2021-08-24 2024-05-17 广州华多网络科技有限公司 任务引擎执行方法及其装置、设备与介质
CN113641678A (zh) * 2021-08-25 2021-11-12 杭州每刻科技有限公司 一种基于多维表单的动态服务配置方法和系统
CN113992742A (zh) * 2021-09-17 2022-01-28 深圳云天励飞技术股份有限公司 接口接入方法、装置、设备及存储介质
CN113992742B (zh) * 2021-09-17 2023-10-10 深圳云天励飞技术股份有限公司 接口接入方法、装置、设备及存储介质
CN114268533A (zh) * 2021-12-27 2022-04-01 山石网科通信技术股份有限公司 网络设备的配置同步方法及装置、存储介质
CN114301919B (zh) * 2021-12-30 2024-04-05 百融云创科技股份有限公司 一种基于Kubernetes的ICE框架改进方法
CN114301919A (zh) * 2021-12-30 2022-04-08 百融云创科技股份有限公司 一种基于Kubernetes的ICE框架改进方法
CN114356427A (zh) * 2022-01-06 2022-04-15 成都新希望金融信息有限公司 一种扫描过滤方法、装置、电子设备及存储介质
CN114547052A (zh) * 2022-02-14 2022-05-27 山东浪潮超高清视频产业有限公司 一种分布式系统缓存更新的方法
CN114547052B (zh) * 2022-02-14 2024-03-22 山东浪潮超高清视频产业有限公司 一种分布式系统缓存更新的方法
CN114650318A (zh) * 2022-02-24 2022-06-21 阿里巴巴(中国)有限公司 开关推送方法
CN114650318B (zh) * 2022-02-24 2024-04-19 阿里巴巴(中国)有限公司 开关推送方法
CN114465896A (zh) * 2022-03-30 2022-05-10 深信服科技股份有限公司 一种配置信息处理方法、装置、设备及可读存储介质
CN115061663A (zh) * 2022-06-17 2022-09-16 中国兵器工业信息中心 基于客户需求的微服务划分方法、装置、电子设备及介质
CN115904361A (zh) * 2022-09-28 2023-04-04 建信金融科技有限责任公司 应用于微服务的数据处理方法、装置、设备和介质
CN115904361B (zh) * 2022-09-28 2023-09-22 建信金融科技有限责任公司 应用于微服务的数据处理方法、装置、设备和介质
CN115757552A (zh) * 2022-11-29 2023-03-07 广发银行股份有限公司 基于分布式微服务的银行历史数据管理系统
CN116112403A (zh) * 2022-12-30 2023-05-12 中国电信股份有限公司 应用服务的云服务管理系统、方法、电子设备及存储介质
CN115858012B (zh) * 2022-12-30 2023-10-20 广州市易鸿智能装备有限公司 程序变量配置方法、装置、电子设备及存储介质
CN115858012A (zh) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 程序变量配置方法、装置、电子设备及存储介质
CN116112403B (zh) * 2022-12-30 2024-05-14 中国电信股份有限公司 应用服务的云服务管理系统、方法、电子设备及存储介质
CN116069264A (zh) * 2023-03-13 2023-05-05 南京飓风引擎信息技术有限公司 一种应用程序数据信息存储控制系统
CN116136756A (zh) * 2023-04-18 2023-05-19 浪潮通用软件有限公司 一种基于分层结构的微服务组装方法、装置、设备及介质
CN116166756A (zh) * 2023-04-26 2023-05-26 浪潮通用软件有限公司 一种微服务应用数据的共享方法、装置及设备
CN116582872B (zh) * 2023-07-07 2023-09-15 北京集度科技有限公司 数据发送装置、方法、数据接收装置及存储介质
CN116582872A (zh) * 2023-07-07 2023-08-11 北京集度科技有限公司 数据发送装置、方法、数据接收装置及存储介质
CN117278640A (zh) * 2023-09-05 2023-12-22 北京长河数智科技有限责任公司 一种基于数据归集的api接口调用方法及系统
CN117278640B (zh) * 2023-09-05 2024-05-17 北京长河数智科技有限责任公司 一种基于数据归集的api接口调用方法及系统
CN117255136A (zh) * 2023-11-15 2023-12-19 博泰车联网(南京)有限公司 一种路由方法、微服务系统、设备及存储介质
CN117255136B (zh) * 2023-11-15 2024-02-27 博泰车联网(南京)有限公司 一种路由方法、微服务系统、设备及存储介质

Also Published As

Publication number Publication date
CN112019369A (zh) 2020-12-01

Similar Documents

Publication Publication Date Title
WO2020237797A1 (zh) 一种微服务框架下动态配置管理方法及系统
US8788254B2 (en) Monitoring and control of contact centers with dynamic temporal dimension
US11514076B2 (en) Cooperative naming for configuration items in a distributed configuration management database environment
US20200285514A1 (en) Automated reconfiguration of real time data stream processing
US8612406B1 (en) Sharing business data across networked applications
US11481408B2 (en) Event driven extract, transform, load (ETL) processing
US9336288B2 (en) Workflow controller compatibility
KR101548003B1 (ko) 서비스 지향 파이프라인 기반 아키택쳐
US8023934B2 (en) Synchronizing communications and data between mobile devices and servers
CN109960710A (zh) 数据库之间的数据同步方法和系统
US20200274764A1 (en) Network slice management
CN105653425A (zh) 基于复杂事件处理引擎的监控系统
WO2012151912A1 (zh) 内存数据库对数据的操作方法及装置
CN112417051A (zh) 容器编排引擎资源管理方法及装置、可读介质及电子设备
US20210182267A1 (en) Watermark-based techniques for change-data-capture
WO2020258666A1 (zh) 一种分布式系统及数据处理方法
CN104901998B (zh) 一体化云服务监控方法
CN112860343A (zh) 配置变更方法、系统、装置、电子设备以及存储介质
CN116303516A (zh) 一种更新知识图谱的方法、装置及相关设备
CN105871659A (zh) 新增服务器的监控方法及装置
US20230195543A1 (en) Application programming interface (api) server for correlation engine and policy manager (cpe), method and computer program product
CN112711466B (zh) 悬挂事务巡检方法和装置、电子设备和存储介质
CN113010385B (zh) 一种任务状态更新方法、装置、设备及介质
WO2023136847A1 (en) Correlation engine and policy manager (cpe), method and computer program product
CN115037757A (zh) 一种多集群服务管理系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19931379

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19931379

Country of ref document: EP

Kind code of ref document: A1