CN115051904A - 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
CN115051904A
CN115051904A CN202210286883.1A CN202210286883A CN115051904A CN 115051904 A CN115051904 A CN 115051904A CN 202210286883 A CN202210286883 A CN 202210286883A CN 115051904 A CN115051904 A CN 115051904A
Authority
CN
China
Prior art keywords
state
control
data
markup language
disk
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
CN202210286883.1A
Other languages
Chinese (zh)
Other versions
CN115051904B (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

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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the field of network management, in particular to a method and a device for single-disk state management based on a markup language. The method 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 into 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 disc into the state file according to the definition of the general file format of the markup language; and reading controls in the state file through a uniform interface, and analyzing the content of the state block in each control according to the type of the service model corresponding to the control. The invention can unify the data expression modes of the single-disk management background and the display, and unifies the management interface and the display interface of the single-disk state by using the markup language and the general file format, so that the display mode is more friendly, and the development efficiency, the expandability and the transportability are improved.

Description

Method and device for managing single disk state based on markup language
[ technical field ] A method for producing a semiconductor device
The invention relates to the field of network management, in particular to a method and a device for single-disk state management based on a markup language.
[ background of the invention ]
In the process of maintenance and management of telecommunication network management, the state of a single disk needs to be checked frequently, such as: cross data state, protection group state, interface state, device operation and maintenance state, and the like.
Along with more and more functions on equipment, the requirement of a client on operation and maintenance is higher and higher, the current common state display cannot meet the requirement that the number of states corresponding to the current single-disk function is increased, and the requirement that the display modes of various states required by the client are uniform and the positioning is easy to search cannot be met. Meanwhile, when developing related functions in the background, the single-disk state also needs to be read frequently, and for example, when judging the current working path of the service, the protection switching state needs to be read, the port basic state of the single disk needs to be queried, and the like, the single-disk state needs to be read in the background. At present, hard codes are developed in single-disk states, state values are directly read and written in a fixed data structure according to functions of each single disk, a background does not have a uniform mode for reading the current disk states, development efficiency is low, and errors are prone to occurring.
Because the single-disk state expression and display on the network element of the network management 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 the requirement, the single-disk state design logic is not uniform, the definition and display of the single-disk state are not uniform, and the rapid positioning can not be carried out between different nodes. This also leads to complex logic of single-disk state calculation in the background of the network management, low logic multiplexing degree, non-uniform logic of single-disk state calculation, low logic multiplexing degree, and poor expandability.
In view of this, how to overcome the defects in the prior art and solve the problem that the current single-disc status expression is not uniform is a problem to be solved in the technical field.
[ summary of the invention ]
Aiming at the defects or the improvement requirements of the prior art, the invention solves the problems of non-uniform state expression and complex management caused by using 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 single-disk state management based on a markup language, specifically comprising: dividing the state data of the single disk into at least one state block, and defining the state data in each state block into 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 the state file according to the definition of the general file format of the markup language; and reading controls in the state file through the unified interface, and analyzing the content of the state block in each control according to the type of the service model corresponding to the control.
Preferably, the defining the state data in each state block into one or more standard controls based on the markup language according to the type of the service model specifically includes: and acquiring the control type required 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 the control according to the preset format of the corresponding control.
Preferably, the defining the state data in each state block into one or more standard controls based on the markup language 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 in the control to write the access address of the associated state block.
Preferably, the method further comprises the following steps: analyzing the service model type content in the single-disk state data stream to obtain 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, the obtaining the control corresponding to each service model type further includes: and acquiring a unique attribute name corresponding to each control according to the type of the service model, and searching for the corresponding control according to a space access path and data migration corresponding to the unique attribute name.
Preferably, the analyzing is performed on the content of the state block in each control, and when the control is a table control, the analyzing specifically includes: analyzing the header data content in the form control, and completing header filling according to the row number and column number; and acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disc state data stream according to the data type corresponding to each cell.
Preferably, the analyzing is performed on the content of the state block in each control, and when the control is a text control, the analyzing specifically includes: reading a data stream starting 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 being the text data length; and generating a common character string text according to the read data.
Preferably, the content of the state block in each control is analyzed, and when the control is an enumeration control, the method specifically includes: reading bytes of each enumerated data length in sequence from the enumerated data offset of the single-disk state data stream according to the enumerated data length and the enumerated data offset in the enumerated control, and acquiring all enumerated values; and searching the content corresponding to each enumerated value according to the enumeration interpretation.
Preferably, the content of the state block in each control is analyzed, and when the control is a BOOL control, the method specifically includes: reading byte data in the single disk state data stream according to the 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 single disk state management device based on a markup language, which specifically comprises the following steps: the system comprises at least one processor and a memory, wherein the at least one processor and the memory are connected through a data bus, and the memory stores instructions capable of being executed by the at least one processor, and the instructions are used for completing the method for single-disk state management 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 state blocks in different single disks are managed in a unified mode through the controls of the markup language, the transmission and display of the state values of the single disks are completed through the state files in the universal file format, the data expression modes of the single disk management background and the display are unified, and the management interface and the display interface of the single disk state are unified through the markup language and the universal file format, so that the display mode is more friendly, and the development efficiency, the expandability and the transportability are improved.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below. It is obvious that the drawings described below are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a flowchart of a method for single-disk state management 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 instances 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 an example of the main parameters of a form control provided in the present invention;
FIG. 7 is an example of data types for the major parameters of a form control provided in the present invention;
FIG. 8 is a schematic diagram illustrating a parsing process of a form control provided in the present invention;
FIG. 9 is an example of the main parameters of an enumeration control provided in the present invention;
FIG. 10 is a schematic diagram of an analysis flow of an enumeration control provided in the present invention;
FIG. 11 is an example of the main parameters of a text control provided in the present invention;
FIG. 12 is a schematic diagram illustrating a parsing process of a text control provided in the present invention;
FIG. 13 is an example of the main parameters of the BOOL control provided in the present invention;
FIG. 14 is a schematic diagram illustrating an analysis process of a BOOL control provided in the present invention;
FIG. 15 is a schematic structural diagram of an apparatus for single-disk status management based on markup language according to an embodiment of the present invention;
wherein the reference numbers are as follows:
11: a processor; 12: a memory.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The present invention is a system structure of a specific function system, so the functional logic relationship of each structural module is mainly explained in the specific embodiment, and the specific software and hardware implementation is not limited.
In addition, the technical features involved in the respective embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other. The invention will be described in detail below with reference to the figures and examples.
Example 1:
markup language is a computer word code that combines text and other information related to the text to reveal details about the structure of the document and the processing of the data. Compared with a common text description language, the markup language can not only contain original text information, but also combine other information related to the text, such as the structure and the representation information of the text, with the original text through the markup so as to define the semantics, the structure and the format of the electronic document. The markup of a markup language is typically easily distinguishable from the content and easily identifiable. Common Markup languages include hypertext Markup Language (HTML), Extensible Markup Language (XML), Resource Description Framework (RDF), and the like. The markup language generally has a corresponding file format, such as HTML-corresponding XML-corresponding RDF-format. Each language and corresponding file format can be read, written and otherwise processed according to the standard definitions of the language and file format. For some specific tags, corresponding entity content can be added, different display contents such as characters, graphics, animations, sounds, tables, links and the like can be presented in a browser, or non-display data content can be saved, such as buttons < button > in HTML language, text display < label >, hyperlink < HTML >, and the like, and the tags are called controls.
As shown in fig. 1, the method for single-disk status management based on markup language provided by the embodiment of the present invention includes the following specific steps.
Step 101: and dividing the state data of the single disk into at least one state block, and defining the state data in each state block into 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 the different business model types, a markup language is used to describe the states of the single disks. The control is a minimum processing unit for analyzing the single-disk state, 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 the states of all the single disks can be uniformly defined into state files 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 a specific implementation, each state block of the single disk may contain state data of a plurality of different service models, such as description text, an optional state list, a forwarding table, a switch state, and the like. For each different business model, different types of controls in the markup language can be used for presentation according to the organization characteristics of the data, the control type required to be used by each business model type in the state block is obtained, and the single-disk state data of each business model type is 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, BOOL controls; the states of the protection group, the cross state and the matrix lengthening state of the forwarding table are defined by a table control; the data of the fixed entries such as the port state, the device information state and the like are defined by the table control of the fixed entries. In order to adapt to different use scenes and user requirements, a user-defined control can be used on the basis of a general control, or the existing control can be adjusted to adapt to the needs of some special scenes, so that the use range of the method provided by the embodiment is expanded. The data structure used in the control can be a basic data type contained in the markup language itself, 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 general file format of the markup language.
In order to save and exchange data for a single disk state, after a state block is defined by using a control, the content of the control needs to be organized and saved by using a file format corresponding to a tag language. In order to facilitate management and search, all controls corresponding to all state blocks in each single disk are written into the same state file.
In order to improve the universality of different platforms, the file format uses a general file format corresponding to the markup language, such as HTML (hypertext markup language) file format. Since 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 the business model and the control, all the business model types and the control types may be defined in a state file of the whole single disk, and one business model corresponds to one control type. As shown in fig. 2, as a typical example of the structure of the state file, the state file contains the total display content and format of each single disc, including the service model type, control link information, format control link information, and the like. Since the markup language can support multi-layer nesting of tags, each control tag can contain various service attribute information of the service model, in the example shown in fig. 2, each control contains attribute information of the service model type, the control link and the data start bit of the control, and other description and formatting contents can be added according to needs. When the content of the state block corresponding to the control is associated with other state blocks, the jump link is used in the control to write the access address of the associated state block. The jump link comprises a state file access path and a state file name of the control corresponding to the associated state block, and can also comprise unique attribute names or positioning information in the state file such as file internal offset, so as to facilitate quick jump searching. In order to adapt to different use scenes and increase the readability of the state file, additional format definitions, file descriptions and the like can be added.
The state file can use two modes of new creation and writing. And for the single disk which does not generate the state file, a new mode is used, all the controls which need to be written in the file are directly organized according to the file format, and a new state file is generated. For a single disk with a state file, after the state value changes, the corresponding control can be found by using a write-in mode, the content in the control is updated according to the latest state data, and the updated control is placed in the position where the original control is located or the new position specified by the parameters, so that the influence on the 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 a single-disk state data stream, so as to obtain the current state of the single disk; or directly writing through a uniform interface, using the configuration file as a configuration file of a single disk, and reconfiguring the state block corresponding to the control by using the latest state data in the file.
Step 103: and reading controls in the state file through the unified interface, and analyzing the content of the state block in each control according to the type of the service model corresponding to the control.
For the single-disk state file, the system architecture shown in fig. 3 may be used, and the state value may be displayed directly through a general browser, or may be used as intermediate data for single-disk control, and external modules such as state data upload, service module management, and state data display use a unified single-disk state management interface to process data in the header file. 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 acquired through analysis.
In order to obtain the state data corresponding to the service model, firstly, the content of the service model type in the single-disc state data stream needs to be analyzed, the service model type and the control type information in the state file are read, the control corresponding to each service model type is obtained, then, the data of the single-disc state block is analyzed according to the preset format of the control, corresponding state data is returned according to the requirement, then, the state of the single disc is judged through the state data, or the state of the single disc 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, the content of the service model type carried in the header of the single-disk state data stream can be obtained in a fixed format, including the type of each service model, the initial position of the service model, the length content of the whole data of the service model and the like.
In the embodiment, the file in the standard format and the unified control are used for defining the state blocks with the same service model, so that the single-disk type does not need to be distinguished when the control is analyzed, and only the unified reading interface and the analysis algorithm need to be used for acquiring data aiming at the service model, thereby avoiding the problems that the calling modes of the specialized interfaces written by the existing interfaces according to the single-disk characteristics are not unified and the number of the specialized interfaces is large. In a specific use, the state obtaining interface may include: the interface is used for acquiring the whole state data of the single disc, the interface is used for acquiring the state data of a certain service model in the single disc, and the interface is used for acquiring the state data of specific attributes under a certain service model of the single disc. Interfaces for a certain set of traffic patterns, or custom interfaces, may also be provided as desired. After the state block is analyzed, the interface returns the single disk ID where the state block is located, the type of the service model, and the attribute and data content of the state block. As shown in fig. 4, by taking a common table control, an enumeration control, a text control, and a BOOL control as examples, specific contents of the return state value after parsing are provided, and other controls may select corresponding return value contents according to control characteristics and service characteristics.
After the steps 101 to 103 provided in this embodiment, by using the unified control and the standard file format based on the markup language, the unification of storing, displaying, and acquiring the single-disk state data is completed, the unified expression and processing of the single-disk state are solved, the friendly display in different application scenarios is realized, and the development efficiency is improved. In practical implementation, steps 102 and 103 may be used alternatively, simultaneously or sequentially to meet different requirements of status data storage, display, acquisition, update, etc.
In the present embodiment, the markup language used is preferably HTML language. The HTML is called hypertext markup language, and is a markup language, the latest version at present is HTML5, and a suitable language version can be selected according to stability, compatibility and subsequent upgrading requirements in specific use. In practical use, the HTML format file corresponding to the HTML language can be directly analyzed and displayed by the general browser, for example, the switch state is directly displayed by using the selected state of the selection control < select >, an additional display interface is not required to be used or an additional client is not required to be installed, the complexity of development and user use is simplified, and the program response speed is improved. On the other hand, because the HTML language is a language commonly used in a network transmission environment, and correspondingly, the HTML format file can be efficiently transmitted through a network, and therefore remote state reading, writing and management of a single disk in network equipment through the network are facilitated.
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, only the state value is filled in the storage position of the corresponding control in the cache according to the type of the service model, and then the template file filled with the data is integrally written into the file.
In this embodiment, the control is used as an organization unit for single-disk state management, and since the control is defined according to the service model, different configuration block definition modes are different, so as to facilitate management and search of the control, the control corresponding to each state block can be distinguished by using a unique attribute name, and a control index is established in the cache for the corresponding relationship between the service model and the control, so that the corresponding control can be conveniently found according to the type of the service model. The unique attribute names are not repeated in each configuration block, and can be named or numbered uniformly according to characteristics such as control cross states, port states, software version numbers and the like. Specifically, the control index may include: single disk ID, business model type, unique property name of control, control type, etc. In order to perform subsequent operations on the control content according to specific requirements, the attribute parameters of the control can be stored, so that the read-write interface can directly use the corresponding parameters to perform content analysis and writing. In particular 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 widget needs to be analyzed to obtain the widget that needs to be replaced with the content and the writing position of the latest state data. And acquiring a state file corresponding to the single disc according to the single disc id, analyzing the service model type content in a fixed head format in the single disc state data stream, finding 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 type of the service model, and the corresponding control is searched according to a space access path and data migration corresponding to the unique attribute name.
In the method for single-disk state management based on the markup language provided by this embodiment, a unified control is defined for each service model type, and then a single-disk state file of a certain type of single disk is defined by the control, so that unification of single-disk state data structure management and read-write analysis interfaces is realized, and inconvenience in use and secondary development due to complex read-write interfaces and large number of read-write interfaces caused by hard coding used in current single-disk state management is solved. By using the method provided by the embodiment, the final single disk state data can be calculated and generated through the background unified data analysis algorithm, and the uniformly called background access interface is provided based on the unified format content in the control, so that the unified definition, unified calculation and unified reading of the single disk state are ensured. By the method, a developer can quickly define the state of a new single disc with uniform expression format and display format, conveniently perform custom expansion on the control based on the characteristics of the markup language, and associate the content through the skip link, thereby improving the readability of data. Based on the method, the background service module reads the desired content through the uniform interface, thereby improving the development efficiency of the service module and reducing the coupling degree of the module; meanwhile, based on the method, unified controls, the state content of the single disk and a background access interface can be quickly 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 commonly used control instances are provided in this embodiment. In specific implementation, the examples provided by the present embodiment can be directly used as required, and other basic controls in the markup language or custom controls can also be used with reference to the examples.
(1) A form control.
The method is mainly used for defining the contents of a plurality of items such as a complex matrix type and a table format, and can use controls and tags such as < table >, < tbody >, < td > in an HTML language as a specific implementation mode, and can also use controls and tags of corresponding functions in other languages or use custom tags as a specific implementation mode.
The main parameters of the form control are shown in fig. 6, and include header data, form data type, form data content, starting position of content item number, and the like. The row number and the column number represent the specific format position relationship of the subsequent analysis content, and part of logics are used as row-column corresponding logical relationships; the starting position of the number of content items and the length of the items are used for positioning the content in each cell when reading.
In actual use, a fixed entry's tablespace or a non-fixed entry's tablespace may be used for different needs. The table control of the fixed entry needs to define parameters of all cells in the table data type, the table data content and the table header data, and when the table control is used, the parameters are directly positioned to the cells needing to be read and written; the form control of the non-fixed entry only needs to define the form data type of a row of forms to represent the parameters of each same resolution parameter, form data content, form header data and the like. The main parameters of the specific data type of the table can be shown in fig. 7, including the data type, the representation type of the data content, the data length, the display format, the interpretation content, and the like.
When the form control is analyzed, the data content of the form header in the form control is analyzed, and the form header filling is completed according to the row number and the column number. And then acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disc state data stream according to the data type corresponding to each cell.
Specifically, as shown in fig. 8, the following steps may be used to complete the analysis.
Step 201: and analyzing the header data content in the table control, and completing the table filling according to the row number and the column number.
Step 202: reading parameters of data type data content 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: and judging whether the fixed entry table control is the fixed entry table control according to the starting position of the entry number. If not, go to step 204; if yes, go to step 205.
Step 204: and acquiring all parameter related data in the single-disk state data stream according to the entry, the entry length and the starting position of the first line, and turning to step 205.
Step 205: determining data type dependent parameters based on the data type of each entry.
Step 206: and reading the content with the length corresponding to each entry at the beginning of the data offset in the single-disk state data stream according to the type and the length of the data type and the data offset in the data content.
Step 207: and acquiring the state content corresponding to the entry according to the data type. Specifically, if the display type parameter is an int type, the display type parameter is directly converted into int type data, and the int type data is displayed according to a carry system specified 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 display text is an enumeration type or a BOOL type, the corresponding interpretation text needs 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 content with a plurality of parallel options such as a global clock source, a working mode state and the like in a single disc, and can use controls and tags such as < fieldset > < ul > < ol > in an HTML language as a specific implementation mode, and can also use controls and tags of corresponding functions in other languages or use custom tags as a specific implementation mode.
The main parameters of the enumeration control are shown in fig. 9, including: enumerate default content, content length, content offset, enumeration interpretation, etc. And the content offset represents the offset of each enumerated content item relative to the starting address of the control, and the 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, reading bytes of each enumeration data length in sequence from the enumeration data offset of the single-disk state data stream, and acquiring all enumeration values. And searching the content corresponding to each enumeration value according to the enumeration interpretation.
Specifically, as shown in fig. 10, the following steps may be used to complete the analysis.
Step 301: and 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 and the data offset, and starting to read the 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 interpretation in the enumeration interpretation list according to the enumeration value.
Step 304: the state content is obtained according to the enumeration interpretation. Specifically, if the corresponding enumeration explanation is found, the content in the explanation text is directly used; and if the corresponding enumeration explanation is not found, directly displaying the default text content. This step may be omitted in scenes that need not be displayed.
(3) And (6) text controls.
The method is mainly used for defining the text contents such as time, version and the like in a single disc, controls and tags such as < label > < textarea > < ins > in an HTML language can be used as a specific implementation mode, controls and tags of corresponding functions in other languages can be used, or a user-defined tag is used as a specific implementation mode.
The main parameters of the text control are shown in fig. 11, which include: text type, data length, data offset. The text type represents the data type represented by the characters in the text, such as ordinary text, time text, and the like.
When the text control is analyzed, firstly, reading a data stream starting 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 enumeration control, and reading data with the length of the text data; and generating a common character string text according to the read data.
Specifically, as shown in fig. 12, the following steps may be used to complete the analysis.
Step 401: and reading the data analysis type, the data length and the data offset in the text control.
Step 402: and reading the data stream from the data offset in the single-disc 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 time format content is judged, and if the time format content is the time format content, the data is formatted into the time format content; if the time format content is not the time format content, the ordinary character string text is directly generated.
(4) A BOOL control.
The method is mainly used for defining whether the contents of global switches, activation states and the like in the single disk can be logically represented or not, controls and tags such as < select > in an HTML language can be used as specific implementation modes, whether the states are displayed by selecting the states or not, controls and tags of corresponding functions in other languages can be used, or custom tags are used as specific implementation modes.
The BOOL control is mainly shown in FIG. 13 and comprises: BOOL interpretation and data migration. Since the data length of the BOOL value is a fixed 1bit, the data length parameter is not required to be additionally used. Wherein, the BOOL explanation represents the explanation text corresponding to the BOOL value 0 and 1 respectively.
When the BOOL control is analyzed, firstly, one byte of data in the single-disk state data stream is read according to the 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 following steps may be used to complete the analysis.
Step 501: and reading the data offset and the BOOL interpretation parameters in the BOOL control.
Step 502: one byte of data in the single disc status data stream is read according to the data offset.
Step 503: and finding the corresponding display content in the BOOL explanation through the read BOOL numerical value. For example, 0 is shown as inactive/not enable/off, 1 is shown as active/enable/on, etc.
For all types of controls described above and other types of controls, in a specific implementation, one service model may use a plurality of controls of the same or related types to be stored in a state file, and for these types of service models, before parsing, all related controls need to be searched first, and then parsing is performed in a unified manner.
On the other hand, after the analysis is completed, the data obtained by the analysis can be filled in the position corresponding to the control cache for display or for other modules to call, or the content can be filled back to the original position of the control in the state file for storage after all the data are processed.
As can be seen from the specific example in this embodiment, no matter how the configuration type of the single disk itself changes, the state of the single disk can be organized into state blocks according to the service type, and the state blocks are stored by using corresponding controls through a unified interface, and after the storage, the state blocks are conveniently analyzed through control parameters and the unified interface, thereby completing the method for managing the state of the single disk based on the markup language provided in embodiment 1.
Example 3:
on the basis of the method for single-disk state management based on markup language provided in embodiments 1 to 2, the present invention further provides a device for single-disk state management based on markup language, which can be used to implement the method, and as shown in the single-disk state management based on markup language, the device is a schematic diagram of the device architecture in the embodiments of the present invention. The apparatus for single disk state management based on markup language of the present embodiment includes one or more processors 11 and a memory 12. Fig. 15 illustrates one processor 11 as an example.
The processor 11 and the memory 12 may be connected by a bus or other means, and the bus connection is exemplified in fig. 15.
The memory 12, which is a non-volatile computer-readable storage medium for a single-disk state management method based on a markup language, may be used to store a non-volatile software program, a non-volatile computer-executable program, and modules, such as the single-disk state management method based on a markup language in embodiments 1 to 2. The processor 11 executes various functional applications and data processing of the apparatus for single disk state management based on markup language, that is, implements the method for single disk state management based on markup language of embodiments 1 to 2, by running the nonvolatile software program, instructions and modules stored in the memory 12.
The 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, the memory 12 may optionally include memory located remotely from the processor 11, and these remote memories may be connected to the 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.
Program instructions/modules are stored in the memory 12, and when executed by the one or more processors 11, perform the method for single-disk state management based on a markup language in embodiments 1 to 2 described above, for example, perform the respective steps shown in fig. 1, fig. 8, and the like described above.
Those of ordinary skill in the art will appreciate that all or part of the steps of the various methods of the embodiments may be implemented by associated hardware as instructed by a program, which may be stored on a computer-readable storage medium, which may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.

Claims (10)

1. A method for single disk state management based on markup language is characterized in that:
dividing the state data of the single disk into at least one state block, and defining the state data in each state block into 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 the state file according to the definition of the general file format of the markup language;
and reading controls in the state file through the unified interface, and analyzing the content of the state block in each control according to the type of the service model corresponding to the control.
2. The method according to claim 1, wherein the defining the status data in each status block as one or more standard markup language-based controls according to the type of the business model specifically comprises:
and acquiring the control type required 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 the control according to the preset format of the corresponding control.
3. The method for single disk state management based on markup language according to claim 1, wherein said defining the state data in each state block as one or more standard controls based on markup language according to the type of 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 in the control to write the access address of the associated state block.
4. The method for single disk state management based on markup language according to claim 1, further comprising:
analyzing the service model type content in the single-disk state data stream to obtain 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.
5. The method for single-disk state management based on markup language according to claim 4, wherein said obtaining the 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.
6. The method for single-disk state management based on markup language according to claim 1, wherein the parsing of the state block content in each control, when the control is a table control, specifically comprises:
analyzing the header data content in the form control, and completing header filling according to the row number and column number;
and acquiring the data type corresponding to each cell, and acquiring the state data corresponding to each cell in the single-disc state data stream according to the data type corresponding to each cell.
7. The method for single-disk state management based on markup language according to claim 1, wherein the parsing of the state block content in each control, when the control is a text control, specifically comprises:
reading a data stream starting from the text data offset in the single-disc state data stream according to the text data offset and the text data length in the text control, and reading data with the length being the text data length;
and generating a common character string text according to the read data.
8. The method for single-disk state management based on markup language according to claim 1, wherein the parsing the state block content in each control, when the control is an enumeration control, specifically comprises:
reading bytes of each enumerated data length in sequence from the enumerated data offset of the single-disk state data stream according to the enumerated data length and the enumerated data offset in the enumerated control, and acquiring all enumerated values;
and searching the content corresponding to each enumerated value according to the enumeration interpretation.
9. The method for single disk state management based on markup language according to claim 1, wherein the parsing the state block content in each control, when the control is a BOOL control, specifically comprises:
reading byte data in the single disk state data stream according to the BOOL data offset in the BOOL control;
and searching the content corresponding to the read byte value in the BOOL interpretation.
10. An apparatus for single disk state management based on markup language, comprising:
comprising at least one processor and a memory, said at least one processor and memory being connected by a data bus, said memory storing instructions executable by said at least one processor, said instructions upon execution by said processor, for performing the method of single disk state management based on a markup language according to any of claims 1 to 9.
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 true CN115051904A (en) 2022-09-13
CN115051904B 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 (17)

* 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
US20040034833A1 (en) * 1999-11-12 2004-02-19 Panagiotis Kougiouris Dynamic interaction manager for markup language graphical user interface
US20040172616A1 (en) * 2003-02-28 2004-09-02 Microsoft Corporation Markup language visual mapping
US20050050457A1 (en) * 2003-08-29 2005-03-03 Konica Minolta Business Technologies, Inc. Data display system for efficient display using XML
WO2005098666A1 (en) * 2004-04-08 2005-10-20 Justsystems Corporation Processing data and documents that use a markup language
US20060190527A1 (en) * 2005-02-22 2006-08-24 Nextail Corporation Determining operational status of a mobile device capable of executing server-side applications
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)
US20110161375A1 (en) * 2009-12-24 2011-06-30 Doug Tedder Systems, methods and articles for template based generation of markup documents to access back office systems
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

