Method and apparatus for determining application configuration information

By using predefined placeholders to replace environment variable values ​​in configuration information, the problem of complex configuration file history is solved, thereby simplifying application management and improving the accuracy and efficiency of configuration information.

CN119883407BActive Publication Date: 2025-11-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411941743.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-11-11
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In existing technologies, directly replacing the values ​​of environment variables in configuration files leads to complex configuration file history and increases the difficulty of application management.

Method used

By using predefined placeholders to replace environment-specific environment variable values, and by receiving application configuration requests, determining target parameter values ​​and replacing placeholders in the basic configuration information, target configuration information for the target application environment is generated.

Benefits of technology

It reduces the number of files recording configuration information updates, simplifies application version management, and improves the accuracy and efficiency of configuration information management when applications switch between different environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883407B_ABST
    Figure CN119883407B_ABST
Patent Text Reader

Abstract

The application discloses a kind of application configuration information determination method and device, it is related to cloud computing field.The method comprises the following steps: receiving application configuration request, wherein, application configuration request carries the application identification of target application, and the environment identification corresponding to target application environment;In response to application configuration request, determine the basic configuration information corresponding to application identification, wherein, basic configuration information includes predetermined placeholder, predetermined placeholder is the placeholder to be replaced, and the target parameter value under target application environment is to be replaced;Determine the target parameter value corresponding to environment identification;Using target parameter value, replace predetermined placeholder in basic configuration information, obtain target configuration information under target application environment.By the present application, the variable value of the environment variable in the configuration file is directly replaced in the related technology, which leads to the problem of complex configuration file history record and increased application management difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and more specifically, to a method and apparatus for determining application configuration information. Background Technology

[0002] Application configuration information has specific configuration parameter values ​​in different deployment environments. Configuring different configuration information for different deployment environments is fundamental to ensuring that the application can run normally in the corresponding environment. Currently, the method used is to configure a corresponding configuration file for each environment and manually replace the environment variable values ​​in the configuration file. However, this method will cause changes to the configuration file content, increase the complexity of the configuration process version log file, and increase the difficulty of application version management.

[0003] There is currently no effective solution to the problem that directly replacing the values ​​of environment variables in configuration files leads to complex configuration file history and increases the difficulty of application management. Summary of the Invention

[0004] The main objective of this application is to provide a method and apparatus for determining application configuration information, so as to solve the problem in related technologies that directly replacing the variable values ​​of environment variables in the configuration file leads to complex configuration file history and increases the difficulty of application management.

[0005] To achieve the above objectives, according to one aspect of this application, a method for determining application configuration information is provided. The method includes: receiving an application configuration request, wherein the application configuration request carries an application identifier of a target application and an environment identifier corresponding to the target application environment; responding to the application configuration request, determining basic configuration information corresponding to the application identifier, wherein the basic configuration information includes a predetermined placeholder, the predetermined placeholder being a placeholder to be replaced with a target parameter value in the target application environment; determining a target parameter value corresponding to the environment identifier; and replacing the predetermined placeholder in the basic configuration information with the target parameter value to obtain target configuration information in the target application environment.

[0006] To achieve the above objectives, according to another aspect of this application, an application configuration information determining apparatus is provided. The apparatus includes: a receiving module for receiving an application configuration request, wherein the application configuration request carries an application identifier of a target application and an environment identifier corresponding to the target application environment; a first determining module for determining basic configuration information corresponding to the application identifier in response to the application configuration request, wherein the basic configuration information includes a predetermined placeholder, the predetermined placeholder being a placeholder to be replaced with a target parameter value in the target application environment; a second determining module for determining the target parameter value corresponding to the environment identifier; and a first replacing module for replacing the predetermined placeholder in the basic configuration information with the target parameter value to obtain the target configuration information in the target application environment.

[0007] In this embodiment, an application configuration request is received, which carries an application identifier of the target application and an environment identifier corresponding to the target application environment. In response to the application configuration request, basic configuration information corresponding to the application identifier is determined. This basic configuration information includes a predetermined placeholder, which is a placeholder to be replaced with a target parameter value in the target application environment. A target parameter value corresponding to the environment identifier is determined. The target parameter value is then used to replace the predetermined placeholder in the basic configuration information to obtain the target configuration information in the target application environment. By replacing the predetermined placeholder in the basic configuration information with the target parameter value, the target configuration information in the target application environment is obtained. Since predetermined placeholders are used in the basic configuration information to replace specific environment variable values ​​in different deployment environments, the predetermined placeholders in the basic configuration information can be directly replaced after obtaining the target parameter value to obtain the target configuration information. Determining the target configuration information in this way reduces the number of files recording configuration information updates, simplifies application version management, and solves the problem in related technologies where directly replacing environment variable values ​​in configuration files leads to complex configuration file history and increased application management difficulty. Attached Figure Description

[0008] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0009] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a method for determining application configuration information, according to an embodiment of this application.

[0010] Figure 2 This is a flowchart of a method for determining application configuration information according to an embodiment of this application;

[0011] Figure 3 This is a schematic diagram of an application configuration information determination device according to an embodiment of this application;

[0012] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0013] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0014] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0015] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0016] YAML is a highly readable format used to express data serialization.

[0017] Patch: A differential update method for modifying existing files or configurations. In the context of container orchestration tools, it is mainly used to fine-tune or override the basic configuration for specific environments or requirements when deploying applications. It is usually a YAML file containing instructions to modify the original configuration. It can be used to add, modify, or delete fields in the existing configuration to make it conform to specific environment or deployment requirements.

[0018] ConfigMap: A fundamental resource object in container orchestration platforms used to store non-confidential configuration data. Within the context of a container orchestration platform, configuration data can include various application parameters, environment variables, command-line arguments, and any other non-sensitive settings. ConfigMap provides a mechanism to inject configuration information into containers without modifying application code or the container image.

[0019] The `params` directory specifically refers to the directory used to manage application configurations for container orchestration platforms. In the file directory structure of container orchestration tools, the `params` directory is often used to centrally manage variable parameters, enabling quick and accurate configuration adjustments when deploying the same application in different environments.

[0020] The `base` directory is the root directory for configuration files. It contains container orchestration platform resource definitions and variable definitions common to all environments. When using container orchestration tools, various overrides are applied starting from the `base` directory to adapt to specific environments.

[0021] The overlay directory is a dedicated directory for storing configuration overlays for specific environments or scenarios. It allows users to customize and adjust configuration parameters for different environments (such as development, testing, and production environments) or different deployment scenarios while keeping the basic configuration unchanged.

[0022] The `variables` directory is primarily responsible for storing and managing all configuration-related variables. In container orchestration platform deployments, variables typically refer to values ​​that may need to be changed in different environments or deployment contexts, such as database connection strings, service ports, and environment identifiers. The configuration files under the `variables` directory allow you to define the names and default values ​​of these variables, as well as how they are referenced by other configuration files.

