WO2018028127A1 - Method and apparatus for parsing storage files - Google Patents

Method and apparatus for parsing storage files Download PDF

Info

Publication number
WO2018028127A1
WO2018028127A1 PCT/CN2016/113344 CN2016113344W WO2018028127A1 WO 2018028127 A1 WO2018028127 A1 WO 2018028127A1 CN 2016113344 W CN2016113344 W CN 2016113344W WO 2018028127 A1 WO2018028127 A1 WO 2018028127A1
Authority
WO
WIPO (PCT)
Prior art keywords
parsing
storage file
logic
data structure
format data
Prior art date
Application number
PCT/CN2016/113344
Other languages
French (fr)
Chinese (zh)
Inventor
陈民敬
Original Assignee
广州视睿电子科技有限公司
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 广州视睿电子科技有限公司 filed Critical 广州视睿电子科技有限公司
Publication of WO2018028127A1 publication Critical patent/WO2018028127A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for analyzing a stored file.
  • the parsing logic a when the content of the xml file is displayed on the UI of the interactive whiteboard, the parsing logic a is used to parse the xml file into a memory model, and after adding a json type file to the storage file, the json file is added.
  • the parsing logic a needs to be modified to parse the parsing logic b of the xml file and the json file, and then the json file is parsed into a memory model.
  • the parsing logic c when parsing the storage file into the memory model A, the parsing logic c is used, but after adding a memory model B to the memory model to implement the new function, the parsing logic c needs to be modified to make part
  • the storage file can be parsed into memory model A, while another portion of the storage file can be parsed into memory model B. Therefore, the existing technical solutions lead to poor compatibility of software on the interactive electronic whiteboard, and the process of implementing format compatibility is complicated and difficult.
  • the invention provides a method and a device for parsing a storage file, which can improve the compatibility of the device with the file format, and make the process of implementing the file format compatible easy and simple.
  • the method for parsing a storage file specifically includes:
  • Reading a storage file where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
  • parsing the storage file into an intermediate format data structure according to the parsing logic corresponding to the parsing logic identification code, which includes:
  • the storage file is parsed into the intermediate format data structure according to the parsing logic.
  • parsing logic includes a first parsing logic and a second parsing logic
  • the parsing the storage file into the intermediate format data structure according to the parsing logic, specifically:
  • a format parser corresponding to the format of the storage file, to parse the storage file into a corresponding format data structure
  • the converting the intermediate format data structure into a memory storage file according to the conversion logic that is commonly associated with the element identification code, which includes:
  • the method further includes:
  • the present invention further provides a device for analyzing a file, which specifically includes:
  • a storage file reading module configured to read a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
  • a storage file parsing module configured to parse the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier, where the intermediate format data structure includes the storage The element identifier corresponding to each content element in the file;
  • An intermediate format data structure conversion module configured to convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset corresponding to the element identification code; wherein the memory storage file is the storage The mapping of files in memory.
  • the storing file parsing module specifically includes:
  • a parsing logic acquiring unit configured to acquire, according to the parsing logic identifier, the parsing logic corresponding to the parsing logic identifier from a preset parsing manager;
  • a file parsing unit configured to parse the storage file into the intermediate format data structure according to the parsing logic.
  • parsing logic includes a first parsing logic and a second parsing logic
  • the file parsing unit specifically includes:
  • a first parsing subunit configured to, according to the first parsing logic, invoke a format parser corresponding to a format of the storage file to parse the storage file into a corresponding format data structure;
  • a second parsing subunit configured to modify a node reference relationship of the format data structure according to the second parsing logic, and parse the format data structure into the intermediate format data structure.
  • the intermediate format data structure conversion module specifically includes:
  • a conversion logic acquiring unit configured to acquire, according to the element identification code, a conversion logic that is common to the element identification code from a preset conversion manager;
  • a format conversion unit configured to recurse the intermediate format data structure according to the conversion logic, and convert the intermediate format data structure into the memory storage file.
  • the parsing device for storing the file further includes:
  • a rendering display module is configured to render each content element in the memory storage file to a display in a display.
  • the method and apparatus for parsing a storage file parses a storage file into an intermediate format data structure according to parsing logic corresponding to a format of the storage file, and according to a content element corresponding to the intermediate format data structure
  • the conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, a plurality of intermediate format data structures containing different content elements can be converted during the conversion process regardless of the format of the corresponding storage file.
  • the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format.
  • the parsing method of the storage file can improve the compatibility of the device with the file format.
  • only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.
  • FIG. 1 is a schematic flow chart of an embodiment of a method for parsing a storage file provided by the present invention
  • FIG. 2 is a schematic diagram of an intermediate format corresponding to an integer X attribute of an embodiment of a method for parsing a storage file provided by the present invention
  • FIG. 3 is a schematic diagram of an intermediate format corresponding to a coordinate point Point attribute of an embodiment of a method for parsing a storage file provided by the present invention
  • FIG. 4 is a schematic diagram of an intermediate format corresponding to a background of a background property of an embodiment of a method for parsing a storage file provided by the present invention
  • FIG. 5 is a schematic diagram of an intermediate format corresponding to a background property of a background of a method for parsing a storage file according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of an intermediate format corresponding to a Point attribute of a coordinate point array of an embodiment of a method for parsing a storage file provided by the present invention
  • FIG. 7 is a schematic diagram of a tree-type intermediate format data structure of an embodiment of a method for parsing a storage file provided by the present invention.
  • FIG. 8 is a schematic flowchart of a parsing process of an embodiment of a method for parsing a storage file provided by the present invention.
  • FIG. 9 is a schematic flowchart of a conversion process of an embodiment of a method for parsing a storage file provided by the present invention.
  • FIG. 10 is a schematic structural diagram of an embodiment of a device for analyzing a stored file according to the present invention.
  • FIG. 1 is a schematic flowchart diagram of an embodiment of a method for parsing a storage file provided by the present invention, including steps S11 to S13, as follows:
  • S12 Parse the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier, where the intermediate format data structure includes each content in the storage file.
  • S13 Convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset in common with the element identifier; wherein the memory storage file is a mapping of the storage file in memory.
  • the method provided by the present invention mainly consists of a parsing process and a conversion process, that is, when a storage file is parsed and converted into an in-memory storage file, the storage file is first parsed according to corresponding parsing logic. After the intermediate format data structure, the intermediate format data structure is converted into an in-memory storage file according to the corresponding conversion logic.
  • the parsing logic used in the parsing process is determined by the format of the parsed storage file.
  • the transformation logic used in the conversion process is determined by the content elements in the converted intermediate format data structure.
  • the format of the storage file may be an xml format, a json format, or an svg format.
  • the intermediate format data structure can be a tree structure or other types of data structures such as linked lists and stacks.
  • the tree-type intermediate format data structure is taken as an example to illustrate the node reference relationship in the intermediate format data structure.
  • Each node in the intermediate format data structure includes three items of Name, Value and Children, which respectively represent the name of the node, the value of the node, and the child nodes of the node.
  • the attribute represented by a node is an underlying data type such as an integer, a decimal, or a string
  • the Name of the node is the name of the attribute
  • the Value of the node is the value of the attribute
  • the Child value of the node is null.
  • the intermediate format corresponding to the attribute is shown in Figure 2.
  • the attribute represented by a node is a composite data type, that is, the attribute is a composite attribute composed of several single attributes
  • the Name of the node is the name of the attribute
  • the value of the node is null
  • the child of the node points to A node that represents each single attribute.
  • the attribute is the coordinate point Point (100, 200)
  • the attribute represented by a node may be the underlying data type or the composite data type
  • the Name of the node is the name of the attribute
  • the value of the node is null
  • the Child of the node points to the specific The node of the data type and content.
  • the type of the property may be a color or an image.
  • the intermediate format corresponding to the attribute is as shown in FIG. 4 .
  • the intermediate format corresponding to the attribute is as shown in FIG. 5.
  • the Name of the node is the name of the attribute
  • the value of the node is null
  • the Children of the node points to the node representing the attributes of each array element in the attribute.
  • the attribute is an array of Points consisting of two coordinate points Point
  • the intermediate format corresponding to the attribute is as shown in FIG. 6.
  • the computer when a certain storage file needs to be parsed and converted into an in-memory storage file, the computer reads the storage file and according to the parsing logic corresponding to the version number of the parsing logic in the storage file, that is, The parsing logic corresponding to the logical identifier is parsed, and the storage file is parsed into an intermediate format data structure. Subsequently, the computer traverses the intermediate format data structure and converts the intermediate format data structure into an in-memory storage file according to conversion logic that corresponds to the element identification code of each content element therein.
  • the memory storage file is a mapping of the storage file in memory.
  • the intermediate format data structure may be a tree structure, or may be another type of data structure such as a linked list or a stack.
  • each content element is respectively parsed into each subtree having a common parent node in the tree structure, and the root nodes of each subtree respectively correspond to The element identifier of the content element, and each child node in each subtree is the attribute of its parent node.
  • the computer reads the storage file, and obtains a corresponding parsing logic capable of parsing the file in the xml format according to the parsing logical identifier in the storage file, and according to the The parsing logic parses the storage file into an intermediate format data structure of the tree type as shown in FIG.
  • the content element ⁇ iwb:shape> and the content element ⁇ iwb:magnifier> respectively correspond to two subtrees whose common parent node is an elements node.
  • the node name in the root node of the subtree corresponding to the content element ⁇ iwb:shape> is the element identifier of the content element ⁇ iwb:shape>, that is, the iwb:shape, and the attribute of the content element ⁇ iwb:shape> is parsed as the The child or grandchild of the root node.
  • the node name in the root node of the subtree corresponding to the content element ⁇ iwb:magnifier> is the element identifier of the content element ⁇ iwb:magnifier>, ie, iwb:magnifier, and the attribute of the content element ⁇ iwb:magnifier> is parsed as The child or grandchild of the root node.
  • the computer traverses the intermediate format data structure, and obtains a common corresponding conversion logic according to all of the element identification codes, iwb:shape and iwb:magnifier, and the conversion logic is
  • the subtree corresponding to the content element ⁇ iwb:shape> can be converted, and the subtree corresponding to the content element ⁇ iwb:magnifier> can be converted.
  • the intermediate format data structure is converted into a corresponding memory storage file, which includes a shape content element and its corresponding attribute, and a magnifier content element and its corresponding attribute.
  • the intermediate format data is parsed into an intermediate format data structure according to parsing logic corresponding to the format of the stored file, and the conversion format logic corresponding to the content element in the intermediate format data structure
  • the structure is converted into a memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, regardless of what is included in the storage file.
  • the content element can convert a plurality of intermediate format data structures containing different content elements during the conversion process, regardless of the format of the corresponding storage file. Therefore, the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format.
  • parsing the storage file into an intermediate format data structure according to the parsing logic corresponding to the parsing logic identification code, which includes:
  • the storage file is parsed into the intermediate format data structure according to the parsing logic.
  • the parsing logic is stored and managed by the parsing manager, and each parsing logic in the parsing manager has a unique version number, that is, parsing the logical identifier. Whenever you add a new storage file format, you need to add the corresponding parsing logic in the parsing manager.
  • the computer finds the parsing logic corresponding to the parsing logical identifier in the storage file in the parsing manager and acquires the parsing logic, and parses the stored file according to the parsing logic. Is an intermediate format data structure.
  • the flow chart of the analysis process of the present embodiment is shown, and the analysis manager 81 stores the analysis logic A and the analysis logic B.
  • the parsing logic A is obtained from the parsing manager 81, and the storage file A is parsed according to the parsing logic A.
  • the parsing logic B is obtained from the parsing manager 81, and the storage file B is parsed according to the parsing logic B.
  • the analysis logic C capable of parsing the storage file C is added to the analysis manager 81.
  • parsing logic includes a first parsing logic and a second parsing logic
  • the parsing the storage file into the intermediate format data structure according to the parsing logic, specifically:
  • the parsing logic is divided into two parts, namely, a first parsing logic and a second parsing logic.
  • the first parsing logic corresponds to the format of the storage file, and is used to call a format parser corresponding to the format of the stored file, thereby parsing the storage file into a corresponding format data structure.
  • the second parsing logic is configured to recurse the format data structure, thereby traversing the format data structure and modifying the node reference relationship therein, and further parsing the format data structure into an intermediate format data structure.
  • the format data structure may be a tree structure, or may be another type of data structure such as a linked list or a stack.
  • the node reference relationships of the format data structures corresponding to the format of different storage files may be the same or different.
  • the xml format data structure is recursively, thereby traversing the xml format data structure and modifying the node reference relationship therein, and further parsing the xml format data structure into the intermediate format data structure.
  • the converting the intermediate format data structure into an in-memory storage file according to the conversion logic that is commonly associated with the element identification code, which includes:
  • the conversion logic is stored and managed by the conversion manager, and each conversion logic in the conversion manager has an element identifier of all content elements that it can convert. Whenever a content element in a storage file changes to implement a new function, the corresponding conversion logic needs to be added in the conversion manager in advance.
  • the conversion logic corresponding to the element identifier of each content element in the intermediate format data structure is found in the conversion manager and the conversion logic is obtained, and according to The conversion logic recursively transforms the intermediate format data structure to convert the intermediate format data structure into an in-memory storage file.
  • the conversion manager 92 stores conversion logic A and conversion logic B.
  • the conversion logic A can convert an intermediate format data structure including the content element a and the content element b
  • the conversion logic B can convert an intermediate format data structure including the content element a, the content element b, and the content element c.
  • the slave conversion manager 92 The conversion logic A is obtained, and the intermediate format data structure 91 is converted into a corresponding memory storage file A according to the conversion logic A, and the converted memory storage file A includes the content element a and its corresponding attribute, and the content element b. And its corresponding properties.
  • adding in the conversion manager 92 is capable of converting the middle including the content element a, the content element b, and the content element d
  • the conversion logic C of the format data structure is capable of converting the middle including the content element a, the content element b, and the content element d.
  • the method further includes:
  • the storage file is parsed and converted into an in-memory storage file
  • the content elements in the memory storage file are rendered to be displayed in the display screen.
  • a storage file includes a content element a representing an ellipse and a content element b representing a magnifying glass
  • the corresponding memory storage file includes the content element a and its corresponding attribute, and the content element b and its corresponding Attributes.
  • an ellipse and a magnifying glass are displayed on the display of the device.
  • the method for parsing a storage file parses a storage file into an intermediate format data structure according to parsing logic corresponding to a format of the storage file, and according to a content element corresponding to the intermediate format data structure
  • the conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, a plurality of intermediate format data structures containing different content elements can be converted during the conversion process regardless of the format of the corresponding storage file.
  • the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format.
  • the parsing method of the storage file can improve the compatibility of the device with the file format.
  • only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.
  • the present invention also provides a device for analyzing a file, which can implement all the processes of the method for parsing a file in the above embodiment.
  • FIG. 10 is a schematic structural diagram of an embodiment of a device for analyzing a storage file provided by the present invention, which is specifically as follows:
  • a storage file reading module 01 configured to read a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
  • the storage file parsing module 02 is configured to perform, according to a preset parsing logic corresponding to the parsing logic identifier, Parsing the storage file into an intermediate format data structure; wherein the intermediate format data structure includes an element identification code respectively corresponding to each content element in the storage file;
  • the intermediate format data structure conversion module 03 is configured to convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset corresponding to the element identification code; wherein the memory storage file is the Stores the mapping of files in memory.
  • the storage file parsing module 02 specifically includes:
  • a parsing logic acquiring unit configured to acquire, according to the parsing logic identifier, the parsing logic corresponding to the parsing logic identifier from a preset parsing manager;
  • a file parsing unit configured to parse the storage file into the intermediate format data structure according to the parsing logic.
  • parsing logic includes a first parsing logic and a second parsing logic
  • the file parsing unit specifically includes:
  • a first parsing subunit configured to, according to the first parsing logic, invoke a format parser corresponding to a format of the storage file to parse the storage file into a corresponding format data structure;
  • a second parsing subunit configured to modify a node reference relationship of the format data structure according to the second parsing logic, and parse the format data structure into the intermediate format data structure.
  • the intermediate format data structure conversion module 03 specifically includes:
  • a conversion logic acquiring unit configured to acquire, according to the element identification code, a conversion logic that is common to the element identification code from a preset conversion manager;
  • a format conversion unit configured to recurse the intermediate format data structure according to the conversion logic, and convert the intermediate format data structure into the memory storage file.
  • the parsing device for storing the file further includes:
  • a rendering display module is configured to render each content element in the memory storage file to a display in a display.
  • the apparatus for parsing a storage file parses the storage file into an intermediate format data structure according to parsing logic corresponding to the format of the storage file, and according to the content element corresponding to the intermediate format data structure
  • the conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, the conversion process can be used for a variety of different content elements.
  • the intermediate format data structure is converted regardless of the format of the corresponding storage file.
  • the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format.
  • the parsing method of the storage file can improve the compatibility of the device with the file format.
  • only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.

Landscapes

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

Abstract

A method and apparatus for parsing storage files. Said method for parsing storage files comprising: reading a storage file, wherein said storage file contains a parsing logic identification code corresponding to a format of said storage file (S11); parsing said storage file into an intermediate format data structure according to a pre-set parsing logic corresponding to said parsing logic identification code, wherein said intermediate format data structure contains element identification codes corresponding to respective content elements within said storage file (S12); converting said intermediate format data structure into a memory storage file according to a pre-set conversion logic jointly corresponding to said element identification codes, wherein said memory storage file is a mapping of said storage file within a memory (S13). The present method improves the compatibility of devices to file formats, rendering the process of achieving file format compatibility simple and easy.

Description

存储文件的解析方法和装置Method and device for analyzing stored files 技术领域Technical field
本发明涉及计算机技术领域,尤其涉及一种存储文件的解析方法和装置。The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for analyzing a stored file.
背景技术Background technique
在现有的技术方案中,将存储文件的内容显示到交互式电子白板的UI上,是通过将该存储文件的格式从存储格式直接解析为内存中的一种数据结构格式,即内存模型,并对内存模型进行渲染来实现的。由于现有技术中的解析过程是将文件的格式从存储格式直接解析为内存模型,因此,不管是文件的存储格式发生变化,抑或是内存模型发生变化,均需要对解析过程的实现逻辑进行修改。例如,在将xml文件的内容显示至交互式电子白板的UI上时,使用解析逻辑a将该xml文件解析为内存模型,而在存储文件中增加一种json类型的文件之后,在将json文件的内容显示至交互式电子白板的UI上时,则需要先将解析逻辑a修改为能够解析xml文件和json文件的解析逻辑b之后,再将该json文件解析为内存模型。再例如,在将存储文件解析为内存模型A时,采用的是解析逻辑c,但是在内存模型中新增一个内存模型B以实现新的功能之后,则需要对解析逻辑c进行修改以使部分存储文件能够被解析为内存模型A,同时另一部分存储文件能够被解析为内存模型B。因此,现有的技术方案导致交互式电子白板上的软件的兼容性差,实现格式兼容的过程复杂且困难。In the prior art solution, displaying the content of the storage file to the UI of the interactive electronic whiteboard by directly parsing the format of the storage file from the storage format into a data structure format in the memory, that is, a memory model. And the memory model is rendered to achieve. Since the parsing process in the prior art directly parses the format of the file from the storage format to the memory model, whether the storage format of the file changes or the memory model changes, the implementation logic of the parsing process needs to be modified. . For example, when the content of the xml file is displayed on the UI of the interactive whiteboard, the parsing logic a is used to parse the xml file into a memory model, and after adding a json type file to the storage file, the json file is added. When the content is displayed on the UI of the interactive whiteboard, the parsing logic a needs to be modified to parse the parsing logic b of the xml file and the json file, and then the json file is parsed into a memory model. For another example, when parsing the storage file into the memory model A, the parsing logic c is used, but after adding a memory model B to the memory model to implement the new function, the parsing logic c needs to be modified to make part The storage file can be parsed into memory model A, while another portion of the storage file can be parsed into memory model B. Therefore, the existing technical solutions lead to poor compatibility of software on the interactive electronic whiteboard, and the process of implementing format compatibility is complicated and difficult.
发明内容Summary of the invention
本发明提出一种存储文件的解析方法和装置,能够提高设备对文件格式的兼容性,且使得实现文件格式兼容的过程容易、简单。The invention provides a method and a device for parsing a storage file, which can improve the compatibility of the device with the file format, and make the process of implementing the file format compatible easy and simple.
本发明提供的一种存储文件的解析方法,具体包括:The method for parsing a storage file provided by the present invention specifically includes:
读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;Reading a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;And parsing the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier; wherein the intermediate format data structure includes each content element in the storage file Corresponding element identification code;
根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转 换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。Converting the intermediate format data structure according to a conversion logic that is preset corresponding to the element identification code And replacing the memory storage file; wherein the memory storage file is a mapping of the storage file in memory.
进一步地,所述根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构,具体包括:Further, the parsing the storage file into an intermediate format data structure according to the parsing logic corresponding to the parsing logic identification code, which includes:
根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;Obtaining, according to the parsing logic identification code, the parsing logic corresponding to the parsing logic identification code from a preset parsing manager;
根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。The storage file is parsed into the intermediate format data structure according to the parsing logic.
进一步地,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;Further, the parsing logic includes a first parsing logic and a second parsing logic;
所述根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构,具体包括:The parsing the storage file into the intermediate format data structure according to the parsing logic, specifically:
根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储文件解析为相应的格式数据结构;Decoding, according to the first parsing logic, a format parser corresponding to the format of the storage file, to parse the storage file into a corresponding format data structure;
根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。And modifying, according to the second parsing logic, a node reference relationship of the format data structure, and parsing the format data structure into the intermediate format data structure.
进一步地,所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件,具体包括:Further, the converting the intermediate format data structure into a memory storage file according to the conversion logic that is commonly associated with the element identification code, which includes:
根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;Obtaining, according to the element identifier, a conversion logic that is common to the element identifiers from a preset conversion manager;
根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。Retrieving the intermediate format data structure according to the conversion logic, and converting the intermediate format data structure into the memory storage file.
进一步地,在所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件之后,还包括:Further, after converting the intermediate format data structure into a memory storage file according to the conversion logic that is commonly associated with the element identifier, the method further includes:
将所述内存存储文件中的各个内容元素渲染至显示屏中显示。Renders each content element in the memory storage file to the display in the display.
相应地,本发明还提供了一种存储文件的解析装置,具体包括:Correspondingly, the present invention further provides a device for analyzing a file, which specifically includes:
存储文件读取模块,用于读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;a storage file reading module, configured to read a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
存储文件解析模块,用于根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;以及,a storage file parsing module, configured to parse the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier, where the intermediate format data structure includes the storage The element identifier corresponding to each content element in the file; and,
中间格式数据结构转换模块,用于根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。 An intermediate format data structure conversion module, configured to convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset corresponding to the element identification code; wherein the memory storage file is the storage The mapping of files in memory.
进一步地,所述存储文件解析模块,具体包括:Further, the storing file parsing module specifically includes:
解析逻辑获取单元,用于根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;以及,a parsing logic acquiring unit, configured to acquire, according to the parsing logic identifier, the parsing logic corresponding to the parsing logic identifier from a preset parsing manager; and
文件解析单元,用于根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。And a file parsing unit, configured to parse the storage file into the intermediate format data structure according to the parsing logic.
进一步地,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;Further, the parsing logic includes a first parsing logic and a second parsing logic;
所述文件解析单元,具体包括:The file parsing unit specifically includes:
第一解析子单元,用于根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储文件解析为相应的格式数据结构;以及,a first parsing subunit, configured to, according to the first parsing logic, invoke a format parser corresponding to a format of the storage file to parse the storage file into a corresponding format data structure; and
第二解析子单元,用于根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。a second parsing subunit, configured to modify a node reference relationship of the format data structure according to the second parsing logic, and parse the format data structure into the intermediate format data structure.
进一步地,所述中间格式数据结构转换模块,具体包括:Further, the intermediate format data structure conversion module specifically includes:
转换逻辑获取单元,用于根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;以及,a conversion logic acquiring unit, configured to acquire, according to the element identification code, a conversion logic that is common to the element identification code from a preset conversion manager; and
格式转换单元,用于根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。a format conversion unit, configured to recurse the intermediate format data structure according to the conversion logic, and convert the intermediate format data structure into the memory storage file.
进一步地,所述存储文件的解析装置,还包括:Further, the parsing device for storing the file further includes:
渲染显示模块,用于将所述内存存储文件中的各个内容元素渲染至显示屏中显示。A rendering display module is configured to render each content element in the memory storage file to a display in a display.
实施本发明,具有如下有益效果:The implementation of the present invention has the following beneficial effects:
本发明提供的存储文件的解析方法及装置,通过根据与存储文件的格式相对应的解析逻辑,将存储文件解析为中间格式数据结构,并且根据与该中间格式数据结构中的内容元素相对应的转换逻辑,将该中间格式数据结构转换为内存存储文件,从而使得存储文件的格式的变化与存储文件的内容的变化相互隔离,即在解析过程能够对多种不同格式的存储文件进行解析,而不管该存储文件中包括何种内容元素,在转换过程能够对多种包含不同内容元素的中间格式数据结构进行转换,而不管相对应的存储文件为何种格式。因此,本发明实施例提供的存储文件的解析方法能够提高设备对文件格式的兼容性。同时,由于当存储文件的格式发生变化时只需添加新的解析逻辑,当存储文件的内容元素发生变化时只需添加新的转换逻辑,因此实现格式兼容的过程容易、简单。The method and apparatus for parsing a storage file provided by the present invention parses a storage file into an intermediate format data structure according to parsing logic corresponding to a format of the storage file, and according to a content element corresponding to the intermediate format data structure The conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, a plurality of intermediate format data structures containing different content elements can be converted during the conversion process regardless of the format of the corresponding storage file. Therefore, the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format. At the same time, since only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.
附图说明DRAWINGS
图1是本发明提供的存储文件的解析方法的一个实施例的流程示意图; 1 is a schematic flow chart of an embodiment of a method for parsing a storage file provided by the present invention;
图2是本发明提供的存储文件的解析方法的一个实施例的整数X属性所对应的中间格式的示意图;2 is a schematic diagram of an intermediate format corresponding to an integer X attribute of an embodiment of a method for parsing a storage file provided by the present invention;
图3是本发明提供的存储文件的解析方法的一个实施例的坐标点Point属性所对应的中间格式的示意图;3 is a schematic diagram of an intermediate format corresponding to a coordinate point Point attribute of an embodiment of a method for parsing a storage file provided by the present invention;
图4是本发明提供的存储文件的解析方法的一个实施例的背景Background属性的类型为颜色时所对应的中间格式的示意图;4 is a schematic diagram of an intermediate format corresponding to a background of a background property of an embodiment of a method for parsing a storage file provided by the present invention;
图5是本发明提供的存储文件的解析方法的一个实施例的背景Background属性的类型为图片时所对应的中间格式的示意图;5 is a schematic diagram of an intermediate format corresponding to a background property of a background of a method for parsing a storage file according to an embodiment of the present invention;
图6是本发明提供的存储文件的解析方法的一个实施例的坐标点数组Points属性所对应的中间格式的示意图;6 is a schematic diagram of an intermediate format corresponding to a Point attribute of a coordinate point array of an embodiment of a method for parsing a storage file provided by the present invention;
图7是本发明提供的存储文件的解析方法的一个实施例的树型的中间格式数据结构的示意图;7 is a schematic diagram of a tree-type intermediate format data structure of an embodiment of a method for parsing a storage file provided by the present invention;
图8是本发明提供的存储文件的解析方法的一个实施例的解析过程的流程示意图;8 is a schematic flowchart of a parsing process of an embodiment of a method for parsing a storage file provided by the present invention;
图9是本发明提供的存储文件的解析方法的一个实施例的转换过程的流程示意图;9 is a schematic flowchart of a conversion process of an embodiment of a method for parsing a storage file provided by the present invention;
图10是本发明提供的存储文件的解析装置的一个实施例的结构示意图。FIG. 10 is a schematic structural diagram of an embodiment of a device for analyzing a stored file according to the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
参见图1,是本发明提供的存储文件的解析方法的一个实施例的流程示意图,包括步骤S11至S13,具体如下:FIG. 1 is a schematic flowchart diagram of an embodiment of a method for parsing a storage file provided by the present invention, including steps S11 to S13, as follows:
S11:读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;S11: reading a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
S12:根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;S12: Parse the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier, where the intermediate format data structure includes each content in the storage file. The element identification code corresponding to the element;
S13:根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。 S13: Convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset in common with the element identifier; wherein the memory storage file is a mapping of the storage file in memory.
需要说明的是,本发明所提供的方法主要由解析过程和转换过程组成,即在将某一存储文件解析并转换为内存存储文件时,先根据相应的解析逻辑将该存储文件解析为对应的中间格式数据结构后,再根据相应的转换逻辑将该中间格式数据结构转换为内存存储文件。解析过程所采用的解析逻辑由所解析的存储文件的格式决定。转换过程所采用的转换逻辑由所转换的中间格式数据结构中的内容元素共同决定。It should be noted that the method provided by the present invention mainly consists of a parsing process and a conversion process, that is, when a storage file is parsed and converted into an in-memory storage file, the storage file is first parsed according to corresponding parsing logic. After the intermediate format data structure, the intermediate format data structure is converted into an in-memory storage file according to the corresponding conversion logic. The parsing logic used in the parsing process is determined by the format of the parsed storage file. The transformation logic used in the conversion process is determined by the content elements in the converted intermediate format data structure.
需要进一步说明的是,存储文件的格式可以为xml格式、json格式或者svg格式等。中间格式数据结构可以为树型结构,也可以为链表、堆栈等其他类型的数据结构。It should be further noted that the format of the storage file may be an xml format, a json format, or an svg format. The intermediate format data structure can be a tree structure or other types of data structures such as linked lists and stacks.
以树型的中间格式数据结构为例说明中间格式数据结构中的节点引用关系。该中间格式数据结构中的每个节点中均包括Name,Value和Children三个项,分别表示节点的名称、节点的值和节点的子节点。The tree-type intermediate format data structure is taken as an example to illustrate the node reference relationship in the intermediate format data structure. Each node in the intermediate format data structure includes three items of Name, Value and Children, which respectively represent the name of the node, the value of the node, and the child nodes of the node.
当某一节点表示的属性为整数、小数、字符串等基础数据类型时,该节点的Name值为该属性的名称,该节点的Value值为该属性的值,该节点的Children值为空。例如:当属性为X=100时,该属性所对应的中间格式如图2所示。When the attribute represented by a node is an underlying data type such as an integer, a decimal, or a string, the Name of the node is the name of the attribute, the Value of the node is the value of the attribute, and the Child value of the node is null. For example, when the attribute is X=100, the intermediate format corresponding to the attribute is shown in Figure 2.
当某一节点表示的属性为复合数据类型,即该属性为由若干单一属性组成的复合属性时,该节点的Name值为该属性的名称,该节点的Value值为空,该节点的Children指向表示各个单一属性的节点。例如,当属性为坐标点Point(100,200)时,该属性由单一属性cx=100和单一属性cy=200组成,因此该属性所对应的中间格式如图3所示。When the attribute represented by a node is a composite data type, that is, the attribute is a composite attribute composed of several single attributes, the Name of the node is the name of the attribute, the value of the node is null, and the child of the node points to A node that represents each single attribute. For example, when the attribute is the coordinate point Point (100, 200), the attribute consists of a single attribute cx=100 and a single attribute cy=200, so the intermediate format corresponding to the attribute is as shown in FIG.
当某一节点表示的属性可能是基础数据类型,也可能是复合数据类型时,该节点的Name值为该属性的名称,该节点的Value值为空,该节点的Children指向表示该属性的具体的数据类型和内容的节点。例如,当属性为背景Background时,该属性的类型可能是颜色,也可能是图片。当该属性的类型为颜色时,该属性所对应的中间格式如图4所示。When the attribute represented by a node may be the underlying data type or the composite data type, the Name of the node is the name of the attribute, the value of the node is null, and the Child of the node points to the specific The node of the data type and content. For example, when the property is Background Background, the type of the property may be a color or an image. When the type of the attribute is a color, the intermediate format corresponding to the attribute is as shown in FIG. 4 .
当该属性的类型为图片时,该属性所对应的中间格式如图5所示。When the type of the attribute is a picture, the intermediate format corresponding to the attribute is as shown in FIG. 5.
当某一节点表示的属性为数组类型时,该节点的Name值为该属性的名称,该节点的Value值为空,该节点的Children指向表示该属性中的各个数组元素的属性的节点。例如,当属性为由两个坐标点Point组成的Points数组时,该属性所对应的中间格式如图6所示。When the attribute represented by a node is an array type, the Name of the node is the name of the attribute, the value of the node is null, and the Children of the node points to the node representing the attributes of each array element in the attribute. For example, when the attribute is an array of Points consisting of two coordinate points Point, the intermediate format corresponding to the attribute is as shown in FIG. 6.
在一个优选的实施方式中,当需要将某一存储文件解析并转换为内存存储文件时,计算机读取该存储文件,并根据该存储文件中的解析逻辑的版本号所对应的解析逻辑,即解析逻辑识别码所对应的解析逻辑,将该存储文件解析为中间格式数据结构。随后,计算机遍历该中间格式数据结构,并根据其中的各个内容元素的元素识别码所共同对应的转换逻辑,将该中间格式数据结构转换为内存存储文件。内存存储文件为存储文件在内存中的映射。其中,中间格式数据结构可以为树型结构,也可以为链表、堆栈等其他类型的数据结构。当中间格 式数据结构为树型结构时,存储文件经过解析后,其中的各个内容元素分别对应解析为该树型结构中的具有共同父节点的各个子树,各个子树的根节点中包括分别对应的内容元素的元素识别码,各个子树中的各个子节点分别为其父节点的属性。In a preferred embodiment, when a certain storage file needs to be parsed and converted into an in-memory storage file, the computer reads the storage file and according to the parsing logic corresponding to the version number of the parsing logic in the storage file, that is, The parsing logic corresponding to the logical identifier is parsed, and the storage file is parsed into an intermediate format data structure. Subsequently, the computer traverses the intermediate format data structure and converts the intermediate format data structure into an in-memory storage file according to conversion logic that corresponds to the element identification code of each content element therein. The memory storage file is a mapping of the storage file in memory. The intermediate format data structure may be a tree structure, or may be another type of data structure such as a linked list or a stack. When the middle When the data structure is a tree structure, after the storage file is parsed, each content element is respectively parsed into each subtree having a common parent node in the tree structure, and the root nodes of each subtree respectively correspond to The element identifier of the content element, and each child node in each subtree is the attribute of its parent node.
例如,假设某一xml格式的存储文件如下:For example, suppose a storage file in an xml format is as follows:
Figure PCTCN2016113344-appb-000001
Figure PCTCN2016113344-appb-000001
其中包括内容元素<iwb:shape>和内容元素<iwb:magnifier>,分别表示一个椭圆和一个放大镜。当需要将该存储文件解析并转换为内存存储文件时,计算机读取该存储文件,并根据该存储文件中的解析逻辑识别码获得相对应的能够解析xml格式的文件的解析逻辑,并根据该解析逻辑将存储文件解析为如图7所示的树型的中间格式数据结构。This includes the content element <iwb:shape> and the content element <iwb:magnifier>, which represent an ellipse and a magnifying glass, respectively. When the storage file needs to be parsed and converted into an in-memory storage file, the computer reads the storage file, and obtains a corresponding parsing logic capable of parsing the file in the xml format according to the parsing logical identifier in the storage file, and according to the The parsing logic parses the storage file into an intermediate format data structure of the tree type as shown in FIG.
其中,内容元素<iwb:shape>和内容元素<iwb:magnifier>分别对应解析为共同父节点为elements节点的两棵子树。内容元素<iwb:shape>所对应的子树的根节点中的节点名称为内容元素<iwb:shape>的元素识别码,即iwb:shape,内容元素<iwb:shape>的属性对应解析为该根节点的子节点或者孙节点。内容元素<iwb:magnifier>所对应的子树的根节点中的节点名称为内容元素<iwb:magnifier>的元素识别码,即iwb:magnifier,内容元素<iwb:magnifier>的属性对应解析为该根节点的子节点或者孙节点。The content element <iwb:shape> and the content element <iwb:magnifier> respectively correspond to two subtrees whose common parent node is an elements node. The node name in the root node of the subtree corresponding to the content element <iwb:shape> is the element identifier of the content element <iwb:shape>, that is, the iwb:shape, and the attribute of the content element <iwb:shape> is parsed as the The child or grandchild of the root node. The node name in the root node of the subtree corresponding to the content element <iwb:magnifier> is the element identifier of the content element <iwb:magnifier>, ie, iwb:magnifier, and the attribute of the content element <iwb:magnifier> is parsed as The child or grandchild of the root node.
在将该中间格式数据结构转换为内存存储文件时,计算机遍历该中间格式数据结构,根据其中的所有的元素识别码,即iwb:shape和iwb:magnifier获得共同对应的转换逻辑,该转换逻辑既能够转换内容元素<iwb:shape>所对应的子树,又能够转换内容元素<iwb:magnifier>所对应的子树。根据该转换逻辑,将该中间格式数据结构转换为相应的内存存储文件,该内存存储文件中包括一个shape内容元素及其相应的属性,以及一个magnifier内容元素及其相应的属性。 When the intermediate format data structure is converted into an in-memory storage file, the computer traverses the intermediate format data structure, and obtains a common corresponding conversion logic according to all of the element identification codes, iwb:shape and iwb:magnifier, and the conversion logic is The subtree corresponding to the content element <iwb:shape> can be converted, and the subtree corresponding to the content element <iwb:magnifier> can be converted. According to the conversion logic, the intermediate format data structure is converted into a corresponding memory storage file, which includes a shape content element and its corresponding attribute, and a magnifier content element and its corresponding attribute.
由此可见,通过根据与存储文件的格式相对应的解析逻辑,将存储文件解析为中间格式数据结构,并且根据与该中间格式数据结构中的内容元素相对应的转换逻辑,将该中间格式数据结构转换为内存存储文件,从而使得存储文件的格式的变化与存储文件的内容的变化相互隔离,即在解析过程能够对多种不同格式的存储文件进行解析,而不管该存储文件中包括何种内容元素,在转换过程能够对多种包含不同内容元素的中间格式数据结构进行转换,而不管相对应的存储文件为何种格式。因此,本发明实施例提供的存储文件的解析方法能够提高设备对文件格式的兼容性。同时,由于当存储文件的格式发生变化时只需添加新的解析逻辑,当存储文件的内容元素发生变化时只需添加新的转换逻辑,即可将具有新格式或者具有新内容元素的存储文件解析并转换为相应的内存存储文件,因此实现文件格式兼容的过程容易、简单。It can be seen that the intermediate format data is parsed into an intermediate format data structure according to parsing logic corresponding to the format of the stored file, and the conversion format logic corresponding to the content element in the intermediate format data structure The structure is converted into a memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, regardless of what is included in the storage file. The content element can convert a plurality of intermediate format data structures containing different content elements during the conversion process, regardless of the format of the corresponding storage file. Therefore, the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format. At the same time, since only the new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only the new conversion logic is added, and the storage file with the new format or the new content element can be added. Parsed and converted to the corresponding memory storage file, so the process of file format compatibility is easy and simple.
进一步地,所述根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构,具体包括:Further, the parsing the storage file into an intermediate format data structure according to the parsing logic corresponding to the parsing logic identification code, which includes:
根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;Obtaining, according to the parsing logic identification code, the parsing logic corresponding to the parsing logic identification code from a preset parsing manager;
根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。The storage file is parsed into the intermediate format data structure according to the parsing logic.
需要说明的是,解析逻辑由解析管理器进行存储和管理,解析管理器中的每个解析逻辑均具有唯一的版本号,即解析逻辑识别码。每当增加一种新的存储文件的格式时,需要预先在解析管理器中添加相对应的解析逻辑。当需要将存储文件解析为中间格式数据结构时,计算机在解析管理器中查找到该存储文件中的解析逻辑识别码所对应的解析逻辑并获取该解析逻辑,并根据该解析逻辑将存储文件解析为中间格式数据结构。It should be noted that the parsing logic is stored and managed by the parsing manager, and each parsing logic in the parsing manager has a unique version number, that is, parsing the logical identifier. Whenever you add a new storage file format, you need to add the corresponding parsing logic in the parsing manager. When the storage file needs to be parsed into the intermediate format data structure, the computer finds the parsing logic corresponding to the parsing logical identifier in the storage file in the parsing manager and acquires the parsing logic, and parses the stored file according to the parsing logic. Is an intermediate format data structure.
例如,如图8所示为本实施方式的解析过程的流程示意图,解析管理器81中存储有解析逻辑A和解析逻辑B。当需要将格式为A的存储文件A解析为中间格式数据结构82时,则从解析管理器81中获取解析逻辑A,并根据该解析逻辑A对存储文件A进行解析。当需要将格式为B的存储文件B解析为中间格式数据结构82时,则从解析管理器81中获取解析逻辑B,并根据该解析逻辑B对存储文件B进行解析。当存储文件中新增加一种格式为C的存储文件C时,则在解析管理器81中添加能够解析该存储文件C的解析逻辑C。For example, as shown in FIG. 8, the flow chart of the analysis process of the present embodiment is shown, and the analysis manager 81 stores the analysis logic A and the analysis logic B. When it is necessary to parse the storage file A of the format A into the intermediate format data structure 82, the parsing logic A is obtained from the parsing manager 81, and the storage file A is parsed according to the parsing logic A. When it is necessary to parse the storage file B of the format B into the intermediate format data structure 82, the parsing logic B is obtained from the parsing manager 81, and the storage file B is parsed according to the parsing logic B. When a storage file C of the format C is newly added to the storage file, the analysis logic C capable of parsing the storage file C is added to the analysis manager 81.
进一步地,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;Further, the parsing logic includes a first parsing logic and a second parsing logic;
所述根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构,具体包括:The parsing the storage file into the intermediate format data structure according to the parsing logic, specifically:
根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储 文件解析为相应的格式数据结构;Determining, according to the first parsing logic, a format parser corresponding to a format of the storage file, the storing The file is parsed into a corresponding format data structure;
根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。And modifying, according to the second parsing logic, a node reference relationship of the format data structure, and parsing the format data structure into the intermediate format data structure.
需要说明的是,解析逻辑分为两个部分,即第一解析逻辑和第二解析逻辑。第一解析逻辑与存储文件的格式相对应,用于调用与存储文件的格式相对应的格式解析器,从而将存储文件解析为相应的格式数据结构。第二解析逻辑用于对该格式数据结构进行递归,从而遍历该格式数据结构并且修改其中的节点引用关系,将该格式数据结构进一步解析为中间格式数据结构。其中,格式数据结构可以为树型结构,也可以为链表、堆栈等其他类型的数据结构。不同的存储文件的格式所对应的格式数据结构的节点引用关系可能相同,也可能不相同。It should be noted that the parsing logic is divided into two parts, namely, a first parsing logic and a second parsing logic. The first parsing logic corresponds to the format of the storage file, and is used to call a format parser corresponding to the format of the stored file, thereby parsing the storage file into a corresponding format data structure. The second parsing logic is configured to recurse the format data structure, thereby traversing the format data structure and modifying the node reference relationship therein, and further parsing the format data structure into an intermediate format data structure. The format data structure may be a tree structure, or may be another type of data structure such as a linked list or a stack. The node reference relationships of the format data structures corresponding to the format of different storage files may be the same or different.
例如,在将某一xml格式的存储文件解析为中间格式数据结构时,先根据解析逻辑中的第一解析逻辑,调用xml格式解析器,将该存储文件解析为xml格式数据结构,即xml树。随后,根据解析逻辑中的第二解析逻辑,对该xml格式数据结构进行递归,从而遍历该xml格式数据结构并且修改其中的节点引用关系,将该xml格式数据结构进一步解析为中间格式数据结构。For example, when parsing a storage file of an xml format into an intermediate format data structure, first calling an xml format parser according to the first parsing logic in the parsing logic, and parsing the storage file into an xml format data structure, that is, an xml tree. . Then, according to the second parsing logic in the parsing logic, the xml format data structure is recursively, thereby traversing the xml format data structure and modifying the node reference relationship therein, and further parsing the xml format data structure into the intermediate format data structure.
在另一个优选的实施方式中,所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件,具体包括:In another preferred embodiment, the converting the intermediate format data structure into an in-memory storage file according to the conversion logic that is commonly associated with the element identification code, which includes:
根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;Obtaining, according to the element identifier, a conversion logic that is common to the element identifiers from a preset conversion manager;
根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。Retrieving the intermediate format data structure according to the conversion logic, and converting the intermediate format data structure into the memory storage file.
需要说明的是,转换逻辑由转换管理器进行存储和管理,转换管理器中的每个转换逻辑中均具有其能够转换的所有内容元素的元素识别码。每当存储文件中的内容元素发生变化以实现新的功能时,需要预先在转换管理器中添加相对应的转换逻辑。当需要将中间格式数据结构转换为内存存储文件时,在转换管理器中查找到该中间格式数据结构中的每个内容元素的元素识别码所共同对应的转换逻辑并获取该转换逻辑,并根据该转换逻辑,对该中间格式数据结构进行递归,从而将该中间格式数据结构转换为内存存储文件。It should be noted that the conversion logic is stored and managed by the conversion manager, and each conversion logic in the conversion manager has an element identifier of all content elements that it can convert. Whenever a content element in a storage file changes to implement a new function, the corresponding conversion logic needs to be added in the conversion manager in advance. When the intermediate format data structure needs to be converted into the memory storage file, the conversion logic corresponding to the element identifier of each content element in the intermediate format data structure is found in the conversion manager and the conversion logic is obtained, and according to The conversion logic recursively transforms the intermediate format data structure to convert the intermediate format data structure into an in-memory storage file.
例如,如图9所示的本实施方式的转换过程的流程示意图,转换管理器92中存储有转换逻辑A和转换逻辑B。假设其中的转换逻辑A能够转换包括内容元素a和内容元素b的中间格式数据结构,转换逻辑B能够转换包括内容元素a、内容元素b和内容元素c的中间格式数据结构。当中间格式数据结构91中包括内容元素a和内容元素b时,则从转换管理器92 中获取转换逻辑A,并根据该转换逻辑A将该中间格式数据结构91转换为相应的内存存储文件A,转换所得的内存存储文件A中包括内容元素a及其相应的属性,以及内容元素b及其相应的属性。当需要在包括内容元素a和内容元素b的存储文件中增加内容元素d以实现新的功能时,则在转换管理器92中添加能够转换包括内容元素a、内容元素b和内容元素d的中间格式数据结构的转换逻辑C。For example, as shown in the flow chart of the conversion process of the present embodiment as shown in FIG. 9, the conversion manager 92 stores conversion logic A and conversion logic B. Assuming that the conversion logic A can convert an intermediate format data structure including the content element a and the content element b, the conversion logic B can convert an intermediate format data structure including the content element a, the content element b, and the content element c. When the content element a and the content element b are included in the intermediate format data structure 91, the slave conversion manager 92 The conversion logic A is obtained, and the intermediate format data structure 91 is converted into a corresponding memory storage file A according to the conversion logic A, and the converted memory storage file A includes the content element a and its corresponding attribute, and the content element b. And its corresponding properties. When it is necessary to add a content element d in a storage file including the content element a and the content element b to implement a new function, adding in the conversion manager 92 is capable of converting the middle including the content element a, the content element b, and the content element d The conversion logic C of the format data structure.
进一步地,在所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件之后,还包括:Further, after converting the intermediate format data structure into a memory storage file according to the conversion logic that is commonly associated with the element identifier, the method further includes:
将所述内存存储文件中的各个内容元素渲染至显示屏中显示。Renders each content element in the memory storage file to the display in the display.
需要说明的是,在将存储文件解析并且转换为内存存储文件之后,对该内存存储文件中的内容元素进行渲染,使之在显示屏中显示。It should be noted that after the storage file is parsed and converted into an in-memory storage file, the content elements in the memory storage file are rendered to be displayed in the display screen.
例如,某一存储文件中包括表示椭圆的内容元素a和表示放大镜的内容元素b,则与之相对应的内存存储文件中包括内容元素a及其相应的属性,以及内容元素b及其相应的属性。在对该内存存储文件进行渲染之后,设备的显示屏上显示一个椭圆和一个放大镜。For example, if a storage file includes a content element a representing an ellipse and a content element b representing a magnifying glass, the corresponding memory storage file includes the content element a and its corresponding attribute, and the content element b and its corresponding Attributes. After rendering the memory storage file, an ellipse and a magnifying glass are displayed on the display of the device.
本发明实施例提供的存储文件的解析方法,通过根据与存储文件的格式相对应的解析逻辑,将存储文件解析为中间格式数据结构,并且根据与该中间格式数据结构中的内容元素相对应的转换逻辑,将该中间格式数据结构转换为内存存储文件,从而使得存储文件的格式的变化与存储文件的内容的变化相互隔离,即在解析过程能够对多种不同格式的存储文件进行解析,而不管该存储文件中包括何种内容元素,在转换过程能够对多种包含不同内容元素的中间格式数据结构进行转换,而不管相对应的存储文件为何种格式。因此,本发明实施例提供的存储文件的解析方法能够提高设备对文件格式的兼容性。同时,由于当存储文件的格式发生变化时只需添加新的解析逻辑,当存储文件的内容元素发生变化时只需添加新的转换逻辑,因此实现格式兼容的过程容易、简单。The method for parsing a storage file according to an embodiment of the present invention, parses a storage file into an intermediate format data structure according to parsing logic corresponding to a format of the storage file, and according to a content element corresponding to the intermediate format data structure The conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, a plurality of intermediate format data structures containing different content elements can be converted during the conversion process regardless of the format of the corresponding storage file. Therefore, the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format. At the same time, since only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.
相应地,本发明还提供一种存储文件的解析装置,能够实现上述实施例中的存储文件的解析方法的所有流程。Correspondingly, the present invention also provides a device for analyzing a file, which can implement all the processes of the method for parsing a file in the above embodiment.
参见图10,是本发明提供的存储文件的解析装置的一个实施例的结构示意图,具体如下:FIG. 10 is a schematic structural diagram of an embodiment of a device for analyzing a storage file provided by the present invention, which is specifically as follows:
存储文件读取模块01,用于读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;a storage file reading module 01, configured to read a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
存储文件解析模块02,用于根据预先设置的与所述解析逻辑识别码所对应的解析逻辑, 将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;以及,The storage file parsing module 02 is configured to perform, according to a preset parsing logic corresponding to the parsing logic identifier, Parsing the storage file into an intermediate format data structure; wherein the intermediate format data structure includes an element identification code respectively corresponding to each content element in the storage file;
中间格式数据结构转换模块03,用于根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。The intermediate format data structure conversion module 03 is configured to convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset corresponding to the element identification code; wherein the memory storage file is the Stores the mapping of files in memory.
进一步地,所述存储文件解析模块02,具体包括:Further, the storage file parsing module 02 specifically includes:
解析逻辑获取单元,用于根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;以及,a parsing logic acquiring unit, configured to acquire, according to the parsing logic identifier, the parsing logic corresponding to the parsing logic identifier from a preset parsing manager; and
文件解析单元,用于根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。And a file parsing unit, configured to parse the storage file into the intermediate format data structure according to the parsing logic.
进一步地,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;Further, the parsing logic includes a first parsing logic and a second parsing logic;
所述文件解析单元,具体包括:The file parsing unit specifically includes:
第一解析子单元,用于根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储文件解析为相应的格式数据结构;以及,a first parsing subunit, configured to, according to the first parsing logic, invoke a format parser corresponding to a format of the storage file to parse the storage file into a corresponding format data structure; and
第二解析子单元,用于根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。a second parsing subunit, configured to modify a node reference relationship of the format data structure according to the second parsing logic, and parse the format data structure into the intermediate format data structure.
在另一个优选的实施方式中,所述中间格式数据结构转换模块03,具体包括:In another preferred embodiment, the intermediate format data structure conversion module 03 specifically includes:
转换逻辑获取单元,用于根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;以及,a conversion logic acquiring unit, configured to acquire, according to the element identification code, a conversion logic that is common to the element identification code from a preset conversion manager; and
格式转换单元,用于根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。a format conversion unit, configured to recurse the intermediate format data structure according to the conversion logic, and convert the intermediate format data structure into the memory storage file.
进一步地,所述存储文件的解析装置,还包括:Further, the parsing device for storing the file further includes:
渲染显示模块,用于将所述内存存储文件中的各个内容元素渲染至显示屏中显示。A rendering display module is configured to render each content element in the memory storage file to a display in a display.
本发明实施例提供的存储文件的解析装置,通过根据与存储文件的格式相对应的解析逻辑,将存储文件解析为中间格式数据结构,并且根据与该中间格式数据结构中的内容元素相对应的转换逻辑,将该中间格式数据结构转换为内存存储文件,从而使得存储文件的格式的变化与存储文件的内容的变化相互隔离,即在解析过程能够对多种不同格式的存储文件进行解析,而不管该存储文件中包括何种内容元素,在转换过程能够对多种包含不同内容元素的 中间格式数据结构进行转换,而不管相对应的存储文件为何种格式。因此,本发明实施例提供的存储文件的解析方法能够提高设备对文件格式的兼容性。同时,由于当存储文件的格式发生变化时只需添加新的解析逻辑,当存储文件的内容元素发生变化时只需添加新的转换逻辑,因此实现格式兼容的过程容易、简单。The apparatus for parsing a storage file provided by the embodiment of the present invention parses the storage file into an intermediate format data structure according to parsing logic corresponding to the format of the storage file, and according to the content element corresponding to the intermediate format data structure The conversion logic converts the intermediate format data structure into an in-memory storage file, so that the format change of the storage file is isolated from the change of the content of the storage file, that is, the parsing process can parse the storage file of a plurality of different formats, and Regardless of what content elements are included in the storage file, the conversion process can be used for a variety of different content elements. The intermediate format data structure is converted regardless of the format of the corresponding storage file. Therefore, the parsing method of the storage file provided by the embodiment of the present invention can improve the compatibility of the device with the file format. At the same time, since only new parsing logic needs to be added when the format of the storage file changes, when the content element of the storage file changes, only new conversion logic needs to be added, so the process of implementing format compatibility is easy and simple.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。 The above is a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. The scope of protection of the present invention.

Claims (10)

  1. 一种存储文件的解析方法,其特征在于,包括:A method for parsing a storage file, comprising:
    读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;Reading a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
    根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;And parsing the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier; wherein the intermediate format data structure includes each content element in the storage file Corresponding element identification code;
    根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。Converting the intermediate format data structure into a memory storage file according to a conversion logic that is preset in common with the element identifier; wherein the memory storage file is a mapping of the storage file in memory.
  2. 如权利要求1所述的存储文件的解析方法,其特征在于,所述根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构,具体包括:The method for parsing a storage file according to claim 1, wherein the parsing the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identification code set in advance, specifically including :
    根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;Obtaining, according to the parsing logic identification code, the parsing logic corresponding to the parsing logic identification code from a preset parsing manager;
    根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。The storage file is parsed into the intermediate format data structure according to the parsing logic.
  3. 如权利要求2所述的存储文件的解析方法,其特征在于,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;The method for parsing a storage file according to claim 2, wherein the parsing logic comprises first parsing logic and second parsing logic;
    所述根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构,具体包括:The parsing the storage file into the intermediate format data structure according to the parsing logic, specifically:
    根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储文件解析为相应的格式数据结构;Decoding, according to the first parsing logic, a format parser corresponding to the format of the storage file, to parse the storage file into a corresponding format data structure;
    根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。And modifying, according to the second parsing logic, a node reference relationship of the format data structure, and parsing the format data structure into the intermediate format data structure.
  4. 如权利要求1所述的存储文件的解析方法,其特征在于,所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件,具体包括:The method for parsing a storage file according to claim 1, wherein the intermediate format data structure is converted into a memory storage file according to a conversion logic that is commonly associated with the element identification code. include:
    根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;Obtaining, according to the element identifier, a conversion logic that is common to the element identifiers from a preset conversion manager;
    根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。 Retrieving the intermediate format data structure according to the conversion logic, and converting the intermediate format data structure into the memory storage file.
  5. 如权利要求1所述的存储文件的解析方法,其特征在于,在所述根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件之后,还包括:The method for parsing a storage file according to claim 1, wherein after converting the intermediate format data structure into a memory storage file according to a conversion logic that is commonly associated with the element identification code set in advance ,Also includes:
    将所述内存存储文件中的各个内容元素渲染至显示屏中显示。Renders each content element in the memory storage file to the display in the display.
  6. 一种存储文件的解析装置,其特征在于,包括:A device for analyzing a file, comprising:
    存储文件读取模块,用于读取存储文件;其中,所述存储文件中包括与所述存储文件的格式所对应的解析逻辑识别码;a storage file reading module, configured to read a storage file, where the storage file includes a parsing logical identification code corresponding to a format of the storage file;
    存储文件解析模块,用于根据预先设置的与所述解析逻辑识别码所对应的解析逻辑,将所述存储文件解析为中间格式数据结构;其中,所述中间格式数据结构中包括与所述存储文件中的各个内容元素分别对应的元素识别码;以及,a storage file parsing module, configured to parse the storage file into an intermediate format data structure according to a parsing logic corresponding to the parsing logic identifier, where the intermediate format data structure includes the storage The element identifier corresponding to each content element in the file; and,
    中间格式数据结构转换模块,用于根据预先设置的与所述元素识别码所共同对应的转换逻辑,将所述中间格式数据结构转换为内存存储文件;其中,所述内存存储文件为所述存储文件在内存中的映射。An intermediate format data structure conversion module, configured to convert the intermediate format data structure into a memory storage file according to a conversion logic that is preset corresponding to the element identification code; wherein the memory storage file is the storage The mapping of files in memory.
  7. 如权利要求6所述的存储文件的解析装置,其特征在于,所述存储文件解析模块,具体包括:The device for analyzing a stored file according to claim 6, wherein the storage file parsing module comprises:
    解析逻辑获取单元,用于根据所述解析逻辑识别码,从预先设置的解析管理器中获取所述解析逻辑识别码所对应的所述解析逻辑;以及,a parsing logic acquiring unit, configured to acquire, according to the parsing logic identifier, the parsing logic corresponding to the parsing logic identifier from a preset parsing manager; and
    文件解析单元,用于根据所述解析逻辑,将所述存储文件解析为所述中间格式数据结构。And a file parsing unit, configured to parse the storage file into the intermediate format data structure according to the parsing logic.
  8. 如权利要求7所述的存储文件的解析装置,其特征在于,所述解析逻辑中包括第一解析逻辑和第二解析逻辑;The apparatus for parsing a storage file according to claim 7, wherein the parsing logic comprises first parsing logic and second parsing logic;
    所述文件解析单元,具体包括:The file parsing unit specifically includes:
    第一解析子单元,用于根据所述第一解析逻辑,调用与所述存储文件的格式所对应的格式解析器,将所述存储文件解析为相应的格式数据结构;以及,a first parsing subunit, configured to, according to the first parsing logic, invoke a format parser corresponding to a format of the storage file to parse the storage file into a corresponding format data structure; and
    第二解析子单元,用于根据所述第二解析逻辑,对所述格式数据结构的节点引用关系进行修改,将所述格式数据结构解析为所述中间格式数据结构。a second parsing subunit, configured to modify a node reference relationship of the format data structure according to the second parsing logic, and parse the format data structure into the intermediate format data structure.
  9. 如权利要求6所述的存储文件的解析装置,其特征在于,所述中间格式数据结构转换模块,具体包括: The apparatus for parsing a storage file according to claim 6, wherein the intermediate format data structure conversion module specifically includes:
    转换逻辑获取单元,用于根据所述元素识别码,从预先设置的转换管理器中获取所述元素识别码所共同对应的转换逻辑;以及,a conversion logic acquiring unit, configured to acquire, according to the element identification code, a conversion logic that is common to the element identification code from a preset conversion manager; and
    格式转换单元,用于根据所述转换逻辑,对所述中间格式数据结构进行递归,将所述中间格式数据结构转换为所述内存存储文件。a format conversion unit, configured to recurse the intermediate format data structure according to the conversion logic, and convert the intermediate format data structure into the memory storage file.
  10. 如权利要求6所述的存储文件的解析装置,其特征在于,所述存储文件的解析装置,还包括:The device for analyzing a stored file according to claim 6, wherein the device for analyzing the file further comprises:
    渲染显示模块,用于将所述内存存储文件中的各个内容元素渲染至显示屏中显示。 A rendering display module is configured to render each content element in the memory storage file to a display in a display.
