CN110244978A - A kind of method and device of graphic software platform data structure - Google Patents

A kind of method and device of graphic software platform data structure Download PDF

Info

Publication number
CN110244978A
CN110244978A CN201910514522.6A CN201910514522A CN110244978A CN 110244978 A CN110244978 A CN 110244978A CN 201910514522 A CN201910514522 A CN 201910514522A CN 110244978 A CN110244978 A CN 110244978A
Authority
CN
China
Prior art keywords
data structure
file
row
output
software platform
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.)
Pending
Application number
CN201910514522.6A
Other languages
Chinese (zh)
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.)
INFORMATION2 SOFTWARE (SHANGHAI) Ltd
Original Assignee
INFORMATION2 SOFTWARE (SHANGHAI) 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 INFORMATION2 SOFTWARE (SHANGHAI) Ltd filed Critical INFORMATION2 SOFTWARE (SHANGHAI) Ltd
Priority to CN201910514522.6A priority Critical patent/CN110244978A/en
Publication of CN110244978A publication Critical patent/CN110244978A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of method and devices of graphic software platform data structure, and described method includes following steps: step S1, and the data structure for obtaining setting format describes file;Step S2, it parses the data structure and describes file, it the data structure is described each data structure in file automatically generates graphics data structure output to show, the present invention in the form of patterned by showing data structure with character, the content of output can be pasted in program and be used as annotation, facilitate the subsequent program development design of programmer.

Description

A kind of method and device of graphic software platform data structure
Technical field
The present invention relates to computer software development fields, a kind of method more particularly to graphic software platform data structure and Device.
Background technique
In computer software development process, when being related to binary data processing, various data are often used Structure, data structure describe the composition of binary data, such as the head of TCP message, by different length, the word of different meanings Duan Zucheng.Programmer designs for convenience, and data structure generally will form visual document, but be typically all at present It is depicted as visible document file manually by programmer, this artificial drafting mode is time-consuming and laborious.
Summary of the invention
In order to overcome the deficiencies of the above existing technologies, purpose of the present invention is to provide a kind of graphic software platform data knots The method and device of structure, to show data structure in the form of patterned with character, the content of output can be pasted It is used in program as annotation, facilitates the subsequent program development design of programmer.
In order to achieve the above object, a kind of method that the present invention proposes graphic software platform data structure, includes the following steps:
Step S1, the data structure for obtaining setting format describe file;
Step S2 parses the data structure and describes file, by the data structure describe in file each data structure from The dynamic graphics data structure output that generates is shown.
Preferably, step S2 further comprises:
Step S201, parsing obtain the next line that data structure describes file the first row or final character, its content are made For the i-th row content output of the output file of the graphics data structure;
Step S202 generates byte count mark in the i+1 row interval of the output file;
Step S203 corresponds to byte count mark in the i-th+2 row interval of output file and generates byte interval symbol;
Step S204 reads member Name Ck and byte number CkB that the data structure describes the data structure of file, I-th+3 row of output file indicates corresponding output display according to byte count;
Step S205 generates line Separator in the i-th+4 row of output file;
Step S206 enables i=i+2, and return if step S204 fails the member of the complete output data structure in a line It returns and repeats step S204 and step S205 until graphics data structure output shows and finishes.
Preferably, it in step S201, is described under the first row or the final character of file when parsing the data structure A line then firstly generates comment flags in the i-th row of output file when obtaining data structure name, and then continuously output M is a divides Every symbol, it is then inserted into read data structure name, finally in same a line polishing separator of output file to the line endings.
Preferably, M is the half of the difference of output file line character number and data structure name number of characters.
Preferably, in step S202, comment flags are firstly generated in the i+1 row of output file, then interval generates It is byte number j, j=1,2 ... ..., N, B 3-6, selection principle that byte count, which is behind 0, B spaces that is, after comment flags, The byte count of 0~N is finished for display in energy a line.
Preferably, the power that N is 2.
Preferably, in step S203, comment flags are firstly generated in the i-th+2 row of output file, then interval generates Blank character is first blank character that is, after comment flags, is j-th of blank character after B separators, j=1,2 ... ..., N, and B is 3-6 is blank character that is, under N+1 byte count of lastrow, is separator under the position the B space of lastrow.
Preferably, in step S204, comment flags are firstly generated in the i-th+3 row of output file, then interval generates Blank character is the member Name of tactic data structure between blank character, i.e., is blank character after comment flags, in (B+1) * It is blank character at CkB, is k-th of member Name between -1 k-th of blank character of kth, k=1,2 ... ..., K, K is data The number of members of structure, current row its column position if having blank character are identical as the blank character column position of lastrow.
Preferably, in step S205, comment flags are firstly generated in the i-th+4 row of output file, then continuous output Separator is to the line endings.
In order to achieve the above objectives, the present invention also provides a kind of devices of graphic software platform data structure, comprising:
Data structure describes file obtaining unit, and the data structure for obtaining setting format describes file;
Graphic software platform unit describes file for parsing the data structure, the data structure is described in file Each data structure automatically generates graphics data structure output and shows.
Compared with prior art, a kind of method and device of graphic software platform data structure of the present invention is by by data structure It is showed in the form of patterned, and the content that can be output it is pasted in program and used as annotation, facilitates programming people The program development design of member.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of the method for graphic software platform data structure of the present invention;
Fig. 2 is the schematic diagram that data structure describes file in the specific embodiment of the invention;
Fig. 3 is the detailed flowchart of step S2 in the specific embodiment of the invention;
Fig. 4 is patterned data structure schematic diagram in the specific embodiment of the invention;
Fig. 5 is a kind of system architecture diagram of the device of graphic software platform data structure of the present invention.
Specific embodiment
Below by way of specific specific example and embodiments of the present invention are described with reference to the drawings, those skilled in the art can Understand further advantage and effect of the invention easily by content disclosed in the present specification.The present invention can also pass through other differences Specific example implemented or applied, details in this specification can also be based on different perspectives and applications, without departing substantially from Various modifications and change are carried out under spirit of the invention.
Fig. 1 is a kind of step flow chart of the method for graphic software platform data structure of the present invention.As shown in Figure 1, of the invention A kind of method of graphic software platform data structure, includes the following steps:
Step S1, the data structure for obtaining setting format describe file.That is, data structure describes file by program Designer writes according to preset format, and file is text formatting, multiple data structures can be successively described, in this hair In bright specific embodiment, as shown in Fig. 2, the descriptor format that the data structure describes each data structure of file is as follows:
1st behavioral data structure title
Each member of data structure appears on two lines, and the first row is member Name, and the second row is the byte number that member occupies
Character string " ----END---- " Zhan Yihang, represents individual data structure and describes, behind can restart to retouch State next data structure.
Step S2 parses the data structure and describes file, by the data structure describe in file each data structure from The dynamic graphics data structure output that generates is shown.
Specifically, as shown in figure 3, step S2 further comprises:
Step S201, parsing obtain data structure and describe a line under file the first row or final character " END ", will be in it Hold the i-th row content output of the output file as the graphics data structure.Specifically, when parse data structure description When the first row or final character " END " next line, i.e. data structure name of file, then (it is assumed to be in certain row of output file I-th row) double slashes comment flags " // " are firstly generated, M separator such as strigula "-" is then continuously exported, institute is then inserted into The data structure name of reading, it is finally excellent to the line endings in same a line polishing separator such as strigula "-" of output file Selection of land, M is the half of the difference of output file line character number and data structure name number of characters, i.e., so that the data structure name position In the middle position of current line, as shown in Figure 4;
Step S202 generates byte count mark in the i+1 row interval of the output file.Specifically, in output file I+1 row firstly generate double slashes comment flags " // ", then interval generates byte count, i.e. double slashes comment flags " // " Afterwards to be behind 0, B spaces be byte number j, j=1,2 ... ..., N, B 3-6, selection principle are display to finish 0 in a line The byte count of~N, N are setting value, it is preferable that N is generally 2 power such as 8,16 or 32, and byte count is mainly for convenient Data capacity is calculated, as shown in Figure 4;
Step S203 generates byte interval symbol in the i-th+2 row interval of output file.Specifically, the i-th of output file + 2 rows firstly generate double slashes comment flags " // ", and then interval generates blank character such as vertical line " | ", i.e. double slashes comment flags " // " is first blank character such as vertical line " | " afterwards, is j-th of blank character such as vertical line " | ", j after B separators such as strigula "-" =1,2 ... ..., N, B 3-6, i.e., be blank character such as vertical line " | " under N+1 byte count of lastrow, and the position B of lastrow is empty It is separator such as strigula "-" under lattice, as shown in Figure 4;
Step S204 reads member Name Ck and byte number CkB that the data structure describes the data structure of file, I-th+3 row of output file indicates corresponding output display according to byte count.Specifically, the i-th+3 row of output file first It generates double slashes comment flags " // ", then interval generates blank character such as vertical line " | ", is sequence between blank character such as vertical line " | " The member Name of the data structure of arrangement, i.e. double slashes comment flags " // " are afterwards blank character such as vertical line " | ", in (B+1) * CkB Place is blank character such as vertical line " | ", is k-th of member Name between -1 k-th of blank character of kth such as vertical line " | ", k=1, 2 ... ..., K, K are the number of members of data structure, i.e., current row is if having interval mansion such as vertical line " | " between its column position and lastrow It is identical every symbol column position, as shown in Figure 4;
Step S205 generates line Separator in the i-th+4 row of output file, specifically, first in the i-th+4 row of output file Mr. is at double slashes comment flags " // ", and then continuously output separator such as strigula "-" is to the line endings, as shown in Figure 4;
Step S206 enables i=i+2, and return if step S204 fails the member of the complete output data structure in a line It returns and repeats step S204 and step S205 until graphics data structure output shows and finishes, as shown in Figure 4.
Fig. 5 is a kind of system architecture diagram of the device of graphic software platform data structure of the present invention.As shown in figure 5, of the invention A kind of device of graphic software platform data structure, comprising:
Data structure describes file obtaining unit 501, and the data structure for obtaining setting format describes file.Namely It says, data structure describes file and write by programmer according to preset format, and file is text formatting, Ke Yiyi The secondary multiple data structures of description, in the specific embodiment of the invention, the data structure describes each data structure of file Descriptor format is as follows:
1st behavioral data structure title
Each member of data structure appears on two lines, and the first row is member Name, and the second row is the byte number that member occupies
Character string " ----END---- " Zhan Yihang, represents individual data structure and describes, behind can restart to retouch State next data structure.
Graphic software platform unit 502 describes file for parsing the data structure, the data structure is described file In each data structure automatically generate graphics data structure output and show.
Wherein, graphic software platform unit 502 is specifically used for:
It obtains data structure and describes a line under file the first row or final character " END ", using its content as the figure I-th row content of the output file of shape data structure exports.Specifically, when the first row for parsing data structure and describing file It is or when final character " END " next line, i.e. data structure name, then raw first in certain row (being assumed to be the i-th row) of output file At double slashes comment flags " // ", M separator such as strigula "-" is then continuously exported, read data knot is then inserted into Structure title, finally in same a line polishing separator such as strigula "-" of output file to the line endings, it is preferable that M is output The half of the difference of file line number of characters and data structure name number of characters, i.e., so that the data structure name is located in current line Between position;
Byte count mark is generated in the i+1 row interval of output file.Specifically, first in the i+1 row of output file Mr. is at double slashes comment flags " // ", and then interval generates byte count, i.e. double slashes comment flags " // " are empty for 0, B afterwards It is byte number j, j=1,2 ... ... after lattice, N, B 3-6, selection principle is to show the byte meter for finishing 0~N in a line Number, N is setting value, it is preferable that N is generally close time such as 8,16 or 32 of 2, and byte count calculates data appearance mainly for facilitating Amount;
Byte interval symbol is generated in the i-th+2 row interval of output file.Specifically, the i-th+2 row of output file first It generates double slashes comment flags " // ", then interval generates blank character such as vertical line " | ", i.e. double slashes comment flags " // " are afterwards the One blank character such as vertical line " | ", is j-th of blank character such as vertical line " | " after B separators such as strigula "-", j=1, 2 ... ..., N, B 3-6 are blank character such as vertical line " | " that is, under N+1 byte count of lastrow, under the position the B space of lastrow For separator such as strigula "-";
Member Name Ck and byte number CkB that the data structure describes the data structure of file are read, in output file The i-th+3 row corresponding output display is indicated according to byte count.Specifically, diclinic is firstly generated in the i-th+3 row of output file Thick stick comment flags " // ", it is tactic number between blank character such as vertical line " | " that then interval, which generates blank character such as vertical line " | ", According to the member Name of structure, i.e. double slashes comment flags " // " are blank character such as vertical line " | " afterwards, are interval at (B+1) * CkB Symbol is k-th of member Name, k=1,2 ... ..., K, K between -1 k-th of blank character of kth such as vertical line " | " such as vertical line " | " For the number of members of data structure, i.e. the blank character column position of current row its column position and lastrow if having interval mansion such as vertical line " | " It is identical;
Line Separator is generated in the i-th+4 row of output file, specifically, is firstly generated in the i-th+4 row of output file double Slash comment flags " // " then continuously export separator such as strigula "-" to the line endings;
If failing the member of the complete output data structure in a line in the i+3 row of output file, i=i+2 is enabled, is laid equal stress on The process of multiple above-mentioned i+3 row and i+4 row is finished up to graphics data structure output is shown.
In conclusion a kind of method and device of graphic software platform data structure of the present invention by by data structure with figure The form of change shows, and the content that can be output it is pasted in program and used as annotation, facilitates the journey of programmer Sequence exploitation design.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.Any Without departing from the spirit and scope of the present invention, modifications and changes are made to the above embodiments by field technical staff.Therefore, The scope of the present invention, should be as listed in the claims.

Claims (10)

1. a kind of method of graphic software platform data structure, includes the following steps:
Step S1, the data structure for obtaining setting format describe file;
Step S2 parses the data structure and describes file, and the data structure is described each data structure in file and is given birth to automatically It is shown at graphics data structure output.
2. a kind of method of graphic software platform data structure as described in claim 1, which is characterized in that step S2 is further wrapped It includes:
Step S201, parsing obtains the next line that data structure describes file the first row or final character, using its content as institute State the i-th row content output of the output file of graphics data structure;
Step S202 generates byte count mark in the i+1 row interval of the output file;
Step S203 corresponds to byte count mark in the i-th+2 row interval of output file and generates byte interval symbol;
Step S204 reads member Name Ck and byte number CkB that the data structure describes the data structure of file, is exporting I-th+3 row of file indicates corresponding output display according to byte count;
Step S205 generates line Separator in the i-th+4 row of output file;
Step S206 enables i=i+2 if step S204 fails the member of the complete output data structure in a line, and returns to weight Multiple step S204 and step S205 is until graphics data structure output shows and finishes.
3. a kind of method of graphic software platform data structure as claimed in claim 2, it is characterised in that: in step S201, When the first row or final character next line for parsing the data structure and describing file then exist when obtaining data structure name I-th row of output file firstly generates comment flags, then continuously exports M separator, is then inserted into read data knot Structure title, finally in same a line polishing separator of output file to the line endings.
4. a kind of method of graphic software platform data structure as claimed in claim 3, it is characterised in that: M is output file row The half of the difference of number of characters and data structure name number of characters.
5. a kind of method of graphic software platform data structure as claimed in claim 3, it is characterised in that: in step S202, Comment flags are firstly generated in the i+1 row of output file, then interval generates byte count, i.e., is 0, B after comment flags It is byte number j, j=1,2 ... ... behind space, N, B 3-6, selection principle is that can show the byte for finishing 0~N in a line It counts.
6. a kind of method of graphic software platform data structure as claimed in claim 5, it is characterised in that: the power that N is 2.
7. a kind of method of graphic software platform data structure as claimed in claim 5, it is characterised in that: in step S203, Comment flags are firstly generated in the i-th+2 row of output file, then interval generates blank character, i.e., between first after comment flags It is j-th of blank character, j=1,2 ... ..., N, B 3-6, i.e., under N+1 byte count of lastrow after symbol, B separators It is separator under the position the B space of lastrow for blank character.
8. a kind of method of graphic software platform data structure as claimed in claim 7, it is characterised in that: in step S204, Comment flags are firstly generated in the i-th+3 row of output file, it is tactic between blank character that then interval, which generates blank character, The member Name of data structure is blank character that is, after comment flags, is blank character (B+1) * CkB at, at k-th of kth -1 It is k-th of member Name between blank character, k=1,2 ... ..., K, K is the number of members of data structure, and current row is if having blank character Its column position is identical as the blank character column position of lastrow.
9. a kind of method of graphic software platform data structure as claimed in claim 8, it is characterised in that: in step S205, Comment flags are firstly generated in the i-th+4 row of output file, then continuously export separator to the line endings.
10. a kind of device of graphic software platform data structure, comprising:
Data structure describes file obtaining unit, and the data structure for obtaining setting format describes file;
Graphic software platform unit, describes file for parsing the data structure, and the data structure is described each number in file Graphics data structure output is automatically generated according to structure to show.
CN201910514522.6A 2019-06-14 2019-06-14 A kind of method and device of graphic software platform data structure Pending CN110244978A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910514522.6A CN110244978A (en) 2019-06-14 2019-06-14 A kind of method and device of graphic software platform data structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910514522.6A CN110244978A (en) 2019-06-14 2019-06-14 A kind of method and device of graphic software platform data structure

Publications (1)

Publication Number Publication Date
CN110244978A true CN110244978A (en) 2019-09-17

Family

ID=67887191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910514522.6A Pending CN110244978A (en) 2019-06-14 2019-06-14 A kind of method and device of graphic software platform data structure

Country Status (1)

Country Link
CN (1) CN110244978A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268171A (en) * 2005-03-22 2006-10-05 Nec Corp Visual display unit, visual display program, visual display server, and visual display system
CN104685467A (en) * 2012-09-28 2015-06-03 起元技术有限责任公司 Graphically representing programming attributes
CN106557454A (en) * 2015-09-30 2017-04-05 腾讯科技(深圳)有限公司 Conversion method and converting system of the document to form
CN107851089A (en) * 2015-06-29 2018-03-27 微软技术许可有限责任公司 Distortion document

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006268171A (en) * 2005-03-22 2006-10-05 Nec Corp Visual display unit, visual display program, visual display server, and visual display system
CN104685467A (en) * 2012-09-28 2015-06-03 起元技术有限责任公司 Graphically representing programming attributes
CN107851089A (en) * 2015-06-29 2018-03-27 微软技术许可有限责任公司 Distortion document
CN106557454A (en) * 2015-09-30 2017-04-05 腾讯科技(深圳)有限公司 Conversion method and converting system of the document to form

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴江 等: "《下一代的IP骨干网络技术——多协议标记交换》", 31 January 2001, 人民邮电出版社 *

