[go: up one dir, main page]

CN118819685A - Method, system, device, product and medium for obtaining configuration information of application program - Google Patents

Method, system, device, product and medium for obtaining configuration information of application program Download PDF

Info

Publication number
CN118819685A
CN118819685A CN202411311300.1A CN202411311300A CN118819685A CN 118819685 A CN118819685 A CN 118819685A CN 202411311300 A CN202411311300 A CN 202411311300A CN 118819685 A CN118819685 A CN 118819685A
Authority
CN
China
Prior art keywords
environment
application
configuration information
tag
configuration
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.)
Granted
Application number
CN202411311300.1A
Other languages
Chinese (zh)
Other versions
CN118819685B (en
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.)
Alibaba Cloud Computing Ltd
Original Assignee
Alibaba Cloud Computing 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 Alibaba Cloud Computing Ltd filed Critical Alibaba Cloud Computing Ltd
Priority to CN202411311300.1A priority Critical patent/CN118819685B/en
Publication of CN118819685A publication Critical patent/CN118819685A/en
Application granted granted Critical
Publication of CN118819685B publication Critical patent/CN118819685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a method, a system, equipment, a product and a medium for acquiring configuration information of an application program, and relates to the technical field of cloud computing, wherein the method comprises the following steps: the service agent component obtains a query request of configuration information of the application program and obtains an environment grouping strategy of the application program from the application management and control platform; determining an environment label corresponding to the application program based on the environment grouping strategy; adding the environment label into the query request, and sending the query request added with the environment label to a configuration center so that the configuration center obtains configuration information corresponding to the environment label; and receiving configuration information corresponding to the environment label sent by the configuration center and returning the configuration information to the application program. In the embodiment, the service agent component realizes the self-perception of the environment label, avoids the manual parameter configuration of the application program, reduces the complexity of different environment configuration of the application program, and improves the application configuration efficiency.

Description

应用程序的配置信息获取方法、系统、设备、产品及介质Method, system, device, product and medium for obtaining configuration information of application program

技术领域Technical Field

本申请涉及云计算技术领域,尤其涉及一种应用程序的配置信息获取方法、系统、设备、产品及介质。The present application relates to the field of cloud computing technology, and in particular to a method, system, device, product and medium for obtaining configuration information of an application.

背景技术Background Art

云原生应用通常有统一的配置中心进行配置管理,通常情况下应用订阅的配置信息由应用中的环境变量或参数进行控制,相同发布方式的应用会使用相同的配置。但随着云原生应用编排能力的增强,越来越多元化的底层云资源均能够被云管控纳管,用于作为应用部署的基础设施。在复杂的基础设施场景下,不同环境中期望应用使用不同的配置版本。Cloud-native applications usually have a unified configuration center for configuration management. Usually, the configuration information subscribed by the application is controlled by the environment variables or parameters in the application, and applications with the same release method will use the same configuration. However, with the enhancement of cloud-native application orchestration capabilities, more and more diversified underlying cloud resources can be managed by cloud management and control and used as the infrastructure for application deployment. In complex infrastructure scenarios, applications in different environments are expected to use different configuration versions.

相关技术中,通过参数设置订阅指定版本的配置信息,配置信息与启动参数或环境变量强关联,由应用运维部署人员对不同环境的应用指定变量,通过人工操作实现配置信息的版本管理。然而,使用这种方式配置应用的版本,依赖于运维人员人工配置参数,不同环境中的应用需要做不同的参数配置,相同环境中的应用需要做相同的参数配置,这样由人工进行应用的参数配置存在运维管理复杂度高,配置效率低下的问题。In the related art, the configuration information of the specified version is subscribed through parameter settings. The configuration information is strongly associated with the startup parameters or environment variables. The application operation and maintenance deployment personnel specify variables for applications in different environments, and the version management of the configuration information is achieved through manual operations. However, using this method to configure the application version depends on the manual configuration of parameters by the operation and maintenance personnel. Applications in different environments need to have different parameter configurations, and applications in the same environment need to have the same parameter configurations. In this way, the manual parameter configuration of applications has the problems of high complexity of operation and maintenance management and low configuration efficiency.

发明内容Summary of the invention

本申请实施例提供了一种应用程序的配置信息获取方法、系统、设备、产品及介质,以降低应用程序的不同环境配置的复杂度,提高应用配置效率。The embodiments of the present application provide a method, system, device, product and medium for obtaining configuration information of an application program, so as to reduce the complexity of configuring different environments of the application program and improve the efficiency of application configuration.

第一方面,本申请实施例提供了一种应用程序的配置信息获取方法,该方法应用于服务代理组件,包括:获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。In the first aspect, an embodiment of the present application provides a method for obtaining configuration information of an application, which is applied to a service proxy component, and includes: obtaining a query request for the configuration information of the application, and obtaining the environment grouping strategy of the application from an application management and control platform; based on the environment grouping strategy, determining the environment tag corresponding to the application; adding the environment tag to the query request, and sending the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receiving the configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application.

第二方面,本申请实施例提供了一种应用程序的配置信息获取方法,该方法应用于应用管控平台,包括:获取应用程序的环境分组策略;将环境分组策略发送至服务代理组件,以使服务代理组件基于环境分组策略,确定应用程序对应的环境标签,环境标签用于从配置中心获取配置信息。In the second aspect, an embodiment of the present application provides a method for obtaining configuration information of an application, which is applied to an application management and control platform, including: obtaining the environment grouping strategy of the application; sending the environment grouping strategy to a service agent component so that the service agent component determines the environment tag corresponding to the application based on the environment grouping strategy, and the environment tag is used to obtain configuration information from a configuration center.

第三方面,本申请实施例提供了一种应用程序的配置信息获取方法,该方法应用于配置中心,包括:在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件,以使服务代理组件将目标配置信息发送至应用程序。In a third aspect, an embodiment of the present application provides a method for obtaining configuration information of an application, which is applied to a configuration center, comprising: upon receiving a query request for target configuration information of an application sent by a service proxy component, obtaining a target environment tag of the target configuration information from the query request; the target environment tag is determined by the service proxy component based on the environment grouping policy sent by an application management and control platform; based on the target environment tag, determining the target configuration information from multiple configuration information of the application with environment tags and sending it to the service proxy component, so that the service proxy component sends the target configuration information to the application.

第四方面,本申请实施例提供了一种应用程序的配置信息获取系统,该系统包括服务代理组件、应用管控平台和配置中心;应用管控平台,用于获取应用程序的环境分组策略;将环境分组策略发送至服务代理组件;服务代理组件,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序;配置中心,用于在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件。In a fourth aspect, an embodiment of the present application provides a system for acquiring configuration information of an application, the system comprising a service proxy component, an application management and control platform, and a configuration center; the application management and control platform is used to acquire the environment grouping strategy of the application; the environment grouping strategy is sent to the service proxy component; the service proxy component is used to obtain a query request for the configuration information of the application, and acquire the environment grouping strategy of the application from the application management and control platform; based on the environment grouping strategy, determine the environment tag corresponding to the application; add the environment tag to the query request, and send the query request with the environment tag added to the configuration center; receive the configuration information corresponding to the environment tag sent by the configuration center, and return it to the application; the configuration center is used to, upon receiving a query request for the target configuration information of the application sent by the service proxy component, acquire the target environment tag of the target configuration information from the query request; the target environment tag is determined by the service proxy component based on the environment grouping strategy sent by the application management and control platform; based on the target environment tag, determine the target configuration information from multiple configuration information with environment tags of the application and send it to the service proxy component.

第五方面,本申请实施例提供了一种应用程序的配置信息获取方法,该方法应用于服务代理组件,包括:获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。In the fifth aspect, an embodiment of the present application provides a method for obtaining configuration information of an application, which is applied to a service proxy component, and includes: obtaining a query request for the configuration information of the application, and obtaining an environment tag corresponding to the application from an application management and control platform; adding the environment tag to the query request, and sending the query request with the added environment tag to a configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receiving the configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application.

第六方面,本申请实施例提供了一种应用程序的配置信息获取方法,该方法应用于应用管控平台,包括:获取应用程序的环境分组策略;根据环境分组策略,确定应用程序对应的环境标签;将环境标签发送至服务代理组件,以使服务代理组件根据环境标签从配置中心获取配置信息。In the sixth aspect, an embodiment of the present application provides a method for obtaining configuration information of an application, which is applied to an application management and control platform, including: obtaining the environment grouping strategy of the application; determining the environment tag corresponding to the application based on the environment grouping strategy; sending the environment tag to the service agent component, so that the service agent component obtains configuration information from the configuration center based on the environment tag.

第七方面,本申请实施例提供了一种应用程序的配置信息获取系统,该系统包括服务代理组件、应用管控平台和配置中心;应用管控平台,用于获取应用程序的环境分组策略;根据环境分组策略,确定应用程序对应的环境标签;将环境标签发送至服务代理组件;服务代理组件,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序;配置中心,用于在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件。In the seventh aspect, an embodiment of the present application provides a system for obtaining configuration information of an application, the system comprising a service proxy component, an application management and control platform, and a configuration center; the application management and control platform is used to obtain the environment grouping strategy of the application; according to the environment grouping strategy, the environment tag corresponding to the application is determined; the environment tag is sent to the service proxy component; the service proxy component is used to obtain a query request for the configuration information of the application, obtain the environment tag corresponding to the application from the application management and control platform; add the environment tag to the query request, and send the query request with the environment tag added to the configuration center; receive the configuration information corresponding to the environment tag sent by the configuration center, and return it to the application; the configuration center is used to obtain the target environment tag of the target configuration information from the query request when receiving a query request for the target configuration information of the application sent by the service proxy component; based on the target environment tag, determine the target configuration information from multiple configuration information with environment tags of the application and send it to the service proxy component.

第八方面,本申请实施例提供了一种电子设备,包括存储器、处理器及存储在存储器上的计算机程序,处理器在执行计算机程序时实现上述任一项的方法。In an eighth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor implements any of the above methods when executing the computer program.

第九方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质内存储有计算机程序,计算机程序被处理器执行时实现上述任一项的方法。In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above methods is implemented.

第十方面,本申请实施例提供了一种计算机程序产品,计算机程序产品包括计算机程序,计算机程序被处理器执行时实现上述任一项的方法。In a tenth aspect, an embodiment of the present application provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the computer program implements any of the above methods.

与现有技术相比,本申请具有如下优点:Compared with the prior art, this application has the following advantages:

本申请提供了一种应用程序的配置信息获取方法、系统、设备、产品及介质,服务代理组件获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。本实施例中,利用服务代理组件从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。The present application provides a method, system, device, product and medium for obtaining configuration information of an application. A service proxy component obtains a query request for configuration information of an application, obtains the environment grouping strategy of the application from an application management and control platform; based on the environment grouping strategy, determines the environment tag corresponding to the application; adds the environment tag to the query request, and sends the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application. In this embodiment, a service proxy component is used to obtain the environment grouping strategy of the application from the application management and control platform; based on the environment grouping strategy, the environment tag corresponding to the application is determined, and configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. Self-perception of the environment tag is achieved through the service proxy component, which avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

本申请提供了一种应用程序的配置信息获取方法、系统、设备、产品及介质,服务代理组件从应用管控平台获取应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。本实施例中,利用服务代理组件从应用管控平台获取应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。The present application provides a method, system, device, product and medium for obtaining configuration information of an application. The service proxy component obtains the environment tag corresponding to the application from the application management and control platform; adds the environment tag to the query request, and sends the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application. In this embodiment, the service proxy component is used to obtain the environment tag corresponding to the application from the application management and control platform, and the configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. The service proxy component realizes self-awareness of the environment tag, avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,可依照说明书的内容予以实施,并且为了让本申请的上述和其他目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

在附图中,除非另外规定,否则贯穿多个附图相同的附图标记表示相同或相似的部件或元素。这些附图不一定是按照比例绘制的。应该理解,这些附图仅描绘了根据本申请的一些实施方式,而不应将其视为是对本申请范围的限制。In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments according to the present application and should not be regarded as limiting the scope of the present application.

图1为本申请一实施例的配置实体模型的示意图。FIG. 1 is a schematic diagram of a configuration entity model according to an embodiment of the present application.

图2为本申请一实施例的应用程序的配置信息获取方法的一个应用场景的示意图。FIG. 2 is a schematic diagram of an application scenario of a method for acquiring configuration information of an application program according to an embodiment of the present application.

图3为本申请一实施例的应用程序的配置信息获取方法的流程图。FIG. 3 is a flowchart of a method for acquiring configuration information of an application according to an embodiment of the present application.

图4为本申请一实施例的应用程序的配置信息获取方法的流程图。FIG. 4 is a flowchart of a method for acquiring configuration information of an application program according to an embodiment of the present application.

图5为本申请一实施例的应用程序的配置信息获取方法的流程图。FIG. 5 is a flowchart of a method for acquiring configuration information of an application according to an embodiment of the present application.

图6为本申请一实施例的应用程序的配置信息获取方法的流程图。FIG. 6 is a flowchart of a method for acquiring configuration information of an application according to an embodiment of the present application.

图7为本申请一实施例的应用程序的配置信息获取方法的流程图。FIG. 7 is a flowchart of a method for acquiring configuration information of an application according to an embodiment of the present application.

图8为本申请一实施例的应用程序的配置信息获取装置的结构框图。FIG8 is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.

图9为本申请一实施例的应用程序的配置信息获取装置的结构框图。FIG. 9 is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.

图10为本申请一实施例的应用程序的配置信息获取装置的结构框图。FIG. 10 is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.

图11为本申请一实施例的应用程序的配置信息获取装置的结构框图。FIG. 11 is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.

图12为本申请一实施例的应用程序的配置信息获取装置的结构框图。FIG. 12 is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.

图13为用来实现本申请实施例的电子设备的框图。FIG. 13 is a block diagram of an electronic device used to implement an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

在下文中,仅简单地描述了某些示例性实施例。正如本领域技术人员可认识到的那样,在不脱离本申请的构思或范围的情况下,可通过各种不同方式修改所描述的实施例。因此,附图和描述被认为本质上是示例性的,而非限制性的。In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the concept or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary in nature and not restrictive.

为便于理解本申请实施例的技术方案,以下对本申请实施例的相关技术进行说明。以下相关技术作为可选方案与本申请实施例的技术方案可以进行任意结合,其均属于本申请实施例的保护范围。To facilitate understanding of the technical solutions of the embodiments of the present application, the following describes the related technologies of the embodiments of the present application. The following related technologies can be combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

本申请实施的具体应用场景可以包括应用程序灰度发布、应用程序按规格订阅配置等。Specific application scenarios implemented in this application may include grayscale release of applications, subscription configuration of applications according to specifications, etc.

在应用灰度发布场景中,配置中心接受用户发布的应用程序灰度分组策略,灰度分组的应用程序订阅新版本的配置信息,非灰度分组仍然保持订阅默认版本的配置信息。应用程序的服务代理组件自感知当前环境分组标签,动态订阅灰度分组的配置信息,并在验证完成后动态调整订阅目标为默认配置信息。In the application grayscale release scenario, the configuration center accepts the grayscale grouping strategy of the application published by the user. The grayscale grouped applications subscribe to the configuration information of the new version, and the non-grayscale grouping still subscribes to the configuration information of the default version. The service proxy component of the application self-awares the current environment grouping label, dynamically subscribes to the configuration information of the grayscale grouping, and dynamically adjusts the subscription target to the default configuration information after verification is completed.

在应用程序按规格订阅配置的场景中,微服务应用场景下批量应用程序针对特定环境差异订阅不同的配置信息,比如不同规格的应用程序配置不同的连接池、并发度等应用参数。相关技术中,配置信息获取强依赖于应用程序的代码,规格变更后还需要联动调整程序代码。本申请实施例可以实现环境自感知当前环境规格,动态调整订阅的配置文件的目标规格,应用程序进行规格升降级时,无需再人工调整应用程序的环境配置。In the scenario where applications subscribe to configurations based on specifications, batch applications in microservice application scenarios subscribe to different configuration information based on specific environment differences. For example, applications of different specifications configure different connection pools, concurrency and other application parameters. In the related art, configuration information acquisition is strongly dependent on the application code, and program code needs to be adjusted in conjunction after the specification changes. The embodiments of the present application can realize the self-awareness of the current environment specifications by the environment, dynamically adjust the target specifications of the subscribed configuration files, and there is no need to manually adjust the environment configuration of the application when the application is upgraded or downgraded.

图1为本申请一实施例的配置实体模型的示意图。在配置中心创建配置实体模型,配置中心接收应用程序的配置信息,配置信息包括多个配置实体,每个配置实体中包括配置的名称、命名空间和配置内容(如图1所示的“标签配置内容”和“默认配置内容”),每个配置实体的配置内容中包括多个配置项(图1中未示出)。其中,命名空间用于做环境隔离,不同的命名空间下可以存在名称相同的容器。配置实体的配置内容包括标签配置内容和默认配置内容。标签配置内容中包括名称、命名空间、环境标签和具体的配置项。默认配置内容中包括名称、命名空间和具体的配置项。其中,默认配置内容部分用于保存不带环境标签的配置内容,并用于在订阅不存在环境标签的配置时作为默认返回的配置内容;带环境标签的配置内容部分,用于存储用户发布的带有环境标签的配置内容。FIG1 is a schematic diagram of a configuration entity model of an embodiment of the present application. A configuration entity model is created in a configuration center, and the configuration center receives configuration information of an application. The configuration information includes multiple configuration entities, each of which includes a configuration name, a namespace, and configuration content (such as "label configuration content" and "default configuration content" as shown in FIG1 ), and the configuration content of each configuration entity includes multiple configuration items (not shown in FIG1 ). Among them, the namespace is used for environmental isolation, and containers with the same name can exist under different namespaces. The configuration content of the configuration entity includes label configuration content and default configuration content. The label configuration content includes a name, a namespace, an environment label, and specific configuration items. The default configuration content includes a name, a namespace, and specific configuration items. Among them, the default configuration content part is used to save configuration content without an environment label, and is used as the default returned configuration content when subscribing to a configuration without an environment label; the configuration content part with an environment label is used to store configuration content with an environment label published by the user.

图2为本申请一实施例的应用程序的配置信息获取方法的一个应用场景的示意图。其中,配置中心、应用管控平台、分组(服务代理和应用),可以部署在同一台设备上,也可以分别部署在不同的设备上。应用程序的配置信息获取方法包括以下步骤:FIG2 is a schematic diagram of an application scenario of a method for obtaining configuration information of an application program according to an embodiment of the present application. The configuration center, the application management and control platform, and the group (service agent and application) can be deployed on the same device or on different devices. The method for obtaining configuration information of an application program includes the following steps:

1. 更新配置并设置标签。具体的,接收用户调用配置中心的接口或直接使用配置中心的前端页面(如图2所示的“控制面”)输入的配置更新指令,更新配置信息时,为配置信息增加标签选项。例如,为配置信息A打上标签test,表示用于测试环境。1. Update the configuration and set the label. Specifically, receive the configuration update instruction input by the user by calling the configuration center interface or directly using the front-end page of the configuration center (such as the "control plane" shown in Figure 2), and add label options to the configuration information when updating the configuration information. For example, label configuration information A with test to indicate that it is used in the test environment.

2. 配置存储。具体的,配置中心为配置增加标签项后,虽然配置的名称和命名空间相同,但是由于环境标签不同,在存储时可以保存为多份数据存储。比如,若利用数据库存储,带环境标签和不带环境标签的配置信息可以分别存储在不同的数据表中;若利用本地目录文件存储,带环境标签和不带环境标签的配置信息可以分不同的目录文件存储。2. Configuration storage. Specifically, after the configuration center adds a tag item to the configuration, although the configuration name and namespace are the same, due to different environment tags, it can be saved as multiple data stores during storage. For example, if a database is used for storage, configuration information with and without environment tags can be stored in different data tables; if a local directory file is used for storage, configuration information with and without environment tags can be stored in different directory files.

3. 分组策略下发、环境打标。用户通过应用管控平台发布应用分组策略,即应用管控平台获取环境分组策略,并将环境分组策略发送至服务代理组件,可以按照不同地域、不同可用区、不同宿主机版本等不同环境对应用程序进行环境分组。3. Grouping strategy issuance and environment labeling. Users publish application grouping strategies through the application management and control platform. That is, the application management and control platform obtains the environment grouping strategy and sends it to the service proxy component. Applications can be grouped according to different environments such as different regions, different availability zones, and different host versions.

另外,若按照多个维度确定环境分组策略,可以设置环境分组策略的优先级。根据环境分组策略的优先级,来确定环境标签的优先级,优先级高的环境标签的配置信息优先生效。In addition, if you determine the environment grouping strategy based on multiple dimensions, you can set the priority of the environment grouping strategy. According to the priority of the environment grouping strategy, the priority of the environment tag is determined, and the configuration information of the environment tag with a higher priority takes effect first.

可选的,应用管控平台与服务代理组件通信,应用管控平台可以将环境分组策略直接发送至服务代理组件,服务代理组件可以获取环境信息,根据环境分组策略和环境信息,确定环境标签。Optionally, the application management and control platform communicates with the service proxy component. The application management and control platform can send the environment grouping strategy directly to the service proxy component. The service proxy component can obtain the environment information and determine the environment label according to the environment grouping strategy and the environment information.

可选的,应用管控平台还可以根据环境分组策略确定环境标签,具体包括以下两种实现方式:一种方式是应用管控平台在创建应用程序时,根据环境分组策略计算应用程序对应的环境标签,并直接添加到应用程序中,例如,通过为应用程序所在容器配置标签,将容器标签附加到容器镜像或容器运行时实例上、在容器中添加环境变量、在容器中挂载配置文件等方式将环境标签添加到应用程序中,服务代理组件通过直接识别容器的标签、环境变量、指定路径配置等方式,获取应用程序的环境标签;另一种实现方式为应用管控平台创建应用程序后,服务代理组件向应用管控平台发送环境标签的查询请求,应用管控平台接收到查询请求之后,根据环境分组策略实时计算应用程序当前对应的环境标签,再发送给服务代理组件。例如,灰度发布时,应用程序之前属于灰度发布的分组,灰度发布之后,不再属于灰度发布的分组,则实时计算的环境标签发生变化。Optionally, the application management and control platform can also determine the environment label according to the environment grouping strategy, which specifically includes the following two implementation methods: one method is that when the application management and control platform creates an application, it calculates the environment label corresponding to the application according to the environment grouping strategy and directly adds it to the application. For example, by configuring labels for the container where the application is located, attaching the container label to the container image or container runtime instance, adding environment variables in the container, mounting configuration files in the container, etc., the environment label is added to the application. The service proxy component obtains the environment label of the application by directly identifying the container label, environment variables, specifying the path configuration, etc.; another implementation method is that after the application management and control platform creates the application, the service proxy component sends a query request for the environment label to the application management and control platform. After receiving the query request, the application management and control platform calculates the current environment label corresponding to the application in real time according to the environment grouping strategy, and then sends it to the service proxy component. For example, when grayscale is released, if the application previously belongs to the grayscale release group, and after the grayscale release, it no longer belongs to the grayscale release group, then the real-time calculated environment label changes.