PCT/CN2016/113344 2016-08-09 2016-12-30 Method and apparatus for parsing storage files WO2018028127A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610648942.X 2016-08-09
CN201610648942.XA CN106649428A (en) 2016-08-09 2016-08-09 Analyzing method and apparatus of storage files

Publications (1)

Publication Number Publication Date
WO2018028127A1 true WO2018028127A1 (en) 2018-02-15

Family

ID=58852999

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113344 WO2018028127A1 (en) 2016-08-09 2016-12-30 Method and apparatus for parsing storage files

Country Status (2)

Country Link
CN (1) CN106649428A (en)
WO (1) WO2018028127A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325217A (en) * 2018-09-19 2019-02-12 深圳市元征科技股份有限公司 A kind of document conversion method, system, device and computer readable storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213709B (en) * 2017-06-30 2021-01-15 阿里巴巴(中国)有限公司 Data conversion method and device and data processing equipment
CN110688343B (en) * 2019-08-26 2023-04-28 天津开心生活科技有限公司 Method and device for converting data format
CN112732643B (en) * 2021-04-01 2021-07-20 南京国睿信维软件有限公司 Method for interconversion of flow chart graphic file data and S1000D standard XML format data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055577A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 Collector capable of extending markup language
CN102243665A (en) * 2011-08-22 2011-11-16 上海梅花信息有限公司 Document online playing system and method thereof
CN102402431A (en) * 2010-09-17 2012-04-04 基信康信息技术(上海)有限公司 Method for designing UI (User Interface) of mobile phone by utilizing XML (Extensive Makeup Language)
US20140279875A1 (en) * 2013-03-15 2014-09-18 Matthew Pitstick Method and apparatus for converting data

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100501740C (en) * 2007-01-25 2009-06-17 无敌科技(西安)有限公司 Method and system for converting text data of different formats to uniform format
CN101247589B (en) * 2007-07-04 2010-09-08 华为技术有限公司 Mobile terminal data conversion/backup method, device and system
CN101917520B (en) * 2007-07-04 2013-01-30 华为技术有限公司 Conversion/backup method, equipment and system for mobile terminal data
CN101436185B (en) * 2007-11-12 2012-02-01 北大方正集团有限公司 Method for implementing multiple-file compatibility by XML memory tree
CN102053952A (en) * 2009-11-10 2011-05-11 英华达(上海)电子有限公司 Method and device for converting data format of electronic book and portable electronic book reader
CN102866986A (en) * 2012-08-30 2013-01-09 中国矿业大学 Document format conversion system
CN104935499A (en) * 2015-05-28 2015-09-23 杭州华三通信技术有限公司 Message format conversion method and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101055577A (en) * 2006-04-12 2007-10-17 龙搜(北京)科技有限公司 Collector capable of extending markup language
CN102402431A (en) * 2010-09-17 2012-04-04 基信康信息技术(上海)有限公司 Method for designing UI (User Interface) of mobile phone by utilizing XML (Extensive Makeup Language)
CN102243665A (en) * 2011-08-22 2011-11-16 上海梅花信息有限公司 Document online playing system and method thereof
US20140279875A1 (en) * 2013-03-15 2014-09-18 Matthew Pitstick Method and apparatus for converting data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325217A (en) * 2018-09-19 2019-02-12 深圳市元征科技股份有限公司 A kind of document conversion method, system, device and computer readable storage medium
CN109325217B (en) * 2018-09-19 2023-04-18 深圳市元征科技股份有限公司 File conversion method, system, device and computer readable storage medium

