CN117632223A - Configuration file synchronization method and related equipment - Google Patents

Configuration file synchronization method and related equipment Download PDF

Info

Publication number
CN117632223A
CN117632223A CN202210979610.5A CN202210979610A CN117632223A CN 117632223 A CN117632223 A CN 117632223A CN 202210979610 A CN202210979610 A CN 202210979610A CN 117632223 A CN117632223 A CN 117632223A
Authority
CN
China
Prior art keywords
configuration file
configuration
file
default
profile
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
CN202210979610.5A
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202210979610.5A priority Critical patent/CN117632223A/en
Publication of CN117632223A publication Critical patent/CN117632223A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a configuration file synchronization method and related equipment, wherein the method comprises the following steps: acquiring a first default configuration file of an original operating system and a second default configuration file of a target operating system, and generating a configuration description file; acquiring a configuration file of the electronic equipment under an original operating system; generating configuration difference information according to the first default configuration file, the second default configuration file, the configuration file and the configuration description file of the electronic equipment under the original operating system; generating a target configuration file according to the second default configuration file, the configuration description file and the configuration difference information; and synchronizing the configuration file of the electronic equipment under the target operating system according to the target configuration file. The method improves the efficiency of configuration file synchronization.

Description

Configuration file synchronization method and related equipment
Technical Field
The present disclosure relates to computer software, and more particularly, to a method and related device for synchronizing configuration files.
Background
When the operating system of the electronic device is changed (e.g., the operating system is replaced or upgraded), the software in the electronic device needs to be redeployed. When software is redeployed, the configuration files of the software need to be synchronized. Most of the synchronization of the current configuration files is realized in a business layer, the pertinence is strong, different software has respective synchronization methods, the universality is not realized, and the synchronization efficiency is low.
Disclosure of Invention
The embodiment of the application provides a configuration file synchronization method and related equipment, which can improve the efficiency of configuration file synchronization.
The first aspect of the application discloses a configuration file synchronization method, which comprises the following steps: acquiring a first default configuration file of an original operating system and a second default configuration file of a target operating system, and generating a configuration description file, wherein the configuration description file comprises configuration description information of the first default configuration file and the second default configuration file; acquiring a configuration file of the electronic equipment under an original operating system; generating configuration difference information according to the first default configuration file, the second default configuration file, the configuration file and the configuration description file of the electronic equipment under the original operating system, wherein the configuration difference information describes the difference of the first default configuration file compared with the second default configuration file and the configuration file of the electronic equipment under the original operating system and whether the first default configuration file is synchronous with the second default configuration file; generating a target configuration file according to the second default configuration file, the configuration description file and the configuration difference information; and synchronizing the configuration file of the electronic equipment under the target operating system according to the target configuration file.
According to the configuration file synchronization method provided by the embodiment of the application, the configuration files can be synchronized when the operating system is changed (changed from the original operating system to the target operating system), so that the efficiency of redeploying the software is improved. The configuration file synchronization method supports the identification of configuration files of various software under an operating system, does not need to specifically identify the software, and has universality for different software. The configuration file synchronization method can analyze the configuration file changed under the original operating system, does not need manual investigation, reduces the workload and prevents analysis omission. The configuration file synchronization method can realize batch synchronization configuration, improves configuration synchronization efficiency, and reduces error probability of manual synchronization configuration.
In some alternative embodiments, obtaining a first default configuration file of an original operating system and a second default configuration file of a target operating system, generating the configuration description file includes: acquiring a first full software package of an original operating system and a second full software package of a target operating system; decompressing the first full software package and the second full software package; searching a first default configuration file from the files obtained by decompressing the first full-quantity software package, and searching a second default configuration file from the files obtained by decompressing the second full-quantity software package; and writing configuration description information corresponding to the first default configuration file and the second default configuration file into the configuration description file.
According to the first full software package of the original operating system and the second full software package of the target operating system, a first default configuration file of the original operating system and a second default configuration file of the target operating system can be obtained, and the first default configuration file and the second default configuration file of the target operating system are analyzed to obtain a configuration description file.
In some alternative embodiments, searching for the first default configuration file from the file decompressed by the first full software package includes: searching a text file from the file obtained by decompressing the first full software package; and searching a first default configuration file from the text file according to the preset file type.
The text file is searched from the files obtained by decompressing the first full software package, the first default configuration file is searched from the text file according to the preset file type, and the first default configuration file can be quickly searched.
In some alternative embodiments, the method further comprises: and packaging the first default configuration file and the second default configuration file into a resource file.
Packaging the first default configuration file and the second default configuration file into resource files can facilitate configuration file synchronization for different electronic devices.
In some alternative embodiments, generating the configuration difference information according to the first default configuration file, the second default configuration file, the configuration file of the electronic device under the original operating system, and the configuration description file includes: comparing the first default configuration file with the second default configuration file according to the configuration description file to obtain a first difference; comparing the first default configuration file with the configuration file of the electronic equipment under the original operating system according to the configuration description file to obtain a second difference; and generating configuration difference information according to the first difference and the second difference.
The configuration difference information describes whether the first default configuration file is different from the second default configuration file, the configuration file of the electronic device under the original operating system and whether the first default configuration file is synchronous with the second default configuration file or not, and the configuration difference information can be obtained by comparing the first default configuration file with the second default configuration file and comparing the first default configuration file with the configuration file of the electronic device under the original operating system.
In some alternative embodiments, the method further comprises: and generating a configuration file synchronization script according to the second default configuration file, the configuration description file and the configuration difference information.
Based on the configuration file synchronization script, the configuration files can be synchronized quickly.
In some alternative embodiments, generating the target profile and profile synchronization script from the second default profile, the profile, and the configuration difference information includes: reading configuration difference information, a configuration description file and a second default configuration file; for each difference item in the configuration difference information: if the difference item represents the deletion configuration file, generating a deletion script; if the difference item represents the newly added configuration file, copying the newly added configuration file to generate a copy script; and if the difference item represents the newly added, modified or deleted configuration item, modifying the second default configuration file according to the configuration description file to generate a copy script.
And carrying out different processes according to different situations of the differences described in the configuration difference information, thereby obtaining a target configuration file and a configuration file synchronization script.
In some alternative embodiments, the configuration description information includes a profile genus, a profile path, a profile type, a profile parsing rule, and a profile synchronization rule.
In some alternative embodiments, the configuration difference information includes a profile path, an original operating system, a target operating system, a processor architecture, a profile genus, a first default configuration value, a second default configuration value, an original configuration value, whether a first difference exists, whether a second difference exists, whether a difference is synchronized.
A second aspect of the present application discloses a computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the profile synchronization method according to the first aspect.
A third aspect of the present application discloses an electronic device, the electronic device comprising a processor and a memory, the memory being configured to store instructions, the processor being configured to invoke the instructions in the memory, so that the electronic device performs the profile synchronization method according to the first aspect.
A fourth aspect of the present application discloses a chip system, which is applied to an electronic device; the chip system comprises an interface circuit and a processor; the interface circuit and the processor are interconnected through a circuit; the interface circuit is used for receiving signals from the memory of the electronic device and sending signals to the processor, wherein the signals comprise computer instructions stored in the memory; when the processor executes the computer instructions, the system-on-chip performs the profile synchronization method as described in the first aspect.
It should be understood that, the computer readable storage medium of the second aspect, the electronic device of the third aspect and the chip system of the fourth aspect correspond to the methods of the first aspect, and therefore, the advantages achieved by the method may refer to the advantages of the corresponding methods provided above, and are not repeated herein.
Drawings
Fig. 1 is an application scenario schematic diagram of a configuration file synchronization method provided in an embodiment of the present application.
Fig. 2 and fig. 3 are flowcharts of a configuration file synchronization method provided in an embodiment of the present application.
Fig. 4 is a detailed flowchart of acquiring a configuration file according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a plurality of configuration files provided in an embodiment of the present application.
Fig. 6 is a detailed flowchart of generating configuration difference information based on a configuration file according to an embodiment of the present application.
Fig. 7 is a schematic diagram of configuration difference information provided in an embodiment of the present application.
FIG. 8 is a detailed flow chart of a generation target profile and profile synchronization script provided by an embodiment of the present application.
Fig. 9 is a schematic diagram of a target configuration file and a configuration file synchronization script provided in an embodiment of the present application.
Fig. 10 is a schematic diagram of structured storage of profile data according to an embodiment of the present application.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For ease of understanding, a description of some of the concepts related to the embodiments of the present application are given by way of example for reference.
It should be noted that "at least one" in this application means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
In order to better understand the configuration file synchronization method and the related device provided in the embodiments of the present application, an application scenario of the configuration file synchronization method is first described below.
Fig. 1 is an application scenario schematic diagram of a configuration file synchronization method provided in an embodiment of the present application.
As shown in fig. 1, the configuration file synchronization method provided in the embodiment of the present application is applied to an electronic device 10. The electronic device 10 comprises an operating system 11 and at least one software 12 (only one shown). The software 12 comprises at least one configuration file 13. The configuration file 13 provides information required for the software 12 to run. According to the configuration file synchronization method provided by the embodiment of the application, when the operating system 11 is changed (changed from the original operating system to the target operating system), the configuration file 13 can be synchronized, so that the efficiency of redeploying the software 12 is improved.
The change operating system 11 may be a replacement operating system, for example, the original operating system is centOS 7.6 and the target operating system is openEuler 22.03. The modified operating system 11 may be an upgrade operating system, for example, the original operating system is openEuler 21.03, the target operating system is openEuler 22.03, or the original operating system is CentOS 6.8, and the target operating system is CentOS 7.6.
The electronic device 10 may be a tablet computer, desktop computer, notebook, cloud server, or the like.
Fig. 2 and fig. 3 are flowcharts of a configuration file synchronization method according to an embodiment of the present application. The methods shown in fig. 2 and 3 are applied to an electronic device (e.g., electronic device 10 of fig. 1). Wherein fig. 2 focuses on the data processed or generated by each step, and fig. 3 focuses on the details of each step. In order to clearly and completely describe the detailed flow of the configuration file synchronization method, the configuration file synchronization method provided in the embodiment of the present application is described below with reference to fig. 2 and 3.
As shown in fig. 2 and 3, the method for synchronizing configuration files provided in the embodiment of the present application specifically includes:
a default configuration file of the original operating system (hereinafter, simply referred to as a "first default configuration file" for convenience of distinction) and a default configuration file of the target operating system (hereinafter, simply referred to as a "second default configuration file" for convenience of distinction) are acquired 201, and a configuration description file is generated.
The original operating system may be an operating system before the electronic device changes the operating system. The target operating system is an operating system after the electronic device changes the operating system.
The first default configuration file is a configuration file corresponding to software supported by the original operating system. The second default configuration file is a configuration file corresponding to software supported by the target operating system. A full package of the original operating system (hereinafter, simply referred to as a "first full package" for convenience of distinction) and a full package of the target operating system (hereinafter, simply referred to as a "second full package" for convenience of distinction) may be acquired, a first default configuration file is acquired according to the first full package, and a second default configuration file is acquired according to the second full package, and a configuration description file is generated (see 201 in fig. 2). In addition, in other embodiments, the first default configuration file and the second default configuration file stored in advance may also be obtained directly from the storage device.
In some embodiments, the first default configuration file and the second default configuration file may be different for different processor architectures. For example, for an X86 and ARM (e.g., advanced RISC Machine, advanced reduced instruction set machine, where RISC is a reduced instruction set, reduced Instruction Set Computer) architecture, the first default profile and the second default profile are different. In order to achieve the synchronization of the configuration files of the electronic device, the first default configuration file and the second default configuration file need to be acquired according to the processor architecture of the electronic device, that is, the first default configuration file and the second default configuration file corresponding to the processor architecture of the electronic device are acquired.
The configuration description file comprises configuration description information of a first default configuration file and a second default configuration file. When generating the configuration description files, each configuration file pair is acquired, and a set of configuration description information is generated for each configuration file pair. Each profile pair includes a first default profile and a corresponding second default profile. For example, under the original operating system, the software a includes a configuration file aa.conf, and under the target operating system, the software a includes a configuration file aa '. Conf corresponding to aa.conf, where aa.conf and aa'. Conf form a configuration file pair.
In one embodiment of the present application, configuration description information corresponding to a user-defined configuration file may be added to the configuration description file, so as to support batch synchronization of the user-defined configuration file.
In one embodiment of the present application, the configuration description information may include a profile genus, a profile path, a profile type, a profile parsing rule, and a profile synchronization rule.
The profile genus group represents software to which the profile pair belongs, such as software a.
The profile path is used to describe the installation path of the profile pair. In the pair of configuration files, if the installation paths of the first default configuration file and the corresponding second default configuration file are the same, the configuration file path may include one installation path (i.e., the installation path of the first default configuration file or the corresponding second default configuration file), or may include two identical installation paths (i.e., the installation paths of the first default configuration file and the corresponding second default configuration file). If the installation paths of the first default configuration file and the corresponding second default configuration file are different, the configuration file path comprises two installation paths, namely the installation path of the first default configuration file and the installation path of the corresponding second default configuration file.
The profile type is used to describe the file type of the profile pair, e.g., xml, json, etc.
The profile parsing rules are used to define how to parse the configuration items in the profile pairs. If the names of the configuration items in the first default configuration file and the names of the corresponding configuration items in the corresponding second default configuration file are different, the configuration file analysis rule defines the mapping relation between the configuration items in the first default configuration file and the corresponding configuration items in the corresponding second default configuration file. For example, in the first default configuration file, the configuration item is a, in the corresponding second default configuration file, the corresponding configuration item is aa, and the configuration file parsing rule defines the mapping relationship between a and aa.
The profile synchronization rules are used to define how to synchronize the configuration items in the profile pairs. For example, in the first default configuration file, a=b, and in the corresponding second default configuration file, the corresponding configuration item is aa, and the configuration file parsing rule defines how aa is synchronized, i.e., how aa is assigned b.
The specific process of obtaining the first default configuration file and the second default configuration file, and generating the configuration description file is depicted in fig. 4.
202, acquiring a configuration file of the electronic equipment under an original operating system.
The configuration file of the electronic equipment under the original operating system is the configuration file corresponding to the software installed by the electronic equipment under the original operating system, and is the configuration file actually contained by the electronic equipment under the original operating system.
The electronic equipment can inquire the software installed under the original operating system of the electronic equipment, and acquire the configuration file of the electronic equipment under the original operating system according to the software installed under the original operating system of the electronic equipment.
The configuration file of the electronic device under the original operating system and the software corresponding to the first default configuration file may be the same. For example, the software corresponding to the configuration file of the electronic device under the original operating system (i.e. the software installed by the electronic device under the original operating system) includes software a, software B, software C, software D and software E, and the software corresponding to the first default configuration file (i.e. the software supported by the original operating system) includes software a, software B, software C, software D and software E.
The configuration file of the electronic device under the original operating system and the software corresponding to the first default configuration file may also be different. The software corresponding to the configuration file of the electronic device under the original operating system comprises software A, software B, software C and software D, and the software corresponding to the first default configuration file (namely the software supported by the original operating system) comprises software A, software B, software C, software D and software E.
For the same software, the configuration file of the electronic device under the original operating system and the first default configuration file may be the same. For example, for software a, the configuration file and the first default configuration file of the electronic device under the original operating system include aa.conf, ab.ini, ac.xml, and the configuration items in aa.conf, ab.ini, ac.xml are the same.
For the same software, the configuration file of the electronic device under the original operating system and the first default configuration file may also be different (including the situations that the configuration file is added, deleted, configuration items in the configuration file are modified, etc. when the configuration file of the electronic device under the original operating system is compared with the first default configuration file). For example, for software a, the configuration file of the electronic device under the original operating system includes aa.conf, ab.ini, ac.xml, and the first default configuration file includes aa.conf, ab.ini.
The electronic device can inquire the software installed under the original operating system through a preset command. For example, the software installed under the original operating system of the electronic device can be queried through an rpm-qa command to obtain a catalog of the software installed under the original operating system of the electronic device.
The electronic equipment can search the configuration file from the catalog of the software installed under the original operating system to obtain the configuration file of the electronic equipment under the original operating system.
And 203, generating configuration difference information according to the first default configuration file, the second default configuration file, the configuration file of the electronic device under the original operating system and the configuration description file.
The configuration difference information describes differences in the first default configuration file compared to the second default configuration file, the configuration file of the electronic device under the original operating system, and whether the differences are synchronized.
When the configuration difference information is generated, a first default configuration value can be obtained from a first default configuration file, a second default configuration value can be obtained from a second default configuration file, and an original configuration value can be obtained from a configuration file of the electronic device under an original operating system according to a configuration file analysis rule. The electronic equipment compares the first difference between the second default configuration file and the first default configuration file, compares the second difference between the configuration file of the electronic equipment under the original operating system and the first default configuration file, and obtains configuration difference information according to the first difference and the second difference.
In one embodiment of the present application, the configuration difference information includes information of a configuration file path, an original operating system, a target operating system, a processor architecture, a configuration file group, a first default configuration value, a second default configuration value, an original configuration value, whether a first difference exists, whether a second difference exists, whether the difference is synchronized, and the like. Wherein the profile path is an installation path of the first default profile and the second default profile.
When generating the configuration difference information, a setting interface of the configuration difference information may be displayed, the generated configuration difference information may be displayed on the setting interface, and a user may set the configuration difference information through the setting interface.
The generation of configuration difference information is described in fig. 5 according to the configuration file, the first default configuration file and the second default configuration file of the electronic device under the original operating system.
And 204, generating a target configuration file and a configuration file synchronization script according to the configuration description file, the configuration difference information and the second default configuration file.
Script (Script) is an executable file written in accordance with a certain format using a specific descriptive language. The profile synchronization script is a script for synchronizing a profile.
After the electronic equipment generates the target configuration file and the configuration file synchronization script, copying the target configuration file and the configuration file synchronization script to a preset position for carrying out configuration file synchronization after the electronic equipment changes an operating system and reinstallates software. The preset location may be other electronic devices, cloud end, etc.
The specific process of generating the target profile and the profile synchronization script from the profile, the configuration difference information and the second default profile may be referred to as detailed description in fig. 7 below.
And 205, synchronizing the configuration file of the electronic equipment under the target operating system according to the target configuration file and the configuration file synchronization script.
After the electronic equipment is changed from the original operating system to the target operating system, the electronic equipment executes a configuration file synchronization script, and synchronizes the configuration file of the electronic equipment under the target operating system according to the target configuration file.
By executing the configuration file synchronization script to synchronize the configuration file of the electronic device under the target operating system, the efficiency of the configuration file synchronization can be improved.
In other embodiments of the present application, the electronic device may generate the target configuration file without generating the configuration file synchronization script, and synchronize the configuration file of the electronic device under the target operating system according to the target configuration file.
According to the configuration file synchronization method provided by the embodiment of the application, the configuration files can be synchronized when the operating system is changed (changed from the original operating system to the target operating system), so that the efficiency of redeploying the software is improved. The configuration file synchronization method supports the identification of configuration files of various software under an operating system, does not need to specifically identify the software, and has universality for different software. The configuration file synchronization method can analyze the configuration file changed under the original operating system, does not need manual investigation, reduces the workload and prevents analysis omission. The configuration file synchronization method can realize batch synchronization configuration, improves configuration synchronization efficiency, and reduces error probability of manual synchronization configuration.
In the case that the electronic device includes a plurality of operating systems, according to the configuration file synchronization method provided by the embodiment of the application, the configuration file synchronization can be performed on each operating system.
Fig. 4 is a detailed flowchart of acquiring a configuration file according to an embodiment of the present application. Specifically, fig. 4 is a detailed flowchart of step 201 in fig. 2 and 3.
401, obtaining a first full software package of an original operating system and a second full software package of a target operating system.
The first full software package of the original operating system is all software packages provided for the original operating system, and the second full software package of the target operating system is all software packages provided for the target operating system.
The electronic device can acquire the first full-quantity software package and the second full-quantity software package through a preset command.
The electronic device may obtain a first full-volume software package and a second full-volume software package from the original operating system and the target operating system's web, respectively.
The first full-scale software package and the second full-scale software package each include a plurality of software packages. One for each software package.
The software corresponding to the first full-scale software package and the second full-scale software package may be the same. For example, the first full-scale software package and the second full-scale software package each include software packages of software a, software B, software C, software D, and software E.
The software corresponding to the first full-scale software package and the second full-scale software package may also be different. For example, the first full-scale software package includes software packages of software a, software B, software C, software D, and software E, and the second full-scale software package includes software packages of software a, software B, software C, software D, software E, software F, and software G.
The first full software package and the second full software package are decompressed 402.
Decompressing the first full-scale software package and the second full-scale software package includes decompressing each of the first full-scale software package and the second full-scale software package.
For example, the first full-scale software package and the second full-scale software package each include software packages of software a, software B, software C, software D, and software E, and the software packages of software a, software B, software C, software D, and software E in the first full-scale software package and the software packages of software a, software B, software C, software D, and software E in the second full-scale software package are decompressed respectively.
403, searching a first default configuration file from the files obtained by decompressing the first full-quantity software package, and searching a second default configuration file from the files obtained by decompressing the second full-quantity software package.
The configuration file may be looked up from the decompressed file according to the file type of the configuration file. For example, the configuration file may include types of. Ini,. Json,. Xml,. Yaml,. List,. Kv, etc.
The text file may be looked up from the decompressed file and the configuration file may be looked up from the looked up text file. Searching text files from the decompressed files and searching configuration files from the searched text files can improve the efficiency of searching the configuration files.
And 404, writing configuration description information corresponding to the first default configuration file and the second default configuration file into the configuration description file, and copying the first default configuration file and the second default configuration file to the appointed directory.
In one embodiment of the present application, the configuration description information may include a profile genus, a profile path, a profile type, a profile parsing rule, a profile synchronization rule.
The format of the configuration description file is not limited in this application, and may be, for example, a json file, an xml file, or the like.
And 405, after the first full-quantity software package and the second full-quantity software package are processed, acquiring a first default configuration file and a second default configuration file from the appointed directory, and packaging the first default configuration file and the second default configuration file into resource files.
The first default configuration file and the second default configuration file are acquired, and the generation of the configuration description file is a preprocessing stage of configuration file synchronization, and the step can be executed on electronic equipment needing configuration file synchronization or other equipment. For example, the configuration file synchronization method can be executed on a server, and the server can acquire corresponding first default configuration files and second default configuration files aiming at different processor architectures, different original operating systems and target operating systems, generate corresponding configuration description files and can realize configuration file synchronization according to different situations.
Fig. 5 is a schematic diagram of a plurality of configuration files provided in an embodiment of the present application. Specifically, fig. 5 is a schematic diagram of step 201 in fig. 2 and 3.
As shown in fig. 5, the original operating system and the target operating system include software A, B, C …, the configuration files of software a include aa.conf, ab.ini, ac.xml, the configuration files of software B include ba.conf, bb.kv, bc.json, and the configuration files of software C include ca.xml, cb.ini, cc.kv. The default configuration files (first default configuration file and second default configuration file) are obtained from the files of the software A, B, C …, and a configuration description file is generated.
In fig. 5, the configuration description information in the configuration description file includes a configuration file genus group, a configuration file path, a configuration file type, a configuration file parsing rule, and a configuration file synchronization rule.
Fig. 6 is a detailed flowchart of generating configuration difference information based on a configuration file according to an embodiment of the present application. Specifically, fig. 6 is a detailed flowchart of 203 in fig. 2 and 3.
And 601, comparing the first default configuration file with the second default configuration file according to the configuration description file to obtain a first difference.
Comparing the first default configuration file with the second default configuration file may include determining whether additional, deleted, and modified configuration items exist in the second default configuration file. The newly added, deleted and modified configuration items in the second default configuration file may be marked.
And 602, comparing the first default configuration file with the configuration file of the electronic device under the original operating system according to the configuration description file to obtain a second difference.
Comparing the first default configuration file with the configuration file of the electronic device under the original operating system can comprise judging whether the configuration file of the electronic device under the original operating system exists a new configuration file or a deleted configuration file, and judging whether the configuration file of the electronic device under the original operating system exists a new configuration item, a deleted configuration item and a modified configuration item. The configuration files added or deleted in the configuration files of the electronic equipment under the original operating system and the configuration items added, deleted and modified in the configuration files of the electronic equipment under the original operating system can be marked.
And 603, generating configuration difference information according to the first difference and the second difference.
The configuration difference information records the first difference and the second difference, such as newly added, deleted and modified configuration items in a second default configuration file, newly added or deleted configuration files in the configuration files of the electronic device under the original operating system, and newly added, deleted and modified configuration items in the configuration files of the electronic device under the original operating system.
Fig. 7 is a schematic diagram of configuration difference information provided in an embodiment of the present application. Specifically, fig. 7 is a schematic diagram of 203 in fig. 2 and 3.
As shown in fig. 7, the configuration difference information includes a configuration file path, an original operating system, a target operating system, a processor architecture, a configuration file group, a first default configuration value, a second default configuration value, an original configuration value, whether a first difference exists, whether a second difference exists, and whether the differences are synchronized.
FIG. 8 is a detailed flow chart of a generation target profile and profile synchronization script provided by an embodiment of the present application. Specifically, fig. 8 is a detailed flowchart of 204 in fig. 2 and 3.
801, reading configuration difference information, a configuration description file and a second default configuration file.
802, for each difference item in the configuration difference information, if the difference item represents deleting the configuration file, generating a deleting script.
803, if the difference item represents the newly added configuration file, copying the newly added configuration file to obtain a target configuration file, and generating a copy script.
804, if the difference item represents adding, modifying or deleting the configuration item, modifying the second default configuration file according to the configuration description file, and generating a copy script.
Fig. 9 is a schematic diagram of a target configuration file and a configuration file synchronization script provided in an embodiment of the present application. Specifically, fig. 9 is a schematic diagram of 204 in fig. 2 and 3.
As shown in fig. 9, the target profile and the profile synchronization script are generated from the profile, the configuration difference information, and the second default profile.
When the first default configuration file and the second default configuration file are acquired, in addition to packaging the first default configuration file and the second default configuration file, data in the first default configuration file and the second default configuration file can be stored in a structured manner, for example, the data in the first default configuration file and the second default configuration file are stored in a configuration database. The configuration database may be SQLite, mySQL or a custom database.
Fig. 10 is a schematic diagram of structured storage of profile data according to an embodiment of the present application. Specifically, fig. 10 is a schematic diagram of structured storage of data in a first default configuration file and a second default configuration file. As shown in fig. 10, the original operating system and the target operating system include software A, B, C …, the configuration files of software a include aa.conf, ab.ini, ac.xml, the configuration files of software B include ba.conf, bb.kv, bc.json, and the configuration files of software C include ca.xml, cb.ini, cc.kv. The data in the configuration file of the software A, B, C … is stored to a configuration database.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application. Optionally, the electronic device 1100 shown in fig. 9 is used to perform the methods shown in fig. 2, 3, 4, 6, and 8.
The electronic device 1100 comprises at least one processor 1101, a memory 1102, and at least one network interface 1103.
The processor 1101 is, for example, a general purpose central processing unit (central processing unit, CPU), a network processor (network processer, NP), a graphics processor (graphics processing unit, GPU), a neural-network processor (neural-network processing units, NPU), a data processing unit (data processing unit, DPU), a microprocessor, or one or more integrated circuits for implementing the aspects of the present application. For example, the processor 1101 includes an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. PLDs are, for example, complex programmable logic devices (complex programmable logic device, CPLD), field-programmable gate arrays (field-programmable gate array, FPGA), general-purpose array logic (generic array logic, GAL), or any combination thereof.
The Memory 1102 is, for example, but not limited to, a read-only Memory (ROM) or other type of static storage device that can store static information and instructions, a random access Memory (random access Memory, RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only Memory (electrically erasable programmable read-only Memory, EEPROM), a compact disc read-only Memory (compact disc read-only Memory) or other optical disk storage, a compact disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium, or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and that can be accessed by a computer. Alternatively, the memory 1102 may exist separately and be connected to the processor 1101 by an internal connection 1104. Alternatively, the memory 1102 and the processor 1101 are integrated together.
The network interface 1103 uses any transceiver-like device for communicating with other apparatus or communication networks. The network interface 1103 includes, for example, at least one of a wired network interface or a wireless network interface. The wired network interface is, for example, an ethernet interface. The ethernet interface is, for example, an optical interface, an electrical interface, or a combination thereof. The wireless network interface is, for example, a wireless local area network (wireless local area networks, WLAN) interface, a cellular network interface, a combination thereof, or the like.
In some embodiments, processor 1101 includes one or more CPUs, such as CPU0 and CPU1 shown in fig. 11.
In some embodiments, the electronic device 1100 optionally includes multiple processors, such as processor 1101 and processor 1105 shown in fig. 11. Each of these processors is, for example, a single-core processor (single-CPU), and is, for example, a multi-core processor (multi-CPU). A processor herein may optionally refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In some embodiments, electronic device 1100 also includes internal connection 1104. The processor 1101, the memory 1102 and at least one network interface 1103 are connected by an internal connection 1104. Internal connections 1104 include pathways that communicate information between the components described above. Optionally, internal connection 1104 is a board or bus. Optionally, the internal connections 1104 are split into address buses, data buses, control buses, and the like.
In some embodiments, the electronic device 1100 also includes an input-output interface 1106. Input-output interface 1106 is connected to internal connection 1104.
Alternatively, the processor 1101 implements the method in the above embodiment by reading the program code 910 stored in the memory 1102, or the processor 1101 implements the method in the above embodiment by internally storing the program code. In the case where the processor 1101 implements the method in the above embodiment by reading the program code 910 stored in the memory 1102, the program code implementing the method provided in the embodiment of the present application is stored in the memory 1102.
For more details on the implementation of the above-described functions by the processor 1101, reference is made to the description of the previous method embodiments, which is not repeated here.
The present embodiment also provides a computer storage medium having stored therein computer instructions which, when executed on an electronic device, cause the electronic device to perform the above-described related method steps to implement the profile synchronization method in the above-described embodiments.
The present embodiment also provides a computer program product which, when run on an electronic device, causes the electronic device to perform the above-described related steps to implement the profile synchronization method in the above-described embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be specifically a chip, a component, or a module, and may include a processor and a memory connected to each other; the memory is used for storing computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the configuration file synchronization method in each method embodiment.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods provided above, and will not be described herein.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated unit may be stored in a readable storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present disclosure should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A method of profile synchronization, the method comprising:
acquiring a first default configuration file of an original operating system and a second default configuration file of a target operating system, and generating a configuration description file, wherein the configuration description file comprises configuration description information of the first default configuration file and the second default configuration file;
acquiring a configuration file of the electronic equipment under the original operating system;
generating configuration difference information according to the first default configuration file, the second default configuration file, the configuration file of the electronic device under the original operating system and the configuration description file, wherein the configuration difference information describes differences of the first default configuration file compared with the second default configuration file and the configuration file of the electronic device under the original operating system and whether the differences are synchronous or not;
Generating a target configuration file according to the second default configuration file, the configuration description file and the configuration difference information;
and synchronizing the configuration file of the electronic equipment under the target operating system according to the target configuration file.
2. The method for synchronizing configuration files according to claim 1, wherein the obtaining a first default configuration file of an original operating system and a second default configuration file of a target operating system, and generating the configuration description file comprises:
acquiring a first full-quantity software package of the original operating system and a second full-quantity software package of the target operating system;
decompressing the first full-scale software package and the second full-scale software package;
searching the first default configuration file from the files obtained by decompressing the first full-quantity software package, and searching the second default configuration file from the files obtained by decompressing the second full-quantity software package;
and writing configuration description information corresponding to the first default configuration file and the second default configuration file into the configuration description file.
3. The profile synchronization method of claim 2, wherein the searching for the first default profile from the file decompressed by the first full software package comprises:
Searching a text file from the file obtained by decompressing the first full software package;
and searching the first default configuration file from the text file according to a preset file type.
4. The profile synchronization method of claim 2, wherein the method further comprises:
and packaging the first default configuration file and the second default configuration file into a resource file.
5. The profile synchronization method of any one of claims 1-4, wherein the generating configuration difference information from the first default profile, the second default profile, the profile of the electronic device under the original operating system, and the profile description comprises:
comparing the first default configuration file with the second default configuration file according to the configuration description file to obtain a first difference;
comparing the first default configuration file with the configuration file of the electronic equipment under the original operating system according to the configuration description file to obtain a second difference;
and generating the configuration difference information according to the first difference and the second difference.
6. The profile synchronization method of any one of claims 1 to 5, wherein the method further comprises:
And generating a configuration file synchronization script according to the second default configuration file, the configuration description file and the configuration difference information.
7. The profile synchronization method of claim 6, wherein generating a target profile and a profile synchronization script based on the second default profile, the profile description, and the configuration difference information comprises:
reading the configuration difference information, the configuration description file and the second default configuration file;
for each difference item in the configuration difference information:
if the difference item represents the deletion configuration file, a deletion script is generated;
if the difference item represents the newly added configuration file, copying the newly added configuration file to generate a copy script;
and if the difference item represents a new added, modified or deleted configuration item, modifying the second default configuration file according to the configuration description file to generate a copy script.
8. The profile synchronization method of any one of claims 1-7, wherein the profile description information includes a profile genus group, a profile path, a profile type, a profile parsing rule, and a profile synchronization rule.
9. The profile synchronization method of any one of claims 1-8, wherein the configuration difference information comprises a profile path, an original operating system, a target operating system, a processor architecture, a profile genus, a first default configuration value, a second default configuration value, an original configuration value, whether a first difference exists, whether a second difference exists, whether a difference is synchronized.
10. A computer readable storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the profile synchronization method of any one of claims 1 to 9.
11. An electronic device comprising a processor and a memory for storing instructions, the processor for invoking the instructions in the memory to cause the electronic device to perform the profile synchronization method of any of claims 1-9.
12. A chip system, wherein the chip system is applied to an electronic device; the chip system comprises an interface circuit and a processor; the interface circuit and the processor are interconnected through a circuit; the interface circuit is used for receiving signals from the memory of the electronic device and sending signals to the processor, wherein the signals comprise computer instructions stored in the memory; when the processor executes the computer instructions, the system-on-chip performs the profile synchronization method of any one of claims 1 to 9.
CN202210979610.5A 2022-08-16 2022-08-16 Configuration file synchronization method and related equipment Pending CN117632223A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210979610.5A CN117632223A (en) 2022-08-16 2022-08-16 Configuration file synchronization method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210979610.5A CN117632223A (en) 2022-08-16 2022-08-16 Configuration file synchronization method and related equipment

Publications (1)

Publication Number Publication Date
CN117632223A true CN117632223A (en) 2024-03-01

Family

ID=90027423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210979610.5A Pending CN117632223A (en) 2022-08-16 2022-08-16 Configuration file synchronization method and related equipment

Country Status (1)

Country Link
CN (1) CN117632223A (en)

Similar Documents

Publication Publication Date Title
US8984516B2 (en) System and method for shared execution of mixed data flows
Ji et al. ispan: Parallel identification of strongly connected components with spanning trees
CN111339041A (en) File parsing and warehousing and file generating method and device
US8417688B2 (en) Converting two-tier resource mapping to one-tier resource mapping
CN111241177A (en) Data acquisition method, system and network equipment
CN112860730A (en) SQL statement processing method and device, electronic equipment and readable storage medium
CN111679860B (en) Distributed information processing method and device
CN105474177A (en) Distributed processing system, distributed processing device, distributed processing method, and distributed processing program
CN115599359A (en) Code generation method, device, equipment and medium
CA3094727C (en) Transaction processing method and system, and server
CN113051102A (en) File backup method, device, system, storage medium and computer equipment
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN111444148A (en) Data transmission method and device based on MapReduce
CN111090782A (en) Graph data storage method, device, equipment and storage medium
US9537941B2 (en) Method and system for verifying quality of server
CN117632223A (en) Configuration file synchronization method and related equipment
CN115455006A (en) Data processing method, data processing device, electronic device, and storage medium
US20150347402A1 (en) System and method for enabling a client system to generate file system operations on a file system data set using a virtual namespace
CN116074195A (en) Domain name synchronization method, service container, cluster, computing node and storage medium
CN113179332B (en) Method, electronic device and storage medium for acquiring configuration information
CN115016737A (en) Spark-based method and system for merging hive small files
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN113609092A (en) Method, system, terminal and storage medium for distributed storage docking of HDFS client
US11347765B2 (en) Data processing apparatus and data processing method
CN112231292A (en) File processing method and device, storage medium and computer equipment

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