Configuration file processing method and device, equipment, medium and program product

By monitoring configuration file updates in the first electronic device and performing parameter conversion, and sending target parameters to the second electronic device, the problem of inconsistency in configuration files is solved, and synchronous updates and consistency of configuration files are achieved.

CN119829088APending Publication Date: 2025-04-15DAWNING INT INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411885907.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, the configuration files in the first electronic device and the configuration files stored by the second electronic device are likely to be inconsistent with the user's direct modification.

Method used

When the first electronic device monitors the configuration file update, it determines the change parameters, and converts the change parameters according to the parameter conversion relationship in the configuration file template, obtains the target parameters, and sends the target parameters to the second electronic device so as to update the configuration file of the second electronic device through the configuration center.

Benefits of technology

Synchronous update of the configuration files of the first electronic device and the second electronic device is realized, and the consistency of the configuration files is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829088A_ABST
    Figure CN119829088A_ABST
Patent Text Reader

Abstract

The invention provides a configuration file processing method and device, equipment, a medium and a program product. In the method, a first electronic device determines a change parameter in a configuration file when monitoring that the configuration file stored in the first electronic device is updated. The first electronic equipment determines a configuration file template corresponding to the configuration file, and obtains a first parameter conversion relation in the configuration file template; and the first electronic equipment performs parameter conversion processing on the change parameter according to the first parameter conversion relationship to obtain a target parameter, and sends the target parameter to the second electronic equipment, so that the second electronic equipment performs updating processing on a configuration file stored in the second electronic equipment through the configuration center according to the target parameter. The consistency of the configuration file stored in the first electronic equipment and the configuration file stored in the second electronic equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic devices, and in particular to a configuration file processing method, apparatus, device, medium and program product. Background Art

[0002] The electronic device cluster includes a plurality of first electronic devices. The second electronic device can manage configuration files stored in the plurality of first electronic devices in a unified manner through a configuration center.

[0003] In the related art, the second electronic device, through the configuration center, can uniformly utilize the unidirectional parameter conversion relationship in the configuration file template to update the configuration files stored in each first electronic device when the configuration file stored in the second electronic device is updated, so that the configuration file stored in the first electronic device is consistent with the configuration file stored in the second electronic device.

[0004] However, in the method in the related art, when the user directly modifies the configuration file in the first electronic device, there is a problem that the configuration file in the first electronic device is inconsistent with the configuration file stored in the second electronic device. Summary of the invention

[0005] The present application provides a configuration file processing method, apparatus, device, medium and program product, which are used to solve the problem in the related art that the configuration file in the first electronic device is inconsistent with the configuration file stored in the second electronic device.

[0006] In a first aspect, the present application provides a configuration file processing method, which is applied to a first electronic device, and the method includes:

[0007] In the case where it is monitored that the configuration file stored in the first electronic device is updated, determining a changed parameter in the configuration file;

[0008] Determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template;

[0009] According to the first parameter conversion relationship, the changed parameter is subjected to parameter conversion processing to obtain the target parameter;

[0010] The target parameter is sent to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0011] In this scheme, the first electronic device can determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated. The first electronic device can determine the configuration file template corresponding to the configuration file, and obtain the first parameter conversion relationship in the configuration file template. The first electronic device can perform parameter conversion processing on the changed parameters according to the first parameter conversion relationship to obtain the target parameters, and send the target parameters to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameters through the configuration center. In the above manner, when the configuration file stored in the first electronic device (running the proxy service) is updated, the configuration file stored in the second electronic device (running the configuration center) can be synchronously updated, thereby improving the consistency of the configuration file stored in the first electronic device and the configuration file stored in the second electronic device.

[0012] In one implementation, the method further includes:

[0013] Receiving configuration file update information sent by the second electronic device through the configuration center;

[0014] Determining, according to the configuration file update information, whether the first electronic device meets the configuration file update condition;

[0015] When the first electronic device meets the configuration file update condition, the configuration file stored in the first electronic device is updated according to the configuration file update information to obtain an updated configuration file.

[0016] In this solution, when the first electronic device receives configuration file update information sent by the second electronic device through the configuration center and the first electronic device meets the configuration file update conditions, the configuration file stored in the first electronic device can be updated according to the configuration file update information to obtain an updated configuration file. In the above manner, when the configuration file stored in the second electronic device (running the configuration center) is updated, the configuration file stored in the first electronic device (running the proxy service) can be synchronously updated, thereby improving the consistency of the configuration file stored in the second electronic device with the configuration files stored in all the first electronic devices in the electronic device cluster.

[0017] In one implementation, determining whether the first electronic device meets the configuration file update condition according to the configuration file update information includes:

[0018] Determine update parameters in the configuration file update information;

[0019] Performing parameter conversion processing on the update parameter to obtain a first conversion parameter;

[0020] Determining whether the first conversion parameter is consistent with the historical parameter; wherein the copy of the historical configuration file stored in the first electronic device includes the historical parameter;

[0021] When the first conversion parameter is consistent with the historical parameter, determining that the first electronic device does not meet the configuration file update condition;

[0022] When the first conversion parameter is inconsistent with the historical parameter, it is determined that the first electronic device meets the configuration file update condition.

[0023] In this solution, the first electronic device can determine the update parameters in the configuration file update information, and perform parameter conversion processing on the update parameters to obtain the first conversion parameters. The first electronic device can determine whether the first electronic device meets the configuration file update condition by comparing whether the first conversion parameters are consistent with the historical parameters in the historical configuration file copy, that is, determine whether the first electronic device is not an electronic device that triggers the configuration file of the second electronic device to be updated. The accuracy of determining whether the first electronic device meets the configuration file update condition is improved, thereby improving the accuracy of configuration file processing.

[0024] In one implementation, performing parameter conversion processing on the update parameter to obtain the first conversion parameter includes:

[0025] Determine a configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template;

[0026] According to the second parameter conversion relationship, parameter conversion processing is performed on the update parameter to obtain the first conversion parameter.

[0027] In this solution, the first electronic device can use the second parameter conversion relationship in the configuration file template to perform parameter conversion processing on the update parameter to obtain the first conversion parameter. In this way, the update parameter updated in the second electronic device can be converted into the first conversion parameter matching the storage requirement of the first electronic device, thereby realizing the rapid update of the configuration file stored in the first electronic device.

[0028] In one implementation, updating the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file includes:

[0029] Acquire a second configuration parameter stored in the second electronic device;

[0030] According to the second parameter conversion relationship, the second configuration parameter is subjected to parameter conversion processing to obtain a second conversion parameter;

[0031] An updated configuration file is obtained according to the first conversion parameter and the second conversion parameter.

[0032] In this solution, the first electronic device can perform parameter conversion processing on the second configuration parameters (configuration file, parameters other than update parameters) stored in the second electronic device based on the second parameter conversion relationship to obtain second conversion parameters, and then obtain an updated configuration file based on the first conversion parameters and the second conversion parameters. In this way, a rapid update of the configuration file stored in the first electronic device is achieved.

[0033] In one implementation, the method further includes:

[0034] Get the template description file in the configuration file template;

[0035] According to the template description file, the validation operation is performed to validate the updated configuration file; the validation operation includes loading the updated configuration file, or restarting the service corresponding to the updated configuration file.

[0036] In this solution, the first electronic device can perform a validation operation according to the template description file in the configuration file template to validate the updated configuration file. In this way, after the configuration file stored in the first electronic device is synchronously updated, the updated configuration file can be effective in time, so that the service corresponding to the updated configuration file can run normally.

[0037] In a second aspect, the present application provides a configuration file processing device, which is applied to a first electronic device, and the device includes:

[0038] A processing module, configured to determine a changed parameter in the configuration file when it is detected that the configuration file stored in the first electronic device is updated;

[0039] The processing module is further used to determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template;

[0040] The processing module is further used to perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter;

[0041] The transceiver module is used to send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0042] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0043] In one implementation, the method further includes:

[0044] The transceiver module is further used to receive configuration file update information sent by the second electronic device through the configuration center;

[0045] The processing module is further used to determine whether the first electronic device meets the configuration file update condition according to the configuration file update information;

[0046] The processing module is further used to update the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file when the first electronic device meets the configuration file update condition.

[0047] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0048] In one implementation, the processing module is specifically configured to:

[0049] Determine update parameters in the configuration file update information;

[0050] Performing parameter conversion processing on the update parameter to obtain a first conversion parameter;

[0051] Determining whether the first conversion parameter is consistent with the historical parameter; wherein the copy of the historical configuration file stored in the first electronic device includes the historical parameter;

[0052] When the first conversion parameter is consistent with the historical parameter, determining that the first electronic device does not meet the configuration file update condition;

[0053] When the first conversion parameter is inconsistent with the historical parameter, it is determined that the first electronic device meets the configuration file update condition.

[0054] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0055] In one implementation, the processing module is specifically configured to:

[0056] Determine a configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template;

[0057] According to the second parameter conversion relationship, parameter conversion processing is performed on the update parameter to obtain the first conversion parameter.

[0058] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0059] In one implementation, the processing module is specifically configured to:

[0060] Acquire a second configuration parameter stored in the second electronic device;

[0061] According to the second parameter conversion relationship, the second configuration parameter is subjected to parameter conversion processing to obtain a second conversion parameter;

[0062] An updated configuration file is obtained according to the first conversion parameter and the second conversion parameter.

[0063] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0064] In one implementation, the processing module is further configured to:

[0065] Get the template description file in the configuration file template;

[0066] According to the template description file, the validation operation is performed to validate the updated configuration file; the validation operation includes loading the updated configuration file, or restarting the service corresponding to the updated configuration file.

[0067] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

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

[0069] Memory stores computer-executable instructions;

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

[0071] The electronic device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0072] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method of the first aspect.

[0073] When the computer-executable instructions in the computer-readable storage medium provided in the embodiment of the present application are executed by the processor, the technical solution shown in the above method embodiment can be implemented. The implementation principle and beneficial effects are similar and will not be repeated here.

[0074] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which implements the method of the first aspect when executed by a processor.

[0075] When the computer program in the computer program product provided in the embodiment of the present application is executed by a processor, the technical solution shown in the above method embodiment can be implemented. The implementation principle and beneficial effects are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0077] Figure 1 A schematic diagram of an application scenario of a configuration file processing method provided in an embodiment of the present application;

[0078] Figure 2 A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 1 ;

[0079] Figure 3 A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 2 ;

[0080] Figure 4a A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 3 ;

[0081] Figure 4b An interactive diagram of a configuration file processing process provided in an embodiment of the present application Figure 1 ;

[0082] Figure 4c An interactive diagram of a configuration file processing process provided in an embodiment of the present application Figure 2 ;

[0083] Figure 5 A schematic diagram of the structure of a configuration file processing device provided in an embodiment of the present application;

[0084] Figure 6 A structural diagram of an electronic device provided in this application.

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

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

[0087] It should be noted that the configuration file processing method, apparatus, equipment, medium and program product of the present application can be used in the field of electronic device technology, and can also be used in any field other than electronic devices. The present application does not limit the application field of the configuration file processing method, apparatus, equipment, medium and program product.

[0088] Glossary:

[0089] ETCD: is a distributed key-value storage system, mainly used for configuration management and service discovery.

[0090] Inotify: inotify is a kernel-level file system event monitoring mechanism. In Linux systems, you can use the Inotify tool to monitor configuration file updates.

[0091] FileSystemWatcher: A component used to monitor updates to configuration files.

[0092] Bidirectional synchronization: is a data synchronization mechanism that allows bidirectional data updates and synchronization between two or more data sources.

[0093] Figure 1 A schematic diagram of an application scenario of a configuration file processing method provided in an embodiment of the present application.

[0094] The scenario includes: a terminal device 10, a second electronic device 20, and an electronic device cluster.

[0095] The electronic device cluster includes a plurality of first electronic devices. Figure 1 Two first electronic devices are shown, namely a first electronic device 30 and a first electronic device 40 .

[0096] The second electronic device 20 may run a configuration center 201 , the terminal device 10 may run a management client 101 , the first electronic device 30 may run an agent service 301 , and the first electronic device 40 may run an agent service 401 .

[0097] The second electronic device 20 can centrally manage the configuration files stored in the plurality of first electronic devices through the configuration center 201 .

[0098] In the related art, the second electronic device 20, through the configuration center 201, can uniformly utilize the unidirectional parameter conversion relationship in the configuration file template to update the configuration files stored in each first electronic device when the configuration file stored in the second electronic device 20 is updated, so that the configuration file stored in the first electronic device is consistent with the configuration file stored in the second electronic device 20.

[0099] However, in the method of the related art, when the user directly modifies the configuration file in the first electronic device (such as the first electronic device 30), there is a problem that the configuration file in the first electronic device (such as the first electronic device 30) is inconsistent with the configuration file stored in the second electronic device 20.

[0100] Based on the above technical problems, the technical concept of the embodiment of the present application is as follows: the first electronic device can determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated. The first electronic device can determine the configuration file template corresponding to the configuration file, and obtain the first parameter conversion relationship in the configuration file template. The first electronic device can perform parameter conversion processing on the changed parameters according to the first parameter conversion relationship to obtain the target parameters, and send the target parameters to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameters through the configuration center.

[0101] By means of the above method, the consistency between the configuration file stored in the first electronic device and the configuration file stored in the second electronic device can be improved.

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

[0103] Figure 2 A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 1 ,like Figure 2 As shown, the method comprises the following steps:

[0104] S201: When it is detected that a configuration file stored in a first electronic device is updated, a changed parameter in the configuration file is determined.

[0105] In this embodiment, the first electronic device may store a configuration file. It is understandable that for each service, the first electronic device may store a configuration file corresponding to the service. For example, for service A (such as an image processing service), the first electronic device may store a configuration file corresponding to service A.

[0106] The first electronic device may monitor whether the configuration file stored in the first electronic device is updated.

[0107] The first electronic device may determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated. In one implementation, the first electronic device stores a copy of the historical configuration file. The first electronic device may compare the configuration file stored in the first electronic device with the copy of the historical configuration file. The first electronic device may determine the parameters that are inconsistent with the copy of the historical configuration file as the changed parameters in the configuration file.

[0108] S202: Determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template.

[0109] In this embodiment, the first electronic device may store a configuration file template corresponding to the configuration file.

[0110] The configuration file template includes a first parameter conversion relationship (also referred to as a reverse expression), a second parameter conversion relationship (also referred to as a forward expression), and a template description file.

[0111] It should be noted that the first parameter conversion relationship is used to indicate a method for converting parameters in a configuration file stored in the first electronic device so as to make it meet the requirements for storing the configuration file in the second electronic device (configuration center running on the second electronic device).

[0112] The second parameter conversion relationship is used to indicate a method of converting parameters in the configuration file stored in the second electronic device so as to make it conform to the requirement of storing the configuration file in the first electronic device (the proxy service running on the second electronic device).

[0113] The template description file is used to indicate the method of executing the validation operation so as to validate the updated configuration file.

[0114] After obtaining the changed parameter in the configuration file, the first electronic device may determine the configuration file template corresponding to the configuration file, and obtain the first parameter conversion relationship in the configuration file template.

[0115] S203: Perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0116] In this embodiment, the first electronic device can perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0117] For example, with respect to the changed parameter, parameter A, the first electronic device may convert parameter A according to a first parameter conversion relationship (such as A+B=C) to obtain a target parameter, parameter C.

[0118] S204: Sending the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device through the configuration center according to the target parameter.

[0119] In this embodiment, the electronic device may send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0120] Beneficial effects of this embodiment: In this embodiment, the first electronic device can determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated. The first electronic device can determine the configuration file template corresponding to the configuration file, and obtain the first parameter conversion relationship in the configuration file template. The first electronic device can perform parameter conversion processing on the changed parameters according to the first parameter conversion relationship to obtain the target parameters, and send the target parameters to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameters through the configuration center. In the above manner, when the configuration file stored in the first electronic device (running the proxy service) is updated, the configuration file stored in the second electronic device (running the configuration center) can be synchronously updated, thereby improving the consistency of the configuration file stored in the first electronic device and the configuration file stored in the second electronic device.

[0121] Figure 3 A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 2 ,like Figure 3 As shown, the method comprises the following steps:

[0122] S301: When it is detected that a configuration file stored in a first electronic device is updated, a changed parameter in the configuration file is determined.

[0123] In this embodiment, the first electronic device may determine the changed parameters in the configuration file when monitoring that the configuration file stored in the first electronic device is updated.

[0124] The specific implementation process is the same as S201 and will not be repeated here.

[0125] S302: Determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template.

[0126] In this embodiment, the first electronic device may determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship from the configuration file template.

[0127] The specific implementation process is the same as S202 and will not be repeated here.

[0128] S303: Perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0129] In this embodiment, the first electronic device can perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0130] The specific implementation process is the same as S203 and will not be repeated here.

[0131] S304: Sending the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device through the configuration center according to the target parameter.

[0132] In this embodiment, the first electronic device may send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0133] The specific implementation process is the same as S204 and will not be repeated here.

[0134] S305: Receive configuration file update information sent by the second electronic device through the configuration center.

[0135] In this embodiment, the second electronic device may update the configuration file stored in the second electronic device.

[0136] In one implementation, the second electronic device may update the configuration file stored in the second electronic device in response to the target parameter sent by the first electronic device.

[0137] In one implementation, the second electronic device can update the configuration file stored in the second electronic device in response to the parameter change request sent by the terminal device. It should be noted that in one implementation, the terminal device can call the interface of the configuration center through the management client to send a parameter change request to the second electronic device. It should be noted that the management client provides an application programming interface (Application Programming Interface, referred to as API) for modifying and obtaining parameters in the configuration file, and supports dependency packages of common programming languages ​​​​(such as Python, Java). In addition, the management client also provides an independently deployed Restful interface for convenient and flexible use.

[0138] When the second electronic device detects that the configuration file stored in the second electronic device is updated, the second electronic device may send configuration file update information to each first electronic device in the electronic device cluster through the configuration center.

[0139] It is understandable that in one implementation, the configuration center can send an event response to all subscribed proxy services (proxy services running on the first electronic device) when the configuration file changes. The event response may include configuration file update information. It should also be noted that in one implementation, the configuration center may be ETCD, Zookeeper, Nacos and other similar functional software, and the embodiments of the present application are not limited to this.

[0140] Correspondingly, for any first electronic device, the first electronic device can obtain the configuration file update information sent by the second electronic device through the configuration center.

[0141] S306: Determine whether the first electronic device meets a configuration file update condition according to the configuration file update information.

[0142] In this embodiment, the first electronic device may determine whether the first electronic device meets the configuration file update condition according to the configuration file update information.

[0143] If yes, the first electronic device may execute S307;

[0144] If not, then end.

[0145] Next, a process in which the first electronic device determines whether the first electronic device meets the configuration file update condition according to the configuration file update information is described.

[0146] In one implementation,

[0147] The first electronic device may determine an update parameter in the configuration file update information.

[0148] The first electronic device may perform parameter conversion processing on the update parameter to obtain a first conversion parameter. In one implementation, the first electronic device may determine a configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template. The first electronic device may perform conversion processing on the update parameter according to the second parameter conversion relationship to obtain the first conversion parameter.

[0149] The first electronic device may determine whether the first conversion parameter is consistent with the historical parameter, wherein the copy of the historical configuration file stored by the first electronic device includes the historical parameter.

[0150] The first electronic device may determine that the first electronic device does not meet the configuration file update condition when the first conversion parameter is consistent with the historical parameter. It should be noted that the first electronic device may determine that the first electronic device is an electronic device that has updated the configuration file and triggered the configuration file stored in the second electronic device to be updated when determining that the first electronic device does not meet the configuration file update condition.

[0151] The first electronic device may determine that the first electronic device meets the configuration file update condition when the first conversion parameter is inconsistent with the historical parameter.

[0152] S307: updating the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file.

[0153] In this embodiment, when the first electronic device meets the configuration file update condition, the first electronic device may update the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file.

[0154] Next, a process in which the first electronic device updates the configuration file stored in the first electronic device according to the configuration file update information to obtain the updated configuration file is described.

[0155] In one implementation,

[0156] The first electronic device obtains a second configuration parameter stored in the second electronic device. It should be noted that the second configuration parameter belongs to a configuration file stored in the second electronic device.

[0157] Next, a process of the first electronic device acquiring the second configuration parameter stored in the second electronic device is described.

[0158] In one implementation, the configuration file update information includes all parameters in the configuration file stored in the second electronic device. The all parameters include update parameters and second configuration parameters, and the second configuration parameters are parameters that have not been updated.

[0159] In one implementation, the first electronic device may send an acquisition request to the second electronic device. In response to the acquisition request, the second electronic device may send a configuration file stored in the second electronic device to the first electronic device through the configuration center. The first electronic device may acquire the second configuration parameter from the configuration file stored in the second electronic device.

[0160] After obtaining the second configuration parameter stored in the second electronic device, the first electronic device may perform parameter conversion processing on the second configuration parameter according to the second parameter conversion relationship to obtain a second conversion parameter.

[0161] The first electronic device can obtain an updated configuration file according to the first conversion parameter and the second conversion parameter.

[0162] It should be noted that, in one implementation, after obtaining the updated configuration file, the first electronic device may obtain a new copy of the historical configuration file according to the updated configuration file, and store the new copy of the historical configuration file.

[0163] In one implementation, after obtaining the updated configuration file, the first electronic device can obtain the template description file in the configuration file template. The first electronic device can perform an effective operation according to the template description file to perform effective processing on the updated configuration file. It should be noted that the effective operation includes loading the updated configuration file, or restarting the service corresponding to the updated configuration file. It should also be noted that the effective operation can also be not performing any action.

[0164] Beneficial effects of this embodiment: In this embodiment, the first electronic device can determine the change parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated, and use the first parameter conversion relationship to convert the change parameters to obtain the target parameters, and send the target parameters to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameters through the configuration center. In the above manner, the configuration file stored in the second electronic device (running the configuration center) can be updated when the configuration file stored in the first electronic device (running the proxy service) is updated. The consistency of the configuration file stored in the second electronic device and the configuration file stored in the first electronic device is improved. In addition, the first electronic device can also update the configuration file stored in the first electronic device according to the configuration file update information when receiving the configuration file update information sent by the second electronic device through the configuration center, and the first electronic device meets the configuration file update condition, and obtain the updated configuration file. In the above manner, the configuration file stored in the first electronic device (running the proxy service) can be updated when the configuration file stored in the second electronic device (running the configuration center) is updated. That is to say, based on the method of the embodiment of the present application, bidirectional updating (bidirectional synchronization) can be achieved, thereby improving the consistency of the configuration file stored in the second electronic device with the configuration files stored in all the first electronic devices in the electronic device cluster.

[0165] Figure 4a A flowchart of a method for processing a configuration file provided in an embodiment of the present application Figure 3 ,like Figure 4a As shown, the method comprises the following steps:

[0166] S401: When it is detected that a configuration file stored in a first electronic device is updated, a changed parameter in the configuration file is determined.

[0167] In this embodiment, the first electronic device may determine a changed parameter in the configuration file when it is detected that the configuration file stored in the first electronic device is updated.

[0168] It should be noted that, in an implementation, when the configuration file stored in the first electronic device is updated, the first electronic device may obtain a copy of the historical configuration file according to the updated configuration file, and store the copy of the historical configuration file.

[0169] S402: Determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template.

[0170] In this embodiment, the first electronic device may determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship from the configuration file template.

[0171] The specific implementation process is the same as S202 and will not be repeated here.

[0172] S403: Perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0173] In this embodiment, the first electronic device can perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter.

[0174] The specific implementation process is the same as S203 and will not be repeated here.

[0175] S404: Sending the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device through the configuration center according to the target parameter.

[0176] In this embodiment, the first electronic device may send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0177] The specific implementation process is the same as S204 and will not be repeated here.

[0178] S405: Receive configuration file update information sent by the second electronic device through the configuration center.

[0179] In this embodiment, the second electronic device may update the configuration file stored in the second electronic device.

[0180] In one implementation, the second electronic device may update the configuration file stored in the second electronic device in response to the target parameter sent by the first electronic device.

[0181] In one implementation, the second electronic device can update the configuration file stored in the second electronic device in response to the parameter change request sent by the terminal device. It should be noted that in one implementation, the parameter change request is sent by the terminal device through the management client calling the interface of the configuration center.

[0182] When the second electronic device detects that the configuration file stored in the second electronic device is updated, the second electronic device may send configuration file update information to each first electronic device in the electronic device cluster through the configuration center.

[0183] Correspondingly, for any first electronic device, the first electronic device can receive configuration file update information sent by the second electronic device through the configuration center.

[0184] S406: Determine update parameters in the configuration file update information.

[0185] In this embodiment, the configuration file update information includes update parameters.

[0186] The first electronic device may determine an update parameter in the configuration file update information.

[0187] S407: Determine a configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template.

[0188] In this embodiment, the first electronic device may store a configuration file template corresponding to the configuration file, wherein the configuration file template includes a first parameter conversion relationship, a second parameter conversion relationship, and a template description file.

[0189] After determining the update parameter in the configuration file update information, the first electronic device may determine the configuration file template corresponding to the configuration file, and obtain the second parameter conversion relationship from the configuration file template.

[0190] S408: Perform parameter conversion processing on the update parameter according to the second parameter conversion relationship to obtain a first conversion parameter.

[0191] In this embodiment, the first electronic device can perform parameter conversion processing on the update parameter according to the second parameter conversion relationship to obtain the first conversion parameter. For example, for the update parameter, parameter C, the first electronic device can perform parameter conversion processing on parameter C according to the second parameter conversion relationship (such as C=A+B) to obtain the first conversion parameter, parameter A.

[0192] S409: Determine whether the first conversion parameter is consistent with the historical parameter.

[0193] In this embodiment, the first electronic device may determine whether the first conversion parameter is consistent with the historical parameter.

[0194] It should be noted that the copy of the historical configuration file stored in the first electronic device includes historical parameters.

[0195] If yes, execute S410;

[0196] If not, execute S411.

[0197] S410: Determine that the first electronic device does not meet a configuration file update condition.

[0198] In this embodiment, the first electronic device may determine that the first electronic device does not meet the configuration file update condition when the first conversion parameter is consistent with the historical parameter.

[0199] The first electronic device may end the process if the configuration file update condition is not met. It should be noted that the first electronic device may determine that the first electronic device is an electronic device that has updated the configuration file and triggered the configuration file stored in the second electronic device to be updated if the first electronic device determines that the configuration file update condition is not met. The first electronic device does not need to update the configuration file again.

[0200] S411: Determine whether the first electronic device meets a configuration file update condition.

[0201] In this embodiment, the first electronic device may determine that the first electronic device meets the configuration file update condition when the first conversion parameter is inconsistent with the historical parameter.

[0202] It should be noted that the first electronic device may execute S412 after executing S411.

[0203] S412: Acquire a second configuration parameter stored in the second electronic device.

[0204] In this embodiment, the first electronic device can obtain the second configuration parameter stored in the second electronic device. It should be noted that the second configuration parameter belongs to the configuration file stored in the second electronic device.

[0205] Next, a process of the first electronic device acquiring the second configuration parameter stored in the second electronic device is described.

[0206] In one implementation, the configuration file update information includes all parameters in the configuration file stored in the second electronic device. The all parameters include update parameters and second configuration parameters, and the second configuration parameters are parameters that have not been updated.

[0207] In one implementation, the first electronic device may send an acquisition request to the second electronic device. In response to the acquisition request, the second electronic device may send a configuration file stored in the second electronic device to the first electronic device through the configuration center. The first electronic device may acquire the second configuration parameter from the configuration file stored in the second electronic device.

[0208] S413: Perform parameter conversion processing on the second configuration parameter according to the second parameter conversion relationship to obtain a second conversion parameter.

[0209] In this embodiment, the configuration file template includes a second parameter conversion relationship.

[0210] The first electronic device may perform parameter conversion processing on the second configuration parameter according to the second parameter conversion relationship to obtain a second conversion parameter.

[0211] S414: Obtain an updated configuration file according to the first conversion parameter and the second conversion parameter.

[0212] In this embodiment, the first electronic device can obtain an updated configuration file according to the first conversion parameter and the second conversion parameter.

[0213] It should be noted that, in one implementation, after obtaining the updated configuration file, the first electronic device may obtain a new copy of the historical configuration file according to the updated configuration file, and store the new copy of the historical configuration file.

[0214] S415: Obtain a template description file from the configuration file template.

[0215] In this embodiment, the configuration file template includes a template description file.

[0216] After obtaining the updated configuration file, the first electronic device may obtain the template description file from the configuration file template.

[0217] S416: Execute a validation operation according to the template description file to validate the updated configuration file.

[0218] In this embodiment, the first electronic device may perform a validation operation after obtaining the template description file, so as to perform a validation operation on the updated configuration file.

[0219] In one implementation, the validation operation may include loading an updated configuration file.

[0220] In one implementation, the validation operation may include restarting the service corresponding to the updated configuration file. For service A, after updating the configuration file corresponding to service A, the first electronic device may restart service A according to the template description file in the configuration file template corresponding to service A, so that the updated configuration file corresponding to service A takes effect.

[0221] In one implementation, the validation operation may be to not perform any action.

[0222] Next, the configuration file processing process is explained from the software perspective.

[0223] Figure 4b An interactive diagram of a configuration file processing process provided in an embodiment of the present application Figure 1 .

[0224] First, combine Figure 4b , from a software perspective, the processes of S401, S402, S403, and S404 are explained.

[0225] In one implementation,

[0226] The first electronic device 30 runs an agent service 301 (also referred to as an agent service of a configuration management system). The agent service 301 includes a file monitor 3011 (such as an inotify tool or FileSystemWatcher), a configuration file parser 3012 , and a configuration management module 3013 .

[0227] The file monitor 3011 can monitor whether the configuration file stored in the first electronic device 30 is updated.

[0228] The file monitor 3011 may notify the configuration file parser 3012 when detecting that the configuration file stored in the first electronic device 30 is updated.

[0229] The configuration file parser 3012 may compare the configuration file stored by the first electronic device 30 with the historical configuration file copy.

[0230] The configuration file parser 3012 may determine the changed parameters in the configuration file when it is determined that the configuration file stored in the first electronic device 30 is inconsistent with the historical configuration file copy.

[0231] The configuration file parser 3012 may determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template.

[0232] The configuration file parser 3012 may perform parameter conversion processing on the changed parameters according to the first parameter conversion relationship to obtain target parameters.

[0233] The configuration file parser 3012 may send target parameters to the configuration management module 3013 .

[0234] The configuration management module 3013 can call the interface of the configuration center to send the target parameters to the second electronic device. It should be noted that the configuration center 201 runs on the second electronic device 20. The second electronic device 20 can update the configuration file stored in the second electronic device 20 according to the target parameters through the configuration center 201.

[0235] Then, combine Figure 4c ,From the software perspective, the process from S405 to S416 is explained.

[0236] In one implementation,

[0237] Figure 4c An interactive diagram of a configuration file processing process provided in an embodiment of the present application Figure 2 .

[0238] The configuration center 201 runs on the second electronic device 20 .

[0239] The management client 101 runs on the terminal device 10 .

[0240] The proxy service 301 is run on the first electronic device 30. The proxy service 301 may include a listener 3014 (such as ETCD listener), a version controller 3015, a template engine 3016, and an event manager 3017.

[0241] The configuration center 201 may update the configuration file stored in the second electronic device 20 .

[0242] In one implementation, the management client 101 calls an interface of the configuration center 201 and sends a parameter change request to the configuration center 201. The configuration center may update the configuration file stored in the second electronic device 20 in response to the parameter change request.

[0243] In one implementation, the configuration center may update the configuration file stored in the second electronic device 20 in response to the target parameter sent by the proxy service 301 .

[0244] When the configuration file stored in the second electronic device 20 is updated, the configuration center 201 may send configuration file update information to each subscribed proxy service (such as the proxy service 301 and the proxy service 401 ).

[0245] The following description will be given by taking the proxy service 301 as an example.

[0246] For proxy service 301:

[0247] After receiving the configuration file update information, the listener 3014 may send the configuration file update information to the version controller 3015. It should be noted that, in one implementation, the proxy service 301 may close the file monitor 3011 upon receiving the configuration file update information.

[0248] The version controller 3015 can determine the update parameters in the configuration file update information. The version controller 3015 can determine the configuration file template corresponding to the configuration file, and obtain the second parameter conversion relationship in the configuration file template. The version controller 3015 can perform parameter conversion processing on the update parameter according to the second parameter conversion relationship to obtain the first conversion parameter. The version controller 3015 can determine whether the first conversion parameter is consistent with the historical parameter (the historical configuration file copy stored in the first electronic device 30 includes the historical parameter).

[0249] The version controller 3015 may determine that the first electronic device 30 does not meet the configuration file update condition when it is determined that the first conversion parameter is consistent with the historical parameter. At this time, the version controller 3015 may discard the first conversion parameter. It should be noted that Figure 4c This process is not shown.

[0250] The version controller 3015 may determine that the first electronic device 30 meets the configuration file update condition when it is determined that the first conversion parameter is inconsistent with the historical parameter.

[0251] The version controller 3015 may send the first conversion parameter to the template engine 3016 .

[0252] The template engine 3016 can obtain the second configuration parameter stored in the second electronic device 20, and perform parameter conversion processing on the second configuration parameter according to the second parameter conversion relationship to obtain a second conversion parameter. The template engine 3016 can obtain an updated configuration file according to the first conversion parameter and the second conversion parameter.

[0253] After obtaining the updated configuration file, the template engine 3016 may send an update completion message to the event manager 3017 .

[0254] The event manager 3017 can obtain the template description file in the configuration file template, and perform the validation operation according to the template description file to validate the updated configuration file. In one implementation, the validation operation includes loading the updated configuration file. In one implementation, the validation operation includes restarting the service corresponding to the updated configuration file. In one implementation, the validation operation includes not performing any action.

[0255] Beneficial effects of this embodiment: In this embodiment, the first electronic device can determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated, and use the first parameter conversion relationship to convert the changed parameters to obtain the target parameters, and send the target parameters to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameters through the configuration center. In the above manner, the configuration file stored in the second electronic device (running the configuration center) can be updated synchronously when the configuration file stored in the first electronic device (running the proxy service) is updated. The consistency of the configuration file stored in the second electronic device and the configuration file stored in the first electronic device is improved. In addition, the first electronic device can also update the configuration file stored in the first electronic device according to the configuration file update information when receiving the configuration file update information sent by the second electronic device through the configuration center, and the first electronic device meets the configuration file update condition, and obtain the updated configuration file, and perform the validation operation according to the template description file in the configuration file template, so as to validate the updated configuration file. In the above manner, the configuration file stored in the first electronic device (running the configuration center) can be updated synchronously when the configuration file stored in the second electronic device (running the configuration center) is updated, and the updated configuration file is validated.

[0256] Figure 5 Schematic diagram of a configuration file processing device provided in an embodiment of the present application. The configuration file processing device 50 is applied to a first electronic device. Figure 5 As shown, the configuration file processing device 50 may include: a processing module 51 and a transceiver module 52, wherein:

[0257] The processing module 51 is used to determine the changed parameters in the configuration file when it is detected that the configuration file stored in the first electronic device is updated;

[0258] The processing module 51 is further used to determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template;

[0259] The processing module 51 is further used to perform parameter conversion processing on the changed parameter according to the first parameter conversion relationship to obtain the target parameter;

[0260] The transceiver module 52 is used to send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

[0261] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0262] In one implementation, the method further includes:

[0263] The transceiver module 52 is further used to receive configuration file update information sent by the second electronic device through the configuration center;

[0264] The processing module 51 is further used to determine whether the first electronic device meets the configuration file update condition according to the configuration file update information;

[0265] The processing module 51 is further configured to update the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file when the first electronic device meets the configuration file update condition.

[0266] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be described in detail here.

[0267] In one implementation, the processing module 51 is specifically configured to:

[0268] Determine update parameters in the configuration file update information;

[0269] Performing parameter conversion processing on the update parameter to obtain a first conversion parameter;

[0270] Determining whether the first conversion parameter is consistent with the historical parameter; wherein the copy of the historical configuration file stored in the first electronic device includes the historical parameter;

[0271] When the first conversion parameter is consistent with the historical parameter, determining that the first electronic device does not meet the configuration file update condition;

[0272] When the first conversion parameter is inconsistent with the historical parameter, it is determined that the first electronic device meets the configuration file update condition.

[0273] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0274] In one implementation, the processing module 51 is specifically configured to:

[0275] Determine a configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template;

[0276] According to the second parameter conversion relationship, parameter conversion processing is performed on the update parameter to obtain the first conversion parameter.

[0277] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0278] In one implementation, the processing module 51 is specifically configured to:

[0279] Acquire a second configuration parameter stored in the second electronic device;

[0280] According to the second parameter conversion relationship, the second configuration parameter is subjected to parameter conversion processing to obtain a second conversion parameter;

[0281] An updated configuration file is obtained according to the first conversion parameter and the second conversion parameter.

[0282] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0283] In one implementation, the processing module 51 is further configured to:

[0284] Get the template description file in the configuration file template;

[0285] According to the template description file, the validation operation is performed to validate the updated configuration file; the validation operation includes loading the updated configuration file, or restarting the service corresponding to the updated configuration file.

[0286] The configuration file processing device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0287] Figure 6 This is a structural diagram of an electronic device provided in this application. Figure 6As shown, the electronic device 60 includes a processor 61 and a memory 62. The processor 61 is in communication connection with the memory 62, and the memory 62 is used to store computer-executable instructions; the processor 61 is configured to execute the technical solution in any of the above method embodiments by executing the computer-executable instructions stored in the memory 62.

[0288] Optionally, the memory 62 may be independent or integrated with the processor 61. Optionally, when the memory 62 is a device independent of the processor 61, the electronic device 60 may further include: a bus 63 for connecting the above devices.

[0289] The electronic device is used to execute the technical solution in any of the aforementioned method embodiments, and its implementation principle and technical effect are similar and will not be repeated here.

[0290] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by any of the aforementioned method embodiments.

[0291] An embodiment of the present application also provides a computer program product, including a computer program, which is used to implement the technical solution provided by the aforementioned method embodiment when executed by a processor.

[0292] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

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

[0294] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-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 portion of the sub-steps or stages of other steps.

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

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

[0297] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.

[0298] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

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

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

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

Claims

1. A method for processing a configuration file, characterized in that: Applied to a first electronic device, the method includes: In the case where it is monitored that the configuration file stored in the first electronic device is updated, determining a changed parameter in the configuration file; Determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template; According to the first parameter conversion relationship, performing parameter conversion processing on the change parameter to obtain a target parameter; The target parameter is sent to the second electronic device, so that the second electronic device updates the configuration file stored in the second electronic device according to the target parameter through the configuration center.

2. The method according to claim 1, characterized in that The method further comprises: Receiving configuration file update information sent by the second electronic device through the configuration center; determining, according to the configuration file update information, whether the first electronic device meets a configuration file update condition; When the first electronic device meets the configuration file update condition, the configuration file stored in the first electronic device is updated according to the configuration file update information to obtain an updated configuration file.

3. The method according to claim 2, characterized in that The determining, according to the configuration file update information, whether the first electronic device meets the configuration file update condition includes: Determining update parameters in the configuration file update information; Performing parameter conversion processing on the update parameter to obtain a first conversion parameter; Determining whether the first conversion parameter is consistent with a historical parameter; wherein the copy of the historical configuration file stored in the first electronic device includes the historical parameter; When the first conversion parameter is consistent with the historical parameter, determining that the first electronic device does not meet the configuration file update condition; When the first conversion parameter is inconsistent with the historical parameter, it is determined that the first electronic device meets the configuration file update condition.

4. The method according to claim 3, characterized in that The performing parameter conversion processing on the update parameter to obtain a first conversion parameter includes: Determine the configuration file template corresponding to the configuration file, and obtain a second parameter conversion relationship in the configuration file template; According to the second parameter conversion relationship, parameter conversion processing is performed on the update parameter to obtain the first conversion parameter.

5. The method according to claim 4, characterized in that The updating process of the configuration file stored in the first electronic device according to the configuration file update information to obtain an updated configuration file includes: Acquire a second configuration parameter stored in the second electronic device; According to the second parameter conversion relationship, performing parameter conversion processing on the second configuration parameter to obtain a second conversion parameter; The updated configuration file is obtained according to the first conversion parameter and the second conversion parameter.

6. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: Obtaining a template description file in the configuration file template; According to the template description file, a validation operation is performed to validate the updated configuration file; the validation operation includes loading the updated configuration file, or restarting a service corresponding to the updated configuration file.

7. A configuration file processing device, characterized in that: Applied to a first electronic device, the device comprises: a processing module, configured to determine a changed parameter in the configuration file when it is detected that the configuration file stored in the first electronic device is updated; The processing module is further used to determine a configuration file template corresponding to the configuration file, and obtain a first parameter conversion relationship in the configuration file template; The processing module is further used to perform parameter conversion processing on the change parameter according to the first parameter conversion relationship to obtain a target parameter; The transceiver module is used to send the target parameter to the second electronic device, so that the second electronic device can update the configuration file stored in the second electronic device according to the target parameter through the configuration center.

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

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

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