Also Published As

Publication number Publication date
CN106649428A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
WO2018028127A1 (en) Method and apparatus for parsing storage files
CN106527892B (en) Screen capturing method and system of electronic equipment
US8938720B2 (en) Trace visualization for object oriented programs
CN111611518B (en) Automatic visual display page publishing method and system based on Html5
US20140207826A1 (en) Generating xml schema from json data
US7509574B2 (en) Method and system for reducing delimiters
US20060161890A1 (en) Application-generic sequence diagram generator driven by a non-proprietary language
US20060282453A1 (en) Methods and systems for transforming an and/or command tree into a command data model
US20070006196A1 (en) Methods and systems for extracting information from computer code
US20070006179A1 (en) Methods and systems for transforming a parse graph into an and/or command tree
WO2016015564A1 (en) Method and apparatus for displaying document
US7500184B2 (en) Determining an acceptance status during document parsing
US20060212800A1 (en) Method and system for sequentially accessing compiled schema
CN111090417A (en) Binary file analysis method, device, equipment and medium
US20110023014A1 (en) Method and apparatus for modifying an executable application using in-memory object representation
US10489024B2 (en) UI rendering based on adaptive label text infrastructure
CN108664546A (en) Xml data structure conversion method and device
CN111508562A (en) Visual display method, device, equipment and medium of flow descriptive language
CN107438194A (en) A kind of intelligent television UI object rendering methods and intelligent television
US7735001B2 (en) Method and system for decoding encoded documents
CN117454846A (en) Method for converting XSD file into JSON file
US8996991B2 (en) System and method for displaying an acceptance status
JP2010267092A (en) Information processor and information processing method
CN116932829A (en) Solutions for developer supporting big data tree view components
CN111090651A (en) Data source processing method, device and equipment and readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16912580

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 08.07.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 16912580

Country of ref document: EP

Kind code of ref document: A1