4. 分组环境感知。服务代理组件代理应用程序的配置信息的查询请求。应用程序发起配置信息查询请求时,服务代理组件拦截查询请求。服务代理组件可以包括:JavaAgent代理组件(用Java语言编写的具有代理功能的程序)、应用引用依赖的软件开发工具包(Software Development Kit,SDK)、边车容器(sidecar container)等。比如,针对Java应用获取配置信息时,服务代理组件可以是针对配置中心查询接口做了增强的JavaAgent;针对应用获取容器管理平台kubernetes环境中的配置信息时,服务代理组件可以是拦截超文本传输协议(Hypertext Transfer Protocol,HTTP)请求的网络代理组件。服务代理组件拦截到配置信息的查询请求后,获取环境标签,并在查询请求中添加环境标签。4. Group environment awareness. The service proxy component proxies the query request for the configuration information of the application. When the application initiates a query request for configuration information, the service proxy component intercepts the query request. The service proxy component may include: JavaAgent proxy component (a program with proxy function written in Java language), Software Development Kit (SDK) that the application references and depends on, sidecar container, etc. For example, when obtaining configuration information for a Java application, the service proxy component may be a JavaAgent that has been enhanced for the query interface of the configuration center; when obtaining configuration information in the container management platform Kubernetes environment for an application, the service proxy component may be a network proxy component that intercepts Hypertext Transfer Protocol (HTTP) requests. After the service proxy component intercepts the query request for configuration information, it obtains the environment tag and adds the environment tag to the query request.

服务代理组件感知环境标签(如图2所示的“分组环境标识A”或者“分组环境标识B”)。The service proxy component perceives the environment label (such as "group environment identifier A" or "group environment identifier B" as shown in FIG. 2).

可选的,环境分组策略为根据宿主机规格进行分组,则服务代理组件根据环境分组策略,获取当前宿主机的规格信息,根据宿主机的规格信息确定环境标签。Optionally, the environment grouping strategy is to group according to host machine specifications, and the service proxy component obtains specification information of the current host machine according to the environment grouping strategy, and determines the environment tag according to the specification information of the host machine.

可选的,服务代理组件可以通过直接识别容器的标签、环境变量、指定路径配置等方式获取环境标签。Optionally, the service proxy component can obtain the environment label by directly identifying the container label, environment variables, specifying the path configuration, etc.

可选的,服务代理组件如果没有获取到环境标签,则通过与应用管控平台通信,发起应用环境查询请求,应用管控平台根据环境分组策略计算环境标签,服务代理组件从应用管控平台直接拉取环境标签。Optionally, if the service proxy component does not obtain the environment tag, it initiates an application environment query request by communicating with the application management and control platform. The application management and control platform calculates the environment tag according to the environment grouping strategy, and the service proxy component directly pulls the environment tag from the application management and control platform.

5. 注入环境标签查询配置。5. Inject environment tag query configuration.

配置中心的控制面在接收到查询请求后,控制面根据查询请求中的配置信息的名称、命名空间、环境标签等参数联合查询,根据是否存在环境标签和标签具体内容来获取相应的配置信息返回给服务代理组件。After receiving the query request, the control plane of the configuration center conducts a joint query based on the name, namespace, environment tag and other parameters of the configuration information in the query request, and obtains the corresponding configuration information based on whether the environment tag exists and the specific content of the tag and returns it to the service proxy component.

对于多个维度的环境分组策略,服务代理组件根据各环境分组策略的优先级,确定环境标签的优先级。若各环境标签对应的配置信息存在相同配置项,则根据各环境标签的优先级顺序,确定各环境标签对应的配置信息的生效顺序信息;将各环境标签对应的配置信息和生效顺序信息返回给应用程序,应用程序根据生效顺序信息生效配置信息。若各环境标签对应的配置信息不存在相同配置项,则将各环境标签对应的配置信息进行合并,将合并后的配置信息返回给应用程序。For multi-dimensional environment grouping strategies, the service proxy component determines the priority of the environment tag according to the priority of each environment grouping strategy. If the configuration information corresponding to each environment tag has the same configuration items, the effective order information of the configuration information corresponding to each environment tag is determined according to the priority order of each environment tag; the configuration information and effective order information corresponding to each environment tag are returned to the application, and the application validates the configuration information according to the effective order information. If the configuration information corresponding to each environment tag does not have the same configuration items, the configuration information corresponding to each environment tag is merged and the merged configuration information is returned to the application.

相关技术中,应用订阅配置的能力是订阅一份唯一的配置信息,配置信息与应用程序中的代码强关联,如需订阅不同的配置信息,需要人工对不同环境中的应用做不同的参数配置。In the related art, the ability of an application to subscribe to configuration is to subscribe to a unique configuration information. The configuration information is strongly associated with the code in the application. If different configuration information needs to be subscribed, different parameter configurations need to be made manually for applications in different environments.

本实施例中,通过服务代理组件实现无侵入式环境标签自感知能力,用户在应用管控平台设置了环境分组策略后,应用管控平台将环境分组策略推送到应用的服务代理组件中,服务代理组件根据环境分组策略获取环境标签,或者直接从应用管控平台获取环境标签,并基于环境标签获取相应的配置信息满足不同环境的配置需求,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。In this embodiment, non-intrusive environment label self-perception capability is implemented through the service proxy component. After the user sets the environment grouping strategy on the application management and control platform, the application management and control platform pushes the environment grouping strategy to the service proxy component of the application. The service proxy component obtains the environment label according to the environment grouping strategy, or directly obtains the environment label from the application management and control platform, and obtains the corresponding configuration information based on the environment label to meet the configuration requirements of different environments, avoiding manual parameter configuration of the application program, reducing the complexity of different environment configurations of the application program, and improving the efficiency of application configuration.

本申请实施例提供了一种应用程序的配置信息获取方法,本实施例中的方法可以应用于具有计算和处理能力的服务器、终端设备、平台、装置等,其中,服务器可以是服务器集群,也可以是单个服务器,可以是部署在云端的服务器,也可以本地服务器。An embodiment of the present application provides a method for obtaining configuration information of an application. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud, or a local server.

如图3所示为本申请一实施例的应用程序的配置信息获取方法的流程图,包括:FIG3 is a flow chart of a method for obtaining configuration information of an application program according to an embodiment of the present application, including:

步骤S301,获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略。Step S301, obtaining a query request for configuration information of an application, and obtaining an environment grouping strategy of the application from an application management and control platform.

步骤S302,基于环境分组策略,确定应用程序对应的环境标签。Step S302: Determine the environment tag corresponding to the application based on the environment grouping strategy.

步骤S303,将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息。Step S303: Add the environment tag to the query request, and send the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag.

步骤S304,接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。Step S304: receiving configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application.

本实施例的执行主体为服务代理组件,服务代理组件拦截应用程序的配置信息的查询请求,并从应用管控平台获取环境分组策略。其中,服务代理组件可以是具有代理能力的组件,例如,JavaAgent组件、可以拦截HTTP请求的网络代理组件等。The execution subject of this embodiment is a service proxy component, which intercepts the query request of the configuration information of the application and obtains the environment grouping strategy from the application management and control platform. The service proxy component can be a component with proxy capability, such as a JavaAgent component, a network proxy component that can intercept HTTP requests, etc.

其中,配置信息包括但不限于:应用程序启动时关联的配置项。例如,数据库等中间件;地址、端口、账号密码等连接信息;应用程序启动时的系统参数:如连接池、最大连接数等。The configuration information includes, but is not limited to: configuration items associated with the application startup, such as database and other middleware; connection information such as address, port, account and password; system parameters when the application is started, such as connection pool, maximum number of connections, etc.

可选的,环境分组策略具体可以是按照以下维度对应用程序进行环境分组:地域、可用区、宿主机系统版本、宿主机规格、容器规格、自定义分组(例如,按照测试环境、生产环境等不同环境分组)、网段无类域间路由(Classless Inter-Domain Routing,CIDR)等。Optionally, the environment grouping strategy can specifically group the application environments according to the following dimensions: region, availability zone, host system version, host specification, container specification, custom grouping (for example, grouping according to different environments such as test environment and production environment), network segment Classless Inter-Domain Routing (CIDR), etc.

环境标签可以指示应用程序所处的环境,同一应用程序,处于不同环境,则对应不同的配置信息,环境标签用于获取不同环境对应的配置信息。The environment tag can indicate the environment in which the application is located. The same application in different environments corresponds to different configuration information. The environment tag is used to obtain the configuration information corresponding to different environments.

不同环境差异使用不同的配置信息,包括但不限于:Different environments use different configuration information, including but not limited to:

硬件环境差异:底层云资源规格和性能存在差异,对于不同云资源规格的宿主机,应用程序订阅不同规格的配置信息。Differences in hardware environments: The underlying cloud resources have different specifications and performance. For hosts with different cloud resource specifications, applications subscribe to configuration information of different specifications.

软件环境差异:底层云资源操作系统存在差异,例如,不同版本的云资源操作系统,应用程序需要不同的配置信息。Differences in software environment: There are differences in the underlying cloud resource operating systems. For example, different versions of cloud resource operating systems require different configuration information for applications.

物理环境差异:对于不同地域、可用区的机器上部署的应用程序,期望有不同配置。例如,在不同可用区或地域的应用访问不同的中间件、云资源、远端依赖地址等。Physical environment differences: Different configurations are expected for applications deployed on machines in different regions and availability zones. For example, applications in different availability zones or regions access different middleware, cloud resources, and remote dependency addresses.

应用场景环境差异:测试环境和生产环境的差异,期望按特定标签来进行应用分组配置管理,不同分组的应用使用不同配置。Differences in application scenario environments: Due to the differences between the test environment and the production environment, it is expected that application group configuration management can be performed according to specific tags, and applications in different groups use different configurations.

自定义环境差异:例如,应用程序更新差异,应用程序开发人员更新了应用程序的新版本,并期望新版本应用程序订阅配置中心新版本的配置信息;根据不同的发布方式确定不同的环境,例如,分组发布、分批发布、灰度发布等,在灰度发布过程中或部分分组发布时,使用新版本的配置信息而不影响未进行发布的批次。Custom environment differences: For example, application update differences. The application developer updates the new version of the application and expects the new version of the application to subscribe to the configuration information of the new version of the configuration center. Different environments are determined according to different release methods, such as group release, batch release, gray release, etc. During the gray release process or partial group release, the configuration information of the new version is used without affecting the batches that have not been released.

配置中心预先存储了带有不同环境标签的配置信息,服务代理组件将带有环境标签的查询请求发送到配置中心之后,配置中心根据环境标签获取对应的配置信息返回给服务代理组件,服务代理组件将配置信息发送给应用程序,应用程序进行配置生效。The configuration center pre-stores configuration information with different environment tags. After the service proxy component sends a query request with the environment tag to the configuration center, the configuration center obtains the corresponding configuration information based on the environment tag and returns it to the service proxy component. The service proxy component sends the configuration information to the application, and the application makes the configuration effective.

本申请实施例提供的应用程序的配置信息获取方法,服务代理组件获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。本实施例中,利用服务代理组件从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。The configuration information acquisition method of the application provided in the embodiment of the present application is that the service proxy component obtains the query request for the configuration information of the application, obtains the environment grouping strategy of the application from the application management and control platform; based on the environment grouping strategy, determines the environment tag corresponding to the application; adds the environment tag to the query request, and sends the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application. In this embodiment, the environment grouping strategy of the application is obtained from the application management and control platform by using the service proxy component; based on the environment grouping strategy, the environment tag corresponding to the application is determined, and the configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. The service proxy component realizes self-awareness of the environment tag, avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

下面通过多种实现方式对上述各步骤的具体实现过程进行详细介绍。The specific implementation process of the above steps is described in detail below through multiple implementation methods.

在一种实现方式中,步骤S302,基于环境分组策略,确定应用程序对应的环境标签,包括:步骤S3021,获取应用程序对应的环境信息;步骤S3022,根据环境分组策略和环境信息,确定应用程序对应的环境标签。In one implementation, step S302, based on the environment grouping strategy, determines the environment tag corresponding to the application, including: step S3021, obtaining the environment information corresponding to the application; step S3022, determining the environment tag corresponding to the application according to the environment grouping strategy and the environment information.

其中,环境信息包括软件环境信息、硬件环境信息、物理环境信息、应用场景环境信息中的至少一项。例如,硬件环境信息可以是宿主机云资源规格,软件环境信息可以是云资源操作系统版本,物理环境信息可以是地域信息,应用场景环境信息可以是测试环境。The environment information includes at least one of software environment information, hardware environment information, physical environment information, and application scenario environment information. For example, the hardware environment information may be the host cloud resource specifications, the software environment information may be the cloud resource operating system version, the physical environment information may be the region information, and the application scenario environment information may be the test environment.

在一示例中,环境分组策略为根据地域分组,则获取应用程序所在机器的地域信息,根据具体的地域信息确定应用程序对应的环境标签,不同地域则环境标签不同。In one example, the environment grouping strategy is to group by region, so the region information of the machine where the application is located is obtained, and the environment label corresponding to the application is determined according to the specific region information, and different regions have different environment labels.

例如,应用程序aa宿主机所在的地域为B市,则服务代理组件确定应用程序aa对应的环境标签为B市对应的符号、字符串等。服务代理组件根据环境标签从配置中心获取对应的配置信息。For example, if the region where the host machine of application aa is located is city B, the service proxy component determines that the environment tag corresponding to application aa is a symbol, string, etc. corresponding to city B. The service proxy component obtains corresponding configuration information from the configuration center according to the environment tag.

在又一示例中,环境分组策略为根据宿主机规格分组,则获取应用程序的宿主机云资源规格,根据宿主机的具体规格确定应用程序对应的环境标签,不同规格则环境标签不同。In another example, the environment grouping strategy is to group according to host machine specifications, then the host machine cloud resource specifications of the application are obtained, and the environment tag corresponding to the application is determined according to the specific specifications of the host machine, and different specifications have different environment tags.

例如,服务代理组件可以通过应用程序编程接口获取宿主机的规格信息,如CPU核心数、内存大小、存储容量等。根据宿主机的资源规格确定环境标签,可以确定出“小”、“中”、“大”等不同的资源规格对应的环境标签。For example, the service proxy component can obtain the specification information of the host machine through the application programming interface, such as the number of CPU cores, memory size, storage capacity, etc. The environment label is determined according to the resource specifications of the host machine, and the environment labels corresponding to different resource specifications such as "small", "medium", and "large" can be determined.

本实施例中,服务代理组件从应用管控平台获取应用程序的环境分组策略后,基于环境分组策略和环境信息,实现环境标签自感知,在环境分组策略相同的情况下,根据不同的环境信息可以得到不同的环境标签,进而得到不同的配置信息,满足应用程序的多样化配置需求。In this embodiment, after the service proxy component obtains the environment grouping strategy of the application from the application management and control platform, it realizes self-perception of the environment label based on the environment grouping strategy and environment information. When the environment grouping strategy is the same, different environment labels can be obtained according to different environment information, and then different configuration information can be obtained to meet the diverse configuration requirements of the application.

在一种实现方式中,环境分组策略为多个维度分别对应的分组策略,应用程序的配置信息获取方法还包括:获取多个维度分别对应的分组策略的优先级;根据多个维度分别对应的分组策略的优先级,确定多个维度分别对应的环境标签的优先级。In one implementation, the environment grouping strategy is a grouping strategy corresponding to multiple dimensions, and the configuration information acquisition method of the application also includes: obtaining the priorities of the grouping strategies corresponding to the multiple dimensions; and determining the priorities of the environment tags corresponding to the multiple dimensions according to the priorities of the grouping strategies corresponding to the multiple dimensions.

在实际应用中,应用管控平台还可以对应用程序按照多个维度进行分组,并为每个维度的环境分组策略设置优先级,并发送至服务代理组件,服务代理组件根据环境分组策略的优先级,来设置环境标签的优先级。In actual applications, the application management and control platform can also group applications according to multiple dimensions, set priorities for the environment grouping strategies for each dimension, and send them to the service proxy component. The service proxy component sets the priority of the environment tag according to the priority of the environment grouping strategy.

例如,按照宿主机云资源规格进行分组的优先级高于按照地域进行分组的优先级,按照宿主机云资源规格进行分组的情况下,应用程序的标签为L1,按照地域进行分组的情况下,应用程序的标签为L2,则L1的优先级高于L2。For example, the priority of grouping by host cloud resource specifications is higher than the priority of grouping by region. When grouping by host cloud resource specifications, the application label is L1, and when grouping by region, the application label is L2. Then L1 has a higher priority than L2.

本实施例中,从多个维度对应用程序进行分组时,通过确定环境标签的优先级,可以避免获取配置信息时出现冲突,从而实现高优先级的环境标签对应的配置信息优先生效。In this embodiment, when the application programs are grouped from multiple dimensions, conflicts when obtaining configuration information can be avoided by determining the priorities of the environment tags, so that the configuration information corresponding to the environment tags with higher priorities takes effect first.

在一种实现方式中,步骤S303,将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,包括:将多个维度分别对应的环境标签添加到查询请求中,并将添加了多个维度分别对应的环境标签的查询请求发送至配置中心。In one implementation, step S303, adding an environmental tag to a query request, and sending the query request with the environmental tag added to a configuration center, includes: adding environmental tags corresponding to multiple dimensions to the query request, and sending the query request with the environmental tags corresponding to multiple dimensions added to the configuration center.

在从多个维度对应用程序进行分组时,服务代理组件将多个维度的环境标签添加到查询请求中并发送到配置中心,配置中心可以根据多个维度的环境标签,获取每个环境标签对应的配置信息返回给服务代理组件,服务代理组件再发送给应用程序,应用程序进行配置生效。When grouping applications from multiple dimensions, the service proxy component adds the environment tags of multiple dimensions to the query request and sends it to the configuration center. The configuration center can obtain the configuration information corresponding to each environment tag based on the environment tags of multiple dimensions and return it to the service proxy component. The service proxy component then sends it to the application, and the application makes the configuration effective.

本实施例中,服务代理组件通过向配置中心发送多个维度的环境标签,可以获取到多个维度的环境标签分别对应的配置信息,满足应用程序多个维度的配置需求。In this embodiment, the service proxy component can obtain configuration information corresponding to the environment tags of multiple dimensions by sending environment tags of multiple dimensions to the configuration center, thereby meeting the configuration requirements of the application program in multiple dimensions.

在一种实现方式中,步骤S304,接收配置中心发送的环境标签对应的配置信息,并返回给应用程序,包括:接收配置中心发送的各环境标签对应的配置信息,若各环境标签对应的配置信息存在相同配置项,则根据各环境标签的优先级顺序,确定各环境标签对应的配置信息的生效顺序信息:将各环境标签对应的配置信息和生效顺序信息返回给应用程序。In one implementation, step S304, receiving configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application, includes: receiving configuration information corresponding to each environment tag sent by the configuration center, if there are identical configuration items in the configuration information corresponding to each environment tag, determining the effective order information of the configuration information corresponding to each environment tag according to the priority order of each environment tag: returning the configuration information corresponding to each environment tag and the effective order information to the application.

在实际应用中,服务代理组件接收到多个维度的环境标签对应的配置信息之后,判断各环境标签对应的配置信息是否存在相同配置项,如果存在相同的配置项,则确定配置信息的生效顺序信息,将配置信息和生效顺序信息发送给应用程序,应用程序根据生效顺序信息生效配置信息,优先级较高的环境标签对应的配置信息优先生效。In actual applications, after the service proxy component receives the configuration information corresponding to the environment tags of multiple dimensions, it determines whether there are identical configuration items in the configuration information corresponding to each environment tag. If there are identical configuration items, it determines the effective order information of the configuration information, and sends the configuration information and the effective order information to the application. The application implements the configuration information according to the effective order information, and the configuration information corresponding to the environment tag with a higher priority takes effect first.

例如,两个环境标签[a]、[b],[a]的优先级高于[b]的优先级。For example, given two environment tags [a] and [b], the priority of [a] is higher than that of [b].

[a]对应的配置信息为配置项config1、config2分别对应的配置值:config1=configvalue1-a;config2=configvalue2;[a] The corresponding configuration information is the configuration values corresponding to configuration items config1 and config2 respectively: config1=configvalue1-a; config2=configvalue2;

[b]对应的配置信息为配置项config1、config3分别对应的配置值:config1=configvalue1-b;config3=configvalue3[b] The corresponding configuration information is the configuration values corresponding to configuration items config1 and config3 respectively: config1=configvalue1-b; config3=configvalue3

[a]对应的配置信息和[b]对应的配置信息存在相同的配置项config1,由于[a]的优先级较高,则最终生效的配置项为:config1=configvalue1-a;config2=configvalue2;config3=configvalue3。The configuration information corresponding to [a] and the configuration information corresponding to [b] have the same configuration item config1. Since [a] has a higher priority, the configuration items that finally take effect are: config1=configvalue1-a; config2=configvalue2; config3=configvalue3.

本实施例中,根据环境标签的优先级顺序,确定环境标签对应的配置信息的生效顺序,可以避免配置信息冲突问题,保证优先级较高的配置信息优先生效。In this embodiment, the order in which the configuration information corresponding to the environment tags takes effect is determined according to the priority order of the environment tags, which can avoid configuration information conflict and ensure that the configuration information with a higher priority takes effect first.

在一种实现方式中,步骤S304,接收配置中心发送的环境标签对应的配置信息,并返回给应用程序,包括:接收配置中心发送的各环境标签对应的配置信息,若各环境标签对应的配置信息不存在相同配置项,则将各环境标签对应的配置信息进行合并,将合并后的配置信息返回给应用程序。In one implementation, step S304, receiving configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application, includes: receiving configuration information corresponding to each environment tag sent by the configuration center, if the configuration information corresponding to each environment tag does not have the same configuration item, then merging the configuration information corresponding to each environment tag, and returning the merged configuration information to the application.

在实际应用中,服务代理组件接收到多个维度的环境标签对应的配置信息之后,判断各环境标签对应的配置信息是否存在相同配置项,如果不存在相同的配置项,则不存在配置信息冲突问题,则将每个环境标签对应的配置信息合并发送至应用程序,供应用程序配置使用。In actual applications, after the service proxy component receives the configuration information corresponding to the environment tags of multiple dimensions, it determines whether there are the same configuration items in the configuration information corresponding to each environment tag. If there are no identical configuration items, there is no configuration information conflict problem. The configuration information corresponding to each environment tag is merged and sent to the application for application configuration use.

本申请实施例提供了一种应用程序的配置信息获取方法,本实施例中的方法可以应用于具有计算和处理能力的服务器、终端设备、平台、装置等,其中,服务器可以是服务器集群,也可以是单个服务器,可以是部署在云端的服务器,也可以本地服务器。An embodiment of the present application provides a method for obtaining configuration information of an application. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud, or a local server.

如图4所示为本申请一实施例的应用程序的配置信息获取方法的流程图,包括:FIG4 is a flow chart of a method for obtaining configuration information of an application program according to an embodiment of the present application, comprising:

步骤S401,获取应用程序的环境分组策略。Step S401, obtaining the environment grouping strategy of the application.

步骤S402,将环境分组策略发送至服务代理组件,以使服务代理组件基于环境分组策略,确定应用程序对应的环境标签,环境标签用于从配置中心获取配置信息。Step S402: Send the environment grouping strategy to the service proxy component, so that the service proxy component determines the environment tag corresponding to the application based on the environment grouping strategy, and the environment tag is used to obtain configuration information from the configuration center.

本实施例的执行主体为应用管控平台,用户通过应用管控平台配置环境分组策略,应用管控平台接收用户输入的环境分组策略,并将环境分组策略发送至服务代理组件,可以按照不同地域、不同可用区、不同宿主机版本等不同环境对应用程序进行环境分组。The executor of this embodiment is the application management and control platform. The user configures the environment grouping strategy through the application management and control platform. The application management and control platform receives the environment grouping strategy input by the user and sends the environment grouping strategy to the service proxy component. The application program can be grouped according to different environments such as different regions, different availability zones, and different host machine versions.

本申请实施例中的各步骤的具体实现过程可以参见前述实施例中的对应描述,并具备相应的有益效果,在此不再赘述。The specific implementation process of each step in the embodiment of the present application can refer to the corresponding description in the aforementioned embodiment, and has corresponding beneficial effects, which will not be repeated here.

本申请实施例提供的应用程序的配置信息获取方法,应用管控平台获取应用程序的环境分组策略,并发送至服务代理组件,服务代理组件基于环境分组策略,确定应用程序对应的环境标签,将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。本实施例中,利用服务代理组件从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。The configuration information acquisition method of the application provided in the embodiment of the present application is that the application management and control platform obtains the environment grouping strategy of the application and sends it to the service proxy component. The service proxy component determines the environment tag corresponding to the application based on the environment grouping strategy, adds the environment tag to the query request, and sends the query request with the environment tag added to the configuration center, receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application. In this embodiment, the service proxy component is used to obtain the environment grouping strategy of the application from the application management and control platform; based on the environment grouping strategy, the environment tag corresponding to the application is determined, and the configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. The service proxy component realizes self-awareness of the environment tag, avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

本申请实施例提供了一种应用程序的配置信息获取方法,本实施例中的方法可以应用于具有计算和处理能力的服务器、终端设备、平台、装置等,其中,服务器可以是服务器集群,也可以是单个服务器,可以是部署在云端的服务器,也可以本地服务器。An embodiment of the present application provides a method for obtaining configuration information of an application. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud, or a local server.

如图5所示为本申请一实施例的应用程序的配置信息获取方法的流程图,包括:FIG5 is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application, including:

步骤S501,在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;Step S501, when receiving a query request for target configuration information of an application sent by a service proxy component, obtaining a target environment tag of the target configuration information from the query request; the target environment tag is determined by the service proxy component based on an environment grouping strategy sent by an application management and control platform;

步骤S502,基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件,以使服务代理组件将目标配置信息发送至应用程序。Step S502 : based on the target environment tag, determine the target configuration information from the multiple configuration information with the environment tag of the application program and send it to the service proxy component, so that the service proxy component sends the target configuration information to the application program.

本实施例的执行主体为配置中心,在配置中心预先创建配置实体模型,预先存储了带有不同环境标签的配置信息,服务代理组件将带有环境标签的查询请求发送到配置中心之后,配置中心根据查询请求中携带的环境标签,获取对应的配置信息返回给服务代理组件,服务代理组件将配置信息发送给应用程序,应用程序进行配置生效。The executor of this embodiment is the configuration center. A configuration entity model is pre-created in the configuration center, and configuration information with different environment tags is pre-stored. After the service proxy component sends a query request with the environment tag to the configuration center, the configuration center obtains the corresponding configuration information based on the environment tag carried in the query request and returns it to the service proxy component. The service proxy component sends the configuration information to the application, and the application makes the configuration effective.

本申请实施例中的各步骤的具体实现过程可以参见前述实施例中的对应描述,并具备相应的有益效果,在此不再赘述。The specific implementation process of each step in the embodiment of the present application can refer to the corresponding description in the aforementioned embodiment, and has corresponding beneficial effects, which will not be repeated here.

本申请实施例提供的应用程序的配置信息获取方法,在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件,以使服务代理组件将目标配置信息发送至应用程序。本实施例中,服务代理组件基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。The configuration information acquisition method for an application provided in an embodiment of the present application, upon receiving a query request for the target configuration information of an application sent by a service proxy component, obtains the target environment tag of the target configuration information from the query request; the target environment tag is determined by the service proxy component based on the environment grouping strategy sent by the application management and control platform; based on the target environment tag, the target configuration information is determined from multiple configuration information with environment tags of the application and sent to the service proxy component, so that the service proxy component sends the target configuration information to the application. In this embodiment, the service proxy component obtains configuration information from the configuration center based on the environment tag, and can obtain configuration information that conforms to the environment grouping. The service proxy component realizes self-awareness of the environment tag, avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取系统,该系统包括服务代理组件、应用管控平台和配置中心。Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a system for obtaining configuration information of an application program, which includes a service proxy component, an application management and control platform, and a configuration center.

应用管控平台,用于获取应用程序的环境分组策略;将环境分组策略发送至服务代理组件;The application management and control platform is used to obtain the environment grouping strategy of the application program; and send the environment grouping strategy to the service proxy component;

服务代理组件,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序;The service proxy component is used to obtain query requests for application configuration information, obtain the application environment grouping strategy from the application management and control platform; determine the environment tag corresponding to the application based on the environment grouping strategy; add the environment tag to the query request, and send the query request with the environment tag added to the configuration center; receive the configuration information corresponding to the environment tag sent by the configuration center, and return it to the application;

配置中心,用于在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件。The configuration center is used to obtain the target environment tag of the target configuration information from the query request when receiving the query request for the target configuration information of the application sent by the service proxy component; the target environment tag is determined by the service proxy component based on the environment grouping strategy sent by the application management and control platform; based on the target environment tag, the target configuration information is determined from multiple configuration information with environment tags of the application and sent to the service proxy component.

本申请实施例中的各部分的功能的具体实现过程可以参见前述实施例中的对应描述,并具备相应的有益效果,在此不再赘述。The specific implementation process of the functions of each part in the embodiments of the present application can refer to the corresponding description in the aforementioned embodiments, and has corresponding beneficial effects, which will not be repeated here.

本实施例中,利用服务代理组件从应用管控平台获取应用程序的环境分组策略;基于环境分组策略,确定应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。In this embodiment, a service proxy component is used to obtain the environment grouping strategy of the application from the application management and control platform; based on the environment grouping strategy, the environment tag corresponding to the application is determined, and configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. Self-perception of the environment tag is achieved through the service proxy component, which avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

本申请实施例提供了一种应用程序的配置信息获取方法,本实施例中的方法可以应用于具有计算和处理能力的服务器、终端设备、平台、装置等,其中,服务器可以是服务器集群,也可以是单个服务器,可以是部署在云端的服务器,也可以本地服务器。An embodiment of the present application provides a method for obtaining configuration information of an application. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud, or a local server.

如图6所示为本申请一实施例的应用程序的配置信息获取方法的流程图,包括:FIG6 is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application, including:

步骤S601,获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序对应的环境标签。Step S601, obtaining a query request for configuration information of an application, and obtaining an environment tag corresponding to the application from an application management and control platform.

步骤S602,将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。Step S602, adding the environment tag to the query request, and sending the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; receiving the configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application.

本实施例的执行主体为服务代理组件。The execution subject of this embodiment is a service proxy component.

其中,服务代理组件从应用管控平台获取应用程序对应的环境标签包括以下两种实现方式:The service proxy component obtains the environment tag corresponding to the application from the application management and control platform in the following two ways:

一种方式是应用管控平台在创建应用程序时,根据环境分组策略计算应用程序对应的环境标签,并直接添加到应用程序中,例如,通过为应用程序所在容器配置标签、环境变量、注入挂载配置等方式将环境标签添加到应用程序中,服务代理组件通过直接识别容器的标签、环境变量、指定路径配置等方式,获取应用程序的环境标签;One way is that when creating an application, the application management and control platform calculates the environment tag corresponding to the application according to the environment grouping strategy and directly adds it to the application. For example, the environment tag is added to the application by configuring tags, environment variables, injecting mount configuration, etc. for the container where the application is located. The service proxy component obtains the environment tag of the application by directly identifying the container's tags, environment variables, specifying path configuration, etc.

另一种实现方式为应用管控平台创建应用程序后,服务代理组件向应用管控平台发送环境标签的查询请求,应用管控平台接收到查询请求之后,根据环境分组策略实时计算应用程序当前对应的环境标签,再发送给服务代理组件。例如,灰度发布时,应用程序之前属于灰度发布的分组,灰度发布之后,不再属于灰度发布的分组,则实时计算的环境标签发生变化。Another implementation method is that after the application management platform creates an application, the service proxy component sends a query request for the environment tag to the application management platform. After receiving the query request, the application management platform calculates the current environment tag corresponding to the application in real time according to the environment grouping strategy, and then sends it to the service proxy component. For example, during a grayscale release, if the application previously belonged to a grayscale release group, but after the grayscale release, it no longer belongs to the grayscale release group, the real-time calculated environment tag changes.

可选的,在实际应用中,服务代理组件拦截到应用程序的配置信息的查询请求之后,获取应用程序的环境信息,基于环境信息,确定环境标签,例如,直接识别容器的标签、环境变量、指定路径配置等方式,获取应用程序的环境标签。如果基于环境信息,没有获取到环境标签,则向应用管控平台发送环境标签的获取请求,应用管控平台根据环境分组策略实时计算应用程序当前对应的环境标签,再发送给服务代理组件。Optionally, in actual applications, after the service proxy component intercepts the query request for the configuration information of the application, it obtains the environment information of the application and determines the environment label based on the environment information, for example, by directly identifying the container label, environment variables, or specifying the path configuration to obtain the environment label of the application. If the environment label is not obtained based on the environment information, a request to obtain the environment label is sent to the application management and control platform. The application management and control platform calculates the environment label currently corresponding to the application in real time according to the environment grouping strategy and then sends it to the service proxy component.

应用管控平台根据环境分组策略确定的环境标签的具体过程,与上述实施例中服务代理组件根据环境分组策略确定环境标签的过程类似,此处不再赘述。The specific process of the application management and control platform determining the environment label according to the environment grouping strategy is similar to the process of the service agent component determining the environment label according to the environment grouping strategy in the above embodiment, and will not be repeated here.

本实施例中,利用服务代理组件从应用管控平台获取应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。In this embodiment, a service proxy component is used to obtain the environment tag corresponding to the application from the application management and control platform, and configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. Self-perception of the environment tag is achieved through the service proxy component, which avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

本申请实施例提供了一种应用程序的配置信息获取方法,本实施例中的方法可以应用于具有计算和处理能力的服务器、终端设备、平台、装置等,其中,服务器可以是服务器集群,也可以是单个服务器,可以是部署在云端的服务器,也可以本地服务器。An embodiment of the present application provides a method for obtaining configuration information of an application. The method in this embodiment can be applied to servers, terminal devices, platforms, devices, etc. with computing and processing capabilities, wherein the server can be a server cluster or a single server, a server deployed in the cloud, or a local server.

如图7所示为本申请一实施例的应用程序的配置信息获取方法的流程图,包括:FIG. 7 is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application, including:

步骤S701,获取应用程序的环境分组策略;Step S701, obtaining an environment grouping strategy of an application program;

步骤S702,根据环境分组策略,确定应用程序对应的环境标签;Step S702, determining the environment tag corresponding to the application according to the environment grouping strategy;

步骤S703,将环境标签发送至服务代理组件,以使服务代理组件根据环境标签从配置中心获取配置信息,并返回给应用程序。Step S703: Send the environment tag to the service proxy component, so that the service proxy component obtains configuration information from the configuration center according to the environment tag and returns it to the application.

本实施例的执行主体为应用管控平台。The execution subject of this embodiment is the application management and control platform.

其中,应用管控平台根据环境分组策略确定应用程序对应的环境标签包括两种实现方式:The application management and control platform determines the environment label corresponding to the application according to the environment grouping strategy, including two implementation methods:

一种方式是应用管控平台在创建应用程序时,根据环境分组策略计算应用程序对应的环境标签,并直接添加到应用程序中,例如,通过为应用程序所在容器配置标签、环境变量、注入挂载配置等方式将环境标签添加到应用程序中,服务代理组件通过直接识别容器的标签、环境变量、指定路径配置等方式,获取应用程序的环境标签;One way is that when creating an application, the application management and control platform calculates the environment tag corresponding to the application according to the environment grouping strategy and directly adds it to the application. For example, the environment tag is added to the application by configuring tags, environment variables, injecting mount configuration, etc. for the container where the application is located. The service proxy component obtains the environment tag of the application by directly identifying the container's tags, environment variables, specifying path configuration, etc.

另一种实现方式为应用管控平台创建应用程序后,服务代理组件向应用管控平台发送环境标签的查询请求,应用管控平台接收到查询请求之后,根据环境分组策略实时计算应用程序当前对应的环境标签,再发送给服务代理组件。例如,灰度发布时,应用程序之前属于灰度发布的分组,灰度发布之后,不再属于灰度发布的分组,则实时计算的环境标签发生变化。Another implementation method is that after the application management platform creates an application, the service proxy component sends a query request for the environment tag to the application management platform. After receiving the query request, the application management platform calculates the current environment tag corresponding to the application in real time according to the environment grouping strategy, and then sends it to the service proxy component. For example, during a grayscale release, if the application previously belonged to a grayscale release group, but after the grayscale release, it no longer belongs to the grayscale release group, the real-time calculated environment tag changes.

应用管控平台根据环境分组策略确定的环境标签的具体过程,与上述实施例中服务代理组件根据环境分组策略确定环境标签的过程类似,此处不再赘述。The specific process of the application management and control platform determining the environment label according to the environment grouping strategy is similar to the process of the service agent component determining the environment label according to the environment grouping strategy in the above embodiment, and will not be repeated here.

本实施例中,应用管控平台根据环境分组策略确定环境标签并发送至服务代理组件,服务代理组件基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。In this embodiment, the application management and control platform determines the environment label according to the environment grouping strategy and sends it to the service agent component. The service agent component obtains configuration information from the configuration center based on the environment label, and can obtain configuration information that conforms to the environment grouping. The service agent component realizes self-perception of the environment label, avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

在一个具体的实施例中,应用程序灰度发布过程中,动态订阅灰度分组的配置信息的步骤如下:In a specific embodiment, during the grayscale release of an application, the steps of dynamically subscribing to the configuration information of the grayscale grouping are as follows:

1. 配置中心接收用户的接口调用指令,或者接收用户发布的配置信息。1. The configuration center receives the user's interface call instructions, or receives the configuration information published by the user.

2. 配置中心控制面接收到配置请求之后,确定配置请求中是否存在环境标签。如果不存在环境标签,则将配置信息存储到默认版本的配置信息所在的目录或数据库中。如果存在环境标签,则新建配置存储目录或新建数据库记录,以配置名称、分组、环境标签为三元组来保存配置信息。2. After receiving the configuration request, the configuration center control plane determines whether there is an environment tag in the configuration request. If there is no environment tag, the configuration information is stored in the directory or database where the default version of the configuration information is located. If there is an environment tag, a new configuration storage directory or a new database record is created to save the configuration information in the configuration name, group, and environment tag triples.

3. 应用管控平台接收用户设置的环境分组策略。例如,确定灰度分组和非灰度分组。3. The application management and control platform receives the environment grouping policy set by the user, for example, determining grayscale groups and non-grayscale groups.

4. 应用管控平台接收到环境分组策略后,根据环境分组策略计算环境标签,与应用程序实例中的服务代理组件通信,推送环境标签。4. After receiving the environment grouping strategy, the application management and control platform calculates the environment tag according to the environment grouping strategy, communicates with the service proxy component in the application instance, and pushes the environment tag.

5. 服务代理组件接收到管控平台发布的环境标签后,拦截应用程序的配置配信息的查询请求,为查询请求中注入环境标签,并发送至配置中心。5. After receiving the environment tag published by the management and control platform, the service proxy component intercepts the query request for the application's configuration information, injects the environment tag into the query request, and sends it to the configuration center.

6.配置中心控制面接收到带环境标签的查询请求,根据查询请求中的配置名称、分组、环境标签定位到目标配置信息,从底层存储中查询到目标配置信息后返回给服务代理组件,服务代理组件返回给应用程序。6. The configuration center control plane receives the query request with the environment tag, locates the target configuration information according to the configuration name, group, and environment tag in the query request, queries the target configuration information from the underlying storage, and returns it to the service proxy component, which returns it to the application.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取系统,该系统包括服务代理组件、应用管控平台和配置中心。Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a system for obtaining configuration information of an application program, which includes a service proxy component, an application management and control platform, and a configuration center.

应用管控平台,用于获取应用程序的环境分组策略;根据环境分组策略,确定应用程序对应的环境标签;将环境标签发送至服务代理组件;The application management and control platform is used to obtain the environment grouping strategy of the application; determine the environment tag corresponding to the application according to the environment grouping strategy; and send the environment tag to the service proxy component;

服务代理组件,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序对应的环境标签;将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序;The service proxy component is used to obtain a query request for the configuration information of the application, obtain the environment tag corresponding to the application from the application management and control platform; add the environment tag to the query request, and send the query request with the environment tag added to the configuration center; receive the configuration information corresponding to the environment tag sent by the configuration center, and return it to the application;

配置中心,用于在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件。The configuration center is used to obtain the target environment tag of the target configuration information from the query request when receiving the query request for the target configuration information of the application sent by the service proxy component; based on the target environment tag, determine the target configuration information from multiple configuration information with environment tags of the application and send it to the service proxy component.

本实施例中,利用服务代理组件从应用管控平台获取应用程序对应的环境标签,基于环境标签从配置中心获取配置信息,可以获取到符合环境分组的配置信息,通过服务代理组件实现了环境标签自感知,避免了人工进行应用程序的参数配置,降低了应用程序的不同环境配置的复杂度,提高应用配置效率。In this embodiment, a service proxy component is used to obtain the environment tag corresponding to the application from the application management and control platform, and configuration information is obtained from the configuration center based on the environment tag. Configuration information that conforms to the environment grouping can be obtained. Self-perception of the environment tag is achieved through the service proxy component, which avoids manual parameter configuration of the application, reduces the complexity of different environment configurations of the application, and improves the efficiency of application configuration.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取装置。如图8所示为本申请一实施例的应用程序的配置信息获取装置的结构框图,该装置应用于服务代理组件,该装置包括:Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a device for obtaining configuration information of an application. As shown in FIG8 , a structural block diagram of a device for obtaining configuration information of an application in an embodiment of the present application is applied to a service proxy component, and the device includes:

获取模块801,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序的环境分组策略。The acquisition module 801 is used to obtain a query request for the configuration information of the application program and obtain the environment grouping strategy of the application program from the application management and control platform.

确定模块802,用于基于环境分组策略,确定应用程序对应的环境标签。The determination module 802 is used to determine the environment tag corresponding to the application program based on the environment grouping strategy.

发送模块803,用于将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。The sending module 803 is used to add the environment tag to the query request, and send the query request with the environment tag added to the configuration center so that the configuration center obtains the configuration information corresponding to the environment tag; receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application.

在一种实现方式中,确定模块802用于:获取应用程序对应的环境信息;根据环境分组策略和环境信息,确定应用程序对应的环境标签。其中,环境信息包括软件环境信息、硬件环境信息、物理环境信息、应用场景环境信息中的至少一项。In one implementation, the determination module 802 is used to: obtain environment information corresponding to the application; and determine the environment tag corresponding to the application according to the environment grouping strategy and the environment information, wherein the environment information includes at least one of software environment information, hardware environment information, physical environment information, and application scenario environment information.

在一种实现方式中,环境分组策略为多个维度分别对应的分组策略,装置还用于:获取多个维度分别对应的分组策略的优先级;根据多个维度分别对应的分组策略的优先级,确定多个维度分别对应的环境标签的优先级。In one implementation, the environmental grouping strategy is a grouping strategy corresponding to multiple dimensions, and the device is also used to: obtain the priorities of the grouping strategies corresponding to the multiple dimensions; and determine the priorities of the environmental tags corresponding to the multiple dimensions according to the priorities of the grouping strategies corresponding to the multiple dimensions.

在一种实现方式中,发送模块803,用于:将多个维度分别对应的环境标签添加到查询请求中,并将添加了多个维度分别对应的环境标签的查询请求发送至配置中心。In one implementation, the sending module 803 is used to add environment tags corresponding to multiple dimensions to the query request, and send the query request with the environment tags corresponding to the multiple dimensions added to the configuration center.

在一种实现方式中,发送模块803,用于:接收配置中心发送的各环境标签对应的配置信息,若各环境标签对应的配置信息存在相同配置项,则根据各环境标签的优先级顺序,确定各环境标签对应的配置信息的生效顺序信息;将各环境标签对应的配置信息和生效顺序信息返回给应用程序。In one implementation, the sending module 803 is used to: receive configuration information corresponding to each environment tag sent by the configuration center; if the configuration information corresponding to each environment tag has the same configuration items, determine the effective order information of the configuration information corresponding to each environment tag according to the priority order of each environment tag; and return the configuration information and effective order information corresponding to each environment tag to the application.

在一种实现方式中,发送模块803,用于:接收配置中心发送的各环境标签对应的配置信息,若各环境标签对应的配置信息不存在相同配置项,则将各环境标签对应的配置信息进行合并,将合并后的配置信息返回给应用程序。In one implementation, the sending module 803 is used to: receive configuration information corresponding to each environment tag sent by the configuration center; if the configuration information corresponding to each environment tag does not have the same configuration item, merge the configuration information corresponding to each environment tag, and return the merged configuration information to the application.

本申请实施例中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取装置。如图9所示为本申请一实施例的应用程序的配置信息获取装置的结构框图,该装置应用于应用管控平台,该装置包括:Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a device for obtaining configuration information of an application. As shown in FIG9 , a structural block diagram of a device for obtaining configuration information of an application in an embodiment of the present application is applied to an application management and control platform, and the device includes:

获取模块901,用于获取应用程序的环境分组策略;An acquisition module 901 is used to acquire an environment grouping strategy of an application program;

发送模块902,用于将环境分组策略发送至服务代理组件,以使服务代理组件基于环境分组策略,确定应用程序对应的环境标签,环境标签用于从配置中心获取配置信息。The sending module 902 is used to send the environment grouping strategy to the service proxy component, so that the service proxy component determines the environment tag corresponding to the application based on the environment grouping strategy, and the environment tag is used to obtain configuration information from the configuration center.

本申请实施例中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取装置。如图10所示为本申请一实施例的应用程序的配置信息获取装置的结构框图,该装置应用于配置中心,该装置包括:Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a device for obtaining configuration information of an application. As shown in FIG10 , a structural block diagram of a device for obtaining configuration information of an application in an embodiment of the present application is applied to a configuration center, and the device includes:

标签获取模块1001,用于在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从查询请求中获取目标配置信息的目标环境标签;目标环境标签是服务代理组件基于应用管控平台发送的环境分组策略确定的;The tag acquisition module 1001 is used to obtain the target environment tag of the target configuration information from the query request when receiving the query request of the target configuration information of the application sent by the service proxy component; the target environment tag is determined by the service proxy component based on the environment grouping strategy sent by the application management and control platform;

