CN113885924A - XML configuration file upgrading method and device and readable storage medium - Google Patents

XML configuration file upgrading method and device and readable storage medium Download PDF

Info

Publication number
CN113885924A
CN113885924A CN202111479313.6A CN202111479313A CN113885924A CN 113885924 A CN113885924 A CN 113885924A CN 202111479313 A CN202111479313 A CN 202111479313A CN 113885924 A CN113885924 A CN 113885924A
Authority
CN
China
Prior art keywords
configuration file
xml configuration
change
upgrading
upgrade
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
CN202111479313.6A
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.)
Shenzhen Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
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 Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202111479313.6A priority Critical patent/CN113885924A/en
Publication of CN113885924A publication Critical patent/CN113885924A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for upgrading an XML configuration file and a readable storage medium, wherein the method comprises the following steps: when a configuration file upgrading instruction is received, an upgrading conversion file is obtained and analyzed, and a first change instruction of a preset node is obtained; obtaining a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file; updating the original XML configuration file according to the second change description to generate a new XML configuration file; because how to change the preset nodes of the XML configuration files with various structures is defined in the upgrading conversion file, whether the preset nodes exist in the original XML configuration file is only needed to be searched during upgrading, if the preset nodes exist, the nodes are used as target nodes, and the target nodes are updated in the original XML configuration file, so that the problems that the upgrading efficiency is low, manpower is consumed, and the correctness cannot be guaranteed when the XML configuration files are manually upgraded in a manual comparison mode in the prior art are solved.

Description

XML configuration file upgrading method and device and readable storage medium
Technical Field
The invention relates to the technical field of computer software, in particular to an XML configuration file upgrading method and device and a computer readable storage medium.
Background
With the development of computer software technology, various application programs come into play, and great convenience is brought to the life of people.
Currently, most of application programs have XML configuration files for storing some configuration parameters and initial setting parameters and some parameters that may be changed, and in the iterative process of the application program, some configuration parameters inevitably need to be adjusted, for example, some configuration items are added, modified or deleted in the XML configuration file, and if the XML configuration file is not upgraded, the software will encounter problems in delivery.
In the prior art, when an application program is upgraded, an XML configuration file is generally not upgraded directly, but after the application program is upgraded, the application program is manually modified or a tool matched with the structure of the XML configuration file is written manually by comparison, and the XML configuration file is analyzed by the tool to be modified. Obviously, the cost of upgrading the product is increased by the manual processing mode, and along with the fact that the application program becomes larger and larger, the configuration parameters become more and more, the structure becomes more and more complex, the difficulty of manual processing becomes larger and larger, the efficiency of manual processing is low, and the correctness of the configuration file after manual processing cannot be guaranteed.
Disclosure of Invention
The invention mainly aims to provide an XML configuration file upgrading method, an XML configuration file upgrading device and a computer readable storage medium, and aims to solve the technical problems that in the prior art, the XML configuration file upgrading method consumes manpower, is low in upgrading efficiency and cannot guarantee correctness.
In order to achieve the above object, an embodiment of the present invention provides an XML configuration file upgrading method, where the XML configuration file upgrading method includes:
when a configuration file upgrading instruction is received, an upgrading conversion file is obtained;
analyzing the upgrading conversion file to obtain a first change description of a preset node;
acquiring an original XML configuration file to be upgraded;
obtaining a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file;
and updating the original XML configuration file according to the second change description to generate a new XML configuration file so as to finish the upgrading of the XML configuration file.
Optionally, when the configuration file upgrade instruction is received, the step of obtaining the upgrade conversion file includes:
and respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax to create an upgrade conversion file.
Optionally, the first change instruction includes path information, a change type, and change content of a preset node;
the step of analyzing the upgrade conversion file to obtain a first change description of a preset node includes:
and analyzing the upgrade conversion file to acquire the path information, the change type and the change content of the preset node.
Optionally, the second change instruction includes path information, a change type, and change content of the target node;
the step of obtaining a second change description of the target node to be changed in the upgrade according to the first change description and the original XML configuration file comprises the following steps:
determining a target node to be changed in the current upgrade in the preset nodes according to the path information in the first change description;
and determining the path information, the change type and the change content of the target node as a second change description of the target node to be changed in the upgrading.
Optionally, the step of updating the original XML configuration file according to the second change instruction and generating a new XML configuration file includes:
determining the position of the target node by using XPath according to the path information of the target node in the second change instruction;
and updating the position of the target node according to the change type and the change content in the second change description to generate a new XML configuration file.
Optionally, the change types include Replace, Insert ifmissing, Remove, removall.
Optionally, the present invention further provides an apparatus for upgrading an XML configuration file, where the apparatus for upgrading an XML configuration file includes:
the acquisition module is used for acquiring an upgrade conversion file when receiving an upgrade instruction of the configuration file; the system is also used for acquiring an original XML configuration file to be upgraded;
the analysis module is used for analyzing the upgrade conversion file to obtain a first change description of a preset node;
the determining module is used for obtaining a second change description of the target node to be changed in the upgrading according to the first change description and the original XML configuration file;
and the updating module is used for updating the original XML configuration file according to the second change description and generating a new XML configuration file so as to finish the upgrading of the XML configuration file.
Optionally, the XML configuration file upgrading apparatus further includes:
and the creating module is used for respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax so as to create the upgrade conversion file.
In addition, the present invention also provides an XML configuration file upgrade apparatus, including: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the XML configuration file upgrading method when being executed by the processor.
In addition, the present invention also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the computer program realizes the steps of the above-mentioned XML configuration file upgrading method.
The invention provides a method, a device and a readable storage medium for upgrading an XML configuration file, wherein an upgrading conversion file is obtained when a configuration file upgrading instruction is received; analyzing the upgrade conversion file to obtain a first change description of a preset node; acquiring an original XML configuration file to be upgraded, and acquiring a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file; updating the original XML configuration file according to the second change instruction, and generating a new XML configuration file to finish the upgrading of the XML configuration file; the method and the device have the advantages that how to change the preset nodes of the XML configuration files with various structures is defined in the upgrading conversion file, so that the upgrading conversion file can be compatible with the upgrading of the XML configuration files with various structures, whether the preset nodes exist in the original XML configuration file is only needed to be searched during upgrading, if the preset nodes exist, the nodes serve as target nodes, and the target nodes are updated in the original XML configuration file.
Drawings
Fig. 1 is a schematic structural diagram of an XML configuration file upgrade apparatus of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of an XML configuration file upgrade method according to the present invention;
fig. 3 is a schematic structural diagram of an XML configuration file upgrading apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Currently, most of application programs have XML configuration files for storing some configuration parameters and initial setting parameters and some parameters that may be changed, and in the iterative process of the application program, some configuration parameters inevitably need to be adjusted, for example, some configuration items are added, modified or deleted in the XML configuration file, and if the XML configuration file is not upgraded, a problem occurs in the delivery of software.
In the prior art, when an application program is upgraded, an XML configuration file is generally not upgraded directly, but after the application program is upgraded, the XML configuration file is manually modified or a tool matched with the XML configuration file to be upgraded is written manually by comparison, the XML configuration file is analyzed by the tool, and the XML configuration file is modified. Obviously, the cost of upgrading the product is increased by the manual processing mode, and along with the fact that the application program becomes larger and larger, the configuration parameters become more and more, the structure becomes more and more complex, the difficulty of manual processing becomes larger and larger, the efficiency of manual processing is low, and the correctness of the configuration file after manual processing cannot be guaranteed.
In the prior art, a traditional tool is also adopted to upgrade the XML configuration file, the node to be modified and the modified content are compiled into the tool, and the tool is operated to upgrade the XML configuration file, so that although the problem of correctness can be guaranteed, developers need to repeatedly compile tools matched with the structure of the XML configuration file to be upgraded every time aiming at the XML configuration files to be upgraded with different structures, and therefore the developers are high in working strength and labor-consuming.
The invention provides an XML configuration file upgrading method, which is characterized in that an upgrading conversion file compatible with various XML configuration file structures is created, path information, change types and change contents of all preset nodes are defined in the upgrading conversion file, when the upgrading is carried out, only the target node to be changed needs to be searched in the XML configuration file to be upgraded, if the target node to be changed exists, the target node is updated in the original XML configuration file, the problems that the upgrading efficiency is low, manpower is consumed and the correctness cannot be ensured when the XML configuration file is manually upgraded by adopting a manual comparison mode in the prior art are solved, and the problems that the XML configuration file cannot be suitable for XML configuration files with various structures and an upgrading tool needs to be repeatedly written by adopting a traditional tool are solved.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
Referring to fig. 1, the XML configuration file upgrade apparatus in the present invention may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the XML profile upgrade apparatus shown in FIG. 1 does not constitute a limitation of XML profile upgrade apparatus, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a computer program.
In the XML configuration file upgrade apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting a server and performing data communication with the server; the user interface 1003 is mainly used for connecting a client and performing data communication with the client; and the processor 1001 may be configured to invoke the computer program stored in the memory 1005 and perform the following operations:
when a configuration file upgrading instruction is received, an upgrading conversion file is obtained;
analyzing the upgrading conversion file to obtain a first change description of a preset node;
acquiring an original XML configuration file to be upgraded;
obtaining a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file;
and updating the original XML configuration file according to the second change description to generate a new XML configuration file so as to finish the upgrading of the XML configuration file.
Further, before the step of obtaining the upgrade conversion file when receiving the configuration file upgrade instruction, the processor 1001 may call the computer program stored in the memory 1005, and further perform the following operations:
and respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax to create an upgrade conversion file.
Further, the first change instruction comprises path information, a change type and change content of a preset node; the step of analyzing the upgrade conversion file to obtain a first change description of a preset node includes:
and analyzing the upgrade conversion file to acquire the path information, the change type and the change content of the preset node.
Further, the second change instruction comprises path information, change type and change content of the target node; the step of obtaining a second change description of the target node to be changed in the upgrade according to the first change description and the original XML configuration file comprises the following steps:
determining a target node to be changed in the current upgrade in the preset nodes according to the path information in the first change description;
and determining the path information, the change type and the change content of the target node as a second change description of the target node to be changed in the upgrading.
Further, the step of updating the original XML configuration file according to the second change instruction and generating a new XML configuration file includes:
determining the position of the target node by using XPath according to the path information of the target node in the second change instruction;
and updating the position of the target node according to the change type and the change content in the second change description to generate a new XML configuration file.
Further, the change types include Replace, Insert ifmissing, Remove, removall.
Furthermore, the present invention also provides an apparatus for upgrading an XML configuration file, where the apparatus for upgrading an XML configuration file includes:
the acquisition module is used for acquiring an upgrade conversion file when receiving an upgrade instruction of the configuration file; the system is also used for acquiring an original XML configuration file to be upgraded;
the analysis module is used for analyzing the upgrade conversion file to obtain a first change description of a preset node;
the determining module is used for obtaining a second change description of the target node to be changed in the upgrading according to the first change description and the original XML configuration file;
and the updating module is used for updating the original XML configuration file according to the second change description and generating a new XML configuration file so as to finish the upgrading of the XML configuration file.
Further, the apparatus for upgrading an XML configuration file further includes:
and the creating module is used for respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax so as to create the upgrade conversion file.
The present invention further provides an XML configuration file upgrading method, in a first embodiment of the XML configuration file upgrading method, referring to fig. 2, the XML configuration file upgrading method of the present invention includes:
step A10, when receiving the configuration file upgrading instruction, obtaining an upgrading conversion file;
it will be appreciated that XML is an extensible markup language, a structured markup language for marking electronic documents, which can be used to mark data, define data types, and is a source language that allows a user to define his own markup language.
In the iterative process of the application program, the configuration parameters in the XML configuration file inevitably need to be adjusted, and some configuration items need to be added, modified or deleted in the XML configuration file.
The upgrade conversion file, which is also a file written in the XML language, is used to define how the XML configuration file is modified during upgrade. The upgrading conversion file defines how to change the XML configuration files with various similar structures or how to change the XML configuration files with the same service according to the service requirement, so that the upgrading conversion file can be compatible with the XML configuration files with various structures, and when the original XML configuration file is upgraded, the upgrading conversion file is not required to be updated unless the structure related to the original XML configuration file or the service type upgrading conversion file is not covered, and the upgrading conversion file is not required to be updated, so that the upgrading conversion file can be suitable for upgrading the XML configuration files with various similar structures or similar service types.
Step A20, analyzing the upgrade conversion file to obtain a first change instruction of a preset node;
it can be understood that the first change instruction includes path information, change type and change content of the preset node, the change type refers to how to change, and includes Replace, Insert ifmissing, Remove and Remove all, and may also include other change types with conditions, such as Insert before, Insert after, Remove attribute, and SetAttributes, and the change content refers to what is changed, such as specific elements, and after the upgrade conversion file is obtained, the upgrade conversion file is parsed according to xdt: Transform, xdt: Locator syntax, that is, the path information, change type and change content of the preset node can be parsed.
Step A30, obtaining an original XML configuration file to be upgraded;
the original XML configuration file, that is, the XML configuration file that needs to be modified, is also the XML configuration file that needs to be upgraded this time.
Step A40, obtaining a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file;
it can be understood that the first change instruction includes path information, change types and change contents of all preset nodes in the upgrade conversion file, the target node refers to a node to be changed in the upgrade, and the second change instruction includes path information, change types and change contents of the target node.
Optionally, the step of obtaining, according to the first change instruction and the original XML configuration file, a second change instruction of the target node to be changed in the current upgrade includes:
step A41, determining a target node to be changed in the current upgrade from the preset nodes according to the path information in the first change instruction;
it can be understood that, since the upgrade conversion file may be compatible with XML configuration files of multiple structures, how to change all nodes of the XML configuration files of multiple structures is defined in the upgrade conversion file, and therefore the first change instruction obtained by parsing the upgrade conversion file includes path information, change types, and change contents of all preset nodes in the upgrade conversion file, so that a node to be changed of the original XML configuration file to be upgraded at this time is only a part of a preset node in the first change instruction, and therefore, according to the path information of the preset node in the first change instruction, whether the preset node exists in the original XML configuration file to be upgraded at this time is searched, and if the preset node exists, the node is determined to be a target node, for example, the first change instruction includes path information, change types, and change contents of A, B, C, D, E, F6 preset nodes, and the node to be changed of the original XML configuration file to be upgraded at this time is only B, C, D, whether the node A exists in the original XML configuration file is searched through the path information of the node A, if the search result does not exist, whether the node B exists in the original XML configuration file is continuously searched according to the path information of the node B, if the search result exists, the node B is determined to be the target node, and if the search result exists, the node C, D is also determined to be the target node.
Step a42, determining the path information, the change type and the change content of the target node as a second change description of the target node to be changed in the current upgrade.
After the target node is determined, the path information, the change type and the change content of the target node are used as a second change description of the target node to be changed in the upgrade, for example, the first change description includes the path information, the change type and the change content of A, B, C, D, E, F6 preset nodes, and the target node is B, C, D, the path information, the change type and the change content of B, C, D node are used as a second change description.
Step A50, updating the original XML configuration file according to the second change instruction, and generating a new XML configuration file to complete the upgrading of the XML configuration file.
After the second change description of the target node is determined, the original XML configuration file can be updated according to the second change description, and a new XML configuration file is generated, so that the upgrading of the XML configuration file is completed.
Optionally, the step of updating the original XML configuration file according to the second change instruction and generating a new XML configuration file includes:
a step a51 of determining the position of the target node by using XPath according to the path information of the target node in the second change instruction;
it can be understood that the second alteration specification includes path information of the target node, and the position of the target node can be located in the original XML configuration file by using XPath according to the path information of the target node.
Step a52, updating the location of the target node according to the change type and change content in the second change instruction, and generating a new XML configuration file.
After the position of the target node is determined, the position of the target node of the original XML configuration file can be updated according to the change type and the change content in the second change description, and if a plurality of target nodes exist, the positions of the plurality of target nodes need to be updated to generate a new XML configuration file, that is, the original XML configuration file is upgraded.
The invention provides a method, a device and a readable storage medium for upgrading an XML configuration file, wherein an upgrading conversion file is obtained when a configuration file upgrading instruction is received; analyzing the upgrade conversion file to obtain a first change description of a preset node; acquiring an original XML configuration file to be upgraded, and acquiring a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file; updating the original XML configuration file according to the second change instruction, and generating a new XML configuration file to finish the upgrading of the XML configuration file; the method and the device have the advantages that how to change the preset nodes of the XML configuration files with various structures is defined in the upgrading conversion file, so that the upgrading conversion file can be compatible with the XML configuration files with various structures, whether the preset nodes exist in the original XML configuration file is only needed to be searched during upgrading, if the preset nodes exist, the nodes serve as target nodes, and the target nodes are updated in the original XML configuration file.
Preferably, in another embodiment of the XML configuration file upgrading method according to the present invention, the step of obtaining the upgrade conversion file when the configuration file upgrading instruction is received includes:
and respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax to create an upgrade conversion file.
It should be noted that the preset node refers to all nodes of the XML configuration file with multiple structures to be included in the upgrade conversion file, the Locator syntax is used to define the position of the preset node, the Locator includes multiple subsets, and the subsets are all used to describe the position of the preset node, for example, Condition, Match, and XPath subsets, where Condition represents a matching Condition and is implicitly added to the XML expression of the current element to Match the corresponding element, Match represents one or more elements selected to Match the specified one or more characteristics, XPath represents a matching Condition, and unlike Condition, the specified expression is not added to the implicit XPath expression corresponding to the current element.
The Transform syntax is used to define the change type and content of the preset node, the Transform contains a plurality of subsets, each of which is used to describe how the preset node is modified, e.g. Replace, Insert, insertbeform, InsertAfter, Remove all, Remove atttributes, SetAttributes subsets, Replace selected elements with elements specified in the Transform file, if a plurality of elements are selected, only the first element selected is replaced, Insert indicates that the elements defined in the Transform file are added as peers of the selected element or elements, the new element is added to the end of any set, insertbeform indicates that the elements are inserted directly before the elements selected by XPath expressions, Insert indicates that the elements are inserted directly after the elements selected by XPath expressions, Remove the selected elements, if a plurality of elements are selected, Remove the first element, Remove the selected element or elements, RemoveAttributes indicates that a specified property is removed from a selected element, and SetAttributes indicates that a property of a selected element is set to a specified value.
And respectively creating the position characteristics and the conversion characteristics of all preset nodes by using Locator syntax and Transform syntax, namely completing the creation of the upgrade conversion file.
By creating the upgrading conversion file compatible with various XML configuration file structures, the XML configuration files with various structures can be upgraded according to the upgrading conversion file during upgrading, an upgrading tool does not need to be written for many times, the upgrading accuracy of the XML configuration files is guaranteed, the upgrading efficiency is improved, and the labor cost is reduced.
Further, referring to fig. 3, an embodiment of the present invention further provides an XML configuration file upgrading apparatus, where the XML configuration file upgrading apparatus includes:
the acquisition module is used for acquiring an upgrade conversion file when receiving an upgrade instruction of the configuration file; the system is also used for acquiring an original XML configuration file to be upgraded;
the analysis module is used for analyzing the upgrade conversion file to obtain a first change description of a preset node;
the determining module is used for obtaining a second change description of the target node to be changed in the upgrading according to the first change description and the original XML configuration file;
and the updating module is used for updating the original XML configuration file according to the second change description and generating a new XML configuration file so as to finish the upgrading of the XML configuration file.
Optionally, the XML configuration file upgrading apparatus further includes:
and the creating module is used for respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax so as to create the upgrade conversion file.
The expanding content of the specific implementation of the apparatus for upgrading an XML configuration file of the present invention is basically the same as that of each embodiment of the method for upgrading an XML configuration file, and is not described herein again.
Further, an embodiment of the present invention further provides an XML configuration file upgrading apparatus, where the XML configuration file upgrading apparatus includes: the system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the XML configuration file upgrading method in each embodiment when being executed by the processor.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps of the above-mentioned XML configuration file upgrading method in each embodiment.
The expanding contents of the specific implementation modes of the XML configuration file upgrading device and the computer readable storage medium of the invention are basically the same as the embodiments of the XML configuration file upgrading method, and are not described herein again.
It should be noted that, in this document, 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 like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An XML configuration file upgrading method is characterized by comprising the following steps:
when a configuration file upgrading instruction is received, an upgrading conversion file is obtained;
analyzing the upgrading conversion file to obtain a first change description of a preset node;
acquiring an original XML configuration file to be upgraded;
obtaining a second change description of a target node to be changed in the upgrade according to the first change description and the original XML configuration file;
and updating the original XML configuration file according to the second change description to generate a new XML configuration file so as to finish the upgrading of the XML configuration file.
2. The XML configuration file upgrade method according to claim 1, wherein the step of obtaining the upgrade conversion file upon receiving the configuration file upgrade instruction, is preceded by:
and respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax to create an upgrade conversion file.
3. The XML configuration file upgrading method according to claim 1, wherein the first change specification includes path information, a change type, and change contents of a preset node;
the step of analyzing the upgrade conversion file to obtain a first change description of a preset node includes:
and analyzing the upgrade conversion file to acquire the path information, the change type and the change content of the preset node.
4. The XML configuration file upgrade method according to claim 3, wherein the second change specification includes path information, a change type, and change contents of a target node;
the step of obtaining a second change description of the target node to be changed in the upgrade according to the first change description and the original XML configuration file comprises the following steps:
determining a target node to be changed in the current upgrade in the preset nodes according to the path information in the first change description;
and determining the path information, the change type and the change content of the target node as a second change description of the target node to be changed in the upgrading.
5. The XML configuration file upgrading method according to claim 4, wherein the step of updating the original XML configuration file according to the second change specification to generate a new XML configuration file comprises:
determining the position of the target node by using XPath according to the path information of the target node in the second change instruction;
and updating the position of the target node according to the change type and the change content in the second change description to generate a new XML configuration file.
6. The XML configuration file upgrade method according to claim 3, wherein the change types include Replace, Insert ifmissing, Remove, removall.
7. An XML configuration file upgrade apparatus, comprising:
the acquisition module is used for acquiring an upgrade conversion file when receiving an upgrade instruction of the configuration file; the system is also used for acquiring an original XML configuration file to be upgraded;
the analysis module is used for analyzing the upgrade conversion file to obtain a first change description of a preset node;
the determining module is used for obtaining a second change description of the target node to be changed in the upgrading according to the first change description and the original XML configuration file;
and the updating module is used for updating the original XML configuration file according to the second change description and generating a new XML configuration file so as to finish the upgrading of the XML configuration file.
8. The XML configuration file upgrading apparatus of claim 7, wherein the XML configuration file upgrading apparatus further comprises:
and the creating module is used for respectively creating the position characteristic and the conversion characteristic of the preset node according to the Locator syntax and the Transform syntax so as to create the upgrade conversion file.
9. An XML configuration file upgrade apparatus, comprising: memory, processor and computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of the XML configuration file upgrade method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps of the XML configuration file upgrade method according to any one of claims 1 to 6.
CN202111479313.6A 2021-12-07 2021-12-07 XML configuration file upgrading method and device and readable storage medium Pending CN113885924A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111479313.6A CN113885924A (en) 2021-12-07 2021-12-07 XML configuration file upgrading method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111479313.6A CN113885924A (en) 2021-12-07 2021-12-07 XML configuration file upgrading method and device and readable storage medium

Publications (1)

Publication Number Publication Date
CN113885924A true CN113885924A (en) 2022-01-04

Family

ID=79015680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111479313.6A Pending CN113885924A (en) 2021-12-07 2021-12-07 XML configuration file upgrading method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN113885924A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108811A (en) * 2023-04-11 2023-05-12 天津联想协同科技有限公司 Method and system for upgrading content of SaaS application specific format document

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866252A (en) * 2006-02-20 2006-11-22 华为技术有限公司 Method and system for transformation between different version configuration data
CN104217029A (en) * 2014-09-26 2014-12-17 北京国双科技有限公司 Configuration file modification method and configuration file modification device
CN107608704A (en) * 2017-11-02 2018-01-19 金蝶软件(中国)有限公司 A kind of XML configuration file update method, system, medium and device
CN109656585A (en) * 2018-09-27 2019-04-19 深圳壹账通智能科技有限公司 Upgrade method, device, equipment and the storage medium of flow instance

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1866252A (en) * 2006-02-20 2006-11-22 华为技术有限公司 Method and system for transformation between different version configuration data
CN104217029A (en) * 2014-09-26 2014-12-17 北京国双科技有限公司 Configuration file modification method and configuration file modification device
CN107608704A (en) * 2017-11-02 2018-01-19 金蝶软件(中国)有限公司 A kind of XML configuration file update method, system, medium and device
CN109656585A (en) * 2018-09-27 2019-04-19 深圳壹账通智能科技有限公司 Upgrade method, device, equipment and the storage medium of flow instance

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DOTNET全栈开发: "vs发布项目webconfig替换语法", 《CSDN: HTTPS://BLOG.CSDN.NET/KEBI007/ARTICLE/DETAILS/60321701》 *
张林-布莱恩特: "vs发布项目webconfig替换语法", 《HTTPS://WWW.BBSMAX.COM/A/X9J2DG7MD6/》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116108811A (en) * 2023-04-11 2023-05-12 天津联想协同科技有限公司 Method and system for upgrading content of SaaS application specific format document
CN116108811B (en) * 2023-04-11 2023-08-11 天津联想协同科技有限公司 Method and system for upgrading content of SaaS application specific format document

