Configuration file management method and device, equipment and medium

By setting reference inheritance tags in the configuration file and replacing them with base class attributes, the problem of low configuration file management efficiency in large-scale search and recommendation systems is solved, and storage resource conservation and management efficiency are improved.

CN119759449AActive Publication Date: 2025-04-04BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411945343.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04
Estimated Expiration
2044-12-26

AI Technical Summary

Technical Problem

In large-scale search and recommendation systems, the configuration files are huge and complex, which leads to repeated comparison and repeated configuration operations for operation and maintenance personnel when configuration iteration and function updates, which is inefficient and prone to errors.

Method used

通过在配置文件中设置引用继承标签,并在读取配置文件后将引用继承标签替换为其所指示的基类配置文件中的引用继承属性,从而实现配置文件的灵活便捷管理。

Benefits of technology

Saves the storage resources required for configuration files, improves the management efficiency of configuration files, and reduces maintenance difficulty and cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759449A_ABST
    Figure CN119759449A_ABST
Patent Text Reader

Abstract

The invention provides a configuration file management method and device, equipment and a medium, relates to the technical field of computer software, in particular to the technical fields of software engineering, data modeling, configuration management and the like, and can be used for application scenes such as generative search, document intelligent editing, intelligent assistants, virtual assistants and intelligent e-commerce. The method comprises the steps that a first configuration file is read, the first configuration file comprises a first reference inheritance label, and the value of the first reference inheritance label indicates a first reference inheritance attribute in a first base class configuration file; obtaining a first reference inheritance attribute from the first base class configuration file based on the value of the first reference configuration tag; and replacing the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain an expanded first configuration file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer software technology, and in particular to technical fields such as software engineering, data modeling, and configuration management. It can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce, and specifically relates to a configuration file management method, a configuration file management device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In large-scale search and recommendation systems, configuration files are large and complex, often up to thousands or tens of thousands of items. Traditionally, different application cases use configuration files independently, which have a lot of similarities and a few differences. This causes operation and maintenance personnel to repeatedly compare and repeat configuration operations during configuration iterations and function updates, which is not only inefficient but also prone to errors. In addition, when common features change, the relationship between base classes and subclasses needs to be manually reconstructed, which increases the difficulty and cost of maintenance.

[0003] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0004] The present disclosure provides a configuration file management method, a configuration file management device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of the present disclosure, a configuration file management method is provided, comprising: reading a first configuration file, wherein the first configuration file comprises a first reference inheritance tag, and a value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; based on the value of the first reference configuration tag, obtaining the first reference inheritance attribute from the first base class configuration file; and replacing the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain an expanded first configuration file.

[0006] According to another aspect of the present disclosure, a configuration file management device is provided, including: a reading unit, configured to read a first configuration file, wherein the first configuration file includes a first reference inheritance tag, and a value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; an acquisition unit, configured to acquire the first reference inheritance attribute from the first base class configuration file based on the value of the first reference configuration tag; and a first replacement unit, configured to replace the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain an expanded first configuration file.

[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.

[0009] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0010] According to one or more embodiments of the present disclosure, the present disclosure saves storage resources required for the configuration file and achieves flexible and convenient management of the configuration file by setting a reference inheritance tag in the configuration file and replacing the reference inheritance tag with the reference inheritance attribute in the base class configuration file indicated by it after reading the configuration file.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of a configuration file management method according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A flowchart of a configuration file management method according to an embodiment of the present disclosure is shown;

[0016] Figure 4 A schematic diagram of a reference inheritance relationship tree according to an embodiment of the present disclosure is shown;

[0017] Figure 5A flowchart of replacing one or more attributes in a modified first configuration file with a second reference inheritance tag according to an embodiment of the present disclosure is shown;

[0018] Figure 6 A flowchart of a configuration file management method according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A flowchart of a configuration file management method according to an embodiment of the present disclosure is shown;

[0020] Figure 8 A flowchart of updating reference inheritance properties in multiple base class configuration files according to an embodiment of the present disclosure is shown;

[0021] Fig. 9 A schematic diagram showing a derivation relationship diagram according to an embodiment of the present disclosure is shown;

[0022] Figure 10A-10C A schematic diagram showing a reference inheritance relationship tree and a derivation relationship diagram according to an embodiment of the present disclosure is shown;

[0023] Fig.11 A structural block diagram showing a configuration file management device according to an embodiment of the present disclosure; and

[0024] Fig.12 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0026] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0027] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0028] In the related art, configuration files usually rely on manual combing, which is time-consuming and labor-intensive.

[0029] To solve the above problems, the present disclosure sets a reference inheritance tag in the configuration file, and replaces the reference inheritance tag with the reference inheritance attribute in the base class configuration file it indicates after reading the configuration file, thereby saving the storage resources required for the configuration file and achieving flexible and convenient management of the configuration file.

[0030] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0031] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0032] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the methods of the present disclosure.

[0033] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0034] exist Figure 1In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0035] The user can use client devices 101, 102, 103, 104, 105 and / or 106 to perform human-computer interaction. The client device can provide an interface that enables the user of the client device to interact with the client device. The client device can also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0036] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0037] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0038] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0039] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0040] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0041] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0042] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0043] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0044] Figure 1 The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0045] According to one aspect of the present disclosure, a method for managing a configuration file is provided. Figure 2 As shown, the method includes: step S201, reading a first configuration file, wherein the first configuration file includes a first reference inheritance tag, and the value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; step S202, obtaining the first reference inheritance attribute from the first base class configuration file based on the value of the first reference configuration tag; and step S203, replacing the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain an expanded first configuration file.

[0046] Therefore, by setting the reference inheritance tag in the configuration file and replacing the reference inheritance tag with the reference inheritance attribute in the base class configuration file it indicates after reading the configuration file, the storage resources required for the configuration file are saved and flexible and convenient management of the configuration file is achieved.

[0047] In an exemplary embodiment, in the offline database building business of searching, there are scenarios for building and maintaining multiple library types. A library type refers to a certain type of configuration file included in an index. They generally calculate the same features and use the same index building method. In larger-scale search applications, there are often hundreds of library types, and there are similarities and differences between different library types. Generally, there is at least one configuration difference between different library types, such as differences in calculation features, or local differences in index building methods, etc. When maintaining hundreds of library types, it is often necessary to carefully compare all configuration items of two or more library types, so how to characterize the differences between different library types becomes a challenge. When doing feature upgrades, if you want a certain change to take effect on several library types at the same time, you often have to repeatedly configure these library types, which is very complex.

[0048] The configuration file management method proposed in the present disclosure can better describe the similarities and differences between these libraries. When updating the similarities, only one place can be modified, and all libraries are affected by the changes at the same time. The differences can be seen at a glance, and the differences between different libraries can be quickly understood. The efficiency of search system operation, maintenance, and iteration is improved.

[0049] In some embodiments, the configuration file management method proposed in the present disclosure can be used for system configuration files, and can be used for configuration files based on standard file protocols, such as json, protobuf, xml, yaml, etc. These standard file protocols generally have specifications for describing basic data structures such as Boolean values, numbers, strings, arrays, objects, etc. Various applications define specific protocols for system configuration based on these basic data structure specifications.

[0050] This disclosure will mainly use JSON as an example to illustrate the proposed configuration file management method, but it is not intended to limit the scope of protection of this disclosure. It is understandable that implementation methods based on other protocols or custom protocols are all within the scope of protection of this disclosure. In addition, "configuration file" is intended to refer to a complete configuration description paragraph, rather than a specific computer file.

[0051] This disclosure will use $lref to refer to a reference inheritance tag, and use expressions such as base class and base to refer to a base class configuration file.

[0052] In some embodiments, most existing methods cannot directly describe the differences between different configuration files. For example, there are two services with different IP addresses and the same other configurations. When using json to describe, it is generally described as follows:

[0053]

[0054] Service A and service B have different IP addresses, but the port and other information are the same, but they need to be described repeatedly.

[0055] By adopting the method proposed in the present disclosure, the above example can be modified as follows:

[0056]

[0057]

[0058] In the above example, a reference inheritance tag $lref is used to express the reference and inheritance relationship. A and B both define that they want to reference and inherit the base class configuration file basic_service.json. A and B only need to define the differences between themselves and the base class configuration file. The common points between A and B can be described in basic_service.json. In real business scenarios, there may be a lot of these common configuration contents, and the structure is also very complex. In some embodiments, a library has as many as tens of thousands of description items. This reference inheritance method has played a very important role, improving the efficiency of system configuration updates and reducing the difficulty of familiarizing with and maintaining the system.

[0059] In some embodiments, the reference inheritance tag $lref represents the concept of reference inheritance, and the format is defined as follows:

[0060] {"$lref":"dir / some_json_file.json#json-pointer"}

[0061] Indicates that the reference inherits the value of the tag $lref, which is taken from the content of the json-pointer position in the file dir / some_json_file.json, where:

[0062] ·dir is a directory prefix, and there can actually be multiple layers of directories;

[0063] some_json_file.json is a file in valid json text format;

[0064] ·json-pointer points to a certain location in json. The definition of json-pointer refers to RFC6901.

[0065] JSON has 6 basic types: boolean, number, string, null, array, object. Among them, boolean, number, string, null are single-value types; object and array are composite types, and the internal basic elements are still the 6 basic types of JSON.

[0066] When the json-pointer in the $lref tag points to a single-value type or array type, it means "reference", that is, its value cannot be modified.

[0067] When the json-pointer of the $lref tag points to the object type, it means "inheritance", which is the json merge patch. In other words, you can not only reference the value of the content pointed to by the json-pointer, but also modify it further.

[0068] In an exemplary embodiment, the content of the base class configuration file base.json is as follows:

[0069]

[0070]

[0071] Depending on the JSON type, use "$lref" to express the reference inheritance relationship as follows:

[0072] 1) Reference semantics

[0073] An example configuration file boolean.json has the following contents:

[0074] {

[0075] “$lref”: “base.json#n”

[0076] }

[0077] After the file is expanded, the content is: 3.14

[0079] An example configuration file array.json has the following contents:

[0080] {

[0081] “$lref”: “base.json#a”

[0082] }

[0083] After the file is expanded, the content is:

[0084] [1,2{“s”:“hello”}]

[0085] 2) Inheritance semantics

[0086] An example configuration file object.json has the following contents:

[0087]

[0088] After the file is expanded, the actual content is:

[0089]

[0090]

[0091] The value of the p1 property is inherited from the base class base.json, the p2 property is deleted (because null is set), and p3 is a new property.

[0092] Back to Figure 2 The first configuration file read in step S201 may be similar to the above exemplary configuration file. The first configuration file may include a first reference inheritance tag $lref, whose value indicates the first reference inheritance attribute in the first base class configuration file.

