CN114090602A - Configuration file updating method and device, server and storage medium - Google Patents

Configuration file updating method and device, server and storage medium Download PDF

Info

Publication number
CN114090602A
CN114090602A CN202111400306.2A CN202111400306A CN114090602A CN 114090602 A CN114090602 A CN 114090602A CN 202111400306 A CN202111400306 A CN 202111400306A CN 114090602 A CN114090602 A CN 114090602A
Authority
CN
China
Prior art keywords
target
configuration information
configuration
processed
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111400306.2A
Other languages
Chinese (zh)
Inventor
李志刚
刘劲
郭浩
王连庆
陈剑桥
杨凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China National Offshore Oil Corp CNOOC
Original Assignee
China National Offshore Oil Corp CNOOC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China National Offshore Oil Corp CNOOC filed Critical China National Offshore Oil Corp CNOOC
Priority to CN202111400306.2A priority Critical patent/CN114090602A/en
Publication of CN114090602A publication Critical patent/CN114090602A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for updating a configuration file, a server and a storage medium. The method comprises the following steps: when the trigger target configurable item control is detected, acquiring target configuration information corresponding to the target configurable item control; determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs; and updating the target to-be-processed configuration information based on the target configuration information, and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information. The embodiment of the invention solves the problem that an operator spends a large amount of time and labor when updating configuration manually or writing scripts, realizes that the configuration file to which the configurable item belongs is automatically updated after the configuration file is modified based on the configurable item in the configuration template, and improves the automation and convenience of updating the configuration file, thereby improving the technical effect of updating the efficiency of the configuration file.

Description

Configuration file updating method and device, server and storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a method and an apparatus for updating a configuration file, a server, and a storage medium.
Background
With the rise of cloud native applications, the deployment of the applications in the cloud becomes an important mark for the transition from traditional applications to the cloud native applications, and is also an important factor for accelerating the digital transformation of enterprises.
Different types of software can complete cloud migration through different technologies and platforms, but due to the fact that the technologies and the technologies, the platforms and the platforms lack correlation, and obstacles exist in updating of configuration files after application is online. At present, two methods of updating configuration files mainly include manual configuration updating and scripted configuration updating.
The manual configuration updating method is that technicians replace configuration information corresponding to configuration items one by one through manual operation to update the configuration, and the method needs manual operation to update the configuration, so that the problem of high misoperation rate exists. The scripted configuration method requires a technician to write a script file, and upload, store, and replace configuration information by a control engine to obtain an updated configuration file. If the configuration files needing to be modified are more, technicians are required to compile a large number of script files corresponding to the configuration files, and the problem of time and labor consumption is caused by compiling, storing and managing the script files.
Disclosure of Invention
The invention provides a method and a device for updating a configuration file, a server and a storage medium, which are used for solving the problem that the manual updating of the configuration or the writing of a script by an operator to update the configuration file consumes manpower and time and realizing the automatic updating of the configuration file with high efficiency and high accuracy.
In a first aspect, an embodiment of the present invention provides a method for updating a configuration file, including:
when a trigger target configurable item control is detected, acquiring target configuration information corresponding to the target configurable item control;
determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs;
and updating the target to-be-processed configuration information based on the target configuration information, and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
In a second aspect, an embodiment of the present invention further provides an apparatus for updating a configuration file, including:
the target configuration information acquisition module is used for acquiring target configuration information corresponding to a target configurable item control when the trigger of the target configurable item control is detected;
a to-be-processed configuration information determining module, configured to determine, according to the target configurable item, the target configuration information, and at least one pre-stored group of to-be-processed configuration information pairs, target to-be-processed configuration information corresponding to the target configurable item;
and the configuration file updating module is used for updating the target to-be-processed configuration information based on the target configuration information and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
In a third aspect, an embodiment of the present invention further provides a server, where the server includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for updating a configuration file provided in any of the embodiments.
In a fourth aspect, the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the method for updating a configuration file provided in any of the embodiments.
The invention determines the target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored pair of to-be-processed configuration information when detecting that the target configurable item control is triggered, updates the target to-be-processed configuration information based on the target configuration information, and updates the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information, solves the problem that an operator manually changes the configuration or writes a large number of script files to update the configuration file and consumes a large amount of time and labor, realizes that the configuration file to which the configurable item belongs is automatically updated after the configuration file is modified based on the configurable item in the configuration template, and improves the automation and convenience for updating the configuration file, thereby improving the technical effect of updating the configuration file.
Drawings
Fig. 1 is a flowchart of a method for updating a configuration file according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for updating a configuration file according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for updating a configuration file according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a method for updating a configuration file according to a first embodiment of the present invention, where the method is applicable to a situation that the configuration file is updated by using the technical solution in the present embodiment, the method may be executed by an apparatus for updating the configuration file, and the apparatus may be implemented by hardware and/or software.
As shown in fig. 1, the method of this embodiment specifically includes the following steps:
s110, when the trigger target configurable item control is detected, target configuration information corresponding to the target configurable item control is obtained.
The configurable items are configuration items which can be changed in the configuration file, the configurable item control is a control for selecting the configurable items, and the configurable items triggered by a user can be used as target configurable items. Correspondingly, the control corresponding to the target configurable item is the target configurable item control. When triggering of the target configurable item control is detected, a content editing control corresponding to the target configurable item can be popped up, and the content editing control can have original configuration information or not. If the original configuration information corresponding to the target configurable item is displayed on the content editing control, the user can modify the original configuration information, and the modified configuration information is the target configuration information; and if the original configuration information is not displayed in the content editing control, the configuration information input by the user in the content editing control is target configuration information.
Specifically, the user may select the target configurable item on the visualization interface, and may input or select the target configuration information corresponding to the target configurable item. The user may input target configuration information corresponding to the target configurable item; the target configuration information may also be determined in a manner of selecting in a pull-down menu, where the pull-down menu may include at least one configuration information editing control, a user may input corresponding content in the corresponding control, and after all content is input, a confirmation key may be triggered, so that the system acquires the edited configuration information.
Further, when it is detected that the modification is completed, optionally, clicking "determination" is detected, and the target configuration information is obtained according to the modified configuration information.
S120, determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs.
Each configuration file comprises configurable items and configuration information corresponding to the configurable items, and the configurable items and the corresponding configuration information can be correspondingly stored in the storage component. Each pair of configurable items and corresponding configuration information stored in the storage component may be treated as a set of pending configuration information pairs.
The target to-be-processed configuration information is acquired according to the identification corresponding to the target configurable item. Optionally, the identifier may be an identifier formed by the target configurable item and a file name to which the target configurable item belongs, the configurable item that is found from at least one group of pre-stored to-be-processed configuration information and is consistent with the identifier of the target configurable item is the to-be-processed configurable item, and the configuration information corresponding to the to-be-processed configurable item is obtained and used as the target to-be-processed configuration information, and the target to-be-processed configuration information may be specific content corresponding to the to-be-processed configuration item.
And S130, updating the target to-be-processed configuration information based on the target configuration information, and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
And updating the target to-be-processed configuration information into target configuration information so as to finish updating the configuration information, and facilitating the use of the configuration information when the configuration file is continuously updated subsequently. Optionally, when the number of the configuration files to be modified is large, the configurable item and the storage path and the name of the corresponding configuration file may be stored correspondingly, so as to quickly determine the location of the configuration file to be processed and update the configuration file. And according to the corresponding relation, acquiring the file name and the storage path of the target configurable item corresponding to the target configuration information, and updating the target configuration information into a corresponding configuration file according to the storage path to obtain the configuration file corresponding to the target configuration information, thereby completing the updating of the configuration file. Or determining a storage path and a name of a configuration file corresponding to the target configuration information, determining a specific position of the target configuration information in the configuration file template according to a pre-stored corresponding configuration file template, and updating the target to-be-processed configuration information into the target configuration information to generate an updated configuration file. The configuration file template is a file template for labeling the configurable items in the configuration file and the configuration information corresponding to the configurable items, for example: the configurable items and the configuration information corresponding to the configurable items are labeled with quotation marks or brackets and the like. And replacing the original corresponding configuration file with the updated configuration file to finish the updating of the configuration file.
According to the technical scheme of the embodiment, the target configuration information is obtained through the target configurable item control, the target to-be-processed configuration information is determined according to the target configurable item and the target configurable item information, the target to-be-processed information is updated, an updated configuration file is generated to replace an original configuration file, the problem that a large amount of time and labor are consumed due to the fact that an operator needs to manually update the configuration file or write a script file to update the configuration file when the configuration file is updated is solved, the configuration file to which the configurable item belongs is automatically updated after the configuration file is modified based on the configurable item in the configuration template, the automation and the convenience of updating the configuration file are improved, and therefore the technical effect of the updating efficiency of the configuration file is improved.
Example two
Fig. 2 is a flowchart of a method for updating a configuration file according to a second embodiment of the present invention, which is further optimized based on the first embodiment.
As shown in fig. 2, the method specifically includes:
s201, acquiring configurable items in each configuration file and at least one piece of configuration information corresponding to the configurable items.
It should be noted that a platform, system, software, or the like contains more than one configuration file, and the contents of these configuration files contain configuration information that is not modifiable and configuration information that is modifiable. The changeable configuration information is the configurable item and the corresponding configuration content. Corresponding configuration information may be found in one or more configuration files for configurable items in the configuration file.
Different configuration files can carry out different configurations on the same configurable item under different conditions, and the configuration information corresponding to the configurable item at the moment is different. Illustratively, the configuration file a contains a configurable item C, and the configuration information corresponding to the configurable item C is D; the configuration file B also contains a configurable item C, the configuration information corresponding to the configurable item C is E, and the configuration information corresponding to the configurable item C is D and E.
S202, generating a configuration template displayed on the target page according to the configurable item and the configuration file identifier to which the configurable item belongs.
Wherein the configuration file identification is a unique identifier of the configuration file. And determining the configuration file to which the configurable item belongs according to the configuration file identifier corresponding to the configurable item.
Illustratively, the configuration file a contains a configurable item C, and the configuration information corresponding to the configurable item C is D; the configuration file B also contains a configurable item C and configuration information E corresponding to the configurable item C. Optionally, the generated and displayed content may be configurable items a-C and corresponding configuration information D, and configurable items B-C and corresponding configuration information E. Optionally, the display is performed in a file directory manner, where the configurable item C under the directory of the configuration file a and the corresponding configuration information D are configured, and the configurable item C under the directory of the configuration file B and the corresponding configuration information E are configured. The specific position of the corresponding configuration item to be updated can be determined through the identification content.
The configuration template is a template including configurable items and corresponding configuration information to be input, where the configuration information to be input may be supplemented by descriptive statements, for example: please enter an integer of 1-999, etc., and the supported data types include array type (array), string type (string), number type (number), etc. commonly used data types. Configuration information corresponding to the at least one configurable item may be adjusted based on the configuration template. To enable visual display of the configuration template, the configuration template may be displayed on a target page.
It may be stated that the user may trigger at least one configurable item on the display interface and change the configuration information corresponding to the at least one configurable item.
S203, storing the configurable items corresponding to the configuration files, the configuration information corresponding to the configurable items and the configuration file identifications of the configurable items in a storage component according to the corresponding relation.
The configurable item and the configuration file identifier to which the configurable item belongs can be combined to serve as a uniform identifier, wherein the combination mode can be direct splicing or splicing by using a connector. The uniform identifier is used for determining a configuration file to which the target configuration information belongs and a specific position of the target configuration information in the configuration file according to the content stored in the storage component, so that the corresponding configuration information is convenient to update. After the uniform identifier is determined, the uniform identifier and corresponding configuration information may be stored in the form of a Key Value pair < Key Value >. And determining the uniform identifier as a Key Value and determining the corresponding configuration information as a Value.
The storage component may be a < Key Value > cloud native storage component of an open source in the industry, such as an etcd (distributed consistent k-v storage system), and is mainly used to store configuration information input by a client as a storage component of static configuration information.
And S204, when the target configurable item is detected to be triggered, displaying a content editing control corresponding to the target configurable item so as to edit target configuration information in the content editing control.
The target configurable item is a configuration item to be changed currently, the content editing control is a control for inputting corresponding configuration information for a user, and the configuration information input in the content editing control is the configuration information corresponding to the target configurable item.
When the target configurable item control is triggered, a content editing control can be popped up, and a user can edit target configuration information corresponding to the target configurable item through the content editing control. Before the user selects the target configurable item, the configuration file and the file identifier to which the target configurable item belongs are determined, so that the target configurable item can be selected according to the file identifier, optionally, the selection can be performed according to the uniform identifier, optionally, the corresponding configurable item can be triggered and selected according to the content presented in the directory, optionally, any one item in the directory is triggered to be used as the target configurable item, and the modes such as clicking or checking can be performed. The contents presented in the directory mainly correspond to each configurable item in the configuration file.
And S205, when the trigger target control is detected, acquiring target configuration information in the content editing control.
The target control is a control for indicating that the target configuration information is input, and may be a "confirm" button or a "save" button.
Specifically, after the user input is completed, the target control is triggered. When the system detects that the target control is triggered, the content edited in the content editing control can be acquired, and the acquired content is used as target configuration information.
The user may update the configuration information in one or more configuration files at once. If the user updates the configuration information in a plurality of configuration files at one time, the uniform identifier of the configuration files can be obtained to determine each target configurable item, and corresponding target configuration information is edited in the content editing control corresponding to each target configurable item. And when the input is finished, triggering the target control to send the target configuration information to the system, so that the system processes the target configuration information and generates a corresponding configuration file. Optionally, when the system detects that the target control is triggered, all the target configuration information may be acquired, and the configuration file to which the target configuration information belongs may be updated according to all the target configuration information, so that a plurality of configuration files may be updated at one time, and the technical effect of improving the update efficiency of the configuration files is achieved.
S206, determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs.
The at least one group of pre-stored to-be-processed configuration information pairs may be Key Value pairs correspondingly stored in a < Key Value > manner according to the uniform identifier and the corresponding configuration information of the configurable item in the configuration file, so as to quickly determine the path of the configuration file and the specific position of the target configuration information in the corresponding configuration file according to the uniform identifier, and further facilitate updating the configuration file.
Optionally, the configuration item to be processed, which is the same as the target configurable item, is obtained from at least one group of configuration information pairs to be processed, which are stored in advance, and the target configuration information to be processed corresponding to the configuration item to be processed is called.
According to the Key value, namely the uniform identifier, it can be determined that the configurable item in the storage component, which has the same uniform identifier as the target configurable item, is a to-be-processed configuration item, and the configuration information corresponding to the to-be-processed configuration item is target to-be-processed configuration information.
Optionally, the target configurable item and the target configuration information are correspondingly stored in the storage component, and when it is detected that at least one group of to-be-processed configuration information pairs pre-stored in the storage component includes the target configurable item, the to-be-processed configuration item corresponding to the target configurable item is acquired, and the target to-be-processed configuration information of the to-be-processed configuration item is called.
The target configurable item and the target configuration information are stored in a storage component, specifically, a uniform identifier of the target configurable item and a corresponding Key Value pair of the target configuration information are correspondingly stored in a mode of < Key Value >, according to the characteristic that a Key Value, namely the uniform identifier, has uniqueness, a pair of Key Value pairs with the same Key Value which are stored in advance can be found in the storage component, and the Value in the Key Value pair is target to-be-processed configuration information.
And S207, updating the target to-be-processed configuration information into target configuration information.
And correspondingly updating the target to-be-processed configuration information corresponding to the acquired to-be-processed configuration item into the acquired target configuration information, and storing the target to-be-processed configuration information into a storage component in a mode of < Key Value >.
Updating the target configuration information, wherein if a configuration item to be processed which is the same as the target configurable item is obtained from at least one group of prestored configuration information to be processed, the target configuration information to be processed corresponding to the configuration item to be processed is called, and the target configuration information to be processed corresponding to the configuration item to be processed is directly replaced by the target configuration information; if the target configurable item and the target configuration information are correspondingly stored in the storage component, when it is detected that at least one group of to-be-processed configuration information pairs pre-stored in the storage component includes the target configurable item, the to-be-processed configuration item corresponding to the target configurable item is acquired, the target to-be-processed configuration information of the to-be-processed configuration item is called, the key value pair correspondingly stored in the target configurable item and the target configuration information is reserved, and the original to-be-processed configuration item in the storage component and the target to-be-processed configuration information corresponding to the to-be-processed configuration item are deleted.
S208, acquiring a configuration file identifier corresponding to the target configuration information, and determining an updating path of the configuration file to which the target configuration information belongs based on the configuration file identifier.
According to a Key value, namely a uniform identifier, corresponding to the target configuration information, a configuration file identifier can be determined, and further, a path of the configuration file and a specific position of the target configuration information in the corresponding configuration file can be determined.
It should be noted that the configuration file corresponding to the configuration file identifier is unique, and a corresponding relationship between the configuration file identifier and the configuration file storage path may be established, so as to determine the update path of the configuration file, that is, the update path of the configuration file to which the configuration file identifier belongs may be determined by the configuration file identifier.
In order to meet the actual demand, a listener, optionally a listener, may be provided in the storage component to update the configuration file at a preset point in time. For example, a configuration listener is set in the storage component, and when the configuration listener monitors that there is a change in the configuration information in the storage component, the configuration listener notifies the corresponding Handler module (asynchronous message processing module) to perform processing.
Illustratively, the listener-based real-time monitoring of information changes in the storage component, or the listener-based timed monitoring of information in the storage component, such as: listen once an hour or 8:00 a day.
Optionally, each configuration file may generate a configuration file template corresponding to each configuration file according to the configurable item and the configuration information corresponding to the configurable item. The configurable items and the corresponding configuration information in the configuration file template can be represented according to a preset format, so that the position of the configurable items can be conveniently and rapidly determined, for example: $ Key, $ { Value }. And the generation of a new configuration file can be quickly completed through the configuration file template, the target configurable item and the corresponding configuration information. Before updating the configuration file, the configuration file is generated, and for example, after the Handler module receives the processing signal, the Handler module updates the corresponding to-be-processed configuration information one by one to the target configuration information according to the target configuration information and the configuration file to which the target configuration information belongs, so as to generate a new configuration file.
S209, updating the configuration file to which the target to-be-processed configuration information belongs based on the update path and the configuration file to which the target configuration information belongs.
Optionally, the specific position of the configuration file to which the target configuration information belongs is determined according to the update path, and then the target to-be-processed information in the configuration file to which the target configuration information belongs is updated to the target configuration information, so as to complete updating of the configuration file to which the target to-be-processed configuration information belongs.
Optionally, the new configuration file generated according to the configuration file template is sent to the update path of the configuration file to which the target configuration information belongs, and the configuration file to which the target configuration information belongs is updated to be the new configuration file, that is, the configuration file in the update path is replaced by the new configuration file, so as to complete the update of the configuration file.
S210, determining a loading mode corresponding to the updated configuration file, and loading the configuration file based on the loading mode.
The updated configuration file needs to be loaded to realize the corresponding function, and the loading mode of the configuration file mainly depends on the type of the configuration file, the writing language, the operating environment and other factors.
The loading mode can be loading when detecting the update of the configuration file, namely directly loading after the update of the configuration file; the dynamic loading of the configuration file can be completed by using a configuration loading engine; the corresponding configuration file can be loaded by using a command line; or restarting the device to which the configuration file belongs to achieve the purpose of loading the configuration file.
The dynamic loading of the configuration file by using the configuration loading engine refers to executing a configuration loading command under the path of the configuration file of the application program, so that the configuration dynamic loading process is completed. The configuration loading engine supports commands of various different environments and languages, such as shell, python, java and the like, and supports configuration dynamic loading of various cloud computing platforms such as a physical server, a virtualization environment, a container environment and the like.
According to the technical scheme of the embodiment, the configuration template displayed on the target page is generated through the configurable items in the configuration files, the configuration information corresponding to the configurable items and the configuration file identifiers to which the configurable items belong, and the configuration template is stored in the storage component; editing and acquiring target configuration information through a configuration template; based on the update path and the configuration file to which the target configuration information belongs, the configuration file to which the target configuration information belongs is updated, and the configuration file is loaded, so that the problem that an operator manually modifies the configuration information in the configuration file one by one or writes a large number of script files to update the configuration file, a large amount of time and energy are consumed is solved, the configuration file to which the configurable item belongs is automatically updated after the configuration file is modified based on the configurable item in the configuration template, the automation and the convenience for updating the configuration file are improved, and the technical effect of improving the update efficiency of the configuration file is further achieved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an apparatus for updating a configuration file according to a third embodiment of the present invention, where the apparatus includes: a target configuration information obtaining module 310, a pending configuration information determining module 320, and a configuration file updating module 330.
A target configuration information obtaining module 310, configured to obtain target configuration information corresponding to a target configurable item control when the trigger target configurable item control is detected; a pending configuration information determining module 320, configured to determine, according to the target configurable item, the target configuration information, and at least one group of pairs of pending configuration information stored in advance, target pending configuration information corresponding to the target configurable item; the configuration file updating module 330 is configured to update the target to-be-processed configuration information based on the target configuration information, and update the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
Optionally, the target configuration information obtaining module 310 is further configured to, when it is detected that the target configurable item is triggered, display a content editing control corresponding to the target configurable item, so as to edit the target configuration information in the content editing control; and when the trigger target control is detected, acquiring target configuration information in the content editing control.
Optionally, the to-be-processed configuration information determining module 320 is further configured to obtain a to-be-processed configuration item that is the same as the target configurable item from at least one group of pre-stored to-be-processed configuration information pairs, and retrieve target to-be-processed configuration information corresponding to the to-be-processed configuration item; or, correspondingly storing the target configurable item and the target configuration information into the storage component, when detecting that at least one group of to-be-processed configuration information pairs pre-stored in the storage component include the target configurable item, acquiring the to-be-processed configuration item corresponding to the target configurable item, and calling the target to-be-processed configuration information of the to-be-processed configuration item.
Optionally, the configuration file updating module 330 is further configured to update the target to-be-processed configuration information to the target configuration information; acquiring a configuration file identifier corresponding to the target configuration information, and determining an updating path of a configuration file to which the updated target configuration information belongs based on the configuration file identifier; and updating the configuration file to which the target to-be-processed configuration information belongs based on the update path and the configuration file to which the target configuration information belongs.
Optionally, the apparatus further comprises:
the configuration template generation module is used for acquiring the configurable items in each configuration file and at least one piece of configuration information corresponding to the configurable items; generating a configuration template displayed on a target page according to the configurable item and the configuration file identifier to which the configurable item belongs; the configuration template is used for adjusting configuration information corresponding to at least one configurable item; the target configurable item is any one or more of the at least one configurable item.
Optionally, the configuration template generating module is further configured to store the configurable items corresponding to the configuration files, the configuration information corresponding to the configurable items, and the configuration file identifiers to which the configurable items belong in the storage component according to the corresponding relationship.
Optionally, the apparatus further comprises:
the configuration file loading module is used for determining a loading mode corresponding to the updated configuration file and loading the configuration file based on the loading mode; the loading mode comprises at least one of loading when the configuration file is detected to be updated, loading based on an engine, loading based on a command line and restarting of a device to which the configuration file belongs.
The configuration file updating apparatus provided in this embodiment generates a configuration template displayed on a target page through a configurable item in each configuration file, configuration information corresponding to the configurable item, and a configuration file identifier to which the configurable item belongs, and stores the configuration template in a storage component; editing and acquiring target configuration information through a configuration template; based on the update path and the configuration file to which the target configuration information belongs, the configuration file to which the target configuration information belongs is updated, and the configuration file is loaded, so that the problem that an operator manually modifies the configuration information in the configuration file one by one or writes a large number of script files to update the configuration file, a large amount of time and energy are consumed is solved, the configuration file to which the configurable item belongs is automatically updated after the configuration file is modified based on the configurable item in the configuration template, the automation and the convenience for updating the configuration file are improved, and the technical effect of improving the update efficiency of the configuration file is further achieved.
The configuration file updating device provided by the embodiment of the invention can execute the configuration file updating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the present invention.
Example four
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary server 40 suitable for use in implementing embodiments of the present invention. The server 40 shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in fig. 4, the server 40 is in the form of a general purpose computing device. The components of server 40 may include, but are not limited to: one or more processors or processing units 401, a system memory 402, and a bus 403 that couples the various system components (including the system memory 402 and the processing unit 401).
Bus 403 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
The server 40 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by server 40 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 402 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)404 and/or cache memory 405. The server 40 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 406 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 403 by one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402, such program modules 407 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 407 generally perform the functions and/or methods of the described embodiments of the invention.
The server 40 may also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), with one or more devices that enable a user to interact with the server 40, and/or with any devices (e.g., network card, modem, etc.) that enable the server 40 to communicate with one or more other computing devices. Such communication may be through input/output (I/O) interface 411. Also, server 40 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via network adapter 412. As shown, the network adapter 412 communicates with the other modules of the server 40 over the bus 403. It should be appreciated that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with the server 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 401 executes various functional applications and data processing by executing programs stored in the system memory 402, for example, to implement the method for updating a configuration file provided by the embodiment of the present invention.
EXAMPLE five
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform a method for updating a configuration file, and the method includes:
when the trigger target configurable item control is detected, acquiring target configuration information corresponding to the target configurable item control;
determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs;
and updating the target to-be-processed configuration information based on the target configuration information, and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for updating a configuration file, comprising:
when a trigger target configurable item control is detected, acquiring target configuration information corresponding to the target configurable item control;
determining target to-be-processed configuration information corresponding to the target configurable item according to the target configurable item, the target configuration information and at least one group of pre-stored to-be-processed configuration information pairs;
and updating the target to-be-processed configuration information based on the target configuration information, and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
2. The method of claim 1, wherein before the obtaining target configuration information corresponding to a target configurable item control when the triggering of the target configurable item control is detected, further comprising:
acquiring configurable items in each configuration file and at least one piece of configuration information corresponding to the configurable items;
generating a configuration template displayed on a target page according to the configurable item and the configuration file identifier to which the configurable item belongs;
the configuration template is used for adjusting configuration information corresponding to at least one configurable item; the target configurable item is any one or more of the at least one configurable item.
3. The method of claim 2, further comprising:
and storing the configurable items corresponding to the configuration files, the configuration information corresponding to the configurable items and the configuration file identifications of the configurable items in a storage component according to the corresponding relation.
4. The method according to claim 1, wherein the obtaining target configuration information corresponding to a target configurable item control when detecting that a target configurable item control is triggered comprises:
when a target configurable item is detected to be triggered, displaying a content editing control corresponding to the target configurable item so as to edit the target configuration information in the content editing control;
and when the triggering target control is detected, acquiring the target configuration information in the content editing control.
5. The method according to claim 1, wherein the determining, according to the target configurable item, the target configuration information, and at least one pre-stored group of pairs of configuration information to be processed, target configuration information corresponding to the target configurable item includes:
acquiring a to-be-processed configuration item which is the same as the target configurable item from at least one group of pre-stored to-be-processed configuration information pairs, and calling target to-be-processed configuration information corresponding to the to-be-processed configuration item; or the like, or, alternatively,
and correspondingly storing the target configurable item and the target configuration information into the storage component, when detecting that at least one group of to-be-processed configuration information pairs pre-stored in the storage component comprise the target configurable item, acquiring the to-be-processed configuration item corresponding to the target configurable item, and calling the target to-be-processed configuration information of the to-be-processed configuration item.
6. The method according to claim 1, wherein the updating the target configuration information to be processed based on the target configuration information and the updating the configuration file to which the target configuration information belongs according to the target configuration information comprises:
updating the target to-be-processed configuration information into the target configuration information;
acquiring a configuration file identifier corresponding to the target configuration information, and determining an updating path for updating a configuration file to which the target configuration information belongs based on the configuration file identifier;
and updating the configuration file to which the target to-be-processed configuration information belongs based on the update path and the configuration file to which the target configuration information belongs.
7. The method of claim 1, further comprising:
determining a loading mode corresponding to the updated configuration file, and loading the configuration file based on the loading mode;
the loading mode comprises at least one of loading when the configuration file is detected to be updated, loading based on an engine, loading based on a command line and restarting of the equipment to which the configuration file belongs.
8. An apparatus for updating a configuration file, comprising:
the target configuration information acquisition module is used for acquiring target configuration information corresponding to a target configurable item control when the trigger of the target configurable item control is detected;
a to-be-processed configuration information determining module, configured to determine, according to the target configurable item, the target configuration information, and at least one group of pre-stored to-be-processed configuration information pairs, target to-be-processed configuration information corresponding to the target configurable item;
and the configuration file updating module is used for updating the target to-be-processed configuration information based on the target configuration information and updating the configuration file to which the target to-be-processed configuration information belongs according to the target configuration information.
9. A server, characterized in that the server comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for profile update of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for updating a configuration file according to any one of claims 1 to 7.
CN202111400306.2A 2021-11-24 2021-11-24 Configuration file updating method and device, server and storage medium Pending CN114090602A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111400306.2A CN114090602A (en) 2021-11-24 2021-11-24 Configuration file updating method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111400306.2A CN114090602A (en) 2021-11-24 2021-11-24 Configuration file updating method and device, server and storage medium

Publications (1)

Publication Number Publication Date
CN114090602A true CN114090602A (en) 2022-02-25

Family

ID=80303765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111400306.2A Pending CN114090602A (en) 2021-11-24 2021-11-24 Configuration file updating method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN114090602A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032680A (en) * 2023-03-29 2023-04-28 广东好太太智能家居有限公司 Configuration method and device of intelligent equipment, electronic equipment and storage medium
WO2024041358A1 (en) * 2022-08-24 2024-02-29 中兴通讯股份有限公司 Configuration file updating method and apparatus, electronic device and readable storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024041358A1 (en) * 2022-08-24 2024-02-29 中兴通讯股份有限公司 Configuration file updating method and apparatus, electronic device and readable storage medium
CN116032680A (en) * 2023-03-29 2023-04-28 广东好太太智能家居有限公司 Configuration method and device of intelligent equipment, electronic equipment and storage medium
CN116032680B (en) * 2023-03-29 2023-07-11 广东好太太智能家居有限公司 Configuration method and device of intelligent equipment, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108519967B (en) Chart visualization method and device, terminal and storage medium
CN114090602A (en) Configuration file updating method and device, server and storage medium
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN111124371A (en) Game-based data processing method, device, equipment and storage medium
CN112269799A (en) Data query method, device, equipment and medium
CN113971037A (en) Application processing method and device, electronic equipment and storage medium
CN109582317B (en) Method and apparatus for debugging hosted applications
CN113760306B (en) Method and device for installing software, electronic equipment and storage medium
CN113032083A (en) Data display method, device, electronic equipment and medium
CN109814957B (en) Label adding method and device for IOS (input/output system)
CN112039975A (en) Method, device, equipment and storage medium for processing message field
CN112258244B (en) Method, device, equipment and storage medium for determining task to which target object belongs
CN112069158A (en) Data restoration method, device, equipment and storage medium
CN110958243A (en) Network vulnerability submitting method and device, storage medium and electronic equipment
CN115860877A (en) Product marketing method, device, equipment and medium
CN116009847A (en) Code generation method, device, electronic equipment and storage medium
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN109948251B (en) CAD-based data processing method, device, equipment and storage medium
CN111176982B (en) Test interface generation method and device
CN111897557A (en) Method, device, equipment and storage medium for updating service system
CN113138760A (en) Page generation method and device, electronic equipment and medium
CN113626409B (en) Test data processing method, device, equipment and storage medium
CN116185412B (en) Data management method and device, electronic equipment and storage medium
CN113128187B (en) Form generation method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination