Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for extracting template file data structure

A template file and data structure technology, applied in the Internet field, can solve problems such as synchronous generation of business data, inability to complete the correctness and verification of template files in time

Active Publication Date: 2016-07-06
ADVANCED NEW TECH CO LTD
View PDF2 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, business data cannot always be generated synchronously with template files; especially for businesses with complex scenarios, it is difficult to provide business data in all scenarios at the same time, which makes it impossible to complete the correctness verification of template files in time

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for extracting template file data structure
  • Method and device for extracting template file data structure
  • Method and device for extracting template file data structure

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] When extracting the data structure of the template file, the computer can extract the data structure of the data parameters according to the description of each line of code; however, if the code statement is complex, such as involving assignment, macro call, for loop and other operations, Due to the changes involved in parameter types, values, etc., the computer cannot make effective distinctions and responses.

[0022] For example, assume the template file is:

[0023] {%setb=a%}

[0024] {%setc=b%}

[0025] {{c.d}}

[0026] {%set=1%}

[0027] Based on the processing methods in related technologies, the data structure directly generated by the computer may be:

[0028] {a:'',b'',c:{d:''},e:1}

[0029] However, due to the assignment operation of "=", the expected data structure is only:

[0030] {a:{d:''}}

[0031] In other words, only the data of a and d need to be provided in the above template file; among them, b and c are only formal parameters of intermedia...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method and device for extracting a template file data structure. The method comprises the following step: generating an abstract syntax tree corresponding to a template file; extracting data related nodes in the abstract syntax tree, and generating a corresponding initial data structure according to the content of the data related nodes and the state attribute of the content, and adding the initial data structure to an initial data structure set; adjusting the initial data structure in the initial data structure set according to the state attribute corresponding to the initial data structure so as to obtain a data structure set corresponding to the template file. Through the technical scheme of the invention, the data structure of the template file at the front end can be automatically extracted so as to verify the accuracy of the template file without needing the supply of service data at the back end.

Description

technical field [0001] The present application relates to the technical field of the Internet, in particular to a method and device for extracting a data structure of a template file. Background technique [0002] With the continuous development of network technologies, users can browse web pages through various terminals. The content of the webpage viewed by the user is usually divided into two parts: the template file of the webpage and the business data; by using the business data in the template file for rendering, the content of the webpage finally presented to the user can be output. For example, the template file is " <h1>Hello, {{name}}!< / h1> ", and the business data is "{name:'world'}", the output will be " <h1> Hello, world!< / h1> ". [0003] In the above operation mode, the correctness of the template file can only be known after using the corresponding business data, that is, the correctness verification of the template file is heavily d...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 杨周璇
Owner ADVANCED NEW TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products