[0093] In some embodiments, the first reference inheritance tag can reference the first base class configuration file as a whole, that is, the first configuration file as a whole inherits the first base class configuration file, and the first reference inheritance attribute is actually all attributes in the first base class configuration file.

[0094] In some embodiments, the first reference inheritance tag may reference some properties in the first base class configuration file.

[0095] In some embodiments, in step S202 and step S203, the content referenced by the $lref tag can be read as the original content, the value of the current $lref tag definition position can be used as a patch, the patch can be applied to the original content, and the generated result can be used as the expanded content to obtain the expanded first configuration file.

[0096] In some embodiments, due to the existence of array and object, the $lref tag may be nested. In this case, local expansion can be performed first and used as fact content (determined value), and then the upper layer larger scope $lref tags are expanded layer by layer.

[0097] The above steps S201 to S203 can be called a load operation (load, or load_json), the purpose of which is to expand the $lref tag. Specifically, the content containing the $lref tag is read from the file, the $lref tag is expanded, and finally a configuration file (such as a json object, which may have different implementations in different programming languages) that does not contain the $lref tag is returned. The expanded first configuration file finally returned can be directly used by the program.

[0098] In some embodiments, the first configuration file may be expanded using the following steps:

[0099] Step SA01, in response to determining that the current value is a single-value type, returning the value of the element;

[0100] Step SA02: In response to determining that the current value is an array type,

[0101] Iterate over each element of the array, including:

[0102] Step SA021: Perform a load operation on each element (call load_json)

[0103] Get the result after expanding the $lref tag, and replace the result to the corresponding position in the array;

[0104] Step SA03, return the content of the entire array;

[0105] Step SA04: In response to determining that the current value is an object type,

[0106] Iterate over each property of the object, including:

[0107] Step SA041: For each attribute value, perform a loading operation (call load_json), and use the returned expansion result as the attribute value of the current object;

[0108] Step SA05, in response to determining that there is an attribute named $lref under the current value, read the content pointed to by the json pointer in $lref (to become the original content), use the content of the current object as a patch, apply the patch to the original content using a fusion patch method to obtain a result, and exchange the result with the current value;

[0109] Step SA06: Return the current value.

[0110] According to some embodiments, Figure 3 As shown, the configuration file management method may also include: step S304, after reading the first configuration file, adding the reference inheritance relationship between the reference configuration tag in the first configuration file and the first reference inheritance attribute in the first base class configuration file to the reference inheritance relationship tree; step S305, in response to receiving a storage instruction for the modified first configuration file, replacing one or more attributes in the modified first configuration file with a second reference inheritance tag based on the reference inheritance relationship tree to obtain a folded first configuration file; and step S306, storing the folded first configuration file.

[0111] Understandably, Figure 3 The operations and effects of steps S301 to S303 in the above description can be referred to. Figure 2The description of steps S201 to S203 in the process will not be repeated here.

[0112] Through step S304, the reference inheritance tree (hereinafter referred to as RefTree) of the $lref tag is synchronously constructed. With RefTree, it is convenient to understand the dependencies between various configuration files of the system. When the content of the configuration file is adjusted later, RefTree is also relied on to put what can be put into the base class into the base class as much as possible, and what cannot be put into the base class is put into the subclass (i.e. each configuration file).

[0113] Figure 4 FIG. 1 shows a schematic diagram of a reference inheritance tree RefTree. Figure 4 It can be seen that the configuration file son.json as a whole references and inherits the configuration file father.json, the attribute hobby in the configuration file son.json references the attribute hobby in the configuration file father.json, and the attribute address in the configuration file son.json and the attribute address in the configuration file father.json both reference the attribute address in the configuration file common.json.

[0114] The above step S305 can be called a storage operation (save, or save_json). The storage operation can be regarded as the inverse operation of the load operation. For a configuration document that does not contain a $lref tag, if its RefTree and the contents of all files pointed to by the $lref tag are known, the configuration file can be converted into a form containing a $lref tag and stored.

[0115] According to some embodiments, Figure 5 As shown, step S305, replacing one or more attributes in the modified first configuration file with the second reference inheritance tag based on the reference inheritance relationship tree may include: step S501, determining the current attribute in the modified first configuration file; step S502, in response to determining that the reference inheritance relationship tree indicates that the current attribute has a reference inheritance relationship with the second reference inheritance attribute of the second base class configuration file, determining whether the value of the current attribute is consistent with the value of the second reference inheritance attribute; and step S503, in response to determining that the value of the current attribute is consistent with the value of the second reference inheritance attribute, replacing the current attribute with the second reference inheritance tag, the value of the second reference inheritance tag indicating the second reference inheritance attribute in the second base class configuration file.

[0116] In some embodiments, in step S501, all attributes in the modified first configuration file may be traversed, and these attributes may be used as current attributes in turn to execute subsequent steps.

[0117] In some embodiments, the modified first configuration file may be folded using the following steps:

[0118] Step SB01, in response to determining that the current value is of type number, boolean, string, or null, determine whether there is a $lref tag in the RefTree at the location of the current value;

[0119] Step SB02, in response to determining that there is no $lref tag, returning the value of the current position;

[0120] Step SB03: In response to determining that there is a $lref tag,

[0121] In response to determining that the content pointed to by $lref is the same as the current value, a reference inheritance tag $lref is constructed, whose value points to the content pointed to by $lref in the RefTree as the returned content (i.e.

[0122] {"$lref":"json_file.json#json-pointer"});

[0123] In response to determining that the content pointed to by $lref is different from the current value, the inheritance structure is lost and the current value is returned;

[0124] Step SB04: In response to determining that the current value is an array type, determine whether there is an overall inheritance of the array in the RefTree at the location of the current value;

[0125] Step SB05, in response to determining that there is no overall inheritance of the array, recursively perform a storage operation on each element of the array (call save_json), replace each element of the array with the return value, and return the a array;

[0126] Step SB06: In response to determining that there is overall inheritance of the array,

[0127] In response to determining that the content pointed to by $lref is the same as the value, a reference inheritance tag $lref is constructed, whose value points to the content pointed to by $lref in the RefTree as the returned content (i.e. {"$lref":"

[0128] json_file.json#json-pointer”});

[0129] In response to determining that the content pointed to by $lref is different from the current value, the inheritance structure is lost and the current value is returned;

[0130] Step SB07: In response to determining that the current value is an object type,

[0131] Iterate over each property of the object, including:

[0132] Step SB071, execute the storage operation (call save_json) to get the return value sub-merged-patch;

[0133] Step SB072, determine whether sub-merged-patch can be contributed by a content referenced by $lref on json-pointer (i.e., inherit the default value);

[0134] Step SB073: In response to determining that it is possible, the current sub-merged-patch is ignored;

[0135] Step SB074, in response to determining that it is not possible, replace the currently traversed attribute of the object with the sub-merged-patch;

[0136] Step SB08, in response to determining that the current value has a $lref tag (this information is obtained through RefTree), read the content of the $lref tag as the base class configuration file, depth-first traverse the base class configuration file, and in response to determining that a certain position in the base class configuration file does not exist in the current value, then set the null mark to indicate that the current value needs to perform a null operation on the base class.

[0137] According to some embodiments, Figure 6 As shown, the configuration file management method may also include: step S607, in response to receiving a base class generation instruction for multiple second configuration files, recording leaf paths of multiple candidate values ​​in the multiple second configuration files, the leaf paths describing the properties that the corresponding candidate values ​​experience from the root path of the second configuration file to the leaf node; step S608, traversing the recorded leaf paths in reverse order, and clustering the values ​​of different second configuration files under the same leaf path; and step S609, determining the second reference inheritance attributes for the multiple second configuration files based on the clustering results.

[0138] Understandably, Figure 6 The operations and effects of steps S601 to S606 in the above description can be referred to. Figure 3 The description of steps S301 to S306 in the process will not be repeated here.

[0139] The above steps S607 to S609 can be referred to as a base class creation operation (create_base). create_base is the best base class result derived from N values. There is no best answer for the base class, and the derivation result is only one of the implementation methods.

[0140] In some embodiments, some parameters may be pre-set:

[0141]

[0142] The above three parameters can be set simultaneously, or one or two can be set selectively. In this way, a more flexible base class creation operation can be achieved.

[0143] In some embodiments, during the base class creation operation, each subclass participating in the derivation is called a voter, and a group of voters vote for the base class content; different voters vote for the content under different voting paths (relative to the json pointer of the base class) and provide corresponding voting values. Specifically, this can be achieved through the following steps:

[0144] Step SC01, initialize the base class configuration file to null.

[0145] Step SC02: traverse the voting values ​​proposed by each voter, including:

[0146] Step SC021, record the leaf path of each item (all attributes from the root directory ' / ' to a leaf node of a non-object type or an empty object type) into an ordered leaf path set;

[0147] Step SC022: Record the value corresponding to the leaf path to the map cluster_map <leaf_path,

[0148] value-cluster-size>;

[0149] Step SC03, traverse each leaf path under the leaf path set in reverse order, cluster the values ​​under cluster_map[leaf_path] of the current leaf path, clusters with the same value are one cluster, and the value of the largest cluster is used as the value determined by voting.

[0150] Step SC04: Get the base class configuration file.

[0151] In some embodiments, the following filtering conditions may be set:

[0152] a) If set null is not allowed, that is, allow_null = false, if a voter's voting path is a prefix of the current leaf path, and the voter does not have the current leaf path, then the voter can veto;

[0153] b) The voting ratio exceeds the preset ratio. The number of voters whose voting paths are prefixes of the leaf paths is counted. These voters are affected by the results. The vote is passed only when the size of the largest cluster is greater than the ratio of affected voters.

[0154] The above two conditions can be used either alone or together, and there is no limitation here.

[0155] According to some embodiments, the configuration file management method may further include: adding a second reference inheritance attribute to a third base class configuration file that is commonly referenced and inherited by a plurality of second configuration files.

[0156] Therefore, through this method, it is possible to avoid adding more base class configuration files unnecessarily and save storage resources.

[0157] According to some embodiments, the configuration file management method may further include: creating a fourth base class configuration file, the fourth base class configuration file including a second reference inheritance attribute; and adding the reference inheritance relationship between multiple second configuration files and the second reference inheritance attribute to a reference inheritance relationship tree.

[0158] Therefore, in this way, a new base class configuration file can be created without an existing base class configuration file, and the corresponding reference inheritance relationship can be added to the reference inheritance relationship tree, thereby saving storage resources and facilitating subsequent operations.

