Development environment building method, device, equipment, medium and product

By obtaining the placeholder of the configuration file from the environment ledger system, generating a variable list and setting a value method, the problem of low construction efficiency caused by complex environmental configuration items in the existing technology is solved, and the development environment configuration files are automatically generated, which improves the construction efficiency and consistency.

CN119576289APending Publication Date: 2025-03-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411832228.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The environment configuration items in the existing development environment construction methods are complex, resulting in low construction efficiency.

Method used

By obtaining the configuration item placeholders of the configuration file from the environment ledger system, generating a variable list, and setting the value method according to the variable list, obtaining the variable definition policy file and file replacement policy file, and automatically generating the configuration files required by the development environment.

Benefits of technology

It reduces the configuration cost of development environment construction, improves construction efficiency, reduces error rates, and achieves standardization and consistency of teamwork.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576289A_ABST
    Figure CN119576289A_ABST
Patent Text Reader

Abstract

The invention provides a development environment building method and device, equipment, a medium and a product, and relates to the technical field of cloud computing. Comprising the steps that a configuration item placeholder of a configuration file is obtained from an environment ledger system, a variable list is generated according to the configuration item placeholder, the configuration file is a configuration file needed by a development environment, and a configuration item is address information needed by the development environment; according to the purpose of each variable in the variable list, a value taking mode is set for each variable, a variable definition strategy file is obtained, and the value taking mode comprises obtaining a variable value or using a fixed value according to the environment machine account system; determining a to-be-replaced variable in the configuration file according to the variable list to obtain a file replacement strategy file; and storing the variable definition strategy file and the file replacement strategy file, wherein the variable definition strategy file and the file replacement strategy file are used for generating configuration files required by development environment establishment. According to the method, the configuration cost of development environment construction is reduced, and the construction efficiency of the development environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a method, device, equipment, medium and product for building a development environment. Background Art

[0002] In order to provide complete business functions within an enterprise, multiple business application systems need to collaborate with each other. These application systems communicate by configuring interface server addresses. Due to the need for environmental isolation, the server Internet Protocol addresses in the test environment and the production environment are different. Therefore, in terms of architecture design, it is necessary to ensure that the application system can correctly configure and identify the interface server addresses in different environments to ensure the stability and security of the system.

[0003] The existing technology sets the server address information as a configuration item, and links the ledger system to automatically replace the configuration items in the test and production environments during deployment to achieve environment adaptation and efficient management.

[0004] However, due to the complexity of the overall architecture, the complex relationships between application systems cannot be decoupled in a short period of time, resulting in reduced efficiency in setting up the application system development environment. Summary of the invention

[0005] The present application provides a development environment construction method, device, equipment, medium and product to solve the technical problems of complex environment configuration items and low construction efficiency in the existing development environment construction method.

[0006] In a first aspect, the present application provides a method for building a development environment, comprising:

[0007] Obtaining a configuration item placeholder of a configuration file from the environment ledger system, and generating a variable list according to the configuration item placeholder, wherein the configuration file is a configuration file required by the development environment, and the configuration item is address information required by the development environment;

[0008] According to the purpose of each variable in the variable list, a value-taking method is set for each variable to obtain a variable definition strategy file, wherein the value-taking method includes obtaining a variable value according to the environment ledger system or using a fixed value;

[0009] Determine the variables to be replaced in the configuration file according to the variable list, and obtain a file replacement strategy file;

[0010] The variable definition policy file and the file replacement policy file are stored, and the variable definition policy file and the file replacement policy file are used to generate configuration files required for building a development environment.

[0011] In a second aspect, the present application provides a development environment building device, including:

[0012] A variable list generation module is used to obtain a configuration item placeholder of a configuration file from an environment ledger system, and generate a variable list according to the configuration item placeholder, wherein the configuration file is a configuration file required by a development environment, and the configuration item is address information required by the development environment;

[0013] A variable definition strategy file obtaining module is used to set a value obtaining method for each variable according to the purpose of each variable in the variable list, and obtain a variable definition strategy file, wherein the value obtaining method includes obtaining a variable value according to the environment ledger system or using a fixed value;

[0014] A file replacement strategy file obtaining module, used to determine the variables to be replaced in the configuration file according to the variable list, and obtain the file replacement strategy file;

[0015] The storage module is used to store the variable definition strategy file and the file replacement strategy file, and the variable definition strategy file and the file replacement strategy file are used to generate configuration files required for setting up a development environment.

[0016] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0017] The memory stores computer-executable instructions;

[0018] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.

[0020] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.

[0021] The development environment building method, apparatus, equipment, medium and product provided in the present application obtain configuration item placeholders of a configuration file from an environment ledger system, and generate a variable list based on the configuration item placeholders, wherein the configuration file is a configuration file required for the development environment, and the configuration item is address information required for the development environment; according to the purpose of each variable in the variable list, a value-taking method is set for each variable to obtain a variable definition policy file, and the value-taking method includes obtaining a variable value according to the environment ledger system or using a fixed value; according to the variable list, the variables to be replaced in the configuration file are determined to obtain a file replacement policy file; the variable definition policy file and the file replacement policy file are stored, and the variable definition policy file and the file replacement policy file are used as a means to generate the configuration file required for building the development environment, thereby reducing the configuration cost of building a local development environment and improving the efficiency of building the development environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] Figure 1 The overall architecture diagram of the development environment construction method proposed in this application;

[0024] Figure 2 This is a flow chart of the first embodiment of the development environment construction method proposed in this application;

[0025] Figure 3 A flowchart of the second embodiment of the method for building a development environment provided by this application;

[0026] Figure 4 A flowchart of the third embodiment of the method for building a development environment provided by this application;

[0027] Figure 5 A flowchart of a fourth embodiment of the method for building a development environment provided by this application;

[0028] Figure 6 A flowchart of a fifth embodiment of the method for building a development environment provided by this application;

[0029] Figure 7 A schematic diagram of the structure of the device for building the development environment provided for this application;

[0030] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0031] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0032] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0033] In the existing technology, the development environment is usually built by manually configuring the configuration file, which has many problems: first, there is a lack of automated support for the extraction and management of variables. Developers need to manually analyze the content of the configuration file and replace the placeholders, which is cumbersome and error-prone. Second, the configuration requirements in multiple environments (such as development, testing, and formal environments) are difficult to flexibly adapt, and the fixed manual configuration method cannot effectively handle the acquisition and replacement of dynamic variables. Third, team collaboration is not standardized, and the generation and storage of configuration files depend on personal operations, which can easily cause inconsistent environment configurations. Finally, manual operations also make it difficult to manage configuration file versions and lack support for updates and backtracking. These problems significantly increase the complexity of building the development environment and the cost of operation and maintenance.

[0034] In view of the above problems in the prior art, the inventors have come up with the idea of ​​introducing an automated development environment building device to solve them. By designing a variable list generation module, a variable definition strategy file acquisition module, a file replacement strategy file acquisition module, and a storage module, the whole process automation from variable extraction, strategy generation to configuration file replacement and storage is realized. Combined with flexible value strategies (such as dynamic acquisition or fixed values), standardized variable definition and replacement rule files are generated, team sharing and consistency management are realized, development efficiency is effectively improved, and error rate is reduced, and finally an efficient, flexible, and traceable development environment building solution is provided.

[0035] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0036] It should be noted that the development environment construction method, device, equipment, medium and product provided in this application can be used in the field of cloud computing technology, and can also be used in any field other than the field of cloud computing technology. The application field of the development environment construction method, device, equipment, storage medium and product in this application is not limited.

[0037] Figure 1 This is the overall architecture diagram of the development environment construction method proposed in this application. Figure 1 As shown, the overall architecture 10 of the development environment building method includes an environment ledger system 101, a development environment building device 102, a version library 103 and a user terminal 104. Among them, the environment ledger system 101 is used to store and provide application system address information. The development environment building device 102 includes a variable list generation module, a variable definition policy file acquisition module, a file replacement policy file acquisition module, a storage module, etc. The version library 103 is used to store variable definition policy files and file replacement policy files. The user terminal 104 interacts with the development environment building device 102 through an integrated development environment (English: Integrated Development Environment, referred to as: IDE) plug-in to complete the configuration file generation and deployment.

[0038] Figure 2 This is a flow chart of the first embodiment of the development environment construction method proposed in this application. Figure 2 As shown, the method includes:

[0039] S201. Obtain the configuration item placeholder of the configuration file from the environment ledger system, and generate a variable list based on the configuration item placeholder.

[0040] Among them, the environment ledger system refers to a system used to manage and store the address information of each application system in the development environment, including service addresses, configuration items and other environmental parameters. The function of the environment ledger system is to provide a query interface to provide the development environment with available service addresses and configuration data, that is, the configuration file required by the development environment, where the configuration items in the configuration file are the address information required by the development environment. In addition, the variable list is a collection of placeholder variables extracted from the configuration file, which lists all variable names and their properties that need to be replaced.

[0041] Specifically, the embodiment of the present application can connect to the environment ledger system through the IDE plug-in, and then obtain the configuration file from the environment ledger system, that is, the service address configuration required for the development environment. Then, the variable placeholders are extracted from the configuration file, the extracted variable placeholders are organized into a variable list, and the relevant information of the variables is recorded, such as the variable name and the application system to which the variable belongs.

[0042] Furthermore, the configuration item placeholders are defined in a key-value pair format to generate a variable list. For example, the configuration file content is order_system_url=http: / / $#{order_system_ip} / order / api, pay_system_url=http: / / $#{pay_system_ip} / order / api. Among them, two configuration items are defined in a key-value pair format, which refer to the API URL address of the "order management" application system: order_system_url, and the API URL address of the "payment management" application system: pay_system_url. In the values ​​of these two addresses, the (English: internet protocol, referred to as: ip) part is expressed using the placeholder $#{order_system_ip}, indicating that the placeholder part needs to be replaced with the actual value of the order_system_ip variable during the deployment process. For example, the address of the "Order Management" application system in the test environment is "192.168.1.200", the value of the order_system_ip variable will be specified as "192.168.1.200", and the configuration file will be replaced with order_system_url=192.168.1.200 / order / api during the deployment process.

[0043] The above method of automatically extracting configuration item placeholders reduces the need for developers to manually analyze configuration files, improves variable recognition efficiency, and reduces omissions or errors that may be caused by manual operations.

[0044] S202: According to the purpose of each variable in the variable list, a value-taking method is set for each variable to obtain a variable definition strategy file.

[0045] After the variable list is generated, a value-taking method will be created for each variable in the variable list. There are two ways to take values. The first is to obtain the variable value according to the environment ledger system, and the second is to use a fixed value, which is not as good as debug. Specifically, the above two value-taking methods can be displayed in the user interface so that users can select and set the value-taking method and source of the variable. Finally, a variable definition policy file is generated according to the user's settings. Among them, the variable values ​​obtained in the environment ledger system include: application system abbreviation, environment type, month, environment distinction, R&D department, operation and maintenance department, environment status, and service environment.

[0046] For example, the content of the variable definition policy file is shown in the following table. For the value acquisition method of the environment ledger system, it is mainly applicable to the scenario where the service IP of other application systems needs to be obtained through the environment ledger system. It is necessary to specify the "source" of the variable as the environment ledger system, and specify the environment ledger system parameters in the form of key-value pairs. For the key name settings of the environment ledger system parameters, it can be determined according to the attributes of the application system service IP. After the values ​​of these attributes are determined, the application system service IP executed by the attributes should be obtained. If multiple IPs are obtained, these IPs are regarded as equivalent IPs, and any one of them can be selected. For the enumeration in the above table, "application system abbreviation", "environment type", "monthly", "environmental distinction", "R&D department", "operation and maintenance department", "environmental status", and "service environment" are used to identify the application system service IP; the value of "environmental distinction" is specified as "-", indicating that the specification of this attribute can be ignored.

[0047]

[0048] The fixed value method is suitable for scenarios where the value of the configuration item is an enumerable value. For example, the log level is generally set to the debug level in a development environment; in this case, you should specify [Source] as "Fixed Value" and specify [Ledger System Parameter] as "debug".

[0049] S203: Determine the variables to be replaced in the configuration file according to the variable list, and obtain a file replacement strategy file.

[0050] In this step, the configuration file with variables can be analyzed according to the variable list, and then the replacement rules can be generated to obtain the file replacement policy file. For example, the example of the file replacement policy file is as follows:

[0051]

[0052] Among them, the "Configuration file path with variables" column is the configuration file mentioned in S201, which is generally one or more files, one file per line. These configuration files are all configuration files required by the development environment; and these configuration files may contain variable placeholders mentioned in S201. After the configuration file specified in the "Replaced configuration file path" column replaces the variable placeholder, it needs to be copied to the path specified in the current column. The specified path is the path for the development environment to identify the configuration file. The "Encoding" column refers to the configuration file specified in the "Configuration file path with variables" column, and the character encoding specified in this column will be used for parsing.

[0053] This step ensures the standardization of the variable replacement process by automatically generating a replacement rule file, thus avoiding errors caused by manual configuration by developers.

[0054] S204: Store the variable definition policy file and the file replacement policy file.

[0055] In this embodiment, the variable definition policy file and the file replacement policy file are used to generate the configuration files required for the development environment. Specifically, by storing the variable definition policy file and the file replacement file in the version library, the user can download these policy files through the IDE plug-in and parse them locally to generate the configuration files required for the development environment.

[0056] The development environment construction method provided in this embodiment realizes the automatic generation and rapid deployment of the development environment configuration file through the synergy of the environment ledger system, the variable definition policy file and the file replacement policy file, and significantly improves the efficiency of the development environment construction. By automatically extracting the variable placeholders in the configuration file, flexibly setting the variable value method, and automatically generating replacement rules, the complexity and error rate of manual configuration are effectively reduced. At the same time, the unified storage and sharing of policy files enhances the efficiency of team collaboration, ensures the standardization and consistency of the development environment configuration, and is particularly suitable for the rapid development and joint debugging scenarios of complex application systems.

[0057] Figure 3 This is a flow chart of the second embodiment of the development environment construction method provided by this application. Figure 3 As shown, in Figure 2 Based on the embodiment, before obtaining the configuration item placeholder of the configuration file from the environment ledger system and generating the variable list according to the configuration item placeholder, the method further includes:

[0058] S301. Establish an environment record system and deploy the address information of each application system in the environment record system.

[0059] In this step, an environment ledger system is built. The environment ledger system can be a new dedicated database or a functional extension based on an existing platform. The environment ledger system can store the service address information of each application system in different environments such as development environment, test environment, and formal environment, and provide a query interface for developers or other systems to obtain address information. Among them, the address information includes the service address used for joint testing of the development environment or formal testing.

[0060] Secondly, the content of the address information consists of two parts. The first part is the service address of each application system, such as a domain name or IP address. The second part is the detailed attributes of each service address, such as the environment type (development, testing, formal), the application system to which it belongs, and the usage status.

[0061] In addition, in this step, the environmental ledger system also needs to expand its functions, namely query function, statistical function and permission management. Among them, the query function means that users can query address information through the IDE plug-in or the environmental ledger system interface, the statistical function is used to record the usage of address information and monitor the efficiency of environmental resource use, and the permission management can ensure that users who query and maintain the environmental ledger system are authenticated to prevent misuse or abuse of address information.

[0062] In short, the environment ledger system centrally manages the address information of each application system, reducing the tedious process of users communicating offline to obtain information, and provides a unified service address query interface, which improves the efficiency and standardization of the development environment construction process.

[0063] S302: Determine, according to the address information, a configuration item placeholder corresponding to each address information, and generate a configuration file for each application system.

[0064] In this step, you first need to determine the corresponding configuration item placeholder based on the address information. Each service address is represented by a placeholder in the configuration file so that it can be replaced with a specific address during deployment. The placeholder naming rule can be designed based on the application system and variable usage. For example, the service address of the order system is: $#{order_system_ip}, or the service address of the payment system is: $#{pay_system_ip}.

