CN110659393B - Method and system for generating xml code - Google Patents

Method and system for generating xml code Download PDF

Info

Publication number
CN110659393B
CN110659393B CN201910867107.9A CN201910867107A CN110659393B CN 110659393 B CN110659393 B CN 110659393B CN 201910867107 A CN201910867107 A CN 201910867107A CN 110659393 B CN110659393 B CN 110659393B
Authority
CN
China
Prior art keywords
data
xml
module
information
panoramic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910867107.9A
Other languages
Chinese (zh)
Other versions
CN110659393A (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.)
Henan Jiushang Technology Co ltd
Original Assignee
Henan Jiushang Technology 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 Henan Jiushang Technology Co ltd filed Critical Henan Jiushang Technology Co ltd
Priority to CN201910867107.9A priority Critical patent/CN110659393B/en
Publication of CN110659393A publication Critical patent/CN110659393A/en
Application granted granted Critical
Publication of CN110659393B publication Critical patent/CN110659393B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/80Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
    • G06F16/81Indexing, e.g. XML tags; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Abstract

The invention discloses an xml code generation method and system. Reading panoramic metadata from a database to obtain panoramic classification data; establishing a main xml storage space, taking project data, scene data or sand table data as father data, establishing a father xml temporary storage space, and establishing an xml key value pair by father data attribute information to be spliced to the father xml temporary storage space; if the parent data has component information or script information, the component information or the script information is used as the parent data to be called recursively, the generated component xml or script xml is inserted into the parent xml, the parent xml is inserted into the main xml, and an xml code is generated; the system comprises a main control module, a data processing module, a classified data reading module, a project module, a scene module, a sand table module, a script module, an assembly module and a general key value corresponding module, and has the advantages of automatic generation, high efficiency and low error rate.

Description

Method and system for generating xml code
Technical Field
The invention relates to the technical field of panoramic editing, in particular to an xml code generation method and system.
Background
In the panoramic editing process, edited panoramic data are written into a database, the database is stored in different data tables according to different types of panoramic data, the data tables store the subordination relation among the panoramic data, corresponding xml codes are usually required to be manually written according to the storage relation among the panoramic data, a renderer calls the xml codes, a panoramic effect is generated, when the panoramic data are more, if the number of scenes and components in the panoramic data is increased by hundreds of thousands, the labor intensity of manually writing the xml codes is high, the efficiency is low, the error probability is high, and the research and development period of panoramic projects is greatly prolonged.
Disclosure of Invention
In order to solve the problems, the invention provides an xml code generation method and system, which have the characteristics of automatic generation, high efficiency and low error rate.
The invention is realized by the following technical scheme:
an xml code generation method includes the following steps,
the method comprises the following steps: reading panoramic metadata from a database, classifying the panoramic metadata to form panoramic classification data, wherein the panoramic classification data is of an inverted tree structure, a storage space corresponding to the panoramic classification data is established, and the panoramic classification data is stored in the storage space and comprises project data, scene data and sand table data, and the project data comprises data information, component information and script information; the scene data comprises scene information, component information and script information, and the sand table data comprises sand table information, component information and script information;
step two: establishing a main xml storage space, generating beginning and ending xml sentences at the same time, storing the beginning and ending xml sentences in the main xml storage space, reading panoramic classification data, and taking the acquired project data, scene data or sand table data as parent data;
step three: establishing a father xml temporary storage space, generating father xml beginning and father xml ending sentences at the same time, storing the father xml temporary storage space, reading attribute information of father data, and constructing attributes and values in the father data into xml key value pairs which are spliced to the father xml beginning in the father xml temporary storage space;
step four: detecting whether component information or script information exists in the parent data, if so, recursively calling the component information or the script information as the parent data in a third step and a fourth step respectively, returning the component xml or the script xml generated by recursive calling to the parent xml and inserting the component xml or the script xml into the parent xml;
step five: and after the recursive call is finished, inserting the finally generated parent xml into the main xml storage space in the step two to generate a final xml code.
In the first step, the panoramic metadata is stored in a database in a data table form.
Classifying according to attribute information of panoramic metadata, wherein any panoramic classification data of the project data, the scene data, the sand table data, the script information and the component information comprises at least one attribute and a value corresponding to the attribute; the panorama metadata is classified according to at least one attribute.
In the first step, the inverted tree structure is established by reading the master-slave relationship among the attributes of various classified data in project data, scene data, sand table data, script information and component information.
An xml code generation system comprises a main control module, a data processing module, a classified data reading module, an item module, a scene module, a sand table module, a script module, an assembly module and a general key value corresponding module; wherein the content of the first and second substances,
the main control module is used for reading and classifying the panoramic metadata, performing recursive calling by taking component data or script data as parent data, inserting parent xml into a main xml storage space, and finally generating an xml code;
the data processing module is used for reading and classifying the panoramic metadata from the database;
the classification data reading module is used for reading the attribute of the panoramic classification data and the value corresponding to the attribute from the storage space;
the item module is used for receiving the attribute of the item data read out from the classified data reading module and the value corresponding to the attribute;
the scene module is used for receiving the attributes of the scene metadata read out from the classified data reading module and the values corresponding to the attributes;
the sand table module is used for receiving the attribute of the sand table metadata read out from the classified data reading module and the value corresponding to the attribute;
the script module is used for receiving the attribute of the script information read out from the classified data reading module and the value corresponding to the attribute;
the component module is used for receiving the attribute of the component information read out from the classified data reading module and the value corresponding to the attribute;
and the universal key value corresponding module is used for constructing the attributes in the item module, the scene module, the sand table module, the script module and the component module and the values corresponding to the attributes into attribute key value pairs.
The invention discloses a method and a system for generating xml codes based on panoramic editing, which are used for reading panoramic metadata stored in a database, obtaining an inverted tree structure of panoramic classification data and panoramic classification data according to attribute information of the panoramic metadata, establishing a storage space consistent with the dependency relationship between the panoramic classification data, writing the panoramic classification data into the storage space, reading the panoramic classification data from the storage space, taking project data, scene data and sand table data as parent data, constructing an attribute key value pair of the parent data, generating parent xml codes, taking component information or script information as the parent data if the parent data contains the component information or the script information, generating the xml codes corresponding to the parent data, inserting the generated xml codes into the corresponding parent xml codes, inserting the parent xml codes into a main xml to generate complete xml codes, and have the advantages of high efficiency, low error rate, large capacity, convenient management, development time saving and automatic and quick generation of the xml codes.
Drawings
FIG. 1 is a flow diagram of an xml code generation method.
FIG. 2 is a data flow diagram of generating xml code.
FIG. 3 is a schematic diagram of a system for generating xml code.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It is obvious that the described embodiments are only a part of the embodiments of the present invention, not all embodiments, and all other embodiments obtained by those skilled in the art without inventive work based on the embodiments of the present invention belong to the protection scope of the present invention.
As shown in fig. 1, a method for generating xml code based on panorama editing includes the following steps,
the method comprises the following steps: reading panoramic metadata from a database, classifying the panoramic metadata to form panoramic classification data, wherein the panoramic classification data is of an inverted tree structure, a storage space corresponding to the panoramic classification data is established, and the panoramic classification data is stored in the storage space and comprises project data, scene data and sand table data, and the project data comprises data information, component information and script information; the scene data comprises scene information, component information and script information, and the sand table data comprises sand table information, component information and script information;
the panoramic metadata is stored in a database in a data table form; the classification is carried out according to attribute information of the panoramic metadata, and the inverted tree structure is established by reading master-slave relations among various classified data attributes in project data, scene data, sand table data, script information and component information;
any panoramic classification data in the project data, the scene data, the sand table data, the script information and the component information comprises at least one attribute and a value corresponding to the attribute; the panoramic metadata is classified according to at least one attribute;
step two: establishing a main xml storage space, generating beginning and ending xml sentences at the same time, storing the beginning and ending xml sentences in the main xml storage space, reading panoramic classification data, and taking the acquired project data, scene data or sand table data as parent data;
step three: establishing a father xml temporary storage space, generating father xml beginning and father xml ending sentences at the same time, storing the father xml temporary storage space, reading attribute information of father data, and constructing attributes and values in the father data into xml key value pairs which are spliced to the father xml beginning in the father xml temporary storage space;
step four: detecting whether component information or script information exists in the parent data, if so, recursively calling the component information or the script information as the parent data in a third step and a fourth step respectively, returning the component xml or the script xml generated by recursive calling to the parent xml and inserting the component xml or the script xml into the parent xml;
step five: and after the recursive call is finished, inserting the finally generated parent xml into the main xml storage space in the step two to generate a final xml code.
As shown in fig. 2, the xml code first generates a beginning statement and an ending statement of a main xml, where the beginning statement and the ending statement are xml modular statements and are descriptions of the xml code, and then item data, scene data, and sand table data are used as parent data to generate a corresponding parent xml beginning statement and parent xml code, and the parent xml code is generated in a process that attributes of the parent data and values corresponding to the attributes are constructed as xml key value pairs, that is, xml statements corresponding to the attributes of the parent data, and the generated xml statements are combined together, that is, a process of generating the parent xml.
The recursive call is that when the data attribute is detected to contain subordinate component information or script information in the father data, the subordinate component information or script information is used as the father data, a component xml or script xml is generated according to the way that the father data generates an xml code, the generated component xml or script xml is inserted into the corresponding father xml, if the component information or the script information also contains component information or script information of a smaller level, the recursive call is performed again until the component information or the script information is not detected, at this moment, the recursive call is completed, and the father xml is inserted between the beginning statement and the ending statement of the main xml to produce complete xml.
An xml code generation system comprises a main control module, a data processing module, a classified data reading module, an item module, a scene module, a sand table module, a script module, a component module and a universal key value corresponding module; wherein the content of the first and second substances,
the main control module is used for reading and classifying the panoramic metadata, performing recursive calling on component data or script data serving as parent data, inserting parent xml into a main xml storage space, and finally generating an xml code;
the data processing module is used for reading and classifying the panoramic metadata from the database;
the classification data reading module is used for reading the attribute of the panoramic classification data and the value corresponding to the attribute from the storage space;
the item module is used for receiving the attribute of the item data read out from the classified data reading module and the value corresponding to the attribute;
the scene module is used for receiving the attributes of the scene metadata read out from the classified data reading module and the values corresponding to the attributes;
the sand table module is used for receiving the attribute of the sand table metadata read out from the classified data reading module and the value corresponding to the attribute;
the script module is used for receiving the attribute of the script information read out from the classified data reading module and the value corresponding to the attribute;
the component module is used for receiving the attribute of the component information read out from the classified data reading module and the value corresponding to the attribute;
and the universal key value corresponding module is used for constructing the attributes in the item module, the scene module, the sand table module, the script module and the component module and the values corresponding to the attributes into attribute key value pairs.
As shown in fig. 3, the inverted tree structure is constructed by storing panoramic metadata generated in a panoramic editing process into a database, wherein the database stores the panoramic metadata according to a data table structure, and the panoramic metadata includes project metadata, scene metadata, sand table layer metadata, script metadata, and component metadata, wherein,
the attributes of the project metadata comprise project information, project titles, opening states, global music, global special effects, global world landmarks and welcome page information, wherein the global world landmarks comprise promotion information in the projects. And the item metadata is read from the database and is changed into item data, and the component information and the script information with the item attributes are put into a subordinate structure of the item data according to the attribute relationship.
The attributes of the scene metadata comprise scene information, a scene title, a scene picture, a grouping identifier, scene music, a scene special effect, a scene sedum landmark, a scene zooming limit and a scene visual angle limit, wherein the grouping identifier can divide scenes with the same grouping identifier into the same scene grouping, the data processing module changes the scene metadata into the scene data when reading the scene metadata from the database, and when reading the scene metadata, if the attribute information of the grouping identifiers of the scene data 1, the scene data 2 and the scene data n is the same, the scene data 1, the scene data 2 and the scene data n are sub-scenes under the same scene grouping, and the scene place and place identifier comprises promotion information in a certain scene.
The attributes of the Sha Panceng metadata comprise sand table layer information, a layer title and a layer background, wherein the sand table layer is an abbreviated schematic diagram in a panoramic project, the Sha Panceng metadata is changed into sand table data after being read out from a database, and component information and script information with the sand table attributes are placed in subordinate structures of the sand table data according to attribute relations.
The attribute of the script metadata comprises script information, a script type, a script code, an affiliated item, a scene, a sand table or a component, wherein the affiliated item, the scene, the sand table or the component in the script metadata attribute is used for indicating which item, which scene, which sand table or which component the script metadata belongs to, the script metadata is read out from a database and changed into the script information, and the script metadata is divided into subordinate structures of the item data, the scene data, the sand table or the component information according to the attribute information of the affiliated item, the scene, the sand table or the component contained in the script information.
The attributes of the component metadata comprise component information, a component title, a component picture, component coordinates, script code calls and belonged items, scenes or sand tables, wherein the attributes of the belonged items, scenes or sand tables in the component metadata indicate which item, scene or sand table the component belongs to, the component metadata are changed into the component information after being read out from a database, and the component metadata are classified into subordinate structures of the item data, the scene data or the sand table data according to the attribute information of the belonged items, scenes or sand tables contained in the component information.
The project data, the scene data and the sand table data may or may not include one or more of component information or script information, and whether the project data, the scene data or the sand table data includes the component information or the script information is completely determined according to whether the attribute information includes the attribute of the component information or the attribute of the script information.
The main control module is preferably a PC, the main control module controls the data processing module to read project metadata, scene metadata, sand table layer metadata, script metadata and component metadata from a database, the data processing module reads each panoramic metadata to classify the panoramic metadata into panoramic classification data, and obtains the master-slave relationship among the data in the panoramic classification data according to the attribute of the panoramic classification data, for example, the scene data includes a grouping identifier, after the data processing module obtains the attribute information of the grouping identifier of the scene data, the scene data with the same grouping identifier is divided into the same scene grouping, and the affiliated project, scene or sand table in the component information indicates the slave relationship between the component information and one or more of the project data, the scene data or the sand table data. And the data processing module stores project data, scene data, sand table data, component information or script information into a storage space in an inverted tree structure according to the read master-slave relationship information.
The main control module controls the classification data reading module to read out the attributes of all panoramic classification data in the storage space and the values corresponding to the attributes and judge the types of the panoramic classification data, if the panoramic classification data are item data, the item module obtains the attributes of the item data and the values corresponding to the attributes, and generates an item attribute key value pair through the universal key value pair module, namely, generates an item data xml statement; if the data is scene data, the scene module acquires the attribute of the scene data and the value corresponding to the attribute, and generates a scene attribute key value pair through the universal key value pair module, namely generates a scene data xml statement; if the data is the sandbox data, the sandbox module obtains the attribute of the sandbox data and the value corresponding to the attribute, and generates a sandbox attribute key value pair through the universal key value pair module, namely a sandbox xml statement is generated; the project data xml statement, the scene data xml statement and the sand table xml statement are all father xml.
If the project data, the scene data or the sand table data are detected to contain the component information or the script information, the component information is sent to a component module or the script information is sent to a script module, at the moment, the component information or the script information is used as parent data, so that the component module generates a component xml, the script module generates a script xml, the generated component xml or the script xml is inserted into the corresponding project xml, scene xml or sand table xml, namely the parent xml, and the generated parent xml is inserted into the main xml, so that the generation of the whole xml code is completed.
The technical means disclosed in the invention scheme are not limited to the technical means disclosed in the above embodiments, but also include the technical scheme formed by any combination of the above technical features. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and such improvements and modifications are also considered to be within the scope of the present invention.

Claims (5)

1. An xml code generation method, characterized by: comprises the following steps of (a) preparing a solution,
the method comprises the following steps: reading panoramic metadata from a database, classifying the panoramic metadata to form panoramic classification data, wherein the panoramic classification data is of an inverted tree structure, a storage space corresponding to the panoramic classification data is established, and the panoramic classification data is stored in the storage space and comprises project data, scene data and sand table data, and the project data comprises data information, component information and script information; the scene data comprises scene information, component information and script information, and the sand table data comprises sand table information, component information and script information;
step two: establishing a main xml storage space, simultaneously generating beginning and ending xml sentences and storing the beginning and ending xml sentences in the main xml storage space, reading panoramic classification data, and taking the obtained project data, scene data or sand table data as parent data;
step three: establishing a father xml temporary storage space, generating father xml beginning and father xml ending sentences at the same time, storing the father xml temporary storage space, reading attribute information of father data, and constructing attributes and values in the father data into xml key value pairs which are spliced to the father xml beginning in the father xml temporary storage space;
step four: detecting whether component information or script information exists in the parent data, if so, recursively calling the component information or the script information as the parent data to perform a third step and a fourth step respectively, returning the component xml or the script xml generated by recursive calling to the parent xml and inserting the component xml or the script xml into the parent xml;
step five: and after the recursive call is finished, inserting the finally generated parent xml into the main xml storage space in the step two to generate a final xml code.
2. The xml code generation method according to claim 1, wherein: in the first step, the panoramic metadata is stored in a database in a data table form.
3. The xml code generation method according to claim 1, wherein: classifying according to attribute information of panoramic metadata, wherein any panoramic classified data of the project data, the scene data, the sand table data, the script information and the component information comprises at least one attribute and a value corresponding to the attribute; the panoramic metadata is classified according to at least one attribute.
4. The xml code generation method according to claim 1, wherein: in the first step, the inverted tree structure is established by reading the master-slave relationship among the attributes of various classified data in project data, scene data, sand table data, script information and component information.
5. An xml code generation system employing the method of any one of claims 1 to 4, wherein: comprises that
The system comprises a main control module, a data processing module, a classified data reading module, a project module, a scene module, a sand table module, a script module, an assembly module and a general key value corresponding module; wherein the content of the first and second substances,
the main control module is used for reading and classifying the panoramic metadata, performing recursive calling by taking component data or script data as parent data, inserting parent xml into a main xml storage space, and finally generating an xml code;
the data processing module is used for reading and classifying the panoramic metadata from the database;
the classification data reading module is used for reading the attribute of the panoramic classification data and the value corresponding to the attribute from the storage space;
the item module is used for receiving the attribute of the item data read out from the classified data reading module and the value corresponding to the attribute;
the scene module is used for receiving the attributes of the scene metadata read out from the classified data reading module and the values corresponding to the attributes;
the sand table module is used for receiving the attribute of the sand table metadata read out from the classified data reading module and the value corresponding to the attribute;
the script module is used for receiving the attribute of the script information read out from the classified data reading module and the value corresponding to the attribute;
the component module is used for receiving the attribute of the component information read out from the classified data reading module and the value corresponding to the attribute;
and the universal key value corresponding module is used for constructing the attributes in the item module, the scene module, the sand table module, the script module and the component module and the values corresponding to the attributes into attribute key value pairs.
CN201910867107.9A 2019-09-12 2019-09-12 Method and system for generating xml code Active CN110659393B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910867107.9A CN110659393B (en) 2019-09-12 2019-09-12 Method and system for generating xml code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910867107.9A CN110659393B (en) 2019-09-12 2019-09-12 Method and system for generating xml code

Publications (2)

Publication Number Publication Date
CN110659393A CN110659393A (en) 2020-01-07
CN110659393B true CN110659393B (en) 2022-10-14

Family

ID=69037122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910867107.9A Active CN110659393B (en) 2019-09-12 2019-09-12 Method and system for generating xml code

Country Status (1)

Country Link
CN (1) CN110659393B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113778427A (en) * 2020-06-09 2021-12-10 北京字节跳动网络技术有限公司 Special effect manufacturing method and device
CN111881323B (en) * 2020-06-19 2022-05-20 四川新网银行股份有限公司 Table separation method based on sequencing field and time routing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473108A (en) * 2013-08-12 2013-12-25 福建富士通信息软件有限公司 Java code generating method
CN107368346A (en) * 2017-07-06 2017-11-21 万惠投资管理有限公司 A kind of code generating method and device based on metadata and script engine
CN107820701A (en) * 2015-05-01 2018-03-20 三星电子株式会社 Developer's exchange system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5326910B2 (en) * 2009-01-20 2013-10-30 ソニー株式会社 Information processing apparatus, information processing method, and program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473108A (en) * 2013-08-12 2013-12-25 福建富士通信息软件有限公司 Java code generating method
CN107820701A (en) * 2015-05-01 2018-03-20 三星电子株式会社 Developer's exchange system
CN107368346A (en) * 2017-07-06 2017-11-21 万惠投资管理有限公司 A kind of code generating method and device based on metadata and script engine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于模板的.Net三层架构的代码自动生成;刘于新等;《计算机技术与发展》;20120810(第08期);全文 *

Also Published As

Publication number Publication date
CN110659393A (en) 2020-01-07

Similar Documents

Publication Publication Date Title
CN108089893B (en) Method and device for determining redundant resources, terminal equipment and storage medium
CN108647883B (en) Business approval method, device, equipment and medium
CN108345485B (en) Identification method and device for interface view
CN110659393B (en) Method and system for generating xml code
CN111209344A (en) Data synchronization method and device
CN106055554A (en) Method, system and terminal for electronic phone album classification
CN102831167B (en) XML (extensive makeup language) processing method and device for graph structure
CN104915201A (en) Interface generating method and device
CN111666100B (en) Software framework generation method and device, electronic equipment and storage medium
CN105354138A (en) Method for determining specific control attribute of mobile phone page
CN113392068A (en) Data processing method, device and system
CN106919390A (en) A kind of method and apparatus of page generation
CN110442371A (en) A kind of method, apparatus of release code, medium and computer equipment
CN102065237A (en) Title generator capable of being convenient to process title files
CN101661277B (en) Part processing method and device used for numerical control machine
CN104135628A (en) Video editing method and terminal
CN110989999A (en) Code generation method and device, electronic equipment and medium
CN113450463B (en) Preform conversion method and apparatus
CN103942203A (en) Information processing method and theme information base manufacturing system
CN107590044B (en) Testing method, device and equipment for distributed storage cluster
CN112488642B (en) Cloud file management method based on structured labels and taking object as core
CN114185894A (en) Method and device for generating product structure tree
CN113760907A (en) Data uniqueness identification method in database
CN112394930A (en) Method, electronic device, and medium for automatically constructing front-end interface
CN102063414A (en) Method and device for positioning file contents

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