[0159] According to some embodiments, Figure 7 As shown, the configuration file management method may also include: step S707, determining multiple objective fact attribute values ​​in multiple third configuration files; step S708, based on the reference inheritance relationship tree, determining multiple base class configuration files that have a reference inheritance relationship with the multiple objective fact attribute values; step S709, constructing a derivation relationship graph of multiple objective fact attribute values ​​and multiple base class configuration files, the derivation relationship graph including multiple nodes and at least one directed edge, the node indicating a reference inheritance relationship between an objective fact attribute value and a base class configuration file, and the directed edge describing the derivation order between the reference inheritance relationships of two nodes; and step S710, using the derivation relationship graph and multiple objective fact attribute values, updating the reference inheritance attributes in multiple base class configuration files.

[0160] Understandably, Figure 7 The operations and effects of steps S701 to S706 in the above description can be referred to. Figure 3 The description of steps S301 to S306 in the process will not be repeated here.

[0161] The above steps S707 to S710 can be referred to as a reconstruction operation (reconstruct_lref). In some embodiments, there are a batch of values ​​(hereinafter also referred to as fact doc, representing objective facts) in multiple configuration files, and their respective RefTrees are known. It is hoped that based on the content of the objective facts, the content of the associated base class in the RefTree can be automatically derived, and then the objective facts (and the derived base class file) are written to the file in the form of a $lref tag. The purpose of reconstruction is to put values ​​that can be placed in the parent class into the parent class; values ​​that are not suitable for being placed in the parent class are no longer reflected in the parent class. Because the parent class may be referenced and inherited by multiple configuration files, multiple values ​​are generally entered and reconstructed together.

[0162] According to some embodiments, Figure 8 As shown, step S710, using the derivation relationship graph and multiple objective fact attribute values, updating the reference inheritance attributes in multiple base class configuration files may include: step S801, determining the current node indicating the same base class configuration file among the nodes with an out-degree of zero in the derivation relationship graph; step S802, clustering the objective fact attribute values ​​indicated by the current node to update the reference inheritance attributes of the base class configuration file indicated by the current node; and step S803, removing multiple current nodes from the derivation relationship graph.

[0163] The derivation relationship graph can be a directed acyclic graph (DAG), in which the content of the node is defined as follows:

[0164] derived_file#derived_json_pointer->base_file#base_json_pointer

[0165] Represents that a certain location in the subclass file references the content of a certain location in the base class file. By analyzing all objective facts in the input, the RefTree can be constructed as follows Fig. 9 The derivation relationship graph DAG is shown.

[0166] The directed edges between nodes of the DAG represent the order in which they are popped during derivation. Each time a node with an "out-degree" of 0 is popped, the node is deleted from the DAG. The popped node requires the same base class configuration file indicated, and there are no other nodes in the entire DAG - the in-degree is not 0 and the base class configuration file is consistent with the base class configuration file to be popped.

[0167] Each time a batch of nodes is popped out from the DAG, the base class configuration files of these nodes are the same, and the base class configuration file is the base class file to be derived in the current stage. At this time, the derivation content is known, that is, objective facts. These derivation contents act as voters to vote on the content at the base_json_pointer of the base class configuration file, and the base class configuration file is derived using the base class creation operation mentioned above.

[0168] After the base class configuration file is determined, as an objective fact, a batch of nodes are popped out from the DAG until there are no nodes in the DAG. At this point, all related base class configuration files are derived.

[0169] In some embodiments, when the DAG is empty, the contents of all the base class files involved have been determined. Each objective fact is traversed, and according to their RefTree, a depth-first traversal is performed, and each base class is called for storage operations from the bottom layer for storage.

[0170] In summary, the present disclosure provides a reference inheritance tag $lref, which can represent "reference". It can simplify a large configuration file into multiple small configuration files. When the system is complex and has many configurations, it is still possible to globally model the system functions and split the description. It reduces the cost of system understanding, learning, and maintenance.

[0171] The $lref tag can play the role of "inheritance". For large-scale similar configurations, you can extract the common points of the base class description and modify multiple changes in one place.

[0172] As the system changes, the system configuration will also change synchronously. The configuration description based on the inheritance structure also needs to be iterated (to ensure consistency and to describe commonalities and differences). The reconstruction operation proposed in this patent is a way to reconstruct the base class content. This method can greatly reduce the workload of system configuration iteration and solve the resistance to system configuration optimization application.

[0173] The effect and function of the reconstruction operation will be described below in conjunction with an exemplary embodiment. Assume that there are the following four third configuration files, which adopt the writing method of the $lref tag proposed in the present disclosure as follows.

[0174] "brief_base.json":{"a":{},"b":{}},

[0175] "k_base.json":{"type":"ann"},

[0176] "k1.json":{"$lref":"k_base.json","brief":{"$lref":"brief_base.json","b":null,"aa":{}}},

[0177] "k2.json":{"$lref":"k_base.json","brief":{"$lref":"brief_base.json","a":null,"bb":{}}}

[0178] k1.json and k2.json correspond to a library type respectively. They inherit the base class configuration file k_base.json. At the same time, the content of the attribute "brief" of these two library types inherits another base class configuration file brief_base.json and makes some adjustments. Specifically, k1 deletes the b feature and adds the aa feature; k2 deletes the a feature and adds the bb feature.

[0179] After k1.json and k2.json are expanded by $lref (for example, after the load operation is performed), the actual content is:

[0180] "k1.json":{"type":"ann","brief":{"a":{},"aa":{}}},

[0181] "k2.json":{"type":"ann","brief":{"b":{},"bb":{}}}

[0182] Now, it is expected that the contents of k_base.json and brief_base.json will be re-derived based on the contents of k1.json and k2.json.

[0183] The derived parameters are defined as follows:

[0184] "allow_null": true, / / / < Allow subclasses to delete a property of the base class by setting set-null

[0185] "allow_lose_inherit":false, / / / <Does not allow loss of inheritance relationship

[0186] "vote_ratio":0.3, / / / <The voting threshold. The value of a json pointer position in the base class is taken from the value with the most votes, and the total number of votes must exceed a certain threshold. It is understandable that 0.3 is only an exemplary threshold. When implementing the solution of the present disclosure, it can be set according to needs.

[0187] "input_set":["k1.json","k2.json"], / / / <Which objective facts are involved in the reconstruction together, generally they have a common base class.

[0188] Fig. 10A and Fig. 10B The RefTree of k1.json and the RefTree of k2.json are shown respectively. According to the RefTree structure of k1.json and k2.json, the inference DAG is constructed, as shown in Fig. 10C As shown. Fig. 10C There is no dependency between the nodes in the , so you can derive the base class configuration file k_base.json or the base class configuration file brief_base.json first.

[0189] After the final derivation, the contents of each configuration file are changed to:

[0190]

[0191] Since set-null is allowed in the derivation options and the voting adoption threshold is 0.3, the content of the base class configuration file brief_base.json becomes the full set. The two third configuration files k1 and k2 shield their unwanted features by setting set-null internally. The derivation parameters can be adjusted to change the results. At the same time, k1.json and k2.json are objective facts, which are described in the form of $lref. After the $lref expansion operation, the content does not change in substance; however, the content of the base class configuration file brief_base.json has changed in substance. It can generally be understood that the base class configuration file brief_base.json is the full set of values ​​of all attribute briefs. The attribute brief content of the third configuration files k1 and k2 reflects the difference from the base class configuration file brief_base.json by setting set-null. All attributes that are not set-null use the attributes defined in the base class configuration file brief_base.json.

[0192] Now adjust the derivation option parameters as follows:

[0193]

[0194]

[0195] Since subclass set-null is not allowed in the derivation parameters, the value of the base class configuration file brief_base.json is ultimately null. At this time, the content of k1.json and k2.json has not changed in essence, but the description form of $lref has changed, reflecting the difference between the third configuration files k1 and k2 and the base class configuration file brief_base.json.

[0196] In summary, if all configuration contents are written to the same configuration file, the configuration file will be very large, and different types of change iterations will affect this configuration file. The learning, understanding, and maintenance costs are very high. The benefits of using the reference inheritance tag $lref are:

[0197] 1. Splitting the configuration file (using reference semantics) allows the configuration file to put different contents into different small files according to business semantics.

[0198] 2. Let the related configurations of multiple library types inherit the same base class configuration file (use of inheritance semantics), so that the base class configuration file can be modified and multiple library types can take effect at the same time.

[0199] In addition, when the system is iterated, the system configuration also needs to be iterated synchronously. At this time, if the system configuration is done by $lref reference, the corresponding inherited base class content also faces the need for adjustment. At this time, the reconstruction operation reconstruct_lref proposed in this patent is used to reconstruct the base class, so as to sustainably maintain this inheritance relationship.

[0200] According to another aspect of the present disclosure, a configuration file management device is provided. Fig.11 As shown, the device 1100 includes: a reading unit 1110, configured to read a first configuration file, wherein the first configuration file includes a first reference inheritance tag, and the value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; an acquisition unit 1120, configured to acquire the first reference inheritance attribute from the first base class configuration file based on the value of the first reference configuration tag; and a first replacement unit 1130, configured to replace the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain the expanded first configuration file.

[0201] It is understood that the operations and effects of the units 1110 to 1130 in the device 1100 can be referred to as Figure 2 Steps S201 to S203 in the above are not described in detail here.

[0202] According to some embodiments, the configuration file management device may further include: a first adding unit, configured to, after reading the first configuration file, add the reference inheritance relationship between the reference configuration tag in the first configuration file and the first reference inheritance attribute in the first base class configuration file to the reference inheritance relationship tree; a second replacement unit, configured to, in response to receiving a storage instruction for the modified first configuration file, replace one or more attributes in the modified first configuration file with the second reference inheritance tag based on the reference inheritance relationship tree to obtain a folded first configuration file; and a storage unit, configured to store the folded first configuration file.

[0203] According to some embodiments, the second replacement unit may include: a first determination subunit, configured to determine the current attribute in the modified first configuration file; a judgment subunit, configured to judge whether the value of the current attribute is consistent with the value of the second reference inheritance attribute in response to determining that the reference inheritance relationship tree indicates that the current attribute has a reference inheritance relationship with the second reference inheritance attribute of the second base class configuration file; and a replacement subunit, configured to replace the current attribute with a second reference inheritance tag in response to determining that the value of the current attribute is consistent with the value of the second reference inheritance attribute, the value of the second reference inheritance tag indicating the second reference inheritance attribute in the second base class configuration file.

[0204] According to some embodiments, the configuration file management device may further include: a recording unit, configured to record leaf paths of multiple candidate values ​​in the multiple second configuration files in response to receiving a base class generation instruction for multiple second configuration files, the leaf paths describing the properties that the corresponding candidate values ​​experience from the root path of the second configuration file to the leaf node; a clustering unit, configured to traverse the recorded leaf paths in reverse order and cluster the values ​​of different second configuration files under the same leaf path; and a first determination unit, configured to determine the second reference inheritance attribute for the multiple second configuration files based on the clustering results.

[0205] According to some embodiments, the configuration file management device may further include: a second adding unit configured to add the second reference inheritance attribute to a third base class configuration file that is commonly referenced and inherited by a plurality of second configuration files.

[0206] According to some embodiments, the configuration file management device may further include: a new creation unit, configured to create a new fourth base class configuration file, the fourth base class configuration file including a second reference inheritance attribute; and a third adding unit, configured to add the reference inheritance relationship between multiple second configuration files and the second reference inheritance attribute to the reference inheritance relationship tree.

[0207] According to some embodiments, the configuration file management device may further include: a second determination unit, configured to determine multiple objective fact attribute values ​​in multiple third configuration files; a third determination unit, configured to determine multiple base class configuration files that have a reference inheritance relationship with the multiple objective fact attribute values ​​based on a reference inheritance relationship tree; a construction unit, configured to construct a derivation relationship graph of multiple objective fact attribute values ​​and multiple base class configuration files, the derivation relationship graph including multiple nodes and at least one directed edge, the node indicating a reference inheritance relationship between an objective fact attribute value and a base class configuration file, the directed edge describing the derivation order between the reference inheritance relationships of two nodes; and an update unit, configured to update the reference inheritance attributes in the multiple base class configuration files using the derivation relationship graph and multiple objective fact attribute values.

[0208] According to some embodiments, the update unit includes: a second determination subunit, configured to determine the current node indicating the same base class configuration file among the nodes with an out-degree of zero in the derivation relationship graph; a clustering subunit, configured to cluster the objective fact attribute values ​​indicated by the current node to update the reference inheritance attribute of the base class configuration file indicated by the current node; and a removal subunit, configured to remove multiple current nodes from the derivation relationship graph.

[0209] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0210] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0211] refer to Fig.12 , a block diagram of an electronic device 1200 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0212] like Fig.12As shown, the electronic device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the electronic device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0213] Multiple components in the electronic device 1200 are connected to the I / O interface 1205, including: an input unit 1206, an output unit 1207, a storage unit 1208, and a communication unit 1209. The input unit 1206 can be any type of device that can input information to the electronic device 1200. The input unit 1206 can receive input digital or character information, and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 1207 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1208 can include but is not limited to a disk and an optical disk. The communication unit 1209 allows the electronic device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device and / or the like.

[0214] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods, processes, and / or processes described above. For example, in some embodiments, these methods, processes, and / or processes may be implemented as computer software programs, which are tangibly included in machine-readable media, such as storage units 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1200 via ROM 1202 and / or communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the methods, processes, and / or processes described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to perform these methods, processes and / or processing in any other suitable manner (eg, by means of firmware).

[0215] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0216] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0217] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0218] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0219] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0220] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0221] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0222] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for managing a configuration file, comprising: Reading a first configuration file, wherein the first configuration file includes a first reference inheritance tag, and a value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; Based on the value of the first reference configuration tag, obtaining a first reference inheritance attribute from the first base class configuration file; and The first reference inheritance attribute is used to replace the reference configuration tag in the first configuration file to obtain an expanded first configuration file.

2. The method according to claim 1, further comprising: After reading the first configuration file, adding the reference inheritance relationship between the reference configuration tag in the first configuration file and the first reference inheritance attribute in the first base class configuration file to the reference inheritance relationship tree; In response to receiving a storage instruction for the modified first configuration file, one or more attributes in the modified first configuration file are replaced with a second reference inheritance tag based on the reference inheritance relationship tree to obtain a folded first configuration file; as well as The folded first configuration file is stored.

3. The method according to claim 2, wherein: Replacing one or more attributes in the modified first configuration file with a second reference inheritance tag based on the reference inheritance relationship tree includes: Determining current properties in the modified first configuration file; In response to determining that the reference inheritance relationship tree indicates that the current attribute has a reference inheritance relationship with a second reference inheritance attribute of a second base class configuration file, determining whether a value of the current attribute is consistent with a value of the second reference inheritance attribute; and In response to determining that the value of the current attribute is consistent with the value of the second reference inheritance attribute, the current attribute is replaced with the second reference inheritance tag, the value of the second reference inheritance tag indicating the second reference inheritance attribute in the second base class configuration file.

4. The method according to claim 2, further comprising: In response to receiving a base class generation instruction for a plurality of second configuration files, recording leaf paths of a plurality of candidate values ​​in the plurality of second configuration files, the leaf paths describing attributes that the corresponding candidate values ​​experience from the root path of the second configuration files to the leaf nodes; Traverse the recorded leaf paths in reverse order, and cluster the values ​​of different second configuration files under the same leaf path; as well as Based on the clustering result, second reference inheritance attributes for the plurality of second configuration files are determined.

5. The method according to claim 4, further comprising: The second reference inheritance attribute is added to the third base class configuration file that is commonly referenced and inherited by the multiple second configuration files.

6. The method according to claim 4, further comprising: Creating a fourth base class configuration file, wherein the fourth base class configuration file includes the second reference inheritance attribute; as well as The reference inheritance relationship between the plurality of second configuration files and the second reference inheritance attribute is added to the reference inheritance relationship tree.

7. The method according to claim 2, further comprising: determining a plurality of objective fact attribute values ​​in a plurality of third configuration files; Based on the reference inheritance relationship tree, determining a plurality of base class configuration files having a reference inheritance relationship with the plurality of objective fact attribute values; Constructing a derivation relationship graph of the multiple objective fact attribute values ​​and the multiple base class configuration files, the derivation relationship graph comprising multiple nodes and at least one directed edge, the node indicating a reference inheritance relationship between an objective fact attribute value and a base class configuration file, and the directed edge describing a derivation order between reference inheritance relationships of two nodes; as well as The reference inheritance attributes in the multiple base class configuration files are updated using the derivation relationship graph and the multiple objective fact attribute values.

8. The method according to claim 7, wherein: Using the derivation relationship graph and the multiple objective fact attribute values, updating the reference inheritance attributes in the multiple base class configuration files includes: Determining a current node indicating the same base class configuration file among nodes with an out-degree of zero in the derivation relationship graph; Clustering the objective fact attribute values ​​indicated by the current node to update the reference inheritance attribute of the base class configuration file indicated by the current node; and The multiple current nodes are removed from the inference relationship graph.

9. A configuration file management device, comprising: A reading unit is configured to read a first configuration file, wherein the first configuration file includes a first reference inheritance tag, and a value of the first reference inheritance tag indicates a first reference inheritance attribute in a first base class configuration file; an acquiring unit, configured to acquire a first reference inheritance attribute from the first base class configuration file based on a value of the first reference configuration tag; and The first replacement unit is configured to replace the reference configuration tag in the first configuration file with the first reference inheritance attribute to obtain an expanded first configuration file.

10. The apparatus according to claim 9, further comprising: A first adding unit is configured to add a reference inheritance relationship between a reference configuration tag in the first configuration file and a first reference inheritance attribute in the first base class configuration file to a reference inheritance relationship tree after reading the first configuration file; A second replacement unit is configured to, in response to receiving an instruction to store the modified first configuration file, replace one or more attributes in the modified first configuration file with a second reference inheritance tag based on the reference inheritance relationship tree to obtain a folded first configuration file; as well as The storage unit is configured to store the folded first configuration file.

11. The device according to claim 10, wherein: The second replacement unit comprises: A first determining subunit is configured to determine a current attribute in the modified first configuration file; a judgment subunit configured to judge whether a value of the current attribute is consistent with a value of the second reference inheritance attribute in response to determining that the reference inheritance relationship tree indicates that the current attribute has a reference inheritance relationship with a second reference inheritance attribute of the second base class configuration file; and A replacement subunit is configured to replace the current attribute with the second reference inheritance tag in response to determining that the value of the current attribute is consistent with the value of the second reference inheritance attribute, wherein the value of the second reference inheritance tag indicates the second reference inheritance attribute in the second base class configuration file.

12. The apparatus according to claim 10, further comprising: a recording unit configured to, in response to receiving a base class generation instruction for a plurality of second configuration files, record leaf paths of a plurality of candidate values ​​in the plurality of second configuration files, the leaf paths describing attributes that the corresponding candidate values ​​experience from a root path of the second configuration files to a leaf node; A clustering unit is configured to traverse the recorded leaf paths in reverse order and cluster the values ​​of different second configuration files under the same leaf path; as well as The first determining unit is configured to determine a second reference inheritance attribute for the plurality of second configuration files based on the clustering result.

13. The apparatus according to claim 12, further comprising: The second adding unit is configured to add the second reference inheritance attribute to a third base class configuration file that is commonly referenced and inherited by the multiple second configuration files.

14. The apparatus according to claim 12, further comprising: A new creation unit is configured to create a fourth base class configuration file, wherein the fourth base class configuration file includes the second reference inheritance attribute; as well as The third adding unit is configured to add the reference inheritance relationship between the plurality of second configuration files and the second reference inheritance attribute to the reference inheritance relationship tree.

15. The apparatus according to claim 10, further comprising: A second determining unit is configured to determine a plurality of objective fact attribute values ​​in a plurality of third configuration files; A third determining unit is configured to determine, based on the reference inheritance relationship tree, a plurality of base class configuration files having a reference inheritance relationship with the plurality of objective fact attribute values; A construction unit is configured to construct a derivation relationship graph of the multiple objective fact attribute values ​​and the multiple base class configuration files, wherein the derivation relationship graph includes multiple nodes and at least one directed edge, wherein the node indicates a reference inheritance relationship between an objective fact attribute value and a base class configuration file, and the directed edge describes a derivation order between reference inheritance relationships of two nodes; as well as An updating unit is configured to update the reference inheritance attributes in the multiple base class configuration files by using the derivation relationship diagram and the multiple objective fact attribute values.

16. The device according to claim 15, wherein: The updating unit comprises: A second determining subunit is configured to determine a current node indicating a same base class configuration file from among nodes with an out-degree of zero in the derivation relationship graph; a clustering subunit, configured to cluster the objective fact attribute value indicated by the current node to update the reference inheritance attribute of the base class configuration file indicated by the current node; and A removal subunit is configured to remove the multiple current nodes from the derivation relationship graph.

17. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.

19. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method and device for updating configuration files of application programs

    CN106843842A

  • Inheritable bureau data dynamic page configuration method and inheritable bureau data dynamic page configuration device

    CN111309319A

  • Micro-service configuration file management method and device

    CN112181528A

  • Configuration file acquisition method and device, electronic equipment and storage medium

    CN116775163A

  • Tagged property files for system configurations

    US20070156715A1

Cited By

  • Service card generation method and apparatus, and electronic device

    CN121462332A

  • Multi-version control and management method based on monorepo

    CN121478337A