摘要:
The present invention discloses a method and apparatus for longest prefix matching. The method includes (A) reading a current-level trie node (TNODE) in the trie, (B) determining whether an offset field of the TNODE indicates that a matched prefix exists in an upper level node and, if so, adding the offset field of the TNODE to a pointer that points to a leaf array in the upper level node, updating a current best match pointer with the computation result and executing block (C), otherwise, executing block (C), (C) determining whether the TNODE has a child node according to a child bitmap, when it is determined that a branch flag of the TNODE matches a corresponding bit of a search keyword, and (D) when it is determined that the TNODE has no child node, reading the internal bitmap of the TNODE, computing a longest matched prefix in the TNODE according to the internal bitmap and a pointer that points to a leaf array in the TNODE, updating the current best match pointer with the computation result, and computing an address of a leaf node (LNODE) associated with the current best match pointer.
摘要:
A method for selecting a hash function, a method for storing and searching a routing table and devices thereof are provided. The method for selecting a hash function includes: hashing data to be hashed by using a current alternative hash function; decoding a hash result; accumulating decoded results until no carry occurs during the accumulation; and selecting a current alternative hash function with no carry generated as a formal hash function. The method for storing a routing table includes: dividing the routing table into a next-level node pointer portion and a prefix portion for being stored; and selecting a hash function by using the above method for selecting a hash function. The method for searching a routing table includes: directly searching an IP address to be searched according to a directly stored length of a next-level node pointer portion for storing the routing table; and reading a prefix node according to a searched result. Thus, hash collision can be avoided, and memory resources occupied by the routing table can be effectively reduced.
摘要:
A method for selecting a hash function, a method for storing and searching a routing table and devices thereof are provided. The method for selecting a hash function includes: hashing data to be hashed by using a current alternative hash function; decoding a hash result; accumulating decoded results until no carry occurs during the accumulation; and selecting a current alternative hash function with no carry generated as a formal hash function. The method for storing a routing table includes: dividing the routing table into a next-level node pointer portion and a prefix portion for being stored; and selecting a hash function by using the above method for selecting a hash function. The method for searching a routing table includes: directly searching an IP address to be searched according to a directly stored length of a next-level node pointer portion for storing the routing table; and reading a prefix node according to a searched result. Thus, hash collision can be avoided, and memory resources occupied by the routing table can be effectively reduced.
摘要:
A regular expression matching method and system, and a searching device are provided. First, the searching device performs string filtering on a data stream to be matched, in which if keywords in the data stream and preset character words have at least one same character, the searching device indicates that the data stream passes through the string filtering. Then the searching device performs regular expression filtering on the data stream passing through the string filtering. In a string filtering process through the method, system, and device, when Hash mapping positions of the keywords of the data stream are a subset of the Hash mapping positions of the character words, it indicates that the data stream passes through the string filtering, and it is not required to store the keywords and further compare the keywords with the character words, thereby saving the storage space and improving performance.
摘要:
Search queries for images are received from users. An original order of responsive images to the query is determined. Duplicate images and words associated with the duplicate images are identified for each of the responsive images. Common words associated with the duplicate images are identified. The responsive images are annotated with the common words and an annotated order is determined. A re-ranked order is determined based on the original order and the annotated order. Responsive images are presented to the user in the re-ranked order.
摘要:
An image segmentation method includes generating a hierarchy of regions by unsupervised segmentation of an input image. Each region is described with a respective region feature vector representative of the region. Hierarchical structures are identified, each including a parent region and its respective child regions in the hierarchy. Each hierarchical structure is described with a respective hierarchical feature vector that is based on the region feature vectors of the respective parent and child regions. The hierarchical structures are classified according to a set of predefined classes with a hierarchical classifier component that is trained with hierarchical feature vectors of hierarchical structures of training images. The training images have semantic regions labeled according to the set of predefined classes. The input image is segmented into a plurality of semantic regions based on the classification of the hierarchical structures and optionally also on classification of the individual regions.
摘要:
A regular expression matching method and system, and a searching device are provided. First, the searching device performs string filtering on a data stream to be matched, in which if keywords in the data stream and preset character words have at least one same character, the searching device indicates that the data stream passes through the string filtering. Then the searching device performs regular expression filtering on the data stream passing through the string filtering. In a string filtering process through the method, system, and device, when Hash mapping positions of the keywords of the data stream are a subset of the Hash mapping positions of the character words, it indicates that the data stream passes through the string filtering, and it is not required to store the keywords and further compare the keywords with the character words, thereby saving the storage space and improving performance.
摘要:
An image segmentation method includes generating a hierarchy of regions by unsupervised segmentation of an input image. Each region is described with a respective region feature vector representative of the region. Hierarchical structures are identified, each including a parent region and its respective child regions in the hierarchy. Each hierarchical structure is described with a respective hierarchical feature vector that is based on the region feature vectors of the respective parent and child regions. The hierarchical structures are classified according to a set of predefined classes with a hierarchical classifier component that is trained with hierarchical feature vectors of hierarchical structures of training images. The training images have semantic regions labeled according to the set of predefined classes. The input image is segmented into a plurality of semantic regions based on the classification of the hierarchical structures and optionally also on classification of the individual regions.
摘要:
Methods and computer-readable media for propagating content category information to images stored in a database are described. A seed image that is associated with a known content category is received. A content-based image retrieval is conducted using the seed image as a search query image. A number of search result images are identified. The content category is propagated to the search result images. Metadata associated with the search result images is aggregated and analyzed to identify domains that should also be associated with the content category. Additional images that are associated with the domain are identified and the content category propagated thereto. The process is iterated using the additional images as search query images for the content-based image retrieval.