CN112073218A - Network configuration file compatibility method, electronic equipment and storage medium - Google Patents

Network configuration file compatibility method, electronic equipment and storage medium Download PDF

Info

Publication number
CN112073218A
CN112073218A CN202010793945.9A CN202010793945A CN112073218A CN 112073218 A CN112073218 A CN 112073218A CN 202010793945 A CN202010793945 A CN 202010793945A CN 112073218 A CN112073218 A CN 112073218A
Authority
CN
China
Prior art keywords
data
configuration
block
data block
keyword
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
Application number
CN202010793945.9A
Other languages
Chinese (zh)
Other versions
CN112073218B (en
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.)
Fiberhome Telecommunication Technologies Co Ltd
Original Assignee
Fiberhome Telecommunication 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 Fiberhome Telecommunication Technologies Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202010793945.9A priority Critical patent/CN112073218B/en
Publication of CN112073218A publication Critical patent/CN112073218A/en
Application granted granted Critical
Publication of CN112073218B publication Critical patent/CN112073218B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of communication network management and discloses a network configuration file compatibility method, electronic equipment and a storage medium. The method comprises the following steps: calling a first configuration serialization block; acquiring a keyword corresponding to the first configuration serialization block; controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file; reading keywords of the data blocks in the network configuration file, and acquiring second configuration serialization blocks corresponding to the keywords through the keywords; and controlling the second configuration serialization block to read the data block corresponding to the keyword, so that the new version can use the network configuration file generated or exported by the old version, and the new version is compatible with the network configuration file generated by the old version, thereby improving the engineering operation and maintenance efficiency and the user experience.

Description

Network configuration file compatibility method, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communication network management technologies, and in particular, to a network configuration file compatibility method, an electronic device, and a storage medium.
Background
With the development of science and technology, the functional requirements of users on various types of software are continuously increased, so that the software versions are updated more and more frequently, wherein the network management software is used as a platform for providing basic management in the aspects of configuration, fault, performance and network user distribution of a network system, and the compatibility of a new version with a network configuration file generated by an old version needs to be maintained in frequent version replacement, so that the new version can rapidly and normally manage the existing communication network without reconstructing network configuration. A network profile, as used herein, is a logical abstraction of data for the communication network that the network management software manages.
The conventional method for keeping network configuration files compatible is to write configuration data into the network configuration files according to a certain serialization sequence of each type of configuration information, when the configuration data in the network configuration files are written into a new version, the configuration data need to be subjected to deserialization reading according to the serialization sequence when the files are written, and only when the serialization sequence and the deserialization sequence of the configuration data are the same, the configuration data in the configuration files can be correctly read. However, as the protocols of the network devices are continuously updated, so that the data structures of the new version and the old version are different, the configuration data can be read only when the serialization order and the deserialization order are the same, and the compatibility of the new version with the network configuration file generated by the old version cannot be realized.
Disclosure of Invention
Therefore, it is necessary to provide a network configuration file compatibility method, an electronic device, and a storage medium for solving the above technical problems, so that not only can the new version be compatible with the network configuration file generated by the old version, but also the engineering operation and maintenance efficiency can be improved.
In a first aspect, an embodiment of the present invention provides a network profile compatible method, which is applied to an electronic device, and the method includes:
calling a first configuration serialization block;
acquiring a keyword corresponding to the first configuration serialization block;
controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file;
reading keywords of a data block in the network configuration file, and acquiring a second configuration serialization block corresponding to the keywords through the keywords;
and controlling the second configuration serialization block to read the data block corresponding to the keyword.
In some embodiments, the method further comprises:
when a second configuration serialization block corresponding to the keyword is not obtained according to the keyword, storing a data block corresponding to the keyword into a configuration group to be processed;
and acquiring the data length of the data block corresponding to the keyword, and offsetting according to the data length so as to continuously read the network configuration file.
In some embodiments, the method further comprises:
and detecting whether a data block exists in the configuration group to be processed, and if so, writing the data block into a network configuration file.
In some embodiments, the data block includes a keyword, a data length, and a configuration body, and the controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file includes:
writing the keywords into the network configuration file, and acquiring the data length of the data block corresponding to the keywords according to the keywords;
writing the data length into the network configuration file, and acquiring a configuration text of the data block according to the data length;
and carrying out data serialization on the configuration text, and writing the serialized configuration text into the network configuration file.
In some embodiments, the controlling the second configured serialization block to read the data block corresponding to the key includes:
acquiring the data length corresponding to the data block according to the keyword, and reading the configuration text of the data block according to the data length;
and performing data deserialization on the configuration text.
In some embodiments, the method further comprises:
and when the data block needs to be added with a new data field, adding a sub key word for the new data field, and adding a sub data length according to the length of the new data field, so that the new data field is added into the configuration body of the data block as a sub data block.
In some embodiments, the method further comprises:
when the data block is written into the network configuration file, controlling a third configuration serialization block corresponding to the sub keyword to serialize a new data field of the sub data block, and adding the serialized new data field into a configuration text before serialization;
and when the data block is read from the network configuration file, controlling a fourth configuration serialization block corresponding to the sub keyword to deserialize a new data field of the sub data block, and adding the deserialized new data field into the deserialized configuration text.
In some embodiments, the method further comprises:
when the data block needs to delete a data field, configuring a deletion sub-keyword for the data field needing to be deleted, setting a deletion sub-data block with the data length of 0 according to the deletion sub-keyword, and adding the deletion sub-data block into a configuration body of the data block;
and when the data block is read from the network configuration file, acquiring the deleted data field in the data block according to the deletion keyword.
In a second aspect, an embodiment of the present invention further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the network profile compatible method described above.
In a third aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, where the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by an electronic device, the electronic device is caused to execute the above network profile compatibility method.
Compared with the prior art, the invention has the beneficial effects that: different from the situation in the prior art, the network configuration file compatibility method, the electronic device and the storage medium in the embodiments of the present invention obtain the keyword corresponding to the first configuration serialization block by calling the first configuration serialization block when the new version writes the network configuration generated or derived from the old version into the network configuration file, and after obtaining the keyword, each data block can be written into the network configuration file only by using the specific configuration serialization block. Therefore, a first configuration serialization block corresponding to the keyword is obtained according to the keyword, and after the first configuration serialization block is obtained, the first configuration serialization block is controlled to write the data block corresponding to the keyword into a network configuration file. When configuration data is read from a network configuration file, keywords of data blocks in the network configuration file are read, and each data block needs to be read only by a specific configuration serialization block, so that a second configuration serialization block corresponding to the keywords is obtained according to the keywords, and after the second configuration serialization block is obtained, the second configuration serialization block is controlled to read the data block corresponding to the keywords, so that a new version can use a network configuration file generated or exported by an old version, the new version is compatible with the network configuration file generated by the old version, and the engineering operation and maintenance efficiency and the user experience are improved.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of an embodiment of a network profile compatibility method of the present invention applied to an electronic device;
FIG. 2 is a flow chart of an embodiment of writing data blocks to a network profile in a network profile compatible method for an electronic device according to the present invention;
FIG. 3 is a flow chart of an embodiment of the present invention applied to a network profile compatible method of an electronic device for reading data blocks from a network profile;
FIG. 4 is a schematic structural diagram of a network profile compatible device according to an embodiment of the present invention;
fig. 5 is a hardware configuration diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the invention. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. The terms "first", "second", "third", and the like used in the present invention do not limit data and execution order, but distinguish the same items or similar items having substantially the same function and action.
The invention provides a network configuration file compatibility method which is applied to electronic equipment, and the method is characterized in that keywords are set for data blocks, and the data blocks are read and written through configuration serialization blocks corresponding to the keywords, so that a new version can read an old version of a network configuration file, the new version is compatible with the network configuration file generated by the old version, and the engineering operation and maintenance efficiency and the user experience are improved.
It is understood that, in the present invention, the electronic device may be a desktop computer, a notebook computer, a tablet computer, or the like, which can be installed with software.
As shown in fig. 1, an embodiment of the present invention provides a network profile compatible method, which is applied to an electronic device, and the method includes:
step S101, a first configuration serialization block is called.
In the embodiment of the invention, the configuration serialization block is a code block which can be bound with the data block and write the data block into the network configuration file. Specifically, the first configuration serialization block may be bound with the key in the data block in advance, which facilitates subsequent writing of configuration data and reading of configuration data. The data block comprises keywords, data length and a configuration text. It should be noted that the first configuration serialization block and the second configuration serialization block described below are only defined for convenience of illustrating the present invention and are not meant to limit the present invention.
Step S102, obtaining a keyword corresponding to the first configuration serialization block.
Specifically, since the first configuration serialization block and the keyword are bound in advance, the keyword corresponding to the first configuration serialization block can be acquired after the first configuration serialization block is acquired. The method is convenient to distinguish from interference information in the binary stream, and can also set fixed length for keywords.
Step S103, controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file.
Because the data block containing the keyword needs a specific configuration serialization block to write the data block into the configuration file, after the keyword corresponding to the first configuration serialization block is obtained, the first configuration serialization block can be controlled to write the data block corresponding to the keyword into the network configuration file.
In some embodiments, as an implementation manner of step S103, as shown in fig. 2, the controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file includes:
step S201, writing the keyword into the network configuration file, and obtaining the data length of the data block corresponding to the keyword according to the keyword.
In order to identify and read the data blocks in the network configuration file when reading the network configuration file, the configuration serialization block needs to write a keyword into the network configuration file first when writing the data blocks into the network configuration file.
Step S202, writing the data length into the network configuration file, and acquiring the configuration text of the data block according to the data length.
After the data length of the data block is obtained, the data length is written into a network configuration file, after the data length is written, the configuration text of the data block needs to be written into the network configuration file, and the data block is written, so that the configuration text matched with the data length is obtained from the data block according to the data length.
And step S203, carrying out data serialization on the configuration text, and writing the serialized configuration text into the network configuration file.
After the configuration text matching the data length is read from the data block, since the format of the data in the network configuration file is a byte stream, before the configuration text is written into the network configuration file, the data format of the configuration text needs to be converted into a byte stream, that is, the data is serialized. Therefore, after the first configuration serialization block reads the configuration text from the data block, the first configuration serialization block converts the data format of the configuration text into a byte stream, and writes the configuration text into the network configuration file after the data format of the configuration text is converted into the byte stream, thereby completing the writing of the configuration data.
And step S104, reading keywords of the data blocks in the network configuration file, and acquiring a second configuration serialization block corresponding to the keywords through the keywords.
When the configuration data is read, the new version needs to read the configuration data from the network configuration file generated by the old version, so that when the new version receives the network configuration file generated by the old version, the new version reads the configuration data according to the sequence of the data blocks in the network configuration file. When reading the data block, a specific configuration serialization block is needed to read, and therefore, a configuration serialization block corresponding to the data block needs to be found first. Since the keywords corresponding to the data block are written into the network configuration file when the data block is written into the network configuration file, the second configuration serialization block corresponding to the keywords can be searched according to the keywords by obtaining the keywords corresponding to the data block.
In some other embodiments, due to the replacement of the old version and the new version, the second configuration serialization block capable of reading the data block in the old version does not exist in the new version, that is, the second configuration serialization block corresponding to the keyword cannot be found in the new version according to the keyword. Since each data block needs to be read by the corresponding configuration serialization block, when the second configuration serialization block capable of reading the data block is not found, the data block which cannot be successfully read is stored in the configuration group to be stored in order to maintain the integrity of the network configuration file.
Because the network configuration file has a large number of data blocks, when a data block which cannot be read normally appears, in order to enable the subsequent data block to be read normally, the data length of the data block is obtained according to the keywords by reading the keywords of the data block after the keywords are read, and the offset is carried out according to the obtained data length, so that the network configuration file is read continuously.
In some other embodiments, when writing the old version of the data block into the network configuration file, in addition to writing the data block in the old version into the network configuration file, the data block in the old version of the pending configuration group needs to be written into the network configuration file. And after writing each data block of the old version into a network configuration file, detecting whether the data block exists in the configuration group to be processed, and if the data block is stored in the configuration group to be processed, writing the data block into the network configuration file.
Step S105, controlling the second configuration serialization block to read the data block corresponding to the keyword.
After the second configuration serialization block is found according to the keyword, the second configuration serialization block can be directly controlled to read the data block corresponding to the keyword.
In some embodiments, as an implementation manner of step S105, as shown in fig. 3, the controlling the second configuration serialization block to read the data block corresponding to the key includes:
step S301, obtaining the data length corresponding to the data block according to the keyword, and reading the configuration text of the data block according to the data length.
After the keyword is read from the data blocks in the network configuration file, because each data block has a data length when being written into the network configuration file, the length of the data block is known only when being read, therefore, after the keyword is read, the data length of the data block corresponding to the keyword needs to be read first, and after the data length of the data block is obtained, the configuration text of the data block is completely read from the network configuration file according to the data length.
Step S302, performing data deserialization on the configuration text.
After the configuration text with the length matching the data length is read from the network configuration file, since the network configuration text converts the data format into the data format of the byte stream before writing into the configuration file, the data format of the configuration text needs to be converted into the data format of the configuration data, that is, deserialization of the data is performed, so that the configuration file generated by the old version can be read by the new version.
In other embodiments, new data fields may be added to data blocks of the old version when writing the data blocks to the network profile, since some new versions are only augmented on the basis of the old version at the time of version replacement.
Specifically, when a new data field needs to be added, in order to distinguish from data of an original data block, a sub-key needs to be added to the newly added new data field, and the new data field is identified as being newly added through the sub-key. And after the sub keywords are added, adding a subdata length according to the data field corresponding to the sub keywords, wherein the subdata length is used for marking the length of the new data field, and after the sub keywords and the subdata field are added, adding the new data field serving as a subdata block into a configuration body of the data block.
In other embodiments, after adding the newly added data field as a sub data block to the configuration text of the data block, when version replacement is required, the data block of the old version needs to be written into the network configuration file. When writing the old version of data block into a network configuration file, firstly searching a third configuration serialization block corresponding to the sub-keyword according to the sub-keyword, after the third configuration serialization block is found, acquiring the sub-data length of the sub-data block corresponding to the sub-keyword by the third configuration serialization block according to the sub-keyword, and acquiring the new data field according to the sub-data length, wherein the data format of the read new data field is configuration data, so that the data format of the new data field needs to be converted from configuration data into byte stream, that is, the new data field is serialized. And after the new data field is serialized, adding the new data field into the configuration body of the data block which is not serialized yet. After all the sub data blocks in the data block are serialized and added to the configuration text, the data block needs to be written into the network configuration file, and the process of writing the data block into the network configuration file is shown in fig. 2, which is not described herein again.
After the data block is written into a network configuration file, a keyword in the network configuration file is read, a second configuration serialization block corresponding to the keyword is obtained according to the keyword, and the data length corresponding to the keyword is obtained according to the keyword. After the data length is obtained, the second configuration serialization block obtains the configuration text of the data block according to the data length, and performs deserialization on the configuration text after the configuration text is obtained.
After deserializing the configuration text, acquiring sub-keywords of sub-data blocks in the data block, searching a fourth configuration serialization block corresponding to the sub-keywords according to the sub-keywords, after the fourth configuration serialization block is found, the fourth configuration serialization block acquires the sub data length of the sub data block corresponding to the sub keyword according to the sub keyword, and acquires a new data field in the sub data block according to the sub data length, since the data format of the new data field in the network configuration file is a byte stream, the fourth configuration serialization block converts the data format of the new data field from a byte stream into configuration data, namely, the new data field is deserialized, and the deserialized new data field is added into the configuration body of the deserialized data block, so that the new version can normally use the expanded function.
In other embodiments, when the version is replaced, a replaced data field may be added to the data block of the old version, and when the data block in the network configuration file is read to the new version, the added replaced data field replaces the original data field, so that the new version can use the replaced function. The flow of the replaced data field in writing and reading the network configuration file is consistent with the flow of the new data field, and is not described herein again.
When the deserialized replaced data field and the data block text are read to a new version, the original data field in the data block corresponding to the replaced data field is judged according to the sub-keywords of the replaced data field, the original data field is replaced by the replaced data field, and the data block is read to the new version after replacement, so that the new version can normally use the replaced functions.
In other embodiments, when the version is replaced, some old versions do not meet the requirements of the new version, and therefore, the data fields corresponding to the old versions need to be deleted. It should be noted that deleting the data field corresponding to the old version indicates that the data field is no longer used.
Specifically, when a data field needs to be deleted, a deletion subkey is configured for the field needing to be deleted, since the field needs to be deleted, the deletion subkey corresponds to a data length of 0, and after the data length is added, the deletion subkey is added to the configuration body of the data block, where the data length is 0. The flow of deleting the sub data block in writing the network configuration file and reading the sub data block from the network configuration file is consistent with the sub data block of the new data field, and is not described herein again.
When the deserialized data block text with the deleted sub data block is read to a new version, because the data length of the deleted sub data block is 0, the new version searches the data field which needs to be deleted and corresponds to the deleted sub key in the data block according to the deleted sub key of the deleted sub data block, so that the function corresponding to the deleted data field cannot be used in the new version.
Correspondingly, an embodiment of the present invention further provides a network profile compatible device, as shown in fig. 4, including:
a first calling module 402, configured to call a first configuration serialization block;
a first obtaining module 404, configured to obtain a keyword corresponding to the first configuration serialization block;
a first control module 406, configured to control the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file;
a second obtaining module 408, configured to read a keyword of a data block in the network configuration file, and obtain, through the keyword, a second configuration serialization block corresponding to the keyword;
a second control module 410, configured to control the second configuration serialization block to read the data block corresponding to the keyword.
According to the network configuration file compatible device provided by the embodiment of the invention, when the network configuration generated or exported by the old version is written into the network configuration file by the new version, the first configuration serialization block is called by the first calling module, then the keyword corresponding to the first configuration serialization block is obtained by the first obtaining module, and after the keyword is obtained, each data block can be written into the network configuration file only by the specific configuration serialization block. Therefore, the first configuration serialization block is controlled to write the data block corresponding to the keyword into the network configuration file through the first control module. When configuration data is read from a network configuration file, keywords of data blocks in the network configuration file are read, and each data block needs to be read only by a specific configuration serialization block, so that a second configuration serialization block corresponding to the keywords is obtained through a second obtaining module, and after the second configuration serialization block is obtained, the second configuration serialization block is controlled through a second control module to read the data block corresponding to the keywords, so that a new version can use a network configuration file generated or exported by an old version, the new version is compatible with the network configuration file generated by the old version, and therefore engineering operation and maintenance efficiency and user experience are improved.
It should be noted that the network profile compatible device can execute the network profile compatible method provided by the embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. For technical details that are not described in detail in the embodiments of the network profile compatible device, reference may be made to the network profile compatible method provided in the embodiments of the present invention.
Fig. 5 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention, where the hardware structure 100 of the electronic device includes:
one or more processors 101 and a memory 102, with one processor 101 being illustrated in fig. 5.
The processor 101 and the memory 102 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
Memory 102, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The processor 101 executes various functional applications and data processing of the electronic device, i.e., the network profile compatible method of the above-described method embodiments, by running the non-volatile software programs, instructions and modules stored in the memory 102.
The memory 102 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the POS machine, and the like. Further, the memory 102 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 102 may optionally include memory located remotely from processor 101, which may be connected to an electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the memory 102 and, when executed by the one or more processors, perform the network profile compatible methods described above as applied to embodiments of electronic devices.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Embodiments of the present application provide a non-transitory computer-readable storage medium storing computer-executable instructions, which are executed by one or more processors, such as the one processor 101 in fig. 5, to enable the one or more processors to perform the network profile compatibility method in any of the above method embodiments.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A network configuration file compatible method is applied to electronic equipment, and is characterized in that the method comprises the following steps:
calling a first configuration serialization block;
acquiring a keyword corresponding to the first configuration serialization block;
controlling the first configuration serialization block to write the data block corresponding to the keyword into a network configuration file;
reading keywords of a data block in the network configuration file, and acquiring a second configuration serialization block corresponding to the keywords through the keywords;
and controlling the second configuration serialization block to read the data block corresponding to the keyword.
2. The method of claim 1, further comprising:
when a second configuration serialization block corresponding to the keyword is not obtained according to the keyword, storing a data block corresponding to the keyword into a configuration group to be processed;
and acquiring the data length of the data block corresponding to the keyword, and offsetting according to the data length so as to continuously read the network configuration file.
3. The method of claim 2, further comprising:
and detecting whether a data block exists in the configuration group to be processed, and if so, writing the data block into a network configuration file.
4. The method of claim 1, wherein the data block comprises a key, a data length, and a configuration body, and the controlling the first configuration serialization block to write the data block corresponding to the key into a network configuration file comprises:
writing the keywords into the network configuration file, and acquiring the data length of the data block corresponding to the keywords according to the keywords;
writing the data length into the network configuration file, and acquiring a configuration text of the data block according to the data length;
and carrying out data serialization on the configuration text, and writing the serialized configuration text into the network configuration file.
5. The method of claim 1, wherein the controlling the second configured serialized block to read the data block corresponding to the key comprises:
acquiring the data length corresponding to the data block according to the keyword, and reading the configuration text of the data block according to the data length;
and performing data deserialization on the configuration text.
6. The method according to any one of claims 1-5, further comprising:
and when the data block needs to be added with a new data field, adding a sub key word for the new data field, and adding a sub data length according to the length of the new data field, so that the new data field is added into the configuration body of the data block as a sub data block.
7. The method of claim 6, further comprising:
when the data block is written into the network configuration file, controlling a third configuration serialization block corresponding to the sub keyword to serialize a new data field of the sub data block, and adding the serialized new data field into a configuration text before serialization;
and when the data block is read from the network configuration file, controlling a fourth configuration serialization block corresponding to the sub keyword to deserialize a new data field of the sub data block, and adding the deserialized new data field into the deserialized configuration text.
8. The method of claim 7, further comprising:
when the data block needs to delete a data field, configuring a deletion sub-keyword for the data field needing to be deleted, setting a deletion sub-data block with the data length of 0 according to the deletion sub-keyword, and adding the deletion sub-data block into a configuration body of the data block;
and when the data block is read from the network configuration file, acquiring the deleted data field in the data block according to the deletion keyword.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the network profile compatible method of any of claims 1-8.
10. A non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by an electronic device, cause the electronic device to perform the network profile compatible method of any one of claims 1-8.
CN202010793945.9A 2020-08-10 2020-08-10 Network configuration file compatible method, electronic equipment and storage medium Active CN112073218B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010793945.9A CN112073218B (en) 2020-08-10 2020-08-10 Network configuration file compatible method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010793945.9A CN112073218B (en) 2020-08-10 2020-08-10 Network configuration file compatible method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112073218A true CN112073218A (en) 2020-12-11
CN112073218B CN112073218B (en) 2022-05-31

Family

ID=73661010

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010793945.9A Active CN112073218B (en) 2020-08-10 2020-08-10 Network configuration file compatible method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112073218B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145315A1 (en) * 2002-01-23 2003-07-31 Tuomo Aro Exchange of data between components of distributed software having different versions of software
CA2419904A1 (en) * 2003-02-26 2004-08-26 Ibm Canada Limited - Ibm Canada Limitee Version-insensitive serialization and deserialization of program objects
CN101286881A (en) * 2008-05-16 2008-10-15 中兴通讯股份有限公司 Device for implementing multi-version compatibility of software configuration data of base station and application thereof
CN101902556A (en) * 2010-08-03 2010-12-01 福建新大陆通信科技股份有限公司 Data block partition positioning method for digital television set-top box
CN101976226A (en) * 2010-10-20 2011-02-16 青岛海信宽带多媒体技术有限公司 Data storage method
US20180314726A1 (en) * 2017-04-28 2018-11-01 Splunk Inc. Computing and replicating event deltas for mutable events in a distributed system
CN109743312A (en) * 2018-12-28 2019-05-10 北京五维星宇科技有限公司 A kind of data dynamic analysis method, system, terminal and the medium of configuration file
CN111506628A (en) * 2020-04-22 2020-08-07 中国民航信息网络股份有限公司 Data processing method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030145315A1 (en) * 2002-01-23 2003-07-31 Tuomo Aro Exchange of data between components of distributed software having different versions of software
CA2419904A1 (en) * 2003-02-26 2004-08-26 Ibm Canada Limited - Ibm Canada Limitee Version-insensitive serialization and deserialization of program objects
CN101286881A (en) * 2008-05-16 2008-10-15 中兴通讯股份有限公司 Device for implementing multi-version compatibility of software configuration data of base station and application thereof
CN101902556A (en) * 2010-08-03 2010-12-01 福建新大陆通信科技股份有限公司 Data block partition positioning method for digital television set-top box
CN101976226A (en) * 2010-10-20 2011-02-16 青岛海信宽带多媒体技术有限公司 Data storage method
US20180314726A1 (en) * 2017-04-28 2018-11-01 Splunk Inc. Computing and replicating event deltas for mutable events in a distributed system
CN109743312A (en) * 2018-12-28 2019-05-10 北京五维星宇科技有限公司 A kind of data dynamic analysis method, system, terminal and the medium of configuration file
CN111506628A (en) * 2020-04-22 2020-08-07 中国民航信息网络股份有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN112073218B (en) 2022-05-31

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
US8224874B2 (en) Systems and methods for removing unreferenced data segments from deduplicated data systems
EP3260993A1 (en) File operation method and device
CN109298873B (en) System upgrading method and device
CN111124288B (en) VPD storage management method, device, equipment and readable storage medium
EP1810154A2 (en) Flash file system management
CN107798063B (en) Snapshot processing method and snapshot processing device
CN112182010B (en) Dirty page refreshing method and device, storage medium and electronic equipment
KR20100088210A (en) Apparatus and method for downloadin contents using movinand in portable terminal
CN108037932B (en) SPI-NAND configuration file acquisition method and device
US8413132B2 (en) Techniques for resolving read-after-write (RAW) conflicts using backup area
CN103514004A (en) Method and device for managing system environment under Windows system
CN112925606A (en) Memory management method, device and equipment
CN106484691B (en) data storage method and device of mobile terminal
US9710337B1 (en) Systems and methods for restoring web parts in content management systems
CN107451070A (en) The processing method and server of a kind of data
CN112073218B (en) Network configuration file compatible method, electronic equipment and storage medium
CN114443598A (en) Data writing method and device, computer equipment and storage medium
CN116954906A (en) Node capacity expansion and contraction method, system, terminal and medium in graph database cluster
CN116610636A (en) Data processing method and device of file system, electronic equipment and storage medium
CN116301602A (en) Data recording or reading method and device, acquisition equipment, vehicle and medium
US8281096B1 (en) Systems and methods for creating snapshots
CN111562983B (en) Memory optimization method and device, electronic equipment and storage medium
CN113342270A (en) Volume unloading method and device and electronic equipment
CN109002343B (en) Method and device for realizing batch creation of virtual machines

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