Method, system, device, product and medium for obtaining configuration information of application program
Through the service agent component, the environment grouping policy is obtained on the application management and control platform, the application's environment tag is determined, and the corresponding configuration information is obtained from the configuration center, which solves the problem of high configuration complexity in different environments of cloud-native applications and realizes efficient application configuration management.
Patent Information
- Application Number
- CN202411311300.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-09-20
AI Technical Summary
In complex cloud-native application scenarios, the configuration complexity of different environments of the application is high, and it relies on manual configuration parameters, resulting in inefficient configuration.
The query request for obtaining the application's configuration information through the service agent component, obtaining the environment grouping policy from the application management platform, determining the application's environment tag, adding it to the query request, and sending it to the configuration center to obtain the configuration information corresponding to the environment tag.
It realizes self-awareness of application environment tags, avoids manual parameter configuration, reduces the complexity of configurations in different environments, and improves application configuration efficiency.
Smart Images

Figure CN118819685B_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] 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.
[0003] 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
[0004] 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.
[0005] 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.
[0006] 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.
[0007] 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.
[0008] 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.
[0009] 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.
[0010] 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.
[0011] 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.
[0012] 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.
[0013] 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.
[0014] 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.
[0015] Compared with the prior art, this application has the following advantages:
[0016] 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.
[0017] 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.
[0018] 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
[0019] 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.
[0020] Figure 1 It is a schematic diagram of configuring a physical model according to an embodiment of the present application.
[0021] Figure 2 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.
[0022] Figure 3 This is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application.
[0023] Figure 4 This is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application.
[0024] Figure 5 This is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application.
[0025] Figure 6 This is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application.
[0026] Figure 7 This is a flowchart of a method for obtaining configuration information of an application program according to an embodiment of the present application.
[0027] Figure 8 This is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.
[0028] Fig. 9 This is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.
[0029] Fig.10 This is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.
[0030] Fig.11 This is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.
[0031] Fig.12 This is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application.
[0032] Fig.13 A block diagram of an electronic device used to implement an embodiment of the present application. DETAILED DESCRIPTION
[0033] 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.
[0034] 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.
[0035] 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.
[0036] Specific application scenarios implemented in this application may include grayscale release of applications, subscription configuration of applications according to specifications, etc.
[0037] 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.
[0038] 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.
[0039] Figure 1 This 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. The configuration center receives configuration information of an application. The configuration information includes multiple configuration entities. Each configuration entity includes a configuration name, a namespace, and configuration content (such as Figure 1 The configuration content of each configuration entity includes multiple configuration items ( Figure 1). 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 the name, namespace, environment label and specific configuration items. The default configuration content includes the name, namespace and specific configuration items. Among them, the default configuration content part is used to save the configuration content without the environment label, and is used as the default returned configuration content when subscribing to the configuration without the environment label; the configuration content part with the environment label is used to store the configuration content with the environment label published by the user.
[0040] Figure 2 The following 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:
[0041] 1. Update the configuration and set the tag. Specifically, the receiving user calls the configuration center interface or directly uses the configuration center's front-end page (such as Figure 2 When updating configuration information, a label option is added to the configuration information. For example, the configuration information A is labeled test, indicating that it is used in a test environment.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] The service proxy component is aware of the environment labels (e.g. Figure 2 "Grouping environment identifier A" or "Grouping environment identifier B" shown).
[0049] 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.
[0050] Optionally, the service proxy component can obtain the environment label by directly identifying the container label, environment variables, specifying the path configuration, etc.
[0051] 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.
[0052] 5. Inject environment tag query configuration.
[0053] 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.
[0054] 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.
[0055] In the related art, the ability of an application to subscribe to configuration is to subscribe to a unique configuration information, which 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.
[0056] 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.
[0057] 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.
[0058] like Figure 3 The flowchart of the method for obtaining configuration information of an application program according to an embodiment of the present application is shown, including:
[0059] 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.
[0060] Step S302: Determine the environment tag corresponding to the application based on the environment grouping strategy.
[0061] 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.
[0062] Step S304: receiving configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application.
[0063] 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.
[0064] 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.
[0065] 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.
[0066] 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.
[0067] Different environments use different configuration information, including but not limited to:
[0068] 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.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] The specific implementation process of the above steps is described in detail below through multiple implementation methods.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] For example, given two environment tags [a] and [b], the priority of [a] is higher than that of [b].
[0093] [a] The corresponding configuration information is the configuration values corresponding to configuration items config1 and config2 respectively: config1=configvalue1-a; config2=configvalue2;
[0094] [b] The corresponding configuration information is the configuration values corresponding to configuration items config1 and config3 respectively: config1=configvalue1-b; config3=configvalue3
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] like Figure 4 The flowchart of the method for obtaining configuration information of an application program according to an embodiment of the present application is shown, including:
[0101] Step S401, obtaining the environment grouping strategy of the application.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] like Figure 5 The flowchart of the method for obtaining configuration information of an application program according to an embodiment of the present application is shown, including:
[0108] 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;
[0109] 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.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] 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;
[0115] 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;
[0116] 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.
[0117] 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.
[0118] 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.
[0119] 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.
[0120] like Figure 6 The flowchart of the method for obtaining configuration information of an application program according to an embodiment of the present application is shown, including:
[0121] 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.
[0122] 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.
[0123] The execution subject of this embodiment is a service proxy component.
[0124] The service proxy component obtains the environment tag corresponding to the application from the application management and control platform in the following two ways:
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] like Figure 7 The flowchart of the method for obtaining configuration information of an application program according to an embodiment of the present application is shown, including:
[0132] Step S701, obtaining an environment grouping strategy of an application program;
[0133] Step S702, determining the environment tag corresponding to the application according to the environment grouping strategy;
[0134] 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.
[0135] The execution subject of this embodiment is the application management and control platform.
[0136] The application management and control platform determines the environment label corresponding to the application according to the environment grouping strategy, including two implementation methods:
[0137] 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.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] 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:
[0142] 1. The configuration center receives the user's interface call instructions, or receives the configuration information published by the user.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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.
[0149] 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;
[0150] 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;
[0151] 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.
[0152] 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.
[0153] 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. Figure 8 The structure diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application is shown. The device is applied to a service proxy component, and the device includes:
[0154] 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.
[0155] The determination module 802 is used to determine the environment tag corresponding to the application program based on the environment grouping strategy.
[0156] 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.
[0157] 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. The environment information includes at least one of software environment information, hardware environment information, physical environment information, and application scenario environment information.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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. Fig. 9 The figure is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application. The device is applied to an application management and control platform, and the device includes:
[0164] An acquisition module 901 is used to acquire an environment grouping strategy of an application program;
[0165] 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.
[0166] 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.
[0167] 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. Fig.10 The figure is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application. The device is applied to a configuration center and includes:
[0168] 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;
[0169] 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.
[0170] 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.
[0171] 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. Fig.11 The structure diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application is shown. The device is applied to a service proxy component and includes:
[0172] The acquisition module 1101 is used to obtain a query request for configuration information of the application program and obtain an environment tag corresponding to the application program from the application management and control platform;
[0173] 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.
[0174] 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.
[0175] 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. Fig.12 The figure is a structural block diagram of a device for acquiring configuration information of an application program according to an embodiment of the present application, and the device is applied to an application management and control platform, and includes:
[0176] An acquisition module 1201 is used to acquire an environment grouping strategy of an application program;
[0177] A determination module 1202, configured to determine an environment tag corresponding to the application program according to an environment grouping strategy;
[0178] 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.
[0179] 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.
[0180] Fig.13 FIG. 1 is a block diagram of an electronic device used to implement an embodiment of the present application. Fig.13 As shown, the electronic device includes: a memory 1310 and a processor 1320. 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.
[0181] The electronic device also includes:
[0182] The communication interface 1330 is used to communicate with external devices and perform data exchange transmission.
[0183] 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. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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.
[0189] 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.
[0190] 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).
[0191] 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.
[0192] 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.
[0193] 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.
[0194] 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.
[0195] 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.
[0196] 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.
[0197] 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.
[0198] 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
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; the environment tag indicates the environment in which the application is located; 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; Receive configuration information corresponding to the environment tag sent by the configuration center, and return it to the application; The step of determining the environment tag corresponding to the application based on the environment grouping strategy includes: 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.
2. The method according to claim 1, characterized in that The environment grouping strategy is a grouping strategy corresponding to multiple dimensions respectively, and the method further includes: 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.
3. The method according to claim 2, characterized in that The adding the environment tag to the query request, and sending the query request with the environment tag added to the configuration center, includes: 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.
4. The method according to claim 3, characterized in that The receiving the configuration information corresponding to the environment tag sent by the configuration center and returning it to the application program includes: 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.
5. The method according to claim 3, characterized in that: The receiving the configuration information corresponding to the environment tag sent by the configuration center and returning it to the application program includes: 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.
6. A method for obtaining configuration information of an application, characterized in that: The method is applied to an application management and control platform, and includes: Get the application's environment grouping strategy; Sending 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, the environment tag is used to obtain configuration information from the configuration center; the environment tag indicates the environment where the application is located; The service proxy component determines the environment tag corresponding to the application based on the environment grouping strategy in the following manner: 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.
7. A method for obtaining configuration information of an application, characterized in that: The method is applied to a configuration center and includes: 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 the environment grouping strategy sent by the application management and control platform; the target environment tag indicates the environment in which the application is located; Based on the target environment tag, determining the target configuration information from a plurality of configuration information with environment tags of the application program and sending 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 target environment tag is determined by the service agent component in the following manner: 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.
8. A method for obtaining configuration information of an application, characterized in that: The method is applied to a service proxy component, comprising: A query request for obtaining configuration information of an application is obtained, and an environment tag corresponding to the application is obtained from an application management and control platform; the environment tag indicates the environment in which the application is located; the environment tag is calculated by the application management and control platform according to the environment grouping strategy when creating the application; or the environment tag is calculated in real time by the application management and control platform according to the environment grouping strategy after receiving the query request; 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.
9. A method for obtaining configuration information of an application, characterized in that: The method is applied to an application management and control platform, and includes: Get the application's environment grouping strategy; Determine the environment tag corresponding to the application according to the environment grouping strategy; the environment tag indicates the environment in which the application is located; the environment tag is calculated by the application management and control platform according to the environment grouping strategy when creating the application; or the environment tag is calculated in real time by the application management and control platform according to the environment grouping strategy after receiving the query request; 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.
10. A system for acquiring configuration information of an application, characterized in that: The system 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 a query request for configuration information of the application program and obtain an environment grouping strategy for the application program 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 configured to, upon receiving a query request for the target configuration information of the application sent by the service proxy component, obtain 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 strategy sent by the application management and control platform; Based on the target environment tag, determining the target configuration information from a plurality of configuration information with environment tags of the application program and sending the target configuration information to the service proxy component; Among them, when the service agent component determines the environment tag corresponding to the application based on the environment grouping strategy, it is used to: obtain the environment information corresponding to the application; 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.
11. A system for acquiring configuration information of an application, characterized in that: The system 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; send the environment tag to the service proxy component; the environment tag is calculated by the application management and control platform according to the environment grouping strategy when creating the application; or the environment tag is calculated in real time by the application management and control platform according to the environment grouping strategy after receiving the query request; The service proxy component 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 an 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; receiving configuration information corresponding to the environment tag sent by the configuration center, and returning it to the application; The configuration center is configured to, upon receiving a query request for the target configuration information of the application sent by the service proxy component, obtain a target environment tag for the target configuration information from the query request; 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 proxy component.
12. 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 9 when executing the computer program.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
14. 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 9 is implemented.
Citation Information
Patent Citations
Method and system for determining configuration file, electronic equipment and storage medium
CN112463256A
System and method for managing a migration of a production environment executing logical devices
US20240248751A1