Similar Documents

Publication Publication Date Title
CN105607897B (en) Chip register code automatic generation method and its system
US20020075284A1 (en) Display of images and image transitions
CN105279144A (en) Method and device for typesetting wind tunnel test data text files
CN103020295A (en) Problem label marking method and device
CN104375952A (en) Method for reading data from ring buffer
CN110110454B (en) Circuit diagram automatic conversion system and method thereof
WO2023071242A1 (en) Text generation method and apparatus, and storage medium
CN105094765B (en) Animation display processing method and animation display processing unit
CN103793349A (en) Data processing method and data processing device
CN108038890A (en) Vector diagram demonstration method, device, equipment and computer storage medium
CN109683881A (en) A kind of code format method of adjustment and device
CN112040271A (en) Cloud intelligent editing system and method for visual programming
CN102831152B (en) A kind of FMEA process based on template model and text matches is assisted and approaches to IM
CN102314798B (en) Method and device for automatically simplifying shape points of polygonal surface elements of electronic map
CN105893601B (en) A kind of data comparison method
CN106354841A (en) Testing method and device of recommendation algorithms
CN110244978A (en) A kind of method and device of graphic software platform data structure
CN103218460B (en) Image tag complementing method based on the sparse reconstruct of optimum linearity
CN103345400B (en) Data processing method and device
CN106033412A (en) Text conversion method and device
CN105930584B (en) A kind of Virtual Experiment Platform Based and its implementation of computer composition and system structure
CN107862166A (en) A kind of intelligent Simulation experiment design system and design method
CN106649321A (en) Mind map display method and device
CN101295245A (en) Intelligent extracting method based on model information
Cummings Coding and scripting techniques for FSM designs with synthesis-optimized, glitch-free outputs

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190917

RJ01 Rejection of invention patent application after publication