CN104021142B - The storage of tamper resistant systems web page files fingerprint and querying method - Google Patents
The storage of tamper resistant systems web page files fingerprint and querying method Download PDFInfo
- Publication number
- CN104021142B CN104021142B CN201410204016.4A CN201410204016A CN104021142B CN 104021142 B CN104021142 B CN 104021142B CN 201410204016 A CN201410204016 A CN 201410204016A CN 104021142 B CN104021142 B CN 104021142B
- Authority
- CN
- China
- Prior art keywords
- fingerprint
- node
- file
- memory node
- file identification
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Storage and querying method the invention discloses a kind of tamper resistant systems web page files fingerprint, wherein storage method include step:Generate fingerprint memory node;The fingerprint memory node is stored with the file identification and file fingerprint of system web page files corresponding with current finger print memory node, and the corresponding file identification of each system web page files is unique;It is sorted according to the file identification to presently described fingerprint memory node and builds to form a binary tree and update fingerprint memory node information;By the end of one record file of current finger print memory node write-in.Storage and querying method as a result of a kind of tamper resistant systems web page files fingerprint of the present invention have the normal the advantages of reading for quickly and efficiently inquiring fingerprint value and fingerprint not being interfered in the case where fingerprint preserves exception.
Description
Technical field
Storage and querying method more particularly to a kind of tamper resistant systems web page files the present invention relates to a kind of file fingerprint
The storage of fingerprint and querying method.
Background technology
Existing technical method is all being written to the fingerprint order of web page files in file, and inquiry when reads one by one
Each fingerprint value is taken, this fingerprint value for relatively searching specified file, takes very much one by one, preserves many feelings of fingerprint value hereof
Under condition, search efficiency is very low, and secondly, existing technical method occurs exception in web page files fingerprint value, and fingerprint value does not have
Having can be very inconvenient to the normal reading of influence fingerprint in the case of preserving successfully.
The content of the invention
The defects of it is an object of the invention to overcome the prior art, and a kind of tamper resistant systems web page files fingerprint is provided
Storage and querying method have and quickly and efficiently inquire fingerprint value and do not interfered in the case where fingerprint preserves exception
Normal the advantages of reading of fingerprint.
Technical problem solved by the invention is realized using following technical scheme:
A kind of storage method of tamper resistant systems web page files fingerprint, including step:
S1:Generate the fingerprint memory node of the file fingerprint of current desired storage;The fingerprint memory node be stored with
The file identification and file fingerprint of the corresponding system web page files of current finger print memory node, each system web page files pair
The file identification answered is unique;
S2:It is sorted according to the file identification to presently described fingerprint memory node, and updates a binary tree, update fingerprint
Memory node information;
S3:By the end of one record file of current finger print memory node write-in;
S4:The file fingerprint of next required storage is judged whether, as the file that there is selected next required storage refers to
Line is current desired storage file fingerprint, and return to step S1;Otherwise terminate to store.
Further improvement of the present invention is that the fingerprint memory node includes:
- file identification area, for storing the files-designated of system web page files corresponding with current finger print memory node
Know;
- file fingerprint area, the file for storing system web page files corresponding with current finger print memory node refer to
Line;
- left child node position area, for storing the left child node of current finger print memory node in the record file
Initial position;
- right child node position area, for storing the right child node of current finger print memory node in the record file
Initial position;
- state area, for storing the effective information of file fingerprint corresponding with current finger print memory node.
Further improvement of the present invention is, described that presently described fingerprint memory node is arranged according to the file identification
Sequence, and a binary tree is updated, update fingerprint memory node information Step includes step:
Judge in the record file with the presence or absence of fingerprint memory node information;
It is such as not present, using presently described fingerprint memory node as the root node of the binary tree, updates presently described finger
The left child node location area information of line memory node updates presently described fingerprint memory node to represent that left child node is not present
There is no right child nodes for expression for right child node location area information;
If exist, search and position the father node of presently described fingerprint memory node, this compared with current finger print memory node with
The numerical values recited of the file identification of the father node of presently described fingerprint memory node,
File identification such as current finger print memory node is more than the father node file identification, and presently described fingerprint is stored
The right child node location area information of the father node of node is updated to the end position of the record file current information;
File identification such as current finger print memory node is less than the father node file identification, and presently described fingerprint is stored
The left child node location area information of the father node of node is updated to the end position of the record file current information.
Further improvement of the present invention is, described to search and position the father node step of presently described fingerprint memory node
Including step:
Since the root node of the binary tree, according to dichotomy algorithm, this is compared with the of current finger print memory node one by one
Second file identification of one file identification and binary tree interior joint;
When the first file identification is more than presently described second file identification, and the right child node of presently described y-bend tree node
When location area information represents that right child node is not present, using presently described y-bend tree node as presently described fingerprint memory node
Father node;
When the first file identification is less than presently described second file identification, and the left child node of presently described y-bend tree node
When location area information represents that right child node is not present, using presently described y-bend tree node as presently described fingerprint memory node
Father node.
A kind of file fingerprint querying method of storage method based on tamper resistant systems web page files fingerprint of the present invention, bag
Include step:
S1’:One first file identification needed for obtaining corresponding to the file fingerprint of inquiry;
S2’:The root node of the binary tree is chosen as ought be up till now compared with node;
S3’:Acquisition ought be up till now compared with one second file identification of node;
S4’:This more described first file identification and second file identification;
As first file identification be more than second file identification, using ought up till now compared with node right child node as newly
Ought be up till now compared with node, and return to step S3 ';
As first file identification be less than second file identification, using ought up till now compared with node left child node as newly
Ought be up till now compared with node, and return to step S3 ';
As first file identification be equal to second file identification, when up till now compared with node be required inquiry file fingerprint
The target fingerprint memory node at place positions and returns to the target fingerprint memory node information.
Further improvement of the present invention is, when the file fingerprint for the target fingerprint memory node for needing deletion inquired
When, it is described to position and further include step after returning to the target fingerprint memory node information Step:
The state area information of the target fingerprint memory node is revised as to represent disarmed state;
Delete the file fingerprint of current goal fingerprint memory node.
Further improvement of the present invention is, when the file fingerprint for the target fingerprint memory node for needing update inquired
When, it is described to position and further include step after returning to the target fingerprint memory node information Step:
Update the file fingerprint in the file fingerprint area of current goal fingerprint memory node.
As a result of above technical scheme, make it have following advantageous effect is the present invention:
System web page files are provided with one-to-one fingerprint memory node, and the use of fingerprint memory node realizes file
Fingerprint record in detail anti-tamper and file fingerprint efficient lookup and fingerprint preserve exception in the case of will not shadow
The normal reading of snap line.In addition, file identification area, identifies for storage file;File fingerprint area is used for storage file fingerprint;
Left child node position area is used to store initial position of the left child node of current finger print memory node in the record file;It is right
Child node position area, for storing initial position of the right child node of current finger print memory node in the record file.Shape
State area is used to store the effective information of fingerprint corresponding with current finger print memory node.
Description of the drawings
Fig. 1 is the storage of tamper resistant systems web page files fingerprint of the present invention and the storage method flow chart of querying method;
Fig. 2 is to be sorted in storage method of the present invention according to the file identification to presently described fingerprint memory node, and more
A new binary tree updates the flow chart of fingerprint memory node information;
Fig. 3 is the storage of tamper resistant systems web page files fingerprint of the present invention and one of the storage method embodiment of querying method
Form the structure diagram of binary tree.
Fig. 4 is the flow of the file fingerprint querying method of the storage method of tamper resistant systems web page files fingerprint of the present invention
Figure;
Fig. 5 is the existing binary tree structure of one of the storage method embodiment of tamper resistant systems web page files fingerprint of the present invention
Schematic diagram;
Fig. 6 is the existing binary tree structure of one of the storage method embodiment of tamper resistant systems web page files fingerprint of the present invention
Query path schematic diagram.
Specific embodiment
With reference to specific embodiment, the invention will be further described.
Referring to Fig. 1, a kind of storage method of tamper resistant systems web page files fingerprint of the present invention, including step:
S1:Generate the fingerprint memory node of the file fingerprint of current desired storage;Fingerprint memory node be stored with currently
The file identification and file fingerprint of the corresponding system web page files of fingerprint memory node, the corresponding file of each system web page files
Mark is unique;
S2:It is sorted according to file identification to current finger print memory node, and updates a binary tree, update fingerprint memory node
Information;
S3:By the end of one record file of current finger print memory node write-in;
S4:The file fingerprint of next required storage is judged whether, as the file that there is selected next required storage refers to
Line is current desired storage file fingerprint, and return to step S1;Otherwise terminate to store.
Wherein, fingerprint memory node includes:
- file identification area, for storing the file identification of system web page files corresponding with current finger print memory node;
- file fingerprint area, for storing the file fingerprint of system web page files corresponding with current finger print memory node;
- left child node position area, for storing starting of the left child node of current finger print memory node in file is recorded
Position;
- right child node position area, for storing starting of the right child node of current finger print memory node in file is recorded
Position;
- state area, for storing the effective information of file fingerprint corresponding with current finger print memory node.
File identification is the unique identifier of file, and file identification and file fingerprint are unique and fixed length character strings, should
Data account for the space of a fixed length (such as:32, account for the space of 32 bytes).In the present embodiment, left child node is in file is recorded
The start position data of start position data and right child node in file is recorded accounts for 8 byte spaces respectively, and file fingerprint has
It is -1 and 0 to imitate information, wherein -1 mark is invalid, 0 mark is effective.
Referring to Fig. 2, sorting according to file identification to current finger print memory node, and a binary tree is updated, update fingerprint
Memory node information Step includes step:
Judge to whether there is fingerprint memory node information in record file;
It is such as not present, using current finger print memory node as the root node of binary tree, updates current finger print memory node
To represent to be not present left child node, the right child node position area of update current finger print memory node believes left child node location area information
It ceases to represent that there is no right child nodes;
It if existed, searches and positions the father node of current finger print memory node, this is compared with current finger print memory node and currently
The numerical values recited of the file identification of the father node of fingerprint memory node,
File identification such as current finger print memory node is more than father node file identification, by the father of current finger print memory node
The right child node location area information of node is updated to the end position of record file current information;
File identification such as current finger print memory node is less than father node file identification, by the father of current finger print memory node
The left child node location area information of node is updated to the end position of record file current information.
Wherein, the father node step searched and position current finger print memory node includes step:
Since the root node of binary tree, according to dichotomy algorithm, this is compared with the first text of current finger print memory node one by one
Part identifies and the second file identification of binary tree interior joint;
When the first file identification is more than current second file identification, and the right child node position area letter of current y-bend tree node
When breath represents that right child node is not present, using current y-bend tree node as the father node of current finger print memory node;
When the first file identification is less than current second file identification, and the left child node position area letter of current y-bend tree node
When breath represents that right child node is not present, using current y-bend tree node as the father node of current finger print memory node.
Please refer to Fig.1,2, such as:
Firstly generate the fingerprint memory node C of the file fingerprint of a current desired storage0,0;
It records and fingerprint memory node information is not present in file;Therefore by current finger print memory node C0,0As binary tree
Root node, the left child node location area information of update current finger print memory node is -1, and right child node location area information is -1,
By C0,0The end of write-in record file, it is L to record file size at this time1,1;
By judging that there are the file fingerprint of next required storage, the corresponding fingerprint memory nodes of generation this document fingerprint
C1,1;
It searches and positions current finger print memory node C1,1Father node C0,0, this is compared with C1,1With C0,0File identification numerical value
Size;
Such as C0,0> C1,1File identification numerical value, by C0,0Right child node location area information be updated to L1,1;
Such as C0,0< C1,1File identification numerical value, by C0,0Left child node location area information be updated to L1,1。
According to C1,1Inserted mode, write successively it is all needed for storage fingerprints fingerprint memory nodes, two finally obtained
Fork tree refers to Fig. 3.
Referring to Fig. 4, a kind of file fingerprint of storage method based on tamper resistant systems web page files fingerprint of the present invention
Querying method, including step:
S1’:One first file identification needed for obtaining corresponding to the file fingerprint of inquiry;
S2’:The root node of selection binary tree is used as ought be up till now compared with node;
S3’:Acquisition ought be up till now compared with one second file identification of node;
S4’:This is compared with the first file identification and the second file identification;
It, ought be up till now as new using right child node that ought be up till now compared with node if the first file identification is more than the second file identification
Compared with node, and return to step S3 ';
It, ought be up till now as new using left child node that ought be up till now compared with node if the first file identification is less than the second file identification
Compared with node, and return to step S3 ';
If the first file identification is equal to the second file identification, the mesh where compared with node being up till now required inquiry file fingerprint
Fingerprint memory node is marked, positions and returns to target fingerprint memory node information.
In addition, when needing to delete the file fingerprint of inquired target fingerprint memory node, position and return to target
Step is further included after fingerprint memory node information Step:
The state area information of target fingerprint memory node is revised as to represent disarmed state;
Delete the file fingerprint of current goal fingerprint memory node.
When needing to update the file fingerprint of inquired target fingerprint memory node, position and return to target fingerprint and deposit
Step is further included after storage nodal information step:
Update the file fingerprint in the file fingerprint area of current goal fingerprint memory node.
Such as:
Existing binary tree structure is as shown in figure 5, each node of binary tree is respectively:A、B、C、D、E;Node A, B, C, D, E
Corresponding file identification is respectively a, b, c, d, e.
First, the file identification X needed for obtaining corresponding to the file fingerprint of inquiry;
Then the root section A points of binary tree are chosen as ought be up till now compared with node;
Obtain file identification a that ought up till now compared with node A;
This is compared with file identification X and file identification a;
File identification X is more than file identification a, up till now the right child node D compared with node A up till now will ought ought relatively be saved as new
Point;
Obtain file identification d that ought up till now compared with node D;
This is compared with file identification X and file identification d;
File identification X is more than file identification d, up till now the right child node E compared with node D up till now will ought ought relatively be saved as new
Point;
Obtain file identification e that ought up till now compared with node E;
This is compared with file identification X and file identification e;
File identification X is equal to file identification e, the target fingerprint where compared with node E being up till now required inquiry file fingerprint
Memory node positions and returns to target fingerprint memory node information.Query path refers to Fig. 6, it is seen that compared to it is existing according to
, it is necessary to judge whether file identification is equal to the method for X for 5 times, method of the invention only needs this compared with 2 by secondary query node A, B, C, D, E
Minor node can search node E, improve 1.5 times of retrieval rate.
The present invention is described in detail above in association with attached drawing embodiment, those skilled in the art can be according to upper
It states and bright many variations example is made to the present invention.Thus, some details in embodiment should not form limitation of the invention, this
Invention will be using the scope that the appended claims define as protection scope of the present invention.
Claims (5)
1. a kind of storage method of tamper resistant systems web page files fingerprint, which is characterized in that including step:
S1:Generate the fingerprint memory node of the file fingerprint of current desired storage;The fingerprint memory node be stored with currently
The file identification and file fingerprint of the corresponding system web page files of fingerprint memory node, each system web page files are corresponding
The file identification is unique;Wherein, the fingerprint memory node includes:
One file identification area, for storing the file identification of system web page files corresponding with current finger print memory node;
One file fingerprint area, for storing the file fingerprint of system web page files corresponding with current finger print memory node;
One left child node position area, for storing start bit of the left child node of current finger print memory node in file is recorded
It puts;
One right child node position area, for storing start bit of the right child node of current finger print memory node in file is recorded
It puts;
One state area, for storing the effective information of file fingerprint corresponding with current finger print memory node;
S2:It is sorted according to the file identification to presently described fingerprint memory node, and updates a binary tree, update fingerprint storage
Nodal information, including:
Judge in the record file with the presence or absence of fingerprint memory node information;
It is such as not present, using presently described fingerprint memory node as the root node of the binary tree, updates presently described fingerprint and deposit
The left child node location area information of node is stored up to represent that left child node is not present, updates the right son of presently described fingerprint memory node
There is no right child nodes for expression for node location area information;
If existed, search and position the father node of presently described fingerprint memory node, compare current finger print memory node with it is current
The numerical values recited of the file identification of the father node of the fingerprint memory node,
File identification such as current finger print memory node is more than the father node file identification, by presently described fingerprint memory node
Father node right child node location area information be updated to it is described record file current information end position;
File identification such as current finger print memory node is less than the father node file identification, by presently described fingerprint memory node
Father node left child node location area information be updated to it is described record file current information end position;
S3:By the end of the one record file of current finger print memory node write-in;
S4:The file fingerprint of next required storage is judged whether, as the file fingerprint that there is selected next required storage is
Current desired storage file fingerprint, and return to step S1;Otherwise terminate to store.
2. the storage method of tamper resistant systems web page files fingerprint according to claim 1, which is characterized in that the lookup
And the father node step for positioning presently described fingerprint memory node includes step:
Since the root node of the binary tree, according to dichotomy algorithm, compare current finger print memory node one by one first is literary
Part identifies and the second file identification of binary tree interior joint;
When the first file identification is more than presently described second file identification, and the right child node position of presently described y-bend tree node
Area's information represents, there is no during right child node, to save presently described y-bend tree node as the father of presently described fingerprint memory node
Point;
When the first file identification is less than presently described second file identification, and the left child node position of presently described y-bend tree node
Area's information represents, there is no during right child node, to save presently described y-bend tree node as the father of presently described fingerprint memory node
Point.
3. a kind of file fingerprint issuer of the storage method of the tamper resistant systems web page files fingerprint based on described in claim 2
Method, which is characterized in that including step:
S1’:One first file identification needed for obtaining corresponding to the file fingerprint of inquiry;
S2’:The root node of the binary tree is chosen as current comparison node;
S3’:Obtain one second file identification of current comparison node;
S4’:Compare first file identification and second file identification;
If first file identification is more than second file identification, work as the right child node of current comparison node as new
Preceding comparison node, and return to step S3 ';
If first file identification is less than second file identification, work as the left child node of current comparison node as new
Preceding comparison node, and return to step S3 ';
If first file identification is equal to second file identification, current comparison node is where required inquiry file fingerprint
Target fingerprint memory node, position and return to the target fingerprint memory node information.
4. file fingerprint querying method according to claim 3, which is characterized in that when the target for needing deletion inquired
It is described to position and further include step after returning to the target fingerprint memory node information Step during file fingerprint of fingerprint memory node
Suddenly:
The state area information of the target fingerprint memory node is revised as to represent disarmed state;
Delete the file fingerprint of current goal fingerprint memory node.
5. file fingerprint querying method according to claim 3, which is characterized in that when the target for needing update inquired
It is described to position and further include step after returning to the target fingerprint memory node information Step during file fingerprint of fingerprint memory node
Suddenly:
Update the file fingerprint in the file fingerprint area of current goal fingerprint memory node.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410204016.4A CN104021142B (en) | 2014-05-14 | 2014-05-14 | The storage of tamper resistant systems web page files fingerprint and querying method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410204016.4A CN104021142B (en) | 2014-05-14 | 2014-05-14 | The storage of tamper resistant systems web page files fingerprint and querying method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104021142A CN104021142A (en) | 2014-09-03 |
CN104021142B true CN104021142B (en) | 2018-06-01 |
Family
ID=51437897
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410204016.4A Active CN104021142B (en) | 2014-05-14 | 2014-05-14 | The storage of tamper resistant systems web page files fingerprint and querying method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104021142B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106203179B (en) * | 2016-07-12 | 2019-06-18 | 何晓行 | A kind of completeness check system and method for pair of file |
CN112054927B (en) * | 2020-08-31 | 2023-03-24 | 北京天融信网络安全技术有限公司 | Anti-tampering website updating method and device based on fingerprint verification and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508916A (en) * | 2011-11-21 | 2012-06-20 | 电子科技大学 | File fingerprint analyzing method for massive data |
CN102662855A (en) * | 2012-04-17 | 2012-09-12 | 华为技术有限公司 | Storage method and system of binary tree |
-
2014
- 2014-05-14 CN CN201410204016.4A patent/CN104021142B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508916A (en) * | 2011-11-21 | 2012-06-20 | 电子科技大学 | File fingerprint analyzing method for massive data |
CN102662855A (en) * | 2012-04-17 | 2012-09-12 | 华为技术有限公司 | Storage method and system of binary tree |
Non-Patent Citations (1)
Title |
---|
一种中文网页消重算法的设计与实现;杨俊峰;《电子技术》;20130925(第09期);第29-31页第1-3节 * |
Also Published As
Publication number | Publication date |
---|---|
CN104021142A (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI702506B (en) | System, machine readable medium, and machine-implemenated method for merge tree garbage metrics | |
TWI702503B (en) | Systems, methods, and computer readable media to implement merge tree modifications for maintenance operations | |
CN110147204B (en) | Metadata disk-dropping method, device and system and computer-readable storage medium | |
WO2015096698A1 (en) | Data writing and reading methods for flash | |
US20010051954A1 (en) | Data updating apparatus that performs quick restoration processing | |
CN105589894B (en) | Document index establishing method and device and document retrieval method and device | |
CN109522271B (en) | Batch insertion and deletion method and device for B + tree nodes | |
JP2005302038A (en) | Method and system for renaming consecutive key in b-tree | |
CN106528647A (en) | Term matching method based on a cedar double-array trie algorithm | |
CN111984732B (en) | Method, node and blockchain network for implementing decentralization search on blockchain | |
JP2008269503A5 (en) | ||
CN104021142B (en) | The storage of tamper resistant systems web page files fingerprint and querying method | |
CN104408128B (en) | A kind of reading optimization method indexed based on B+ trees asynchronous refresh | |
CN105512325A (en) | Multi-version data index renewing, deleting and establishing method and device | |
CN111651372A (en) | Flash retrieval method based on Hash search and storage medium | |
CN111324483B (en) | Data recovery method and device and related equipment | |
CN110825747B (en) | Information access method, device and medium | |
CN102984071B (en) | Method for organizing routing table of segment address route and method for checking route | |
CN111427511B (en) | Data storage method and device | |
CN112269784A (en) | Hash table structure based on hardware realization and inserting, inquiring and deleting method | |
CN112306748A (en) | Data recovery method, device and storage medium | |
CN106557583A (en) | Archival storage and archives storage method | |
US10942934B2 (en) | Non-transitory computer-readable recording medium, encoded data searching method, and encoded data searching apparatus | |
CN110825846B (en) | Data processing method and device | |
JP5041003B2 (en) | Search device and search method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |