CN115051904B - Method and device for managing single disk state based on markup language - Google Patents

Method and device for managing single disk state based on markup language Download PDF

Info

Publication number
CN115051904B
CN115051904B CN202210286883.1A CN202210286883A CN115051904B CN 115051904 B CN115051904 B CN 115051904B CN 202210286883 A CN202210286883 A CN 202210286883A CN 115051904 B CN115051904 B CN 115051904B
Authority
CN
China
Prior art keywords
state
control
data
disk
markup language
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210286883.1A
Other languages
Chinese (zh)
Other versions
CN115051904A (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
Wuhan Fiberhome Technical Services Co Ltd
Original Assignee
Fiberhome Telecommunication Technologies Co Ltd
Wuhan Fiberhome Technical Services 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, Wuhan Fiberhome Technical Services Co Ltd filed Critical Fiberhome Telecommunication Technologies Co Ltd
Priority to CN202210286883.1A priority Critical patent/CN115051904B/en
Publication of CN115051904A publication Critical patent/CN115051904A/en
Application granted granted Critical
Publication of CN115051904B publication Critical patent/CN115051904B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/02Standardisation; Integration
    • H04L41/0246Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols
    • H04L41/0266Exchanging or transporting network management information using the Internet; Embedding network management web servers in network elements; Web-services-based protocols using meta-data, objects or commands for formatting management information, e.g. using eXtensible markup language [XML]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present invention relates to the field of network management, and in particular, to a method and apparatus for managing a single disk state based on a markup language. Mainly comprises the following steps: dividing the state data of the single disk into at least one state block, and defining the state data in each state block as one or more markup language-based controls according to the type of the service model; writing all controls corresponding to the state data of the single disk into a state file according to the definition of the universal file format of the markup language; and reading the controls in the state file through the unified interface, and analyzing the content of the state blocks in each control according to the type of the business model corresponding to the control. The invention can unify the single-disk management background and the displayed data expression mode, unifies the management interface and the display interface of the single-disk state by using the markup language and the universal file format, so that the display mode is more friendly, and the development efficiency, the expandability and the portability are improved.

Description

Method and device for managing single disk state based on markup language
[ field of technology ]
The present invention relates to the field of network management, and in particular, to a method and apparatus for managing a single disk state based on a markup language.
[ background Art ]
In the process of maintenance and management of telecom network management, the state of a single disk needs to be checked frequently, for example: cross data state, protection group state, interface state, device operation state, etc.
Along with the increasing functions on the equipment, the requirements of customers on operation and maintenance are higher, the current common state display cannot meet the requirement of increasing the number of states corresponding to the current single-disk function, and the requirements that the display modes of various states required by the customers are unified and the locating is easy to find are not met. Meanwhile, the single-disk state needs to be read frequently when the related functions are developed in the background, for example, the protection switching state needs to be read when the current working path of the service is judged, the basic state of the port of the single disk is queried, and the single-disk state needs to be read in the background. At present, the single-disk states are all hard codes, the state values are directly read and written in a fixed data structure according to the function of each single disk, the background does not read the current disk state in a unified mode, the development efficiency is low, and the problem of error is easily caused.
Because the single-disk state expression and display on the network element of the network pipe are not uniform at present, when the single-disk state is newly added, each single-disk understands and defines the single-disk state according to own requirements, and the design logic of the single-disk state is not uniform, so that the definition and display of the single-disk state are not uniform, and quick positioning cannot be performed among different nodes. The network management background can also cause the single-disk state calculation logic to be complex, the logic multiplexing degree is low, the single-disk state calculation logic is not uniform, the logic multiplexing degree is low, and the expandability is poor.
In view of this, how to overcome the defects existing in the prior art, and solve the phenomenon that the single-disk state expression is not uniform at present, is a problem to be solved in the technical field.
[ invention ]
Aiming at the defects or improvement demands of the prior art, the invention solves the problems of non-uniform state expression and complex management caused by hard coding in the current single-disk state management.
The embodiment of the invention adopts the following technical scheme:
in a first aspect, the present invention provides a method for managing single disk states based on a markup language, which specifically includes: dividing the state data of the single disk into at least one state block, and defining the state data in each state block as one or more markup language-based controls according to the type of the service model; writing all controls corresponding to the state data of the single disk into a state file according to the definition of the universal file format of the markup language; and reading the controls in the state file through the unified interface, and analyzing the content of the state blocks in each control according to the type of the business model corresponding to the control.
Preferably, the state data in each state block is defined as one or more standard controls based on the markup language according to the type of the service model, and specifically includes: and acquiring the type of the control to be used for each service model type in the state block, and writing the single-disk state data of each service model type into the control according to the preset format of the corresponding control.
Preferably, the defining the state data in each state block as one or more standard controls based on markup language according to the type of the service model, further comprises: when the content of the state block corresponding to the control is associated with other state blocks, the jump link is used for writing the access address of the associated state block in the control.
Preferably, the method further comprises: analyzing the service model type content in the single-disk state data stream, and acquiring a control corresponding to each service model type; and analyzing the data of the single-disk state block according to the preset format of the control.
Preferably, acquiring a control corresponding to each service model type further includes: and acquiring a unique attribute name corresponding to each control according to the service model type, and searching the corresponding control according to the space access path and the data offset corresponding to the unique attribute name.
Preferably, the parsing of the content of the status block in each control is performed, and when the control is a form control, the method specifically includes: analyzing the header data content in the form control, and completing header filling according to the row number and the column number; and acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disk state data stream according to the data type corresponding to each cell.
Preferably, the parsing of the content of the state block in each control is performed, and when the control is a text control, the method specifically includes: reading a data stream from the text data offset in the single-disk state data stream according to the text data offset and the text data length in the text control, and reading data with the length of the text data length; and generating common character string text according to the read data.
Preferably, the parsing of the content of the state block in each control is performed, and when the control is an enumeration control, the method specifically includes: sequentially reading bytes of each enumeration data length from the enumeration data offset of the single-disk state data stream according to the enumeration data length and the enumeration data offset in the enumeration control, and acquiring all enumeration values; and searching the content corresponding to each enumeration value according to the enumeration interpretation.
Preferably, the parsing of the content of the status block in each control is performed, and when the control is a BOOL control, the method specifically includes: reading one byte of data in the single-disk state data stream according to BOOL data offset in the BOOL control; and searching the content corresponding to the read byte value in the BOOL interpretation.
On the other hand, the invention provides a device for managing single disk states based on a markup language, which specifically comprises: the method comprises the steps of connecting at least one processor with a memory through a data bus, wherein the memory stores instructions executed by the at least one processor, and the instructions are used for completing the method for managing the single-disk state based on the markup language in the first aspect after being executed by the processor.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the method has the advantages that the state blocks in different single disks are uniformly managed by using the control of the markup language, the single-disk state values are transferred and displayed by using the state file of the universal file format, the single-disk management background and the displayed data expression mode are uniform, and the management interface and the display interface of the single-disk state are uniform by using the markup language and the universal file format, so that the display mode is more friendly, and the development efficiency, the expandability and the portability are improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings that are required to be used in the embodiments of the present invention will be briefly described below. It is evident that the drawings described below are only some embodiments of the present invention and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flowchart of a method for managing single disk states based on a markup language according to an embodiment of the present invention;
FIG. 2 is an example of a single disk state file structure provided by an embodiment of the present invention;
FIG. 3 is a schematic diagram of a system architecture for status value display according to the present invention;
FIG. 4 is an example of state value content used by the control instance provided in the present invention;
FIG. 5 is an example of parameters of a control cache index provided in the present invention;
FIG. 6 is a principal parameter example of a form control provided in the present invention;
FIG. 7 is an example of data types of the primary parameters of the form control provided in the present invention;
FIG. 8 is a schematic diagram of an parsing flow of a form control provided in the present invention;
FIG. 9 is a primary parameter example of an enumeration control provided in the present invention;
FIG. 10 is a schematic diagram of an enumeration control resolution flow provided in the present invention;
FIG. 11 is a principal parameter example of a text control provided in the present invention;
FIG. 12 is a schematic diagram of a parsing flow for text controls provided in the present invention;
FIG. 13 is a main parameter example of a BOOL control provided in the present invention;
fig. 14 is a schematic diagram of an parsing flow of a BOOL control provided in the present invention;
FIG. 15 is a schematic diagram of a device for managing single-disk states based on a markup language according to an embodiment of the present invention;
wherein, the reference numerals are as follows:
11: a processor; 12: a memory.
[ detailed description ] of the invention
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The present invention is an architecture of a specific functional system, so that in a specific embodiment, functional logic relationships of each structural module are mainly described, and specific software and hardware implementations are not limited.
In addition, the technical features of the embodiments of the present invention described below may be combined with each other as long as they do not collide with each other. The invention will be described in detail below with reference to the drawings and examples.
Example 1:
markup language is a computer literal code that combines text with other information related to the text to reveal details about the structure of the document and the processing of the data. Compared with the common text description language, the markup language can contain original text information, and other information related to the text, such as the structure and the representation information of the text, and the like, can be combined with the original text through the markup so as to realize definition of semantics, structure and format of the electronic document. The markup of a markup language is generally easily distinguishable from content and easily identifiable. Common markup languages include hypertext markup language (Hyper Text Markup Language, abbreviated HTML), extensible markup language (Extensible Markup Language, abbreviated XML), resource description framework (Resource Description Framework, abbreviated RDF), and the like. The markup language typically has a corresponding file format, such as HTML language for HTML format files, XML language for XML format files, RDF language for RDF format files. Each language and corresponding file format may be read-written and otherwise processed according to standard definitions of the language and file format. For some specific tags, the corresponding entity content can be added, different display content such as text, graphics, animation, sound, tables, links and the like can be presented in the browser, or non-display data content such as buttons < button >, text display < label >, hyperlink < HTML > and the like in the HTML language can be saved, and the tags are called controls.
As shown in fig. 1, the method for managing single disk states based on a markup language according to the embodiment of the present invention specifically includes the following steps.
Step 101: the state data of the single disk is divided into at least one state block, and the state data in each state block is defined as one or more markup language-based controls according to the type of the service model.
In this embodiment, in order to unify the states of the single disks of various different service model types, a markup language is used to describe the states of the single disks. The control is a minimum processing unit for single-disk state analysis, the control is defined according to a service model of a single disk of a transmission network element, specific equipment types are not distinguished, and states of all single disks can be uniformly defined into a state file in a format corresponding to a label language through the control so as to realize a uniform expression method, a uniform display method, a uniform calculation method and a background uniform reading method. In implementations, each state block of a single disk may contain state data for a plurality of different traffic models, such as descriptive text, selectable state lists, forwarding tables, switch states, and the like. For each different service model, different types of controls in the markup language can be used for presenting according to the organization characteristics of the data, the type of the control needed to be used by each service model type in the state block is obtained, and single-disk state data of each service model type are written into the control according to the preset format of the corresponding control. For example, a single disk base state block is defined by enumeration, text, and a BOOL control; the matrix-type variable-length states of the protection group state, the cross state and the forwarding table are defined through the table control; the data of fixed items such as port state, device information state and the like are defined by a table control of the fixed items. In order to adapt to different use scenes and user demands, a custom control can be used on the basis of a general control, or an existing control can be adjusted to adapt to the demands of certain special scenes, so that the use range of the method provided by the embodiment is improved. The data structure used in the control can be a basic data type contained in the markup language, and can also use a custom data type according to the requirement.
Step 102: and writing all controls corresponding to the state data of the single disk into the state file according to the definition of the universal file format of the markup language.
In order to save and exchange data of the single-disk state, after the state block is defined by the control, the content of the control needs to be organized and saved by using a file format corresponding to the label language. In order to facilitate management and searching, all controls corresponding to all state blocks in each single disk are written into the same state file.
In order to improve the versatility of different platforms, the file format uses a general file format corresponding to the markup language, for example, HTML language. Because a certain state block may contain a plurality of labels, and each single disk may contain a plurality of state blocks, in order to correspond a service model and a control, all service model types and control types may be defined in a state file of the whole single disk, and one service model corresponds to one control type. As shown in fig. 2, a typical example of a state file structure is that the state file contains the overall display content and format file of each single disk, including service model type, control link information, format control link information, and the like. Because the markup language can support multi-layer nesting of labels, each control label can contain various business attribute information of the business model, in the example shown in fig. 2, each control contains the attribute information of the business model type, the control link and the data start bit of the control, and other description and formatting contents can be added as required. When the content of the state block corresponding to the control is associated with other state blocks, the jump link is used for writing the access address of the associated state block in the control. The jump link comprises a state file access path and a state file name of a corresponding control of the associated state block, and can also comprise a unique attribute name or positioning information in the state file such as an offset in the file, so that quick jump searching is facilitated. Additional format definitions, file descriptions, etc. may also be added to accommodate different usage scenarios and to increase the readability of the status file.
Both new and write modes can be used for the state file. And for a single disk which does not generate a state file, using a new mode to directly organize all the controls needing to be written into the file according to a file format to generate a new state file. For a single disk of an existing state file, after the state value is changed, a writing mode is used, a corresponding control can be found, the content in the control can be updated according to the latest state data, the updated control is placed in the position of the original control or a new position designated by parameters, and the influence on reading and writing of other controls and the change of a display interface are avoided as much as possible. In specific implementation, the value of each control in the state file can be obtained by reading the single-disk state data stream, so that the current state of the single disk is obtained; the method can also be directly written through a unified interface, used as a configuration file of a single disk, and used for reconfiguring a state block corresponding to the control by using the latest state data in the file.
Step 103: and reading the controls in the state file through the unified interface, and analyzing the content of the state blocks in each control according to the type of the business model corresponding to the control.
For the state file of the single disk, the system architecture shown in fig. 3 can be used, the state value display can be directly performed through a general browser, the state file can also be used as intermediate data of single disk control, and external modules such as state data uploading, service module management, state data display and the like process the data in the turn file by utilizing a unified single disk state management interface. When the state file is used as intermediate data, one or more controls in the file can be read as required, and the state data stored in the file can be obtained through analysis.
In order to acquire the state data corresponding to the service model, firstly, the service model type content in the single-disk state data stream is required to be analyzed, the service model type and control type information in the state file are read, the control corresponding to each service model type is acquired, then the data of the single-disk state block is analyzed according to the preset format of the control, the corresponding state data is returned according to the requirement, then the state of the single disk is judged through the state data, or the state of the single disk is reset according to the updated content in the state file. Furthermore, in order to facilitate identification and analysis, in the single-disk state data stream, a fixed format can be used for acquiring the service model type content carried in the header of the single-disk state data stream, including the type of each service model, the starting position of the service model, the length content of the whole data of the service model, and the like, and through the analysis parameters, the storage position and the storage space size of each control in the state file can be directly acquired, so that the positioning, the reading and the writing of the file reading and writing instructions can be conveniently performed.
In the embodiment, the file with the standard format and the unified control are used for defining the same state blocks of the service model, so that the single-disk type does not need to be distinguished when the control is analyzed, and only a unified reading interface and an analysis algorithm are used for acquiring data aiming at the service model, thereby avoiding the problems of non-uniform and more quantity of the existing interface writing specialized interface calling modes according to the single-disk characteristics. In a specific use, according to actual needs, the state acquisition interface may include: an interface for acquiring the whole state data of a single disk, an interface for acquiring the state data of a certain service model in the single disk, an interface for acquiring the state data of specific attributes under a certain service model of the single disk, and the like. An interface for a certain set of traffic patterns may also be provided, or a custom interface may be provided, as desired. After the state block is parsed, the interface returns the single-disk ID where the state block is located, the service model type, and the attribute and data content of the state block itself. As shown in fig. 4, taking a common form control, enumeration control, text control and BOOL control as examples, specific contents of the return state value after analysis are provided, and other controls can select corresponding return value contents according to control characteristics and business characteristics.
After steps 101-103 provided in this embodiment, unification of single-disk state data storage, display and acquisition is completed through unified controls and standard file formats based on a markup language, unified expression and processing of single-disk states are solved, friendly display under different application scenes is realized, and development efficiency is improved. In an actual implementation process, step 102 and step 103 may be used alternatively, simultaneously or sequentially to meet different usage requirements of state data storage, display, acquisition, update, etc.
In the present embodiment, the markup language used is preferably HTML language. HTML, which is known as hypertext markup language, is a markup language, and the latest version is HTML5, and in specific use, an appropriate language version can be selected according to stability, compatibility and subsequent upgrading requirements. In practical use, HTML format files corresponding to HTML language can be directly analyzed and displayed by a general browser, for example, the switch state is directly displayed by using the selected state of a selection control < select >, and no additional display interface or additional client is required to be installed, so that the complexity of development and user use is simplified, and the response speed of a program is improved. On the other hand, the HTML language is a language commonly used in a network transmission environment, and the corresponding HTML format file can be efficiently transmitted through a network, so that remote status reading, writing and management of a single disk in network equipment are also facilitated through the network.
In order to accelerate the reading and writing speed of the file, a template file can be established for a single disk of each service model type, and the template file is imported into a cache. When reading and writing, the state numerical value is filled in the storage position of the corresponding control in the cache only according to the service model type, and then the whole template file filled with the data is written in the file.
In this embodiment, the control is used as an organization unit for single-disk state management, and because the control is defined according to the service model, different configuration blocks are defined in different manners, in order to facilitate management and searching of the control, a unique attribute name can be used to distinguish the control corresponding to each state block, and a control index is established for the corresponding relation between the service model and the control in the cache, so that the corresponding control can be conveniently searched through the type of the service model. The unique attribute name is not repeated in each configuration block, and can be named or numbered uniformly according to the characteristics of the control cross state, the port state, the software version number and the like. Specifically, the control index may include: single disk ID, service model type, unique attribute name of control, control type, etc. In order to perform subsequent operations on the control content according to specific requirements, attribute parameters of the control can be saved, so that the read-write interface can directly use the corresponding parameters to analyze and write the content. In implementations, a cache index may be established for each control using parameters as shown in FIG. 5.
On the other hand, when updating the state file, the control needs to be parsed to acquire the control needing content replacement and the writing position of the latest state data. And acquiring a state file corresponding to the single disk according to the single disk id, analyzing the service model type content in the fixed header format in the single disk state data stream, finding out a corresponding control according to the service model type, and analyzing the specific content in the state data through an analysis algorithm of the corresponding control. Specifically, a unique attribute name corresponding to each control is obtained according to the service model type, and the corresponding control is searched according to a space access path and data offset corresponding to the unique attribute name.
According to the method for managing the single-disk state based on the markup language, unified controls are defined for each service model type, and single-disk state files of a certain type of single disk are defined through the controls, so that unified management of a single-disk state data structure and read-write analysis interfaces are achieved, and the problems that hard coding is used during current single-disk state management, the read-write interfaces are complex and the number of the read-write interfaces is large, and the use and secondary development are inconvenient are solved. By using the method provided by the embodiment, the final single-disk state data can be generated through calculation of a background unified data analysis algorithm, and a background access interface for unified call is provided based on unified format content in the control, so that unified definition, unified calculation and unified reading of the single-disk state are ensured. By the method, a developer can rapidly define the state of a new single disk with uniform expression format and display format, conveniently perform custom expansion on the control based on the characteristics of the markup language, correlate the content through jump links, and improve the data readability. Based on the method, a background service module reads the wanted content through a unified interface, so that the development efficiency of the service module is improved, and the coupling degree of the module is reduced; and meanwhile, based on the method, unified controls, state contents of the single disk and a background access interface can be rapidly defined, and the development period of the new single disk state is greatly shortened.
Example 2:
for the method for single disk state management based on markup language provided in embodiment 1, some common control examples are provided in this embodiment. In specific implementations, the examples provided in this embodiment may be used directly as needed, or other basic controls in the markup language, or custom controls may be used with reference to these examples.
(1) Form controls.
The method is mainly used for defining the contents of a plurality of items such as complex, matrix type, table format and the like, controls and labels such as < table >, < tbody >, < td > and the like in an HTML language can be used as specific implementation modes, controls and labels with corresponding functions in other languages can be used, or custom labels can be used as specific implementation modes.
The main parameters of the form control are shown in fig. 6, and include header data, form data type, form data content, content entry number start position, and the like. Wherein, the row number and the column number represent the specific format position relation of the subsequent analysis content, and part of logic is used as the row-column corresponding logic relation; the content item number start position and the item length are used to locate the content in each cell when read.
In actual use, either a fixed entry tablespace or a non-fixed entry tablespace may be used for different needs. The table control of the fixed item needs to define parameters of all cells in the table data type, the table data content and the table head data, and the parameters are directly positioned to the cells needing to be read and written when the table control is used; the table control of the non-fixed entry only needs to define the table data type of a row of tables to represent parameters such as analysis parameters, table data content, header data and the like of each type. The main parameters of the specific data types of the table may be shown with reference to fig. 7, including data type, representation type of data content, data length, display format, interpretation content, etc.
When the table control is analyzed, the header data content in the table control is analyzed first, and header filling is completed according to the row number and the column number. And acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disk state data stream according to the data type corresponding to each cell.
Specifically, as shown in fig. 8, the analysis may be completed using the following steps.
Step 201: and analyzing the header data content in the form control, and completing form filling according to the line number and the column number.
Step 202: and reading parameters of data content of the data type in the form control, generating a corresponding relation according to the row number and the column number, and corresponding the content with the same row number and column number.
Step 203: judging whether the table control is a fixed entry or not according to the initial position of the entry number. If not, go to step 204; if yes, go to step 205.
Step 204: and acquiring relevant data of all parameters in the single-disk state data stream according to the item, the item length and the first line starting position, and turning to step 205.
Step 205: a data type dependent parameter is determined based on the data type of each entry.
Step 206: and reading the content of each entry corresponding to the length from which the data offset starts in the single-disk state data stream according to the type, the length and the data offset in the data content of the data type.
Step 207: and acquiring the state content corresponding to the item according to the data type. Specifically, if the display type is the int type, directly converting the display type into the int type data, and displaying the int type data according to a system appointed by the display type parameter; if the data is string type data, the data is directly read and displayed as a common text; if the enumeration type or the BOOL type is adopted, the corresponding interpretation text is required to be searched in the enumeration interpretation content to obtain the final display text.
(2) Enumeration control
The method is mainly used for defining the global clock source, working mode state and other contents with a plurality of parallel options in a single disk, controls and labels such as < fieldset > < ul > < ol > in an HTML language can be used as specific implementation modes, controls and labels with corresponding functions in other languages can be used, or custom labels can be used as specific implementation modes.
The main parameters of the enumeration control are as shown in fig. 9, including: enumerating default content, content length, content offset, enumerating interpretations, etc. The content offset represents the offset of each enumerated content item relative to the start address of the control, and enumeration interpretation defines the front-end display content of each enumerated item.
When the enumeration control is analyzed, firstly, according to the enumeration data length and the enumeration data offset in the enumeration control, sequentially reading bytes of each enumeration data length from the enumeration data offset of the single-disk state data stream, and obtaining all enumeration values. And searching the content corresponding to each enumeration value according to the enumeration interpretation.
Specifically, as shown in fig. 10, the analysis may be completed using the following steps.
Step 301: reading parameters such as data length, offset, default content, enumeration interpretation and the like in the enumeration control.
Step 302: and reading the data in the single-disk state data stream according to the data length by the data offset, and starting to read bytes of the data length from the data offset of the single-disk state data stream to finish the reading of the enumeration value.
Step 303: and traversing and searching the corresponding enumeration explanation in the enumeration explanation list according to the enumeration value.
Step 304: the state content is obtained according to the enumeration interpretation. Specifically, if a corresponding enumeration explanation is found, directly using the content in the explanation text; if no corresponding enumeration explanation is found, the default text content is directly displayed. This step may be omitted in a scene that does not need to be displayed.
(3) A text control.
The method is mainly used for defining the text contents such as time and version in a single disk, controls and labels such as < label > < textarea > < ins > in an HTML language can be used as specific implementation modes, controls and labels with corresponding functions in other languages can be used, or custom labels are used as specific implementation modes.
The main parameters of the text control are as shown in fig. 11, including: text type, data length, data offset. The text type represents the data type represented by characters in the text, such as common text, time text and the like.
When the text control is analyzed, firstly, according to the text data offset and the text data length in the enumeration control, reading a data stream from the text data offset in the single-disk state data stream, and reading data with the length of the text data length; and generating a common character string text according to the read data.
Specifically, as shown in fig. 12, the analysis may be completed using the following steps.
Step 401: and reading the data analysis type, the data length and the data offset in the text control.
Step 402: and reading a data stream starting from the data offset in the single-disk state data stream, wherein the length of the read content is the data length.
Step 403: and analyzing according to the data analysis type parameter in the text control. Specifically, whether the content is time format content is judged, and if the content is time format content, the data is formatted into the time format content; if the content is not the time format content, the common character string text is directly generated.
(4) A BOOL control.
The method is mainly used for defining whether the global switch, the activation state and the like in the single disk can use the content which is logically represented or not, controls and labels such as < select > in the HTML language can be used as a specific implementation mode, whether the state is displayed through the selected state, controls and labels with corresponding functions in other languages can be used, or a custom label is used as a specific implementation mode.
The BOOL controls are shown primarily in FIG. 13 and include: BOOL interpretation and data migration. Since the data length of the BOOL value is fixed 1bit, there is no need to additionally use a data length parameter. Wherein, the BOOL interpretation represents the interpretation text corresponding to the BOOL values 0 and 1 respectively.
When the BOOL control is analyzed, one byte of data in the single-disk state data stream is read according to BOOL data offset in the BOOL control. And searching the content corresponding to the read byte value in the BOOL interpretation.
Specifically, as shown in fig. 14, the analysis may be completed using the following steps.
Step 501: reading the data offset and the BOOL interpretation parameters in the BOOL control.
Step 502: one byte of data in the single disk state data stream is read according to the data offset.
Step 503: and searching corresponding display content in the BOOL interpretation through the read BOOL value. For example, 0 is shown as inactive/not enabled/off, 1 is shown as active/enabled/on, etc.
For all types of controls and other types of controls, in a specific implementation, a service model may be stored in a state file by using a plurality of controls of the same or related types, and for these types of service models, all related controls need to be searched before analysis is performed, and then analysis is performed uniformly.
On the other hand, after the analysis is completed, the data obtained by the analysis can be filled in the corresponding position of the control cache for display or for other modules to call, or after all the data are processed, the content can be filled in the original position of the control in the state file for storage.
According to the specific example in the embodiment, no matter how the configuration type of the single disk is changed, the single disk state can be organized into a state block according to the service type, the state block is stored by using a corresponding control through a unified interface, and after the storage, the analysis is conveniently carried out through the control parameters and the unified interface, so that the method for managing the single disk state based on the markup language provided in the embodiment 1 is completed.
Example 3:
on the basis of the method for managing single disk states based on the markup language provided in the foregoing embodiments 1 to 2, the present invention further provides a device for managing single disk states based on the markup language, which is a schematic device architecture diagram of an embodiment of the present invention, and is shown in the drawing based on single disk state management of the markup language. The device for single disk state management based on the markup language of the present embodiment includes one or more processors 11 and a memory 12. In fig. 15, one processor 11 is taken as an example.
The processor 11 and the memory 12 may be connected by a bus or otherwise, for example in fig. 15.
The memory 12 is used as a non-volatile computer-readable storage medium for storing a non-volatile software program, a non-volatile computer-executable program, and a module as a single disk state management method based on a markup language as in embodiments 1 to 2. The processor 11 performs various functional applications and data processing of the device for single disk state management based on the markup language, that is, implements the method for single disk state management based on the markup language of embodiment 1 to embodiment 2, by running the nonvolatile software programs, instructions, and modules stored in the memory 12.
Memory 12 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 12 may optionally include memory located remotely from processor 11, which may be connected to processor 11 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 program instructions/modules are stored in the memory 12 and when executed by the one or more processors 11 perform the method of single disk state management based on a markup language in the above-described embodiments 1 to 2, for example, perform the respective steps shown in fig. 1, 8, etc. described above.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the embodiments may be implemented by a program that instructs associated hardware, the program may be stored on a computer readable storage medium, the storage medium may include: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (9)

1. A method for single disk state management based on a markup language, characterized in that:
dividing the single-disk state data into at least one state block, acquiring the type of a control to be used by each service model type in the state block, and writing the single-disk state data of each service model type into one or more controls based on a markup language according to a preset format of the corresponding control;
writing all controls corresponding to the state data of the single disk into a state file according to the definition of the universal file format of the markup language;
and reading the controls in the state file through the unified interface, and analyzing the content of the state blocks in each control according to the type of the business model corresponding to the control.
2. The method of claim 1, wherein defining the state data in each state block as one or more standard markup language-based controls according to the type of the business model, further comprises:
when the content of the state block corresponding to the control is associated with other state blocks, the jump link is used for writing the access address of the associated state block in the control.
3. The method of single disk state management based on markup language of claim 1, further comprising:
analyzing the service model type content in the single-disk state data stream, and acquiring a control corresponding to each service model type;
and analyzing the data of the single-disk state block according to the preset format of the control.
4. The method for managing single disk states based on markup language according to claim 3, wherein said obtaining a control corresponding to each service model type further comprises:
and acquiring a unique attribute name corresponding to each control according to the service model type, and searching the corresponding control according to the space access path and the data offset corresponding to the unique attribute name.
5. The method for managing single-disk states based on markup language according to claim 1, wherein the parsing the contents of the state blocks in each control, when the control is a form control, specifically comprises:
analyzing the header data content in the form control, and completing header filling according to the row number and the column number;
and acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disk state data stream according to the data type corresponding to each cell.
6. The method for managing single-disk states based on markup language according to claim 1, wherein the parsing the contents of the state blocks in each control, when the control is a text control, specifically comprises:
reading a data stream from the text data offset in the single-disk state data stream according to the text data offset and the text data length in the text control, and reading data with the length of the text data length;
and generating common character string text according to the read data.
7. The method for managing single-disk states based on markup language according to claim 1, wherein the parsing the contents of the state blocks in each control, when the control is an enumeration control, specifically comprises:
sequentially reading bytes of each enumeration data length from the enumeration data offset of the single-disk state data stream according to the enumeration data length and the enumeration data offset in the enumeration control, and acquiring all enumeration values;
and searching the content corresponding to each enumeration value according to the enumeration interpretation.
8. The method for managing single-disk states based on markup language according to claim 1, wherein the parsing the contents of the state blocks in each control, when the control is a BOOL control, specifically comprises:
reading one byte of data in the single-disk state data stream according to BOOL data offset in the BOOL control;
and searching the content corresponding to the read byte value in the BOOL interpretation.
9. An apparatus for single disk state management based on a markup language, characterized in that:
comprising at least one processor and a memory connected by a data bus, the memory storing instructions for execution by the at least one processor, the instructions, when executed by the processor, for performing the method of markup language-based single disk state management of any one of claims 1-8.
CN202210286883.1A 2022-03-23 2022-03-23 Method and device for managing single disk state based on markup language Active CN115051904B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210286883.1A CN115051904B (en) 2022-03-23 2022-03-23 Method and device for managing single disk state based on markup language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210286883.1A CN115051904B (en) 2022-03-23 2022-03-23 Method and device for managing single disk state based on markup language

Publications (2)

Publication Number Publication Date
CN115051904A CN115051904A (en) 2022-09-13
CN115051904B true CN115051904B (en) 2023-09-12

Family

ID=83157208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210286883.1A Active CN115051904B (en) 2022-03-23 2022-03-23 Method and device for managing single disk state based on markup language

Country Status (1)

Country Link
CN (1) CN115051904B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6112235A (en) * 1995-06-07 2000-08-29 Spofford; Jason J. Method and apparatus for remotely managing a network hardware device having an embedded server with a client computer across a network
WO2005098666A1 (en) * 2004-04-08 2005-10-20 Justsystems Corporation Processing data and documents that use a markup language
CN101217406A (en) * 2008-01-15 2008-07-09 中兴通讯股份有限公司 Collocation data backup and recovery method
CN101876901A (en) * 2009-12-02 2010-11-03 烽火通信科技股份有限公司 Method for realizing single disk block state of webmaster by using extensible markup language (XML)
CN104268163A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Method and system for acquiring network management network element configuration interface
CN109510728A (en) * 2018-12-24 2019-03-22 成都天奥电子股份有限公司 The method that a kind of network management information library mib file is automatically converted into XML file
CN111488145A (en) * 2020-04-30 2020-08-04 国网河北省电力有限公司信息通信分公司 Micro-service code generation system and method based on service domain data model base
CN111711695A (en) * 2020-06-17 2020-09-25 池州市新晟电子科技有限公司 Distributed equipment management system based on cloud platform
CN112612535A (en) * 2020-12-07 2021-04-06 河南方达空间信息技术有限公司 XML and JSON based satellite receiving system network communication coding and decoding engine method
CN112764831A (en) * 2021-01-19 2021-05-07 中盈优创资讯科技有限公司 Configuration file analysis method and device based on user-defined extensible markup language
CN113609820A (en) * 2021-07-30 2021-11-05 中国平安财产保险股份有限公司 Method, device and equipment for generating word file based on extensible markup language file
CN113761082A (en) * 2021-09-10 2021-12-07 中国工商银行股份有限公司 Data visualization method, device and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040034833A1 (en) * 1999-11-12 2004-02-19 Panagiotis Kougiouris Dynamic interaction manager for markup language graphical user interface
US7096422B2 (en) * 2003-02-28 2006-08-22 Microsoft Corporation Markup language visual mapping
JP4553599B2 (en) * 2003-08-29 2010-09-29 コニカミノルタビジネステクノロジーズ株式会社 Data display system, data output apparatus, image forming apparatus, data display apparatus, and data display program
WO2006089392A1 (en) * 2005-02-22 2006-08-31 Nextair Corporation Determining operational status of a mobile device capable of executing server-side applications
US8700682B2 (en) * 2009-12-24 2014-04-15 Vertafore, Inc. Systems, methods and articles for template based generation of markup documents to access back office systems

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6112235A (en) * 1995-06-07 2000-08-29 Spofford; Jason J. Method and apparatus for remotely managing a network hardware device having an embedded server with a client computer across a network
WO2005098666A1 (en) * 2004-04-08 2005-10-20 Justsystems Corporation Processing data and documents that use a markup language
CN101217406A (en) * 2008-01-15 2008-07-09 中兴通讯股份有限公司 Collocation data backup and recovery method
CN101876901A (en) * 2009-12-02 2010-11-03 烽火通信科技股份有限公司 Method for realizing single disk block state of webmaster by using extensible markup language (XML)
CN104268163A (en) * 2014-09-05 2015-01-07 烽火通信科技股份有限公司 Method and system for acquiring network management network element configuration interface
CN109510728A (en) * 2018-12-24 2019-03-22 成都天奥电子股份有限公司 The method that a kind of network management information library mib file is automatically converted into XML file
CN111488145A (en) * 2020-04-30 2020-08-04 国网河北省电力有限公司信息通信分公司 Micro-service code generation system and method based on service domain data model base
CN111711695A (en) * 2020-06-17 2020-09-25 池州市新晟电子科技有限公司 Distributed equipment management system based on cloud platform
CN112612535A (en) * 2020-12-07 2021-04-06 河南方达空间信息技术有限公司 XML and JSON based satellite receiving system network communication coding and decoding engine method
CN112764831A (en) * 2021-01-19 2021-05-07 中盈优创资讯科技有限公司 Configuration file analysis method and device based on user-defined extensible markup language
CN113609820A (en) * 2021-07-30 2021-11-05 中国平安财产保险股份有限公司 Method, device and equipment for generating word file based on extensible markup language file
CN113761082A (en) * 2021-09-10 2021-12-07 中国工商银行股份有限公司 Data visualization method, device and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
数据网设备配置下发接口及应用;冯瑞军;魏丽红;刘涛;张晨;周文安;;北京邮电大学学报(S1);全文 *

Also Published As

Publication number Publication date
CN115051904A (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN106598612B (en) Operation method and system for data table in database
US8346803B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
US8683324B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
US20070208769A1 (en) System and method for generating an XPath expression
US20120192151A1 (en) Software development tool
CN108762743B (en) Data table operation code generation method and device
CN111241454A (en) Method, system and device for generating webpage code
CN106354483B (en) Data processing method and device and electronic equipment
CN116011400A (en) Automatic generation method and device for project standard test document
CN103905231A (en) Method and device for unified management of device types
CN108664546B (en) XML data structure conversion method and device
CN112799718A (en) Enumerated document generation method and device, electronic equipment and storage medium
US20090083300A1 (en) Document processing device and document processing method
WO2007081017A1 (en) Document processor
EP1909170B1 (en) Method and system for automatically generating a communication interface
CN112698819A (en) Method, device and storage medium for designing tree-oriented object programming program
CN111625728B (en) Method, device, equipment and medium for generating retrieval catalog from webpage document
EP1830274A1 (en) Server device and name space issuing method
CN110308907B (en) Data conversion method and device, storage medium and electronic equipment
CN115051904B (en) Method and device for managing single disk state based on markup language
US20090228678A1 (en) Mapping definition creation system and mapping definition creation program
US20080005085A1 (en) Server Device and Search Method
CN116028062A (en) Target code generation method, NPU instruction display method and device
CN115186214A (en) Page configuration method and device, computer equipment and computer readable storage medium
US20070153342A1 (en) Display and editing of documents described by schemas

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