[0023] The resources directory contains the actual resource definition files in the container orchestration platform cluster. These files describe the specific configurations of the services and resources required by the application at runtime, including container images, port mappings, environment variable settings, etc.

[0024] The application.properties file is a commonly used configuration file format in programming language applications. It is a simple key-value pair configuration file that uses the property file format to store configuration parameters. Each configuration item consists of a key and a value, separated by an equal sign (=) or a colon (:).

[0025] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0026] Example 1

[0027] According to an embodiment of this application, an embodiment of a method for determining application configuration information is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0028] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a method for determining application configuration information, according to an embodiment of this application. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0029] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0030] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the application configuration information determination method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned application configuration information determination method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0031] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0032] The display can be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0033] In the above operating environment, this application provides a method for determining application configuration information. Figure 2 This is a flowchart of a method for determining application configuration information according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0034] Step S202: Receive an application configuration request, wherein the application configuration request carries the application identifier of the target application and the environment identifier corresponding to the target application environment.

[0035] In step S202 of this application, an application configuration request carrying an application identifier of the target application and an environment identifier corresponding to the target application environment is received.

[0036] This involves application configuration requests, which are requests from users to change, update, or retrieve configuration information for a specific application. These requests are typically initiated during application deployment, upgrades, or environment switching to ensure the application can correctly adapt to its operating environment.

[0037] This involves the target application, which refers to a specific software application that needs to be modified by changing the defined configuration parameters to adapt to the operating requirements of different environments.

[0038] This involves application identifiers, which are used to identify the target application, such as the application's name, tag, or namespace, and can help identify and process requests from the target application.

[0039] This involves the target application environment, which refers to the specific environment or stage in which the target application runs. During the software development and deployment lifecycle, an application will go through multiple different environments, each with its specific purpose and configuration requirements, such as development environment (dev), testing environment (test), pre-production environment (staging), and production environment (prod).

[0040] This involves environment identifiers, which are used to distinguish different operating environments of a target application. Environment identifiers are crucial in configuration management, determining which configuration parameters should be loaded or modified.

[0041] In this step, an application configuration request is received. This request contains two key pieces of information: an application identifier and an environment identifier. These two pieces of information are used to locate and process the correct application configuration. The environment identifier identifies the environment in which the application needs to be configured, providing independent and customized configuration information for each environment, thus enhancing the application's stability and security.

[0042] Step S204: In response to the application configuration request, determine the basic configuration information corresponding to the application identifier. The basic configuration information includes a predefined placeholder, which is a placeholder to be replaced and is to be replaced with a target parameter value in the target application environment.

[0043] In step S204 provided in this application, basic configuration information corresponding to the application identifier is determined in response to the application configuration request.

[0044] This involves basic configuration information, which refers to configuration information that is universally applicable throughout the application's lifecycle, regardless of the environment in which it runs. This information includes the application's basic settings and parameters, but some parameters need to be adjusted depending on the operating environment. These parameters are represented by predefined placeholders in the basic information.

[0045] This involves pre-defined placeholders, which are special markers or symbols that are set in advance in the basic configuration information and are waiting to be replaced by specific parameter values ​​in a specific environment configuration.

[0046] This involves target parameter values, which refer to the actual parameter values ​​required by the configuration information of the target application in the target application environment.

[0047] In this step, the corresponding basic configuration information is located and obtained by identifying the application identifier in the application configuration request. This basic configuration information includes predefined placeholders, which represent environment parameter values ​​that will be replaced in the target application environment.

[0048] This step, using placeholders in the basic configuration information, ensures that the basic configuration information itself is independent of the environment, thereby simplifying configuration management and avoiding the complexity and redundancy of maintaining separate configuration files for each environment. It also facilitates version control and auditing of application configurations. Furthermore, the standardized design of the basic configuration information makes configuration maintenance and application expansion easier; adding or deleting new environment variables can be accomplished by modifying the basic configuration information.

[0049] Step S206: Determine the target parameter value corresponding to the environmental identifier.

[0050] In step S206 of this application, the target parameter value corresponding to the environmental identifier is determined.

[0051] In this step, the environment-specific parameter values ​​are located and determined based on the environment identifier provided in the application configuration request. Each environment identifier corresponds to a specific set of parameter values, ensuring that the application can obtain the configuration information corresponding to the environment identifier when switching between different environments, reducing runtime issues caused by configuration errors.

[0052] This step identifies the target parameter values ​​corresponding to the environment identifier. These target parameter values ​​typically contain sensitive information bound to the environment identifier. Determining the target parameter values ​​corresponding to the environment identifier after receiving an application configuration request enables more secure parameter management, preventing sensitive information from being exposed or misused in inappropriate environments. Furthermore, by identifying the target parameter values ​​corresponding to the environment identifier, customized configurations can be provided for each environment, ensuring the application runs correctly and performs optimally in different environments. In addition, adding a new environment or modifying existing parameter values ​​can be achieved by modifying the parameter values ​​of the corresponding environment, without needing to modify the configuration content and basic configuration information of other environments, making application configuration management and maintenance simpler and more efficient.

[0053] It's important to note that determining target parameter values ​​also involves version control and auditing. Target parameter values ​​under each environment identifier can be version controlled to track historical changes, which is particularly important for complex application deployments and rollback scenarios. Furthermore, in industries such as fintech, healthcare, and telecommunications, applications need to operate in highly secure and regulated environments. Determining target parameter values ​​corresponding to environment identifiers not only ensures that the application adapts to the functional requirements of different environments but also meets industry-specific security and compliance requirements. For example, ensuring that database connection parameters in the production environment are up-to-date and secure, while being completely isolated from parameters in the development environment, prevents the leakage of production data and the potential impact of development operations on the production environment.

[0054] Step S208: Replace the predefined placeholders in the basic configuration information with the target parameter values ​​to obtain the target configuration information in the target application environment.

[0055] In step S208 provided in this application, the target parameter value is used to replace the predetermined placeholder in the basic configuration information to obtain the target configuration information in the target application environment.

[0056] This involves target configuration information, which refers to the final configuration information obtained after the target application is deployed to the target application environment, by replacing the predefined placeholders in the basic configuration information with target parameter values. This configuration information contains all the necessary parameter values ​​for the target application environment and is suitable for the operational requirements of the current target application environment.

[0057] In this step, after reading the target parameter values ​​associated with the environment identifier, all predefined placeholders are found in the basic configuration information and replaced with the read target parameter values, thereby generating the final configuration information adapted to the target application environment, i.e., the target configuration information.

[0058] This step replaces the placeholders in the basic configuration information with target parameter values, ensuring that the configuration information is accurate and applicable in each environment, thus avoiding application operation problems caused by configurations that are not adapted to the environment.

[0059] It's important to note that in actual deployments, this system can be tightly integrated with Continuous Integration / Continuous Deployment (CI / CD) processes to ensure that each deployment uses the latest and correct environment configuration. For example, when a microservice is migrated from development to production, the CI / CD system automatically detects the environment change, reads parameters such as database connection information from the production environment, injects these target parameter values ​​into the basic configuration information, replaces the corresponding placeholders, and generates the final production environment configuration file. This process not only improves the automation of deployment but also ensures the stability and security of the application in the production environment, avoiding failures or security vulnerabilities caused by improper configuration.

[0060] The method for determining application configuration information provided in this application embodiment receives an application configuration request, wherein the application configuration request carries an application identifier of the target application and an environment identifier corresponding to the target application environment; in response to the application configuration request, it determines basic configuration information corresponding to the application identifier, wherein the basic configuration information includes a predetermined placeholder, which is a placeholder to be replaced with a target parameter value in the target application environment; it determines the target parameter value corresponding to the environment identifier; and it uses the target parameter value to replace the predetermined placeholder in the basic configuration information to obtain the target configuration information in the target application environment. By using the target parameter value to replace the predetermined placeholder in the basic configuration information, the purpose of obtaining the target configuration information in the target application environment is achieved. Since the predetermined placeholder is used in the basic configuration information to replace the specific environment variable values ​​in different deployment environments, after obtaining the target parameter value, the predetermined placeholder in the basic configuration information can be directly replaced to obtain the target configuration information. Determining the target configuration information in this way reduces the number of files recording configuration updates, simplifies application version management, and solves the problem of complex configuration file history and increased application management difficulty caused by directly replacing environment variable values ​​in configuration files in related technologies. As a result, it achieves the effect of obtaining accurate configuration information when the application switches between different environments, and making application expansion and configuration maintenance easier.

[0061] Optionally, in the method for determining application configuration information provided in this application embodiment, the method for determining basic configuration information corresponding to an application identifier in response to an application configuration request includes: determining a basic configuration directory corresponding to a target application based on the application identifier, wherein the basic configuration directory includes a first file path corresponding to multiple basic configuration files; retrieving multiple basic configuration files based on the multiple first file paths, wherein each of the multiple basic configuration files includes partial configuration information corresponding to the application identifier; and determining basic configuration information based on the multiple partial configuration information.

[0062] This embodiment describes the specific steps for determining the basic configuration information corresponding to the application identifier in response to an application configuration request.

[0063] This involves the basic configuration directory, which is the directory that stores the basic configuration information of the application. The basic configuration directory provides a unified configuration management entry point for the application.

[0064] This involves basic configuration files, which are files containing the essential configuration information required for the application to run. These files contain placeholders in their configuration information so that they can be dynamically populated or adjusted based on the characteristics of the specific environment during deployment, adapting to different operating environments, such as development, testing, and production environments.

[0065] This involves the first file path, which refers to the path in the basic configuration directory that points to the basic configuration file.

[0066] This involves partial configuration information, which refers to a portion of the application configuration information stored in each basic configuration file within the basic configuration directory. This information may cover database connections, log levels, environment variables, etc., but each basic configuration file typically only covers one aspect of the configuration.

[0067] In this step, firstly, based on the application identifier in the received application configuration request, the specific directory storing basic configuration information, i.e., the basic configuration directory, is located. This directory contains multiple first file paths, which point to different configuration files containing parts of the application's configuration information—multiple basic configuration files. Then, based on these first file paths, all relevant basic configuration files are retrieved from the basic configuration directory. Each basic configuration file carries a portion of the application configuration, such as database settings or log levels. Finally, these scattered configuration parts are merged to construct the complete basic configuration information, which serves as the universal configuration foundation for the application to run in any environment.

[0068] This step merges scattered configuration information stored in multiple basic configuration files to construct a complete basic configuration file. This achieves modularization and detailed management of configurations. By sharing basic configuration information, it reduces storage and management resource requirements in multi-environment scenarios and improves the reusability of basic configuration information. Simultaneously, a unified basic configuration directory ensures centralized manageability and consistency of configuration information.

[0069] Optionally, in the method for determining application configuration information provided in the embodiments of this application, before determining the basic configuration directory corresponding to the target application based on the application identifier, the method further includes: creating a basic configuration management file in the basic configuration directory; and creating a first file path corresponding to multiple basic configuration files in the basic configuration management file.

[0070] This embodiment illustrates the specific steps for creating a basic configuration management file.

[0071] This involves basic configuration management files, which are files created in the basic configuration directory and used to organize and manage the basic configuration files that contain configuration information within that directory. The basic configuration management files define which basic configuration files should be included when building basic configuration information, how variable substitution should be performed, and how to inherit configurations from other environments.

[0072] In this step, firstly, a basic configuration management file needs to be created in the basic configuration directory. This file will serve as an index and manager for the basic configuration files, defining and controlling how to process and combine the various basic configuration files in the directory. Subsequently, in this basic configuration management file, first file paths corresponding to multiple basic configuration files are created. These paths will be used to call and integrate information from different basic configuration files to build a complete set of basic configuration information.

[0073] This step creates a basic configuration management file, making the organization and management of basic configuration information more organized. This helps maintain the clarity and readability of the configurations, facilitating understanding and maintenance by development and operations teams. By defining the primary file path in the basic configuration management file, all relevant basic configuration files can be automatically identified and integrated, avoiding the tedious manual configuration integration and reducing configuration discrepancies and omissions. Simultaneously, the basic configuration management file acts as the entry point for configuration information. By strictly controlling file references and parameter placeholder replacements, it ensures that all configurations adhere to established security policies and compliance requirements, reducing application failures caused by configuration errors.

[0074] Optionally, in the method for determining application configuration information provided in this application embodiment, the method for determining the target parameter value corresponding to the environment identifier includes: determining the environment directory corresponding to the target application environment based on the environment identifier, wherein the environment directory includes a parameter management file; and determining the target parameter value corresponding to the environment identifier based on the parameter management file.

[0075] This embodiment describes the specific steps for determining the target parameter value corresponding to the environmental identifier.

[0076] This involves environment directories, which are folders associated with a specific environment identifier and contain configuration parameters that are unique to that environment or need to be overridden. Environment directories make the management and maintenance of environment-specific configurations simpler and more organized.

[0077] This involves parameter management files, which are located in the environment directory and are used to manage the actual parameter values ​​for that environment. Parameter management files contain rules for overriding specific environment parameters, paths to additional configuration files that need to be referenced, and more.

[0078] In this step, firstly, the system locates the environment directory related to the target application environment using the environment identifier. The environment directory is a folder containing all unique configuration parameters for that environment. Next, the parameter management file is found within the environment directory. Finally, based on the definitions in the parameter management file, the target parameter values ​​corresponding to the environment identifier are determined.

[0079] This step uses environment identifiers and environment directories to identify parameter management files. Based on these files, target parameters corresponding to the target application environment are determined. This allows applications to dynamically adjust their configuration parameters when deployed to different environments to adapt to the specific needs of each environment without modifying application code or basic configuration information, thus improving configuration flexibility and environment adaptability.

[0080] Optionally, in the method for determining application configuration information provided in this application embodiment, the method for determining the target parameter value corresponding to the environment identifier based on the parameter management file includes: when there are multiple predetermined placeholders and multiple target parameter values, determining a modification placeholder and a default placeholder from the multiple predetermined placeholders, wherein the modification placeholder is a placeholder that uses the modified value of the default parameter value at the corresponding placeholder position, and the default placeholder is a placeholder that uses the default parameter value at the corresponding placeholder position; and determining a parameter definition file and a target parameter file based on the parameter management file, wherein the parameter definition file includes multiple predetermined placeholders and a target parameter value. The system defines the target parameter items corresponding to placeholders and the default parameter values ​​corresponding to multiple target parameter items. The target parameter file includes multiple modified parameter items corresponding to environment identifiers and the modified parameter values ​​corresponding to multiple modified parameter items. The multiple target parameter items include multiple modified parameter items. Based on the parameter definition file, the system determines the default parameter values ​​corresponding to the default placeholders and the modified parameter values ​​corresponding to the modified placeholders. Based on the default parameter values ​​corresponding to the default placeholders and the modified parameter values ​​corresponding to the modified placeholders, the system determines the target parameter values ​​corresponding to the multiple predefined placeholders.

[0081] This embodiment describes the specific steps for determining the target parameter value corresponding to the environment identifier based on the parameter management file.

[0082] This involves modifying placeholders. Modifying placeholders means that in the target application environment, the default values ​​of the target parameters corresponding to the predefined placeholders need to be replaced with the actual values ​​of the environment.

[0083] This involves default placeholders, which refer to a portion of the predefined placeholders. In the target application environment, the target parameter items corresponding to these placeholders do not need to have their default values ​​changed.

[0084] This involves default parameter values, which are the initial values ​​defined for the target parameter items corresponding to predefined placeholders in the basic configuration information. These values ​​are typically used when there is no specific environment coverage. These values ​​provide a configuration baseline, ensuring that the application has a basic running configuration in any environment.

[0085] This involves parameter definition files, which are located in the basic configuration directory and define the target parameter items corresponding to all predefined placeholders and their default parameter values.

[0086] This involves the target parameter file, which is a file located in the environment directory that contains the parameter modification values ​​corresponding to the environment identifier.

[0087] This involves target parameter items, which are configuration parameters that are expected to be replaced by specific environment values ​​when deploying and running the application. These parameters are typically represented by predefined placeholders in the base configuration file, and they may have different values ​​in different environments (such as development, testing, and production). The purpose of target parameter items is to improve configuration flexibility and environmental adaptability, ensuring that the application can run correctly in different environments.

[0088] This involves modifying parameter items. Modifying parameter items refers to setting target parameter values ​​in environment-specific configuration files, i.e., parameter definition files. These parameter items have default values ​​in the parameter definition files, but in specific environments, such as production environments, they need to be adjusted to more specific or safer values ​​to adapt to the specific needs of the environment.

[0089] This involves modifying parameter values, which refers to the specific values ​​corresponding to the modified parameter items. These values ​​are used in a specific environment corresponding to the environment identifier to replace the environment-specific parameter values ​​of some predefined placeholders (i.e., modified placeholders) in the base configuration file.

[0090] In this step, firstly, based on the parameter management file, the parameter definition file and the target parameter file are determined. The parameter definition file includes all target parameter items corresponding to predefined placeholders and their default values ​​(i.e., default parameter values). The target parameter file contains the modified parameter items that need to be overridden or modified in the target parameter items corresponding to the environment representation, along with their corresponding modified parameter values. Next, all default parameter values ​​are retrieved from the parameter definition file, and simultaneously, the modified parameter values ​​for the specific environment are read from the target parameter file. If a parameter value is not specified in the target parameter file, the system will use the parameter's default value. Finally, the default parameter values ​​retrieved from the parameter definition file are combined with the modified parameter values ​​from the target parameter file to generate the final set of target parameter values.

[0091] This step centralizes the management of parameter definitions and default values, reducing the workload of maintaining configurations across multiple environments and improving configuration efficiency and consistency. Furthermore, environment-specific parameter values ​​are stored in independent target parameter files, rather than being hard-coded into the base configuration information, increasing configuration security and protecting sensitive information. When parameters need to be updated, only the parameter definition file or the target parameter file for the specific environment needs to be modified, without needing to modify the base configuration information or the configuration files for each environment, simplifying the configuration update process.

[0092] Optionally, in the method for determining application configuration information provided in this application embodiment, determining the parameter definition file and the target parameter file based on the parameter management file includes: determining the reference identifier corresponding to the parameter management file; determining the parameter definition management file corresponding to the reference identifier, wherein the parameter definition management file includes a second file path corresponding to the parameter definition file; determining a third file path corresponding to the target parameter file based on the parameter management file; retrieving the parameter definition file based on the second file path, and retrieving the target parameter file based on the third file path.

[0093] This embodiment describes the specific steps for determining the parameter definition file and the target parameter file based on the parameter management file.

[0094] This involves reference identifiers, which are tags or keywords used in the parameter management file to reference other related files.

[0095] This involves parameter definition management files, which are located in the basic configuration directory and are used to manage the references of parameter definition files.

[0096] This involves a second file path, which refers to the path to the parameter definition file recorded in the parameter definition management file.

[0097] This involves a third file path, which refers to the path to the target parameter file recorded in the parameter management file.

[0098] This step begins by locating the reference identifiers in the parameter management files within the environment directory. These identifiers indicate the location of the parameter definition management files. Next, the parameter definition management files are located and parsed. Using the second file path within these files, the parameter definition files are found. These files define all target parameter items, including their default values. Simultaneously, using the third file path within the parameter management files, the target parameter files are located. These target parameter files contain the environment-specific override and modification values ​​for the parameters. Finally, the parameter definition files are retrieved based on the second file path, and the target parameter files are retrieved based on the third file path.

[0099] This step divides parameter configuration into two parts: parameter definition and parameter overriding. This modularizes the configuration process. The parameter definition file ensures standardized management of environment-independent configurations, while the target parameter file allows each environment to set its own parameter values. This enables applications to flexibly adapt to the characteristics of different environments, improving their environmental adaptability and deployability. The separation of the parameter definition file and the target parameter file makes configuration auditing and version control more intuitive and organized. Furthermore, the unified referencing and overriding of parameter management files simplifies the parameter update process.

[0100] Optionally, in the method for determining application configuration information provided in this application embodiment, the method for replacing the predetermined placeholder in the basic configuration information with the target parameter value to obtain the target configuration information in the target application environment includes: determining the predetermined placeholder based on the basic configuration information; replacing the predetermined placeholder with the target parameter value to obtain updated configuration information; checking the updated configuration information to determine whether the updated configuration information includes the predetermined placeholder, and obtaining a determination result; and determining the target configuration information in the target application environment if the determination result is that the updated configuration information does not include the predetermined placeholder.

[0101] This embodiment describes the specific steps for replacing predetermined placeholders in the basic configuration information with target parameter values ​​to obtain target configuration information in the target application environment.

[0102] This involves updating configuration information, which refers to the version of configuration information generated after replacing the predefined placeholders in the basic configuration information with target parameter values. It contains the actual configuration values ​​under a specific environment.

[0103] This involves determining the result, which refers to whether, during the process of checking the updated configuration information, there are any unreplaced predefined placeholders in the updated configuration information. For example, if there are no placeholders in the updated configuration information, the result is "The updated configuration information does not contain predefined placeholders."

[0104] In this step, firstly, the basic configuration information is parsed to search for and determine the location and name of all predefined placeholders. Then, the target parameter values ​​are used to replace these predefined placeholders. After the parameter value replacement is complete, the updated configuration information is checked to ensure that all predefined placeholders have been replaced with actual parameter values ​​and that no unprocessed placeholders remain. Only when the check confirms that the updated configuration information no longer contains any predefined placeholders will this version of the updated configuration information be officially determined as the target configuration information for use in the target application environment and for final application deployment.

[0105] This step ensures that all predefined placeholders in the basic configuration information are successfully replaced by the target parameter values, enabling the application to function smoothly in the target application environment and improving the security and stability of the target configuration information configuration process.

[0106] Based on the above embodiments and optional embodiments, an optional implementation method is provided, which is described in detail below.

[0107] In an optional embodiment of the present invention, configuration is involved for variable definition, variable reference, and variable modification (patch operation) in different file directories. Below is the code for setting up different file directories.

[0108]

[0109]

[0110]

[0111] The `params` directory consists of two parts: the base directory (basic configuration directory) and the overlays directory. Environment-independent content is placed in the base directory, while environment-dependent content is placed in the overlays directory. The base directory contains a `variables` directory and several `resources` directories. The overlays directory contains several environment directories, such as development environment (dev) and production environment (prod).

[0112] The following provides a detailed description of the steps for determining the application information configuration provided by the optional embodiments of the present invention.

[0113] Before configuring application information, it is necessary to define the basic configuration information and target parameter values ​​involved in the application configuration. The specific steps are as follows.

[0114] S1. Determine the parameter definition file.

[0115] Create a parameter definition file in the base directory, which includes all target variable items corresponding to the predefined placeholders and their corresponding default values. Also, create a parameter definition management file in the base directory to organize and manage the parameter definition files.

[0116] A1. Create a parameter definition file.

[0117] Create a parameter definition file (variable-list.ConfigMap.yaml) under / params / base / variables / . This file defines the default values ​​for all variables used in the application. In the file's data field, the key is the variable name, and the value is the variable's default value. Below is the specific code for defining the variables.

[0118]

[0119] The file defines the variable ENV_DATABASE_URL, whose default value is "this is databaseurl!".

[0120] Define a configuration file (var-references.yaml) under / params / base / variables. Configure the container orchestration tool in the file. The following is the specific code for the configuration operation.

[0121] varReference:

[0122] -kind:ConfigMap

[0123] path:data

[0124] The container orchestration tool will use this information to perform variable value lookup operations.

[0125] A2. Create a parameter definition management file.

[0126] Define the parameter definition management file under ` / params / base / variables`. This file manages the `variable-list.ConfigMap.yaml` file defined in the first step and references the defined configuration information. Additionally, the file defines "app".<app name> The . format name prefix can be inherited by other management files.

[0127] Below is the specific code content within the parameter definition management file.

[0128] kind: "Kustomization"

[0129] namePrefix:app.my-app-name.

[0130] resources:

[0131] variable-list.ConfigHap.yaml

[0132] configurations:

[0133] var-references.yaml

[0134] vars:

[0135] name:ENV_DATABASE_URL

[0136] objref:

[0137] kind:ConfigMap

[0138] nane:variable-list

[0139] apiVersion:v1

[0140] fieldref:

[0141] fieldPath:data.ENV_DATABASE_URL

[0142] S2. Create the basic configuration file.

[0143] Create multiple base configuration files in the base directory, replacing environment-related variables with placeholders to form a basic configuration template suitable for different environments. Simultaneously, define a base configuration management file in the base directory to organize and manage these multiple base configuration files.

[0144] It should be noted that the basic configuration management file and the parameter definition management file can inherit from each other.

[0145] B1. Create the basic configuration file.