Similar Documents

Publication Publication Date Title
CN110019486B (en) Data acquisition method, device, equipment and storage medium
CN106951228B (en) Method and device for processing differences in version iteration
CN110955416A (en) Interface document generation method, device, equipment and computer storage medium
CN108762743B (en) Data table operation code generation method and device
CN111068328B (en) Game advertisement configuration form generation method, terminal equipment and medium
US20040193465A1 (en) Automated workflow assignment to print jobs
CN111949351A (en) Page rendering method, device, equipment and computer readable storage medium
CN110673847A (en) Configuration page generation method and device, electronic equipment and readable storage medium
US11128721B2 (en) Action flow fragment management
JP2007183916A (en) Method and apparatus for automatic form input on mobile devices
CN111026670A (en) Test case generation method, test case generation device, and storage medium
US20080263085A1 (en) Describing expected entity relationships in a model
CN113885924A (en) XML configuration file upgrading method and device and readable storage medium
CN111459537A (en) Redundant code removing method, device, equipment and computer readable storage medium
CN111694632B (en) Method, device, equipment and storage medium for displaying service data
CN111857881A (en) Repo-based manifest warehouse loading method and device and storage medium
CN115794214B (en) Application module metadata management method, device, storage medium and apparatus
Nebeling et al. XCML: providing context-aware language extensions for the specification of multi-device web applications
CN115291887A (en) Code generation method, device, equipment and storage medium
CN115080616A (en) Dictionary data acquisition method and device, storage medium and electronic equipment
KR101423594B1 (en) Quary generation apparatus using interactive question and answer, quary generation method and recording medium thereof
CN114328572A (en) Data query method, device, system and medium based on SQL parser
CN113656036B (en) Compiling method, device, terminal and medium based on Mybatis
CN116302076B (en) Method and device for configuring configuration items based on analysis configuration item table structure
CN108845803B (en) Method, device and equipment for updating list view and storage 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220104

RJ01 Rejection of invention patent application after publication