CN109634682B - Configuration file updating method and device for application program - Google Patents
Configuration file updating method and device for application program Download PDFInfo
- Publication number
- CN109634682B CN109634682B CN201811440786.3A CN201811440786A CN109634682B CN 109634682 B CN109634682 B CN 109634682B CN 201811440786 A CN201811440786 A CN 201811440786A CN 109634682 B CN109634682 B CN 109634682B
- Authority
- CN
- China
- Prior art keywords
- configuration
- updated
- node
- file
- configuration node
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
- G06F9/4451—User profiles; Roaming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a method and a device for updating a configuration file of an application program, wherein when the configuration file of the application program needs to be updated, values corresponding to all configuration items to be updated, which are indicated in a configuration parameter description file preset in a deployment package of the application program, are determined, and for each configuration node to be updated, the value of a target configuration item contained in an original configuration file and a target configuration node corresponding to the original configuration file is updated to the value of each configuration item in the configuration parameter description file; and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file. By the method and the device, when an application program is deployed, engineering personnel can automatically update the configuration file of the application program only by providing necessary parameter configuration information at an appointed position, so that the possibility of manual modification errors is reduced, and the normal operation of the application program is ensured.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for updating a configuration file of an application program.
Background
The application program issuing package comprises a configuration file, the configuration file stores configuration information for running the application program, and part of the configuration information is related to the actual deployment environment of the application program.
At present, when an application program is deployed, the configuration information is mostly manually adjusted by engineering personnel according to an actual deployment environment, and the condition of adjustment error or incomplete adjustment information is easily caused in a manual adjustment mode, so that the operation of the application program is abnormal.
Disclosure of Invention
In view of the above, the present invention is proposed to provide a method and apparatus for updating a configuration file of an application program that overcomes or at least partially solves the above problems. The specific scheme is as follows:
a method for profile update of an application, the method comprising:
acquiring a configuration parameter description file from a deployment directory of an application program, wherein the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
determining values corresponding to all configuration items to be updated;
for each configuration node to be updated, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file, and updating a value of a target configuration item contained in the target configuration node to a value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file.
Optionally, the method further comprises:
acquiring an original configuration file from a deployment catalog of an application program;
and backing up the original configuration file.
Optionally, the determining values corresponding to all configuration items to be updated includes:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
Optionally, after determining values corresponding to all configuration items to be updated, the method further includes:
and classifying and combining the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated contained in the configuration nodes to be updated to obtain a set of the values of the configuration items to be updated contained in each configuration node to be updated.
Optionally, the determining, from the original configuration file, a target configuration node corresponding to the configuration node to be updated includes:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
An apparatus for updating a configuration file of an application, the apparatus comprising:
the device comprises an acquisition unit, a configuration unit and a configuration unit, wherein the acquisition unit is used for acquiring a configuration parameter description file from a deployment directory of an application program, and the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
the determining unit is used for determining values corresponding to all the configuration items to be updated;
the updating unit is used for determining a target configuration node corresponding to the configuration node to be updated from an original configuration file for each configuration node to be updated, and updating the value of a target configuration item contained in the target configuration node to the value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and the generating unit is used for generating an updated configuration file after all values corresponding to the configuration items to be updated are updated into the original configuration file, so that the application program is started by adopting the updated configuration file.
Optionally, the apparatus further comprises:
the backup unit is used for acquiring an original configuration file from a deployment catalog of the application program; and backing up the original configuration file.
Optionally, the determining unit is specifically configured to:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
Optionally, the apparatus further comprises:
and a classification and combination unit, configured to, after determining the values corresponding to all the configuration items to be updated, perform classification and combination on the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated included in the configuration nodes to be updated, so as to obtain a set of values of the configuration items to be updated included in each configuration node to be updated.
Optionally, the updating unit is specifically configured to:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
A storage medium storing a program to implement the steps of the profile updating method of an application program as described above.
An electronic device, comprising: a memory and a processor; the memory stores a program adapted to be executed by the processor to implement the steps of the profile updating method for an application program as described above.
By means of the technical scheme, the configuration file updating method and device for the application program provided by the invention have the advantages that the configuration parameter description file is preset in the deployment package of the application program, when the configuration file of the application program needs to be updated, the values corresponding to all configuration items to be updated indicated in the configuration parameter description file are determined, the target configuration node corresponding to the configuration node to be updated is determined from the original configuration file for each configuration node to be updated, and the value of the target configuration item contained in the target configuration node is updated to the value corresponding to the configuration item to be updated contained in the configuration node to be updated; and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file. By the method and the device, when an application program is deployed, engineering personnel can automatically update the configuration file of the application program only by providing necessary parameter configuration information at an appointed position, so that the possibility of manual modification errors is reduced, and the normal operation of the application program is ensured.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments,
+ is not to be construed as a limitation of the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flowchart illustrating a method for updating a configuration file of an application according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an apparatus for updating a configuration file of an application according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for updating a configuration file of an application according to an embodiment of the present invention, where the configuration file of the application is an XML (extensible Markup Language) file, and the method includes:
step S100: acquiring a configuration parameter description file from a deployment directory of an application program, wherein the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
in one possible embodiment, the configuration parameter description file is in properties format.
In an implementation manner, the at least one configuration node to be updated includes two types, that is, a common configuration node and a group configuration node, where the common configuration node is a unique configuration node, and the group configuration node is a configuration node containing a plurality of configuration items.
In the configuration parameter description file, the name of a configuration node is composed of three parts, namely a prefix, a node type and a node logical name, and the three parts are distinguished by a decimal point (.), and specific examples are as follows:
common configuration node examples:
ares.node.bus_ar=//parent[@parentName][1]
group configuration node example:
ares.groups.bus_ar=//parent[@parentName][1]/members,0,1
wherein the prefix ("ares" in the above example) is used to identify the parameter processing module to which the configuration node belongs, the node type is a normal configuration node (denoted by node in the above example) or a group configuration node (denoted by group in the above example), and the node logical name is a character string defined as a practical name (denoted by "bus _ ar" in the above example) that is helpful for user identification. The value of the common configuration node is an XPath expression (such as "// parent [ @ parentName ] [1 ]" in the above example) for locating the configuration node in the original configuration file of the application program, the value of the grouped configuration node is composed of an XPath expression (such as "// parent [ @ parentName ] [1 ]" in the above example) and several logical names (such as "members, 0, 1" in the above example), the logical names are used for identifying a plurality of configuration items contained in the grouped configuration node, and the two logical names are separated by an english comma.
In the configuration parameter description file, the name of the configuration item is composed of a prefix and several sub-attribute names, and the specific example is as follows:
configuration item examples of common configuration nodes:
ares.node.bus_ar.poolSize=
ares.node.bus_ar.limit.licenseFile=
configuration item examples for group configuration nodes:
ares.groups.bus_ar.0.member.no=
ares.groups.bus_ar.0.member.address=
ares.groups.bus_ar.0.member.port=
ares.groups.bus_ar.1.member.no=
text attribute example:
ares.groups.eventchains.a.chain.text()=
ares.groups.eventchains.b.chain.text()=
where the prefix (such as "ares. Among several sub-attribute names (0. member.no.) of configuration items of the configuration nodes in the group (such as "areas. groups. bus _ ar.0. member.no" in the above example), the first sub-attribute name "0" is a logical name of the configuration nodes in the group, the following sub-attribute name "member" is used to identify the sub-configuration nodes, and the last sub-attribute name "no" is used to identify the name of one attribute of the sub-configuration nodes. If one attribute of the child configuration node is a text attribute, the child attribute name is represented by "text ()".
Step S110: determining values corresponding to all configuration items to be updated;
in one implementation, values corresponding to all configuration items to be updated may be obtained from any one or more of an environment variable, an application configuration file, and a configuration center. The multiple values of the same configuration item may be obtained from the preset position, and at this time, the value with the highest priority may be finally obtained according to the priorities of the obtained multiple values. The deployment scenes of the application programs are different, and the preset positions are also different, specifically, the preset positions can be determined by combining the deployment scenes of the application programs, and the values corresponding to all the configuration items to be updated are obtained from the preset positions.
The values corresponding to all the configuration items to be updated may not all be obtained from any one or more of the environment variable, the application configuration file, and the configuration center, and in an implementation manner, for the configuration items to be updated which cannot be obtained from any one or more of the environment variable, the application configuration file, and the configuration center, the default values of the configuration items to be updated may be determined from the configuration parameter description file. The default value is empty.
Step S120: for each configuration node to be updated, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file, and updating a value of a target configuration item contained in the target configuration node to a value corresponding to the configuration item to be updated contained in the configuration node to be updated;
in an implementation manner, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file may be implemented by:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
Step S130: and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file.
The configuration file updating method of the application program disclosed by the embodiment of the invention is characterized in that a configuration parameter description file is preset in a deployment package of the application program, when the configuration file of the application program needs to be updated, values corresponding to all configuration items to be updated indicated in the configuration parameter description file are determined, a target configuration node corresponding to the configuration node to be updated is determined for each configuration node to be updated from an original configuration file, and the value of the target configuration item contained in the target configuration node is updated to the value corresponding to the configuration item to be updated contained in the configuration node to be updated; and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file. By the method, when the application program is deployed, engineering personnel can automatically update the configuration file of the application program only by providing necessary parameter configuration information at the appointed position, so that the possibility of manual modification errors is reduced, and the normal operation of the application program is ensured.
In a preferred embodiment, before the configuration file updating method of the application disclosed in the above embodiment is used to update the original configuration file of the application, the original configuration file may also be obtained from the deployment directory of the application; and backing up the original configuration file to prevent the original configuration information of the application program from being lost.
In a preferred embodiment, after determining the values corresponding to all the configuration items to be updated, the method further includes: and classifying and combining the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated contained in the configuration nodes to be updated to obtain a set of the values of the configuration items to be updated contained in each configuration node to be updated. When the configuration items are classified and combined, the prefixes of the configuration items are removed, and the configuration items with null values are removed, so that the updating speed of the configuration files of the application program is improved.
Based on the above embodiment, the embodiment of the present invention further discloses a specific example of a method for updating a configuration file of an application program, which is specifically as follows:
the original XML configuration file fragment is as follows:
the configuration parameter description file fragments are as follows:
the configuration segment containing the value corresponding to the configuration item to be updated is as follows:
the resulting XML configuration file fragments are as follows:
referring to fig. 2, fig. 2 is a schematic structural diagram of an apparatus for updating configuration files of an application according to an embodiment of the present invention, where the apparatus includes:
an obtaining unit 20, configured to obtain a configuration parameter description file from a deployment directory of an application program, where the configuration parameter description file includes at least one configuration node to be updated and a configuration item to be updated included in each configuration node to be updated;
a determining unit 21, configured to determine values corresponding to all configuration items to be updated;
an updating unit 22, configured to determine, for each configuration node to be updated, a target configuration node corresponding to the configuration node to be updated from an original configuration file, and update a value of a target configuration item included in the target configuration node to a value corresponding to a configuration item to be updated included in the configuration node to be updated;
the generating unit 23 is configured to generate an updated configuration file after all values corresponding to the configuration items to be updated are updated in the original configuration file, so that the application program is started by using the updated configuration file.
Optionally, the apparatus further comprises:
the backup unit is used for acquiring an original configuration file from a deployment catalog of the application program; and backing up the original configuration file.
Optionally, the determining unit is specifically configured to:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
Optionally, the apparatus further comprises:
and a classification and combination unit, configured to, after determining the values corresponding to all the configuration items to be updated, perform classification and combination on the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated included in the configuration nodes to be updated, so as to obtain a set of values of the configuration items to be updated included in each configuration node to be updated.
Optionally, the updating unit is specifically configured to:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
It should be noted that specific function implementation of each unit is already described in detail in the method embodiment, and this embodiment is not described again.
The configuration file updating device of the application program comprises a processor and a memory, wherein the acquisition unit, the determination unit, the updating unit, the generation unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and automatic updating of the configuration file of the application program is realized by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing a configuration file update method of the application program when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes a configuration file updating method of an application program when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring a configuration parameter description file from a deployment directory of an application program, wherein the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
determining values corresponding to all configuration items to be updated;
for each configuration node to be updated, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file, and updating a value of a target configuration item contained in the target configuration node to a value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file.
Optionally, the method further comprises:
acquiring an original configuration file from a deployment catalog of an application program;
and backing up the original configuration file.
Optionally, the determining values corresponding to all configuration items to be updated includes:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
Optionally, after determining values corresponding to all configuration items to be updated, the method further includes:
and classifying and combining the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated contained in the configuration nodes to be updated to obtain a set of the values of the configuration items to be updated contained in each configuration node to be updated.
Optionally, the determining, from the original configuration file, a target configuration node corresponding to the configuration node to be updated includes:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring a configuration parameter description file from a deployment directory of an application program, wherein the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
determining values corresponding to all configuration items to be updated;
for each configuration node to be updated, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file, and updating a value of a target configuration item contained in the target configuration node to a value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file.
Optionally, the method further comprises:
acquiring an original configuration file from a deployment catalog of an application program;
and backing up the original configuration file.
Optionally, the determining values corresponding to all configuration items to be updated includes:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
Optionally, after determining values corresponding to all configuration items to be updated, the method further includes:
and classifying and combining the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated contained in the configuration nodes to be updated to obtain a set of the values of the configuration items to be updated contained in each configuration node to be updated.
Optionally, the determining, from the original configuration file, a target configuration node corresponding to the configuration node to be updated includes:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A method for updating a configuration file of an application program, the method comprising:
acquiring a configuration parameter description file from a deployment directory of an application program, wherein the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
the at least one configuration node to be updated comprises two types, namely a common configuration node and a group configuration node, wherein the common configuration node is a configuration node with uniqueness, the group configuration node is a configuration node containing a plurality of configuration items, and in a configuration parameter description file, the name of the configuration node consists of three parts, namely a prefix, a node type and a node logic name, and the three parts are distinguished by a decimal point (·);
determining values corresponding to all configuration items to be updated;
for each configuration node to be updated, determining a target configuration node corresponding to the configuration node to be updated from an original configuration file, and updating a value of a target configuration item contained in the target configuration node to a value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and after the values corresponding to all the configuration items to be updated are updated into the original configuration file, generating an updated configuration file so that the application program is started by adopting the updated configuration file.
2. The method of claim 1, further comprising:
acquiring an original configuration file from a deployment catalog of an application program;
and backing up the original configuration file.
3. The method according to claim 1, wherein the determining values corresponding to all configuration items to be updated includes:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
4. The method according to claim 1, wherein after determining the values corresponding to all the configuration items to be updated, the method further comprises:
and classifying and combining the values corresponding to all the configuration items to be updated according to the information of the configuration items to be updated contained in the configuration nodes to be updated to obtain a set of the values of the configuration items to be updated contained in each configuration node to be updated.
5. The method of claim 1, wherein determining the target configuration node corresponding to the configuration node to be updated from the original configuration file comprises:
traversing configuration nodes in the original configuration file;
if the configuration node in the original configuration file comprises the configuration node corresponding to the configuration node to be updated, determining that the configuration node is a target configuration node corresponding to the configuration node to be updated;
if the configuration node in the original configuration file does not include the configuration node corresponding to the configuration node to be updated, the configuration node corresponding to the configuration node to be updated is created in the original configuration file, and the created configuration node is determined to be the target configuration node corresponding to the configuration node to be updated.
6. An apparatus for updating a configuration file of an application, the apparatus comprising:
the device comprises an acquisition unit, a configuration unit and a configuration unit, wherein the acquisition unit is used for acquiring a configuration parameter description file from a deployment directory of an application program, and the configuration parameter description file comprises at least one configuration node to be updated and a configuration item to be updated contained in each configuration node to be updated;
the at least one configuration node to be updated comprises two types, namely a common configuration node and a group configuration node, wherein the common configuration node is a configuration node with uniqueness, the group configuration node is a configuration node containing a plurality of configuration items, and in a configuration parameter description file, the name of the configuration node consists of three parts, namely a prefix, a node type and a node logic name, and the three parts are distinguished by a decimal point (·);
the determining unit is used for determining values corresponding to all the configuration items to be updated;
the updating unit is used for determining a target configuration node corresponding to the configuration node to be updated from an original configuration file for each configuration node to be updated, and updating the value of a target configuration item contained in the target configuration node to the value corresponding to the configuration item to be updated contained in the configuration node to be updated;
and the generating unit is used for generating an updated configuration file after all values corresponding to the configuration items to be updated are updated into the original configuration file, so that the application program is started by adopting the updated configuration file.
7. The apparatus of claim 6, further comprising:
the backup unit is used for acquiring an original configuration file from a deployment catalog of the application program; and backing up the original configuration file.
8. The apparatus according to claim 6, wherein the determining unit is specifically configured to:
obtaining a value corresponding to a configuration item to be updated from any one or more positions in an environment variable, an application configuration file and a configuration center;
and/or determining a default value of the configuration item to be updated from the configuration parameter description file.
9. A storage medium storing a program to implement the steps of the profile updating method of an application program according to any one of claims 1 to 5.
10. An electronic device, comprising: a memory and a processor; the memory stores a program adapted to be executed by the processor to implement the steps of the profile updating method of the application program according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811440786.3A CN109634682B (en) | 2018-11-29 | 2018-11-29 | Configuration file updating method and device for application program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811440786.3A CN109634682B (en) | 2018-11-29 | 2018-11-29 | Configuration file updating method and device for application program |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109634682A CN109634682A (en) | 2019-04-16 |
CN109634682B true CN109634682B (en) | 2022-02-15 |
Family
ID=66069743
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811440786.3A Active CN109634682B (en) | 2018-11-29 | 2018-11-29 | Configuration file updating method and device for application program |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109634682B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110727477B (en) * | 2019-10-12 | 2023-03-24 | 未鲲(上海)科技服务有限公司 | Component loading method and device, computer equipment and storage medium |
CN110941460B (en) * | 2019-11-22 | 2023-09-01 | 北京金山云网络技术有限公司 | Application program starting method and device, electronic equipment, system and storage medium |
CN111142903B (en) * | 2019-12-23 | 2023-09-22 | 杭州安恒信息技术股份有限公司 | Configuration file interactive updating method and device based on file comparison |
CN112711540A (en) * | 2021-01-11 | 2021-04-27 | 杭州萤石软件有限公司 | Method, device, equipment and storage medium for synchronizing configuration items of application |
CN112988220A (en) * | 2021-03-17 | 2021-06-18 | 恒安嘉新(北京)科技股份公司 | Application configuration updating method and device, storage medium and server |
CN113515322B (en) * | 2021-06-29 | 2022-11-01 | 平安养老保险股份有限公司 | Application program loading method and device, computer equipment and readable storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105607935A (en) * | 2015-12-24 | 2016-05-25 | 北京奇虎科技有限公司 | Application updating method and terminal and server |
CN105871649A (en) * | 2016-06-21 | 2016-08-17 | 上海帝联信息科技股份有限公司 | Node server, service side and configuration file updating method thereof and updating control method |
CN106603281A (en) * | 2016-12-07 | 2017-04-26 | 乐视控股(北京)有限公司 | Configuration file management method and system |
CN108037961A (en) * | 2017-12-07 | 2018-05-15 | 北京锐安科技有限公司 | A kind of application program collocation method, device, server and storage medium |
CN108121559A (en) * | 2017-12-29 | 2018-06-05 | 重庆金融资产交易所有限责任公司 | Configuration file method for pushing, server and storage medium |
CN108717360A (en) * | 2018-08-24 | 2018-10-30 | 江苏神州信源系统工程有限公司 | A kind of software version updating method and device |
Family Cites Families (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130074112A1 (en) * | 2011-09-16 | 2013-03-21 | Elwha LLC, a limited liability company of the State of Delaware | Secure electronic media for in-transit passenger usage |
CN102662705B (en) * | 2012-03-31 | 2015-06-03 | 中国工商银行股份有限公司 | System and method for upgrading system environment of computer cluster |
US10142417B2 (en) * | 2012-04-17 | 2018-11-27 | Nimbix, Inc. | System and method for managing heterogeneous data for cloud computing applications |
CN103117918B (en) * | 2013-01-21 | 2015-08-19 | 阔地教育科技有限公司 | A kind of method and system of automatic configuration parameter |
CN103631623A (en) * | 2013-11-29 | 2014-03-12 | 浪潮(北京)电子信息产业有限公司 | Method and device for allocating application software in trunking system |
CN103777987B (en) * | 2014-01-26 | 2017-09-15 | 北京国电通网络技术有限公司 | The upgrade method and device of one species unix operating systems |
TWI536783B (en) * | 2014-03-06 | 2016-06-01 | 達創科技股份有限公司 | Network system and communication device therein |
CN104158692B (en) * | 2014-08-25 | 2018-04-17 | 烽火通信科技股份有限公司 | The method that home gateway data configuration management is realized based on XML |
CN104601377A (en) * | 2015-01-13 | 2015-05-06 | 北京中交兴路车联网科技有限公司 | Multi-node multi-web-server based management device |
CN106357465A (en) * | 2016-11-10 | 2017-01-25 | 合肥工业大学 | Quick establishment method of easy-to-configure Internet of Things monitoring system |
CN108229112B (en) * | 2016-12-22 | 2022-06-03 | 阿里巴巴集团控股有限公司 | Protection application program, and running method and device of application program |
CN106873966B (en) * | 2016-12-27 | 2020-09-01 | 北京五八信息技术有限公司 | Application program development method and device |
CN107330761B (en) * | 2017-06-29 | 2019-08-09 | 北京三快在线科技有限公司 | Method for providing service information and device and calculating equipment based on geographical location |
CN108762800A (en) * | 2018-05-23 | 2018-11-06 | 北京五八信息技术有限公司 | The dynamic updating method and device of application program |
-
2018
- 2018-11-29 CN CN201811440786.3A patent/CN109634682B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105607935A (en) * | 2015-12-24 | 2016-05-25 | 北京奇虎科技有限公司 | Application updating method and terminal and server |
CN105871649A (en) * | 2016-06-21 | 2016-08-17 | 上海帝联信息科技股份有限公司 | Node server, service side and configuration file updating method thereof and updating control method |
CN106603281A (en) * | 2016-12-07 | 2017-04-26 | 乐视控股(北京)有限公司 | Configuration file management method and system |
CN108037961A (en) * | 2017-12-07 | 2018-05-15 | 北京锐安科技有限公司 | A kind of application program collocation method, device, server and storage medium |
CN108121559A (en) * | 2017-12-29 | 2018-06-05 | 重庆金融资产交易所有限责任公司 | Configuration file method for pushing, server and storage medium |
CN108717360A (en) * | 2018-08-24 | 2018-10-30 | 江苏神州信源系统工程有限公司 | A kind of software version updating method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109634682A (en) | 2019-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109634682B (en) | Configuration file updating method and device for application program | |
CN106897342B (en) | Data verification method and equipment | |
CN109582192B (en) | Hierarchical menu display method and device | |
CN110825377A (en) | Dependency conflict analysis method and device | |
CN112000349A (en) | Data upgrading method, equipment and medium based on software as a service (SaaS) | |
CN110457182A (en) | A kind of load balancing cluster example operating index monitoring system | |
CN108874379B (en) | Page processing method and device | |
CN109471901B (en) | Data synchronization method and device | |
CN106648567B (en) | Data acquisition method and device | |
CN111984666A (en) | Database access method and device, computer readable storage medium and computer equipment | |
CN108062323B (en) | Log reading method and device | |
CN110888723A (en) | Timing task processing method and device | |
CN110928941A (en) | Data fragment extraction method and device | |
CN111125087A (en) | Data storage method and device | |
CN110990799A (en) | Data processing method, device and system for anti-crawler and storage medium | |
CN115293243A (en) | Method, device and equipment for realizing intelligent matching of data assets | |
CN109299125B (en) | Database updating method and device | |
CN114138745A (en) | Data integration method and device, storage medium and processor | |
CN114691610A (en) | Directory processing method and device, storage medium and processor | |
CN111078258B (en) | Version upgrading method and device | |
CN110968754B (en) | Detection method and device for crawler page turning strategy | |
CN110968888B (en) | Data processing method and device | |
CN110020348B (en) | Early warning method and device for circled events | |
CN110019507B (en) | Data synchronization method and device | |
CN110990378A (en) | Block chain-based data consistency comparison method, device and medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |