Configuration file compiling method and device, equipment, storage medium and program product

By using preset hierarchical structures and configuration plug-ins in large software systems, the problem of difficult configuration files is solved, precise analysis of configuration files and standardized generation of target configuration files is achieved, and management performance is improved.

CN119396489APending Publication Date: 2025-02-07DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411464163.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

Configuration files are difficult to manage in large software systems, especially when inter-process dependencies are complex.

Method used

Read the initial configuration file into the memory database through a preset hierarchy, parse the key-value pairs to obtain the intermediate configuration file, and use the configuration plug-in to generate the target configuration file.

Benefits of technology

It realizes unified management of large software system configuration files, avoids redundancy problems, and improves the accuracy and management performance of configuration file parsing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396489A_ABST
    Figure CN119396489A_ABST
Patent Text Reader

Abstract

The invention relates to a configuration file compiling method and device, equipment, a storage medium and a program product. The method comprises the following steps: reading an initial configuration file into a memory database according to a preset hierarchical structure; analyzing a key value pair in the initial configuration file to obtain an intermediate configuration file; and generating a target configuration file according to a configuration plug-in and the intermediate configuration file. By adopting the method, the configuration file of the large-scale software system can be conveniently managed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a configuration file compilation method, apparatus, device, storage medium and program product. Background Art

[0002] In many applications and systems, configuration files are needed to set and adjust various parameters to ensure that the applications and systems can run as expected. By modifying the configuration files, users or developers can change the configuration of the system or application to meet specific needs or environments.

[0003] In traditional technologies, a configuration file is usually used by only a certain process, or a certain configuration file is used by a certain system resource. However, large software systems often contain various processes, and the dependencies between processes are also intertwined. If existing configuration technologies are used, there will be a problem that configuration files are difficult to manage. Summary of the invention

[0004] Based on this, it is necessary to provide a configuration file compilation method, device, equipment, storage medium and program product that can conveniently manage configuration files of large software systems in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for compiling a configuration file, comprising:

[0006] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0007] Parsing the key-value pairs in the initial configuration file to obtain an intermediate configuration file;

[0008] Generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0009] In one embodiment, generating a target configuration file according to the configuration plug-in and the intermediate configuration file includes:

[0010] Utilizing the configuration plug-in to parse the structure in the intermediate configuration file and construct a tree database;

[0011] The target configuration file is generated according to the tree database.

[0012] In one embodiment, generating the target configuration file according to the tree database includes:

[0013] According to the process name of each process in the system to be configured, the configuration file corresponding to each process is exported from the tree database to generate the target configuration file.

[0014] In one embodiment, parsing the key-value pairs in the initial configuration file to obtain the intermediate configuration file includes:

[0015] The variables, expressions and groups in the key-value pairs are subjected to grammatical analysis and semantic expansion to obtain the intermediate configuration file.

[0016] In one of the embodiments, the preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

[0017] In one embodiment, the method further comprises:

[0018] The configuration file to be compiled is formatted, and the configuration file to be compiled is converted into a configuration file in an extensible markup language format to generate the initial configuration file.

[0019] In a second aspect, the present application also provides a configuration file compilation device, including:

[0020] The reading module is used to read the initial configuration file into the memory database according to the preset hierarchical structure;

[0021] An acquisition module, used to parse the key-value pairs in the initial configuration file to obtain an intermediate configuration file;

[0022] The generation module is used to generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0023] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0024] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0025] Parsing the key-value pairs in the initial configuration file to obtain an intermediate configuration file;

[0026] Generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0027] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0028] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0029] Parsing the key-value pairs in the initial configuration file to obtain an intermediate configuration file;

[0030] Generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0031] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0032] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0033] Parsing the key-value pairs in the initial configuration file to obtain an intermediate configuration file;

[0034] Generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0035] The above-mentioned configuration file compilation method, device, equipment, storage medium and program product, because the initial configuration file is read into the memory database according to the preset hierarchical structure, can realize the unified management of the initial configuration file stored in the memory database through the preset hierarchical structure, and the preset hierarchical structure can make the contents in the initial configuration file stored in the memory database have a certain dependency relationship, and also avoid the problem of redundancy when the initial configuration file is read into the memory database, so that the key-value pairs in the initial configuration file can be accurately parsed based on the above-mentioned hierarchical structure, which facilitates the process of parsing the key-value pairs in the initial configuration file, and then by calling the configuration plug-in to process the intermediate configuration file, the target configuration file can be generated, the generation process of the target configuration file is standardized, and the process of generating the target configuration file can be more conveniently managed, thereby improving the management performance of the configuration file. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0037] FIG1 is a schematic diagram of a flow chart of a method for compiling a configuration file in one embodiment;

[0038] FIG2 is a schematic diagram of a structure of a preset hierarchical structure in one embodiment;

[0039] FIG3 is a schematic diagram of a flow chart of a method for compiling a configuration file in another embodiment;

[0040] FIG4 is a general structural diagram of a method for compiling a configuration file in one embodiment;

[0041] FIG5 is a structural block diagram of a device for compiling a configuration file in one embodiment;

[0042] FIG6 is a structural block diagram of a device for compiling a configuration file in another embodiment;

[0043] FIG7 is a structural block diagram of a device for compiling a configuration file in another embodiment;

[0044] FIG8 is a structural block diagram of a device for compiling a configuration file in another embodiment;

[0045] FIG. 9 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] In an exemplary embodiment, as shown in FIG1 , a configuration file compilation method is provided. This embodiment is illustrated by applying the method to a computer device. It is understandable that the method can also be applied to a server, and can also be applied to a system including a computer device and a server, and is implemented through the interaction between the computer device and the server. In this embodiment, the method includes the following steps:

[0048] S201, reading the initial configuration file into the memory database according to the preset hierarchical structure.

[0049] Among them, the preset hierarchical structure can be a universally applicable structure determined in advance according to the structure of the configuration file corresponding to each application or system. Optionally, in this embodiment, the preset hierarchical structure can be a hierarchical structure of libraries, tables, records, and key-value pairs as shown in Figure 2. The top layer is the library instance. Multiple library instances are supported in one process. Each library instance can manage multiple tables. As an optional implementation method, it can be managed with a bidirectional linked list. Each table can manage multiple records. It can also be managed with a bidirectional linked list. The capacity of each record is fixed and multiple sets of key-value pairs (Key-Value, KV) can be stored. The position and length of the Value can be maintained in the Key. Optionally, the initial configuration file in this embodiment can be the initial configuration file of a certain application, or it can be the initial configuration file of a certain system. This embodiment is not limited here.

[0050] It is understandable that the initial configuration file describes configuration information more from a resource perspective. For example, if the initial configuration file includes a process table / thread pool table / connection table / memory table / core group table, the memory database is also saved in the hierarchical structure of the process table / thread pool table / connection table / memory table / core group table. Optionally, in this embodiment, the initial configuration file can be read into the memory database in the form of a file according to a preset hierarchical structure.

[0051] S202, parse the key-value pairs in the initial configuration file to obtain an intermediate configuration file.

[0052] First, it should be noted that in order to simplify the initial configuration file as much as possible to avoid redundancy and realize configuration linkage, the initial configuration file may use expression syntax. For example, the expression syntax used may include atomic expressions, sequence sequences, sets, difference sets, intersection sets, variables, group mappings, etc. This embodiment does not limit this. As an example, the atomic expression: $ <ring>:start:gap, ring represents a cyclic sequence, start represents the starting position of the sequence, and gap represents the extraction interval; for example, for a single sequence 4, 6, 8, 2, it may be expressed as $<1, 2, 3, 4, 5, 6, 7, 8>:4:2 in the initial configuration file. For another example, the sequential sequence: $(x, y) $(x, y] $[x, y) $[x, y], represents a sequential sequence from x to y, the small brackets represent open intervals, and the square brackets represent closed intervals. For the sequential sequence 192.168.0.1, 192.168.0.2, 192.168.0.3, it may be expressed as 192.168.0.$(1, 5) in the initial configuration file. For another example, the set: ${x1,x2,x3}, represents the set x1x2 x3. Difference set: $- <blk> <cond>, which means that blk removes the items in cond, removes duplicates, and forms a single sequence. For example, the set 1, 3 may be expressed as $-<1, 2, 3, 4><2, 4> in the initial configuration file. Intersection: $* <blk> <cond>Indicates that blk retains the items in cond, removes duplicates, and forms a single sequence. For example, the set 2, 4 may be expressed as $-<1, 2, 3, 4><2, 4> in the initial configuration file. The variable $Obj.Key $.Key indicates the result generated by the external given semantics. Obj.Key indicates the Key member value of the matching record item defined by Obj, and .Key indicates the Key member value of this record item.

[0053] Furthermore, as an example, CPU resources are usually divided into CPU groups (core groups) as needed when used. For example, core group A includes CPU1, CPU2, and CPU3, and core group B includes CPU4, CPU5, and CPU6. When there are many CPUs (for example, there are 256 CPUs on a hardware device), it is not appropriate to use this one-by-one enumeration method. Therefore, atomic expressions can be used in the initial configuration file. For example, core group A can be expressed as: $<0,31>, and core group B can be expressed as: $<32,63>. This can avoid errors. For another example, sometimes the CPU needs to be divided at intervals. For example, 0, 2, 4, 6, and 8 need to be divided into core group A, and 1, 3, 5, 7, and 9 need to be divided into core group B. Atomic expressions can also be used. Core group A can be expressed as: $<0,31>:0:2, and core group B can be expressed as: $<0,31>:1:2. For another example, if you need to divide CPUs 0-15 and 32-47 into core group A, and CPUs 16-31 and 48-63 into core group B, you can combine atomic expressions and set sequence nesting. Core group A can be expressed as: $<$[0,16),$[32,48)>, and core group B can be expressed as: $<$[16,32),$[48,64)>.

[0054] Therefore, in this embodiment, the key-value pairs in the initial configuration file need to be parsed and expanded until the key-value pairs of all tables no longer contain expressions, thereby obtaining an intermediate configuration file. Optionally, in this embodiment, the key-value pairs in the initial configuration file may be parsed according to the meaning of the expressions included in the key-value pairs in the initial configuration file to obtain an intermediate configuration file.

[0055] S203, generating a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0056] In this embodiment, the configuration plug-in mainly parses the configuration items parsed from the intermediate configuration file into binary data that can be directly loaded and used by the program as needed. Optionally, in this embodiment, the corresponding configuration plug-in can be called based on the actual configuration requirements, and the corresponding configuration items can be exported from the intermediate configuration file to generate the target configuration file. Optionally, the computer device can call the configuration plug-in corresponding to the process name included in the application to be configured, derive the configuration items corresponding to each process from the intermediate configuration file, generate the configuration file corresponding to each process, and obtain the target configuration file.

[0057] In the above-mentioned configuration file compilation method, since the initial configuration file is read into the memory database according to the preset hierarchical structure, the preset hierarchical structure can be used to achieve unified management of the initial configuration file saved in the memory database, and the preset hierarchical structure can make the contents of the initial configuration file saved in the memory database have certain dependencies, and also avoid the problem of redundancy when the initial configuration file is read into the memory database, so that the key-value pairs in the initial configuration file can be accurately parsed based on the above-mentioned hierarchical structure, which facilitates the process of parsing the key-value pairs in the initial configuration file, and then by calling the configuration plug-in to process the intermediate configuration file, the target configuration file can be generated, the generation process of the target configuration file is standardized, and the process of generating the target configuration file can be more conveniently managed, thereby improving the management performance of the configuration file.

[0058] This embodiment will describe in detail the specific process of generating the target configuration file based on the configuration plug-in and the intermediate configuration file. In an exemplary embodiment, as shown in FIG3 , the above S203 includes:

[0059] S301, using the configuration plug-in to parse the structure in the intermediate configuration file and build a tree database.

[0060] The configuration plug-in is a piece of code that is strongly related to the business. Its function is to find the required structure from the intermediate configuration file to extract the relevant data and build the extracted relevant data into a tree database. The structure parsed by the configuration plug-in can be used directly by the program without additional parsing or conversion.

[0061] In this embodiment, exemplarily, for example, the tree-like database is empty at the beginning. After calling the "process plug-in" and the "core group plug-in" to perform processing, since the "process plug-in" and the "core group plug-in" are related to the process table and the core group table, the tree-like database will construct the content related to the process table and the core group table. Furthermore, after calling the "memory plug-in", the "thread plug-in", and the "connection plug-in" to perform processing, the tree-like database will construct the content related to the memory table, the thread table, and the connection table.

[0062] S302, generating a target configuration file according to the tree database.

[0063] Optionally, in this embodiment, the root node and leaf nodes of the tree database may be determined, and the configuration items in the tree database may be exported according to the distribution order of the root node and the leaf nodes to generate a target configuration file.

[0064] In this embodiment, as an optional implementation, the configuration files corresponding to each process can be determined in the tree database according to the process name of each process in the system to be configured, and then the configuration files corresponding to each process can be exported from the tree database to obtain the configuration files corresponding to each process, thereby generating the above-mentioned target configuration files based on the configuration files of each process. It can be understood that the configuration files of each process of the system to be configured are uniformly generated after being compiled, which can avoid problems caused by inconsistent configuration versions.

[0065] It can be understood that the generated target configuration file is binary data that can be directly loaded and used by the program. In this embodiment, as an optional implementation, the generated target configuration file can also be converted into a text file for easy viewing by operation and maintenance personnel.

[0066] In this embodiment, the process of parsing the structure in the intermediate configuration file using the configuration plug-in is relatively simple, and a tree-like database that is easy to manage can be constructed in a timely manner. The target configuration file is constructed based on the tree-like database, which also enables the operation and maintenance personnel to manage the target configuration file based on the construction idea of ​​the tree-like database, thereby facilitating the operation and maintenance personnel to manage the target configuration file.

[0067] In this embodiment, the specific process of parsing the key-value pairs in the initial configuration file is explained, and how to parse the key-value pairs in the initial configuration file to obtain the intermediate configuration file is explained. In one embodiment, the above S202 includes:

[0068] Step A: Perform syntax analysis and semantic expansion on the variables, expressions, and groups in the key-value pairs to obtain an intermediate configuration file.

[0069] In this embodiment, the computer device can perform grammatical analysis on the variables, expressions and groups in the key-value pairs in the initial configuration file, determine the meaning expressed by the key-value pairs in the initial configuration file, and then semantically expand the key-value pairs according to the meaning expressed by the key-value pairs to obtain the above-mentioned intermediate configuration file.

[0070] For example, if the initial configuration file includes the atomic expression $<1,2,3,4,5,6,7,8>:4:2, then the atomic expression will be parsed into: 4, 6, 8, 2 by performing grammatical analysis and semantic expansion on the atomic expression, that is, the generated intermediate configuration file will replace the original atomic expression with 4, 6, 8, 2. For another example, if the initial configuration file includes the sequence 192.168.0.$(1, 5), then the sequence will be parsed into 192.168.0.1, 192.168.0.2, 192.168.0.3 by performing grammatical analysis and semantic expansion on the sequence, that is, the generated intermediate configuration file will replace the original sequence with 192.168.0.1, 192.168.0.2, 192.168.0.3.

[0071] In this embodiment, the process of performing grammatical analysis and semantic expansion on the variables, expressions and groups in the key-value pairs in the initial configuration file is relatively simple, and the amount of calculation is relatively small. The intermediate configuration file can be obtained by performing grammatical analysis and semantic expansion on the variables, expressions and groups in the key-value pairs in the initial configuration file, thereby ensuring the efficiency of obtaining the intermediate configuration file.

[0072] In some scenarios, the configuration files of some applications or systems may not be in the Extensible Markup Language (XML) format. In order to facilitate the version management of the configuration files, the configuration files need to be converted into XML format files. In one embodiment, the above method further includes:

[0073] Step B: converting the configuration file to be compiled into a configuration file in an extensible markup language format to generate an initial configuration file.

[0074] First, in the present embodiment, it should be noted that the configuration file in XML format is used for version management of the configuration file, and the configuration file in xlsx format is used for editing and modifying the configuration file. Optionally, the format of the configuration file to be compiled in the present embodiment may be in xlsx format, or may be in other file formats, etc., which is not limited in the present embodiment. Therefore, in the present embodiment, when the configuration file to be compiled is compiled, the configuration file to be compiled can be uniformly converted into a configuration file in XML format, and then the configuration file in XML format is compiled. Optionally, in the present embodiment, the configuration file to be compiled can be format converted by running an external script file, and the configuration file to be compiled can be converted into a configuration file in XML format to generate the above-mentioned initial configuration file.

[0075] In addition, it should be noted that there are generally three types of configuration files in XML format: schema.xml, config.xml, and data.xml. That is to say, the initial configuration files read into the memory database can include schema.xml, config.xml, and data.xml. Among them, schema.xml mainly includes four constraint tables (also called meta tables) SCHEMA_VAR, SCHEMA_TABLE, SCHEMA_GROUP, and SCHEMA_STEP. SCHEMA_VAR is used for variable parsing, SCHEMA_TABLE is used for table description (for example, those KV items are key keys, that is, they must exist), SCHEMA_GROUP is used for group mapping, and SCHEMA_STEP represents the parsing steps of the table, which is used to promote the entire configuration parsing process. config.xml mainly contains the definitions of some final tables (which are really concerned by subsequent plug-ins), which use complex expression definitions and are more closely related to the process. data.xml mainly contains some intermediate tables, which are often modified and adjusted, and are more closely related to resources.

[0076] In this embodiment, by converting the format of the configuration files to be compiled, the configuration files to be compiled can be uniformly converted into configuration files in the extensible markup language format, and the formats of the generated initial configuration files are all in the extensible markup language format. In this way, the initial configuration files can be managed in a unified file format, which facilitates the management of the initial configuration files.

[0077] FIG4 is an overall structural diagram of the method for compiling a configuration file provided by the present application. To facilitate understanding by those skilled in the art, the method for compiling a configuration file provided by the present application is described in detail below in conjunction with FIG4. The method may include:

[0078] S1, converting the format of the configuration file to be compiled into a configuration file in an extensible markup language format to generate an initial configuration file.

[0079] S2, reads the initial configuration file into the in-memory database according to the hierarchical structure of libraries, tables, records, and key-value pairs.

[0080] S3, performs syntax analysis and semantic expansion on the variables, expressions, and groups in the key-value pairs in the initial configuration file to obtain an intermediate configuration file.

[0081] S4, use the configuration plug-in to parse the structure in the intermediate configuration file and build a tree database.

[0082] S5, according to the process name of each process in the system to be configured, export the configuration file corresponding to each process from the tree database to generate a target configuration file.

[0083] It should be noted that for the descriptions in the above S1-S5, reference may be made to the relevant descriptions in the above embodiments, and the effects are similar, so this embodiment will not be repeated here.

[0084] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0085] Based on the same inventive concept, the embodiment of the present application also provides a configuration file compilation device for implementing the configuration file compilation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the compilation device for one or more configuration files provided below can refer to the limitations of the configuration file compilation method above, and will not be repeated here.

[0086] In an exemplary embodiment, as shown in FIG5 , a configuration file compilation device is provided, comprising: a reading module 10, an acquisition module 11 and a generation module 12, wherein:

[0087] The reading module 10 is used to read the initial configuration file into the memory database according to the preset hierarchical structure.

[0088] The acquisition module 11 is used to parse the key-value pairs in the initial configuration file to obtain the intermediate configuration file.

[0089] The generating module 12 is used to generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

[0090] Optionally, the preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

[0091] The configuration file compilation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0092] In one embodiment, as shown in FIG6 , the generation module 12 includes: a construction unit 121 and a generation unit 122, wherein:

[0093] The construction unit 121 is used to parse the structure in the intermediate configuration file using the configuration plug-in to construct a tree database.

[0094] The generating unit 122 is used to generate a target configuration file according to the tree database.

[0095] The configuration file compilation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0096] In one embodiment, please continue to refer to FIG. 6 , the generating unit 122 is specifically used to derive the configuration files corresponding to each process from the tree database according to the process name of each process in the system to be configured, and generate the target configuration file.

[0097] The configuration file compilation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0098] In one embodiment, as shown in FIG. 7 , the acquisition module 11 includes: an acquisition unit 111, wherein:

[0099] The acquisition unit 111 is used to perform syntax analysis and semantic expansion on the variables, expressions and groups in the key-value pairs to acquire the intermediate configuration file.

[0100] The configuration file compilation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0101] In one embodiment, as shown in FIG8 , the above device further includes: a conversion module 13, wherein:

[0102] The conversion module 13 is used to perform format conversion on the configuration file to be compiled, convert the configuration file to be compiled into a configuration file in an extensible markup language format, and generate an initial configuration file.

[0103] The configuration file compilation device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.

[0104] Each module in the above configuration file compilation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0105] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG9. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store an initial configuration file. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for compiling a configuration file is implemented.

[0106] Those skilled in the art will understand that the structure shown in FIG. 9 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0107] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0108] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0109] Parse the key-value pairs in the initial configuration file to obtain the intermediate configuration file;

[0110] Generate the target configuration file based on the configuration plug-in and the intermediate configuration file.

[0111] Optionally, the preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

[0112] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0113] Use the configuration plug-in to parse the structure in the intermediate configuration file and build a tree database;

[0114] Generate a target configuration file based on the tree database.

[0115] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0116] According to the process name of each process in the system to be configured, the configuration file corresponding to each process is exported from the tree database to generate a target configuration file.

[0117] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0118] Perform syntax analysis and semantic expansion on the variables, expressions, and groups in the key-value pairs to obtain the intermediate configuration file.

[0119] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0120] The configuration file to be compiled is converted into a configuration file in an extensible markup language format to generate an initial configuration file.

[0121] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0122] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0123] Parse the key-value pairs in the initial configuration file to obtain the intermediate configuration file;

[0124] Generate the target configuration file based on the configuration plug-in and the intermediate configuration file.

[0125] Optionally, the preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

[0126] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0127] Use the configuration plug-in to parse the structure in the intermediate configuration file and build a tree database;

[0128] Generate a target configuration file based on the tree database.

[0129] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0130] According to the process name of each process in the system to be configured, the configuration file corresponding to each process is exported from the tree database to generate a target configuration file.

[0131] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0132] Perform syntax analysis and semantic expansion on the variables, expressions, and groups in the key-value pairs to obtain the intermediate configuration file.

[0133] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0134] The configuration file to be compiled is converted into a configuration file in an extensible markup language format to generate an initial configuration file.

[0135] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0136] Read the initial configuration file into the memory database according to the preset hierarchical structure;

[0137] Parse the key-value pairs in the initial configuration file to obtain the intermediate configuration file;

[0138] Generate the target configuration file based on the configuration plug-in and the intermediate configuration file.

[0139] Optionally, the preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

[0140] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0141] Use the configuration plug-in to parse the structure in the intermediate configuration file and build a tree database;

[0142] Generate a target configuration file based on the tree database.

[0143] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0144] According to the process name of each process in the system to be configured, the configuration file corresponding to each process is exported from the tree database to generate a target configuration file.

[0145] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0146] Perform syntax analysis and semantic expansion on the variables, expressions, and groups in the key-value pairs to obtain the intermediate configuration file.

[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0148] The configuration file to be compiled is converted into a configuration file in an extensible markup language format to generate an initial configuration file.

[0149] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0150] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are 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 application.

[0151] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.< / cond> < / blk> < / cond> < / blk> < / ring>

Claims

1. A method for compiling a configuration file, characterized in that: The method comprises: Read the initial configuration file into the memory database according to the preset hierarchical structure; Parsing the key-value pairs in the initial configuration file to obtain an intermediate configuration file; Generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

2. The method according to claim 1, characterized in that The step of generating a target configuration file according to the configuration plug-in and the intermediate configuration file includes: Utilizing the configuration plug-in to parse the structure in the intermediate configuration file and construct a tree database; The target configuration file is generated according to the tree database.

3. The method according to claim 2, characterized in that The step of generating the target configuration file according to the tree-like database includes: According to the process name of each process in the system to be configured, the configuration file corresponding to each process is exported from the tree database to generate the target configuration file.

4. The method according to claim 1, characterized in that: The step of parsing the key-value pairs in the initial configuration file to obtain the intermediate configuration file includes: The variables, expressions and groups in the key-value pairs are subjected to grammatical analysis and semantic expansion to obtain the intermediate configuration file.

5. The method according to any one of claims 1 to 4, characterized in that: The preset hierarchical structure is a hierarchical structure of library, table, record, and key-value pair.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The configuration file to be compiled is formatted, and the configuration file to be compiled is converted into a configuration file in an extensible markup language format to generate the initial configuration file.

7. A configuration file compilation device, characterized in that: The device comprises: The reading module is used to read the initial configuration file into the memory database according to the preset hierarchical structure; An acquisition module, used to parse the key-value pairs in the initial configuration file to obtain an intermediate configuration file; The generation module is used to generate a target configuration file according to the configuration plug-in and the intermediate configuration file.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.