[0146] Define the specific base configuration file (resources file). For example, if an application needs to use an application.properties file containing parameters that change with the environment, a resources file needs to be created for the application.properties file. The base configuration file (application-properties.ConfigMap.yaml file) is defined under / params / base / my-resources01. The parameters that change with the environment in the file are represented by placeholders (e.g., $(ENV_DATABASE_URL). These placeholders will be replaced with the actual parameter values ​​in the current environment in subsequent steps.

[0147] Below is some basic configuration information code.

[0148] apiversion:"v1"

[0149] kind:"ConfigMap"

[0150] metadata:

[0151] name:"application-properties"

[0152] data:

[0153] application.properties:

[0154] spring.datasource.url=$(ENV_DATABASE_URL)

[0155] At this point, the ENV_DATABASE_URL variable is replaced by the placeholder $(ENV_DATABASE_URL).

[0156] B2. Create basic configuration management files.

[0157] The basic configuration management file is defined under ` / params / base / my-resources01`. This file is responsible for organizing one or more resources files (such as the `application-properties.ConfigMap.yaml` file) that reference variables in the ` / params / base / my-resources01` directory. Additionally, the file defines "app".<app name> The . format name prefix can be inherited by other management files.

[0158] Below is the specific code content within the basic configuration management file.

[0159] kind: "Kustomization"

[0160] namePrefix:app.my-app-name.

[0161] resources:

[0162] -application-properties.ConfigMap.yaml

[0163] S3. Create files in the environment directory.

[0164] In the environment directory, create a target parameter file, which includes the parameter items whose default values ​​need to be modified in this environment, along with their corresponding modified values. Simultaneously, create a parameter management file in the environment directory to organize and manage the target parameter file.

[0165] It should be noted that parameter management files, basic configuration management files, and parameter definition management files can inherit from each other.

[0166] C1. Define the target parameter file.

[0167] Define target parameter files (i.e., patch files) for the variables in the variable list for different environments and different templates. For example, for the prod production environment and the my-template01 template, define the target parameter file (variable-list.ConfigMap.patch.yaml) for the variables in the production environment in the / params / overlays / prod / my-template01 directory. In this file, specify the actual values ​​of the variables.

[0168] Below is the specific code content within the target parameter file.

[0169] apiVersion:"v1"

[0170] kind:"ConfigMap"

[0171] metadata:

[0172] name: "variable-list"

[0173] data

[0174] ENV_DATABASE_URL:"[prod:my-template01]this is database url!"

[0175] The default value of the ENV_DATABASE_URL variable is "this is database url!", but here we specify the value of the variable as the actual value "[prod:my-template01]this is database url!".

[0176] C2. Define the parameter management file.

[0177] Parameter management files are defined separately for different environments and templates. For example, for the prod production environment and the my-template01 template, a parameter management file is defined under / params / overlays / prod / my-template01. This file inherits variable definition information (i.e., the parameter definition management file) and variable reference information (i.e., the basic configuration management file) as needed, and manages the variable-list.ConfigMap.patch.yaml file. Additionally, the file defines "template".<template name> A name prefix in the format of a period (.").

[0178] Below is the specific code content within the parameter management file.

[0179] kind:"Kustomization*

[0180] namePrefix:template.my-template01.

[0181] patchesStrategicMerge:

[0182] -"variable-list.ConfigMap.patch.yaml"

[0183] bases:

[0184] #Inherited variable definition information.

[0185] ".. / .. / .. / base / variables"

[0186] #Inherited variable reference information: Enter the corresponding directory here to specify which directory's files need to be replaced with placeholders.

[0187] -".., / base / my-resources01"

[0188] The above process is a prerequisite for determining application configuration information. The following is a detailed explanation of the steps for determining application information configuration.

[0189] S4. Receive an application configuration request, wherein the application configuration request carries the application identifier of the target application and the environment identifier corresponding to the target application environment.

[0190] Taking the production environment (prod) as an example, the production environment (prod) is the corresponding environment identifier.

[0191] S2. In response to the application configuration request, determine the basic configuration information corresponding to the application identifier.

[0192] Determine the corresponding basic configuration directory, then locate the basic configuration management file within that directory. Based on this file, find the multiple basic configuration files (application-properties.ConfigMap.yaml file) and determine the basic configuration information accordingly.

[0193] S3. Determine the target parameter values ​​corresponding to the environmental label.

[0194] Changes to variables defined in ` / params / overlays / prod / my-template01 / variable-list.ConfigMap.patch.yaml` are automatically applied to the ` / params / base / variables / variable-list.ConfigMap.yaml` file (patch operation). Specifically, the value of the `ENV_DATABASE_URL` variable is changed from "this is database url!" to "[prod:my-template01]this is database url!". This completes the modification of default parameter values ​​and generates a `ConfigMap` object named "template.my-template01.app.my-app-name.variable-list".

[0195] S4. Use the target parameter value to replace the predefined placeholder in the basic configuration information to obtain the target configuration information in the target application environment.

[0196] First, the actual value of the ENV_DATABASE_URL variable is automatically read from the ConfigMap object named "template.my-template01.app.my-app-name.variable-list". Then, the actual value is used to replace the "$(ENV_DATABASE_URL)" placeholder in the basic configuration information of the / params / base / my-resources01 / application-properties.ConfigMap.yaml file.

[0197] After the placeholder replacement operation is completed, a ConfigMap object named "template.my-template01.app.my-app-name.application-properties" is generated based on the base configuration information after variable replacement, namely the file / params / base / my-resources01 / application-properties.ConfigMap.yaml, for the application to use.

[0198] This completes the definition, referencing, and replacement of the variable ENV_DATABASE_URL.

[0199] The above optional implementation methods can achieve at least the following beneficial effects:

[0200] (1) For files whose parameters need to change with different environments (such as application.properties files), users do not need to maintain multiple application.properties files. They only need to maintain one file, / params / base / my-resources01 / application-properties.ConfigMap.yaml (which contains the complete content of application.properties files). The container orchestration tool will automatically replace the variable placeholders according to the user's definition.

[0201] (2) The / params / base / my-resources01 / directory file is defined once, and the resources file can be referenced repeatedly in different environments and different templates; the / params / base / variables / directory file is defined once, and the variables can be shared by different environments and different templates. Different environments and different templates can set the value of the variables as needed.

[0202] (3) Through "template". <template-name>.app. <app-name>The naming convention of ".variable-list" allows the same variable definition file, / params / base / variables / variable-list.ConfigMap.yaml, to generate multiple ConfigMap objects within the container orchestration platform cluster. Each ConfigMap object is accessed through... <template-name>and <app-name>The prefix information distinguishes between different ConfigMap objects, avoiding concurrency security issues caused by repeated modifications of the same ConfigMap object by different templates.

[0203] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0204] Example 2

[0205] This application also provides an apparatus for determining application configuration information. It should be noted that this apparatus can be used to execute the application configuration information determination method provided in this application. The following describes the apparatus for determining application configuration information provided in this application.

[0206] According to an embodiment of this application, an apparatus for implementing the above-described method for determining application configuration information is also provided. Figure 3 This is a schematic diagram of an application configuration information determination device provided in the embodiments of this application, such as... Figure 3 As shown, the device includes: a receiving module 302, a first determining module 304, a second determining module 306, and a first replacement module 308.

[0207] A receiving module 302 is used to receive an application configuration request, wherein the application configuration request carries an application identifier of the target application and an environment identifier corresponding to the target application environment; a first determining module 304 is connected to the receiving module 302, and is used to determine basic configuration information corresponding to the application identifier in response to the application configuration request, wherein the basic configuration information includes a predetermined placeholder, which is a placeholder to be replaced and is to be replaced with a target parameter value in the target application environment; a second determining module 306 is connected to the first determining module 304, and is used to determine a target parameter value corresponding to the environment identifier; a first replacing module 308 is connected to the second determining module 306, and is used to replace the predetermined placeholder in the basic configuration information with the target parameter value to obtain the target configuration information in the target application environment.

[0208] The application configuration information determination device provided in this application embodiment uses a first replacement module 308 to replace a predetermined placeholder in the basic configuration information with a target parameter value, thereby obtaining the target configuration information under the target application environment. Since a predetermined placeholder is used in the basic configuration information to replace specific environment variable values ​​in different deployment environments, the predetermined placeholder in the basic configuration information can be directly replaced after obtaining the target parameter value to obtain the target configuration information. Determining the target configuration information in this way reduces the number of files recording configuration information updates, simplifies application version management, and solves the problem in related technologies where directly replacing environment variable values ​​in configuration files leads to complex configuration file history records and increased application management difficulty. This achieves the effect of obtaining accurate configuration information when the application switches between different environments, making application expansion and configuration maintenance easier.

[0209] Optionally, the application configuration information determination device provided in this application embodiment further includes: a third determination module, used to determine the basic configuration directory corresponding to the target application based on the application identifier, wherein the basic configuration directory includes a first file path corresponding to multiple basic configuration files; a first retrieval module, used to retrieve multiple basic configuration files based on the multiple first file paths, wherein the multiple basic configuration files respectively include partial configuration information corresponding to the application identifier; and a fourth determination module, used to determine the basic configuration information based on the multiple partial configuration information.

[0210] Optionally, the application configuration information determination device provided in the embodiments of this application further includes: a first creation module, used to create a basic configuration management file in the basic configuration directory; and a second creation module, used to create a first file path corresponding to multiple basic configuration files in the basic configuration management file.

[0211] Optionally, the application configuration information determination device provided in this application embodiment further includes: a fifth determination module, used to determine an environment directory corresponding to the target application environment based on an environment identifier, wherein the environment directory includes a parameter management file; and a sixth determination module, used to determine a target parameter value corresponding to the environment identifier based on the parameter management file.

[0212] Optionally, the application configuration information determination device provided in this application embodiment further includes: a seventh determination module, used to determine a modification placeholder and a default placeholder from multiple predetermined placeholders when multiple predetermined placeholders and multiple target parameter values ​​are included, wherein the modification placeholder is a placeholder that uses the modified value of the default parameter value at the corresponding placeholder position, and the default placeholder is a placeholder that uses the default parameter value at the corresponding placeholder position; and an eighth determination module, used to determine a parameter definition file and a target parameter file based on a parameter management file, wherein the parameter definition file includes target parameters corresponding to the multiple predetermined placeholders respectively. The target parameter file includes multiple modified parameter items corresponding to environment identifiers, and multiple modified parameter values ​​corresponding to each modified parameter item. The target parameter file includes multiple modified parameter items. The ninth determining module is used to determine the default parameter value corresponding to the default placeholder based on the parameter definition file, and to determine the modified parameter value corresponding to the modified placeholder based on the target parameter file. The tenth determining module is used to determine the target parameter values ​​corresponding to multiple predetermined placeholders based on the default parameter values ​​corresponding to the default placeholders and the modified parameter values ​​corresponding to the modified placeholders.

[0213] Optionally, the application configuration information determination device provided in this application embodiment further includes: an eleventh determination module, used to determine a reference identifier corresponding to a parameter management file; a twelfth determination module, used to determine a parameter definition management file corresponding to the reference identifier, wherein the parameter definition management file includes a second file path corresponding to the parameter definition file; a thirteenth determination module, used to determine a third file path corresponding to a target parameter file based on the parameter management file; and a second retrieval module, used to retrieve the parameter definition file based on the second file path and retrieve the target parameter file based on the third file path.

[0214] Optionally, the application configuration information determination device provided in this application embodiment further includes: a twelfth determination module, used to determine a predetermined placeholder based on basic configuration information; a second replacement module, used to replace the predetermined placeholder with a target parameter value to obtain updated configuration information; a thirteenth determination module, used to check the updated configuration information, determine whether the updated configuration information includes the predetermined placeholder, and obtain a determination result; and a fourteenth determination module, used to determine the target configuration information in the target application environment when the determination result is that the updated configuration information does not include the predetermined placeholder.

[0215] It should be noted that the receiving module 302, the first determining module 304, the second determining module 306, and the first replacing module 308 mentioned above correspond to steps S202 to S208 in Embodiment 1. Multiple modules implement the same instances and application scenarios as their corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the modules or units mentioned above can be hardware or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). These modules can also run as part of a device in the computer terminal 10 provided in Embodiment 1.