配置确定模块1002,用于基于目标环境标签,在应用程序的多个带有环境标签的配置信息中确定目标配置信息并发送至服务代理组件,以使服务代理组件将目标配置信息发送至应用程序。The configuration determination module 1002 is used to determine target configuration information from multiple configuration information with environment tags of the application program based on the target environment tag and send the target configuration information to the service proxy component, so that the service proxy component sends the target configuration information to the application program.

本申请实施例中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取装置。如图11所示为本申请一实施例的应用程序的配置信息获取装置的结构框图,该装置应用于服务代理组件,包括:Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a device for obtaining configuration information of an application. As shown in FIG11 , a structural block diagram of a device for obtaining configuration information of an application in an embodiment of the present application is applied to a service proxy component, and includes:

获取模块1101,用于获取应用程序的配置信息的查询请求,从应用管控平台获取应用程序对应的环境标签;The acquisition module 1101 is used to obtain a query request for configuration information of an application program and obtain an environment tag corresponding to the application program from the application management and control platform;

发送模块1102,用于将环境标签添加到查询请求中,并将添加了环境标签的查询请求发送至配置中心,以使配置中心获取环境标签对应的配置信息;接收配置中心发送的环境标签对应的配置信息,并返回给应用程序。The sending module 1102 is used to add the environment tag to the query request, and send the query request with the environment tag added to the configuration center so that the configuration center obtains the configuration information corresponding to the environment tag; receives the configuration information corresponding to the environment tag sent by the configuration center, and returns it to the application.

本申请实施例中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

与本申请实施例提供的方法的应用场景以及方法相对应地,本申请实施例还提供一种应用程序的配置信息获取装置。如图12所示为本申请一实施例的应用程序的配置信息获取装置的结构框图,该装置应用于应用管控平台,包括:Corresponding to the application scenario and method of the method provided in the embodiment of the present application, the embodiment of the present application also provides a device for obtaining configuration information of an application. As shown in FIG12 , a structural block diagram of a device for obtaining configuration information of an application in an embodiment of the present application is applied to an application management and control platform, and includes:

获取模块1201,用于获取应用程序的环境分组策略;An acquisition module 1201 is used to acquire an environment grouping strategy of an application program;

确定模块1202,用于根据环境分组策略,确定应用程序对应的环境标签;A determination module 1202, configured to determine an environment tag corresponding to the application program according to an environment grouping strategy;

发送模块1203,用于将环境标签发送至服务代理组件,以使服务代理组件根据环境标签从配置中心获取配置信息,并返回给应用程序。The sending module 1203 is used to send the environment tag to the service proxy component, so that the service proxy component obtains configuration information from the configuration center according to the environment tag and returns it to the application.

本申请实施例中的各模块的功能可以参见上述方法中的对应描述,并具备相应的有益效果,在此不再赘述。The functions of each module in the embodiment of the present application can be referred to the corresponding description in the above method, and have corresponding beneficial effects, which will not be repeated here.

图13为用来实现本申请实施例的电子设备的框图。如图13所示,该电子设备包括:存储器1310和处理器1320,存储器1310内存储有可在处理器1320上运行的计算机程序。处理器1320执行该计算机程序时实现上述实施例中的方法。存储器1310和处理器1320的数量可以为一个或多个。FIG13 is a block diagram of an electronic device for implementing an embodiment of the present application. As shown in FIG13 , the electronic device includes: a memory 1310 and a processor 1320, wherein the memory 1310 stores a computer program that can be run on the processor 1320. When the processor 1320 executes the computer program, the method in the above embodiment is implemented. The number of the memory 1310 and the processor 1320 can be one or more.

该电子设备还包括:The electronic device also includes:

通信接口1330,用于与外界设备进行通信,进行数据交互传输。The communication interface 1330 is used to communicate with external devices and perform data exchange transmission.

如果存储器1310、处理器1320和通信接口1330独立实现,则存储器1310、处理器1320和通信接口1330可以通过总线相互连接并完成相互间的通信。该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(PeripheralComponent Interconnect,PCI)总线或扩展工业标准体系结构(Extended IndustryStandard Architecture,EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。为便于表示,图13中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。If the memory 1310, the processor 1320 and the communication interface 1330 are implemented independently, the memory 1310, the processor 1320 and the communication interface 1330 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in FIG. 13, but it does not mean that there is only one bus or one type of bus.

可选的,在具体实现上,如果存储器1310、处理器1320及通信接口1330集成在一块芯片上,则存储器1310、处理器1320及通信接口1330可以通过内部接口完成相互间的通信。Optionally, in a specific implementation, if the memory 1310, the processor 1320 and the communication interface 1330 are integrated on a chip, the memory 1310, the processor 1320 and the communication interface 1330 can communicate with each other through an internal interface.

本申请实施例提供了一种计算机可读存储介质,其存储有计算机程序,该程序被处理器执行时实现本申请实施例中提供的方法。An embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the method provided in the embodiment of the present application when the program is executed by a processor.

本申请实施例提供了一种计算机程序产品,计算机程序产品包括计算机程序,计算机程序被处理器执行时实现本申请实施例中提供的方法。An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method provided in the embodiment of the present application is implemented.

本申请实施例还提供了一种芯片,该芯片包括处理器,用于从存储器中调用并运行存储器中存储的指令,使得安装有芯片的通信设备执行本申请实施例提供的方法。An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

本申请实施例还提供了一种芯片,包括:输入接口、输出接口、处理器和存储器,输入接口、输出接口、处理器以及存储器之间通过内部连接通路相连,处理器用于执行存储器中的代码,当代码被执行时,处理器用于执行申请实施例提供的方法。An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

应理解的是,上述处理器可以是中央处理器(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(FieldProgrammable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。值得说明的是,处理器可以是支持进阶精简指令集机器(Advanced RISC Machines,ARM)架构的处理器。It should be understood that the above processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor that supports the Advanced RISC Machines (ARM) architecture.

进一步地,可选的,上述存储器可以包括只读存储器和随机访问存储器。该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以包括只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以包括随机访问存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM均可用。例如,静态随机访问存储器(Static RAM,SRAM)、动态随机访问存储器(Dynamic Random Access Memory,DRAM)、同步动态随机访问存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机访问存储器(Double Data RateSDRAM,DDR SDRAM)、增强型同步动态随机访问存储器(Enhanced SDRAM,ESDRAM)、同步链接动态随机访问存储器(Sync link DRAM,SLDRAM)和直接内存总线随机访问存储器(DirectRambus RAM,DR RAM)。Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of exemplary but not limiting description, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生依照本申请的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包括于本申请的至少一个实施例或示例中。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

流程图中描述的或在此以其他方式描述的任何过程或方法可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分。并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能。Any process or method described in the flow chart or otherwise described herein can be understood as a module, fragment or portion of a code representing one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

在流程图中描述的或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。The logic and/or steps described in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

应理解的是,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。上述实施例方法的全部或部分步骤是可以通过程序来指令相关的硬件完成,该程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。上述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读存储介质中。该存储介质可以是只读存储器,磁盘或光盘等。In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.

以上所述,仅为本申请的示例性实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请记载的技术范围内,可轻易想到其各种变化或替换,这些都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only an exemplary embodiment of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope recorded in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims (15)

1.一种应用程序的配置信息获取方法,其特征在于,所述方法应用于服务代理组件,包括:1. A method for obtaining configuration information of an application, characterized in that the method is applied to a service proxy component, comprising: 获取应用程序的配置信息的查询请求,从应用管控平台获取所述应用程序的环境分组策略;Obtain a query request for configuration information of an application, and obtain an environment grouping strategy for the application from an application management and control platform; 基于所述环境分组策略,确定所述应用程序对应的环境标签;Based on the environment grouping strategy, determining an environment tag corresponding to the application; 将所述环境标签添加到所述查询请求中,并将添加了所述环境标签的查询请求发送至配置中心,以使所述配置中心获取所述环境标签对应的配置信息;Adding the environment tag to the query request, and sending the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; 接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序。The configuration information corresponding to the environment tag sent by the configuration center is received and returned to the application. 2.根据权利要求1所述的方法,其特征在于,所述基于所述环境分组策略,确定所述应用程序对应的环境标签,包括:2. The method according to claim 1, wherein determining the environment tag corresponding to the application based on the environment grouping strategy comprises: 获取所述应用程序对应的环境信息;Obtaining environment information corresponding to the application; 根据所述环境分组策略和所述环境信息,确定所述应用程序对应的环境标签;Determining an environment tag corresponding to the application program according to the environment grouping strategy and the environment information; 其中,所述环境信息包括软件环境信息、硬件环境信息、物理环境信息、应用场景环境信息中的至少一项。The environment information includes at least one of software environment information, hardware environment information, physical environment information, and application scenario environment information. 3.根据权利要求2所述的方法,其特征在于,所述环境分组策略为多个维度分别对应的分组策略,所述方法还包括:3. The method according to claim 2, wherein the environment grouping strategy is a grouping strategy corresponding to multiple dimensions respectively, and the method further comprises: 获取所述多个维度分别对应的分组策略的优先级;Obtaining priorities of the grouping strategies corresponding to the multiple dimensions respectively; 根据所述多个维度分别对应的分组策略的优先级,确定多个维度分别对应的环境标签的优先级。According to the priorities of the grouping strategies respectively corresponding to the multiple dimensions, the priorities of the environment tags respectively corresponding to the multiple dimensions are determined. 4.根据权利要求3所述的方法,其特征在于,所述将所述环境标签添加到所述查询请求中,并将添加了所述环境标签的查询请求发送至配置中心,包括:4. The method according to claim 3, characterized in that the step of adding the environment tag to the query request and sending the query request with the environment tag added to the configuration center comprises: 将所述多个维度分别对应的环境标签添加到所述查询请求中,并将添加了所述多个维度分别对应的环境标签的查询请求发送至配置中心。The environment tags corresponding to the multiple dimensions are added to the query request, and the query request with the environment tags corresponding to the multiple dimensions added is sent to the configuration center. 5.根据权利要求4所述的方法,其特征在于,所述接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序,包括:5. The method according to claim 4, characterized in that the receiving of the configuration information corresponding to the environment tag sent by the configuration center and returning the configuration information to the application comprises: 接收所述配置中心发送的各环境标签对应的配置信息,若所述各环境标签对应的配置信息存在相同配置项,则根据所述各环境标签的优先级顺序,确定所述各环境标签对应的配置信息的生效顺序信息;Receive configuration information corresponding to each environment tag sent by the configuration center, and if the configuration information corresponding to each environment tag has the same configuration item, determine the effective order information of the configuration information corresponding to each environment tag according to the priority order of each environment tag; 将所述各环境标签对应的配置信息和所述生效顺序信息返回给所述应用程序。The configuration information corresponding to each environment tag and the effectiveness sequence information are returned to the application. 6.根据权利要求4所述的方法,其特征在于,所述接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序,包括:6. The method according to claim 4, wherein the receiving the configuration information corresponding to the environment tag sent by the configuration center and returning it to the application comprises: 接收所述配置中心发送的各环境标签对应的配置信息,若所述各环境标签对应的配置信息不存在相同配置项,则将所述各环境标签对应的配置信息进行合并,将合并后的配置信息返回给所述应用程序。Receive configuration information corresponding to each environment tag sent by the configuration center. If the configuration information corresponding to each environment tag does not have the same configuration item, merge the configuration information corresponding to each environment tag and return the merged configuration information to the application. 7.一种应用程序的配置信息获取方法,其特征在于,所述方法应用于应用管控平台,包括:7. A method for obtaining configuration information of an application, characterized in that the method is applied to an application management and control platform, comprising: 获取应用程序的环境分组策略;Get the application's environment grouping strategy; 将所述环境分组策略发送至所述服务代理组件,以使所述服务代理组件基于所述环境分组策略,确定所述应用程序对应的环境标签,所述环境标签用于从配置中心获取配置信息。The environment grouping strategy is sent to the service proxy component, so that the service proxy component determines the environment tag corresponding to the application based on the environment grouping strategy, and the environment tag is used to obtain configuration information from a configuration center. 8.一种应用程序的配置信息获取方法,其特征在于,所述方法应用于配置中心,包括:8. A method for obtaining configuration information of an application, characterized in that the method is applied to a configuration center and comprises: 在接收到服务代理组件发送的应用程序的目标配置信息的查询请求的情况下,从所述查询请求中获取所述目标配置信息的目标环境标签;所述目标环境标签是所述服务代理组件基于应用管控平台发送的环境分组策略确定的;In the case of receiving a query request for target configuration information of an application sent by a service proxy component, obtaining a target environment tag of the target configuration information from the query request; the target environment tag is determined by the service proxy component based on an environment grouping strategy sent by an application management and control platform; 基于所述目标环境标签,在所述应用程序的多个带有环境标签的配置信息中确定所述目标配置信息并发送至所述服务代理组件,以使所述服务代理组件将所述目标配置信息发送至所述应用程序。Based on the target environment tag, the target configuration information is determined from a plurality of configuration information with environment tags of the application program and sent to the service agent component, so that the service agent component sends the target configuration information to the application program. 9.一种应用程序的配置信息获取方法,其特征在于,所述方法应用于服务代理组件,包括:9. A method for obtaining configuration information of an application, characterized in that the method is applied to a service proxy component, comprising: 获取应用程序的配置信息的查询请求,从应用管控平台获取所述应用程序对应的环境标签;Obtain a query request for the configuration information of the application, and obtain the environment tag corresponding to the application from the application management and control platform; 将所述环境标签添加到所述查询请求中,并将添加了所述环境标签的查询请求发送至配置中心,以使所述配置中心获取所述环境标签对应的配置信息;Adding the environment tag to the query request, and sending the query request with the environment tag added to the configuration center, so that the configuration center obtains the configuration information corresponding to the environment tag; 接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序。The configuration information corresponding to the environment tag sent by the configuration center is received and returned to the application. 10.一种应用程序的配置信息获取方法,其特征在于,所述方法应用于应用管控平台,包括:10. A method for obtaining configuration information of an application, characterized in that the method is applied to an application management and control platform, comprising: 获取应用程序的环境分组策略;Get the application's environment grouping strategy; 根据所述环境分组策略,确定所述应用程序对应的环境标签;Determining an environment tag corresponding to the application program according to the environment grouping strategy; 将所述环境标签发送至所述服务代理组件,以使所述服务代理组件根据所述环境标签从配置中心获取配置信息,并返回给所述应用程序。The environment tag is sent to the service proxy component, so that the service proxy component obtains configuration information from a configuration center according to the environment tag and returns the configuration information to the application. 11.一种应用程序的配置信息获取系统,其特征在于,所述系统包括服务代理组件、应用管控平台和配置中心;11. A system for acquiring configuration information of an application, characterized in that the system comprises a service proxy component, an application management and control platform and a configuration center; 所述应用管控平台,用于获取应用程序的环境分组策略;将所述环境分组策略发送至所述服务代理组件;The application management and control platform is used to obtain the environment grouping strategy of the application program; and send the environment grouping strategy to the service proxy component; 所述服务代理组件,用于获取应用程序的配置信息的查询请求,从应用管控平台获取所述应用程序的环境分组策略;基于所述环境分组策略,确定所述应用程序对应的环境标签;将所述环境标签添加到所述查询请求中,并将添加了所述环境标签的查询请求发送至配置中心;接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序;The service proxy component is used to obtain a query request for configuration information of an application, obtain the environment grouping strategy of the application from the application management and control platform; determine the environment tag corresponding to the application based on the environment grouping strategy; add the environment tag to the query request, and send the query request with the environment tag added to the configuration center; receive the configuration information corresponding to the environment tag sent by the configuration center, and return it to the application; 所述配置中心,用于在接收到所述服务代理组件发送的所述应用程序的目标配置信息的查询请求的情况下,从所述查询请求中获取所述目标配置信息的目标环境标签;所述目标环境标签是所述服务代理组件基于应用管控平台发送的环境分组策略确定的;基于所述目标环境标签,在所述应用程序的多个带有环境标签的配置信息中确定所述目标配置信息并发送至所述服务代理组件。The configuration center is used to obtain the target environment tag of the target configuration information from the query request for the target configuration information of the application sent by the service agent component when receiving the query request for the target configuration information of the application; the target environment tag is determined by the service agent component based on the environment grouping strategy sent by the application management and control platform; based on the target environment tag, the target configuration information is determined from multiple configuration information with environment tags of the application and sent to the service agent component. 12.一种应用程序的配置信息获取系统,其特征在于,所述系统包括服务代理组件、应用管控平台和配置中心;12. A system for acquiring configuration information of an application, characterized in that the system comprises a service proxy component, an application management and control platform and a configuration center; 所述应用管控平台,用于获取应用程序的环境分组策略;根据所述环境分组策略,确定所述应用程序对应的环境标签;将所述环境标签发送至所述服务代理组件;The application management and control platform is used to obtain an environment grouping strategy for an application program; determine an environment tag corresponding to the application program according to the environment grouping strategy; and send the environment tag to the service proxy component; 所述服务代理组件, 用于获取应用程序的配置信息的查询请求,从应用管控平台获取所述应用程序对应的环境标签;将所述环境标签添加到所述查询请求中,并将添加了所述环境标签的查询请求发送至配置中心;接收所述配置中心发送的所述环境标签对应的配置信息,并返回给所述应用程序;The service proxy component is used to obtain a query request for configuration information of an application, obtain an environment tag corresponding to the application from an application management and control platform; add the environment tag to the query request, and send the query request with the environment tag added to a configuration center; receive configuration information corresponding to the environment tag sent by the configuration center, and return it to the application; 所述配置中心,用于在接收到所述服务代理组件发送的所述应用程序的目标配置信息的查询请求的情况下,从所述查询请求中获取所述目标配置信息的目标环境标签;基于所述目标环境标签,在所述应用程序的多个带有环境标签的配置信息中确定所述目标配置信息并发送至所述服务代理组件。The configuration center is used to, upon receiving a query request for the target configuration information of the application sent by the service agent component, obtain the target environment tag of the target configuration information from the query request; based on the target environment tag, determine the target configuration information from multiple configuration information with environment tags of the application and send it to the service agent component. 13.一种电子设备,其特征在于,所述电子设备包括存储器、处理器及存储在存储器上的计算机程序,所述处理器在执行所述计算机程序时实现权利要求1-10中任一项所述的方法。13. An electronic device, characterized in that the electronic device comprises a memory, a processor and a computer program stored in the memory, and the processor implements the method according to any one of claims 1 to 10 when executing the computer program. 14.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-10中任一项所述的方法。14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented. 15.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现权利要求1-10中任一项所述的方法。15. A computer program product, characterized in that the computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
CN202411311300.1A 2024-09-20 2024-09-20 Method, system, device, product and medium for obtaining configuration information of application program Active CN118819685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411311300.1A CN118819685B (en) 2024-09-20 2024-09-20 Method, system, device, product and medium for obtaining configuration information of application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411311300.1A CN118819685B (en) 2024-09-20 2024-09-20 Method, system, device, product and medium for obtaining configuration information of application program

Publications (2)

Publication Number Publication Date
CN118819685A true CN118819685A (en) 2024-10-22
CN118819685B CN118819685B (en) 2025-03-11

Family

ID=93085588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411311300.1A Active CN118819685B (en) 2024-09-20 2024-09-20 Method, system, device, product and medium for obtaining configuration information of application program

Country Status (1)

Country Link
CN (1) CN118819685B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168913A1 (en) * 2003-01-02 2007-07-19 Sekhar Sarukkai Integration of context-sensitive run-time metrics into integrated development environments
US20150089031A1 (en) * 2013-09-20 2015-03-26 Oracle International Corporation System and method for providing configuration modularity in an application server, cloud platform, or other environment
US9274811B1 (en) * 2007-02-16 2016-03-01 Bladelogic, Inc. System and method for cloud provisioning and application deployment
US20200065128A1 (en) * 2018-08-27 2020-02-27 Vmware, Inc. Modular reinforcement-learning-based application manager
CN112463256A (en) * 2020-12-11 2021-03-09 微医云(杭州)控股有限公司 Method, system, electronic device and storage medium for determining configuration file
CN116820600A (en) * 2023-05-16 2023-09-29 曙光信息产业股份有限公司 Configuration method, configuration device, computer apparatus, storage medium, and program product
US20240248751A1 (en) * 2023-01-20 2024-07-25 Dell Products L.P. System and method for managing a migration of a production environment executing logical devices

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168913A1 (en) * 2003-01-02 2007-07-19 Sekhar Sarukkai Integration of context-sensitive run-time metrics into integrated development environments
US9274811B1 (en) * 2007-02-16 2016-03-01 Bladelogic, Inc. System and method for cloud provisioning and application deployment
US20150089031A1 (en) * 2013-09-20 2015-03-26 Oracle International Corporation System and method for providing configuration modularity in an application server, cloud platform, or other environment
US20200065128A1 (en) * 2018-08-27 2020-02-27 Vmware, Inc. Modular reinforcement-learning-based application manager
CN112463256A (en) * 2020-12-11 2021-03-09 微医云(杭州)控股有限公司 Method, system, electronic device and storage medium for determining configuration file
US20240248751A1 (en) * 2023-01-20 2024-07-25 Dell Products L.P. System and method for managing a migration of a production environment executing logical devices
CN116820600A (en) * 2023-05-16 2023-09-29 曙光信息产业股份有限公司 Configuration method, configuration device, computer apparatus, storage medium, and program product

Also Published As

Publication number Publication date
CN118819685B (en) 2025-03-11

Similar Documents

Publication Publication Date Title
US11726828B2 (en) Managing a virtualized application workspace on a managed computing device
US10198162B2 (en) Method for installing or upgrading an application
CN105338026B (en) The acquisition methods of data resource, device and system
US7587447B2 (en) Systems, methods and computer programs for implementing and accessing web services
CN105389191B (en) A kind of method for upgrading software based on LAN, device and system
US8296774B2 (en) Service-based endpoint discovery for client-side load balancing
WO2021073202A1 (en) Intelligent contract processing method, computer device and storage medium
WO2013143403A1 (en) Method and system for accessing website
CN101411146A (en) Method for consuming heterogenous services on heterogeneous devices using script plugins
CN109522055B (en) Connection preheating method and system based on distributed service calling
CN110532106B (en) Inter-process communication method, device, equipment and storage medium
CN113535419B (en) A service arrangement method and device
CN114090623A (en) Method and device for creating cache resources, electronic equipment and storage medium
CN111338829B (en) Calling method and device for remote procedure call service
CN1901547B (en) Method and device for generating web service policy agreement
CN111367685B (en) Interface calling method and device, computer equipment and storage medium
JP2002505491A (en) Apparatus and method for dynamic information certification in a distributed system
CN118819685A (en) Method, system, device, product and medium for obtaining configuration information of application program
JP4063573B2 (en) Device driver installation / execution method, installation / execution method, and program
CN117675757A (en) Background management method, device, equipment and medium of applet platform
US8499023B1 (en) Servlet-based grid computing environment using grid engines and switches to manage resources
CN115834734B (en) Communication method, communication device, electronic apparatus, and medium
CN111506846A (en) Web page generation method and device, electronic equipment and storage medium
WO2024114645A1 (en) Instantiation method for virtualization network function (vnf), and apparatus
CN115408175A (en) API calling method and device, electronic equipment and computer-readable storage medium

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
GR01 Patent grant
GR01 Patent grant