[0065] Then generate the configuration file for each application system. The file format generates an initial configuration file for each application system, and placeholders are used in the configuration items to replace the actual address values. Secondly, the configuration file can be generated in two steps. The first step is automatic generation, that is, after obtaining the address information and placeholder rules of each application system from the environment ledger system, the configuration file is automatically generated. The second step is manual verification. The generated configuration file can be manually checked or adjusted by the user.

[0066] The development environment construction method provided in this embodiment reduces possible errors in manually configuring placeholders by associating address information in the environment ledger system with placeholders, thereby improving the efficiency and accuracy of development environment configuration. In addition, the automatically generated configuration file contains standardized placeholders, which facilitates subsequent replacement operations and deployment processes.

[0067] Figure 4 This is a flow chart of the third embodiment of the development environment construction method provided by this application. Figure 4 As shown, in Figure 2 Based on the embodiment, the variables to be replaced in the configuration file are determined according to the variable list, and a file replacement strategy file is obtained, including:

[0068] S401. Determine, according to a configuration file, a configuration file path with variables and a character encoding corresponding to the configuration file path with variables.

[0069] In this step, firstly, file paths with variables are extracted from the variable list and configuration files, that is, configuration file paths containing variable placeholders. These configuration file paths are the source paths of configuration files in the development environment. Then, the corresponding character encoding is formulated for each configuration file with variables, such as UTF-8, GBK, etc.

[0070] Among them, there are many sources of character encoding. For example, it is determined according to the default rules, that is, common file formats usually use UTF-8 by default; it is determined according to the file header information. Some file formats define the character encoding in the header, which can be obtained by parsing the file header; it is determined according to the user's specification. The user can manually set the character encoding to override the default value.

[0071] Determining the path and character encoding of each configuration file in this step can provide a basis for subsequent file parsing and variable replacement, avoiding garbled characters or replacement errors caused by encoding mismatch.

[0072] S402: Replace the variables to be replaced in the configuration file path with variables with the configuration item placeholders in the variable list to obtain the configuration file path after replacement.

[0073] First, extract the variables to be replaced, that is, read the placeholder variables from the variable list, such as $#{order_system_ip}, and then traverse the contents of the configuration file to find all matching placeholder variables. Further, replace the placeholder with the corresponding variable value or path. For example, if the original path is / config-files / application.yaml, the replaced path is / server / config / application.yaml. The replacement rule is to retain the configuration file structure, only replace the variable part, and change the variable path to the target path actually required by the development environment.

[0074] This step replaces the placeholders and converts the abstract configuration file with variables into an actual path that can be used directly, avoiding the tedious operation of manual adjustment and improving accuracy and efficiency.

[0075] S403: Obtain a file replacement strategy file according to the configuration file path with variables, the configuration file path after replacement, and the character encoding corresponding to the configuration file path with variables.

[0076] In this step, by integrating the configuration file path with variables, the configuration file path after replacement, and the character encoding, a replacement strategy file can be generated. Specifically, the configuration file path with variables is the source path, which is used to indicate the location of the original configuration file, and the configuration file path after replacement is the target path, which is used to indicate the location where the generated configuration file should be stored. The character encoding is the character encoding required for file parsing and generation. By replacing the file, the replacement rules of the configuration file can be uniformly managed, providing users with standardized replacement solutions and simplifying the process of team collaboration.

[0077] The development environment construction method provided in the embodiment of the present application automatically generates configuration file replacement rules by parsing paths, character encodings and variable placeholders, avoiding the tediousness and errors of manual operations. By supporting custom character encodings and path rules, replacement rules and target paths are automatically generated, significantly reducing the workload of manual configuration and avoiding path errors or encoding problems caused by manual operations.

[0078] Figure 5 This is a flow chart of the fourth embodiment of the development environment construction method provided by this application. Figure 5 As shown, in Figure 2 Based on the embodiment, the variable definition policy file and the file replacement policy file are stored in the version library, and the method further includes:

[0079] S501. In response to a user's call operation on a version library, a variable definition policy file and a file replacement policy file are sent to a user terminal.

[0080] Among them, the version library is a centralized tool for storing and managing policy files and codes, supporting version control and sharing. Commonly used version libraries may include distributed version control tool libraries (English: Global Information Tracker, abbreviated as: Git), centralized version control tool libraries (English: Subversion, abbreviated as: SVN), etc.

[0081] Specifically, the user operates the version library through the IDE plug-in or command line tool, requests to download the latest variable definition policy file and file replacement policy file, and then uses the graphical interface in the IDE to click "Download Policy File". At this time, for the version library, the stored variable definition policy file and file replacement policy file can be located according to the user's request, and then the version library will check the user's permissions to ensure that the calling operation is limited to authorized users. The variable definition policy file and the file replacement policy file are transmitted to the user terminal through the network. At this time, the variable definition policy file and the file replacement policy file will be downloaded to the specified directory of the local development environment. Among them, if the variable definition policy file and the file replacement policy file are updated in the version library, the user can automatically obtain the latest version of the file through the calling operation to ensure that the downloaded file version is consistent with the version library.

[0082] Exemplarily, the first step: the user initiates a call request. The user clicks the "Get Latest Configuration" button in the IDE plug-in. At this time, the plug-in sends a request to the version library to pull the latest policy file. The second step: the version library processes the call request. The version library locates the variables.yaml and file_replacements.yaml files, verifies user permissions, and ensures that the user has access rights. The third step: Transfer to the user terminal, the variable definition policy file and the file replacement policy file are transferred to the user terminal via HTTP or other protocols and stored in the local directory / local-config / . The last step: The result is displayed. The IDE plug-in prompts the user that "the file has been downloaded successfully", and these files can be directly called to configure the development environment.

[0083] The development environment building method provided in the embodiment of the present application completes the rapid distribution of variable definition policy files and file replacement policy files by responding to the user's call operation on the version library, so that the development team can efficiently share and use these files, simplifying the development environment building process, improving collaboration efficiency, and ensuring the security and standardization of configuration management.

[0084] Figure 6 This is a flow chart of the fifth embodiment of the development environment construction method provided by this application. Figure 6 As shown, in Figure 2 Based on the embodiment, the variable definition strategy file and the file replacement strategy file are used to generate the configuration files required for setting up the development environment, including:

[0085] S601. Read the configuration file path with variables and the character encoding corresponding to the configuration file path with variables in the file replacement strategy file according to the IDE plug-in function, and determine the target configuration file.

[0086] The target policy file is a configuration file prepared by replacing the policy file with a file, and contains variable placeholders that need to be replaced, and is used to generate the configuration file required for the development environment.

[0087] In this step, the file replacement strategy file is read through the IDE plug-in function to parse the configuration file path with variables, the configuration file path after replacement, and the character encoding of the configuration file. The configuration file with variables is located according to the path field in the file replacement strategy file, and the target configuration file is parsed using the character encoding specified in the file replacement strategy file to ensure that no garbled characters appear during reading. The above steps can determine the configuration file to be processed and its encoding method, laying the foundation for the subsequent operations of extracting variables and replacing values.

[0088] S602: If there is a variable placeholder in the target configuration file, extract the variable name corresponding to the variable placeholder, and determine the value corresponding to the variable name according to the variable definition policy file.

[0089] In this step, the target configuration file is scanned line by line, variable placeholders are searched, and the variable names in the placeholders are extracted. For example, if the variable placeholder is $#{order_system_ip}, the extracted variable name is order_system_ip. Then, based on the extracted variable name, the variable definition policy file is queried to determine the value of the variable, such as obtaining it from the environment ledger system or taking a fixed value. This step can associate the variable name with the value method to ensure that each placeholder can be replaced with the actual variable value.

[0090] S603, updating the value corresponding to the variable name into the copy file of the target configuration file, and deploying the updated copy file to the replaced configuration file path in the text replacement strategy file to generate the configuration file required for setting up the development environment.

[0091] The copy file is used to save the version of the target configuration file after the variables are replaced, and is deployed and effective in the replaced path. In the target configuration file, the value in the variable definition policy file is used to replace the placeholder, and the replaced content is stored as a copy file, where the file path is based on the "Replaced Configuration File Path" field specified in the file replacement policy file. The generated copy file is then stored in the replaced path for direct use in the development environment.

[0092] The development environment construction method provided in the embodiment of the present application automates the entire process from variable extraction to replacement generation, reduces the complexity and error rate of manual operations, and supports multiple variable value acquisition methods (dynamic acquisition and fixed values) to meet the configuration requirements of complex development environments. Finally, the replaced configuration file is automatically deployed to the target path without manual intervention, which improves the efficiency of development environment construction, ensures the standardization of the configuration file generation process, and avoids configuration inconsistency problems.

[0093] Figure 7 This is a schematic diagram of the structure of the development environment building device provided by this application. Figure 7 As shown, the development environment building device 70 includes:

[0094] The variable list generation module 701 is used to obtain the configuration item placeholders of the configuration file from the environment ledger system, and generate a variable list according to the configuration item placeholders, wherein the configuration file is the configuration file required by the development environment, and the configuration item is the address information required by the development environment.

[0095] The variable definition strategy file obtaining module 702 is used to set a value-taking method for each variable according to the purpose of each variable in the variable list, and obtain the variable definition strategy file. The value-taking method includes obtaining the variable value according to the environmental ledger system or using a fixed value.

[0096] The file replacement strategy file obtaining module 703 is used to determine the variables to be replaced in the configuration file according to the variable list, and obtain the file replacement strategy file.

[0097] The storage module 704 is used to store the variable definition policy file and the file replacement policy file, and the variable definition policy file and the file replacement policy file are used to generate the configuration files required for setting up the development environment.

[0098] Optionally, the variable list generating module 701 is further configured to:

[0099] Establish an environment ledger system and deploy the address information of each application system in the environment ledger system. The address information includes the service address used for joint testing or formal testing of the development environment;

[0100] According to the address information, the configuration item placeholder corresponding to each address information is determined, and a configuration file for each application system is generated.

[0101] Optionally, the variable list generating module 701 is further configured to:

[0102] Use key-value pairs to define configuration item placeholders and generate a variable list.

[0103] Optionally, the variable list generating module 701 is further configured to:

[0104] The variable values ​​obtained in the environment ledger system include: application system abbreviation, environment type, month, environment classification, R&D department, operation and maintenance department, environment status and service environment.

[0105] Optionally, the file replacement strategy file obtaining module 703 is further configured to:

[0106] According to the configuration file, determine the configuration file path with variables and the character encoding corresponding to the configuration file path with variables;

[0107] Replace the variables to be replaced in the configuration file path with variables with the configuration item placeholders in the variable list to obtain the replaced configuration file path;

[0108] A file replacement strategy file is obtained according to the configuration file path with variables, the configuration file path after replacement, and the character encoding corresponding to the configuration file path with variables.

[0109] Optionally, the storage module 704 is further configured to:

[0110] Store the variable definition strategy file and file replacement strategy file in the version library;

[0111] Optionally, the storage module 704 is further configured to:

[0112] In response to the user's calling operation on the version library, the variable definition policy file and the file replacement policy file are sent to the user terminal.

[0113] Optionally, the storage module 704 is further configured to:

[0114] According to the IDE plug-in function, the configuration file path with variables and the character encoding corresponding to the configuration file path with variables in the file replacement strategy file are read to determine the target configuration file;

[0115] If there is a variable placeholder in the target configuration file, the variable name corresponding to the variable placeholder is extracted, and the value corresponding to the variable name is determined according to the variable definition policy file;

[0116] Update the value corresponding to the variable name to the copy file of the target configuration file, and deploy the updated copy file to the replaced configuration file path in the text replacement strategy file to generate the configuration file required for setting up the development environment.

[0117] The development environment building device provided in the embodiment of the present application realizes the automation, standardization, sharing and flexibility of configuration file generation through modular design, solves the problems of cumbersome configuration, high error rate, inconsistent team collaboration, etc. in the traditional development environment building process, and provides efficient, flexible and reliable environment building support for the development team.

[0118] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 80 includes:

[0119] The electronic device 80 may include a processor 801 with one or more processing cores, a memory 802 with one or more computer-readable storage media, a communication component 803 and other components. The processor 801 , the memory 802 and the communication component 803 are connected via a bus 804 .

[0120] In the specific implementation process, at least one processor 801 executes the computer execution instructions stored in the memory 802, so that at least one processor 801 executes the above-mentioned abnormal number tracing method based on big data.

[0121] The specific implementation process of the processor 801 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0122] In the above Figure 8 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0123] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0124] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0125] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0126] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program comprises computer instructions stored in a computer-readable storage medium.

[0127] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0128] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0129] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0130] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0131] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0132] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for building a development environment, characterized in that: include: Obtaining a configuration item placeholder of a configuration file from the environment ledger system, and generating a variable list according to the configuration item placeholder, wherein the configuration file is a configuration file required by the development environment, and the configuration item is address information required by the development environment; According to the purpose of each variable in the variable list, a value-taking method is set for each variable to obtain a variable definition strategy file, wherein the value-taking method includes obtaining a variable value according to the environment ledger system or using a fixed value; Determine the variables to be replaced in the configuration file according to the variable list, and obtain a file replacement strategy file; The variable definition policy file and the file replacement policy file are stored, and the variable definition policy file and the file replacement policy file are used to generate configuration files required for building a development environment.

2. The method according to claim 1, characterized in that Before obtaining the configuration item placeholder of the configuration file from the environment ledger system and generating the variable list according to the configuration item placeholder, the method further includes: Establish an environment ledger system and deploy the address information of each application system in the environment ledger system, including the service address used for joint testing or formal testing of the development environment; According to the address information, a configuration item placeholder corresponding to each address information is determined, and a configuration file for each application system is generated.

3. The method according to claim 1 or 2, characterized in that: Generate a variable list based on the configuration item placeholders, including: The configuration item placeholders are defined in a key-value pair manner to generate a variable list.

4. The method according to claim 1 or 2, characterized in that: The variable values ​​obtained in the environmental ledger system include: application system abbreviation, environment type, month, environment classification, R&D department, operation and maintenance department, environment status and service environment.

5. The method according to claim 1 or 2, characterized in that: The step of determining the variables to be replaced in the configuration file according to the variable list to obtain a file replacement strategy file includes: According to the configuration file, determine the configuration file path with variables and the character encoding corresponding to the configuration file path with variables; Replacing the variables to be replaced in the configuration file path with variables with the configuration item placeholders in the variable list to obtain a configuration file path after replacement; A file replacement strategy file is obtained according to the configuration file path with variables, the configuration file path after replacement, and the character encoding corresponding to the configuration file path with variables.

6. The method according to claim 1 or 2, characterized in that: The storing of the variable definition policy file and the file replacement policy file comprises: storing the variable definition policy file and the file replacement policy file in a version library; The method further comprises: In response to a user's calling operation on the version library, the variable definition policy file and the file replacement policy file are sent to a user terminal.

7. The method according to claim 1 or 2, characterized in that: The variable definition strategy file and the file replacement strategy file are used to generate the configuration files required for setting up the development environment, including: Read the configuration file path with variables in the file replacement strategy file and the character encoding corresponding to the configuration file path with variables according to the IDE plug-in function to determine the target configuration file; If a variable placeholder exists in the target configuration file, extract the variable name corresponding to the variable placeholder, and determine the value corresponding to the variable name according to the variable definition policy file; The value corresponding to the variable name is updated to the copy file of the target configuration file, and the updated copy file is deployed to the replaced configuration file path in the text replacement strategy file to generate the configuration file required for setting up the development environment.

8. A development environment building device, characterized in that: include: A variable list generation module is used to obtain a configuration item placeholder of a configuration file from an environment ledger system, and generate a variable list according to the configuration item placeholder, wherein the configuration file is a configuration file required by a development environment, and the configuration item is address information required by the development environment; A variable definition strategy file obtaining module is used to set a value obtaining method for each variable according to the purpose of each variable in the variable list, and obtain a variable definition strategy file, wherein the value obtaining method includes obtaining a variable value according to the environment ledger system or using a fixed value; A file replacement strategy file obtaining module, used to determine the variables to be replaced in the configuration file according to the variable list, and obtain the file replacement strategy file; The storage module is used to store the variable definition strategy file and the file replacement strategy file, and the variable definition strategy file and the file replacement strategy file are used to generate configuration files required for setting up a development environment.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.