[0216] Example 3

[0217] Embodiments of this application may provide an electronic device. Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 4 As shown, the electronic device may include: one or more ( Figure 4 Only one is shown in the diagram. The processor, memory, memory controller, and peripheral interface are connected to the radio frequency module, audio module, and display.

[0218] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0219] The processor can invoke information and applications stored in memory via a transmission device to perform the following steps: receiving an application configuration request, wherein the application configuration request carries an application identifier of the target application and an environment identifier corresponding to the target application environment; responding to the application configuration request, determining basic configuration information corresponding to the application identifier, wherein the basic configuration information includes a predetermined placeholder, the predetermined placeholder being a placeholder to be replaced with a target parameter value in the target application environment; determining the target parameter value corresponding to the environment identifier; and using the target parameter value to replace the predetermined placeholder in the basic configuration information to obtain the target configuration information in the target application environment.

[0220] The processor can also invoke information and applications stored in the memory via a transmission device to perform the following steps: determining the basic configuration directory corresponding to the target application based on the application identifier, wherein the basic configuration directory includes first file paths corresponding to multiple basic configuration files; retrieving multiple basic configuration files based on the multiple first file paths, wherein each of the multiple basic configuration files includes partial configuration information corresponding to the application identifier; and determining basic configuration information based on the multiple partial configuration information.

[0221] The processor can also access information and applications stored in memory via a transmission device to perform the following steps: create a basic configuration management file in the basic configuration directory; and create a first file path corresponding to multiple basic configuration files in the basic configuration management file.

[0222] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: determining the environment directory corresponding to the target application environment based on the environment identifier, wherein the environment directory includes a parameter management file; and determining the target parameter value corresponding to the environment identifier based on the parameter management file.

[0223] The processor can also invoke information and applications stored in memory via a transmission device to perform the following steps: When there are multiple predetermined placeholders and multiple target parameter values, determine a modification placeholder and a default placeholder from the multiple predetermined placeholders. The modification placeholder is a placeholder that uses the modified value of the default parameter value at the corresponding placeholder position, and the default placeholder is a placeholder that uses the default parameter value at the corresponding placeholder position. Based on the parameter management file, determine a parameter definition file and a target parameter file. The parameter definition file includes target parameter items corresponding to the multiple predetermined placeholders and default parameter values ​​corresponding to the multiple target parameter items. The target parameter file includes multiple modification parameter items corresponding to environment identifiers and modified parameter values ​​corresponding to the multiple modification parameter items. The multiple target parameter items include multiple modification parameter items. Based on the parameter definition file, determine the default parameter value corresponding to the default placeholder, and based on the target parameter file, determine the modified parameter value corresponding to the modification placeholder. Based on the default parameter values ​​corresponding to the default placeholders and the modified parameter values ​​corresponding to the modification placeholders, determine the target parameter values ​​corresponding to the multiple predetermined placeholders.

[0224] The processor can also call the information and application program stored in the memory through the transmission device to perform the following steps: determine the reference identifier corresponding to the parameter management file; determine the parameter definition management file corresponding to the reference identifier, wherein the parameter definition management file includes a second file path corresponding to the parameter definition file; determine the third file path corresponding to the target parameter file based on the parameter management file; retrieve the parameter definition file based on the second file path, and retrieve the target parameter file based on the third file path.

[0225] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: determine a predetermined placeholder based on the basic configuration information; replace the predetermined placeholder with the target parameter value to obtain updated configuration information; check the updated configuration information to determine whether the updated configuration information includes the predetermined placeholder, and obtain a determination result; if the determination result is that the updated configuration information does not include the predetermined placeholder, obtain the target configuration information in the target application environment.

[0226] This application provides a scheme for determining application configuration information. By replacing predetermined placeholders in the basic configuration information with target parameter values, the target configuration information for the target application environment is obtained. Since predetermined placeholders are used in the basic configuration information to replace specific environment variable values ​​in different deployment environments, the target configuration information can be directly obtained by replacing the predetermined placeholders in the basic configuration information after obtaining the target parameter values. Determining the target configuration information in this way reduces the number of files recording configuration information updates, simplifies application version management, and solves the problem in related technologies where directly replacing environment variable values ​​in configuration files leads to complex configuration file history and increased application management difficulty. This achieves the effect of obtaining accurate configuration information when the application switches between different environments, making application expansion and configuration maintenance easier.

[0227] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0228] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0229] Example 4

[0230] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the method for determining application configuration information provided in Embodiment 1.

[0231] Optionally, in this embodiment, the storage medium may be a computer-readable storage medium, which includes a stored executable program, wherein the method for determining application configuration information that controls the device where the computer-readable storage medium is located to execute any of the above-mentioned items is used when the executable program is running.

[0232] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0233] This application also provides a computer program product that, when executed on a data processing device, is adapted to perform the steps of a method for determining application configuration information.

[0234] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0235] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0236] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0237] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0238] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0239] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0240] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for determining application configuration information, characterized in that, include: Receive an application configuration request, wherein the application configuration request carries the application identifier of the target application and the environment identifier corresponding to the target application environment; In response to the application configuration request, basic configuration information corresponding to the application identifier is determined, wherein the basic configuration information includes a predetermined placeholder, the predetermined placeholder is a placeholder to be replaced, and the placeholder is to be replaced with a target parameter value in the target application environment; Determine the target parameter value corresponding to the environmental identifier; The target parameter value is used to replace the predetermined placeholder in the basic configuration information to obtain the target configuration information in the target application environment. The step of determining the target parameter value corresponding to the environment identifier includes: determining an environment directory corresponding to the target application environment based on the environment identifier, wherein the environment directory includes a parameter management file; and determining the target parameter value corresponding to the environment identifier based on the parameter management file. The step of determining the target parameter value corresponding to the environment identifier based on the parameter management file includes: when there are multiple predetermined placeholders and multiple target parameter values, determining a modification placeholder and a default placeholder from the multiple predetermined placeholders, wherein the modification placeholder is a placeholder that uses the modified value of the default parameter value at the corresponding placeholder position, and the default placeholder is a placeholder that uses the default parameter value at the corresponding placeholder position; and determining a parameter definition file and a target parameter file based on the parameter management file, wherein the parameter definition file includes target parameter items corresponding to the multiple predetermined placeholders respectively. The target parameter file includes multiple modified parameter items corresponding to the environment identifier, and modified parameter values ​​corresponding to each of the multiple modified parameter items. The multiple target parameter items include the multiple modified parameter items. Based on the parameter definition file, the default parameter value corresponding to the default placeholder is determined, and based on the target parameter file, the modified parameter value corresponding to the modified placeholder is determined. Based on the default parameter values ​​corresponding to the default placeholder and the modified parameter values ​​corresponding to the modified placeholder, the target parameter values ​​corresponding to each of the multiple predetermined placeholders are determined.

2. The method according to claim 1, characterized in that, In response to the application configuration request, determining the basic configuration information corresponding to the application identifier includes: Based on the application identifier, the basic configuration directory corresponding to the target application is determined, wherein the basic configuration directory includes a first file path corresponding to multiple basic configuration files; Based on multiple first file paths, the multiple basic configuration files are retrieved, wherein each of the multiple basic configuration files includes a portion of configuration information corresponding to the application identifier; The basic configuration information is determined based on multiple configuration details.

3. The method according to claim 2, characterized in that, Before determining the basic configuration directory corresponding to the target application based on the application identifier, the process also includes: Create a basic configuration management file in the basic configuration directory; In the basic configuration management file, a first file path corresponding to the multiple basic configuration files is created.

4. The method according to claim 1, characterized in that, Based on the parameter management file, determine the parameter definition file and the target parameter file, including: Determine the reference identifier corresponding to the parameter management file; Determine the parameter definition management file corresponding to the reference identifier, wherein the parameter definition management file includes a second file path corresponding to the parameter definition file; Based on the parameter management file, determine the path of the third file corresponding to the target parameter file; Based on the second file path, the parameter definition file is retrieved, and based on the third file path, the target parameter file is retrieved.

5. The method according to any one of claims 1 to 4, characterized in that, The step of replacing the predetermined placeholders in the basic configuration information with the target parameter values ​​to obtain the target configuration information in the target application environment includes: Based on the aforementioned basic configuration information, the predetermined placeholder is determined; The target parameter value is used to replace the predetermined placeholder to obtain the updated configuration information; Check the updated configuration information to determine whether the predefined placeholder is included in the updated configuration information, and obtain the determination result; If the predetermined placeholder is not included in the determined update configuration information, the target configuration information in the target application environment is determined.

6. A device for determining application configuration information, characterized in that, include: The receiving module is used to receive an application configuration request, wherein the application configuration request carries an application identifier of the target application and an environment identifier corresponding to the target application environment. The first determining module is used to respond to the application configuration request and determine the basic configuration information corresponding to the application identifier, wherein the basic configuration information includes a predetermined placeholder, the predetermined placeholder is a placeholder to be replaced, and the placeholder is to be replaced with a target parameter value in the target application environment; The second determining module is used to determine the target parameter value corresponding to the environmental identifier; The first replacement module is used to replace the predetermined placeholder in the basic configuration information with the target parameter value to obtain the target configuration information in the target application environment. The second determining module is further configured to determine an environment directory corresponding to the target application environment based on the environment identifier, wherein the environment directory includes a parameter management file; and determine a target parameter value corresponding to the environment identifier based on the parameter management file. The second determining module is further configured to, when the predetermined placeholders include multiple placeholders and the target parameter values ​​include multiple target parameter values, determine a modification placeholder and a default placeholder from the multiple predetermined placeholders, wherein the modification placeholder is a placeholder that uses the modified value of the default parameter value at the corresponding placeholder position, and the default placeholder is a placeholder that uses the default parameter value at the corresponding placeholder position; and determine a parameter definition file and a target parameter file according to the parameter management file, wherein the parameter definition file includes target parameter items corresponding to the multiple predetermined placeholders, and a list of target parameter items. The target parameter file includes multiple modified parameter items corresponding to the environment identifier, and modified parameter values ​​corresponding to each of the multiple modified parameter items. The multiple target parameter items include the multiple modified parameter items. Based on the parameter definition file, the default parameter value corresponding to the default placeholder is determined, and based on the target parameter file, the modified parameter value corresponding to the modified placeholder is determined. Based on the default parameter values ​​corresponding to the default placeholder and the modified parameter values ​​corresponding to the modified placeholder, the target parameter values ​​corresponding to each of the multiple predetermined placeholders are determined.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the method for determining application configuration information as described in any one of claims 1 to 5.

8. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the method for determining application configuration information as described in any one of claims 1 to 5.

9. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for releasing software

    CN103645900A

  • Application configuring methods and devices, storage mediums and electronic equipment

    CN109547259A