CN1501624A - Method for interpreting data structure of memory data block - Google Patents

Method for interpreting data structure of memory data block Download PDF

Info

Publication number
CN1501624A
CN1501624A CNA021453047A CN02145304A CN1501624A CN 1501624 A CN1501624 A CN 1501624A CN A021453047 A CNA021453047 A CN A021453047A CN 02145304 A CN02145304 A CN 02145304A CN 1501624 A CN1501624 A CN 1501624A
Authority
CN
China
Prior art keywords
variable
internal storage
storage data
node
data piece
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA021453047A
Other languages
Chinese (zh)
Other versions
CN100461687C (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CNB021453047A priority Critical patent/CN100461687C/en
Publication of CN1501624A publication Critical patent/CN1501624A/en
Application granted granted Critical
Publication of CN100461687C publication Critical patent/CN100461687C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

The invention discloses a method for interpreting the data structure of the internal memory data blocks which comprises, the structure analyzer analyzing the source file to create the type structural description file, and storing it on the host computer where the internal memory decryption course locates, obtaining the byte stream data of the internal memory data block, selecting the structural description file corresponding to the internal memory data block and creating a structure tree, and displaying the meaning of each byte of the internal memory data block, thus the internal memory data block is interpreted.

Description

Explain the method for the data structure of internal storage data piece
Technical field
The invention belongs to the mechanics of communication class, relate in particular to the method that in the mechanics of communication distributed system network bytes flow data is made an explanation.
Background technology
At present, the data structure definition in the mechanics of communication is to define in the source code of program, and this is the final source that obtains structural information.Usually, in program compilation, can generate a very complicated and huge symbol table, it has comprised the definition of all variablees, type and function and the information of action scope.Program will be searched its type structure and memory address according to variable name (symbol) in symbol table when debugging, thereby explain the binary data of this variable in internal memory.In fact, have only on the one hand program compilation is become debug version (be about to symbol table and enroll execute file), could find the memory address and the type structure of variable by variable name, and like this execute file must be huge, and efficient also can be very low.On the other hand, even if program compilation is become Release version (not containing symbol table), and (break away from debugging enironment as the method described in the Chinese patent CN1286431A of pressing by other means, directly read symbol table information), with memory address and the type structure of obtaining certain variable, thereby obtain internal storage data and make an explanation.Though can debug by variable name like this, do not knowing under the situation of variable name, want that the correlation technique of explaining an internal storage data, symbol table and dependent symbols table thereof just seems powerless.Also have on the one hand, symbol table to the explanation of internal storage data at each member variable, though it can provide the value of each member variable, but to the very complicated macrostructure of those data structures, member variable is very many, symbol table can not provide the practical significance of each member variable, so check still very effort, this is to explaining that internal storage data is unsatisfactory.
In communication technique field; perhaps with the closely-related field of other data processing in related program; usually can distribute some very big data fields, perhaps these data fields do not have variable name and its correspondence, so common debugger can not make an explanation to these data fields.But the content of these data fields is very important, in case there is fault to take place, the developer is concerned about most, can the wrong cutting point in the fastest location be exactly these data fields simultaneously.So,, will give fault location and solve and bring huge difficulty if can not make effectively explanation to these huge data fields.
Summary of the invention
The purpose of this invention is to provide a kind of method of explaining the data structure of internal storage data piece, solve an above-mentioned difficult problem, internal storage data is made an explanation, in time determine fault location to solve many-sided needs such as communication failure fast to satisfy.
The object of the present invention is achieved like this: a kind of method of explaining the data structure of internal storage data piece comprises the following steps:
1, analyze source file by structure analyzer, generate the description document of type structure, and leave on the main frame of explaining internal storage data process place.
2, obtain the bytes of stream data of internal storage data piece, select the structure description file corresponding, and generate a structure tree and show the meaning of this each byte of internal storage data piece, thereby explain this internal storage data piece with this internal storage data piece.
Because the present invention has adopted above technical scheme, thereby has following advantage:
1, directly obtain information, so the developer revises organization definition or version changes the correctness that can not influence this explanation from source file.
2, note is carried out in the effect of each member variable by the developer when the definition structure, these annotation information are as the part of member variable attribute list, also with the write structure description document, thereby in structure tree, can obtain equally, so just help the understanding of attendant to each variable more, this is that symbol table of the prior art is irrealizable.
3, because structure description file has been abandoned the information of many and structure-irrelevant in the source file, make its very small and exquisite.And, because the data storage method itself that structure description file adopts is exactly a tree, and be different from the list structure of symbol table, so just saved and searched Hash table institute's time spent, improved the efficient of generating structure tree greatly.
4, the present invention can make an explanation to internal storage data, and does not need to be concerned about whether this internal storage data has variable name and its correspondence, and also not needing this program is the Release version, be completely free of the restriction of symbol table, only need know that this internal storage data is to get final product with which kind of structure is corresponding.And when obtaining the value of each member variable, can also obtain its practical significance.So method of the present invention is to important improvement of existing symbol table technology and debugging technique thereof and raising.
Description of drawings
Fig. 1 is a kind of schematic flow sheet from description document reduction structure tree of the present invention;
Fig. 2 is a kind of schematic flow sheet that obtains structural information from source file of the present invention.
Embodiment
Below in conjunction with accompanying drawing enforcement of the present invention is done as detailed below:
In Fig. 1, the present invention analyzes source file by structure analyzer, generates the description document of type structure, and leaves on the main frame of explaining internal storage data process place.The internal storage data piece that its internal storage data piece can be this machine; It also can be the internal storage data piece on other main frames.Internal storage data piece on other main frames is that a proxy module is set on the main frame at place, is responsible for the internal storage data in that main frame is sent to this machine.
This step can be divided into following step again and realize:
1, obtain all header files with this structurally associated.
2, read these header files, all structures (analytical structure type and member variable thereof with wherein definition, as the Struct type in the C language, Class type among C++ and the Java) puts in the tabulation, its tabulation of member variable that each structure is corresponding has again so just had the information of all structures.
3, structure with required establishment is a starting point, analyze its each member variable, the attribute list that generates member variable (comprises the side-play amount from the structure starting point, type, length, effect (note of variable), title, dimension etc.), if member variable also is a structure type, then continue to analyze its pairing structure.When per minute is analysed a member variable, all in the attribute list write structure description document with it, up to that structural analysis end of required establishment.
The step of its concrete executive program is as follows:
1, open description document and read structrual description note in the file header, step 101, and create root node as node name with this, step 102 is pressed into present node the father node of storehouse as following node, step 103 simultaneously, and judge step 104 to reading next variable's attribute table in the file;
2, the result who reads next variable's attribute table in the file is judged Shi Fou Read gets and loses Defeat, step 105
If failure is then withdrawed from, step 106,
If success, then in the last layer node, add leaf node and with the binding of this node and variable's attribute table according to the content of variable's attribute table, step 107, and do the judgement of structure, step 108;
3, structure is judged,
If, then present node is pressed into the program of storehouse as the father node of following node, step 109,
If not, then to whether last variable of structure judge step 110;
4, whether to last variable of structure is judged,
If not, then return and make the program step of judgement, promptly return step 104 reading next variable's attribute table in the file
If, then current parent's node is withdrawed from storehouse, step 111, and return and make the program of judgement to reading next variable's attribute table in the file, promptly return step 104.
In Fig. 2, the present invention obtains structural information from source file, thereby explains this internal storage data piece, and the step of its concrete executive program is as follows:
1, if newline arranged then handle newline, if not then read next line, step 201; And whether file finished to judge step 202;
2, whether file is finished to judge,
If, then withdraw from, step 213,
If not, then cutting comment section (keep variable-definition after note) is reformulated delegation, step 203, and make the whether judgement of constant definition, step 204;
3, to whether constant definition is judged,
If then the value with constant and it adds Hash table, step 205, if return newline then handle newline, if
If not, then do the judgement whether organization definition begins, step 206;
4, to whether organization definition begins to judge,
If, then be pressed into storehouse, generate lstVar as current variable list with that lstVar and structure name are pressed into Hash table hsStruct is for future reference, step 207, and if return newline then handle newline, if not then read the program step of next line, step 201;
If not, then to whether organization definition finishes to judge step 208;
5) to whether organization definition finishes to judge,
If, pop-up a stack then, step 211 adds the variable list of current structure correspondence with variable and structure title, step 212, and if return newline then handle newline, if not then read the program step of next line, step 201,
If not, then to whether variable-definition is judged step 209;
6) to whether variable-definition is judged,
If not, if then return newline then handle newline, if not then read the program step of next line, step 201,
If, then name variable and variable's attribute table are added current Hash table, step 210, and if return newline then handle newline, if not then read the program step of next line, step 201.
From the above mentioned, the present invention is when the generating structure description document, a byte counter should at first be set, structure with internal storage data piece correspondence is a starting point, member variable of every processing, byte counter just increases corresponding length, like this, the position of each member variable in the internal storage data piece is exactly the value of current byte counter, it is write in the attribute list of variable, determine by the feature of situational variables name whether this variable is bit variable simultaneously, or array, then these attributes are also added in the attribute list to the write structure description document.In a word, the attribute of variable is many more, and the information that obtains in structure description file is also just many more.
Then, the present invention obtains structural information from source file, i.e. structure analyzer is analyzed grammatical phenomenon in source file by its.These grammers comprise and comprise note, compiling preliminary treatment, constant definition, variable-definition, type definition (organization definition), function definition.The position definition is arranged again in variable-definition, array define, special grammar such as pointer definition, these grammers are all with supported.
After reading in delegation, remove comment section (note after the reservation variable-definition) earlier, new delegation is carried out structural analysis, judge whether this row is constant definition, or type definition (organization definition), or variable-definition.If not then skipping; If constant definition, then the value with this constant and its representative adds in the Hash table for future reference.If type definition (organization definition) beginning then is pressed into storehouse, generate a tabulation lstVar simultaneously as current variable list, and it is for future reference that lstVar and structure name (if do not have the structure title then generate one automatically) are pressed into Hash table hsStruct.If type definition (organization definition) finishes, pop-up a stack then is if judged with this organization definition variable, then with the variable list of this variable and structure title adding current structure correspondence.If variable-definition then adds current variable list lstVar with current variable's attribute table, (the variable's attribute table comprises type, length, title and note).Like this, searched for all source files after, will obtain a Hash table (Key=structure title, Value=contains the tabulation lstVar of all member variables) that contains all structures, just can obtain the information of all member variables of this structure by the structure title.
Thus, the structure tree that is provided with among the present invention generates according to structure description file, and its each leaf node is a member variable of representative structure all.Nested as having in the fruit structure, this node will be made of many child nodes, and each child node is represented each member variable of minor structure, and the rest may be inferred.Each node or byte point have all been bound the attribute list of its pairing member variable.Finish synchronously in the process that generates tree with to the process that each byte of internal storage data piece makes an explanation, node of promptly every generation, the internal storage data of this node correspondence just is read and has explained.After in case structure tree generates, the member variable of byte location structure that just can be from byte stream also can make an explanation to internal storage data to satisfy from certain section byte of the member variable location byte stream of structure, in time determine fault location, solve the needs of aspect such as communication failure fast.
The present invention obtains fabulous effect through testing on the probe module model machine of the ZXSS10 of ZTE Corporation back-end data maintenance terminal.Its probe module sends message to the foreground, the data in the internal memory of acquisition request foreground.On the foreground, individual probe proxy module is arranged, the request of response probe module is sent to the backstage to the data in the internal memory of foreground.After probe obtains raw bytes flow data in the internal memory of foreground, utilize the structure description file with the data structure correspondence foreground that generated to generate structure tree, make each byte in the byte stream can both in structure tree, find variables corresponding corresponding with it.Vice versa, arbitrarily chooses certain node (being certain member variable) of structure tree, can both position in byte stream, and can obtain the more detailed information (attribute) relevant with this variable.For example, preserved in the call data district and all the relevant information of once conversing, it is a very big data structure in fact, can know the value and the function thereof of all member variables in call data district (this structure) by this method.If problem has appearred in conversation, check that this structure just can help developer or attendant to locate mistake rapidly.Like this, can make debugging or safeguard that institute's time spent shortens greatly, improve operating efficiency.
The advantage that the present invention is applied in the telecommunication apparatus is clearly.But its application far is not limited thereto.Any one application as long as can obtain the internal storage data piece, and is known its structure, just can utilize the present invention to come the internal storage data piece is made an explanation, and it is all in the present invention's scope required for protection.

