WO2014003249A1 - 해쉬를 이용한 전문 기반 논리 연산 수행 방법 - Google Patents

해쉬를 이용한 전문 기반 논리 연산 수행 방법 Download PDF

Info

Publication number
WO2014003249A1
WO2014003249A1 PCT/KR2012/008715 KR2012008715W WO2014003249A1 WO 2014003249 A1 WO2014003249 A1 WO 2014003249A1 KR 2012008715 W KR2012008715 W KR 2012008715W WO 2014003249 A1 WO2014003249 A1 WO 2014003249A1
Authority
WO
WIPO (PCT)
Prior art keywords
hash
data structure
logic
bucket
hash data
Prior art date
Application number
PCT/KR2012/008715
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 주식회사 리얼타임테크
Priority to JP2015538003A priority Critical patent/JP6078652B2/ja
Priority to CN201280025701.XA priority patent/CN103874996B/zh
Priority to US14/116,834 priority patent/US9396223B2/en
Publication of WO2014003249A1 publication Critical patent/WO2014003249A1/ko

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/325Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3341Query execution using boolean model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30029Logical and Boolean instructions, e.g. XOR, NOT

Definitions

  • the present invention relates to a method for efficiently performing logical operations used for keyword retrieval in a full-text based database.
  • the present invention efficiently utilizes minimal resources on mobile terminals with limited system resources. A method of performing logic operations is described.
  • An information retrieval system is a system that quickly finds information that meets a user's needs and provides it to a user from a database that has been collected, processed, and processed in an easy-to-find form. .
  • the information retrieval system is divided into reference search, fact search, and full-text search according to the type of information accumulated in the database.
  • Reference search is a search of bibliography of literature that is the core of the topic that the user wants to know, such as online information retrieval systems such as DIRLOG and BRS.
  • search general data, numerical data and fact data such as chemical abstracts service on-line (CAS) for chemicals, and electronic information service (EMI) sniffing data for semiconductor materials. Belongs to the category.
  • Full-text search allows you to search not only bibliographic data, but also all texts and texts, as needed, from a database that contains a full-text of literature. WESTLAW, Nexis, where you can search for newspaper articles, and Dow Jones Retrieval.
  • Logical operations used to search keywords in full-text based databases require large amounts of computing resources.
  • computing resources that can be used in a mobile environment are inevitably limited, and the search speed becomes slow when performing logical operations.
  • a full-text based search system on a mobile terminal has a problem that the number of logical operators provided is extremely limited, so that an effective keyword search is not performed.
  • the present invention has been made to solve the above problems, and proposes a method for evaluating a full-text based logical operator using a hash, thereby utilizing the minimum resources on a mobile terminal with limited system resources.
  • the purpose of this paper is to provide AND / OR logic operation, and to provide expert-based logic operation method using hash that can acquire logic operation result data from outside after logic operation.
  • a professional-based logic operation performed method using a hash is that the hash data structures having different logic states and Daewoong ⁇ eu in the current logic ⁇ operator according to the type of logic operator ⁇ dan _ system; ⁇ ⁇
  • the computer-readable recording medium is a hash function consisting of an operation in which a hash ID is used as an input value, and specifying a starting position of a bucket for a hash key.
  • a hash data structure including a hash table that is a list set of hash nodes, and a bucket block having a hash ID and a pointer to a hash chain as a bucket component;
  • a StartUp module that allocates and initializes a memory by generating a hash data structure having a different logic state according to a logic operator type, and allocates and initializes a memory, and a hash node corresponding to the first operand data in the hash data structure.
  • Insert operands to insert into the assigned bucket, and the second operand from the buckets inserted in the Insert modules in the hash data structure if the current logic operator type is AND, or the number of buckets selected as the result of the previous operation.
  • the bucket matching the hash node corresponding to the data is selected as a result value.
  • the bucket is inserted into the bucket allocated from the hash data structure.
  • FIG. 1 illustrates a hash data structure used in a method for performing a specialized-based logical operation using a hash according to the present invention.
  • FIG. 2 is a view showing the operation of the user interface increase StartUp model used in the present invention
  • FIG. 4 is a view showing the operation of the user interface enhancement insert module used in the present invention.
  • FIG. 5 is a view showing the operation of the Logic model of the user interface used in the present invention.
  • FIG. 7 is a view showing the operation of the size model of the user interface used in the present invention.
  • FIG. 8 is a view showing the operation of the user interface enhancement Next model used in the present invention.
  • FIGS. 9A-9C show tables and respective indices for illustrative purposes in accordance with the present invention.
  • 10A to 14E are diagrams for explaining insertion operations, logic operations, and search results of each example according to the present invention.
  • the hash data structure used in the present invention may include a hash function (not shown), a hash table 10, a bucket block 20, a cursor 40, an AND counter 50, an OR counter 51, and the like. have.
  • the hash function is a function that generates a hash key by inputting a hash ID.
  • the hash function is a MOD operation.
  • the record identifier (ID) of the full-text database is used as the hash ID.
  • the hash table 10 is a set of lists of hash nodes that specify the starting position of the bucket 30 against the hash key.
  • the size of the hash table 10 is determined using the PreCount input by the user, which is defined as a prime number slightly larger than the size of the bucket block 20 for an even distribution of the bucket 30. desirable.
  • the bucket 30 is a data structure inserted into the hash, and includes a hash ID and a pointer to the hash chain 32 so that the bucket can be searched in case of a hash collision.
  • the bucket 30 may include a counter for determining a result of a logic operation and data input by the user to the hash node (user data, user data 2, etc.).
  • the bucket block 20 is a memory buffer created in advance by using PreCount, which is an expected number of buckets 30 to be inserted into the hash.
  • the cursor 40 designates the position of the bucket 30 in the bucket convex 20, and is to assist in easily acquiring the result of the logic operation from the outside.
  • the AND counter 50 is for counting the number of result values of the AND logic operation
  • the I counter 51 is for counting the number of result values of the logic operation.
  • the memory manager 60 determines the size of the bucket block for each range in advance and determines the size of the bucket block to generate a value based on which range the PreCount value received from the user belongs to.
  • the size of the bucket block is preferably determined by a value of 2 V (where n is an integer) to facilitate memory management.
  • PreCount input by the user is preferably set to have two or three buckets in the hash chain 32. If the index uses the number of hash nodes in the set corresponding to the first operand data of the logic operation, effective.
  • the memory manager 60 automatically creates a new bucket block 20. Therefore, according to the conventional hash data structure, when a hash collision occurs, a bucket must be newly created and allocated in the form of a linked list, but according to the present invention, the buckets 30 already created in the bucket block 20 are increased. It can be assigned in order and used in the form of linked list.
  • User interface used in the present invention includes StertUp, CleanUp, Insert, Logic, ChangeLogic, Size, Next.
  • StartUp modules perform initialization and resource allocation to use a hash.
  • Input values are Logic Operators, Number of Operators, Estimated Bucket Count (PreCount) It consists of.
  • the number of operators is the number of consecutive AND or OR logic operators. For example, if there are logical operations "A AND B AND C" for the sets A, B, and C, the number of operators is two.
  • the estimated bucket count (PreCount) is used as an important input to determine the size of hash tables and bucket blobs.
  • the size of the bucket block and the hash table is determined using the value (PreCount) input by the user (S110).
  • the memory manager 60 determines the size of the bucket block for each range in advance, and determines the value of the bucket block as the size of the bucket block according to which range the PreCount value belongs to.
  • the size of the bucket block is preferably determined to be 2 V (where n is an integer) to facilitate memory management.
  • the size of the hash table is set to a prime number slightly larger than the size of the bucket block.
  • the memory is allocated to the hash table 10 and initialized using the determined hash table size (S120).
  • hash data structures having different logic states are generated according to the type (AND or OR) of the input logic operator (S130 and S140). That is, the type of bucket is divided into AND logic 30a and OR logic 30b, and the AND logic bucket 30a additionally includes a counter. This counter is used for AND logic operation. Only the AND logic operation is possible in the hash data structure of the AND logic state, and only this logic operation is possible in the hash data structure of the OR logic state.However, when the type of logic operator is changed to another, the ChangeLogic modules described below. You can change the logical state of the hash data structure by
  • the CleanUp module performs a function of releasing resources in a hash after finishing all logic operations.
  • the memory of the bucket block 20 is returned (S200), the memory of the hash table 10 is returned (S210), and all member variables are initialized (S220).
  • the Insert module inserts the first operand data to perform the logic operation on the initialized hash data structure. If there are operations such as "A AND B" for sets A and B, one of the elements of set A is inserted into the hash.
  • Input value is user data data to input as hash node.
  • Hashnode (data) A hash ID to be used for a hash function and other data input by the user.
  • the Insert module performs the following operations.
  • a search is performed to determine whether data to be input in the hash already exists (S300). That is, it is searched whether a bucket having a hash ID equal to the hash ID of the hash node entered in the hash exists.
  • one bucket is allocated from the memory manager 60 (S310), a hash key is generated using the hash function (S320), and the bucket assigned to the hash chain corresponding to the hash key is generated. Connect (S330) and record the input data (S340).
  • the logic modules input a operand following the logic operator to perform a logic operation. If there is an operation such as "A AND B" for sets A and B, then an AND operation is performed on the hash of one of the elements of set B, and if "A OR B" and When the same operation is performed, the hash operation on one of the elements of set B is performed on the hash.
  • the input consists of an operator number and a hash node (data data).
  • Operator number It is the value that indicates the number of logic operator in consecutive same logic operation. For example, if there is a logic operation of "A AND B AND C AND D", the number of operators is 3, the operator number of the first logic operation (A AND B) is 1, and the second logic operation ((1st logic) The operator number at the time of AND) C) is 2, and the operator number at the time of the third logic arithmetic (AND D) is 3.
  • Hash node (data) It consists of hash ID to be used for hash function and data input by other users.
  • a search is performed to determine whether data to be input in the hash already exists (S400). That is, it is searched whether a bucket having a hash ID equal to the hash ID of the hash node entered in the hash exists.
  • step S400 If the search result of step S400 already exists, it is checked whether the current logic operator is AND or OR (S410).
  • the current logic operator is set as the logic operator input in the StartUp mode, and is changed to the newly entered logic operator when the ChangeLogic mode is executed.
  • the counter of the retrieved bucket is equal to the input operator number minus one.
  • step S400 If the search result of step S400 does not exist, check whether the current logic operator is AND or 3 ⁇ 4 (S460X).
  • one bucket is allocated from the memory manager 60 (S470), and a hash key is generated using a hash function (S480).
  • the bucket assigned to the corresponding hash chain is connected (S490), the input data is recorded (S500), and the OR counter is increased (S510).
  • ChangeLogic modules are used when the logic operator changes, and change the logic state inside the hash. If there is an operation such as "(A AND B) OR C '' for sets A, B, and C, the logic state of the hash is changed from AND to this after the AND logic operation.
  • the input value consists of the logic operator and the number of operators.
  • a new hash data structure is created internally using the input logic operators, the number of operators, and the estimated number of buckets ((PreCount) set in the current hash data structure.
  • the Startup models are used.
  • the member variables and pointers of the newly created hash data structure are mapped to the current hash data structure, and only the object data of the newly created hash data structure is destroyed. In this case, the new hash data structure is not cleaned up.
  • a buffer (a hash table, bucket blob) that stores the input data of members inside the hash must be allocated from the heap using a pointer, thereby changing the logic state of the current hash data structure. It is possible to change to a logic state.
  • the memory allocated for the hash data structure is L ⁇ lt ⁇ table line ⁇ ⁇ .
  • the change from rCEn ⁇ Eoi ⁇ ⁇ OR to AND does not reduce the allocated memory, thus simply changing the logic state of the current hash data structure.
  • the bucket of the current hash data structure is the bucket for AND logic. It is changed to 30a.
  • the Size model performs a function of returning the result number of logic operations to the user.
  • the Next model performs a function of returning the result of the logic operation to the user after the logic operation.
  • the counter value in the bucket is compared with the number of operators, and if it is the same, the user data in the bucket is returned (S830). If not, the flow returns to step S810.
  • the cursor is incremented by one, and a bucket is obtained at the position of the cursor (S840).
  • an index operation is performed by searching in the index with the keyword "modern".
  • the search is performed in the index with the keyword "car” to perform AND logic operation on the hash.
  • the program code for example 1 can be written as follows.
  • the logical expression of the search query is as follows.
  • an index operation is performed on the index by searching in the index with the keyword "modern".
  • this logic operation is performed on the hash by searching in the index with the keyword "car”.
  • the program code for example 2 can be described as follows.
  • the logical expression of the search query is as follows.
  • the index is searched in the index with the keyword "modern" to perform an insert operation on the hash.
  • the program code for example 3 can be written as follows.
  • the logical expression of the search query is as follows.
  • an index operation is performed by searching in the index with the keyword "modern”.
  • the index is searched with the keyword "car” to perform a first order AND logic operation on the hash.
  • a second "AND logic" operation is performed on the hash by searching the index with the keyword 'car wash'.
  • the program code for example 4 can be written as follows.
  • the logical expression of the search query is as follows.
  • an index operation is performed by searching in the index with the keyword "modern”.
  • this logic operation is performed on the hash by searching in the index with the keyword "heaven".
  • the index is searched with the keyword "charge” to perform an AND logic operation on the hash.
  • the program code for Example 5 can be written as follows.
  • hash ChangeLogic (LOGIC_AND, 1); // Change Logic State Of Hash Data Structure
  • embodiments of the present invention described above may be recorded in a medium used in a general purpose computer including a personal computer.
  • the medium is magnetic recorder 1 ( ⁇ 1 ⁇ field-side, —platter—sketer 7—bottom—design) 7 optical plate— ⁇ 3 ⁇ 4 ⁇ ( ⁇ ⁇ T ⁇ , DVD, etc.)
  • recording media such as electrical recording media (e.g., flash memory, memory sticks, etc.) and carrier waves (e.g., transmission over the Internet).
  • electrical recording media e.g., flash memory, memory sticks, etc.
  • carrier waves e.g., transmission over the Internet.
  • the expected effect is greater on mobile terminals where the memory compaction function is simpler than a general PC.

Landscapes

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

Abstract

본 발명은 해쉬를 이용한 전문 기반 논리 연산 수행 방법에 관한 것으로, 그 방법은, 로직 오퍼레이터 종류에 따라 로직 상태를 달리하는 해쉬 자료구조를 현재의 로직 오퍼레이터에 대응하여 생성하는 단계; 첫 번째 오퍼랜드 자료에 해당하는 해쉬 노드들을 상기 해쉬 자료구조에서 차례로 할당받은 버킷에 삽입하는 단계; 및 현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자료구조에서 상기 삽입된 버킷들 또는 이전 연산의 결과값으로 선정된 버킷들 중에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드들과 일치하는 버킷들만의 결과값으로 선정하고, OR인 경우 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드들 중에서 상기 해쉬 자료구조에서 검색되지 않는 해쉬 노드들에 대하여 상기 해쉬 자료구조에서 버킷을 차례로 할당받아 삽입하여 상기 해쉬 자료구조 내의 유효한 모든 버킷들을 결과값으로 선정하는 단계;를 포함하여 이루어진다.

Description

【명세서】
【발명의 명칭】
해쉬를 이용한 전문 기반 논리 연산 수행 방법
[기술분야】
본 발명은 전문 (Full-Text) 기반 데이터베이스에서 키워드 검색 시 사 용되는 논리 연산을 효율적으로 수행하기 위한 방법에 관한 것으로, 특히 시스 템 자원이 제한적인 모바일 단말기 상에서 최소한의 자원을 사용하여 효을적으 로 로직 연산을 수행할 수 있는 방법에 관한 것이다.
[배경기술】
정보 검색 시스템은 사용자가 필요하다고 예측되는 정보나 데이터를 미 리 수집, 가공, 처리하여 찾기 쉬운 형태로 축적해 놓은 데이터베이스로부터 사 용자의 요구에 적합한 정보를 신속하게 찾아내어 사용자에게 제공하는 시스템 을 말한다.
데이터베이스에 축적되어 있는 정보의 종류에 따라 정보 검색 시스템은 참조 검색, 사실 검색, 전문 (full-text) 검색으로 구분된다. 참조 검색은 사용자 가 알고자 하는 주제를 핵심적으로 다루고 있는 문헌의 서지사항을 검색하는 것으로, DIRLOG, BRS 등의 온라인 정보검색 시스템이 여기에 해당한다. 사 실 검색은 일반 데이터나 수치 데이터 및 사실 데이터를 검색할 수 있는 것으 로, 화학물질을 검색하는 CAS(Chemical Abstracts Service On-line), 반도체 재료의 데이터를 검색하는 EMIS (Electronic Information Service) 둥이 이 범주 에 속한다. 전문 검색은 문헌의 전문 (full-text)을 축적해 놓은 데이터베이스 로부터 서지적 데이터뿐만 아니라 해당 문장이나 원문 전부를 필요에 따라 검 색해서 볼 수 있는 것으로 법률 정보를 검색할 수 있는 렉시스 (LEXIS)나 웨스 트로 (WESTLAW), 신문 기사를 검색할 수 있는 넥시스 (NEXIS), 다우존스 리 트리벌 (Dow Jones Retrieval) 등이 있다.
전문 (Full-Text) 기반 데이터베이스에서 키워드 검색 시 사용되는 논리 연산에는 대용량의 컴퓨팅 자원이 요구된다. 그런데, 모바일 환경에서 사용할 수 있는 컴퓨팅 자원은 한정될 수밖에 없어, 논리 연산 수행 시 검색 속도가 늦어진다.
따라서 모바일 단말기 상의 전문 (Full-Text) 기반 검색 시스템에서는 제공하는 논리 연산자 사용 개수가 극히 제한적이어서, 효과적인 키워드 검색 이 이루어지지 않는다는 문제점이 있다.
【발명의 상세한 설명】
본 발명은 상기의 문제점을 해결하기 위하여 안출된 것으로, 해쉬를 이 용한 풀텍스트 (Full-Text) 기반 논리 연산자 평가방법을 제안함으로써, 시스템 자원이 제한적인 모바일 단말기 상에서 최소한의 자원을 활용하여 최적의 AND/OR 로직 연산을 수행할 수 있도록 하며, 로직 연산 후 외부에서 로직 연 산 결과 데이터를 획득할 수 있도록 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법을 제공함을 그 목적으로 한다.
상기의 목적들을 달성하기 위하여, 본 발명에 의한 해쉬를 이용한 전문 기반 논리 연산 수행 방법은, 로직 오퍼레이터 종류에 따라 로직 상태를 달리 하는 해쉬 자료구조를 현재의 로직^오퍼레이터에 대웅하 ^ᅳ 하—는ᅳ단 _계; ^ᅳ
—번—째ᅳ오퍼—랜트ᅳ冲료ᅳ에ᅳ해당하든— 르 ¥¥^τΓ 쉬 자료구조에서 차례로 할당받은 버킷에 삽입하는 단계; 및 현재의 로직 오퍼레이터 종류가 AND인 경 우 상기 해쉬 자료구조에서 상기 단계에서 삽입된 버킷들 또는 이전 연산의 결 과값으로 선정된 버킷들 중에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드 들과 일치하는 버킷들만의 결과값으로 선정하고, OR인 경우 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드들 중에서 상기 해쉬 자료구조에서 검색되지 않는 해쉬 노드들에 대하여 상기 해쉬 자료구조에서 버킷을 차례로 할당받아 삽입하 여 상기 해쉬 자료구조 내의 유효한 모든 버킷들을 결과값으로 선정하는 단계; 를 포함하여 이루어진다.
또, 상기의 목적들을 달성하기 위하여, 본 발명에 의한 컴퓨터가 읽을 수 있는 기록매체는, 입력값으로 해쉬 ID가 사용되는 연산으로 이루어진 해쉬 함수와, 해쉬키에 대웅하는 버킷의 시작 위치를 지정하는 해쉬 노드들의 리스트 집합인 해쉬 테이블과, 해쉬 ID와 해쉬 체인용 포인터를 버킷의 구성요 소로 하는 버킷 블록을 구비하는 해쉬 자료구조; 및 로직 오퍼레이터 종류에 따라 로직 상태를 달리하는 해쉬 자료구조를 현재의 로직 오퍼레이터에 대웅하 여 생성하여 메모리를 할당하고 초기화하는 StartUp모들과, 첫 번째 오퍼랜드 자료에 해당하는 해쉬 노드를 상기 해쉬 자료구조에서 할당받은 버킷에 삽입하 는 Insert 모들과, 현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자 료구조에서 상기 Insert 모들에서 삽입된 버킷들 또는 이전 연산의 결과값으로 선정된 버킷들 증에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드와 일치하 는 버킷을 결과값으로 선정하고, 이인 경우 두 번째 오퍼랜드 자료에 해당하 는 해쉬 노드가 상기 해쉬 자료구조에서 검색되지 않으면 상기 해쉬 자료구조 에서 할당받은 버킷에 삽입하는 Logic모들을 구비하는 해쉬를 이용한 전문 기 반 논리 연산 수행을 위한 사용자 인터페이스;를 기록한 것을 특징으로 한다. 【도면의 간단한 설명】
도 1은 본 발명에 의한 해쉬를 이용한 전문 기반 논리 연산 수행 방법 에서 사용하는 해쉬 자료구조를 도시한 것이고,
도 2는 본 발명에 사용되는 사용자 인터페이스 증 StartUp모들의 수행 동작을 나타낸 도면이고,
도 3은 본 발명에 사용되는 사용자 인터페이스 중 CleanUp 모들의 수 행 동작을 나타낸 도면이고,
도 4는 본 발명에 사용되는 사용자 인터페이스 증 Insert 모들의 수행 동작을 나타낸 도면이고,
도 5는 본 발명에 사용되는 사용자 인터페이스 중 Logic 모들의 수행 동작을 나타낸 도면이고,
도 6은 본 발명에 사용되는 사용자 인터페이스 중 ChangeLogic 모들의 수행 동작을 나타낸 도면이고,
도 7은 본 발명에 사용되는 사용자 인터페이스 중 Size 모들의 수행 동 작을 나타낸 도면이고,
도 8은 본 발명에 사용되는 사용자 인터페이스 증 Next모들의 수행 동 작을 나타낸 도면이고,
도 9A 내지 도 9C는 본 발명에 따른 예시를 위한 테이블 및 각 색인을 나타낸 것이고,
도 10A 내지 도 14E는 본 발명에 따른 각 예시의 삽입 연산, 로직 연 산, 검색 결과를 각각 설명하는 도면이다.
[실시예]
이하에서는 첨부도면을 참조하여 본 발명에 대해 상세히 설명한다.
본 발명에 의한 해쉬를 이용한 전문 기반 논리 연산 수행 방법에서 사 용하는 해쉬 자료구조를 도 1을 참조하여 설명하기로 한다.
본 발명에서 사용되는 해쉬 자료구조에는 해쉬 함수 (도시되지 않음), 해 쉬 테이블 (10), 버킷 블록 (20), 커서 (40), AND 카운터 (50), OR 카운터 (51) 등이 포함될 수 있다.
해쉬 함수는 해쉬 ID를 입력으로 하여 해쉬키를 생성하는 함수로, MOD 연산으로 이루어짐이 바람직하다. 또한, 전문 (Full-Text) 데이터베이스의 레코 드 식별자 (ID)가 해쉬 ID로 사용된다.
해쉬 테이블 (10)은 해쉬키에 대웅하는 버킷 (30)의 시작 위치를 지정하는 해쉬 노드들의 리스트 집합이다. 해쉬 테이블 (10)의 크기는 사용자에 의해 입 력되는 PreCount를 이용하여 결정되는데, 버킷 (30)의 고른 분포를 위하여 버킷 블록 (20)의 크기보다 약간 큰 소수 (a prime number)로 정하여짐이 바람직하다. 버킷 (30)은 해쉬에 삽입되는 자료구조로서, 해쉬 충돌시 해당 버킷을 검 색할 수 있도록 해쉬 ID와 해쉬 체인 (32)용 포인터를 포함된다. 버킷 (30)에는 로직 연산의 결과값을 결정하기 위한 카운터와 사용자가 해쉬 노드에 입력하는 데이터 (사용자 데이테, 사용자 데이터 2등)가 포함될 수 있다.
버킷 블록 (20)은 해쉬에 삽입될 버킷 (30)의 예상 개수인 PreCount를 이 용하여 미리 생성되는 메모리 버퍼이다.
커서 (40)는 버킷 볼록 (20)에서 버킷 (30)의 위치를 지정한 것으로, 로직 연산의 결과를 외부에서 용이하게 획득할 수 있도록 지원하기 위한 것이다.
AND 카운터 (50)는 AND 로직 연산의 결과값의 개수를 카운트하기 위 한 것이고, 이 I 카운터 (51)는 이 로직 연산의 결과값의 개수를 카운트하기 위 한 것이다.
본 발명에서는 메모리 관리자 (60)라는 모들을 설정하여, 해쉬 내에서 사 용하는 메모리를 관리하며, 특히 버킷 블록 (20)의 자동추가 기능 및 현재의 버 킷이 삽입될 위치 정보를 관리하도록 한다. 메모리 관리자 (60)는 일정 범위별 로 버킷 블록의 크기를 미리 정해두고, 사용자로부터 입력받는 PreCount 값이 어떤 범위에 속하는가에 따라 대웅하는 값을 생성하고자 하는 버킷 블록의 크 기로 결정한다. 여기서 버킷 블록의 크기는 메모리 관리를 용이하게 하기 위 하여 2V (여기서, n은 정수) 값으로 결정되는 것이 바람직하다. 사용자에 의해 입력되는 PreCount는 해쉬 체인 (32) 내에 버킷이 2~3개가 되도록 정해지는 것 이 바람직한데, 색인을 통해 로직 연산의 첫 번째 오퍼랜드 자료에 해당하는 집합에서의 해쉬 노드의 개수를 사용하면 효과적이다.
버킷 블록의 크기보다 실제로 삽입되는 버킷의 개수가 많을 경우, 메모 리 관리자 (60)는 자동으로 새로운 버킷 블록 (20)을 생성한다. 따라서, 종래의 해쉬 자료구조에 의하면 해쉬 충돌시 버킷을 매번 새롭게 메모리 공간을 할당 받아 생성하여 연결 리스트 형태로 구성하여야 하지만, 본 발명에 의하면 버킷 블록 (20) 내에 이미 생성된 버킷 (30)들 증에서 차례로 할당받아 연결 리스트 형 태로 구성하여 사용할 수 있다. 본 발명에서 사용되는 사용자 인터페이스에는 StertUp, CleanUp, Insert, Logic, ChangeLogic, Size, Next가 포함된다.
(1) Startup모들
도 2에 도시된 바와 같이 StartUp모들은 해쉬를 사용하기 위해서 초기 화 및 자원 할당을 수행한다.
입력값은 로직 오퍼레이터, 오퍼레이터 개수, 예상 버킷 개수 (PreCount) 로 구성된다.
로직 오퍼레이터는 AND또는
오퍼레이터 개수는 AND 또는 OR 로직 오퍼레이터가 연속적으로 나타 나는 개수이다. 예를들어, 집합 A, B, C에 대해서 "A AND B AND C"라는 논리 연산이 있을 경우 오퍼레이터 개수는 2가 된다.
예상 버킷 개수 (PreCount)는 해쉬 테이블 및 버킷 블력의 크기를 결정 하는데 중요한 입력값으로 사용된다.
Startup모들이 수행하는 동작은 다음과 같다.
논리 연산 Hash가 가지는 모든 멤버 변수를 초기화한다 (S100).
사용자가 입력한 값 (PreCount)을 이용하여 버킷 블록 및 해쉬 테이불의 크기를 결정한다 (S110). 메모리 관리자 (60)는 일정 범위별로 버킷 블록의 크기 를 미리 정해두고, PreCount 값이 어떤 범위에 속하는가에 따라 대웅하는 값을 버킷 블록의 크기로 결정한다. 여기서 버킷 블록의 크기는 메모리 관리를 용 이하게 하기 위하여 2V (여기서, n은 정수) 값으로 결정되는 것이 바람직하다. 또한, 해쉬 테이블의 크기는 버킷 블록의 크기보다 약간 큰 소수로 정하여진 다.
결정된 해쉬 테이블의 크기를 이용하여 해쉬 테이블 (10)에 메모리를 할 당하고 초기화한다 (S120).
이후, 입력된 로직 오퍼레이터의 종류 (AND또는 OR)에 따라 로직 상태 를 달리하는 해쉬 자료구조를 생성한다 (S130, S140). 즉, 버킷의 종류는 AND 로직용 (30a)과 OR 로직용 (30b)으로 구분되어 있으며, AND 로직용 버킷 (30a)에 는 추가적으로 카운터가 포함되어 있다. 이 카운터는 AND 로직연산 시 사용 된다. AND 로직 상태의 해쉬 자료구조에서는 AND 로직 연산만이 가능하고, OR 로직 상태의 해쉬 자료구조에서는 이 로직 연산만이 가능하지만, 로직 오 퍼레이터의 종류가 다른 것으로 바뀌게 되면 아래에서 설명하게 되는 ChangeLogic 모들에 의해 해쉬 자료구조의 로직 상태를 변경할 수 있다.
(2) CleanUp모들
도 3에 도시된 바와 같이 CleanUp 모들은 모든 로직 연산을 마치고 해 쉬 내 자원을 해제하는 기능을 수행한다.
입력값은 없다.
CleanUp모들이 수행하는 동작은 다음과 같다.
버킷 블록 (20)의 메모리를 반환하고 (S200), 해쉬 테이블 (10)의 메모리를 반환하고 (S210), 모든 멤버 변수를 초기화한다 (S220).
(3) Insert모들
도 4에 도시된 바와 같이, Insert 모들은 초기화된 해쉬 자료구조에 로 직 연산을 수행하기 위해서 첫 번째 오퍼랜드 자료를 삽입한다. 만약 집합 A 와 B에 대하여 "A AND B"와 같은 연산이 있을 때, 집합 A의 원소들 중 하 나를 해쉬에 삽입하는 기능을 수행한다.
입력값은 해쉬 노드로서 입력할 사용자 데이터 자료이다.
해쉬노드 (데이터자료) : 해쉬 함수에 사용될 해쉬 ID와 기타 사용자가 입력 _한_자료 등으로 ϋ€다.ᅳ
Insert모들이 수행하는 동작은 다음과 같다.
먼저 해쉬 내에 입력할 자료가 이미 존재하는지 검색을 수행한다 (S300). 즉, 해쉬 내에 입력된 해쉬 노드의 해쉬 ID와 동일한 해쉬 ID를 갖는 버킷이 존재하는지를 검색한다.
만약, 검색 결과 이미 존재하면 아무것도 수행하지 않는다.
만약, 검색 결과 존재하지 않으면, 메모리 관리자 (60)로부터 하나의 버킷 을 할당받고 (S310), 해쉬 함수를 이용하여 해쉬키를 생성한 후 (S320), 해쉬키에 해당하는 해쉬 체인에 할당받은 버킷을 연결하고 (S330), 입력 자료를 기록한다 (S340).
OR카운터를 증가시킨다 (S350). (4) Logic모들
도 5에 도시된 바와 같이, Logic 모들은 로직 오퍼레이터 뒤에 나오는 오퍼랜드를 입력하여 로직 연산을 수행한다. 만약 집합 A와 B에 대하여 "A AND B"와 같은 연산이 있을 때, 집합 B의 원소들 증 하나에 대하여 해쉬에 AND 연산 기능을 수행하고, 만약 집합 A와 B에 대하여 "A OR B"와 같은 연산이 있을 때, 집합 B의 원소들 중 하나에 대하여 해쉬에 이 ¾ 연산 기능을 수행한다.
입력값은 오페레이터 번호와 해쉬노드 (데이터자료) 로 구성된다.
오퍼레이터 번호 : 연속적인 동일한 로직 연산에서 몇 번째 로직 오퍼레 이터인지를 의미하는 값이다. 예를들어 "A AND B AND C AND D"라는 로 직 연산이 있을때 오퍼레이터 개수는 3이며, 첫 번째 로직 연산 (A AND B) 시 의 오퍼레이터 번호는 1이며, 두 번째 로직 연산 ((첫 반째 로직 연산 결과) AND C) 시의 오퍼레이터 번호는 2이며, 세 번째 로직 연산 ((두 번째 로직 연 산 결과) AND D) 시의 오퍼레이터 번호는 3이 된다.
해쉬노드 (데이터자료) : 해쉬 함수에 사용될 해쉬 ID와 기타 사용자가 입력한 자료 둥으로 구성된다.
Logic 모들에서는 현재의 로직 오퍼레이터 종류가 AND인 경우 해쉬 자료구조에서 Insert 모들에서 삽입된 버킷들 또는 이전 연산의 결과값으로 선 정된 버킷들 중에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드와 일치하는 버킷을 결과값으로 선정한다. 반면에, OR인 경우 두 번째 오퍼랜드 자료에 해 당하는 해쉬 노드가 해쉬 자료구조에서 검색되지 않으면 해쉬 자료구조에서 할 당받은 버킷에 삽입하는 동작올 수행한다. 구체적인 동작은 다음과 같다.
먼저 해쉬 내에 입력할 자료가 이미 존재하는지 검색을 수행한다 (S400). 즉, 해쉬 내에 입력된 해쉬 노드의 해쉬 ID와 동일한 해쉬 ID를 갖는 버킷이 존재하는지를 검색한다.
S400 단계의 검색 결과가 이미 존재하면 현재의 로직 오퍼레이터가 AND인지 OR인지를 확인한다 (S410). 현재의 로직 오퍼레이터는 StartUp모들 에서 입력받은 로직 오퍼레이터로 설정되었다가, ChangeLogic 모들이 수행되 면 새로이 입력받은 로직 오퍼레이터로 변경된다.
만약 검색 결과가 이미 존재하고, 현재의 로직 오퍼레이터가 OR이면, 아무것도 수행하지 않는다.
만약 검색 결과가 이미 존재하고, 현재의 로직 오퍼레이터가 AND이면, 검색된 버킷의 카운터가 입력받은 오퍼레이터 번호에서 1을 뺀 값과 같^ U一운
—(―이—전ᅳ연산까지—— ©ᅳ로쩍의ᅳ결 되 ^})_(¾ϋΓ^ Γ^≤ 카운트 를 1 증가시키고 (현재 연산의 결과값) (S430), 검색된 버킷의 증가된 카운터가 StartUp모들 또는 ChangeLogic 모들에서 입력받은 오퍼레이터 개수와 일치하 면 (AND 연산의 최종 결과값) (S440) AND 카운터를 1 증가시킨다 (S450). 이에 비하여, 검색된 버킷의 카운터가 입력받은 오퍼레이터 번호에서 1을 뺀 값과 다르거나, 검색된 버킷의 증가된 카운터가 Startup모들 또는 ChangeLogic 모 들에서 입력받은 오퍼레이터 개수와 다른 경우에는 아무것도 수행하지 않는다.
S400 단계의 검색 결과가 존재하지 않으면 현재의 로직 오퍼레이터가 AND인지 이 ¾인지를 확인한다 (S460X
만약 검색 결과가 존재하지 않고, 현재의 로직 오퍼레이터가 AND이면, 아무것도 수행하지 않는다.
만약 검색 결과가 존재하지 않고, 현재의 로직 오퍼레이터가 OR이면, 메모리 관리자 (60)로부터 하나의 버킷을 할당받고 (S470), 해쉬 함수를 이용하여 해쉬키를 생성한 후 (S480), 해쉬키에 해당하는 해쉬 체인에 할당받은 버킷을 연결하고 (S490), 입력 자료를 기록한 후 (S500), OR카운터를 증가시킨다 (S510).
(5) ChangeLogic모들
ChangeLogic 모들은 로직 오퍼레이터가 변화될 때 사용하며, 해쉬 내부 의 로직 상태를 변경시키는 기능을 수행한다. 만약 집합 A, B, C에 대해서 "(A AND B) OR C' '와 같은 연산이 있을 때, AND 로직 연산 후 해쉬의 로직 상태를 AND에서 이로 변경하는 기능을 수행한다.
입력값은 로직 오퍼레이터, 오퍼레이터 개수로 구성된다.
로직 오퍼레이터 : AND 또는 이
오퍼레아터 개수 : AND 또는 이 오퍼레이터가 연속적으로 나타나는 개수
ChangeLogic 보들 증 AND에서 이로 변경하는 동작은 도 6에 도시된 바와 같다.
먼저 입력값인 로직 오퍼레이터, 오퍼레이터 개수와 현재의 해쉬 자료구 조에 설정되어 있는 예상 버킷 개수 ((PreCount)를 사용하여 내부적으로 새로운 해쉬 자료구조를 생성한다. 이 경우, 상기한 Startup모들이 이용된다.
이후, 아래에서 설명할 Next 모들을 이용하여 현재의 해쉬 자료구조에 서 결과값만을 획득하여 새로운 해쉬 자료구조에 삽입하고, 현재의 해쉬 자료 구조에 있는 멤버 변수들을 새로운 해쉬 자료구조의 멤버 변수에 매핑시킨다. 이후, 현재의 해쉬 자료구조에 대하여 CleanUp모들을 이용하여 메모리 자원을 해체시킨다.
이후, 내부적으로 생성한 새로운 해쉬 자료구조의 멤버 변수 및 포인터 등을 현재의 해쉬 자료구조에 매핑시키고, 내부적으로 생성한 새로운 해쉬 자 료구조의 객체 자료만을 소멸시킨다. 이 경우, 새로운 해쉬 자료구조를 CleanUp 하지는 않는다.
ChangeLogic 모들의 구현을 위해서는, 해쉬 내부의 멤버들 증 사용자의 입력 데이터를 저장하는 버퍼 (해쉬 테이블, 버킷 블력)는 반드시 포인터를 사용 하여 Heap으로부터 할당받아야 하며, 이로써 현재 해쉬 자료구조의 로직 상태 를 새로운 로직 상태로 변경하는 것이 가능하다.
이상과 같은 동작에 의해 로직 오퍼레이터가 AND에서 이로 변경될 때, 해쉬 자료구조에 할당되는 메모리 L^ lt^표ᅳ줄ᅩ일ᅳ ^있 ^-. - 한편 rCEn^Eoi ^ ^^OR에서 AND로 변경하는 과정에서는 할당 되는 메모리가 줄어들지 않기 때문에, 단순히 현재의 해쉬 자료구조의 로직 상 태를 변경시켜준다. 이때, 현재의 해쉬 자료구조의 버킷은 AND 로직용 버킷 (30a)으로 변경된다.
(6) Size모들
도 7을 참조하면, Size 모들은 로직연산의 결과 갯수를 사용자에게 반환 하는 기능을 수행한다.
입력값은 없다.
현재의 로직 오퍼레이터가 AND인지 OR인지를 확인하여 (S700), 해쉬 자료구조의 로직 상태가 AND 로직 상태이면 AND 카운터 값을 반환하고 (S710), 해쉬 자료구조의 로직 상태가 로직 상태이면 OR카운터 값을 반환 한다 (S720).
(7) Next모들
도 8을 참조하면, Next 모들은 로직 연산 후 로직 연산의 결과를 사용 자에게 반환하는 기능을 수행한다.
입력값은 없다.
Next모들의 경우, 현재의 로직 오퍼레이터 종류가 AND인 경우 (현재의 해쉬 자료구조가 AND 로직 연산을 수행한 후인 경우) 해쉬 자료구조에서 버 킷의 카운터가 AND 로직 오퍼레이터의 개수와 동일한 버킷만을 찾아 최종 결 과값으로 하여 커서가 위치한 버킷 내의 사용자 자료를 하나씩 출력하고, OR 인 경우 (현재의 해쉬 자료구조가 OR 로직 연산을 수행한 후인 경우) 해쉬 자 료구조 내의 유효한 모든 버킷들을 최종 결과값으로 하여 커서가 위치한 버킷 내의 사용자 자료를 하나씩 출력한다. 구체적인 동작은 다음과 같다.
현재의 로직 오퍼레이터가 AND인지 OR인지를 확인하여 (S800), 해쉬 자료구조의 로직 상태가 AND 로직 상태이면 커서를 1 증가시키고, 커서의 위 치에서 버킷을 획득한다 (S810).
획득된 버킷이 유효하지 않을 경우, 해쉬 자료구조 내 모든 버킷 블력 을 순회한 것이므로 사용자에게 'No Data'를 반환하게 된다 (S820).
획득된 버킷이 유효한 경우, 버킷 내에 있는 카운터 값과 오퍼레이터 개 수를 비교하여 같은 경우 버킷 내의 사용자 자료를 반환하고 (S830), 같지 않은 경우 S810단계로 다시 돌아간다.
해쉬 자료구조의 로직 상태가 OR 로직 상태이면 커서를 1 증가시키고, 커서의 위치에서 버킷을 획득한다 (S840).
획득된 버킷이 유효한 경우 버킷 내의 사용자 자료를 반환하고 (S850), 유효하지 않을 경우 해쉬 자료구조 내 모든 버킷 블럭을 순회한 것이므로 사용 자에게 'No Data'를 반환하게 된다. 이하에서, 본 발명에 의한 해쉬를 이용한 전문 기반 논리 연산 수행 과 정을 예를 들어 설명하기로 한다. 도 9A에 도시된 "테이불 A"에 대한 "명칭 B + 색인" 및 "지역 B + 색인" 이 각각 도 9B 및 도 9C에 도시된 바와 같다고 가정한다.
^_υ_명—칭 에— ^^여—」—현—대 ^자동—차'' ᅳ포함하는一^
하라.
검색 질의를 논리식으로 표현하면 다음과 같다. 명칭 ("현대" AND "자동차")
먼저, 도 10A에 도시된 바와 같이, "현대" 키워드로 색인에서 검색하여 해쉬에 삽입 연산을 수행한다.
다음, 도 10B에 도시된 바와 같이, "자동차" 키워드로 색인에서 검색하 여 해쉬에 AND로직 연산을 수행한다.
그러면, 검색 결과는 도 10C에 도시된 바와 같다.
예제 1에 대한 프로그램 코드는 다음과 같이 기술될 수 있다.
LogicHash hash; //해쉬 객체
hash.StartUp( LOGIC_AND, 1, 100 ); //로직 오퍼레이터, 오퍼레이터 개수, 예상 버킷 개수
hash.Insert( {1 사용자데이터 } ); //삽입 연산
hash.Insert( {2사용자데이터 } );
hash.Insert( {4사용자데이터 } );
hash.Logic( 1, {1 사용자데이터 } ); //AND로직 연산
hash.Logic( 1, {4사용자데이터 } );
hash.Logic( 1, {5사용자데이터 } );
int size = hash.SizeO; //결과 개수 획득
forint i=0; Ksize; i++) { //검색 결과 확인
{버킷 } = hash.NextO;
}
hash.CleanUpO; //해쉬 자원 해제
(예제 2) "명칭''에 대하여 "현대" 또는 "자동차"를 포함하는 레코드를 검색하라.
검색 질의를 논리식으로 표현하면 다음과 같다.
명칭 ("현대" OR "자동차")
먼저, 도 11A에 도시된 바와 같이, "현대" 키워드로 색인에서 검색하여 해쉬에 삽입 연산을 수행한다.
다음, 도 11B에 도시된 바와 같이, "자동차" 키워드로 색인에서 검색하 여 해쉬에 이 로직 연산을 수행한다.
그러면, 검색 결과는 도 11C에 도시된 바와 같다.
예제 2에 대한 프로그램 코드는 다음과 같이 기술될 수 있다.
LogicHash hash; //해쉬 객체
hash.StartUp( LOGIC_OR, 1, 100 ); //로직 오퍼레이터, 오퍼레이터 개 수, 예상 버킷 개수
hash.Insert( {1 사용자데이터 } ); //삽입 연산
hash.Insert( {2사용자데이터 } );
hash.Insert( {4사용자데이터 } );
hash.Logic( 1, {1 사용자데이터 } ); //OR로직 연산
hash.Logic( 1, {4사용자데이터 } );
hash.Logic( 1, {5사용자데이터 } );
int size二 hash.SizeO; //결과 개수 획득
ΘΓ (½t- 0H<size;寸+一 ᅳ //검―색ᅳ결^一확
{버킷 } = hash.NextO;
} hash.CleanUpO; //해쉬 자원 해제
(예제 3) "명칭 "에 대하여 "현대 "를 포함하고, "지역' '이 "서을''인 레코드 를 검색하라.
검색 질의를 논리식으로 표현하면 다음과 같다.
명칭 ("현대 ") AND지역 ("서을")
먼저, 도 12A에 도시된 바와 같이, "현대'' 키워드로 색인에서 검색하여 해쉬에 삽입 연산을 수행한다.
다음, 도 12B에 도시된 바와 같이, "서울" 키워드로 색인에서 검색하여 해쉬에 AND로직 연산을 수행한다.
그러면, 검색 결과는 도 12C에 도시된 바와 같다.
예제 3에 대한 프로그램 코드는 다음과 같이 기술될 수 있다.
LogicHash hash; //해쉬 객체
hash.StartUp( LOGIC_AND, 1 100 ); //로직 오퍼레이터, 오퍼레이터 개수, 예상 버킷 개수
hash.Insert( {1 사용자데이터 } ); //삽입 연산
hash.Insert( {2사용자데이터 } );
hash.Insert( {4사용자데이터 } );
hash.Logic( 1, {1 사용자데이터 } ); //AND로직 연산
hash.Logic( 1 {2사용자데이터 } );
int size = hash.SizeO; //결과 개수 획득
for(int i=0; Ksize; i++) { //검색 결과 확인
{버켓 } = hash.NextO;
}
hash.CleanUpO; //해쉬 자원 해제
(예제 4) "명칭 "에 대하여 "현대 "와 "자동차' '와 "세차장"을 포함하는 레 코드를 검색하라.
검색 질의를 논리식으로 표현하면 다음과 같다.
명칭 ("현대" AND "자동차" AND "세차장 ")
먼저, 도 13A에 도시된 바와 같이, "현대'' 키워드로 색인에서 검색하여 해쉬에 삽입 연산을 수행한다.
다음, 도 13B에 도시된 바와 같이, "자동차" 키워드로 색인에서 검색하 여 해쉬에 1차 AND 로직 연산을 수행한다.
다음, 도 13C에 도시된 바와 같이, ' '세차장" 키워드로 색인에서 검색하 여 해쉬에 2차 AND로직 연산을 수행한다.
그러면, 검색 결과는 도 13D에 도시된 바와 같다.
예제 4에 대한 프로그램 코드는 다음과 같이 기술될 수 있다.
LogicHash hash; //해쉬 객체
hash.StartUp( LOGIC_AND, 2, 100 ); //로직 오퍼레이터, 오퍼레이터 개수, 예상 버킷 개수
hash.Insert( {1사용자데이터 } ); //삽입 연산
hasMnsert(-f2— ^ ^ l— 터 Γ
hash.Insert( {4사용자데이터 } );
hash.Logic( 1, {1 사용자데이터 } ); //1차 AND 로직 연산 hash.Logic( 1, {4사용자데이터 } );
hash.Logic( 1, {5사용자데이터 } );
hash.Logic( 2, {4사용자데이터 } ); //2차 AND 로직 연산
int size = hash.SizeO; //결과 개수 획득
for(int i=0; Ksize; i++) { //검색 결과 확인
{버킷 } 二 hash.NextO;
}
hash.CleanUpO; //해쉬 자원 해제
(예제 5) "명칭' '에 대하여 "현대'' 또는 "천국 "을 포함하고, "지역 "이 "대 전' '인 레코드를 검색하라.
검색 질의를 논리식으로 표현하면 다음과 같다.
명칭 ("현대' OR "천국") AND지역 ("대전")
먼저, 도 14A에 도시된 바와 같이, "현대" 키워드로 색인에서 검색하여 해쉬에 삽입 연산을 수행한다.
다음, 도 14B에 도시된 바와 같이, "천국" 키워드로 색인에서 검색하여 해쉬에 이 로직 연산을 수행한다.
다음, 도 14C에 도시된 바와 같이, 로직 오퍼레이터가 OR에서 AND로 변경되므로 해쉬 자료구조에 로직 상태를 변경한다.
다음, 도 14D에 도시된 바와 같이, "대전" 키워드로 색인에서 검색하여 해쉬에 AND 로직 연산을 수행한다.
그러면, 검색 결과는 도 14E에 도시된 바와 같다.
예제 5에 대한 프로그램 코드는 다음과 같이 기술될 수 있다.
LogicHash hash; //해쉬 객체
hash.StartUp( LOGIC_OR, 1, 100 ); //로직 오퍼레이터, 오퍼레이터 개 수, 예상 버킷 개수
hash.Insert( {1 사용자데이터 } ); //삽입 연산
hash.Insert( {2사용자데이터 } );
hash.Insert( {4사용자데이터 } );
hash.Logic( 1, {3사용자데이터 } ); //OR로직 연산
hash.ChangeLogic( LOGIC_AND, 1 ); //해쉬 자료구조의 로직 상태 변경
hash.Logic( 1, {3사용자데이터 } ); //AND 로직 연산
hash.Logic( 1, {4사용자데이터 } );
int size = hash.SizeO; //결과 개수 획득
for(int i=0; Ksize; i++) { //검색 결과 확인
{버켓 } = hash.NextO;
}
hash.CleanUpO; //해쉬 자원 해제 한편, 상술한 본 발명의 실시예는 개인용 컴퓨터를 포함한 범용 컴퓨터 에서 사용되는 매체에 기록될 수 있다. 상기 매체는 마그네틱 기록매처 1(^1^ 들-면 름,—플 —터—스크 7—하^—뎌玄크ᅳ등 )7광학적ᅳ판— ^¾ΡΓ (可 ^ T¥, 디브이디 등), 전기적 기록매체 (예를 들면, 플레쉬 메모리, 메모리 스틱 등) 및 캐리어 웨이브 (예를 들면, 인터넷을 통한 전송)와 같은 기록매체를 포함한다. 【산업상이용가능성】
이상 설명한 바와 같이 본 발명에 따르면, 해쉬를 이용하여 전체적인 리 소스를 줄임으로써 제한된 시스템 자원을 효과적으로 활용할 수 있고, 메모리 단편화를 억제하여 가용한 시스템 자원을 증가시킬 수 있으며, 따라서 원할한 서비스의 제공이 가능하며 성능상의 이득도 확보할 수 있다.
특히, 메모리 컴팩션 기능이 일반 PC 보다 단순한 모바일 단말기상에서 는 그 기대 효과가 더욱 크다.

Claims

【청구의범위】
【청구항 1】
(a) 로직 오퍼레이터 종류에 따라 로직 상태를 달리하는 해쉬 자료구조 를 현재의 로직 오퍼레이터에 대웅하여 생성하는 단계;
(b) 첫 번째 오퍼랜드 자료에 해당하는 해쉬 노드들을 상기 해쉬 자료 구조에서 차례로 할당받은 버킷에 삽입하는 단계; 및
(c) 현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자료구조에 서 상기 (b) 단계에서 삽입된 버킷들 또는 이전 연산의 결과값으로 선정된 버 킷들 중에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드들과 일치하는 버킷 들만의 결과값으로 선정하고, 이인 경우 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드들 중에서 상기 해쉬 자료구조에서 검색되지 않는 해쉬 노드들에 대 하여 상기 해쉬 자료구조에서 버킷을 차례로 할당받아 삽입하여 상기 해쉬 자 료구조 내의 유효한 모든 버킷들을 결과값으로 선정하는 단계;를 포함함을 특 징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 2】
제 1항에 있어서,
(d) 현재의 로직 오퍼레이터가 상기 해쉬 자료구조의 로직 상태와 다른 경우, 현재의 로직 오퍼레이터에 대웅하여 상기 해쉬 자료구조의 로직 상태를 변경하는 단계;를 더 포함함을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 3】
제 1항에 있어서, 상기 해쉬 자료구조는
입력값으로 해쉬 ID가 사용되는 MOD 연산으로 이루어진 해쉬 함수와, 해쉬키에 대웅하는 버킷의 시작 위치를 지정하는 해쉬 노드들의 리스트 집합인 해쉬 테이블과,
해쉬 ID와 해쉬 체인용 포인터를 버킷의 구성요소로 하는 버킷 블록을 구비하는 것을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 4】
제 3항에 있어서, 로직 상태가 AND인 해쉬 자료구조의 버킷은
로직 연산의 결과값을 결정하기 위한 카운터를 더 구비하는 것을 특징 으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 5】
저 13항에 있어서, 상기 (b) 단계 또는 상기 (c) 단계에서의 버킷의 할당 미리 설정된 버킷 블록 내의 버킷들 중 사용되지 않은 버킷을 순서대로 할당받되, 버킷 블록 내에 사용되지 않은 버킷이 존재하지 않은 경우 새로운 버킷 블록을 생성한 후 생성된 새로운 버킷 블록 내의 사용되지 않은 버킷을 할당받는 것을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 6】
제 3항에 있어서, 상기 버킷 블록의 크기는
상기 (a) 단계에서 으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 7】
제 6항에 있어서, 상기 해쉬 테이블의 크기는
상기 버킷 블록의 크기보다 큰 솟수 증 하나로 정해짐을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
[청구항 8】
제 3항에 있어서, 상기 해쉬 자료구조는
AND로직 연산의 결과값의 개수를 카운트하는 AND카운터와,
OR 로직 연산의 결과값의 개수를 카운트하는 OR 카운터를 더 구비함 을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 9】
제 2항에 있어서, 상기 (d) 단계에서
상기 해쉬 자료구조의 로직 상태를 AND에서 이로 변경하는 경우, 새 로운 해쉬 자료구조를 생성하여 기존 해쉬 자료구조의 결과값에 해당하는 버킷 들을 새로운 해쉬 자료구조에 삽입하고, 기존의 해쉬 자료구조의 모든 자원을 해제하고, 새로운 해쉬 자료구조를 기존의 해쉬 자료구조에 매핑하는 것임을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 10】
제 4항에 있어서,
(e) 현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자료구조에 서 버킷의 카운터가 AND 로직 오퍼레이터의 개수와 동일한 버킷만을 최종 결 과값으로 출력하고, OR인 경우 상기 해쉬 자료구조 내의 유효한 모든 버킷들 을 최종 결과값으로 출력하는 단계;를 포함함을 특징으로 하는 해쉬를 이용한 전문 기반 논리 연산 수행 방법.
【청구항 11】
입력값으로 해쉬 ID가 사용되는 연산으로 이루어진 해쉬 함수와, 해쉬키에 대웅하는 버킷의 시작 위치를 지정하는 해쉬 노드들의 리스트 집합인 해쉬 테이불과,
해쉬 ID와 해쉬 체인용 포인터를 버킷의 구성요소로 하는 버킷 블록을 구비하는 해쉬 자료구조; 및
로직 오퍼레이터 종류에 따라 로직 상태를 달리하는 해쉬 자료구조를 현재의 로직 오퍼레이터에 대웅하여 생성하여 메모리를 할당하고 초기화하는 StartUp모들과,
첫 번째 오퍼랜드 자료에 해당하는 해쉬 노드를 상기 해쉬 자료구조에 서 할당받은 버킷에 삽입하는 Insert모들과,
현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자료구조에서 상기 Insert 모들에서 삽입된 버킷들 또는 이전 연산의 결과값으로 선정된 버 킷들 중에서 두 번째 오퍼랜드 자료에 해당하는 해쉬 노드와 일치하는 버킷올 결과값으로 선정하고, OR인 경우 두 번째 오퍼랜드 자료에 해당하는 해쉬 노 드가 상기 해쉬 자료구조에서 검색되지 않으면 상기 해쉬 자료구조에서 할당받 은 버킷에 삽입하는 Logic 모들을 구비하는 해쉬를 이용한 전문 기반 논리 연 산 수행을 위한 사용자 인터페이스;를 기록한 컴퓨터가 읽을 수 있는 기록매체.
【청구항 12]
제 11항에 있어서, 상기 사용자 인터페이스는
현재의 로직 오퍼레이터가 상기 해쉬 자료구조의 로직 상태와 다른 경 - , 현재의 로직 오퍼레이터에 대 하여 상기해쉬 자료구조의 로직 상태를 변 는 Changel gic 모들 #~더 ΐ비하는 것을 특징으로 하는 컴퓨터가 읽을 수 있는 기록매체.
【청구항 13】 제 12항에 았어서, 로직 상태가 AND인 해쉬 자료구조의 버킷은 로직 연산의 결과값을 결정하기 위한 카운터를 더 구비하고,
상기 ChangeLogic모들은
상기 해쉬 자료구조의 로직 상태를 AND에서 OR로 변경하는 경우, 새 로운 해쉬 자료구조를 생성하여 기존 해쉬 자료구조의 결과값에 해당하는 버킷 들을 새로운 해쉬 자료구조에 삽입하고, 기존의 해쉬 자료구조의 모든 자원을 해제하고, 새로운 해쉬 자료구조를 기존의 해쉬 자료구조에 매핑하는 것을 특 징으로 하는 컴퓨터가 읽을 수 있는 기록매체.
【청구항 14】
제 11항에 있어서, 상기 해쉬 자료구조는
AND 로직 연산의 결과값의 개수를 카운트하는 AND카운터와,
OR 로직 연산의 결과값의 개수를 카운트하는 이 카운터를 더 구비하 고,
상기 사용자 인터페이스는
상기 현재의 로직 오퍼레이터 종류에 따라 AND 카운터 또는 카운 터의 값을 출력하는 Size모들을 더 구비하는 것을 특징으로 하는 컴퓨터가 읽 을 수 있는 기록매체.
【청구항 15]
제 11항에 있어서, 상기 사용자 인터페이스는
. 현재의 로직 오퍼레이터 종류가 AND인 경우 상기 해쉬 자료구조에서 버킷의 카운터가 AND 로직 오퍼레이터의 개수와 동일한 버킷만을 찾아 최종 결과값으로 하나씩 출력하고, OR인 경우 상기 해쉬 자료구조 내의 유효한 모 든 버킷들을 최종 결과값으로 하나씩 출력하는 Next모들을 더 구비하는 것을 특징으로 하는 컴퓨터가 읽을 수 있는 기록매체.
PCT/KR2012/008715 2012-10-17 2012-10-23 해쉬를 이용한 전문 기반 논리 연산 수행 방법 WO2014003249A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2015538003A JP6078652B2 (ja) 2012-10-17 2012-10-23 ハッシュを利用した全文基盤データベースでの論理演算遂行方法
CN201280025701.XA CN103874996B (zh) 2012-10-17 2012-10-23 用于利用散列来执行基于全文的逻辑运算的方法
US14/116,834 US9396223B2 (en) 2012-10-17 2012-10-23 Method for performing full-text-based logic operation using hash

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2012-0115454 2012-10-17
KR1020120115454A KR101416586B1 (ko) 2012-10-17 2012-10-17 해쉬를 이용한 전문 기반 논리 연산 수행 방법

Publications (1)

Publication Number Publication Date
WO2014003249A1 true WO2014003249A1 (ko) 2014-01-03

Family

ID=49783366

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2012/008715 WO2014003249A1 (ko) 2012-10-17 2012-10-23 해쉬를 이용한 전문 기반 논리 연산 수행 방법

Country Status (5)

Country Link
US (1) US9396223B2 (ko)
JP (1) JP6078652B2 (ko)
KR (1) KR101416586B1 (ko)
CN (1) CN103874996B (ko)
WO (1) WO2014003249A1 (ko)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9405643B2 (en) * 2013-11-26 2016-08-02 Dropbox, Inc. Multi-level lookup architecture to facilitate failure recovery
US10372695B2 (en) * 2014-12-27 2019-08-06 Intel Corporation Technologies for computing rolling hashes
US10496543B2 (en) * 2016-03-31 2019-12-03 Samsung Electronics Co., Ltd. Virtual bucket multiple hash tables for efficient memory in-line deduplication application
US11698929B2 (en) * 2018-11-30 2023-07-11 Intel Corporation Offload of data lookup operations
CN113297224B (zh) * 2021-05-31 2022-06-28 上海艾麒信息科技股份有限公司 一种基于Redis的海量数据分类存储方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060048778A (ko) * 2004-07-26 2006-05-18 구글, 인코포레이티드 정보 검색 시스템에서의 문구 기반 서치
JP2007328736A (ja) * 2006-06-09 2007-12-20 Mitsubishi Electric Corp リソース検索システム
KR20090108849A (ko) * 2008-04-14 2009-10-19 삼성전자주식회사 파일 저장/검색 장치 및 방법
JP2010050600A (ja) * 2008-08-20 2010-03-04 Fujitsu Ltd 情報検索装置
KR20110077934A (ko) * 2009-12-30 2011-07-07 동국대학교 산학협력단 해싱 기반의 데이터 관리 방법 및 장치

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2973944B2 (ja) * 1996-06-26 1999-11-08 富士ゼロックス株式会社 文書処理装置および文書処理方法
US6681217B1 (en) * 1998-10-27 2004-01-20 Jerzy Lewak Boolean text search combined with extended regular expression search
US6381594B1 (en) * 1999-07-12 2002-04-30 Yahoo! Inc. System and method for personalized information filtering and alert generation
US7076494B1 (en) * 2000-01-21 2006-07-11 International Business Machines Corporation Providing a functional layer for facilitating creation and manipulation of compilations of content
US7043488B1 (en) * 2000-01-21 2006-05-09 International Business Machines Corporation Method and system for storing hierarchical content objects in a data repository
CA2384185A1 (en) * 2002-04-29 2003-10-29 Ibm Canada Limited-Ibm Canada Limitee Resizable cache sensitive hash table
JP2011215835A (ja) * 2010-03-31 2011-10-27 Toshiba Corp 全文検索機能を備えるストレージ装置
US8782435B1 (en) * 2010-07-15 2014-07-15 The Research Foundation For The State University Of New York System and method for validating program execution at run-time using control flow signatures
US8539006B2 (en) * 2010-11-01 2013-09-17 Microsoft Corporation Logical chart of accounts with hashing
JP5524144B2 (ja) * 2011-08-08 2014-06-18 株式会社東芝 key−valueストア方式を有するメモリシステム
WO2013175537A1 (ja) * 2012-05-24 2013-11-28 富士通株式会社 検索プログラム、検索方法、検索装置、記憶プログラム、記憶方法及び記憶装置
US9940359B2 (en) * 2014-05-23 2018-04-10 International Business Machines Corporation Data-partitioned secondary index (DPSI) partition level join

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060048778A (ko) * 2004-07-26 2006-05-18 구글, 인코포레이티드 정보 검색 시스템에서의 문구 기반 서치
JP2007328736A (ja) * 2006-06-09 2007-12-20 Mitsubishi Electric Corp リソース検索システム
KR20090108849A (ko) * 2008-04-14 2009-10-19 삼성전자주식회사 파일 저장/검색 장치 및 방법
JP2010050600A (ja) * 2008-08-20 2010-03-04 Fujitsu Ltd 情報検索装置
KR20110077934A (ko) * 2009-12-30 2011-07-07 동국대학교 산학협력단 해싱 기반의 데이터 관리 방법 및 장치

Also Published As

Publication number Publication date
JP6078652B2 (ja) 2017-02-08
US20150213016A1 (en) 2015-07-30
CN103874996B (zh) 2017-02-08
KR101416586B1 (ko) 2014-07-08
JP2015532498A (ja) 2015-11-09
US9396223B2 (en) 2016-07-19
KR20140049328A (ko) 2014-04-25
CN103874996A (zh) 2014-06-18

Similar Documents

Publication Publication Date Title
Skoutas et al. Ranking and clustering web services using multicriteria dominance relationships
EP1468382B1 (en) Taxonomy generation
CN108376143B (zh) 一种新型的olap预计算系统及生成预计算结果的方法
JP5092165B2 (ja) データ構築方法とシステム
CN102193929B (zh) 利用词信息熵的搜索方法及其设备
WO2014003249A1 (ko) 해쉬를 이용한 전문 기반 논리 연산 수행 방법
JP2011258235A (ja) クリックディスタンスを用いて検索結果をランク付けするシステムおよび方法
US20120016863A1 (en) Enriching metadata of categorized documents for search
Rong et al. A model-free approach to infer the diffusion network from event cascade
CN105956148A (zh) 资源信息的推荐方法和装置
CN105373546A (zh) 一种用于知识服务的信息处理方法及系统
Moya et al. Integrating web feed opinions into a corporate data warehouse
US20090006354A1 (en) System and method for knowledge based search system
SE1051394A1 (sv) A system and method for evaluating a reverse query
CN105354283A (zh) 一种资源的搜索方法和装置
CN114491232B (zh) 信息查询方法、装置、电子设备和存储介质
CN102693295B (zh) 一种基于记录逻辑表示的数据库记录数据查询系统
Li et al. The application of weighted co‐occurring keywords time gram in academic research temporal sequence discovery
CN104361114B (zh) 处理方法、处理装置和电子设备
CN105447020A (zh) 一种确定业务对象关键词的方法及装置
CN114117192A (zh) 一种对象查询方法、装置、服务器和存储介质
Abdullah et al. Tracing significant association rules using critical least association rules model
CN112307272A (zh) 确定对象之间关系信息的方法、装置、计算设备及存储介质
Zhang et al. Discovering top-k patterns with differential privacy-an accurate approach
Kang et al. Soft-constraint based online LDA for community recommendation

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 14116834

Country of ref document: US

Ref document number: 2012876071

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2015538003

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 12876071

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE