A project configuration management method, device, product and medium

By using target markup language files to record and store configuration information, it solves the problems of poor interactivity and difficult management in traditional configuration management technology, achieves efficient configuration management and real-time adjustment, and reduces development costs and time.

CN118394429BActive Publication Date: 2024-09-20LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410853497.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-20
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

Traditional project configuration management technology has problems such as poor interactivity, inability to configure dynamically, and difficult management. Especially in the software development process, the modification and update of configuration files are complex, resulting in high development costs and time.

Method used

Use target markup language files (such as YAML) to record the configuration information of the engineering project, and convert it into a structure for storage and call, allowing real-time adjustment of the configuration information. Configuration management can be achieved by modifying the configuration module information in the YAML file, simplifying the development process. .

Benefits of technology

It improves the readability and modification efficiency of configuration files, reduces the compilation and deployment process, reduces development costs and time, and simplifies the real-time adjustment of configuration information to adapt to changes in requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118394429B
    Figure CN118394429B
Patent Text Reader

Abstract

The present invention discloses a project configuration management method, equipment, product and medium, and relates to the field of software development technology. This solution adopts a target markup language file as the storage format of configuration information, so as to manage configuration functions in a structured and easy-to-understand manner, which not only improves the readability of the configuration file, but also makes the modification and update of the configuration simple and fast. On the other hand, this solution allows real-time adjustment of configuration information. When there are new requirements, the configuration adjustment can be achieved by simply modifying the configuration information of the corresponding configuration module in the target markup language file, which greatly simplifies the development process, allowing developers to quickly adapt to changes in requirements without going through complex compilation and deployment processes, thereby significantly reducing development costs and time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a project configuration management method, equipment, product and medium. Background Art

[0002] With technological breakthroughs in cloud computing, big data, artificial intelligence and other fields, the scale and complexity of software engineering projects have grown significantly, which poses both opportunities and challenges to developers.

[0003] During the project development phase, developers are often faced with the task of detailed configuration monitoring, management, and real-time modification of large and complex project frameworks, making project configuration management increasingly critical in the software development lifecycle. However, traditional configuration management technologies, such as using global variables and environment variables to control code content and framework behavior, and judging the configuration content of the framework by reading variable values, have gradually exposed a series of problems such as poor interactivity, inability to dynamically configure, and difficulty in management over time and with the increase in project complexity.

[0004] In view of the above problems, how to solve the current project configuration management method, which has poor interactivity, cannot be dynamically configured and is difficult to manage, is an urgent problem to be solved by technical personnel in this field. Summary of the invention

[0005] The purpose of the present invention is to provide a project configuration management method, device, product and medium to solve the problems of poor interactivity, inability to dynamically configure and difficult management of current project configuration management methods.

[0006] In order to solve the above technical problems, the present invention provides a project configuration management method, comprising:

[0007] Generate a target markup language file; wherein the target markup language file records the configuration information of each configuration module required for the engineering project;

[0008] Convert the configuration information of each configuration module in the target markup language file into a target form, and store each configuration information in the target form into a structure;

[0009] Setting the calling information of each configuration module based on the structure, and compiling the engineering project;

[0010] When there is a need for configuration management of the engineering project, the configuration information of the corresponding configuration module in the target markup language file is modified to complete the configuration management.

[0011] On the one hand, generating a target markup language file includes:

[0012] Determine each of the configuration modules required for the engineering project, and determine configuration information corresponding to each of the configuration modules;

[0013] Defining configuration setting keywords for the target markup language file;

[0014] Based on the configuration setting keywords, each of the configuration modules and its corresponding configuration information are recorded in the target markup language file in the form of key-value pairs to generate the target markup language file.

[0015] On the other hand, recording each of the configuration modules and its corresponding configuration information in the target markup language file in the form of key-value pairs includes:

[0016] Determine the name of the configuration module and set the value of the configuration information corresponding to the configuration module;

[0017] A key-value pair is generated in a fixed format by appending the value of the corresponding configuration information to the name of the configuration module, and the key-value pair is recorded in the target markup language file.

[0018] On the other hand, converting the configuration information of each configuration module in the target markup language file into a target form includes:

[0019] Obtain the target markup language file parsing and generation library;

[0020] Based on the target markup language file parsing generation library, each key-value pair in the target markup language file is converted into a target form.

[0021] On the other hand, the generating library based on the target markup language file parsing converts each key-value pair in the target markup language file into a target form, including:

[0022] Determine the location of the target markup language file based on the target form acquisition function in the target markup language file parsing and generating library;

[0023] Searching the target markup language file for the configuration setting keyword;

[0024] Convert each key-value pair under the configuration setting keyword into a target form.

[0025] On the other hand, storing each configuration information in the target form into the structure includes:

[0026] Determine the parsing function corresponding to each of the configuration modules;

[0027] The corresponding key-value pairs are parsed according to each of the parsing functions, and the parsed data are stored in the public parameters corresponding to the structure.

[0028] On the other hand, when the configuration module specifically includes a log printing module, an operator development module and a function calling module, the corresponding key-value pairs are parsed according to each of the parsing functions, and the parsed data are stored in the public parameters corresponding to the structure, including:

[0029] Based on the minimum log level acquisition function, parse the value of the minimum log level in each key-value pair, and store the value of the minimum log level in the minimum log level public parameter of the structure;

[0030] Based on the deregistration operation acquisition function, the value named as operator deregistration in each key-value pair is parsed, and the value of operator deregistration is stored in the unregistered operator public parameter of the structure;

[0031] Based on the analyzer start function, parse the value named analyzer start in each key-value pair, and store the analyzer start value into the analyzer start public parameter of the structure;

[0032] The minimum log level value and the analyzer startup value are saved in digital form; the operator cancellation value is saved in string form.

[0033] On the other hand, the calling information of each of the configuration modules is set based on the structure, including:

[0034] Calling a static configuration acquisition function to create a static instance of the structure;

[0035] Based on the static instance of the structure, the calling information of each of the configuration modules is determined.

[0036] On the other hand, when the configuration module specifically includes a log printing module, an operator development module and a function calling module, the determining the calling information of each of the configuration modules based on the static instance of the structure includes:

[0037] Determine the level and category of the log printing module based on the minimum log level variable in the static instance of the structure;

[0038] Setting the calling information of the log printing module according to the level and category of the log printing module;

[0039] Assigning an unordered string list based on a static instance of the structure to set call information for the operator development module;

[0040] A startup value is assigned based on the static instance of the structure to set call information for a function call module.

[0041] On the other hand, when there is a configuration management requirement for the engineering project, modifying the configuration information of the corresponding configuration module in the target markup language file includes:

[0042] When there is a configuration management requirement for the engineering project, determining a target configuration module corresponding to the configuration management requirement;

[0043] The value of the corresponding key-value pair in the target markup language file is modified according to the target configuration module to modify the configuration information of the target configuration module.

[0044] On the other hand, it also includes:

[0045] Monitor changes in configuration management requirements for the engineering project;

[0046] A development log for the engineering project is generated according to changes in the configuration management requirements.

[0047] On the other hand, after monitoring the changes in the configuration management requirements of the engineering project, the method further includes:

[0048] According to the change of the configuration management requirement, determining whether the number of modification times of the configuration information of the target configuration module exceeds a threshold;

[0049] If so, redetermine the configuration management requirements of the engineering project.

[0050] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above project configuration management method when executed by a processor.

[0051] In order to solve the above technical problems, the present invention also provides a project configuration management device, comprising:

[0052] Memory for storing computer programs;

[0053] A processor is used to implement the steps of the above-mentioned project configuration management method when executing the computer program.

[0054] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above project configuration management method are implemented.

[0055] The project configuration management method provided by the present invention generates a target markup language file; wherein the target markup language file records the configuration information of each configuration module required for the engineering project; the configuration information of each configuration module in the target markup language file is converted into a target form, and each configuration information under the target form is stored in a structure; based on the structure, the call information of each configuration module is set, and the engineering project is compiled; when there is a configuration management requirement for the engineering project, the configuration information of the corresponding configuration module in the target markup language file is modified to complete the configuration management. The beneficial effect of the present invention is that the target markup language file is used as the storage format of the configuration information, so as to manage the configuration function in a structured and easy-to-understand manner, which not only improves the readability of the configuration file, but also makes the modification and update of the configuration simple and fast. On the other hand, the present scheme allows the configuration information to be adjusted in real time. When there is a new requirement, the configuration adjustment can be realized by simply modifying the configuration information of the corresponding configuration module in the target markup language file, which greatly simplifies the development process, so that developers can quickly adapt to the change of requirements without going through a complicated compilation and deployment process, thereby significantly reducing the development cost and time.

[0056] On the other hand, the present invention specifically determines the configuration modules and their corresponding configuration information required for the project, defines and records each configuration module and its corresponding configuration information in a YAML file in the form of a key-value pair based on the configuration setting keywords, thereby realizing the generation of a YAML file. Determine the name of the configuration module, and set the value of the configuration information corresponding to the configuration module; generate a key-value pair in a fixed format by appending the value of the corresponding configuration information to the name of the configuration module, and record the key-value pair in the target markup language file, thereby realizing the standardized storage of the configuration module and its corresponding configuration information. Based on the target form acquisition function GetNode() in the yaml-cpp library, determine the location of the YAML file, search for the configuration setting keyword ConfigSettings in the YAML file, and store each key-value pair under the configuration setting keyword ConfigSettings in the form of YAML::NODE, that is, convert it into a node form, so as to provide subsequent machine recognition and calling. Determine the parsing function corresponding to each configuration module, parse the key-value pair corresponding to the configuration module through the parsing function, and store the parsed data in the public parameter corresponding to the structure EnvConfig, thereby realizing the reasonable storage of configuration information. Add the static configuration acquisition function GetStaticConfig() to call the interface to obtain the structure EnvConfig, and then obtain the required configuration of each configuration module from the structure EnvConfig to determine the call information of each module. When there is a configuration management requirement for the project, determine the target configuration module corresponding to the configuration management requirement. You only need to modify the value of the key-value pair corresponding to the target configuration module in the YAML file to directly modify the configuration information of the target configuration module without modifying other code content and recompiling, thereby greatly improving the development and debugging efficiency. In order to better enable developers to grasp the development of the project, the changes in the configuration management requirements of the project can be specifically monitored; according to the changes in the configuration management requirements, the development log of the project is generated, so that developers can grasp the development of the project according to the development log, or sort out and optimize the development process of the entire project according to the development log after the development is completed. If the number of modifications to the configuration information of the target configuration module exceeds the threshold, it is considered that the configuration management requirements of the current project are unreasonable. In order to avoid meaningless manpower and time consumption, the configuration management requirements of the project need to be re-determined.

[0057] In addition, the present invention also provides a project configuration management device, product and medium, with the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0059] Figure 1 A flowchart of a project configuration management method provided by an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of a project configuration management device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] The core of the present invention is to provide a project configuration management method, device, product and medium to solve the problems of poor interactivity, inability to dynamically configure and difficult management of current project configuration management methods.

[0063] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0064] In current software development projects, there are two common methods for controlling the configuration framework, namely the global variable control scheme and the environment variable control scheme. Among them, the global variable control scheme requires developers to embed corresponding configuration control statements in the source code; when the configuration needs to be changed, the relevant code must be updated accordingly, and the entire project needs to be recompiled. However, in large projects, recompilation may consume a lot of time and resources. The environment variable control scheme allows developers to use commands (such as export) to dynamically modify the value of environment variables without recompiling the code. This makes the implementation of configuration changes faster. However, this method also requires continuous management and maintenance of environment variables, especially in scenarios of multi-environment deployment and multi-framework collaboration, the management of environment variables may become complicated. It can be seen that both of the above methods have the problems of poor interactivity, inability to dynamically configure, and difficult management. In order to solve the above problems, this solution provides a project configuration management method.

[0065] Figure 1 A flowchart of a project configuration management method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0066] S10: Generate a target markup language file.

[0067] The target markup language file records the configuration information of each configuration module required for the engineering project.

[0068] Specifically, the target markup language (Yet Another Markup Language, YAML) file is first generated. It should be noted that YAML is a user-readable data serialization language for data serialization and configuration files. In fact, YAML is not a markup language, but is used for data representation and exchange. YAML has a concise and clear syntax, which is easy to read and write. It uses indentation to represent hierarchical relationships and supports various data types, including objects, arrays, strings, numbers, etc. YAML also supports comments and references, making configuration files easier to maintain and understand.

[0069] It should be noted that the target markup language file generated in this embodiment records the configuration information of each configuration module required for the engineering project. The engineering project is a software development project, and the configuration module is the project module involved in the corresponding software development project. For example, for an artificial intelligence framework backend development project, the configuration module requirements may include a log printing module, an operator development module, and a function call module. Among them, the role of the log printing module is mainly to determine whether certain log information needs to be printed according to the needs during development and debugging, and to achieve this by configuring its configuration information; it can be divided into categories such as debugging (DEBUG), information (INFO), and warning (WARNING) according to the level, and can be divided into different sub-modules such as common (COMMON), operation (RUNTIME), and operator (OPERATOR) according to the category; it is necessary to adjust the log printing configuration according to different needs, and only print the required part of the log information. The role of the operator development module is mainly to debug one or several operators during development and check the location of the error. At this time, it is necessary to determine whether certain operators need to be called or skipped according to the needs, which requires configuring its configuration information. The function call module is used to control whether the project records and prints the running time of various codes during the running of the project. By configuring the configuration information of the function call module, the project timing function can be enabled.

[0070] In this embodiment, there is no restriction on the generation process of the YAML file, which depends on the specific implementation situation.

[0071] S11: converting the configuration information of each configuration module in the target markup language file into a target form, and storing each configuration information in the target form into a structure.

[0072] Furthermore, since the configuration information of each configuration module required for the project recorded in the YAML file is user-readable and machine-unrecognizable, in order to convert each configuration information into machine language, it is necessary to convert the configuration information of each configuration module in the YAML file into a target form. It should be noted that the target form in this embodiment specifically refers to the node form, based on which the content in the original YAML file can be directly used by the backend machine.

[0073] In addition, after the configuration information of each configuration module in the YAML file is converted into the node form, it is also necessary to store the various configuration information in the node form into the structure EnvConfig. It is understandable that the structure EnvConfig is dedicated to storing and managing various configuration information. In this embodiment, the specific process of converting the target form of the configuration information and storing the structure is not limited, and it depends on the specific implementation situation.

[0074] S12: Setting the calling information of each configuration module based on the structure, and compiling the engineering project.

[0075] After converting each configuration information in the YAML file into node data that can be directly called and storing it, in order to realize dynamic configuration, it is also necessary to add a call to the above structure EnvConfig in the code of each corresponding configuration module in the project. Specifically, the call information of each configuration module is set based on the structure, for example, the call information of the log printing module, operator development module or function call module is set separately, and the entire project is compiled after the setting is completed, so as to realize the call and operation of each configuration module.

[0076] S13: When there is a need for configuration management of the engineering project, the configuration information of the corresponding configuration module in the target markup language file is modified to complete the configuration management.

[0077] It should be noted that the project only needs to be compiled once through the above steps. When there is a configuration management requirement for the project, the configuration can be modified directly by simply modifying the configuration information of the corresponding configuration module in the YAML file, without modifying other code content and recompiling, thereby greatly improving development and debugging efficiency. In this embodiment, there is no restriction on the modification method of the configuration information in the YAML file, which depends on the specific implementation situation.

[0078] In this embodiment, the target markup language file is used as the storage format of the configuration information, so that the configuration function is managed in a structured and easy-to-understand manner, which not only improves the readability of the configuration file, but also makes the modification and update of the configuration simple and quick. On the other hand, this solution allows real-time adjustment of the configuration information. When there are new requirements, the configuration adjustment can be achieved by simply modifying the configuration information of the corresponding configuration module in the target markup language file, which greatly simplifies the development process, allowing developers to quickly adapt to changes in requirements without going through complex compilation and deployment processes, thereby significantly reducing development costs and time.

[0079] Based on the above embodiments, in some embodiments, generating a target markup language file includes:

[0080] S101: Determine each configuration module required for the project, and determine configuration information corresponding to each configuration module.

[0081] S102: Define configuration setting keywords of the target markup language file.

[0082] S103: Based on the configuration setting keywords, each configuration module and its corresponding configuration information are recorded in a target markup language file in the form of key-value pairs to generate a target markup language file.

[0083] In the specific implementation, in order to generate a YAML file containing various configuration information, it is first necessary to determine the types of configuration modules required for the current project and determine the configuration information corresponding to each configuration module. For example, determine whether a log printing module needs to be set up, and if so, determine what specific log information the log printing module prints, so as to configure its configuration information.

[0084] The configuration setting keyword ConfigSettings of the YAML file is further defined. The configuration setting keyword ConfigSettings indicates that the following data is used to control the configuration settings. In a project file, the same YAML file can be used to manage multiple types of requirements, so a specific unique keyword is used for subsequent interface processing. Finally, based on the configuration setting keyword ConfigSettings, each configuration module and its corresponding configuration information are recorded in the initial YAML file in the form of key-value pairs to generate a YAML file.

[0085] It should be noted that the specific format of the key-value pair is not limited in this embodiment and depends on the specific implementation situation.

[0086] In this embodiment, by determining the configuration modules and their corresponding configuration information required for the project, defining and setting keywords based on the configuration, and recording each configuration module and its corresponding configuration information in a YAML file in the form of key-value pairs, the generation of the YAML file is achieved.

[0087] Based on the above embodiments, in some embodiments, each configuration module and its corresponding configuration information are recorded in a target markup language file in the form of key-value pairs, including:

[0088] S104: Determine the name of the configuration module, and set the value of the configuration information corresponding to the configuration module.

[0089] S105: Generate a key-value pair in a fixed format by appending the value of the corresponding configuration information to the name of the configuration module, and record the key-value pair in a target markup language file.

[0090] In a specific implementation, in order to better record the configuration module and its configuration information in the YAML file, the name of the configuration module is specifically determined, and the value of the configuration information corresponding to the configuration module is set. A key-value pair is generated in a fixed format of the name of the configuration module and the value of the corresponding configuration information, and the key-value pair is recorded in the YAML file.

[0091] For example, the log printing module MIN_LOG_LEVEL is used to control the minimum log level, the operator development module OPERATOR_UNREGISTER is used to control whether the operator is skipped for registration (i.e. not called), and the function call module ENABLE_PROFILER is used to control whether the engineering timing function is enabled. At this time, the value of the configuration information corresponding to each module can be empty (the default value is set in the subsequent YAML reading interface part) or the required configuration value. In subsequent use, you only need to modify the content in value.

[0092] In this embodiment, the name of the configuration module is determined, and the value of the configuration information corresponding to the configuration module is set; a key-value pair is generated in a fixed format by appending the name of the configuration module with the value of the corresponding configuration information, and the key-value pair is recorded in the target markup language file, thereby realizing the standardized storage of the configuration module and its corresponding configuration information.

[0093] Based on the above embodiments, in some embodiments, converting the configuration information of each configuration module in the target markup language file into a target form includes:

[0094] S111: Obtain a target markup language file parsing and generation library.

[0095] S112: Parsing and generating a library based on the target markup language file, converting each key-value pair in the target markup language file into a target form.

[0096] In order to convert the configuration information of each configuration module in the YAML file into the node form, the target markup language file parsing and generation (yaml-cpp) library is specifically obtained. The yaml-cpp library is a YAML parsing and generation library for the C++ programming language. It allows developers to read, write and manipulate data in YAML format in C++ applications, and is widely used in various applications and projects, including game development, configuration management, data serialization, etc. In this embodiment, each key-value pair in the YAML file is converted into the node form based on the yaml-cpp library.

[0097] Based on the above embodiments, in some embodiments, a library is generated based on the target markup language file parsing, and each key-value pair in the target markup language file is converted into a target form, including:

[0098] S113: obtaining a target form function in a target markup language file parsing generation library based on the target markup language file, and determining a location of the target markup language file.

[0099] S114: Searching for configuration setting keywords in the target markup language file.

[0100] S115: Convert each key-value pair under the configuration setting keyword into a target form.

[0101] First, based on the target form in the yaml-cpp library, the function GetNode() is obtained to determine the location of the YAML file. Specifically, the GetNode() function can determine the location of the YAML file by obtaining the address through multiple methods such as environment variable search, .so file, and default address; further search for the configuration setting keyword ConfigSettings in the YAML file, and store each key-value pair under the configuration setting keyword ConfigSettings in the form of YAML::NODE, that is, convert it into node form, so that it can be recognized and called by the subsequent machine.

[0102] Based on the above embodiments, in some embodiments, each configuration information in the target form is stored in a structure, including:

[0103] S116: Determine the analysis function corresponding to each configuration module.

[0104] S117: Parse the corresponding key-value pairs according to each parsing function, and store the parsed data into the public parameters corresponding to the structure.

[0105] In order to store various configuration information in the node form into the structure EnvConfig, it is necessary to determine the parsing function corresponding to each configuration module. It should be noted that different configuration modules correspond to different parsing functions. The function of the parsing function is to parse the key-value pairs corresponding to the configuration module, and store the parsed data into the public parameters corresponding to the structure EnvConfig, thereby realizing the reasonable storage of configuration information. The following is an explanation of the parsing and storage of key-value pairs corresponding to different configuration modules:

[0106] When the configuration module specifically includes a log printing module, an operator development module, and a function call module, the corresponding key-value pairs are parsed according to each parsing function, and the parsed data are stored in the public parameters corresponding to the structure, including:

[0107] S118: Based on the minimum log level acquisition function, parse the value named as the minimum log level in each key-value pair, and store the value of the minimum log level in the minimum log level public parameter of the structure.

[0108] S119: Based on the deregistration operation acquisition function, the value named as the operator deregistration in each key-value pair is parsed, and the value of the operator deregistration is stored in the unregistered operator public parameter of the structure.

[0109] S120: Based on the analyzer startup function, parse the value named analyzer startup in each key-value pair, and store the analyzer startup value into the analyzer startup public parameter of the structure.

[0110] The minimum log level value and the analyzer startup value are saved in digital form; the operator cancellation value is saved in string form.

[0111] Specifically, when setting the log printing module, the corresponding parsing function is the minimum log level acquisition function GetMinLogLevel(). Specifically based on the minimum log level acquisition function GetMinLogLevel(), the value value of the minimum log level MIN_LOG_LEVEL in each key-value pair is parsed, and the value value of the minimum log level MIN_LOG_LEVEL is stored in the minimum log level public parameter min_log_level_ of the structure EnvConfig.

[0112] When setting the operator development module, the corresponding parsing function is the unregister operation acquisition function GetUnRegisterOpers(). Specifically, based on the unregister operation acquisition function GetUnRegisterOpers(), the value value of the operator unregister OPERATOR_UNREGISTER in each key-value pair is parsed, and the value value of the operator unregister OPERATOR_UNREGISTER is stored in the non-registered operator public parameter non_register_opers of the structure EnvConfig.

[0113] When setting the function call module, the corresponding parsing function is the profiler startup function EnableProfiler(). Specifically, based on the profiler startup function EnableProfiler(), the value value named profiler startup ENABLE_PROFILER in each key-value pair is parsed, and the value value of profiler startup ENABLE_PROFILER is stored in the profiler startup public parameter enable_profiler_ of the structure EnvConfig.

[0114] In addition, it should be noted that the value of the minimum log level MIN_LOG_LEVEL and the value of the profiler enable ENABLE_PROFILER are saved in digital form (corresponding to the machine language int); the value of the operator unregister OPERATOR_UNREGISTER is saved in string form (corresponding to the machine language std::string). For example, in the value of the operator unregister OPERATOR_UNREGISTER, Add, Log, and EXP are split into three strings: add, log, and exp, and saved in a vector list. In addition, each parameter in the structure EnvConfig has a preset default value to increase the robustness of the system.

[0115] In this way, the key-value pair parsing and structure storage of the log printing module, operator development module and function call module are realized respectively.

[0116] Based on the above embodiments, in some embodiments, the calling information of each configuration module is set based on the structure, including:

[0117] S121: Call the static configuration acquisition function to create a static instance of the structure.

[0118] S122: Based on the static instance of the structure, determine the calling information of each configuration module.

[0119] In order to call each configuration module, the static configuration acquisition function GetStaticConfig() is called to create a static instance static of the structure EnvConfig.

[0120] It should be noted that the static keyword can control that no matter how many times the static configuration acquisition function GetStaticConfig() is used in the code, the structure EnvConfig only initializes and constructs a static instance once when it is first called, and the parameter values ​​are directly read when it is called subsequently without the need to construct it again. In each configuration module of the project, add the static configuration acquisition function GetStaticConfig() to call the interface to obtain the structure EnvConfig, and then obtain the required configuration of each configuration module from the structure EnvConfig to determine the calling information of each module. The following is a detailed explanation:

[0121] When the configuration module specifically includes a log printing module, an operator development module, and a function calling module, the calling information of each configuration module is determined based on the static instance of the structure, including:

[0122] S123: Determine the level and category of the log printing module based on the minimum log level variable in the static instance of the structure.

[0123] S124: Setting the calling information of the log printing module according to the level and category of the log printing module.

[0124] S125: Assign an unordered string list based on the static instance of the structure to set the calling information of the operator development module.

[0125] S126: Assigning a startup value based on the static instance of the structure to set calling information for the function calling module.

[0126] Specifically, when a log printing module is provided, the level and category of the log printing module are determined based on the minimum log level variable min_TGlog_level in the static instance static of the structure EnvConfig, so that the calling information of the log printing module is set according to the level and category of the log printing module.

[0127] It is understandable that the value of the minimum log level variable min_TGlog_level_ is parsed according to the value value in YAML. In order to facilitate machine language operations, the log printing levels are respectively corresponded to numbers in this embodiment: DEBUG=-1, INFO=0, WARNING=1, ERROR=2, FATAL=3. When the printing requirement is DEBUG, it is defined in the key-value pair in YAML: -name: MIN_LOG_LEVEL, value: -1. After the above code is parsed, the minimum log level variable min_TGlog_level will be obtained to be equal to -1; in the subsequent related code, the value of the minimum log level variable min_TGlog_level will be judged. For example, when it is confirmed that the minimum log level variable min_TGlog_level is equal to -1, all DEBUG level log information will be printed.

[0128] When an operator development module is set, the static instance static of the structure EnvConfig is used to assign an unordered string list unordered_set to set the call information for the operator development module. When the code is running, it will determine whether there are operator names in the unordered string list unordered_set that need to be skipped. For example, if the value is set in the YAML file: Add, Log, EXP, the calls of these three operators will be automatically skipped at runtime.

[0129] When a function call module is set, take the engineering timing function as an example, the static instance of the structure EnvConfig is assigned the startup value enabled to true to set the call information for the function call module. That is, if the engineering timing function is needed, first define the key-value pair in the YAML file: -name:ENABLE_PROFILER, value:1 to start the engineering timing function.

[0130] In this way, the calls of the log printing module, operator development module and function calling module are realized respectively.

[0131] Based on the above embodiments, in some embodiments, when there is a configuration management requirement for an engineering project, modifying the configuration information of the corresponding configuration module in the target markup language file includes:

[0132] S131: When there is a configuration management requirement for the engineering project, determine a target configuration module corresponding to the configuration management requirement.

[0133] S132: Modify the value of the corresponding key-value pair in the target markup language file according to the target configuration module to modify the configuration information of the target configuration module.

[0134] It is understandable that, through the above-mentioned embodiments, the project only needs to be compiled once. When there is a configuration management requirement for the project, the target configuration module corresponding to the configuration management requirement is determined. By simply modifying the value of the key-value pair corresponding to the target configuration module in the YAML file, the configuration information of the target configuration module can be modified directly without modifying other code content and recompiling, thereby greatly improving the development and debugging efficiency.

[0135] For example, modify the value of the log printing module MIN_LOG_LEVEL from 0 to -1, and when running the code, the log information printed will be changed from the INFO level to the DEBUG level. Modify the value of the operator development module OPERATOR_UNREGISTER from Add, Log, EXP to Add, Log, thereby changing the call of three operators to skip the call of the two operators add and log. Modify the value of the function call module ENABLE_PROFILER from 1 to 0, thereby changing the call of the engineering timing function to directly turning off the function.

[0136] Based on the above embodiments, in some embodiments, the following further includes:

[0137] S14: Monitor changes in configuration management requirements for engineering projects.

[0138] S15: Generate a development log for the engineering project based on changes in configuration management requirements.

[0139] In the specific implementation, in order to better enable developers to understand the development status of the project, the changes in the configuration management requirements of the project can be specifically monitored. For example, which configurations have been modified during the development process, the number of times the same configuration has been modified, and other information. Further, the development log of the project is generated according to the changes in the configuration management requirements, so that developers can understand the development status of the project according to the development log, or sort out and optimize the development process of the entire project according to the development log after the development is completed.

[0140] In addition, after monitoring the changes in the configuration management requirements of the engineering project, it also includes:

[0141] S16: According to the change of configuration management requirements, it is determined whether the number of modification times of the configuration information of the target configuration module exceeds the threshold. If yes, the process proceeds to step S17.

[0142] S17: Redefine the configuration management requirements of the engineering project.

[0143] In order to save the economic cost and time cost of engineering project development, after monitoring the changes in the configuration management requirements of the engineering project, it is also possible to further determine whether the number of modifications of the configuration information of the target configuration module exceeds the threshold value according to the changes in the configuration management requirements. In this embodiment, there is no restriction on the size of the threshold value, which depends on the specific implementation situation. If it does not exceed the threshold value, continue to monitor. If it exceeds the threshold value, it is considered that the configuration management requirements of the current engineering project are not reasonable. In order to avoid meaningless manpower and time consumption, it is necessary to redetermine the configuration management requirements of the engineering project.

[0144] In addition, measures can be taken to simplify configuration, including merging configuration items, deleting unnecessary configuration items, or using default values ​​to reduce configuration complexity. Or use configuration management tools to manage configuration information, which can provide version control, change management, access control and other functions to help better manage configuration information. It is also possible to reduce manual configuration errors and time consumption by automating the configuration process, including using scripts or tools to automatically generate configuration files, automatically deploy configuration changes, etc. The above methods can help reduce configuration management issues and improve the work efficiency of developers.

[0145] In the above embodiments, the project configuration management method is described in detail, and the present invention also provides a computer program product. The computer program product includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the project configuration management method in any of the above embodiments are implemented.

[0146] Figure 2 A schematic diagram of a project configuration management device provided by an embodiment of the present invention. Figure 2 As shown, the project configuration management equipment includes:

[0147] A memory 20, used for storing computer programs;

[0148] The processor 21 is used to implement the steps of the project configuration management method mentioned in the above embodiment when executing the computer program.

[0149] The project configuration management device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0150] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0151] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the project configuration management method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to data related to the project configuration management method.

[0152] In some embodiments, the project configuration management device may further include a display screen 22 , an input and output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .

[0153] Those skilled in the art will understand that Figure 2 The structure shown in the figure does not constitute a limitation of the project configuration management device, and may include more or less components than those shown in the figure.

[0154] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.

[0155] It is understandable that if the method in the above embodiment is implemented in the form of 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 the present invention, 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, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.

[0156] The above is a detailed introduction to a project configuration management method, device, product and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

[0157] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A project configuration management method, characterized in that: include: Generate a target markup language file; wherein the target markup language file records the configuration information of each configuration module required for the engineering project; Convert the configuration information of each configuration module in the target markup language file into a target form, and store each configuration information in the target form into a structure; Setting the calling information of each configuration module based on the structure, and compiling the engineering project; When there is a configuration management requirement for the engineering project, modify the configuration information of the corresponding configuration module in the target markup language file to complete the configuration management; The calling information of each of the configuration modules is set based on the structure, including: Calling a static configuration acquisition function to create a static instance of the structure; Determining the calling information of each of the configuration modules based on the static instance of the structure; Wherein, when the configuration module specifically includes a log printing module, an operator development module and a function calling module, the calling information of each configuration module is determined based on the static instance of the structure, including: Determine the level and category of the log printing module based on the minimum log level variable in the static instance of the structure; Setting the calling information of the log printing module according to the level and category of the log printing module; Assigning an unordered string list based on a static instance of the structure to set call information for the operator development module; A startup value is assigned based on the static instance of the structure to set call information for the function call module.

2. The project configuration management method according to claim 1, characterized in that: The generating of the target markup language file comprises: Determine each of the configuration modules required for the engineering project, and determine configuration information corresponding to each of the configuration modules; Defining configuration setting keywords for the target markup language file; Based on the configuration setting keywords, each of the configuration modules and its corresponding configuration information are recorded in the target markup language file in the form of key-value pairs to generate the target markup language file.

3. The project configuration management method according to claim 2, characterized in that: The step of recording each of the configuration modules and their corresponding configuration information in the target markup language file in the form of key-value pairs includes: Determine the name of the configuration module and set the value of the configuration information corresponding to the configuration module; A key-value pair is generated in a fixed format by appending the value of the corresponding configuration information to the name of the configuration module, and the key-value pair is recorded in the target markup language file.

4. The project configuration management method according to claim 3, characterized in that: The converting the configuration information of each configuration module in the target markup language file into a target form includes: Obtain the target markup language file parsing and generation library; Based on the target markup language file parsing generation library, each key-value pair in the target markup language file is converted into a target form.

5. The project configuration management method according to claim 4, characterized in that: The generating library based on the target markup language file parsing converts each key-value pair in the target markup language file into a target form, including: Determine the location of the target markup language file based on the target form acquisition function in the target markup language file parsing and generating library; Searching the target markup language file for the configuration setting keyword; Convert each key-value pair under the configuration setting keyword into a target form.

6. The project configuration management method according to claim 5, characterized in that: The storing of each configuration information in the target form into the structure includes: Determine the parsing function corresponding to each of the configuration modules; The corresponding key-value pairs are parsed according to each of the parsing functions, and the parsed data are stored in the public parameters corresponding to the structure.

7. The project configuration management method according to claim 6, characterized in that: When the configuration module specifically includes a log printing module, an operator development module and a function calling module, the corresponding key-value pairs are parsed according to each of the parsing functions, and the parsed data are stored in the public parameters corresponding to the structure, including: Based on the minimum log level acquisition function, parse the value of the minimum log level in each key-value pair, and store the value of the minimum log level in the minimum log level public parameter of the structure; Based on the deregistration operation acquisition function, the value named as operator deregistration in each key-value pair is parsed, and the value of operator deregistration is stored in the unregistered operator public parameter of the structure; Based on the analyzer start function, parse the value named analyzer start in each key-value pair, and store the analyzer start value into the analyzer start public parameter of the structure; The minimum log level value and the analyzer startup value are saved in digital form; the operator cancellation value is saved in string form.

8. The project configuration management method according to claim 3, characterized in that: When there is a configuration management requirement for the engineering project, modifying the configuration information of the corresponding configuration module in the target markup language file includes: When there is a configuration management requirement for the engineering project, determining a target configuration module corresponding to the configuration management requirement; The value of the corresponding key-value pair in the target markup language file is modified according to the target configuration module to modify the configuration information of the target configuration module.

9. The project configuration management method according to any one of claims 1 to 8, characterized in that: Also includes: Monitor changes in configuration management requirements for the engineering project; A development log for the engineering project is generated according to changes in the configuration management requirements.

10. The project configuration management method according to claim 9, characterized in that: After monitoring the changes in the configuration management requirements of the engineering project, the method further includes: According to the change of the configuration management requirement, determining whether the number of modification times of the configuration information of the target configuration module exceeds a threshold; If so, redetermine the configuration management requirements of the engineering project.

11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the project configuration management method according to any one of claims 1 to 10 are implemented.

12. A project configuration management device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the project configuration management method according to any one of claims 1 to 10 when executing the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the project configuration management method according to any one of claims 1 to 10 are implemented.