Patent Citations (17)

* 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
US20040034833A1 (en) * 1999-11-12 2004-02-19 Panagiotis Kougiouris Dynamic interaction manager for markup language graphical user interface
US20040172616A1 (en) * 2003-02-28 2004-09-02 Microsoft Corporation Markup language visual mapping
US20050050457A1 (en) * 2003-08-29 2005-03-03 Konica Minolta Business Technologies, Inc. Data display system for efficient display using XML
WO2005098666A1 (en) * 2004-04-08 2005-10-20 Justsystems Corporation Processing data and documents that use a markup language
US20060190527A1 (en) * 2005-02-22 2006-08-24 Nextail Corporation Determining operational status of a mobile device capable of executing server-side applications
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)
US20110161375A1 (en) * 2009-12-24 2011-06-30 Doug Tedder Systems, methods and articles for template based generation of markup documents to access back office systems
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
冯瑞军;魏丽红;刘涛;张晨;周文安;: "数据网设备配置下发接口及应用", 北京邮电大学学报, no. 1 *

Also Published As

Publication number Publication date
CN115051904B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN106598612B (en) Operation method and system for data table in database
US8392880B2 (en) Rapid application development for database-aware applications
KR101312867B1 (en) Markup based extensibility for user interfaces
CN108762743B (en) Data table operation code generation method and device
US7945590B2 (en) Programmability for binding data
US20060080603A1 (en) Method and apparatus for utilizing an object model to manage document parts for use in an electronic document
US20070005622A1 (en) Method and apparatus for lazy construction of XML documents
KR20060080861A (en) Data binding in a word-processing application
CN116011400A (en) Automatic generation method and device for project standard test document
CN113177168B (en) Positioning method based on Web element attribute characteristics
CN110489401B (en) Method and device for deploying database objects
CN112799718A (en) Enumerated document generation method and device, electronic equipment and storage medium
CN109815240A (en) For managing method, apparatus, equipment and the storage medium of index
CN115617338A (en) Method and device for quickly generating service page and readable storage medium
CN113703777B (en) Code generation method, device, storage medium and equipment based on database table
CN112698819A (en) Method, device and storage medium for designing tree-oriented object programming program
US8433729B2 (en) Method and system for automatically generating a communication interface
TW201324347A (en) System and method for managing commands of function module
CN117453713A (en) SQL sentence generation method, device and storage medium for multi-type database
CN112783927A (en) Database query method and system
US7231598B1 (en) User interface for editing documents containing markup language
CN115051904B (en) Method and device for managing single disk state based on markup language
US20240037325A1 (en) Ability to add non-direct ancestor columns in child spreadsheets
US20090228678A1 (en) Mapping definition creation system and mapping definition creation program
CN107977459B (en) Report generation method and device

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