WO2013108333A1 - 検索装置、検索方法、及び、検索プログラム - Google Patents

検索装置、検索方法、及び、検索プログラム Download PDF

Info

Publication number
WO2013108333A1
WO2013108333A1 PCT/JP2012/007922 JP2012007922W WO2013108333A1 WO 2013108333 A1 WO2013108333 A1 WO 2013108333A1 JP 2012007922 W JP2012007922 W JP 2012007922W WO 2013108333 A1 WO2013108333 A1 WO 2013108333A1
Authority
WO
WIPO (PCT)
Prior art keywords
search
rank
previous
node
attention
Prior art date
Application number
PCT/JP2012/007922
Other languages
English (en)
French (fr)
Inventor
佑嗣 小林
藤山 健一郎
健太郎 山崎
敏功 落合
Original Assignee
日本電気株式会社
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 日本電気株式会社 filed Critical 日本電気株式会社
Publication of WO2013108333A1 publication Critical patent/WO2013108333A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees

Definitions

  • the present invention relates to a search device, a search method, and a search program, and more particularly, to a search device, a search method, and a search program that perform a search by searching a tree structure.
  • a search device uses a tree structure to search an element string of a search condition from a plurality of element strings to be searched.
  • the element row is composed of a plurality of elements arranged in a predetermined order.
  • the element is, for example, small unit data such as character data.
  • FIG. 22 is a diagram illustrating an example of the trie tree structure.
  • each rank (order from the top or position) of the element string is associated with the hierarchy of the tree structure.
  • the trie tree structure has a node for performing matching determination for each element in the rank corresponding to the hierarchy for each hierarchy.
  • Each node has an element to be compared with the search condition and a link to a child node to be traced next when the element matches the element.
  • the trie tree structure has a leaf node that stores a search target.
  • the tree structure in FIG. 22 is an example in which the element string to be searched is four alphabetic character strings “aa”, “ab”, “ba”, “bb”.
  • the first hierarchy includes a node having a node identifier N1 for performing a match determination on the element of rank “1”
  • the second hierarchy includes a node for performing a match determination on the element of rank “2”.
  • Nodes with identifiers N21 and N22 are arranged.
  • the node with the node identifier N1 has a link to the node with the node identifier N21 for the character “a” and a link to the node with the node identifier N22 for the character “b”.
  • nodes having node identifiers N31, N32, N33, and N34 that store four alphabetic character strings to be searched are arranged as leaf nodes.
  • a search device using a trie tree structure the following tree structure search is performed in order to obtain a search result.
  • Next, in the child node similarly, it is determined whether there is an element that matches the element of the next rank of the search condition in the element of the node. If there is a matching element, it is indicated by a link to the element. Move to a child node. Thus, moving to the next node according to the result of the match determination is defined as tracing the node. If there is no matching element, the tree structure search ends. The above operation is repeated until the leaf node is reached, and the search target stored in the leaf node is output as the search result.
  • the match determination of the character with the rank “1” is performed at the node with the node identifier N1, and the match determination result with the character “a” is obtained. can get.
  • the matching determination of the character with the rank “2” is performed, and the matching determination result with the character “a” is obtained. Since the node with the node identifier N31 indicated by the link corresponding to the character “a” is a leaf node, the character string “aa” is output as the search result.
  • Patent Document 1 An example of a technique for speeding up such a continuous search is described in Patent Document 1, for example.
  • the search device of Patent Literature 1 stores an element string of a previous search condition and a node traced by a tree structure search in the previous search.
  • the search device compares the element string of the previous search condition with the element string of the input search condition from the top rank, and determines whether they match or do not match.
  • the search device starts a search for the input search condition from the node (search start node) corresponding to the rank one higher than the rank determined to be inconsistent among the nodes traced in the previous search.
  • search up to the search start node in the tree structure is omitted, and the search range is limited to nodes below the search start node, so that the search is speeded up.
  • Patent Document 1 In the technique described in Patent Document 1 described above, it is necessary to repeat the element comparison in order from the top of the element string in order to determine the search start node, and there is a problem that it takes time to search.
  • An object of the present invention is to solve the above-mentioned problem, and when performing a search for a search condition that matches the previous search condition in a limited manner on a search range on a search tree, a search device that can speed up the search, A search method and a search program are provided.
  • the search device includes a search tree storage unit that stores a plurality of search targets that are element strings, and stores a search tree in which each rank from the top of the element string is associated with each hierarchy from the root; Previous search condition storage means for storing a previous search element sequence, and previous search path information indicating a node of a hierarchy corresponding to the attention rank among nodes traced when searching for the previous search element sequence in the search tree.
  • the previous search route information storage means for storing, the input search element sequence and the previous search element sequence, collectively compare the element sequence before the attention rank, and if they match, the previous search Search start node determination means for determining the node indicated by the path information as a search start node, and search for the elements after the attention rank in the input search element sequence from the search start node on the search tree By performing, including a searching means for searching the search element string that is the input from the plurality of search target.
  • the search method stores a search tree that represents a plurality of search targets that are element strings, associates each rank from the top of the element string with each hierarchy from the root, and stores the previous search element string And storing previous search path information indicating nodes in the hierarchy corresponding to the attention rank among the nodes to be traced when searching the previous search element string in the search tree, and the input search element string and the Compare the previous search element sequence with the previous search element sequence in a lump, and if they match, determine the node indicated by the previous search path information as a search start node, and The input search element sequence is searched from the plurality of search targets by searching for the elements after the attention rank of the input search element sequence from the search start node.
  • the computer stores a search tree that represents a plurality of search targets that are element strings and associates each rank from the head of the element string with each hierarchy from the root.
  • Storing the previous search element sequence storing the previous search path information indicating the node of the hierarchy corresponding to the attention rank among the nodes to be traced when searching the previous search element sequence in the search tree, The element sequence before the attention rank is compared in a batch between the input search element sequence and the previous search element sequence, and if they match, the node indicated by the previous search route information is searched And the search starting node on the search tree is searched for the elements after the attention rank of the input search element string, and the input from the plurality of search targets is performed.
  • Search Search element sequence and stores a search program for executing the process.
  • the effect of the present invention is that the search can be further speeded up when the search condition that matches the previous search condition is limited and the search range on the search tree is limited.
  • FIG. It is a block diagram which shows the structure of the search device 100 in the 3rd Embodiment of this invention. It is a flowchart which shows attention rank update processing in the 3rd Embodiment of this invention.
  • FIG. 2 is a block diagram showing the configuration of the search device 100 according to the first embodiment of the present invention.
  • the search device 100 includes a search start node determination unit 110, a search unit 120, a search tree storage unit 210, an attention rank storage unit 220, and a previous search condition storage unit 240. And a previous searched route storage unit 250.
  • the search tree storage unit 210 stores search tree information 310 indicating the tree structure of the search tree 300.
  • FIG. 5 is a diagram illustrating an example of the search tree 300 according to the first embodiment of this invention.
  • the search tree 300 in FIG. 5 includes six element strings “aaa”, “aab”, “aba”, “abb”, “baa” whose search target is an alphabet character and whose element string length is 3, and , “Bab”.
  • the order (position) from the top of each element in the element string is defined as a rank.
  • the search tree 300 is a node having a node identifier N1 for determining the match for the element of the rank “1” in the first hierarchy, and a node for performing a match determination for the element of the rank “2” in the second hierarchy.
  • the nodes with identifiers N21 and N22 and the third layer have node identifiers N31, N32, and N33 for performing a match determination on the element of rank “3”.
  • the search tree 300 has node identifiers N41, N42, N43, N44, N45, and N46 that store search targets as leaf nodes.
  • FIG. 6 is a diagram illustrating an example of the search tree information 310 according to the first embodiment of this invention.
  • the search tree information 310 in FIG. 6 corresponds to the search tree 300 in FIG.
  • the search tree information 310 includes “node ID”, “order”, “child node link information”, and “search target”.
  • “node ID” indicates an identifier of the node.
  • “Rank” indicates the rank of an element that corresponds to a hierarchy on the search tree 300 of the node and performs matching determination at the node. The rank “1” corresponds to the root node hierarchy on the search tree 300.
  • “Child node link information” includes “element” and “child node ID”.
  • “Element” indicates the value of the element for which the matching is determined.
  • the “child node ID” indicates an identifier of a child node that is a movement destination when the value of the element indicated by “rank” in the element string of the search condition matches the value indicated by “element”.
  • search target indicates an element string to be searched. Note that “search target” is not set for nodes other than leaf nodes.
  • the search tree information 310 is generated in advance by a user or the like based on the element sequence to be searched and set in the search tree storage unit 210.
  • the attention rank storage unit 220 stores attention rank information 320.
  • FIG. 7 is a diagram illustrating an example of attention order information 320 according to the first embodiment of this invention.
  • the attention rank information 320 indicates the attention rank.
  • the element string before the attention rank is compared between the element string of the input search condition and the element string of the previous search condition 340.
  • the attention rank information 320 is set in advance by the user or the like.
  • the previous search condition storage unit 240 stores the previous search condition 340.
  • the previous searched route storage unit 250 stores previous searched route information 350.
  • FIG. 8 is a diagram illustrating an example of the previous search condition 340 and the previous search route information 350 for each search according to the first embodiment of this invention.
  • the previous search condition 340 indicates an element string of the search condition in the previous search.
  • the previous search route information 350 indicates a node identifier of a node corresponding to the attention rank among the nodes traced when searching the previous search condition 340 in the search tree 300.
  • the search start node determination unit 110 compares the input search condition 330 with the previous search condition 340 and determines the search start node that is the search start point on the search tree 300 as the previous search route information 350. And decide.
  • the search unit 120 performs a search from the search start node on the search tree 300 and acquires a search result 380 for the input search condition 330. In addition, the search unit 120 updates the previous search condition 340 and the previous search route information 350.
  • the search device 100 may be a computer that includes a CPU (Central Processing Unit) and a storage medium that stores a program, and that operates by control based on the program.
  • the search tree storage unit 210, the attention rank storage unit 220, the previous search condition storage unit 240, and the previous search path storage unit 250 may be configured as individual storage media or a single storage medium.
  • FIG. 3 is a flowchart showing search processing in the first embodiment of the present invention.
  • the search device 100 receives an input of the search condition 330 from the user (step S101).
  • the search start node determination unit 110 of the search device 100 compares each element of the rank before the attention rank of the attention rank information 320 between the search condition 330 and the previous search condition 340, and before the attention rank. It is determined whether or not the elements of all ranks (element strings before the attention rank) match (step S102).
  • the search start node determination unit 110 collectively compares the element strings before the attention rank and performs the above determination.
  • the search start node determination unit 110 converts the element sequences before the attention rank of the search condition 330 and the previous search condition 340 into hash values using a predetermined hash function, and the hash values match. Determine whether to do.
  • the search start node determination unit 110 may compare the element strings before the attention rank in a lump and may use other methods if the above determination can be made.
  • step S102 If it is determined in step S102 that they match (step S102 / Yes), the search start node determination unit 110 sets the attention rank to the search start rank (step S103).
  • the search start node determination unit 110 determines a search start node based on the previous search route information 350.
  • the search start node determination unit 110 sets the node identifier indicated by the previous search route information 350 as the search start node (step S104).
  • step S104 if a node identifier is not set in the previous search route information 350, as described later in step S119, in the search for the previous search condition 340, the search is performed up to a rank lower than the attention rank (previous). Since this corresponds to that the search result 380 is “none”, the search result 380 is set to “none” for the search condition 330 and the search is terminated.
  • step S102 determines whether they do not match (step S102 / No). If it is determined in step S102 that they do not match (step S102 / No), the search start node determination unit 110 sets the rank “1” as the search start rank (step S105) and searches for the identifier of the root node. The start node is set (step S106). In the initial state, since the previous search condition 340 and the previous search route information 350 are not set, the search start node determining unit 110 sets the identifier of the root node as the search start node.
  • the search unit 120 refers to the search tree information 310 and searches the element string of the search condition 330 from the search start node on the search tree 300 (step S107).
  • FIG. 4 is a flowchart showing details of the search process (step S107) in the first embodiment of the present invention.
  • the search unit 120 sets a search start node as a search node (step S111).
  • the search unit 120 refers to the search tree information 310 and determines whether the search node is a leaf node (step S112).
  • step S112 if the search node is a leaf node (step S112 / Yes), the search unit 120 sets the search target for the search node in the search tree information 310 to the search result 380 (step S118), and ends the process. To do.
  • step S112 determines whether or not the comparison order matches the attention order (step S113).
  • step S113 when the comparison order matches the attention order (step S113 / Yes), the search unit 120 updates the node identifier of the previous search route information 350 with the node identifier of the search node (step S114).
  • the search unit 120 determines whether there is an element in the search tree information 310 that matches the element of the comparison order in the element string of the search condition 330 among the elements for the search node (step S115).
  • step S115 when there is a matching element (step S115 / Yes), the search unit 120 sets a child node identifier for the element in the search tree information 310 to the search node (step S116). Then, the search unit 120 recursively repeats the processing from steps S112 to S119 until a search result 380 is obtained (step S117).
  • step S115 if there is no matching element (step S115 / No), the search unit 120 sets “none” in the search result 380 (step S119), and ends the process.
  • step S119 when the comparison order is lower than the attention order (when the previous search route information 350 is not updated in step S114), the search unit 120 deletes the set value of the previous search route information 350 (initially). ).
  • the search unit 120 updates the previous search condition 340 with the search condition 330 (step S108).
  • the search device 100 outputs a search result 380 (step S109).
  • the search tree information 310 of FIG. 6 is set. Further, it is assumed that the attention rank “3” is set in the attention rank information 320 as shown in FIG. Furthermore, in the initial state, it is assumed that the previous search condition 340 and the previous search route information 350 are not set as shown in the state (a) of FIG.
  • the search start node determination unit 110 sets the node identifier “N1” of the root node as the search start node.
  • the search unit 120 sets the search start node identifier “N1” as the search node and the rank “1” as the comparison rank. Since the element “a” of the comparison order “1” of the search condition 330 matches the element “a” of the search node “N1”, the search unit 120 sets the child node “N21” for the element as the search node.
  • the search unit 120 sets the rank “2” as the comparison rank.
  • the search unit 120 sets the child node “N31” for the element as the search node because the element “a” of the comparison order “2” of the search condition 330 matches the element of the search node “N21” and “a”. .
  • the search unit 120 sets the rank “3” as the comparison rank. Since the comparison order “3” matches the attention order, the search unit 120 sets the node identifier “N31” of the search node to the node identifier of the previous search route information 350 as shown in the state (b) of FIG. To do. Since the element “a” of the comparison order “3” of the search condition 330 matches the element “a” of the search node “N31”, the search unit 120 sets the child node “N41” for the element as the search node. .
  • the search unit 120 Since the search node “N41” is a leaf node, the search unit 120 sets the search target “aaa” of the search node “N41” in the search result 380. Then, the search unit 120 sets the search condition 330 “aaa” in the previous search condition 340 as shown in the state (b) of FIG.
  • the search start node determination unit 110 sets the search condition 330 and the previous search condition 340 in the state (b) of FIG.
  • the element strings before the attention rank “3” are collectively compared.
  • the search start node determination unit 110 searches for the node identifier “N31” in the previous searched route information 350 in the state (b) of FIG. Set to the start node.
  • the search unit 120 searches from the search start node in the order of the search nodes “N31” and “N41”, and sets the search target “aab” in the search result 380.
  • the search unit 120 sets the search condition 330 “aab” in the previous search condition 340, and the node identifier “N31” of the search node in the previous search path information 350. Set.
  • FIG. 1 is a block diagram showing a characteristic configuration of the first embodiment of the present invention.
  • the search device 100 includes a search start node determination unit 110, a search unit 120, a search tree storage unit 210, a previous search condition storage unit 240, and a previous search route storage unit 250.
  • the search tree storage unit 210 represents a plurality of search targets that are element strings, and stores a search tree 300 in which each rank from the head of the element string is associated with each hierarchy from the root.
  • the previous search condition storage unit 240 stores the previous search condition 340 that is the previous search element string.
  • the previous search route storage unit 250 stores previous search route information 350 indicating nodes in the hierarchy corresponding to the attention rank among the nodes to be traced when searching the element string of the previous search condition 340 in the search tree 300.
  • the search start node determination unit 110 collectively compares the element string of the input search condition 330 and the element string of the previous search condition 340 in the element string before the attention rank, and if they match, the search path information of the previous time
  • the node indicated by 350 is determined as the search start node.
  • the search unit 120 searches the element string of the search condition 330 input from a plurality of search targets by searching for elements after the attention rank of the input search condition 330 from the search start node on the search tree 300. To do.
  • the search start node determination unit 110 compares the element string of the input search condition 330 and the element string of the previous search condition 340 in a batch and matches the element string before the attention rank. This is because the node indicated by the previous search route information 350 is determined as the search start node.
  • setting the rank as the attention rank makes the determination of the search start node more efficient, Search is faster.
  • the search start node determination unit 110 determines, as the search start node, a node in the hierarchy corresponding to the attention rank among the nodes to be traced when searching the element string of the previous search condition 340. It is. As a result, not all the nodes traced when searching the element string of the previous search condition 340 but at least information on nodes in the hierarchy corresponding to the attention rank necessary for determining the search start node is stored in the previous search path information 350. Thus, the search start node can be determined.
  • the second embodiment of the present invention is different from the first embodiment of the present invention in that a search start node is determined from a plurality of nodes of attention order included in the previous search route information 351.
  • components having the same reference numerals as in the first embodiment of the present invention are the same as those in the first embodiment of the present invention unless otherwise specified.
  • the attention rank storage unit 220 stores attention rank information 321.
  • FIG. 10 is a diagram showing an example of the attention rank information 321 in the second embodiment of the present invention.
  • the attention rank information 321 includes a plurality of attention ranks.
  • the previous search route storage unit 250 stores the previous search route information 351.
  • FIG. 11 is a diagram illustrating an example of the previous search condition 340 and the previous search route information 351 for each search in the second embodiment of the present invention.
  • the previous search route information 351 indicates a node identifier of a node corresponding to each of a plurality of attention ranks among the nodes on the search tree 300 traced by the search of the previous search condition 340.
  • FIG. 9 is a flowchart showing the processing of the search device 100 in the second embodiment of the present invention.
  • the search start node determination unit 110 of the search device 100 receives an input of the search condition 330 from the user (step S201).
  • the search start node determination unit 110 of the search device 100 sets the search condition 330 and the previous search condition 340 in order from the larger (backward) rank among the plurality of attention ranks included in the attention rank information 321. Each element of the rank before the attention rank is compared, and it is determined whether or not the element strings before the attention rank match (step S202).
  • the search start node determination unit 110 compares the element strings before the attention order for each of the plurality of attention orders, and performs the above determination.
  • search start node determination unit 110 may perform the determination in another order, such as performing the determination in order from a smaller (front) rank among a plurality of attention ranks included in the attention rank information 321. .
  • step S202 when it is determined that any of the attention ranks matches (step S202 / Yes), the search start node determination unit 110 sets the attention rank as the search start rank (step S203).
  • the search start node determination unit 110 determines a search start node based on the previous search route information 351.
  • the search start node determination unit 110 sets the node identifier corresponding to the search start rank in the previous search route information 351 as the search start node (step S204).
  • the search order rank is smaller than the previous order (previous). Since this corresponds to the search result 380 being “none” in the search, “none” is set in the search result 380 for the search condition 330 and the search is terminated.
  • step S202 when it is determined in step S202 that all the attention ranks do not match (step S202 / No), the search start node determination unit 110 sets the rank “1” as the search start rank (step S205). Then, the search start node determination unit 110 determines the root node as a search start node (step S206).
  • the search unit 120 refers to the search tree information 310 and searches the element string of the search condition 330 from the search start node on the search tree 300 (step S207).
  • the search process in the second embodiment of the present invention is the same as that in the first embodiment (FIG. 4) of the present invention except for the update of the previous search route information 351 (steps S113, S114, and S119). It becomes.
  • step S113 the search unit 120 determines whether the comparison order matches any of the plurality of attention orders included in the attention order information 321. If the comparison order matches any of the plurality of attention orders, in step S114, the search unit 120 updates the node identifier corresponding to the comparison order in the previous search path information 351 with the node identifier of the search node.
  • step S119 the search unit 120 deletes (initializes) a set value for an attention rank that is larger than the comparison rank (the update is not performed in step S114) among the attention ranks of the previous searched route information 350.
  • the search unit 120 updates the previous search condition 340 with the search condition 330 (step S208).
  • the search unit 120 outputs the search result 380 (step S209).
  • the search tree information 310 of FIG. 6 is set. Further, it is assumed that attention rank information “2” and “3” are set in the attention rank information 321 as shown in FIG. Furthermore, in the initial state, it is assumed that the previous search condition 340 and the previous searched route information 351 are not set as shown in the state (a) of FIG.
  • the search start node determination unit 110 sets the node identifier “N1” of the root node as the search start node.
  • the search unit 120 searches in the order of the search nodes “N1”, “N21”, “N31”, and “N41”, and sets the search target “aaa” in the search result 380.
  • the search unit 120 sets the search condition 330 “aaa” as the previous search condition 340, and performs the ranks “2” and “3” of the previous search route information 351. Node identifiers “N21” and “N31” are set.
  • the search start node determination unit 110 sets the search condition 330 and the previous search condition 340 in the state (b) of FIG.
  • the element strings before the attention rank “3” and before the attention rank “2” are collectively compared.
  • the search start node determination unit 110 determines the node for the rank “2” in the previous searched route information 351 in the state (b) of FIG.
  • the identifier “N21” is set as the search start node.
  • the search unit 120 searches from the search start node in the order of the search nodes “N21”, “N32”, and “N44”, and sets the search target “abb” in the search result 380. Then, as shown in the state (c) of FIG. 11, the search unit 120 sets the search condition 330 “abb” as the previous search condition 340, and with respect to the ranks “2” and “3” of the previous search route information 351. , Node identifiers “N21” and “N32” are set.
  • the search start node determination unit 110 sets the search condition 330 and the previous search condition 340 in the state (c) of FIG.
  • the element strings before the attention rank “3” and before the attention rank “2” are collectively compared.
  • the search start node determination unit 110 determines the node for the rank “3” in the previous searched route information 351 in the state (c) of FIG.
  • the identifier “N32” is set as the search start node.
  • the search unit 120 searches from the search start node in the order of the search nodes “N32” and “N43”, and sets the search target “aba” in the search result 380. Then, as shown in the state (d) of FIG. 11, the search unit 120 sets the search condition 330 “aba” as the previous search condition 340, and sets the node identifier for the rank “3” of the previous search route information 351. “N32” is set.
  • the search start node determination unit 110 collectively compares the element strings before each of the plurality of attention ranks in the element string of the input search condition 330 and the element string of the previous search condition 340. This is because when the element sequence before any of the plurality of attention ranks matches, the node corresponding to the attention rank indicated by the previous search route information 350 is determined as the search start node.
  • the third embodiment of the present invention is the same as the first embodiment of the present invention in that the attention rank is updated according to the number of times the elements in each rank do not match between consecutive search conditions. Different.
  • components having the same reference numerals as those of the first embodiment of the present invention are the same as those of the first embodiment of the present invention unless otherwise specified.
  • FIG. 12 is a block diagram showing a configuration of the search device 100 according to the third embodiment of the present invention.
  • the search device 100 includes an element change count update unit 130 and an attention rank update unit 140 in addition to the components of the search device 100 according to the first embodiment. , And an element change number storage unit 260.
  • the element change number storage unit 260 stores element change number information 360.
  • FIG. 14 is a diagram illustrating an example of the element change number information 360 according to the third embodiment of this invention.
  • the element change number information 360 includes “change number” indicating the number of times the elements of the rank are not matched between consecutive search conditions for each rank.
  • the element change number update unit 130 updates the element change number information 360 based on the input search condition 330 and the previous search condition.
  • the attention rank update unit 140 updates the attention rank information 320 based on the element change number information 360.
  • the search processing in the third embodiment of the present invention is the same as that in the first embodiment (FIGS. 3 and 4) of the present invention.
  • FIG. 13 is a flowchart showing attention rank update processing according to the third embodiment of the present invention.
  • the attention rank update process is executed following the search process (steps S101 to S109).
  • the element change count updating unit 130 of the search device 100 compares the search condition 330 input in step S101 with a previous search condition stored in a storage unit (not shown), and the search condition 330 and the previous search condition are compared. The order in which the elements do not match is detected (step S321).
  • the element change count updating unit 130 may acquire the previous search condition 340 before being updated in step S208 and compare it with the input search condition 330.
  • the element change number update unit 130 detects the ranks “2” and “3”.
  • the element change number update unit 130 updates the change number for the rank detected in step S321 in the element change number information 360 (step S322).
  • the element change number update unit 130 adds 1 to the change numbers for the ranks “2” and “3” in the element change number information 360 in FIG. 14 and updates them to “91” and “11”, respectively.
  • the attention rank update unit 140 updates the attention rank of the attention rank information 320 based on the element change number information 360 (step S323).
  • the attention rank update unit 140 sets, in the element change number information 360, a rank in which the number of changes is larger than other ranks as the attention rank of the attention rank information 320.
  • the attention rank update unit 140 sets the rank “2” having the largest number of changes as the attention rank.
  • the attention rank update unit 140 deletes (initializes) the set value of the previous search condition 340 (step S325). Further, the attention rank update unit 140 deletes (initializes) the set value of the previous searched route information 350 (step S326). Thereby, after the attention order is changed, the search from the root node is performed.
  • search process (steps S101 to S109) is executed from the next search in the updated attention order.
  • the attention rank information 320 is updated (steps S323 to S326) every time search processing is performed.
  • the attention rank information 320 is updated by a predetermined number of searches, etc. It may be executed when a predetermined condition regarding the number of searches is satisfied or in response to an instruction from the user or the like.
  • initialization of the change number in the element change number information 360 may be executed when a predetermined condition regarding the number of searches is satisfied or in response to an instruction from the user or the like.
  • the attention rank update in the third embodiment of the present invention may be applied to the second embodiment of the present invention.
  • a predetermined number of ranks having a larger number of changes than other ranks may be set as the attention rank.
  • the element change number updating unit 130 compares the elements of each rank between the input search condition 330 and the previous search condition
  • the attention rank update unit 140 compares the elements in the other ranks. This is because the rank with the highest number of mismatches is set as the attention rank.
  • the search processing is performed using the search tree 301 related to the search target obtained by rearranging (reordering) the element string of the original search target in the rearrangement order. Different from the first embodiment of the present invention.
  • FIG. 15 is a block diagram showing a configuration of the search device 100 according to the fourth embodiment of the present invention.
  • the search device 100 includes an element change number update unit 130 and a search tree update unit 150 in addition to the components of the search device 100 according to the first embodiment.
  • the element change count updating unit 130 and the element change count storage unit 260 are the same as those in the third embodiment of the present invention.
  • the rearrangement order storage unit 270 stores the rearrangement order information 370.
  • FIG. 18 is a diagram illustrating an example of the rearrangement order information 370 according to the fourth embodiment of this invention.
  • the rearrangement rank information 370 includes “realignment rank” indicating the rank after the rearrangement corresponding to the rank for each rank.
  • the search tree storage unit 210 stores search tree information 311 of the search tree 301 related to the search target (reordered search target) rearranged in the rearrangement order.
  • FIG. 20 is a diagram illustrating an example of the search tree 301 in the fourth embodiment of the present invention.
  • a search tree 301 in FIG. 20 is an example when the search target in the search tree 300 in FIG. 5 is rearranged according to the rearrangement order of the rearrangement order information 370 in FIG.
  • FIG. 21 is a diagram illustrating an example of the search tree information 311 in the fourth embodiment of the present invention.
  • the search tree information 311 in FIG. 21 corresponds to the search tree 301 in FIG.
  • the rearrangement order of the rearrangement order information 370 is the same as the original order, and the search tree information 311 is set with search tree information related to search targets that are not rearranged. Assume that
  • the search tree update unit 150 updates the rearrangement order information 370 and the search tree information 311 based on the element change number information 360.
  • the search condition rearrangement unit 160 rearranges the input element string of the search condition 330 in the rearrangement order and converts it into the search condition 331.
  • the search start node determination unit 110 compares the element sequences of the search condition 331 and the previous search condition 340, and determines the search start node that is the starting point of the search on the search tree 301 based on the previous search path information 350. To do.
  • the search unit 120 performs a search from the search start node on the search tree 301 and acquires a search result 381 for the search condition 331. In addition, the search unit 120 updates the previous search condition 340 and the previous search route information 350.
  • the attention rank of the attention rank information 320 is set using the rearrangement rank.
  • the rearranged search condition 331 is set.
  • the search result reordering unit 170 rearranges the element string of the search result 381 on the search tree 301 in the original order, and converts it into the search result 380.
  • FIG. 16 is a flowchart showing search processing in the fourth embodiment of the present invention.
  • the search tree update unit 150 has set the search tree information 311 in FIG. 21 and the rearrangement order information 370 in FIG.
  • the search device 100 receives an input of the search condition 330 from the user (step S401).
  • the search condition reordering unit 160 of the search device 100 rearranges the element string of the search condition 330 in the reordering order and converts it into the search condition 331 (step S402).
  • the search condition reordering unit 160 rearranges the search condition 330 “abb” in the realignment rank in the realignment rank information 370 of FIG.
  • the search condition 331 is converted into “bab”.
  • the search start node determination unit 110 and the search unit 120 determine a search start node, and search from the search start node on the search tree 301 in the same manner as steps S102 to S108 in the first embodiment of the present invention. I do.
  • the search unit 120 acquires a search result 381 for the search condition 331 (step S403).
  • the search unit 120 performs a search using the search tree information 311 in FIG. 21, and sets the search target “bab” for the search condition 331 “bab” in the search result 381.
  • the search result reordering unit 170 rearranges the element string of the search result 381 in the original order and converts it into the search result 381. (Step S404).
  • the search result reordering unit 170 acquires a search result 380 “abb” obtained by reordering the search result 381 “bab” in the original order.
  • the search device 100 outputs the search result 380 (step S405).
  • FIG. 17 is a flowchart showing search tree update processing according to the fourth embodiment of the present invention.
  • the search tree update process is executed following the search process (steps S401 to S405).
  • the element change count update unit 130 of the search device 100 compares the search condition 330 input in step S401 with the previous search condition, and determines that the elements do not match. Is detected (step S421). Then, the element change number update unit 130 updates the change number with respect to the rank detected in step S421 in the element change number information 360 (step S422).
  • the search tree update unit 150 updates the rearrangement order of the rearrangement order information 370 based on the element change number information 360 (step S423).
  • the search tree update unit 150 assigns an order of increasing numbers of changes to each rank in the element change number information 360, and the order assigned to each rank is the reorder rank for the rank in the reorder rank information 370. Set to.
  • the search tree update unit 150 sets the rearrangement order information 370 in FIG. 18 for the element change number information 360 in FIG.
  • step S423 When the rearrangement order is changed in step S423 (step S424 / Yes), the search tree update unit 150 updates the search tree information 311 based on the rearrangement order (step S425).
  • the search tree update unit 150 arranges the element strings of the original search target stored in a storage unit (not shown) in the rearrangement order, and acquires the rearrangement search target. Then, the search tree update unit 150 sets the search tree information 311 for the realignment search target.
  • FIG. 19 is a diagram showing an example of reordering of search targets in the fourth embodiment of the present invention.
  • the search tree update unit 150 acquires the reordering search object from the original search object as shown in FIG. 19 according to the reordering rank information 370 of FIG. Further, the search tree update unit 150 generates search tree information 311 in FIG. 21 for the realignment search target in FIG. 19.
  • the search tree update unit 150 deletes (initializes) the set value of the previous search condition 340 (step S426). In addition, the search tree update unit 150 deletes (initializes) the set value of the previous search route information 350 (step S427). Thereby, after the search tree 301 is changed with the change of the rearrangement order, the search from the root node is performed.
  • search process (steps S401 to S405) is executed from the next search using the updated search tree 301.
  • the processing after the reordering order information 370 is updated (steps S423 to S427) is executed for each search process. It may be executed when a predetermined condition regarding the number of searches such as the number of searches is satisfied or in response to an instruction from the user or the like.
  • initialization of the change number in the element change number information 360 may be executed when a predetermined condition regarding the number of searches is satisfied or in response to an instruction from the user or the like.
  • the update of the search tree 301 in the fourth embodiment of the present invention may be applied to the second embodiment of the present invention.
  • the search can be further speeded up as compared with the first embodiment.
  • the reason is that the search tree update unit 150 compares the elements of each rank between the input search condition 330 and the previous search condition, and reorders indicating the order of the number of times the elements do not match each rank. This is because the ranking is given, the respective rankings of the element strings to be searched are rearranged according to the rearrangement ranking, and a search tree is generated for the rearranged search target.
  • the search range can be further limited by setting the attention rank higher (backward), so that the search is further speeded up.
  • the element string to be searched may include a wild card element indicating an arbitrary element
  • the child node link information in the node on the search tree 300 may include a wild card element.
  • a search is performed using a plurality of routes.
  • the previous searched route information 350 a node corresponding to the attention rank in each of the plurality of routes is set.
  • the search is performed using each node of the previous search route information 350 as the search start node.
  • Search apparatus 110 Search start node determination part 120 Search part 130 Element change number update part 140 Attention rank update part 150 Search tree update part 160 Search condition realignment part 170 Search result realignment part 210 Search tree memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

 前回の検索条件と前方一致する検索条件に対して、探索木上の探索範囲を限定して検索を行う場合に、検索をより高速に行う。 探索木記憶部210は、要素列である複数の検索対象を表す探索木を記憶する。前回検索条件記憶部240は、前回検索要素列を記憶する。前回探索経路記憶部250は、探索木において前回検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶する。探索開始ノード判定部110は、入力された検索要素列と前回検索要素列とで、注目順位より前の要素列を一括して比較し、一致する場合、前回探索経路情報で示されるノードを探索開始ノードと決定する。検索部120は、探索木上の探索開始ノードから、入力された検索要素列の注目順位以降の要素について探索を行う。

Description

検索装置、検索方法、及び、検索プログラム
 本発明は、検索装置、検索方法、及び、検索プログラムに関し、特に、木構造の探索により検索を行う検索装置、検索方法、及び、検索プログラムに関する。
 検索対象である複数の要素列から、検索条件の要素列を、木構造を用いて検索する検索装置が知られている。ここで、要素列は、所定の順序で整列された複数の要素により構成される。要素は、例えば、文字データ等の小単位のデータである。
 このような検索装置として、トライ木構造を利用した検索装置がある。図22は、トライ木構造の例を示す図である。
 トライ木構造では、要素列の各順位(先頭からの順序、または、位置)が、木構造の階層に対応付けられる。また、トライ木構造は、階層毎に、当該階層に対応する順位の各要素について一致判定を行うためのノードを持つ。各ノードは、検索条件と比較を行う要素、及び、当該要素と一致した場合に、次に辿る子ノードへのリンクを持つ。さらに、トライ木構造は、検索対象を格納する葉ノードを持つ。
 図22の木構造は、検索対象の要素列が、4つのアルファベット文字列「aa」、「ab」、「ba」、「bb」の場合の例である。ここで、1番目の階層には、順位「1」の要素について一致判定を行うためのノード識別子N1のノード、2番目の階層には、順位「2」の要素について一致判定を行うためのノード識別子N21、N22のノードが配置されている。また、ノード識別子N1のノードは、文字「a」に対してノード識別子N21のノードへのリンク、文字「b」に対してノード識別子N22のノードへのリンクを持つ。さらに、葉ノードとして、検索対象である4つのアルファベット文字列を格納する、ノード識別子N31、N32、N33、N34のノードが配置される。
 トライ木構造を利用した検索装置では、検索結果を得るために、以下のような木構造の探索が行われる。まず、根ノードの要素に、検索条件の順位「1」(先頭)の要素と一致する要素があるかどうかが判定(一致判定)され、一致する要素が存在すれば、当該要素に対するリンクで示された子ノードへの移動が行われる。次に、子ノードにおいて、同様に、ノードの要素に、検索条件の次の順位の要素と一致する要素があるかどうかが判定され、一致する要素が存在すれば、当該要素に対するリンクで示された子ノードへの移動が行われる。このように、一致判定の結果に従って、次のノードに移動することを、ノードを辿ると定義する。一致する要素が無い場合、木構造の探索は終了する。以上の動作が、葉ノードに辿り着くまで繰り返され、葉ノードに格納されている検索対象が、検索結果として出力される。
 例えば、図22において、検索条件として文字列「aa」が入力された場合、ノード識別子N1のノードにおいて、順位「1」の文字の一致判定が行われ、文字「a」との一致判定結果が得られる。次に、文字「a」に対応するリンクにより示されるノード識別子N21のノードにおいて、順位「2」の文字の一致判定が行われ、文字「a」との一致判定結果が得られる。文字「a」に対応するリンクにより示されるノード識別子N31のノードは葉ノードであるため、文字列「aa」が、検索結果として出力される。
 トライ木構造を利用した検索装置では、検索を連続して行う場合に、連続する検索条件の要素列の先頭からある順位までの要素が一致(前方一致)する場合でも、検索を行うたびに、トライ木構造の根ノードからの探索を行う必要があるという問題があった。
 このような連続した検索を高速化する技術の一例が、例えば、特許文献1に記載されている。特許文献1の検索装置は、前回の検索条件の要素列と、前回の検索における木構造の探索で辿ったノードを記憶する。新たに検索条件が入力されると、検索装置は、前回の検索条件の要素列と入力された検索条件の要素列を、先頭の順位から比較し、一致か不一致かを判定する。そして、検索装置は、前回の検索において辿ったノードの内、不一致と判定された順位の1つ上位の順位に対応するノード(探索開始ノード)から、入力された検索条件に対する探索を開始する。これにより、木構造における探索開始ノードまでの探索が省略され、探索範囲が当該探索開始ノード以下のノードに限定されるため、検索が高速化される。
特開平11-184857号公報
 上述の特許文献1に記載された技術では、探索開始ノードを決定するために、要素列の先頭から順番に要素の比較を繰り返す必要があり、検索に時間がかかるという問題がある。
 本発明の目的は、上述の課題を解決し、前回の検索条件と前方一致する検索条件の検索を探索木上の探索範囲を限定して行う場合に、検索をより高速化できる、検索装置、検索方法、及び、検索プログラムを提供することである。
 本発明の一態様における検索装置は、要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶する探索木記憶手段と、前回の検索要素列を記憶する前回検索条件記憶手段と、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶する前回探索経路情報記憶手段と、入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定する探索開始ノード判定手段と、前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する検索手段と、を含む。
 本発明の一態様における検索方法は、要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶し、前回の検索要素列を記憶し、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶し、入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定し、前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する。
 本発明の一態様におけるコンピュータが読み取り可能な記録媒体は、コンピュータに、要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶し、前回の検索要素列を記憶し、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶し、入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定し、前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する、処理を実行させる検索プログラムを格納する。
 本発明の効果は、前回の検索条件と前方一致する検索条件の検索を探索木上の探索範囲を限定して行う場合に、検索をより高速化できることである。
本発明の第1の実施の形態の特徴的な構成を示すブロック図である。 本発明の第1の実施の形態における、検索装置100の構成を示すブロック図である。 本発明の第1の実施の形態における、検索処理を示すフローチャートである。 本発明の第1の実施の形態における、探索処理の詳細を示すフローチャートである。 本発明の第1の実施の形態における、探索木300の例を示す図である。 本発明の第1の実施の形態における、探索木情報310の例を示す図である。 本発明の第1の実施の形態における、注目順位情報320の例を示す図である。 本発明の第1の実施の形態における、検索毎の前回検索条件340、及び、前回探索経路情報350の例を示す図である。 本発明の第2の実施の形態における、検索装置100の処理を示すフローチャートである。 本発明の第2の実施の形態における、注目順位情報321の例を示す図である。 本発明の第2の実施の形態における、検索毎の前回検索条件340、及び、前回探索経路情報351の例を示す図である。 本発明の第3の実施の形態における、検索装置100の構成を示すブロック図である。 本発明の第3の実施の形態における、注目順位更新処理を示すフローチャートである。 本発明の第3の実施の形態における、要素変化数情報360の例を示す図である。 本発明の第4の実施の形態における、検索装置100の構成を示すブロック図である。 本発明の第4の実施の形態における、検索処理を示すフローチャートである。 本発明の第4の実施の形態における、探索木更新処理を示すフローチャートである。 本発明の第4の実施の形態における、再整列順位情報370の例を示す図である。 本発明の第4の実施の形態における、検索対象の再整列の例を示す図である。 本発明の第4の実施の形態における、探索木301の例を示す図である。 本発明の第4の実施の形態における、探索木情報311の例を示す図である。 トライ木構造の例を示す図である。
 (第1の実施の形態)
 次に、本発明の第1の実施の形態について説明する。
 はじめに、本発明の第1の実施の形態の構成について説明する。図2は、本発明の第1の実施の形態における、検索装置100の構成を示すブロック図である。
 図2を参照すると、本発明の第1の実施の形態の検索装置100は、探索開始ノード判定部110、検索部120、探索木記憶部210、注目順位記憶部220、前回検索条件記憶部240、及び、前回探索経路記憶部250を含む。
 ここで、探索木記憶部210は、探索木300の木構造を示す探索木情報310を記憶する。
 図5は、本発明の第1の実施の形態における、探索木300の例を示す図である。図5の探索木300は、検索対象が、アルファベット文字を要素とする、要素列長が3の6つの要素列「aaa」、「aab」、「aba」、「abb」、「baa」、及び、「bab」である場合の例である。ここで、要素列における各要素の先頭からの順序(位置)を順位と定義する。探索木300は、1番目の階層に、順位「1」の要素について一致判定を行うためのノード識別子N1のノード、2番目の階層に、順位「2」の要素について一致判定を行うためのノード識別子N21、N22のノード、及び、3番目の階層に、順位「3」の要素について一致判定を行うためのノード識別子N31、N32、N33を持つ。また、探索木300は、葉ノードとして、検索対象を格納する、ノード識別子N41、N42、N43、N44、N45、N46のノードを持つ。
 図6は、本発明の第1の実施の形態における、探索木情報310の例を示す図である。図6の探索木情報310は、図5の探索木300に対応する。
 探索木情報310は、「ノードID」、「順位」、「子ノードリンク情報」、及び、「検索対象」を含む。ここで、「ノードID」はノードの識別子を示す。「順位」は、当該ノードの探索木300上の階層に対応し、当該ノードで一致判定を行う要素の順位を示す。なお、順位「1」は、探索木300上の根ノードの階層に対応する。「子ノードリンク情報」は、「要素」及び「子ノードID」を含む。「要素」は、一致判定を行う要素の値を示す。「子ノードID」は、検索条件の要素列の「順位」で示される順位の要素の値と「要素」で示される値とが一致した場合の移動先である、子ノードの識別子を示す。なお、葉ノードは子ノードを持たないため、葉ノードには、「子ノードリンク情報」は設定されない。「検索対象」は、検索対象の要素列を示す。なお、葉ノード以外のノードには、「検索対象」は設定されない。探索木情報310は、予め、ユーザ等により、検索対象の要素列に基づいて生成され、探索木記憶部210に設定される。
 注目順位記憶部220は、注目順位情報320を記憶する。図7は、本発明の第1の実施の形態における、注目順位情報320の例を示す図である。注目順位情報320は、注目順位を示す。探索開始ノードを決定する場合、入力された検索条件の要素列と前回検索条件340の要素列との間で、注目順位より前の要素列が比較される。注目順位情報320は、予め、ユーザ等によりに設定される。
 前回検索条件記憶部240は、前回検索条件340を記憶する。前回探索経路記憶部250は、前回探索経路情報350を記憶する。図8は、本発明の第1の実施の形態における、検索毎の前回検索条件340、及び、前回探索経路情報350の例を示す図である。前回検索条件340は、前回の検索における検索条件の要素列を示す。また、前回探索経路情報350は、探索木300において、前回検索条件340を探索する時に辿るノードの内、注目順位に対応するノードのノード識別子を示す。
 探索開始ノード判定部110は、入力された検索条件330と前回検索条件340との要素列を比較し、探索木300上での探索の始点である探索開始ノードを、前回探索経路情報350をもとに決定する。
 検索部120は、探索木300上で、探索開始ノードから探索を行い、入力された検索条件330に対する検索結果380を取得する。また、検索部120は、前回検索条件340と前回探索経路情報350とを更新する。
 なお、検索装置100はCPU(Central Processing Unit)とプログラムを記憶した記憶媒体を含み、プログラムに基づく制御によって動作するコンピュータであってもよい。また、探索木記憶部210、注目順位記憶部220、前回検索条件記憶部240、及び、前回探索経路記憶部250は、それぞれ個別の記憶媒体でも、1つの記憶媒体によって構成されてもよい。
 次に、本発明の第1の実施の形態における検索装置100の動作について説明する。
 図3は、本発明の第1の実施の形態における、検索処理を示すフローチャートである。
 はじめに、検索装置100は、ユーザから、検索条件330の入力を受け付ける(ステップS101)。
 次に、検索装置100の探索開始ノード判定部110は、検索条件330と前回検索条件340との間で、注目順位情報320の注目順位より前の順位の各要素を比較し、注目順位より前の全順位の要素(注目順位より前の要素列)が一致するかどうかを判定する(ステップS102)。
 ここで、探索開始ノード判定部110は、注目順位より前の要素列を、一括して比較し、上記判定を行う。この場合、例えば、探索開始ノード判定部110は、検索条件330と前回検索条件340との、注目順位より前の要素列を、所定のハッシュ関数によりハッシュ値に変換し、これらハッシュ値同士が一致するかどうかを判定する。なお、探索開始ノード判定部110は、注目順位より前の要素列を一括して比較し、上記判定ができれば、他の方法を用いて判定してもよい。
 ステップS102において、一致すると判定された場合(ステップS102/Yes)、探索開始ノード判定部110は、注目順位を探索開始順位に設定する(ステップS103)。
 次に、探索開始ノード判定部110は、前回探索経路情報350を基に、探索開始ノードを決定する。ここで、探索開始ノード判定部110は、前回探索経路情報350で示されるノード識別子を探索開始ノードに設定する(ステップS104)。なお、ステップS104において、前回探索経路情報350にノード識別子が設定されていない場合は、ステップS119で後述するように、前回検索条件340の検索において、注目順位より小さい(前の)順位までの探索で、検索結果380が「なし」であったことに相当するため、検索条件330に対しても、検索結果380に「なし」を設定し検索を終了する。
 一方、ステップS102において、一致しないと判定された場合(ステップS102/No)、探索開始ノード判定部110は、順位「1」を探索開始順位に設定し(ステップS105)、根ノードの識別子を探索開始ノードに設定する(ステップS106)。なお、初期状態では、前回検索条件340、及び、前回探索経路情報350が設定されていないため、探索開始ノード判定部110は、根ノードの識別子を探索開始ノードに設定する。
 次に、検索部120は、探索木情報310を参照し、探索木300上の探索開始ノードから、検索条件330の要素列の探索を行う(ステップS107)。
 図4は、本発明の第1の実施の形態における、探索処理(ステップS107)の詳細を示すフローチャートである。
 はじめに、検索部120は、探索ノードに探索開始ノードを設定する(ステップS111)。
 次に、検索部120は、探索木情報310を参照し、探索ノードが葉ノードであるかどうかを判定する(ステップS112)。
 ステップS112において、探索ノードが葉ノードであれば(ステップS112/Yes)、検索部120は、探索木情報310における、探索ノードに対する検索対象を検索結果380に設定し(ステップS118)、処理を終了する。
 一方、ステップS112において、探索ノードが葉ノードでなければ(ステップS112/No)、検索部120は、探索木情報310における、探索ノードに対する順位を、比較順位に設定する。そして、検索部120は、比較順位が注目順位と一致するかどうかを判定する(ステップS113)。
 ステップS113において、比較順位が注目順位と一致する場合(ステップS113/Yes)、検索部120は、前回探索経路情報350のノード識別子を、探索ノードのノード識別子で更新する(ステップS114)。
 次に、検索部120は、探索木情報310における、探索ノードに対する要素の内、検索条件330の要素列における比較順位の要素と一致する要素が存在するかどうかを判定する(ステップS115)。
 ステップS115において、一致する要素が存在する場合(ステップS115/Yes)、検索部120は、探索木情報310における、当該要素に対する子ノード識別子を探索ノードに設定する(ステップS116)。そして、検索部120は、ステップS112からS119までの処理を、検索結果380が得られるまで、再帰的に繰り返す(ステップS117)。
 また、ステップS115において、一致する要素が存在しない場合(ステップS115/No)、検索部120は、検索結果380に「なし」を設定し(ステップS119)、処理を終了する。なお、ステップS119において、比較順位が注目順位より小さい場合(ステップS114における前回探索経路情報350の更新が行われていない場合)、検索部120は、前回探索経路情報350の設定値を削除(初期化)する。
 次に、検索部120は、検索条件330で、前回検索条件340を更新する(ステップS108)。
 最後に、検索装置100は、検索結果380を出力する(ステップS109)。
 次に、初期状態からの連続する検索について、具体例を説明する。
 ここで、図6の探索木情報310が設定されていると仮定する。また、注目順位情報320には、図7に示すように、注目順位「3」が設定されていると仮定する。さらに、初期状態では、図8の状態(a)に示すように、前回検索条件340、及び、前回探索経路情報350が設定されていないと仮定する。
 1回目の検索の検索条件330として、要素列「aaa」が入力された場合、探索開始ノード判定部110は、根ノードのノード識別子「N1」を探索開始ノードに設定する。
 検索部120は、探索開始ノードの識別子「N1」を探索ノード、順位「1」を比較順位に設定する。検索部120は、検索条件330の比較順位「1」の要素「a」と探索ノード「N1」の要素「a」が一致するため、当該要素に対する子ノード「N21」を探索ノードに設定する。
 検索部120は、順位「2」を比較順位に設定する。検索部120は、検索条件330の比較順位「2」の要素「a」と探索ノード「N21」の要素と「a」が一致するため、当該要素に対する子ノード「N31」を探索ノードに設定する。
 検索部120は、順位「3」を比較順位に設定する。比較順位「3」は注目順位と一致するため、検索部120は、前回探索経路情報350のノード識別子に、図8の状態(b)に示すように、探索ノードのノード識別子「N31」を設定する。検索部120は、検索条件330の比較順位「3」の要素「a」と探索ノード「N31」の要素「a」とが一致するため、当該要素に対する子ノード「N41」を探索ノードに設定する。
 探索ノード「N41」は葉ノードであるため、検索部120は、探索ノード「N41」の検索対象「aaa」を検索結果380に設定する。そして、検索部120は、図8の状態(b)に示すように、前回検索条件340に検索条件330「aaa」を設定する。
 次に、2回目の検索の検索条件330として、要素列「aab」が入力された場合、探索開始ノード判定部110は、検索条件330と図8の状態(b)の前回検索条件340との間で、注目順位「3」より前の要素列を一括して比較する。ここで、注目順位「3」より前の要素列「aa」が一致するため、探索開始ノード判定部110は、図8の状態(b)の前回探索経路情報350におけるノード識別子「N31」を探索開始ノードに設定する。
 検索部120は、探索開始ノードから、探索ノード「N31」、「N41」の順に、探索を行い、検索対象「aab」を検索結果380に設定する。ここで、検索部120は、図8の状態(c)に示すように、前回検索条件340に検索条件330「aab」を設定し、前回探索経路情報350に、探索ノードのノード識別子「N31」を設定する。
 以上により、本発明の第1の実施の形態の動作が完了する。
 次に、本発明の第1の実施の形態の特徴的な構成を説明する。図1は、本発明の第1の実施の形態の特徴的な構成を示すブロック図である。
 検索装置100は、探索開始ノード判定部110、検索部120、探索木記憶部210、前回検索条件記憶部240、及び、前回探索経路記憶部250を含む。
 ここで、探索木記憶部210は、要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木300を記憶する。
 前回検索条件記憶部240は、前回の検索要素列である前回検索条件340を記憶する。
 前回探索経路記憶部250は、探索木300において前回検索条件340の要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報350を記憶する。
 探索開始ノード判定部110は、入力された検索条件330の要素列と前回検索条件340の要素列とで、注目順位より前の要素列を一括して比較し、一致する場合、前回探索経路情報350で示されるノードを探索開始ノードと決定する。
 検索部120は、探索木300上の探索開始ノードから、入力された検索条件330の注目順位以降の要素について探索を行うことにより、複数の検索対象から入力された検索条件330の要素列を検索する。
 本発明の第1の実施の形態によれば、前回の検索条件と前方一致する検索条件の検索を探索木上の探索範囲を限定して行う場合に、検索をより高速化できる。その理由は、探索開始ノード判定部110が、入力された検索条件330の要素列と前回検索条件340の要素列とで、注目順位より前の要素列を一括して比較し、一致する場合、前回探索経路情報350で示されるノードを探索開始ノードと決定するためである。これにより、連続する検索条件の要素列間で、特定の順位までの要素列が前方一致することが多い場合、当該順位を注目順位に設定することにより、探索開始ノードの決定が効率化され、検索がより高速化される。
 また、本発明の第1の実施の形態によれば、探索経路に関して記憶が必要な情報量を削減できる。その理由は、上述のように、探索開始ノード判定部110が、前回検索条件340の要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを探索開始ノードと決定するためである。これにより、前回検索条件340の要素列を探索する場合に辿る全ノードではなく、少なくとも、探索開始ノードの決定に必要な注目順位に対応する階層のノードの情報を前回探索経路情報350に記憶することで、探索開始ノードを決定できる。
 (第2の実施の形態)
 次に、本発明の第2の実施の形態について説明する。
 本発明の第2の実施においては、前回探索経路情報351に含まれる複数の注目順位のノードから、探索開始ノードを決定する点において、本発明の第1の実施の形態と異なる。なお、本発明の第2の実施において、本発明の第1の実施の形態と同一の符号を有する構成要素は、特に説明のない限り、本発明の第1の実施の形態と同様とする。
 本発明の第2の実施において、注目順位記憶部220は、注目順位情報321を記憶する。図10は、本発明の第2の実施の形態における、注目順位情報321の例を示す図である。注目順位情報321は、複数の注目順位を含む。
 前回探索経路記憶部250は、前回探索経路情報351を記憶する。図11は、本発明の第2の実施の形態における、検索毎の前回検索条件340、及び、前回探索経路情報351の例を示す図である。前回探索経路情報351は、前回検索条件340の検索で辿った探索木300上のノードの内、複数の注目順位の各々に対応するノードのノード識別子を示す。
 次に、本発明の第2の実施の形態における検索装置100の動作について説明する。
 図9は、本発明の第2の実施の形態における、検索装置100の処理を示すフローチャートである。
 はじめに、検索装置100の探索開始ノード判定部110は、ユーザから、検索条件330の入力を受け付ける(ステップS201)。
 次に、検索装置100の探索開始ノード判定部110は、注目順位情報321に含まれる複数の注目順位の内の大きい(後方の)順位より順番に、検索条件330と前回検索条件340との、当該注目順位より前の順位の各要素を比較し、当該注目順位より前の要素列が一致するかどうかを判定する(ステップS202)。ここで、探索開始ノード判定部110は、複数の注目順位の各々について、当該注目順位より前の要素列を、一括して比較し、上記判定を行う。
 なお、探索開始ノード判定部110は、注目順位情報321に含まれる複数の注目順位の内の小さい(前方の)順位より順番に上記判定を行う等、他の順番で上記判定を行ってもよい。
 ステップS202において、いずれかの注目順位について、一致すると判定された場合(ステップS202/Yes)、探索開始ノード判定部110は、当該注目順位を探索開始順位に設定する(ステップS203)。
 次に、探索開始ノード判定部110は、前回探索経路情報351を基に、探索開始ノードを決定する。ここで、探索開始ノード判定部110は、前回探索経路情報351における、探索開始順位に対応するノード識別子を探索開始ノードに設定する(ステップS204)。なお、ステップS204において、探索開始順位に対応するノード識別子が設定されていない場合は、ステップS119で後述するように、前回検索条件340の検索において、探索開始順位より小さい(前の)順位までの探索で、検索結果380が「なし」であったことに相当するため、検索条件330に対しても、検索結果380に「なし」を設定し検索を終了する。
 一方、ステップS202において、全ての注目順位について、一致しないと判定された場合(ステップS202/No)、探索開始ノード判定部110は、順位「1」を探索開始順位に設定する(ステップS205)。そして、探索開始ノード判定部110は、根ノードを探索開始ノードと決定する(ステップS206)。
 次に、検索部120は、探索木情報310を参照し、探索木300上の探索開始ノードから、検索条件330の要素列の探索を行う(ステップS207)。
 本発明の第2の実施の形態における探索処理は、前回探索経路情報351の更新(ステップS113、S114、及び、S119)を除いて、本発明の第1の実施の形態(図4)と同様となる。
 本発明の第2の実施の形態の探索処理においては、ステップS113において、検索部120は、比較順位が注目順位情報321に含まれる複数の注目順位のいずれかと一致するかどうかを判定する。比較順位が複数の注目順位のいずれかと一致する場合、ステップS114において、検索部120は、前回探索経路情報351における比較順位に対応するノード識別子を、探索ノードのノード識別子で更新する。
 また、ステップS119において、検索部120は、前回探索経路情報350の注目順位の内、比較順位より大きい(ステップS114における更新が行われていない)注目順位に対する設定値を削除(初期化)する。
 次に、検索部120は、検索条件330で、前回検索条件340を更新する(ステップS208)。
 最後に、検索部120は、検索結果380を出力する(ステップS209)。
 次に、初期状態からの連続する検索について、具体例を説明する。
 ここでは、図6の探索木情報310が設定されていると仮定する。また、注目順位情報321には、図10に示すように、注目順位「2」「3」が設定されていると仮定する。さらに、初期状態では、図11の状態(a)に示すように、前回検索条件340、及び、前回探索経路情報351が設定されていないと仮定する。
 1回目の検索の検索条件330として、要素列「aaa」が入力された場合、探索開始ノード判定部110は、根ノードのノード識別子「N1」を探索開始ノードに設定する。検索部120は、探索ノード「N1」、「N21」、「N31」、「N41」の順に、探索を行い、検索対象「aaa」を検索結果380に設定する。ここで、検索部120は、図10の状態(b)に示すように、検索条件330「aaa」を前回検索条件340に設定し、前回探索経路情報351の順位「2」「3」に対して、ノード識別子「N21」「N31」を設定する。
 次に、2回目の検索の検索条件330として、要素列「abb」が入力された場合、探索開始ノード判定部110は、検索条件330と図11の状態(b)の前回検索条件340との間で、注目順位「3」より前、及び、注目順位「2」より前の要素列を、それぞれ一括して比較する。ここで、注目順位「2」より前の要素列「a」が一致するため、探索開始ノード判定部110は、図11の状態(b)の前回探索経路情報351における、順位「2」に対するノード識別子「N21」を探索開始ノードに設定する。
 検索部120は、探索開始ノードから、探索ノード「N21」、「N32」、「N44」の順に、探索を行い、検索対象「abb」を検索結果380に設定する。そして、検索部120は、図11の状態(c)に示すように、検索条件330「abb」を前回検索条件340に設定し、前回探索経路情報351の順位「2」「3」に対して、ノード識別子「N21」「N32」を設定する。
 次に、3回目の検索の検索条件330として、要素列「aba」が入力された場合、探索開始ノード判定部110は、検索条件330と図11の状態(c)の前回検索条件340との間で、注目順位「3」より前、及び、注目順位「2」より前の要素列を、それぞれ一括して比較する。ここで、注目順位「3」より前の要素列「ab」が一致するため、探索開始ノード判定部110は、図11の状態(c)の前回探索経路情報351における、順位「3」に対するノード識別子「N32」を探索開始ノードに設定する。
 検索部120は、探索開始ノードから、探索ノード「N32」、「N43」の順に、探索を行い、検索対象「aba」を検索結果380に設定する。そして、検索部120は、図11の状態(d)に示すように、検索条件330「aba」を前回検索条件340に設定し、前回探索経路情報351の順位「3」に対して、ノード識別子「N32」を設定する。
 以上により、本発明の第2の実施の形態の動作が完了する。
 本発明の第2の実施の形態によれば、連続する検索条件の要素列間で、特定の複数の順位までの要素列が前方一致することが多い場合、第1の実施の形態に比べて、検索をさらに高速化できる。その理由は、探索開始ノード判定部110が、入力された検索条件330の要素列と前回検索条件340の要素列とで、複数の注目順位の各々より前の要素列を一括して比較し、複数の注目順位のいずれかより前の要素列が一致する場合、前回探索経路情報350で示される当該注目順位に対応するノードを探索開始ノードと決定するためである。これにより、前方一致する順位が小さい(前方の)場合、すなわち、探索範囲の限定の効果が小さいがその機会が多い場合と、前方一致する順位が大きい(後方の)場合、すなわち、探索範囲の限定の効果が大きいがその機会が少ない場合とが、混在する場合でも、どちらの場合についても探索開始ノードの決定が効率化され、検索がさらに高速化される。
 (第3の実施の形態)
 次に、本発明の第3の実施の形態について説明する。
 本発明の第3の実施においては、連続する検索条件の間で、各順位における要素が不一致となった回数に応じて、注目順位を更新する点において、本発明の第1の実施の形態と異なる。なお、本発明の第3の実施において、本発明の第1の実施の形態と同一の符号を有する構成要素は、特に説明のない限り、本発明の第1の実施の形態と同様とする。
 はじめに、本発明の第3の実施の形態の構成について説明する。図12は、本発明の第3の実施の形態における、検索装置100の構成を示すブロック図である。
 図12を参照すると、本発明の第3の実施の形態の検索装置100は、第1の実施の形態の検索装置100の構成要素に加えて、要素変化数更新部130、注目順位更新部140、及び、要素変化数記憶部260を含む。
 ここで、要素変化数記憶部260は、要素変化数情報360を記憶する。図14は、本発明の第3の実施の形態における、要素変化数情報360の例を示す図である。要素変化数情報360は、順位毎に、連続する検索条件間で、当該順位の要素が不一致となった回数を示す「変化数」を含む。
 要素変化数更新部130は、入力された検索条件330と前回の検索条件とをもとに、要素変化数情報360を更新する。
 注目順位更新部140は、要素変化数情報360をもとに、注目順位情報320を更新する。
 次に、本発明の第3の実施の形態における検索装置100の動作について説明する。
 本発明の第3の実施の形態における検索処理は、本発明の第1の実施の形態(図3、図4)と同様となる。
 次に、本発明の第3の実施の形態における、注目順位更新処理について説明する。
 ここでは、図14の要素変化数情報360が設定されていると仮定する。
 図13は、本発明の第3の実施の形態における、注目順位更新処理を示すフローチャートである。注目順位更新処理は、検索処理(ステップS101からS109)に続いて実行される。
 はじめに、検索装置100の要素変化数更新部130は、ステップS101で入力された検索条件330と図示しない記憶部に記憶された前回の検索条件とを比較し、検索条件330と前回の検索条件との間で、要素が不一致となる順位を検出する(ステップS321)。なお、要素変化数更新部130は、ステップS208で更新される前の前回検索条件340を取得し、入力された検索条件330と比較してもよい。
 例えば、前回の検索条件が「aaa」であり、入力された検索条件330が「abb」である場合、要素変化数更新部130は、順位「2」「3」を検出する。
 要素変化数更新部130は、要素変化数情報360における、ステップS321で検出された順位に対する変化数を更新する(ステップS322)。
 例えば、要素変化数更新部130は、図14の要素変化数情報360における、順位「2」「3」に対する変化数に1を加算し、それぞれ「91」「11」に更新する。
 次に、注目順位更新部140は、要素変化数情報360をもとに、注目順位情報320の注目順位を更新する(ステップS323)。ここで、注目順位更新部140は、要素変化数情報360において、変化数が他の順位に比べて大きい順位を、注目順位情報320の注目順位に設定する。
 例えば、注目順位更新部140は、変化数が最大の順位「2」を注目順位に設定する。
 ステップS323において注目順位が変更された場合(ステップS324/Yes)、注目順位更新部140は、前回検索条件340の設定値を削除(初期化)する(ステップS325)。また、注目順位更新部140は、前回探索経路情報350の設定値を削除(初期化)する(ステップS326)。これにより、注目順位が変更された後は、根ノードからの検索が行われる。
 以降、次の検索から、更新された注目順位で、検索処理(ステップS101からS109)が実行される。
 なお、本発明の第3の実施の形態においては、注目順位情報320の更新(ステップS323からS326)を検索処理のたびに実行するが、注目順位情報320の更新を、所定の検索回数等、検索回数に関する所定条件を満たした場合や、ユーザ等による指示に応答して実行してもよい。
 また、要素変化数情報360における変化数の初期化を、検索回数に関する所定条件を満たした場合や、ユーザ等による指示に応答して実行してもよい。
 また、本発明の第3の実施の形態における注目順位の更新を、本発明の第2の実施の形態に適用してもよい。この場合、変化数が他の順位に比べて大きい所定数の順位を、注目順位として設定してもよい。
 以上により、本発明の第3の実施の形態の動作が完了する。
 本発明の第3の実施の形態によれば、要素列が前方一致することが多い順位が予め特定できない場合でも、検索をより高速化できる。その理由は、要素変化数更新部130が、入力された検索条件330と前回の検索条件との間で各順位の要素を比較し、注目順位更新部140が、他の順位に比べて要素が不一致となった回数が多い順位を、注目順位に設定するためである。
 (第4の実施の形態)
 次に、本発明の第4の実施の形態について説明する。
 本発明の第4の実施の形態においては、もとの検索対象の要素列を再整列順位で再整列した(並び変えた)検索対象に関する探索木301を用いて、検索処理を行う点において、本発明の第1の実施の形態と異なる。
 なお、本発明の第4の実施において、本発明の第1の実施の形態と同一の符号を有する構成要素は、特に説明のない限り、本発明の第1の実施の形態と同様とする。
 はじめに、本発明の第4の実施の形態の構成について説明する。図15は、本発明の第4の実施の形態における、検索装置100の構成を示すブロック図である。
 図15を参照すると、本発明の第4の実施の形態の検索装置100は、第1の実施の形態の検索装置100の構成要素に加えて、要素変化数更新部130、探索木更新部150、検索条件再整列部160、検索結果再整列部170、要素変化数記憶部260、及び、再整列順位記憶部270を含む。ここで、要素変化数更新部130、及び、要素変化数記憶部260は、本発明の第3の実施の形態と同一である。
 再整列順位記憶部270は、再整列順位情報370を記憶する。図18は、本発明の第4の実施の形態における、再整列順位情報370の例を示す図である。再整列順位情報370は、順位毎に、当該順位に対応する再整列後の順位を示す「再整列順位」を含む。
 探索木記憶部210は、再整列順位で再整列された検索対象(再整列検索対象)に関する探索木301の探索木情報311を記憶する。図20は、本発明の第4の実施の形態における、探索木301の例を示す図である。図20の探索木301は、図5の探索木300における検索対象を、図18の再整列順位情報370の再整列順位で再整列した場合の例である。図21は、本発明の第4の実施の形態における、探索木情報311の例を示す図である。図21の探索木情報311は、図20の探索木301に対応する。
 なお、初期状態では、再整列順位情報370の再整列順位は、もとの順位と同じであり、探索木情報311には、再整列されていない検索対象に関する探索木の情報が設定されていると仮定する。
 探索木更新部150は、要素変化数情報360をもとに、再整列順位情報370、及び、探索木情報311を更新する。
 検索条件再整列部160は、入力された検索条件330の要素列を、再整列順位で再整列して、検索条件331に変換する。
 探索開始ノード判定部110は、検索条件331と前回検索条件340との要素列を比較し、探索木301上での探索の始点である探索開始ノードを、前回探索経路情報350をもとに決定する。
 検索部120は、探索木301上で、探索開始ノードから探索を行い、検索条件331に対する検索結果381を取得する。また、検索部120は、前回検索条件340と前回探索経路情報350とを更新する。
 なお、注目順位情報320の注目順位は、再整列順位を用いて設定される。また、前回検索条件340には、再整列された検索条件331が設定される。
 検索結果再整列部170は、探索木301上での検索結果381の要素列を、もとの順位で再整列して、検索結果380に変換する。
 次に、本発明の第4の実施の形態における検索装置100の動作について説明する。
 はじめに、本発明の第4の実施の形態における、検索処理について説明する。
 図16は、本発明の第4の実施の形態における、検索処理を示すフローチャートである。
 ここでは、探索木更新部150により、図21の探索木情報311、及び、図18の再整列順位情報370が設定されていると仮定する。
 はじめに、検索装置100は、ユーザから、検索条件330の入力を受け付ける(ステップS401)。
 次に、検索装置100の検索条件再整列部160は、検索条件330の要素列を再整列順位で再整列して、検索条件331に変換する(ステップS402)。
 例えば、検索条件330として、要素列「abb」が入力された場合、検索条件再整列部160は、検索条件330「abb」を図18の再整列順位情報370における再整列順位で再整列し、検索条件331「bab」に変換する。
 次に、探索開始ノード判定部110と検索部120は、本発明の第1の実施の形態におけるステップS102からS108と同様に、探索開始ノードを決定し、探索木301上の探索開始ノードから探索を行う。検索部120は、検索条件331に対する検索結果381を取得する(ステップS403)。
 例えば、検索部120は、図21の探索木情報311を用いて探索を行い、検索条件331「bab」に対する検索対象「bab」を検索結果381に設定する。
 次に、検索結果再整列部170は、検索結果381の要素列を、もとの順序で再整列して、検索結果381に変換する。(ステップS404)。
 例えば、検索結果再整列部170は、検索結果381「bab」を、もとの順位で再整列した検索結果380「abb」を取得する。
 最後に、検索装置100は、検索結果380を出力する(ステップS405)。
 次に、本発明の第4の実施の形態における、探索木更新処理について説明する。
 図17は、本発明の第4の実施の形態における、探索木更新処理を示すフローチャートである。探索木更新処理は、検索処理(ステップS401からS405)に続いて実行される。
 はじめに、検索装置100の要素変化数更新部130は、本発明の第3の実施の形態と同様に、ステップS401で入力された検索条件330と前回の検索条件とを比較し、要素が不一致となる順位を検出する(ステップS421)。そして、要素変化数更新部130は、要素変化数情報360における、ステップS421で検出された順位に対する変化数を更新する(ステップS422)。
 探索木更新部150は、要素変化数情報360をもとに、再整列順位情報370の再整列順位を更新する(ステップS423)。ここで、探索木更新部150は、要素変化数情報360における各順位に対する変化数の昇順に順番を付与し、各順位に付与した順番を、再整列順位情報370における、当該順位に対する再整列順位に設定する。
 例えば、探索木更新部150は、図14の要素変化数情報360に対して、図18の再整列順位情報370を設定する。
 ステップS423において再整列順位が変更された場合(ステップS424/Yes)、探索木更新部150は、再整列順位をもとに、探索木情報311を更新する(ステップS425)。
 ここで、探索木更新部150は、図示しない記憶部に記憶されている、もとの検索対象の各々の要素列を再整列順位で整列し、再整列検索対象を取得する。そして、探索木更新部150は、再整列検索対象について探索木情報311を設定する。
 図19は、本発明の第4の実施の形態における、検索対象の再整列の例を示す図である。例えば、探索木更新部150は、図18の再整列順位情報370に従って、図19に示すように、もとの検索対象から再整列検索対象を取得する。さらに、探索木更新部150は、図19の再整列検索対象に対して、図21の探索木情報311を生成する。
 次に、探索木更新部150は、前回検索条件340の設定値を削除(初期化)する(ステップS426)。また、探索木更新部150は、前回探索経路情報350の設定値を削除(初期化)する(ステップS427)。これにより、再整列順位の変更に伴い探索木301が変更された後は、根ノードからの検索が行われる。
 以降、次の検索から、更新された探索木301を用いて、検索処理(ステップS401からS405)が実行される。
 なお、本発明の第4の実施の形態においては、再整列順位情報370の更新以降の処理(ステップS423からS427)を検索処理のたびに実行するが、再整列順位情報370の更新を、所定の検索回数等、検索回数に関する所定条件を満たした場合や、ユーザ等による指示に応答して実行してもよい。
 また、要素変化数情報360における変化数の初期化を、検索回数関する所定条件を満たした場合や、ユーザ等による指示に応答して実行してもよい。
 また、本発明の第4の実施の形態における探索木301の更新を、本発明の第2の実施の形態に適用してもよい。
 以上により、本発明の第4の実施の形態の動作が完了する。
 本発明の第4の実施の形態によれば、第1の実施の形態に比べて、検索をさらに高速化できる。その理由は、探索木更新部150が、入力された検索条件330と前回の検索条件との間で各順位の要素を比較し、各順位に要素が不一致となった回数の順番を示す再整列順位を付与し、検索対象の要素列の各順位を当該再整列順位に従って並び変え、当該並び変えられた検索対象に対して探索木を生成するためである。これにより、連続する検索条件の要素列間で、注目順位までの要素列が前方一致する機会が増えるため、検索がさらに高速化される。また、注目順位をより大きく(後方に)設定することにより、探索範囲をさらに限定できるため、検索がさらに高速化される。
 以上、実施形態を参照して本願発明を説明したが、本願発明は上記実施形態に限定されるものではない。本願発明の構成や詳細には、本願発明のスコープ内で当業者が理解し得る様々な変更をすることができる。
 例えば、検索対象の要素列が、任意の要素を示すワイルドカード要素を含み、探索木300上のノードにおける子ノードリンク情報が、ワイルドカード要素を含んでいてもよい。この場合、ワイルドカード要素に対する子ノードへのリンクは必ず探索されるため、複数の経路で探索が行われる。そして、前回探索経路情報350には、複数の経路の各々における注目順位に対応するノードが設定される。入力された検索条件330と前回検索条件340とで、注目順位までの要素列が一致した場合、前回探索経路情報350の各ノードを探索開始ノードとして、探索が行われる。
 この出願は、2012年1月18日に出願された日本出願特願2012-007857を基礎とする優先権を主張し、その開示の全てをここに取り込む。
 100  検索装置
 110  探索開始ノード判定部
 120  検索部
 130  要素変化数更新部
 140  注目順位更新部
 150  探索木更新部
 160  検索条件再整列部
 170  検索結果再整列部
 210  探索木記憶部
 220  注目順位記憶部
 240  前回検索条件記憶部
 250  前回探索経路記憶部
 260  要素変化数記憶部
 270  再整列順位記憶部
 300  探索木
 301  探索木
 310  探索木情報
 311  探索木情報
 320  注目順位情報
 321  注目順位情報
 330  検索条件
 331  検索条件
 340  前回検索条件
 350  前回探索経路情報
 351  前回探索経路情報
 360  要素変化数情報
 370  再整列順位情報
 380  検索結果
 381  検索結果

Claims (10)

  1.  要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶する探索木記憶手段と、
     前回の検索要素列を記憶する前回検索条件記憶手段と、
     前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶する前回探索経路情報記憶手段と、
     入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定する探索開始ノード判定手段と、
     前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する検索手段と、を含む検索装置。
  2.  前記前回探索経路情報は、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、複数の前記注目順位の各々に対応する階層のノードを示し、
     前記探索開始ノード判定手段は、入力された検索要素列と前記前回の検索要素列との間で、前記複数の注目順位のいずれかより前の要素列が一致する場合、前記前回探索経路情報で示される当該注目順位に対応するノードを、前記探索開始ノードと決定する、請求項1に記載の検索装置。
  3.  さらに、前記入力された検索要素列と前記前回の検索要素列との間で各順位の要素を比較し、他の順位に比べて要素が不一致となった回数が多い順位を、前記注目順位に設定する注目順位更新手段を含む、請求項1または2に記載の検索装置。
  4.  さらに、前記入力された検索要素列と前記前回の検索要素列との間で各順位の要素を比較し、各順位に要素が不一致となった回数の順番を示す再整列順位を付与し、前記複数の検索対象の要素列の各順位を当該再整列順位に従って並び変え、当該並び変えられた前記複数の検索対象に対して前記探索木を生成する探索木更新手段を含み、
     前記検索手段は、前記再整列順位に従って並び変えられた前記入力された検索要素列を、前記生成された探索木上で検索する、請求項1または2に記載の検索装置。
  5.  要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶し、
     前回の検索要素列を記憶し、
     前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶し、
     入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定し、
     前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する、検索方法。
  6.  前記前回探索経路情報は、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、複数の前記注目順位の各々に対応する階層のノードを示し、
     前記探索開始ノードを決定する場合、入力された検索要素列と前記前回の検索要素列との間で、前記複数の注目順位のいずれかより前の要素列が一致する場合、前記前回探索経路情報で示される当該注目順位に対応するノードを、前記探索開始ノードと決定する、請求項5に記載の検索方法。
  7.  さらに、前記入力された検索要素列と前記前回の検索要素列との間で各順位の要素を比較し、他の順位に比べて要素が不一致となった回数が多い順位を、前記注目順位に設定する、請求項5または6に記載の検索方法。
  8.  コンピュータに、
     要素列である複数の検索対象を表し、ルートからの各階層に要素列の先頭からの各順位を対応付けた探索木を記憶し、
     前回の検索要素列を記憶し、
     前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、注目順位に対応する階層のノードを示す前回探索経路情報を記憶し、
     入力された検索要素列と前記前回の検索要素列との間で、前記注目順位より前の要素列を一括して比較し、一致する場合、前記前回探索経路情報で示されるノードを探索開始ノードと決定し、
     前記探索木上の前記探索開始ノードから、前記入力された検索要素列の前記注目順位以降の要素について探索を行うことにより、前記複数の検索対象から前記入力された検索要素列を検索する、処理を実行させる検索プログラムを格納する、
    コンピュータが読み取り可能な記録媒体。
  9.  前記前回探索経路情報は、前記探索木において前記前回の検索要素列を探索する場合に辿るノードの内、複数の前記注目順位の各々に対応する階層のノードを示し、
     前記探索開始ノードを決定する場合、入力された検索要素列と前記前回の検索要素列との間で、前記複数の注目順位のいずれかより前の要素列が一致する場合、前記前回探索経路情報で示される当該注目順位に対応するノードを、前記探索開始ノードと決定する処理を実行させる前記検索プログラムを格納する、請求項8に記載のコンピュータが読み取り可能な記録媒体。
  10.  さらに、前記入力された検索要素列と前記前回の検索要素列との間で各順位の要素を比較し、他の順位に比べて要素が不一致となった回数が多い順位を、前記注目順位に設定する処理を実行させる前記検索プログラムを格納する、請求項8または9に記載のコンピュータが読み取り可能な記録媒体。
PCT/JP2012/007922 2012-01-18 2012-12-12 検索装置、検索方法、及び、検索プログラム WO2013108333A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012-007857 2012-01-18
JP2012007857 2012-01-18

Publications (1)

Publication Number Publication Date
WO2013108333A1 true WO2013108333A1 (ja) 2013-07-25

Family

ID=48798791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/007922 WO2013108333A1 (ja) 2012-01-18 2012-12-12 検索装置、検索方法、及び、検索プログラム

Country Status (2)

Country Link
JP (1) JPWO2013108333A1 (ja)
WO (1) WO2013108333A1 (ja)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015015757A1 (ja) * 2013-08-02 2015-02-05 日本電気株式会社 情報処理装置、及び、検索方法
JP2015130103A (ja) * 2014-01-08 2015-07-16 日本電気株式会社 情報処理装置、検索方法、及び、プログラム
US9612799B2 (en) 2013-12-20 2017-04-04 International Business Machines Corporation Method, device, and computer program for merge-sorting record groups having tree structure efficiently

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11184857A (ja) * 1997-12-25 1999-07-09 Nec Corp 木構造情報検索装置及び検索方法並びに検索方法を実行させるためのプログラムを記録した記録媒体
JP2001188791A (ja) * 1999-12-24 2001-07-10 Internatl Business Mach Corp <Ibm> 配列の変換方法、構造解析方法、装置、記録媒体及び伝送媒体
WO2009034689A1 (ja) * 2007-09-14 2009-03-19 S.Grants Co., Ltd. ビット列検索装置、検索方法及びプログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11184857A (ja) * 1997-12-25 1999-07-09 Nec Corp 木構造情報検索装置及び検索方法並びに検索方法を実行させるためのプログラムを記録した記録媒体
JP2001188791A (ja) * 1999-12-24 2001-07-10 Internatl Business Mach Corp <Ibm> 配列の変換方法、構造解析方法、装置、記録媒体及び伝送媒体
WO2009034689A1 (ja) * 2007-09-14 2009-03-19 S.Grants Co., Ltd. ビット列検索装置、検索方法及びプログラム

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015015757A1 (ja) * 2013-08-02 2015-02-05 日本電気株式会社 情報処理装置、及び、検索方法
US9612799B2 (en) 2013-12-20 2017-04-04 International Business Machines Corporation Method, device, and computer program for merge-sorting record groups having tree structure efficiently
US10228907B2 (en) 2013-12-20 2019-03-12 International Business Machines Corporation Method, device, and computer program for merge-sorting record groups having tree structure efficiently
US11023203B2 (en) 2013-12-20 2021-06-01 International Business Machines Corporation Method, device, and computer program for merge-sorting record groups having tree structure efficiently
JP2015130103A (ja) * 2014-01-08 2015-07-16 日本電気株式会社 情報処理装置、検索方法、及び、プログラム

Also Published As

Publication number Publication date
JPWO2013108333A1 (ja) 2015-05-11

Similar Documents

Publication Publication Date Title
CN110268394B (zh) 用于存储和操作键值数据的方法、系统及机器可读存储媒体
CN111460311A (zh) 基于字典树的搜索处理方法、装置、设备和存储介质
TW201837720A (zh) 用於多串流儲存裝置之串流選擇
TW201842454A (zh) 合併樹廢棄項目指標
US20110179030A1 (en) Method and apparatus for indexing suffix tree in social network
WO2015010509A1 (zh) 一种基于一维线性空间实现Trie树的词典检索方法
US20120005234A1 (en) Storage medium, trie tree generation method, and trie tree generation device
CN106599091B (zh) 基于键值存储的rdf图结构存储和索引方法
WO2013108333A1 (ja) 検索装置、検索方法、及び、検索プログラム
Belazzougui et al. Bidirectional variable-order de Bruijn graphs
JP6072922B2 (ja) 文字列検索装置、文字列検索方法および文字列検索プログラム
US20110219143A1 (en) Path calculation order deciding method, program and calculating apparatus
JP4491480B2 (ja) インデクス構築方法、文書検索装置及びインデクス構築プログラム
JP5678691B2 (ja) 検索制御装置、検索制御プログラムおよび検索制御方法
JP6959164B2 (ja) 生成装置、生成方法、及び生成プログラム
JP2020086662A (ja) 情報処理装置、情報処理方法、及び情報処理プログラム
JP6705764B2 (ja) 生成装置、生成方法、及び生成プログラム
JP5964781B2 (ja) 検索装置、検索方法および検索プログラム
CN106302178B (zh) 一种路由查询方法及装置
JP2015176407A (ja) 検索装置、検索方法、検索用プログラムおよび検索用データ構造
JP6005583B2 (ja) 検索装置、検索方法および検索プログラム
JP5628365B2 (ja) 検索装置
KR100907827B1 (ko) 포워딩 테이블 검색 장치 및 방법
JP2020187644A (ja) 情報処理装置、情報処理方法、及び情報処理プログラム
JP6512050B2 (ja) 探索方法、探索プログラム及び探索装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12865682

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2013554099

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12865682

Country of ref document: EP

Kind code of ref document: A1