CN103049553B - Method, Apparatus and system that a kind of searching route stores - Google Patents

Method, Apparatus and system that a kind of searching route stores Download PDF

Info

Publication number
CN103049553B
CN103049553B CN201210584778.2A CN201210584778A CN103049553B CN 103049553 B CN103049553 B CN 103049553B CN 201210584778 A CN201210584778 A CN 201210584778A CN 103049553 B CN103049553 B CN 103049553B
Authority
CN
China
Prior art keywords
hash
hash keys
keys
data
search key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210584778.2A
Other languages
Chinese (zh)
Other versions
CN103049553A (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.)
Guangdong Gaohang Intellectual Property Operation Co ltd
Haining hi tech Zone Science and Innovation Center Co.,Ltd.
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201210584778.2A priority Critical patent/CN103049553B/en
Publication of CN103049553A publication Critical patent/CN103049553A/en
Application granted granted Critical
Publication of CN103049553B publication Critical patent/CN103049553B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments provide method, Apparatus and system that a kind of searching route stores, relate to the communications field, in order to realize the waste reducing storage space, improve the utilization factor of storage space.Described method, comprising: data to be retrieved resolved, and obtains at least one critical data; According at least one critical data described, generate at least one Hash keys pair; Wherein, searching route by Hash keys described at least one to forming; Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element; Store at least one Hash keys pair described.The present invention is applicable to data and stores and the scene retrieved.

Description

Method, Apparatus and system that a kind of searching route stores
Technical field
The present invention relates to the communications field, particularly relate to method, Apparatus and system that a kind of searching route stores.
Background technology
XML (ExtensibleMarkupLanguage, extend markup language) make it have structural markup language for electroactive marker son file, can be used for flag data, definition data type, be the source language that the markup language of a kind of user of permission to oneself defines.Document content and display format can be separated by XML, and the mark in document is used to the implication describing XML data element, instead of are used for describing and how show, so XML is a kind of data of self-described.
XML becomes the standard of internet data performance and exchanges data day by day, and how from a large amount of XML information, to retrieve effective information becomes urgent problem.At present, before XML information is retrieved, need first to resolve XML information, obtain structurized searching route.According to the key word that user provides, utilize structurized searching route, XML is retrieved, can recall precision be provided.Because XML data amount is large, after analyzing XML, how efficient storage resolve after huge structure tree information become the problem that industry more and more pays close attention to.In the prior art, huge after storing and resolving structure tree information carries out storing based on the coding of prefix.
The coding stated in realization based on prefix carries out in the process of storage node paper mulberry information, and inventor finds that in prior art, at least there are the following problems: the storage mode based on the coded message of prefix is stored in redundant information.Further, along with the degree of depth of tree increases, redundant information exponentially increases, thus causes the waste of storage space.
Summary of the invention
Method, Apparatus and system that embodiments of the invention provide a kind of searching route to store, in order to realize the waste reducing storage space, improve the utilization factor of storage space.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, embodiments provides a kind of method that searching route stores, comprising: data to be retrieved resolved, obtain at least one critical data; According at least one critical data described, generate at least one Hash keys pair; Wherein, searching route by Hash keys described at least one to forming; Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element; Store at least one Hash keys pair described.
Second aspect, embodiments provides the device that a kind of searching route stores, comprising: acquiring unit, for data to be retrieved being resolved, obtaining at least one critical data; Generation unit, for according at least one critical data described, generates at least one Hash keys pair; Wherein, searching route by Hash keys described at least one to forming; Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element; Storage unit, for store described resolution unit obtain described at least one Hash keys pair.
The third aspect, embodiments provides the system that a kind of searching route stores, comprising: host node, switch, service server, terminal; Wherein, described host node is the device of the searching route storage described in above-described embodiment.
Embodiments provide method, Apparatus and system that a kind of searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.
Accompanying drawing explanation
The schematic diagram of the method that a kind of searching route that Fig. 1 provides for the embodiment of the present invention stores;
The application schematic diagram of the device that a kind of searching route that Fig. 2 provides for the embodiment of the present invention stores;
The schematic diagram of a kind of example that Fig. 3 provides for the embodiment of the present invention;
The schematic diagram of the method that the another kind of searching route that Fig. 4 provides for the embodiment of the present invention stores;
The schematic diagram of the method that the another kind of searching route that Fig. 5 provides for the embodiment of the present invention stores;
The schematic diagram of the another kind of example that Fig. 6 provides for the embodiment of the present invention;
The structural representation of the device that a kind of searching route that Fig. 7 provides for the embodiment of the present invention stores;
The structural representation of the device that the another kind of searching route that Fig. 8 provides for the embodiment of the present invention stores;
The structural representation of the device that the another kind of searching route that Fig. 9 provides for the embodiment of the present invention stores;
The structural representation of the system that a kind of searching route that Figure 10 provides for the embodiment of the present invention stores.
Embodiment
The method stored embodiment of the present invention searching route below in conjunction with accompanying drawing, device, system are described in detail.
Embodiments provide a kind of method that searching route stores, as shown in Figure 1, comprising:
101, data to be retrieved are resolved, obtain at least one critical data.
Wherein, described critical data is the data for building searching route.
It should be noted that, when searching route refers to and retrieves according to the retrieval critical data received, the path used.
Concrete, the content of data to be retrieved is resolved by the device that searching route stores, from the content of data to be retrieved, parse critical data.Preferably, data to be retrieved are resolved, obtain the critical data that version is tree-shaped.Be, Data Analysis to be retrieved gone out the critical data of tree.
Optionally, data to be retrieved are XML (ExtensibleMarkupLanguage, extend markup language) data.
It should be noted that, data to be retrieved also other forms of retrieval time, be the data of retrieve data content, the present invention does not limit this.
It should be noted that, the device of described searching route can be a kind of computing equipment, referred to as main frame, as shown in Figure 2.Wherein, main frame can comprise the known any computing equipment of current techniques, as server, desk-top computer etc.Inner at main frame, be provided with operating system and other application programs, the present invention does not limit this.
102, according at least one critical data described, at least one Hash keys pair is generated.
Wherein, searching route by Hash keys described at least one to forming.Described Hash keys is to comprising: the first element and the second element.Described second element is the upper level element of described first element.First element is a critical data, and the second element is the upper level data of this critical data.
Concrete, the device that searching route stores is after obtaining at least one critical data, and by each element of at least one critical data of acquisition, the upper level element of element therewith, generates Hash keys pair.
Further, if the version of at least one critical data is tree-shaped, is then the critical data of tree-shaped according to described version, generates at least one Hash keys pair.Be, each node in tree and father node thereof are generated a Hash keys pair.
It should be noted that, each node in tree is a critical data, and the first element that now described Hash keys is right is a node in the critical data of tree; The second element that described Hash keys is right is the father node of described first element.
Exemplary, the critical data of hypotheses creation is tree, as shown in Figure 3.The critical data generated comprises: root node is life range, and root node has three child nodes, is respectively country, island and lake.Wherein, there are three child nodes in country, is respectively population, name, city.There are three byte points in city, is respectively population, mark, name.There are two child nodes on island, are respectively name, area.There are two child nodes in lake, is respectively name, area.Each node of the critical data of tree and father node thereof are generated Hash keys pair.Wherein, using each node as right the first element of Hash keys, using its father node as right the second element of Hash keys.The Hash keys generated is to as shown in table 1 below.
Table 1
<area, island>
<area, lake>
<city, country>
<country, life circle>
<mark, city>
<island, life circle>
<lake, life circle>
<name, country>
<name, city>
<name, island>
<name, lake>
<population, country>
<population, city>
103, at least one Hash keys pair described is stored.
Concrete, the device that searching route stores stores at least one Hash keys pair generated.Optionally, the device that searching route stores according to default hash algorithm, can obtain at least one Hash keys described to the cryptographic hash of correspondence; According at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored to the position that the described cryptographic hash of at least one Hash keys to correspondence is corresponding.
It should be noted that, preset hash algorithm, is that the device that searching route stores pre-sets.
Wherein, the device that searching route stores, according to default hash algorithm, can obtain the cryptographic hash of the first right element of Hash keys, according to this cryptographic hash by Hash keys corresponding for this cryptographic hash to storing position corresponding to so far cryptographic hash.
As above, described in example, suppose to preset the ASCI code that hash algorithm is the first letter asking for the first right element of Hash keys, and with 4 for divisor asks for remainder.Suppose according to above-mentioned default hash algorithm, the < asked for area, the cryptographic hash of island > is 3, then by < area, island > is stored to the position that cryptographic hash is 3 correspondences.
Further, according at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored in memory node corresponding to the described cryptographic hash of at least one Hash keys to correspondence.
Concrete, the device that searching route stores by Hash keys to being stored in memory node corresponding to the cryptographic hash of Hash keys to correspondence.
It should be noted that, the device management memory node that searching route stores, shown in figure 2.Memory node can comprise the known memory device of current techniques, as Redundant Array of Independent Disks (RAID) (RedundantArraysofIndependentDisks, RAID), disk cluster (JustaBunchOfDisks, JBOD), direct access storage device (DirectAccessStorageDevice, the disc driver of one or more interconnection DASD), the such as fc tape storage device FC of tape library, one or more storage unit, the present invention does not limit this.
Embodiments provide a kind of method that searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.
After step 103, said method, as shown in Figure 4, also comprises:
104, the data described to be retrieved of not resolving are stored in described memory node.
Concrete, not parsed data described to be retrieved can be equally divided into the first integral multiple of memory node by the device that searching route stores according to the number of memory node.A first integer data to be retrieved can sequentially can be stored in each memory node.Also the first integer data to be retrieved can be generated corresponding cryptographic hash according to presetting hash algorithm, the first integer data to be retrieved are stored in corresponding memory node according to the cryptographic hash of correspondence.
It should be noted that, the first integer be not less than 1 integer.
Original data can being stored to memory node by step 104, making when receiving search key, can inquire about according to the data stored, thus obtain the data relevant with search key.
After step 104, said method, as shown in Figure 5, also comprises:
105, search key and search key type is received.
Concrete, if user needs data query, then user need input search key, and inputs search key type.Such as, user will inquire about the correlation circumstance in Xi'an, city, then inputting search key type is name, and search key is Xi'an, then the device of searching route receives this search key, and search key type.
106, according to described search key type, the cryptographic hash of described search key type is obtained.
Concrete, after the device that searching route stores receives search key type, search key type is utilized and presets hash algorithm, calculate the cryptographic hash of search key type.
Exemplary, the type that the device that searching route stores receives search key is name, then according to presetting hash algorithm, obtain the cryptographic hash that name is corresponding.
107, according to the cryptographic hash of the described search key type obtained, the first Hash keys pair is obtained.
Wherein, described first Hash keys is to referring to the Hash keys pair found according to the cryptographic hash of search key type.
Concrete, the device that searching route stores, according to the cryptographic hash of the described search key type obtained, obtains the first Hash keys pair that cryptographic hash corresponding to memory location is identical with the cryptographic hash of described search key type; The first element that first Hash keys described in cycle index is right, and the cryptographic hash obtaining the second right element of described first Hash keys; According to the cryptographic hash of right the second element of described first Hash keys of described acquisition, obtain the second Hash keys pair that the cryptographic hash of cryptographic hash corresponding to memory location second element right with described first Hash keys is identical; The Hash keys pair identical according to the cryptographic hash of the cryptographic hash that described memory location is corresponding second element right with described first Hash keys, upgrades described first Hash keys pair, until the second Hash keys obtained is to being sky; Record the second element that the first Hash keys is right.
Wherein, the first element that described second Hash keys is right is the second element that described first Hash keys is right.
Specifically, after the device that searching route stores obtains the cryptographic hash of search key type, search according to this cryptographic hash that to store Hash keys right, and the position that this cryptographic hash is corresponding.To store Hash keys right, and obtain the Hash keys pair that search key type is the first element in position corresponding to this cryptographic hash, be acquisition first Hash keys pair.Obtain the first Hash keys to rear, recording the first element that the first Hash keys is right, be record retrieval key word type, and obtain the second right element of the first Hash keys.According to default hash algorithm, calculate the cryptographic hash of the second right element of the first Hash keys, search according to this cryptographic hash that to store Hash keys right, and the position that the cryptographic hash of right the second element of the first Hash keys is corresponding, and the second Hash keys pair that the cryptographic hash obtaining cryptographic hash corresponding to memory location second element right with described first Hash keys is identical.That is, to store Hash keys right, and what obtain the second right element of the first Hash keys in position corresponding to the cryptographic hash of right the second element of the first Hash keys is the second Hash keys pair of the first element.Obtaining the second Hash keys to rear, according to this second Hash keys to renewal first Hash keys pair, be existing second Hash keys replacement first Hash keys pair, thus generate the first new Hash keys pair, repeat the first element that record first Hash keys is right, and according to default hash algorithm, calculate the cryptographic hash of the second right element of the first Hash keys, and the memory location that the cryptographic hash of the cryptographic hash of searching memory location second element right with the first Hash keys is identical, obtain the second Hash keys pair, and then according to the second Hash keys to renewal first Hash keys pair, until the second Hash keys obtained is to being sky, record the second element that the first Hash keys is right.
Exemplary, as above described in example, if it is name that user inputs search key type, and, the device that searching route stores by Hash keys to being stored in memory node.The device that searching route stores calculates the cryptographic hash of name according to presetting hash algorithm, suppose that the cryptographic hash of the name calculated is 2, then search according to cryptographic hash 2 that to store Hash keys right, the memory node of cryptographic hash 2 correspondence, be according to cryptographic hash 2, the cryptographic hash finding memory location is the memory location of 2.In the memory node of cryptographic hash 2 correspondence, obtain the Hash keys pair that name is the first element, be acquisition first Hash keys pair.If storing 4 the first elements in memory node is the Hash keys pair of name, then by these 4 Hash keys to being all considered as the first Hash keys pair.These four first Hash keys are to being respectively < name, country >, < name, city >, < name, island >, < name, lake >.Below with < name, national > is that example is described.
First Hash keys to being < name, national >, then records the first element name that this first Hash keys is right, and obtains the second right element country of this first Hash keys.According to default hash algorithm, calculate the cryptographic hash of the second right element country of the first Hash keys, if the cryptographic hash calculated is 1, then search the memory node of cryptographic hash 1 correspondence of the second right element country of the first Hash keys.In this memory node, obtain the Hash keys pair that the first element is country, be acquisition second Hash keys pair.The Hash keys pair that first element is country if only store in memory node, then obtain second Hash keys pair.Now, the second Hash keys is to being < country, life circle >.According to the second Hash keys to renewal first Hash keys pair, be by the first Hash keys to by < name, national > is updated to < country, life circle >.Be updated to the first Hash keys to rear, record the first element country that the first Hash keys is right.Obtain the second element life circle that the first Hash keys is right.According to default hash algorithm, calculate the cryptographic hash of the second right element life circle of the first Hash keys, if the cryptographic hash calculated is 2, then search the memory node of cryptographic hash 2 correspondence of the second right element life circle of the first Hash keys.In this memory node, obtain the Hash keys pair that the first element is life range, be acquisition second Hash keys pair, storage first element is not had to be the Hash keys pair of life range in the memory node of now cryptographic hash 3 correspondence, that is, the second Hash keys obtained, to for empty, records the second element that the first Hash keys is right, is record life circle.Now, the data of record are name, country, life circle.Other three first Hash keys are to < name, city >, < name, island >, < name, the disposal route of lake >, with the first Hash keys to < name, the disposal route of country > is identical, does not repeat them here, as shown in Figure 6.Now, the first Hash keys of acquisition is to < name, and the record content of national > is name, country, life circle.First Hash keys is to < name, and the record content of city > is name, city, country, life circle.First Hash keys is to < name, and the record content of island > is name, island, life circle.First Hash keys is to < name, and the record content of lake > is name, lake, life circle.
108, according to described first Hash keys pair obtained, searching route is set up.
Concrete, the device that searching route stores in acquisition first Hash keys to rear, according to this first Hash keys to setting up searching route.Further, the device that searching route stores is according to right the first element of at least one first Hash keys of described record and right the second element of described first Hash keys, and according to writing time, backward sets up searching route.
Wherein, backward is set up and is referred to according to writing time, by the order arrangement of record content according to writing time from writing time the latest to writing time the earliest.
It should be noted that, owing to obtaining the first Hash keys pair according to search key type, the second element that Hash keys is right is the upper level element of the first element, so, when recording right the first element of the first Hash keys, the first element that the first Hash keys of current record is right is the upper level of the first element that the first Hash keys of last record is right.The search key type that user inputs is the first element that the first Hash keys of first record is right.The second element that the first Hash keys finally recorded is right is last element, is the root node of tree.
Wherein, the device that searching route stores is according to the writing time of right the first element of at least one first Hash keys and right the second element of described first Hash keys, by the content of record, according to from writing time the latest to the order of writing time the earliest, set up searching route.
Exemplary, described in upper example, at least one first element that 4 the first Hash keys of acquisition are right and the second element, be respectively the first Hash keys to < name, the record content of national > is name, country, life circle.First Hash keys is to < name, and the record content of city > is name, city, country, life circle.First Hash keys is to < name, and the record content of island > is name, island, life circle.First Hash keys is to < name, and the record content of lake > is name, lake, life circle.With the first Hash keys to < name, the record content of national > is name, and country, life circle is that example is described.
If the first Hash keys is to < name, the record content of national > is name, country, life circle.Wherein, the writing time of name, country took second place the earliest, and the writing time of life circle the latest.Now, according to the order of writing time the latest to writing time the earliest, set up searching route, the searching route now set up is life range, country, name.Other three first Hash keys are to the method setting up searching route, and with the first Hash keys to for < name, the method that national > sets up searching route is identical, does not repeat them here.4 searching routes obtained are: life circle, country, name; Life circle, country, city, name; Life circle, island, name; Life circle, lake, name.
109, carry out treating retrieve data according to described searching route and described search key to retrieve, obtain retrieve data.
Concrete, the device that searching route stores obtains searching route, find data to be retrieved according to searching route to retrieve, find and the data to be retrieved under searching route, now, search the data to be retrieved under searching route according to the search key of user's input, thus find the retrieve data relevant to search key.
Further, in at least one Hash keys described to when being stored to memory node, described searching route and described search key are sent to and store in the right memory node of Hash keys by the device that searching route stores, to make described memory node according to described searching route and described search key, the described data to be tested of not resolving described in storage are retrieved, and returns retrieve data.The device that searching route stores receives the retrieve data that described memory node returns.
Optionally, described searching route and described search key are added in inquiry request message by the device that searching route stores, and are sent to by inquiry request message and store in the right memory node of Hash keys.
Exemplary, as above described in example, 4 query and search paths that the device that searching route stores obtains are: life circle, country, name; Life circle, country, city, name; Life circle, island, name; Life circle, lake, name.4 searching routes that the device that searching route stores will obtain, and the search key Xi'an of the user's input received all is sent to and stores in the right all memory nodes of Hash keys.Memory node receives 4 searching routes of the device transmission that searching route stores, and behind the search key Xi'an of user's input, according to 4 searching routes, the not parsed data to be retrieved of retrieve stored respectively.Exemplary, according to life circle, country, the not parsed data to be retrieved that name search stores, after retrieving the data conformed to, according to the search key Xi'an of user's input, continue to retrieve the data conformed to, if retrieve the national name retrieve data identical with Xi'an in the data stored, then retrieve data is back to the device that searching route stores, do not retrieve the retrieve data that national name is identical with Xi'an, then the device stored to searching route returns the relevant information not retrieving the national name conformed to Xi'an.According to the not parsed data to be checked of other three searching routes retrieve stored and according to life circle, country, the not parsed data to be retrieved that name search stores are identical, do not repeat them here.
Memory node is life range in searching route, country, city, the retrieve data relevant to Xi'an is found out under the searching route of name, under other searching routes, do not retrieve relevant information, then the device that searching route stores can receive the retrieve data relevant to Xi'an of memory node feedback.
110, described retrieve data is returned.
Concrete, this retrieve data is fed back to subscriber equipment after receiving the retrieve data relevant to Xi'an of memory node feedback by the device that searching route stores.
Embodiments provide a kind of method that searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.After the search key receiving user's input and search key type, according to search key type, set up searching route, and according to the search key of this searching route and user's input, obtain retrieve data needed for user, and then feed back to user.Improve inquiry velocity, thus improve Consumer's Experience.
Embodiments provide the device that a kind of searching route stores, as shown in Figure 7, comprising:
Acquiring unit 601, for data to be retrieved being resolved, obtains at least one critical data.
Wherein, described critical data is the data for building searching route.
It should be noted that, when searching route refers to and retrieves according to the retrieval critical data received, the path used.
Concrete, described acquiring unit 601 specifically for, data to be retrieved are resolved, obtain the critical data that version is tree-shaped.
Generation unit 602, at least one critical data according to described acquiring unit 601 acquisition, generates at least one Hash keys pair.
Wherein, searching route by Hash keys described at least one to forming.Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element.First element is a critical data, and the second element is the upper level data of this critical data.
Concrete, described generation unit 602 specifically for, the described version obtained according to described acquiring unit 601 is the critical data of tree-shaped, generates at least one Hash keys pair.
Now, the first element that described Hash keys is right is a node in the critical data of tree; The second element that described Hash keys is right is the father node of described first element.
Storage unit 603, for store described generation unit 602 obtain described at least one Hash keys pair.
Concrete, described storage unit 603 specifically for, according to default hash algorithm, obtain at least one Hash keys described to the cryptographic hash of correspondence.According at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored in memory node corresponding to the described cryptographic hash of at least one Hash keys to correspondence.
Described storage unit 603, also for being stored in described memory node by not parsed described data to be tested.
Further, the device that above-mentioned searching route stores, as shown in Figure 8, also comprises:
Receiving element 604, for receiving search key and search key type.
Described acquiring unit 601, the described search key type also for receiving according to described receiving element 604, obtains the cryptographic hash of described search key type.
Described acquiring unit 601, also for the cryptographic hash according to the described search key type obtained, obtains the first Hash keys pair.
Wherein, described first Hash keys is to referring to the Hash keys pair arrived according to the Hash lookup of search key type.
Concrete, described acquiring unit 601 specifically for, according to the cryptographic hash of the described search key type obtained, obtain the first Hash keys pair that cryptographic hash corresponding to memory location is identical with the cryptographic hash of described search key type.The first element that first Hash keys described in cycle index is right, and the cryptographic hash obtaining the second right element of described first Hash keys.According to the cryptographic hash of right the second element of described first Hash keys of described acquisition, obtain the second Hash keys pair that the cryptographic hash of cryptographic hash corresponding to memory location second element right with described first Hash keys is identical; The first element that described second Hash keys is right refers to the second element that described first Hash keys is right.The Hash keys pair identical according to the cryptographic hash of the cryptographic hash that described memory location is corresponding second element right with described first Hash keys, upgrades described first Hash keys pair, until the second Hash keys obtained is to being sky; Record the second element that the first Hash keys is right.
Set up unit 605, for described first Hash keys pair obtained according to described acquiring unit 601, set up searching route.
Concrete, described set up unit 605 specifically for, first element right according at least one first Hash keys of described record, according to writing time, backward sets up searching route.
Wherein, backward is set up and is referred to according to writing time, by the order arrangement of record content according to writing time from writing time the latest to writing time the earliest.
Described acquiring unit 601, also for carrying out retrieving band retrieve data according to the described search key of the described described searching route and described receiving element 604 reception of setting up unit 605 foundation, obtains retrieve data.
Concrete, acquiring unit 601 specifically for, in at least one Hash keys described to when being stored to memory node, described searching route and described search key are sent to and store in the right memory node of Hash keys, to make described memory node according to described searching route and described search key, not parsed described data to be tested described in storage are retrieved, and returns retrieve data.Receive the retrieve data that described memory node returns.
Embodiments provide the device that a kind of searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.After the search key receiving user's input and search key type, according to search key type, set up searching route, and according to the search key of this searching route and user's input, obtain retrieve data needed for user, and then feed back to user.Improve inquiry velocity, thus improve Consumer's Experience.
Embodiments provide the device that a kind of searching route stores, as shown in Figure 9, comprising: storer 801 and the processor 802 be connected with storer 801.Certainly, the device that searching route stores can also comprise the universal components such as antenna, baseband process component, middle radio frequency processing parts, input-output unit, and the embodiment of the present invention is in this no longer any restriction.
Wherein, in storer 801, store batch processing code, processor 802 for calling the program code in storer 801, for performing following operation:
Processor 802, for data to be retrieved being resolved, obtains at least one critical data.
Wherein, described critical data is the data for building searching route.
It should be noted that, when searching route refers to and retrieves according to the retrieval critical data received, the path used.
Concrete, described processor 802 specifically for, data to be retrieved are resolved, obtain the critical data that version is tree-shaped.
Processor 802, also for according at least one critical data described, generates at least one Hash keys pair.
Wherein, searching route by Hash keys described at least one to forming.Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element.First element is a critical data, and the second element is the upper level data of this critical data.
Concrete, described processor 802 specifically for, be the critical data of tree-shaped according to described version, generate at least one Hash keys pair.
The first element that now described Hash keys is right is a node in the critical data of tree; The second element that described Hash keys is right is the father node of described first element.
Storer 801, for store described processor 802 obtain described at least one Hash keys pair.
Concrete, described storer 801 specifically for, according to default hash algorithm, obtain at least one Hash keys described to the cryptographic hash of correspondence.According at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored in memory node corresponding to the described cryptographic hash of at least one Hash keys to correspondence.
Described storer 801, also for being stored in described memory node by not parsed described data to be tested.
Further, the device that above-mentioned searching route stores, shown in figure 9, also comprises: receiver 803.Wherein, described receiver 803 is connected with processor 802 respectively.
Receiver 803, for receiving search key and search key type.
Described processor 802, the described search key type also for receiving according to described receiver 804, obtains the cryptographic hash of described search key type.
Described processor 802, also for the cryptographic hash according to the described search key type obtained, obtains the first Hash keys pair.
Wherein, described first Hash keys is to referring to the Hash keys pair arrived according to the Hash lookup of search key type.
Concrete, described processor 802 specifically for, according to the cryptographic hash of the described search key type obtained, obtain the first Hash keys pair that cryptographic hash corresponding to memory location is identical with the cryptographic hash of described search key type.The first element that first Hash keys described in cycle index is right, and the cryptographic hash obtaining the second right element of described first Hash keys.According to the cryptographic hash of right the second element of described first Hash keys of described acquisition, obtain the second Hash keys pair that the cryptographic hash of cryptographic hash corresponding to memory location second element right with described first Hash keys is identical; The first element that described second Hash keys is right refers to the second element that described first Hash keys is right.The Hash keys pair identical according to the cryptographic hash of the cryptographic hash that described memory location is corresponding second element right with described first Hash keys, upgrades described first Hash keys pair, until the second Hash keys obtained is to being sky; Record the second element that the first Hash keys is right.
Processor 802, also for according to described first Hash keys pair, sets up searching route.
Concrete, described processor 802 specifically for, first element right according at least one first Hash keys of described record, according to writing time, backward sets up searching route.
Wherein, backward is set up and is referred to according to writing time, by the order arrangement of record content according to writing time from writing time the latest to writing time the earliest.
Described processor 802, the described search key also for receiving according to described searching route and described receiving element 604 carries out retrieving band retrieve data, obtains retrieve data.
Concrete, processor 802 specifically for, in at least one Hash keys described to when being stored to memory node, described searching route and described search key are sent to and store in the right memory node of Hash keys, to make described memory node according to described searching route and described search key, not parsed described data to be tested described in storage are retrieved, and returns retrieve data.Receive the retrieve data that described memory node returns.
Embodiments provide the device that a kind of searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.After the search key receiving user's input and search key type, according to search key type, set up searching route, and according to the search key of this searching route and user's input, obtain retrieve data needed for user, and then feed back to user.Improve inquiry velocity, thus improve Consumer's Experience.
Embodiments provide the system that a kind of searching route stores, as shown in Figure 10, comprising: host node 901, switch 902, service server 903, terminal 904.Wherein, described road host node 901 is the device of the searching route storage described in above-described embodiment.
Further, the system that above-mentioned searching route stores, shown in Figure 10, also comprises: memory node 905.Wherein, described host node 901 manages described memory node 905.
Embodiments provide method, Apparatus and system that a kind of searching route stores, by being resolved by data to be tested, the critical data parsed, according to the critical data parsed, obtains Hash keys pair, and stores described Hash keys pair.Like this, each Hash keys of storage, to only having two elements, decreases redundant information, thus achieves the waste reducing storage space, improves the utilization factor of storage space.After the search key receiving user's input and search key type, according to search key type, set up searching route, and according to the search key of this searching route and user's input, obtain retrieve data needed for user, and then feed back to user.Improve inquiry velocity, thus improve Consumer's Experience.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.

Claims (12)

1. a method for searching route storage, is characterized in that, comprising:
Data to be retrieved are resolved, obtains at least one critical data;
According at least one critical data described, generate at least one Hash keys pair; Wherein, searching route by Hash keys described at least one to forming; Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element;
Store at least one Hash keys pair described;
Receive search key and search key type;
According to described search key type, the first Hash keys pair is obtained from least one Hash keys centering described, circulation upgrades described first Hash keys pair, and record the first right element of described first Hash keys, until the first Hash keys upgraded is to for time empty, record the second element that the first Hash keys of current renewal is right; Wherein, the first element that the first Hash keys of renewal is right upgrades the second right element of front first Hash keys;
According at least one first element and second element of record, according to writing time, backward sets up searching route;
According to described searching route and described search key, described data to be retrieved are retrieved, obtain retrieve data.
2. the method that stores of searching route according to claim 1, is characterized in that, describedly data to be retrieved is resolved, and obtains at least one critical data and comprises:
Data to be retrieved are resolved, obtains the critical data that version is tree-shaped;
At least one critical data described in described basis, generates at least one Hash keys to comprising:
According to the critical data that described version is tree-shaped, generate at least one Hash keys pair, wherein, the first element that described Hash keys is right is a node in the critical data of tree; The second element that described Hash keys is right is the father node of described first element.
3. the method for searching route storage according to claim 1 and 2, it is characterized in that, described in described storage, at least one Hash keys is to comprising:
According to default hash algorithm, obtain at least one Hash keys described to the cryptographic hash of correspondence;
According at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored in memory node corresponding to the described cryptographic hash of at least one Hash keys to correspondence.
4. the method for searching route storage according to claim 3, is characterized in that,
Described according to described search key type, obtain the first Hash keys pair from least one Hash keys centering described, comprising:
According to described search key type, obtain the cryptographic hash of described search key type;
According to the cryptographic hash of the described search key type obtained, obtain the first Hash keys pair.
5. the method for searching route storage according to claim 4, is characterized in that, the cryptographic hash of the described described search key type according to obtaining, obtains the first Hash keys to comprising:
According to the cryptographic hash of the described search key type obtained, obtain the first Hash keys pair that cryptographic hash corresponding to memory location is identical with the cryptographic hash of described search key type;
Described circulation upgrades described first Hash keys pair, and records the first right element of described first Hash keys, until the first Hash keys upgraded is to during for sky, records the second element that the first Hash keys of current renewal is right, comprising:
The first element that first Hash keys described in cycle index is right, and the cryptographic hash obtaining the second right element of described first Hash keys;
According to the cryptographic hash of right the second element of described first Hash keys of described acquisition, obtain the second Hash keys pair that the cryptographic hash of cryptographic hash corresponding to memory location second element right with described first Hash keys is identical; The first element that described second Hash keys is right refers to the second element that described first Hash keys is right;
According to described second Hash keys to described first Hash keys pair of renewal, until the second Hash keys obtained is to being sky; Record the second Hash keys to being right the second element of the first Hash keys time empty.
6. the method that the searching route according to claim 4 or 5 stores, is characterized in that,
Described method also comprises: not parsed data described to be retrieved being generated corresponding cryptographic hash according to presetting hash algorithm, being stored in corresponding memory node by described not parsed data described to be retrieved according to the cryptographic hash of correspondence;
Describedly carry out treating retrieve data according to described searching route and described search key and retrieve, obtain retrieve data and comprise:
In at least one Hash keys described to when being stored to memory node, described searching route and described search key are sent to and store in the right memory node of Hash keys, to make described memory node according to described searching route and described search key, not parsed described data to be tested described in storage are retrieved, and returns retrieve data;
Receive the retrieve data that described memory node returns.
7. a device for searching route storage, is characterized in that, comprising:
Acquiring unit, for data to be retrieved being resolved, obtains at least one critical data;
Generation unit, at least one critical data described in obtaining according to described acquiring unit, generates at least one Hash keys pair; Wherein, searching route by Hash keys described at least one to forming; Described Hash keys is to comprising: the first element and the second element; Described second element is the upper level element of described first element;
Storage unit, for store described generation unit obtain described at least one Hash keys pair;
Receiving element, for receiving search key and search key type;
Acquiring unit, also for according to described search key type, the first Hash keys pair is obtained from least one Hash keys centering described, circulation upgrades described first Hash keys pair, and record the first right element of described first Hash keys, until the first Hash keys upgraded is to for time empty, record the second element that the first Hash keys of current renewal is right; Wherein, the first element that the first Hash keys of renewal is right upgrades the second right element of front first Hash keys;
Set up unit, for according to record at least one first element and second element, according to writing time, backward sets up searching route;
Acquiring unit, also for retrieving described data to be retrieved according to described searching route and described search key, obtains retrieve data.
8. device according to claim 7, is characterized in that,
Described acquiring unit specifically for, data to be retrieved are resolved, obtain the critical data that version is tree-shaped;
Described generation unit specifically for, the described version obtained according to described acquiring unit is the critical data of tree-shaped, and generate at least one Hash keys pair, wherein, the first element that described Hash keys is right is a node in the critical data of tree; The second element that described Hash keys is right is the father node of described first element.
9. the device according to claim 7 or 8, is characterized in that,
Described storage unit specifically for, according to default hash algorithm, obtain at least one Hash keys described to the cryptographic hash of correspondence;
According at least one Hash keys described to the cryptographic hash of correspondence, by least one Hash keys pair described, be stored in memory node corresponding to the described cryptographic hash of at least one Hash keys to correspondence.
10. device according to claim 9, is characterized in that, also comprises:
Described acquiring unit, the described search key type also for receiving according to described receiving element, obtains the cryptographic hash of described search key type;
Described acquiring unit, also for the cryptographic hash according to the described search key type obtained, obtains the first Hash keys pair.
11. devices according to claim 10, is characterized in that,
Described acquiring unit specifically for, according to the cryptographic hash of described search key type obtained, obtain the first Hash keys pair that cryptographic hash corresponding to memory location is identical with the cryptographic hash of described search key type;
The first element that first Hash keys described in cycle index is right, and the cryptographic hash obtaining the second right element of described first Hash keys;
According to the cryptographic hash of right the second element of described first Hash keys of described acquisition, obtain the second Hash keys pair that the cryptographic hash of cryptographic hash corresponding to memory location second element right with described first Hash keys is identical; The first element that described second Hash keys is right refers to the second element that described first Hash keys is right;
The Hash keys pair identical according to the cryptographic hash of the cryptographic hash that described memory location is corresponding second element right with described first Hash keys, upgrades described first Hash keys pair, until the second Hash keys obtained is to being sky; Record the second Hash keys to being right the second element of the first Hash keys time empty.
12. devices according to claim 10 or 11, is characterized in that,
Described storage unit specifically for, not parsed data described to be retrieved are generated corresponding cryptographic hash according to presetting hash algorithm, described not parsed data described to be retrieved are stored in corresponding memory node according to the cryptographic hash of correspondence;
Described acquiring unit specifically for, in at least one Hash keys described to when being stored to memory node, described searching route and described search key are sent to and store in the right memory node of Hash keys, to make described memory node according to described searching route and described search key, not parsed described data to be tested described in storage are retrieved, and returns retrieve data;
Receive the retrieve data that described memory node returns.
CN201210584778.2A 2012-12-28 2012-12-28 Method, Apparatus and system that a kind of searching route stores Active CN103049553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210584778.2A CN103049553B (en) 2012-12-28 2012-12-28 Method, Apparatus and system that a kind of searching route stores

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210584778.2A CN103049553B (en) 2012-12-28 2012-12-28 Method, Apparatus and system that a kind of searching route stores

Publications (2)

Publication Number Publication Date
CN103049553A CN103049553A (en) 2013-04-17
CN103049553B true CN103049553B (en) 2016-03-02

Family

ID=48062194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210584778.2A Active CN103049553B (en) 2012-12-28 2012-12-28 Method, Apparatus and system that a kind of searching route stores

Country Status (1)

Country Link
CN (1) CN103049553B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103685453B (en) * 2013-09-11 2016-08-03 华中科技大学 The acquisition methods of metadata in a kind of cloud storage system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101655871A (en) * 2009-09-25 2010-02-24 金蝶软件(中国)有限公司 Method and device for storing and inquiring data
EP2209074A1 (en) * 2009-01-19 2010-07-21 Huawei Technologies Co., Ltd. Data storage processing method, data searching method and devices thereof
CN102360359A (en) * 2011-09-29 2012-02-22 用友软件股份有限公司 Data management device and data management method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2209074A1 (en) * 2009-01-19 2010-07-21 Huawei Technologies Co., Ltd. Data storage processing method, data searching method and devices thereof
CN101655871A (en) * 2009-09-25 2010-02-24 金蝶软件(中国)有限公司 Method and device for storing and inquiring data
CN102360359A (en) * 2011-09-29 2012-02-22 用友软件股份有限公司 Data management device and data management method

Also Published As

Publication number Publication date
CN103049553A (en) 2013-04-17

Similar Documents

Publication Publication Date Title
KR102240557B1 (en) Method, device and system for storing data
CN107704202B (en) Method and device for quickly reading and writing data
US9659023B2 (en) Maintaining and using a cache of child-to-parent mappings in a content-addressable storage system
CN111241108B (en) Key value based indexing method and device for KV system, electronic equipment and medium
CN105740303A (en) Improved object storage method and apparatus
KR20200122994A (en) Key Value Append
CN106681995B (en) Data caching method, data query method and device
CN105141672A (en) Method, device and system for data storage
CN112988770B (en) Method, device, electronic equipment and storage medium for updating serial number
CN107798063B (en) Snapshot processing method and snapshot processing device
JP6788002B2 (en) Data storage methods and devices for mobile devices
CN110888847B (en) Recycle bin system and file recycling method
CN103049553B (en) Method, Apparatus and system that a kind of searching route stores
CN104063377A (en) Information processing method and electronic equipment using same
US10956373B1 (en) Page-based metadata system for distributed filesystem
CN112241336A (en) Method, apparatus and computer program product for backing up data
CN111858158B (en) Data processing method and device and electronic equipment
CN115422135A (en) Data processing method and device
CN112131222B (en) Storage method, device, medium and electronic equipment for message reading state data
US11586499B2 (en) Method, device and computer program product for storing data
US20200341648A1 (en) Method, device and computer program product for storage management
CN116010677B (en) Spatial index method and device and electronic equipment thereof
CN106993036B (en) Running environment information processing method and switch
CN112162951A (en) Information retrieval method, server and storage medium
CN116305288B (en) Method, device, equipment and storage medium for isolating database resources

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
TR01 Transfer of patent right

Effective date of registration: 20191220

Address after: 314400 No.11, Weisan Road, Nongfa District, Chang'an Town, Haining City, Jiaxing City, Zhejiang Province

Patentee after: Haining hi tech Zone Science and Innovation Center Co.,Ltd.

Address before: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Effective date of registration: 20191220

Address after: 510000 unit 2414-2416, building, No. five, No. 371, Tianhe District, Guangdong, China

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right