CN110532006A - A kind of complex configurations document upgrading method based on state machine - Google Patents
A kind of complex configurations document upgrading method based on state machine Download PDFInfo
- Publication number
- CN110532006A CN110532006A CN201910772361.0A CN201910772361A CN110532006A CN 110532006 A CN110532006 A CN 110532006A CN 201910772361 A CN201910772361 A CN 201910772361A CN 110532006 A CN110532006 A CN 110532006A
- Authority
- CN
- China
- Prior art keywords
- version
- upgrading
- file
- source
- configuration file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- 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
Abstract
The present invention discloses a kind of complex configurations document upgrading method based on state machine, this method is after the specified file for needing to upgrade of user, the configuration file of all toml formats under the automatic recurrence reading folder of meeting, and identifier is added for each configuration file, when carrying out cross-version upgrading, the field difference for comparing the corresponding version in upgrading chain road is altered to the configuration of escalation target version according to certain rules automatically.In update phase, it can be using user file as an input source, using the template of user's current version as current template source, using the template of next version as target source, this tool can be arrived using all version numbers being upgraded between target version as a upgrade status, and based on the field difference between three sources of each epidemic situation comparison, according to the highest priority of user setting, the recommendation for being upgraded to next version automatically consistent with template configuration, the principles such as few benefit are deleted to change more, it is final that one key of user is helped to be upgraded to desired version, this tool had both supported the upgrading of continuous version or had supported the upgrading of jump version, to significantly simplify the work for the configuration file for configuring corresponding version tool.
Description
Technical field
The present invention relates to the design fields of decentralization block chain complex configurations file, more particularly to one kind to be based on state machine
Complex configurations document upgrading method.
Background technique
Block chain technology, block chain are a kind of novel decentralization agreements, can safely store digital cash transaction or its
His data, information can not be forged and be distorted;Intelligent contract is a kind of one that can dispose and execute in block chain network environment
Section code, the deployment of this section of code and to execute all be that can be presented in the form of transaction in block chain network, deployment and
Implementing result can be known together with trading by the whole network;Since result needs give common recognition layer common recognition, the result thus executed is necessary
Guarantee consistency on each node.
Either public chain or alliance's chain scene, can all there is many nodes, and the version between node is also because of distributed areas, dimension
Shield person is different and variant, and the starting configuration of node is again different according to different guardian's machines, this when is just
Cause the fragmentation of configuration file very serious, when needing subnetwork node or whole network node is upgraded
It waits, faces different editions, the configuration file of different numerical value is just very intractable, if guaranteeing the complex configurations file energy of all nodes
Being upgraded to version always according to unified rule is a completely new challenge.
Summary of the invention
In view of the deficiencies of the prior art, the present invention proposes a kind of complex configurations document upgrading method based on state machine, both
It ensure that the configuration of user will not lose during upgrading, also ensure that not altered field can be upgraded to corresponding version
This recommendation.The purpose of the present invention is what is be achieved through the following technical solutions: a kind of complex configurations file based on state machine
Upgrade method, this method specifically comprise the following steps:
Step 1: it is upgraded in the catalogue and current version and needs for receiving the configuration file that user's needs upgrade
After target version number, by the configuration file of toml format all under recursive lookup catalogue first, and to each file root
A unique identifier is formed according to path and filename;
Step 2: the standard form of all versions in upgrading chain road is checked for, standard form includes each version
Recommendation corresponding to this configuration file.After finding the standard form of each version, check the target version that is upgraded to and
Whether current version is continuously, if it is continuously then using the version number of each upgrading chain road as a state machine section
Point upgrades failure if not version number is discontinuous or lacks standard form;
Step 3: after generating state machine node, also lacking the value and rule that field changes between each node, respectively will
For toml file under user's input directory as current source, the template of user's current version, will be next as current template source
The template of version is as target source, by these three sources of each node according to according to the excellent of user setting when customer upgrade
First grade highest, the recommendation for being upgraded to next version automatically consistent with template configuration, lacks or multi-field is automatically according to mesh
Mark source field supplement or the rule deleted are modified, until state machine state is switched to always targeted update state machine state
Until, export this when last configuration file to former catalogue be our configuration files to be upgraded to;
Step 4: a source file can be replicated automatically before upgrading configuration as backup, if in escalation process
It was found that mistake or have damage, can directly replace backup file.
Beneficial effects of the present invention are as follows: the present invention is applied to the block chain intelligence configuration file under public chain or alliance's chain background
Upgrade under scene, both ensure that the configuration of user will not lose during upgrading, and also ensured that not altered field could
It is block chain configuration tool upgrading scheme quantum jump to be upgraded to the recommendation of corresponding version.
Detailed description of the invention
Fig. 1 is upgrading configuration flow chart in method of the invention.
Specific embodiment
Below according to attached drawing and preferred embodiment the present invention is described in detail, the objects and effects of the present invention will become brighter
White, below in conjunction with drawings and examples, the present invention will be described in further detail.It should be appreciated that described herein specific
Embodiment is only used to explain the present invention, is not intended to limit the present invention.
It is as shown in Figure 1 a kind of complex configurations document upgrading method based on state machine, this method specifically includes following step
It is rapid:
Step 1: by the specified mesh for needing the configuration file catalogue upgraded and current version and needs to be upgraded to of user
Version number is marked, the starting point for upgrading as metamessage mark and the configuration file position to be upgraded;Receiving user's needs
After the target version number that the catalogue and current version and needs of upgrading configuration are upgraded to, mesh described in recursive lookup first
The configuration file of all toml formats under record, and each configuration file is formed into unique identification according to path and filename
Symbol, path and filename, file suffixes identify the uniqueness of file;
Step 2: check that upgrading chain road whether there is the standard form of all versions, standard form includes each version
Recommendation corresponding to configuration file.Standard form needs voluntarily to be added in corresponding catalogue after version publication, standard text
Part can be used as reference file, and the field value that the upgrading of configuration file can rely on normative document carrys out the content of adjust automatically source file.
After finding the standard form of each version, check whether the target version being upgraded to and current version are continuous, if continuous
Using the version number of each upgrading chain road as a state machine node;Upgrade mistake if discontinuous or lack standard form
It loses.
Step 3: after generating state machine node, also lack the value and rule that field changes between each node, by user
The configuration file of toml format under input directory as current source, the template of user's current version as current template source, under
The template of one version is as target source.It, will be each using the field highest priority of user setting as principle when customer upgrade
These three sources of node are compared, if current source field is consistent with current template source field, are changed to target source field,
If current source lacks or have redundant field, modify according to the rule supplemented or deleted according to target source field,
Until state machine state is switched to target source state, exports last configuration file and match to what former catalogue to be as upgraded to
Set file.All rules are all can be predefined, can voluntarily be write according to the characteristic of different configuration files, finally with
Software is issued together, it should be ensured that regular simple, unambiguity, the file after being responsible for will lead to upgrading can not start corresponding
Node.
A source file can be replicated automatically before upgrading configuration as backup, if finding mistake in escalation process
Or have damage, backup file can be directly replaced, reduction reset condition is upgraded manually.The backup filename of generation should
Timestamp is carried, avoids covering file under former catalogue when generating backup file.
According to the continuous state of standard form file generated corresponding to each configuration file, the path either upgraded and
The change of field is required based on this continuous state between each state.
Standard form needs voluntarily to be added in corresponding catalogue after version publication, standard form as reference file,
The upgrading of configuration file relies on the content of the field value adjust automatically source file of normative document.
It will appreciated by the skilled person that being not used to limit the foregoing is merely the preferred embodiment of invention
System invention, although invention is described in detail referring to previous examples, for those skilled in the art, still
It can modify to the technical solution of aforementioned each case history or equivalent replacement of some of the technical features.It is all
Within the spirit and principle of invention, modification, equivalent replacement for being made etc. be should be included within the protection scope of invention.
Claims (5)
1. a kind of complex configurations document upgrading method based on state machine, which is characterized in that this method specifically comprises the following steps:
Step 1: in the target version for receiving user the catalogue of upgrading configuration and current version and needs being needed to be upgraded to
After this number, the configuration file of toml format all under catalogue described in recursive lookup first, and by each configuration file according to
Path and filename form unique identifier.
Step 2: check that upgrading chain road whether there is the standard form of all versions, standard form includes each version configuration
Recommendation corresponding to file.After finding the standard form of each version, the target version and current version being upgraded to are checked
It is whether continuous, using the version number of each upgrading chain road as a state machine node if continuous;If it is discontinuous or
Lack standard form and then upgrades failure.
Step 3: after generating state machine node, by the configuration file of the toml format under user's input directory as working as
Preceding source, the template of user's current version is as current template source, and the template of next version is as target source.Work as customer upgrade
When, using the field highest priority of user setting as principle, these three sources of each node are compared, if current source word
Section is consistent with current template source field, then is changed to target source field, if current source lacks or has redundant field, according to
The rule supplemented or deleted according to target source field is modified, until state machine state is switched to target source state,
Last configuration file is exported to the former catalogue as configuration file to be upgraded to.
2. document upgrading method according to claim 1, which is characterized in that one can be replicated automatically before upgrading configuration
Secondary source file is as backup.
3. document upgrading method according to claim 1, which is characterized in that needed in step 2 according to each configuration file institute
The corresponding continuous state of standard form file generated.
4. document upgrading method according to claim 1, which is characterized in that in step 2, the standard form is sent out in version
Voluntarily it is added in corresponding catalogue after cloth, standard form relies on normative document as reference file, the upgrading of configuration file
The content of field value adjust automatically source file.
5. document upgrading method according to claim 1, which is characterized in that rule described in step 3 provides between three sources
Field how to change, the configuration file ultimately produced cannot have ambiguity.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910772361.0A CN110532006B (en) | 2019-08-21 | 2019-08-21 | Complex configuration file upgrading method based on state machine |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910772361.0A CN110532006B (en) | 2019-08-21 | 2019-08-21 | Complex configuration file upgrading method based on state machine |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110532006A true CN110532006A (en) | 2019-12-03 |
CN110532006B CN110532006B (en) | 2022-11-18 |
Family
ID=68663866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910772361.0A Active CN110532006B (en) | 2019-08-21 | 2019-08-21 | Complex configuration file upgrading method based on state machine |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110532006B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111046055A (en) * | 2019-12-11 | 2020-04-21 | 杭州趣链科技有限公司 | Block chain global configuration changing method, equipment and storage medium |
CN114153527A (en) * | 2021-12-02 | 2022-03-08 | 天地伟业技术有限公司 | Configuration file modification method and device of camera and electronic equipment |
CN116661821A (en) * | 2023-05-10 | 2023-08-29 | 浙江简捷物联科技有限公司 | Application upgrading method and device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101483556A (en) * | 2009-01-06 | 2009-07-15 | 中兴通讯股份有限公司 | Automatic upgrading method and system for switch remote target terminal |
WO2013078951A1 (en) * | 2011-12-01 | 2013-06-06 | 腾讯科技(深圳)有限公司 | Method and system for upgrading software |
US20140317614A1 (en) * | 2012-01-12 | 2014-10-23 | Facebook, Inc. | Multiple System Images for Over-The-Air Updates |
WO2016011607A1 (en) * | 2014-07-23 | 2016-01-28 | 华为技术有限公司 | Terminal upgrade method and related device |
CN107301058A (en) * | 2017-08-28 | 2017-10-27 | 四川长虹电器股份有限公司 | Implement the method for television system OTA upgradings based on version number's Discrete control |
-
2019
- 2019-08-21 CN CN201910772361.0A patent/CN110532006B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101483556A (en) * | 2009-01-06 | 2009-07-15 | 中兴通讯股份有限公司 | Automatic upgrading method and system for switch remote target terminal |
WO2013078951A1 (en) * | 2011-12-01 | 2013-06-06 | 腾讯科技(深圳)有限公司 | Method and system for upgrading software |
US20140317614A1 (en) * | 2012-01-12 | 2014-10-23 | Facebook, Inc. | Multiple System Images for Over-The-Air Updates |
WO2016011607A1 (en) * | 2014-07-23 | 2016-01-28 | 华为技术有限公司 | Terminal upgrade method and related device |
CN107301058A (en) * | 2017-08-28 | 2017-10-27 | 四川长虹电器股份有限公司 | Implement the method for television system OTA upgradings based on version number's Discrete control |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111046055A (en) * | 2019-12-11 | 2020-04-21 | 杭州趣链科技有限公司 | Block chain global configuration changing method, equipment and storage medium |
CN114153527A (en) * | 2021-12-02 | 2022-03-08 | 天地伟业技术有限公司 | Configuration file modification method and device of camera and electronic equipment |
CN116661821A (en) * | 2023-05-10 | 2023-08-29 | 浙江简捷物联科技有限公司 | Application upgrading method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110532006B (en) | 2022-11-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110532006A (en) | A kind of complex configurations document upgrading method based on state machine | |
CN107562513B (en) | Intelligent contract life cycle management method based on JAVA | |
CN100492989C (en) | System and method for service expansion using plug | |
CN101313495B (en) | Method, system and apparatus for data synchronization | |
CN103793514B (en) | Database synchronization method and database | |
CN101730099B (en) | Terminal management method based on authority control and device | |
EP2506140A1 (en) | Ontology updating apparatus, method and system | |
EP3166029B1 (en) | Exporting hierarchical data from a source code management (scm) system to a product lifecycle management (plm) system | |
CN105224344A (en) | A kind of software upgrading file configuration method realized based on XML | |
CN110389766A (en) | HBase container cluster dispositions method, system, equipment and computer readable storage medium | |
CN102202087A (en) | Method for identifying storage equipment and system thereof | |
CN105320681A (en) | Database content combination method and device | |
CN104461531A (en) | Implementing method for self-defined functions of reporting system | |
CN108509599B (en) | Data model creating method and device | |
EP2542976B1 (en) | Method and apparatus of backing-up subversion repository | |
CN105573774A (en) | Application parameter managing and configuring method | |
US9031905B2 (en) | Data synchronization | |
CN110519088A (en) | Configure service disaster and system | |
WO2016197953A1 (en) | Method and device for deploying multi-mode base station | |
CN103984554A (en) | Software design document generating method and device | |
CN112416936A (en) | DCS background multi-node cooperative configuration mark name verification method | |
CN108900347B (en) | Cluster initialization configuration method, device, system, equipment and readable storage medium | |
WO2012069077A1 (en) | Network element configuration management | |
TWI385543B (en) | Data Synchronization System and Method for Establishing Mediation Data in Directory Service Format | |
CN103699404A (en) | Method for enabling different types of equipment with same core to correspond to multiple prefabricated application programs |
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 |