Claims (9)

1. a method of explaining the data structure of internal storage data piece comprises the following steps:
1) analyze source file by structure analyzer, the description document of generating structure type, and leave on the main frame of explaining internal storage data process place.
2) obtain the bytes of stream data of internal storage data piece, select the structure description file corresponding, and generate a structure tree and show the meaning of this each byte of internal storage data piece, thereby explain this internal storage data piece with this internal storage data piece.
2. a kind of method of explaining the data structure of internal storage data piece according to claim 1 is characterized in that the 1st) also comprise the following steps: in the step
1) obtains all header files with this structurally associated;
2) read these header files, all structures of wherein definition are put in the tabulation, and with corresponding its tabulation of member variable of each structure;
3) structure with required establishment is a starting point, analyzes its each member variable, and generates the attribute list of member variable; If member variable is a structure type, then continue to analyze its pairing structure;
4) when per minute is analysed a member variable, all in the attribute list write structure description document with it, up to that structural analysis end of required establishment.
3. a kind of method of explaining the data structure of internal storage data piece according to claim 1 is characterized in that the 1st) the internal storage data piece described in the step is the internal storage data piece of this machine.
4. a kind of method of explaining the data structure of internal storage data piece according to claim 1, it is characterized in that, the 1st) the internal storage data piece described in the step can be the internal storage data piece on other main frames, the proxy module that is provided with on the main frame of internal storage data piece by the place on other main frames sends to this machine.
5. a kind of method of explaining the data structure of internal storage data piece according to claim 5 is characterized in that, described structure type is the Struct type in the C language, or the Class type among C++, the Java.
6. a kind of method of explaining the data structure of internal storage data piece according to claim 1 is characterized in that the 2nd) structure tree described in the step generates by structure description file, and its each leaf node is a member variable of representative structure all; Nested as having in the fruit structure, this node will be made of many child nodes, and each child node is represented each member variable of minor structure; Each node or byte point are set with the attribute list of its pairing member variable.
7. according to claim 1 or 2,5,8 described a kind of methods of explaining the data structure of internal storage data piece, it is characterized in that, described structure tree generative process, finish synchronously with the process that each byte to the internal storage data piece makes an explanation, when node of every generation, the internal storage data of this node correspondence just is read and explains; After structure tree generates, byte location structure member variable that just can be from byte stream, or locate certain section byte of byte stream from the member variable of structure.
8. a kind of method of explaining the data structure of internal storage data piece according to claim 1 is characterized in that the 1st) the concrete executive program of step is as follows:
1) opens description document and read structrual description note in the file header, and create root node as node name, and present node is pressed into the father node of storehouse as following node, and judge reading next variable's attribute table in the file with this;
2) result who reads next variable's attribute table in the file is judged,
If failure is then withdrawed from,
If success, then in the last layer node, add leaf node and with the binding of this node and variable's attribute table, and do the judgement of structure according to the content of variable's attribute table;
3) structure is judged,
If, then return present node be pressed into the program of storehouse as the father node of following node,
If not, then to whether last variable of structure judge;
4) whether to last variable of structure is judged,
If not, then return and make the program of judgement reading next variable's attribute table in the file,
If then current parent's node is withdrawed from storehouse, and returns and make the program of judgement to reading next variable's attribute table in the file.
9. a kind of method of explaining the data structure of internal storage data piece according to claim 1 is characterized in that the 2nd) the concrete executive program of step is as follows:
1),, and whether file is finished to judge if not then read next line if newline is arranged then handle newline;
2) whether file is finished to judge,
If, then withdraw from,
If not, then cutting comment section (keep variable-definition after note) is reformulated delegation, and does the whether judgement of constant definition;
3) to whether constant definition is judged,
If then the value with constant and it adds Hash table, if return newline then handle newline, if not then read the program of next line,
If not, then do the judgement whether organization definition begins;
4) to whether organization definition begins to judge,
If, then be pressed into storehouse, generate lstVar as current variable list with that lstVar and structure name are pressed into Hash table hsStruct is for future reference, and if return newline then handle newline, if not then read the program of next line;
If not, then to whether organization definition finishes to judge;
5) to whether organization definition finishes to judge,
If pop-up a stack then adds the variable list of current structure correspondence with variable and structure title, and if return newline then handle newline, if not then read the program of next line,
If not, then to whether variable-definition is judged;
6) to whether variable-definition is judged,
If not, if then return newline then handle newline, if not then read the program of next line,
If, then name variable and variable's attribute table are added current Hash table, and if return newline then handle newline, if not then read the program of next line.
CNB021453047A 2002-11-15 2002-11-15 Method for interpreting data structure of memory data block Expired - Fee Related CN100461687C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB021453047A CN100461687C (en) 2002-11-15 2002-11-15 Method for interpreting data structure of memory data block

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB021453047A CN100461687C (en) 2002-11-15 2002-11-15 Method for interpreting data structure of memory data block

Publications (2)

Publication Number Publication Date
CN1501624A true CN1501624A (en) 2004-06-02
CN100461687C CN100461687C (en) 2009-02-11

Family

ID=34232367

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021453047A Expired - Fee Related CN100461687C (en) 2002-11-15 2002-11-15 Method for interpreting data structure of memory data block

Country Status (1)

Country Link
CN (1) CN100461687C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1984133B (en) * 2005-12-12 2011-12-28 腾讯科技(深圳)有限公司 Method for forming structured tree
CN103561019A (en) * 2013-10-30 2014-02-05 上海斐讯数据通信技术有限公司 Method for TR069 data access
CN106933577A (en) * 2017-02-28 2017-07-07 烽火通信科技股份有限公司 The method and system of the query software platform courses block realized based on Python

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19510247C2 (en) * 1995-03-21 1998-08-06 Zinser Textilmaschinen Gmbh Data transmission method
US5909223A (en) * 1996-09-04 1999-06-01 Apple Computer, Inc. Text face scaler
US6052387A (en) * 1997-10-31 2000-04-18 Ncr Corporation Enhanced interface for an asynchronous transfer mode segmentation controller

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1984133B (en) * 2005-12-12 2011-12-28 腾讯科技(深圳)有限公司 Method for forming structured tree
CN103561019A (en) * 2013-10-30 2014-02-05 上海斐讯数据通信技术有限公司 Method for TR069 data access
CN103561019B (en) * 2013-10-30 2018-02-06 上海斐讯数据通信技术有限公司 One kind is directed to TR069 data access methods
CN106933577A (en) * 2017-02-28 2017-07-07 烽火通信科技股份有限公司 The method and system of the query software platform courses block realized based on Python

Also Published As

Publication number Publication date
CN100461687C (en) 2009-02-11

Similar Documents

Publication Publication Date Title
CN100504879C (en) Dynamic web page segmentation method
EP2244418A1 (en) Database security monitoring method, device and system
US20080072216A1 (en) Method and device for ANBF string pattern matching and parsing
US11157463B2 (en) Understanding data in data sets
CN1551640A (en) Test stream generating method and apparatus for supporting various standards and testing levels
WO2009105954A1 (en) Method, apparatus and system for analyzing logs of devices in real-time
CN106844607B (en) SQLite data recovery method suitable for non-integer main key and idle block combination
CN103455600A (en) Video URL (Uniform Resource Locator) grabbing method and device and server equipment
CN1869973A (en) Method and system for generating file
CN1501624A (en) Method for interpreting data structure of memory data block
CN111611788B (en) Data processing method and device, electronic equipment and storage medium
CN109299132B (en) SQL data processing method and system and electronic equipment
CN111651514A (en) Data import method and device
CN106991144B (en) Method and system for customizing data crawling workflow
Alawneh et al. MTF: A scalable exchange format for traces of high performance computing systems
CN111563123B (en) Real-time synchronization method for hive warehouse metadata
CN1282917A (en) Software simulation test method
CN113448965A (en) Method, device and equipment for determining full-table-scanning structured query statement
CN113282609A (en) Intelligent data analysis method based on big data technology
CN112217896A (en) JSON message conversion method and related device
KR20120084880A (en) Inputformat for handling network packet data on hadoop mapreduce
CN112948419A (en) Query statement processing method and device
CN1767524A (en) Message processing system and its processing method
KR101005871B1 (en) B-Tree Index Vector Based Web-Log Restoration Method For Huge Web Log Mining And Web Attack Detection
Deng et al. Combinatorial testing on implementations of html5 support

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090211

Termination date: 20171115