KR102279210B1 - Electronic device for determining similarity between sequences considering item classification scheme and control method thereof - Google Patents

Electronic device for determining similarity between sequences considering item classification scheme and control method thereof Download PDF

Info

Publication number
KR102279210B1
KR102279210B1 KR1020190157364A KR20190157364A KR102279210B1 KR 102279210 B1 KR102279210 B1 KR 102279210B1 KR 1020190157364 A KR1020190157364 A KR 1020190157364A KR 20190157364 A KR20190157364 A KR 20190157364A KR 102279210 B1 KR102279210 B1 KR 102279210B1
Authority
KR
South Korea
Prior art keywords
items
similarity
sequences
information
tree
Prior art date
Application number
KR1020190157364A
Other languages
Korean (ko)
Other versions
KR20210067588A (en
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 KR1020190157364A priority Critical patent/KR102279210B1/en
Priority to PCT/KR2020/012648 priority patent/WO2021107360A2/en
Publication of KR20210067588A publication Critical patent/KR20210067588A/en
Application granted granted Critical
Publication of KR102279210B1 publication Critical patent/KR102279210B1/en

Links

Images

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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • 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/2246Trees, e.g. B+trees
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries

Landscapes

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

Abstract

본 발명에 따른 일 실시예는, 순서를 가지는 제1 항목들로 구성된 제1 시퀀스를 획득하는 과정; 순서를 가지는 제2 항목들로 구성된 제2 시퀀스를 획득하는 과정; 및 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단하는 과정을 포함하며, 상기 제1 정보는 상기 제1 항목들 중 하나를 상기 제2 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함하며, 상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법를 제공할 수 있다.An embodiment according to the present invention includes the steps of: obtaining a first sequence consisting of first items having an order; obtaining a second sequence consisting of second items having an order; and determining whether the first and second sequences are similar based on the first information and the second information, wherein the first information converts one of the first items into one of the second items wherein the second information comprises information about the length of a shortest path in the item classification tree between one of the first items and one of the second items. A control method for determining the similarity between sequences in consideration of the item classification system may be provided.

Description

항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법{Electronic device for determining similarity between sequences considering item classification scheme and control method thereof}Electronic device for determining similarity between sequences considering item classification scheme and control method thereof

본 발명은 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법에 관한 것으로, 구체적으로 항목 분류 체계 내의 항목들 간 최단 경로의 거리를 이용하여 항목들을 포함하는 시퀀스들 간 유사도를 판단하는 전자 장치 및 제어 방법에 관한 것이다.The present invention relates to an electronic device for determining the degree of similarity between sequences in consideration of an item classification system and a control method therefor, and more particularly, to determine the similarity between sequences including items by using a distance of a shortest path between items in an item classification system It relates to an electronic device and a control method.

최근 스마트폰의 보급과 소셜 네트워크 서비스의 발전으로 인해 다양한 데이터가 스마트폰 사용자들로부터 데이터스트림의 형태로 끊임없이 실시간으로 생성되는 빅데이터 환경이 도래하였다. 데이터스트림이란 시간의 흐름에 따라 순차적으로 무한하게 생성되는 데이터를 말한다. Due to the recent spread of smartphones and the development of social network services, a big data environment has arrived in which various data are continuously generated in the form of data streams from smartphone users in real time. The data stream refers to data that is sequentially and infinitely generated according to the passage of time.

유사 시퀀스 매칭이란 수많은 데이터 시퀀스(data sequence)들 중에서 사용자에 의해 주어지는 질의 시퀀스 (query sequence)와 유사한 데이터 시퀀스를 검색하는 문제이다. 시퀀스를 구성하는 데이터로 연속성을 가지는 수치 데이터를 사용하여 유사 시퀀스 매칭을 수행할 경우, 비슷한 형태를 가지는 유사한 데이터 시퀀스를 찾을 수 있다.Similar sequence matching is a problem of searching for a data sequence similar to a query sequence given by a user from among numerous data sequences. When similar sequence matching is performed using numerical data having continuity as data constituting a sequence, a similar data sequence having a similar shape can be found.

데이터 시퀀스의 일 예로, 구매 이력 데이터는 고객이 생성하는 대표적인 데이터 중 하나이다. 구매 이력 데이터에는 물건을 구매하는 사람의 특성과 이에 따라 소비되는 제품, 소비 패턴 등이 담겨있다. 다른 고객들의 구매 이력 데이터를 비교하여 유사 여부를 판단함으로써, 새로운 상품 추천 등의 서비스를 할 수 있다. As an example of the data sequence, purchase history data is one of representative data generated by a customer. The purchase history data contains the characteristics of the person purchasing the product, the products consumed, and consumption patterns. By comparing the purchase history data of other customers and determining whether they are similar, a service such as a new product recommendation can be provided.

그러나, 종래의 구매이력 데이터 간 유사 판단 방법은 시퀀스 내의 상품들 간 연관성에 대한 정보를 반영하지 못하여 구매이력 데이터의 유사 판단에 대한 정확성이 떨어지는 문제가 있었다.However, the conventional method for determining similarity between purchase history data does not reflect information on the correlation between products in a sequence, so there is a problem in that accuracy of similarity determination of purchase history data is lowered.

한국 등록특허공보 제10-1937989호 (집합 기반 유사 시퀀스 매칭 장치 및 방법)Korean Patent Publication No. 10-1937989 (Set-based Similar Sequence Matching Apparatus and Method)

본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법은 순서를 가지는 항목들로 구성된 시퀀스들의 유사도를 제공하는 것을 목적으로 한다.An electronic device for determining the degree of similarity between sequences in consideration of an item classification system and a control method therefor according to an embodiment of the present invention aims to provide a degree of similarity between sequences composed of items having an order.

본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법은 상품의 구매이력들의 유사도를 제공하는 것을 목적으로 한다.An electronic device for determining a degree of similarity between sequences in consideration of an item classification system and a control method therefor according to an embodiment of the present invention aims to provide a degree of similarity between purchase histories of products.

본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법은 상품의 구매이력들의 유사도를 제공하기 위하여 상품 분류 트리를 이용하는 것을 목적으로 한다.An electronic device for determining a degree of similarity between sequences in consideration of an item classification system and a control method therefor according to an embodiment of the present invention aims to use a product classification tree to provide a degree of similarity between purchase histories of products.

본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법은 상품의 구매이력들의 유사도를 판단하기 위한 시간을 단축하는 것을 목적으로 한다.An electronic device for determining the degree of similarity between sequences in consideration of an item classification system and a control method therefor according to an embodiment of the present invention aims to shorten a time for determining the degree of similarity between purchase histories of products.

본 발명의 일 실시 예는, 순서를 가지는 제1 항목들로 구성된 제1 시퀀스를 획득하는 과정; 순서를 가지는 제2 항목들로 구성된 제2 시퀀스를 획득하는 과정; 및 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단하는 과정을 포함하며, 상기 제1 정보는 상기 제1 항목들 중 하나를 상기 제2 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함하며, 상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공할 수 있다.According to an embodiment of the present invention, a process of obtaining a first sequence consisting of first items having an order; obtaining a second sequence consisting of second items having an order; and determining whether the first and second sequences are similar based on the first information and the second information, wherein the first information converts one of the first items into one of the second items wherein the second information comprises information about the length of a shortest path in the item classification tree between one of the first items and one of the second items. A control method for determining the similarity between sequences in consideration of the item classification system may be provided.

본 발명의 일 실시 예는, 상기 제1 및 제2 항목들은 동일한 항목 분류 트리의 단말 노드에 해당하는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공할 수 있다.An embodiment of the present invention may provide a control method for determining the degree of similarity between sequences in consideration of an item classification system, characterized in that the first and second items correspond to terminal nodes of the same item classification tree.

본 발명의 일 실시 예는, 상기 제2 정보는 상기 항목 분류 트리 내의 항목들의 최장 경로의 길이에 관한 정보를 더 포함하는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공할 수 있다.In an embodiment of the present invention, the second information further includes information on the length of the longest path of the items in the item classification tree. A control method for determining the similarity between sequences in consideration of the item classification system. can provide

본 발명의 일 실시 예는, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이는 기 저장된 상기 항목 분류 트리의 각 노드에 대한 깊이 정보에 기초하여 결정되는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공할 수 있다.According to an embodiment of the present invention, the length of the shortest path in the item classification tree between one of the first items and one of the second items is based on pre-stored depth information for each node of the item classification tree. It is possible to provide a control method for determining the degree of similarity between sequences in consideration of the item classification system, characterized in that it is determined by

본 발명의 일 실시 예는, 항목 분류 트리에 대한 정보를 저장하는 메모리; 및 상기 메모리를 제어하는 프로세서를 포함하며, 상기 프로세서는, 순서를 가지는 제1 항목들로 구성된 제1 시퀀스를 획득하고, 순서를 가지는 제2 항목들로 구성된 제2 시퀀스를 획득하고, 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단하도록 제어하며, 상기 제1 정보는 상기 제1 항목들 중 하나를 상기 제2 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함하며, 상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치를 제공할 수 있다.An embodiment of the present invention, a memory for storing information about the item classification tree; and a processor for controlling the memory, wherein the processor obtains a first sequence consisting of first items having an order, obtains a second sequence consisting of second items having an order, and the first information and controlling to determine whether the first and second sequences are similar based on second information, wherein the first information is based on the number of operations for converting one of the first items into one of the second items. wherein the second information comprises information about a length of a shortest path in the item classification tree between one of the first items and one of the second items. An electronic device for determining the degree of similarity between each other may be provided.

본 발명의 일 실시 예는, 상기 제1 및 제2 항목들은 동일한 항목 분류 트리의 단말 노드에 해당하는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치를 제공할 수 있다.An embodiment of the present invention may provide an electronic device for determining the degree of similarity between sequences in consideration of an item classification system, wherein the first and second items correspond to terminal nodes of the same item classification tree.

본 발명의 일 실시 예는, 상기 제2 정보는 상기 항목 분류 트리 내의 항목들의 최장 경로의 길이에 관한 정보를 더 포함하는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치를 제공할 수 있다.In an embodiment of the present invention, the second information further includes information on the length of the longest path of the items in the item classification tree. An electronic device for determining the similarity between sequences in consideration of the item classification system. can provide

본 발명의 일 실시 예는, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이는 상기 메모리에 기 저장된 상기 항목 분류 트리의 각 노드에 대한 깊이 정보에 기초하여 결정되는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치를 제공할 수 있다.In one embodiment of the present invention, the length of the shortest path in the item classification tree between one of the first items and one of the second items is a depth for each node of the item classification tree pre-stored in the memory. An electronic device for determining the degree of similarity between sequences in consideration of an item classification system, which is determined based on information, may be provided.

본 발명의 일 실시 예는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공함으로써, 시퀀스들 간 유사여부를 유사 및 비유사와 같이 불연속적인 결과를 제공하는 것이 아니라 정량적인 수치를 제공함으로서 유사도를 제공하는 효과를 가진다.An embodiment of the present invention provides a control method for determining the degree of similarity between sequences in consideration of the item classification system, thereby providing a quantitative numerical value rather than providing discontinuous results such as similarity and dissimilarity for the similarity between sequences. It has the effect of providing similarity.

본 발명의 일 실시 예는, 동일한 항목 분류 체계를 가지는 시퀀스들의 유사 여부를 비교할 수 있는 효과를 가진다.An embodiment of the present invention has an effect of comparing whether sequences having the same item classification system are similar.

본 발명의 일 실시 예는, 기 저장된 상기 항목 분류 트리의 각 노드에 대한 깊이 정보에 기초하여 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공함으로써, 시퀀스들의 유사 판단 시간을 단축할 수 있는 효과를 가진다.An embodiment of the present invention provides a control method for determining the degree of similarity between sequences in consideration of an item classification system based on the previously stored depth information on each node of the item classification tree, thereby reducing the similarity determination time of sequences. have an effect

본 발명의 일 실시 예는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 제공함으로써, 상품 구매이력들의 유사도를 제공하는 효과를 가진다.An embodiment of the present invention has an effect of providing a degree of similarity between product purchase histories by providing a control method for determining a degree of similarity between sequences in consideration of an item classification system.

도 1은 유클리디안 거리와 DTW 거리의 비교를 도시한 것 이다.
도 2(a)는 본 발명에서 사용한 상품 분류 트리 중 일부를 도시한 것이다.
도 2(b)는 본 발명에서 사용한 상품 분류 트리의 longestPath 및 itemPath의 일 예를 도시한 것이다.
도 3은 제안 방법을 적용한 수행 시간 측정 결과 (Experimental results for proposed methods)이다
도 4는 구매 이력 길이에 따른 단순 기법과 세그먼트 트리를 적용한 제안 기법의 성능을 비교 그래프이다.
도 5는 상품 분류 체계 트리의 상품 개수에 따른 단순 기법과 제안 기법의 성능을 비교한 그래프 이다.
도 6은 본 발명의 일 실시 예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법의 흐름도를 도시한 것이다.
도 7 및 도 8은 일 실시예에 따른 전자장치(1000)의 블록도를 도시한 것이다.
1 shows a comparison between the Euclidean distance and the DTW distance.
Figure 2 (a) shows a part of the product classification tree used in the present invention.
Figure 2 (b) shows an example of the longestPath and itemPath of the product classification tree used in the present invention.
3 is a measurement result of the execution time applied to the proposed method (Experimental results for proposed methods)
4 is a graph comparing the performance of a simple technique and a proposed technique to which a segment tree is applied according to a purchase history length.
5 is a graph comparing the performance of the simple technique and the proposed technique according to the number of products in the product classification system tree.
6 is a flowchart illustrating a control method for determining a degree of similarity between sequences in consideration of an item classification system according to an embodiment of the present invention.
7 and 8 are block diagrams of an electronic device 1000 according to an exemplary embodiment.

본 명세서에 개시되어 있는 본 발명의 개념에 따른 실시 예들에 대해서 특정한 구조적 또는 기능적 설명은 단지 본 발명의 개념에 따른 실시 예들을 설명하기 위한 목적으로 예시된 것으로서, 본 발명의 개념에 따른 실시 예들은 다양한 형태들로 실시될 수 있으며 본 명세서에 설명된 실시 예들에 한정되지 않는다.Specific structural or functional descriptions of the embodiments according to the concept of the present invention disclosed in this specification are only exemplified for the purpose of explaining the embodiments according to the concept of the present invention, and the embodiments according to the concept of the present invention are It may be implemented in various forms and is not limited to the embodiments described herein.

제1 또는 제2 등의 용어는 다양한 구성 요소들을 설명하는데 사용될 수 있지만, 상기 구성 요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성 요소를 다른 구성 요소로부터 구별하는 목적으로만, 예컨대 본 발명의 개념에 따른 권리 범위로부터 벗어나지 않은 채, 제1구성 요소는 제2구성 요소로 명명될 수 있고 유사하게 제2구성 요소는 제1구성 요소로도 명명될 수 있다.Terms such as first or second may be used to describe various elements, but the elements should not be limited by the terms. The above terms are used only for the purpose of distinguishing one component from another, for example without departing from the scope of the inventive concept, a first component may be termed a second component and similarly a second component A component may also be referred to as a first component.

본 명세서에서 사용한 기술적 용어는 단지 특정한 실시 예를 설명하기 위해 사용된 것으로서, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 본 명세서에 기재된 특징, 숫자, 단계, 동작, 구성 요소, 부분품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성 요소, 부분품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The technical terms used herein are used only to describe specific embodiments, and are not intended to limit the present invention. The singular expression includes the plural expression unless the context clearly dictates otherwise. In the present specification, terms such as "comprise" or "have" are intended to designate that a feature, number, step, operation, component, part, or combination thereof described herein exists, but one or more other features It is to be understood that it does not preclude the possibility of the presence or addition of numbers, steps, operations, components, parts, or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 명세서에서 특별히 다른 의미로 정의되지 않는 한, 본 명세서에 개시된 기술이 속하는 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 나타낸다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 갖는 것으로 해석되어야 하며, 본 명세서에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않아야 한다.Unless defined otherwise, all terms used herein, including technical or scientific terms, are common to those of ordinary skill in the art to which the technology disclosed herein belongs, unless specifically defined otherwise herein. has the same meaning as understood as Terms such as those defined in a commonly used dictionary should be interpreted as having a meaning consistent with the meaning in the context of the related art, and should not be interpreted in an ideal or excessively formal meaning unless explicitly defined in the present specification. shouldn't

이하에서 첨부된 도면을 참고하여, 본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법의 기계학습 모델(방법)에 대해서 설명한다.Hereinafter, a machine learning model (method) of an electronic device for determining the degree of similarity between sequences in consideration of an item classification system according to an embodiment of the present invention and a control method thereof will be described with reference to the accompanying drawings.

트리 타입의 항목 분류 체계를 가지는 항목들에 대한 항목들의 시퀀스 데이터는 순서를 가지는 항목들의 집합을 의미한다. 이에 대한 구체적인 예로, 트리 타입의 상품 분류 체계를 가지는 상품들에 대하여 상품 구매 이력은 구매한 순서에 따른 상품들이 나열된 시퀀스 데이터이다. 이하의 상품의 구매이력에 대한 설명은 순서를 가지는 항목들에 대한 시퀀스 데이터에도 그대로 적용될 수 있다.Sequence data of items for items having a tree-type item classification system means a set of items having an order. As a specific example of this, for products having a tree-type product classification system, the product purchase history is sequence data in which products according to the purchase order are listed. The following description of the purchase history of the product may be directly applied to sequence data for items having an order.

1. 서 론1. Introduction

빅데이터 시대에 도래함에 따라 고객들은 자체적으로 엄청난 양의 새로운 디지털 데이터를 생성한다. 이렇게 생성된 데이터는 고객의 특성 자체가 되며 더 나아가 고객을 데이터로 표현할 수 있다. 구매 이력 데이터는 고객이 생성하는 대표적인 데이터 중 하나이다. 구매 이력 데이터에는 물건을 구매하는 사람의 특성과 이에 따라 소비되는 제품, 소비 패턴 등이 담겨있다. 따라서 기업은 주어진 고객의 데이터를 분석하는 능력이 필요하며, 분석된 결과를 바탕으로 의사 결정시 반영할 수 있다. With the advent of the big data era, customers are generating huge amounts of new digital data on their own. The generated data becomes the characteristics of the customer itself, and furthermore, the customer can be expressed as data. The purchase history data is one of the representative data generated by the customer. The purchase history data contains the characteristics of the person purchasing the product, the products consumed, and consumption patterns. Therefore, a company needs the ability to analyze given customer data, and it can be reflected in decision making based on the analyzed results.

본 발명에서는 시간에 따른 고객들의 구매 항목들로 구성된 구매이력 데이터에서 임의의 두 고객의 구매이력이 얼마나 유사한지 계산하는 새로운 유사도 방법을 제안한다. 본 발명에서 제안한 유사도 측정방법은 구매이력 데이터와 같이 항목간의 순서가 존재하는 데이터 간의 유사도를 측정하는 기존의 유사도 방식을 항목 간의 계층관계까지 반영하도록 확장하였다. The present invention proposes a new similarity method for calculating how similar the purchase histories of any two customers are in the purchase history data composed of purchase items of customers over time. The similarity measurement method proposed in the present invention is extended to reflect the hierarchical relationship between items as well as the existing similarity method for measuring the similarity between data in which the order of items exists, such as purchase history data.

구매이력 데이터는 구매 항목들 간의 순서가 담긴 데이터로 대표적인 시퀀스(sequence) 데이터 중 하나이다. 시퀀스란 데이터들의 항목들 간에 순서가 존재하는 데이터를 의미하며, 2개의 시퀀스들이 동일한 구성들로 이뤄졌다고 해도 순서가 다르다면 2개의 시퀀스들은 서로 다른 시퀀스이다. 시퀀스의 예는 구매이력 데이터 뿐만 아니라 웹 로그, 단백질 시퀀스 등이 있을 수 있다. The purchase history data is one of the representative sequence data as data containing the order between purchase items. A sequence means data in which an order exists between items of data, and even if two sequences have the same configuration, if the order is different, the two sequences are different sequences. Examples of the sequence may include not only purchase history data, but also web logs, protein sequences, and the like.

본 발명에서 제안하는 유사도 측정 방법은 기존의 구매이력 데이터 분석 방법들과 달리 시퀀스 내 항목간의 순서를 고려하여 유사도를 계산할 뿐만 아니라, 상품 분류 체계를 활용하여 구매한 상품 간의 서로 다른 유사도를 고려한다.The similarity measurement method proposed in the present invention not only calculates the similarity in consideration of the order between items in a sequence, unlike existing purchase history data analysis methods, but also considers different similarities between purchased products using a product classification system.

현재 기존 방법들만을 활용하여 구매이력 시퀀스 간의 유사도 측정하는 경우 시퀀스를 구성하는 상품의 일치 유무만이 유사도 판단 기준이 된다. 시퀀스 1은 구매이력 시퀀스의 예이다.In the case of measuring the similarity between purchase history sequences using only existing methods, only the consistency of products constituting the sequence is the criterion for determining the similarity. Sequence 1 is an example of a purchase history sequence.

[시퀀스 1][Sequence 1]

Figure 112019123732271-pat00001
Figure 112019123732271-pat00001

이는 가령 구매이력 시퀀스가 시퀀스 1과 같은 경우, 기존의 유사도 측정 방법은 시퀀스

Figure 112019123732271-pat00002
,
Figure 112019123732271-pat00003
의 유사도와
Figure 112019123732271-pat00004
,
Figure 112019123732271-pat00005
의 유사도를 동일하게 계산한다. 시퀀스 1의 시퀀스들은 모두 두 번째 구매 상품이 동일하기 때문에 각 시퀀스의 첫 번째 구매 상품만이 시퀀스 간 유사도에 영향을 미친다. For example, if the purchase history sequence is the same as sequence 1, the existing similarity measurement method is the sequence
Figure 112019123732271-pat00002
,
Figure 112019123732271-pat00003
with the similarity of
Figure 112019123732271-pat00004
,
Figure 112019123732271-pat00005
Calculate the similarity of Since all the sequences of Sequence 1 have the same second purchase product, only the first purchased product in each sequence affects the degree of similarity between the sequences.

기존 방법들은 오직 상품의 일치 유무만을 판단하기 때문에

Figure 112019123732271-pat00006
의 'Coke'와
Figure 112019123732271-pat00007
의 'Sprite'를 비교하는 경우와
Figure 112019123732271-pat00008
의 'Coke'와
Figure 112019123732271-pat00009
의 'Jeans'를 비교하는 경우 같은 유사도를 부여한다. Because the existing methods only judge whether the products match or not,
Figure 112019123732271-pat00006
'Coke' of
Figure 112019123732271-pat00007
When comparing the 'Sprite' of
Figure 112019123732271-pat00008
'Coke' of
Figure 112019123732271-pat00009
When comparing 'Jeans' of 'Jeans', the same degree of similarity is given.

하지만 실제로 'Sprite'는 'Jeans' 보다 상대적으로 'Coke'와 음료라는 동일 범주에 속하며, 이를 고려하여 'Coke'와 'Sprite' 비교 시 'Jeans' 보다 더 높은 유사도를 부여할 필요가 있다. 따라서 본 발명에서는 구매이력 시퀀스 간의 유사도 계산 시 상품 분류 체계를 고려하도록 기존의 시퀀스 유사도 측정 방법을 확장하여 더 정확히 두 구매이력 간의 유사도를 계산한다.However, in reality, 'Sprite' belongs to the same category of 'Coke' and beverages relative to 'Jeans'. Considering this, it is necessary to give a higher similarity than 'Jeans' when comparing 'Coke' and 'Sprite'. Therefore, in the present invention, the similarity between two purchase histories is more accurately calculated by extending the existing sequence similarity measurement method to consider the product classification system when calculating the similarity between purchase history sequences.

또한 본 발명에서는 항목들의 순서를 고려하여 유사도를 계산하기 때문에 유사도 계산 성능에 영향을 미치는 시퀀스 간 유사도 측정 방법을 선택하기 위하여 대표적인 시퀀스 유사도 측정 방법인 레벤슈타인(Levenshtein) 거리, 동적 타임 워핑(DTW: Dynamic Time Warping) 거리, 니들만-브니쉬(Needleman-Wunsch) 유사도의 성능을 비교하였다. In addition, in the present invention, since the similarity is calculated in consideration of the order of items, the Levenshtein distance and dynamic time warping (DTW), which are representative sequence similarity measurement methods, are representative in order to select a similarity measurement method between sequences that affects the similarity calculation performance. Dynamic Time Warping) distance and the performance of Needleman-Wunsch similarity were compared.

가상의 시퀀스 데이터를 사용한 실험을 통해, 본 발명에서는 상품 분류 체계를 고려할 뿐만 아니라 서로 다른 길이를 가지는 두 시퀀스에 대해서도 정확히 유사도를 측정하는 동적 타임 워핑 거리가 가장 적합한 유사도 측정 방법임을 확인하였다.Through an experiment using virtual sequence data, it was confirmed that the dynamic time warping distance, which not only considers the product classification system, but also accurately measures the similarity for two sequences having different lengths, is the most suitable similarity measurement method.

본 발명의 명세서의 구성은 다음과 같다. 제2장에서는 본 발명에서 사용한 시퀀스 유사도 측정 방법들에 대하여 살펴본다. 제3장에서는 본 발명에서 제안한 유사도 측정 방법에 대하여 자세히 설명한다. 제4장에서는 제안 방법과 기존 방법과의 성능 평가 결과를 보이며, 제5장에서는 결론을 맺는다.The structure of the specification of the present invention is as follows. Chapter 2 examines the sequence similarity measurement methods used in the present invention. In Chapter 3, the similarity measurement method proposed in the present invention will be described in detail. Chapter 4 shows the performance evaluation results of the proposed method and the existing method, and Chapter 5 concludes.

2. 관련 연구2. Related Studies

2.1 구매이력 데이터 분석2.1 Analysis of purchase history data

고객의 소비활동이 담긴 대규모의 구매이력 데이터에는 고객의 소비패턴이 담겨 있다. 이렇게 고객의 구매내역에서 빈번하게 발생한 구매 패턴을 찾아 나가는 과정을 연관성 분석이라고 한다. 연관성 분석은 각 상품을 독립적인 개체로 판단하여 규칙을 생성하며, 여기서 장바구니 분석은 항목간의 계층 관계까지 고려하는 분석이다. 이와 다르게 순차 패턴 분석은 구매 내역의 선후관계까지 고려하여 규칙을 생성한다. 세 가지 분석 모두 지지도(support), 신뢰도(confidence), 향상도(lift)라는 평가 기준을 활용하여 항목 간의 규칙을 생성한다.The large-scale purchase history data containing the consumer's consumption activity contains the customer's consumption pattern. The process of finding a purchase pattern that occurs frequently in the customer's purchase history is called correlation analysis. Association analysis creates rules by judging each product as an independent entity, where shopping cart analysis considers even the hierarchical relationship between items. Contrary to this, sequential pattern analysis creates rules in consideration of the precedence and precedence of purchase details. All three analyzes generate rules between items using evaluation criteria of support, confidence, and lift.

고객들의 구매이력 데이터를 활용한 대표적인 사례로는 미국의 월마트(Wal-Mart)가 있다. 월마트는 매출에 직접적인 영향을 미치는 고객의 장바구니에 관심을 가진 최초의 업체로 방대한 양의 데이터를 분석하여 맥주와 기저귀의 관계를 밝혀냈다. 매출을 늘리기 위해 다양한 마케팅 활동을 전개하는 기업의 입장에서는 이러한 데이터를 활용하여 실질적인 제품 간의 관계를 파악하여 마케팅 전략으로 활용할 수 있다.A typical example of using customer purchase history data is Wal-Mart in the United States. Wal-Mart was the first company to pay attention to customer shopping carts, which directly affect sales, and analyzed vast amounts of data to uncover the relationship between beer and diapers. Companies that engage in various marketing activities to increase sales can use this data to identify the actual relationship between products and use it as a marketing strategy.

2.2 시퀀스 유사도 측정 방법2.2 How to Measure Sequence Similarity

시퀀스(sequence)란 두 개 이상의 항목들로 구성된 데이터로 이 항목들 간에 순서가 담긴 데이터를 말한다. 대표적인 시퀀스 데이터로는 웹 로그 데이터, 단백질 시퀀스 데이터가 있다. 시퀀스 데이터를 분석하여 웹 로그 파일에서 비슷한 사용자들을 그룹화하거나 비슷한 구조를 가지는 단백질 시퀀스들을 그룹화 하여 비슷한 기능을 갖는 단백질 시퀀스를 발견할 수 있다. 항목간의 선후 관계가 존재하는 시퀀스 데이터에서 순서를 고려하여 유사도를 정의하는 것이 중요하며, 유사도를 계산하는 방법에 따라 다음과 같이 나눌 수 있다.A sequence is data made up of two or more items, and it is data that contains an order between these items. Representative sequence data includes web log data and protein sequence data. You can find protein sequences with similar functions by grouping similar users in web log files by analyzing sequence data or by grouping protein sequences with similar structures. It is important to define the degree of similarity by considering the order in sequence data in which there is a precedence relationship between items, and it can be divided as follows according to the method of calculating the degree of similarity.

1) 편집 기반(edit-based) 유사도 측정 방법1) Edit-based similarity measurement method

두 개의 문자열이 같아지기 위한 최소 수정 연산 횟수를 구하는 알고리즘이다. 수정 연산은 추가(add), 대체(substitute), 삭제(delete) 연산을 말하며 가장 대표적인 알고리즘은 레벤슈타인(Levenshtein) 거리 알고리즘이 있다. 수정 연산 횟수가 유사도 판단 척도로 사용되며 그 값이 작을수록 두 문자열이 유사하다고 판단한다.This is an algorithm to find the minimum number of correction operations to make two strings the same. The correction operation refers to add, substitute, and delete operations, and the most representative algorithm is the Levenshtein distance algorithm. The number of correction operations is used as a measure of similarity, and the smaller the value, the more similar the two strings are judged.

2) 정렬(alignment) 유사도 측정 방법2) How to measure alignment similarity

주로 단백질 서열이나 핵산 서열 사이의 상관관계 분석 시 두 서열 간의 유사한 구역을 찾아낼 때 사용한다. 정렬 범위에 따라 국소(local) 정렬 방법과 전역(global) 정렬 방법이 있으며, 대표적인 국소 정렬 알고리즘으로는 스미스-워터맨(Smith-Waterman) 알고리즘이 있고 전역 정렬 알고리즘으로 니들만-브니쉬(Needleman-Wunsch) 알고리즘이 있다. 두 알고리즘은 정렬 범위에 따라 두 시퀀스가 가장 유사하도록 공백(gap)을 사용하여 정렬한다.It is mainly used to find similar regions between two sequences when analyzing the correlation between protein sequences or nucleic acid sequences. According to the sort range, there are local sorting methods and global sorting methods. A representative local sorting algorithm is the Smith-Waterman algorithm, and the global sorting algorithm is Needleman-Wunsch (Needleman-Wunsch). ) is an algorithm. Both algorithms sort using gaps so that the two sequences are most similar according to the sort range.

3) 집합 기반(set-based) 유사도 측정 방법3) Set-based similarity measurement method

문자열을 문자의 집합 혹은 토큰(token)의 집합 형태로 바꾸어 계산한다. 집합 관계를 이용하여 연산하며 문자열을 토큰으로 나누는 경우에는 N-gram 개념을 사용하여 문자열을 길이가 N개의 기준 단위로 절단하여 사용한다. 대표적인 알고리즘으로는 자카드(Jaccard) 유사도가 있다. 자카드 유사도는 집합을 구성하는 원소들 간의 합집합과 교집합 간의 비율을 나타내며 0에서 1 사이의 값을 가진다.It is calculated by converting a string into a set of characters or a set of tokens. It operates using a set relationship, and when a string is divided into tokens, the string is cut into N standard units of length using the N-gram concept. A typical algorithm is Jaccard similarity. Jacquard similarity indicates the ratio between union and intersection between elements constituting a set, and has a value between 0 and 1.

2.3 구매이력 시퀀스 유사도 측정 방법2.3 Method of measuring similarity of purchase history sequence

본 절에서는 본 발명에서 제안하는 시퀀스 유사도 측정 시 성능 비교를 위해 사용하는 레벤슈타인 거리, 동적 타임 워핑 유사도, 니들만-브니쉬 유사도에 대하여 상세히 설명한다.In this section, the Levenstein distance, dynamic time warping similarity, and Needlemann-Bnish similarity used for performance comparison when measuring sequence similarity proposed in the present invention will be described in detail.

1) 레벤슈타인(Levenshtein) 거리1) Levenshtein street

편집 거리 알고리즘으로도 알려져 있는 레벤슈타인 거리는 하나의 문자열을 다른 문자열로 변환하기 위해 필요한 연산의 최소 횟수를 의미한다. 두 문자열 간의 수정 연산은 추가(insert), 대체(substitute), 삭제(delete) 연산을 말한다. 비교하고자 하는 두 문자열의 문자를 한자씩 비교하며 추가와 삭제 시 연산 비용은 1을 부여하고 대체 연산은 문자의 일치 유무에 따라 0 또는 1을 부여하여 유사도를 계산한다. The Levenstein distance, also known as the edit distance algorithm, refers to the minimum number of operations required to convert one string to another. Modification operations between two strings are insert, substitute, and delete operations. The characters of the two strings to be compared are compared one character at a time. For addition and deletion, the operation cost is given as 1, and for the replacement operation, 0 or 1 is assigned depending on whether the characters match and the similarity is calculated.

2) 동적 타임 워핑(DTW) 거리2) Dynamic Time Warping (DTW) Distance

속도가 다른 두 개의 시계열 패턴의 유사성을 측정하는 알고리즘으로 음성인식, 필기체 문자인식 등에 사용된다. 두 시계열 간의 거리를 최소화하는 방향으로 움직이면서 거리를 계산하기 때문에 유클리디안(Euclidean) 거리로 계산할 때와 달리 부분적으로 왜곡되거나 변형된 파형에 대해서도 계산할 수 있다. It is an algorithm that measures the similarity of two time series patterns with different speeds, and is used for speech recognition and handwritten character recognition. Since the distance is calculated while moving in the direction that minimizes the distance between the two time series, it can be calculated even for a partially distorted or deformed waveform, unlike when calculating with the Euclidean distance.

도 1은 유클리디안 거리와 DTW 거리의 비교를 도시한 것 이다. 1 shows a comparison between the Euclidean distance and the DTW distance.

예를 들어, 두 개의 시계열 그래프 A와 B가 각각

Figure 112019123732271-pat00010
벡터로 표현된다고 하자. 도 1은 두 시계열 그래프 A, B에 대하여 유클리디안(Euclidean) 유사도로 계산한 경우와 동적 타임 워핑 유사도로 계산한 경우이다. 동적 타임 워핑 유사도로 계산한 경우는 유클리디안 유사도와 다르게 시계열 그래프의 한 점에서 다른 시계열 그래프의 하나 혹은 그 이상의 점에 대응하여 계산 할 수 있다. 이러한 특성으로 인해 서로 다른 길이의 시퀀스에 대해서도 효과적으로 유사도를 계산할 수 있다. For example, if two time series graphs A and B are
Figure 112019123732271-pat00010
Let it be expressed as a vector. 1 is a case in which two time series graphs A and B are calculated with Euclidean similarity and dynamic time warping similarity. In the case of calculating the dynamic time warping similarity, it can be calculated in correspondence with one or more points in the other time series graph from one point in the time series graph, unlike the Euclidean similarity. Due to these characteristics, similarity can be effectively calculated even for sequences of different lengths.

3) 니들만-브니쉬(Needleman-Wunsch) 유사도3) Needleman-Wunsch similarity

생물정보학(bioinformatics) 분야에서 단백질이나 뉴클레오타이드 (nucleotide)의 시퀀스 간의 서열 비교를 위한 알고리즘으로, 두 시퀀스가 가장 유사도가 높도록 공백(gap)을 사용하여 두 시퀀스를 정렬한다. 공백 패널티(gap penalty), 일치(match), 불일치(mismatch) 값은 사용자 지정 값으로 값에 따라 시퀀스 간의 정렬 결과가 달라진다. 레벤슈타인 거리와 같이 두 시퀀스에 대한 삽입, 삭제, 일치 연산 비용을 활용하여 두 시퀀스 간의 유사도를 계산한다.As an algorithm for sequence comparison between sequences of proteins or nucleotides in the field of bioinformatics, a gap is used to align two sequences so that the two sequences have the highest similarity. The gap penalty, match, and mismatch values are user-specified values, and the alignment results between sequences vary depending on the values. The similarity between two sequences is calculated using the cost of insertion, deletion, and matching operations for two sequences, such as the Levenstein distance.

본 발명에서는 상기 3개의 유사도 측정 방법을 사용하여 유사도를 측정하였다. 이들은 모두 두 시퀀스 간의 항목을 하나씩 비교 가능하며 시퀀스를 집합 원소로 나누는 등의 별도 연산은 필요하지 않다. 하지만 기존 방법만을 사용하여 구매이력 시퀀스를 비교하는 경우, 상품 일치 유무만을 판단하여 0 또는 1의 값만을 부여하여 유사도를 계산하기 때문에 본 발명에서는 상품간의 계층관계를 고려하도록 이를 확장하였다.In the present invention, the similarity was measured using the three similarity measurement methods. All of them can compare items between two sequences one by one and do not require separate operations such as dividing the sequence into set elements. However, in the case of comparing purchase history sequences using only the existing method, since similarity is calculated by assigning only a value of 0 or 1 by judging only whether products match or not, in the present invention, this is extended to consider the hierarchical relationship between products.

본 발명의 제안 방법은 상품 분류 트리를 활용하여 상품 간의 유사도를 0에서 1사이의 값으로 부여하여 유사도 계산 시 각 상품 간의 연관 정도를 보다 세분화한다. 따라서 본 발명에서는 구매이력 시퀀스 간의 유사도 계산 시 상품 분류 체계를 반영하기 위하여 이들의 수행 과정 중 일부분을 변형하여 사용하였으며, 제4.2절에서는 이들에 대한 성능 평가 결과를 보인다. The proposed method of the present invention uses a product classification tree to assign a similarity between products as a value between 0 and 1 to further subdivide the degree of association between each product when calculating the similarity. Therefore, in the present invention, a part of the process was modified to reflect the product classification system when calculating the similarity between purchase history sequences, and Section 4.2 shows the performance evaluation results for them.

3. 상품 분류 체계를 고려한 시퀀스 유사도 측정3. Measurement of sequence similarity considering the product classification system

본 장에서는 본 발명에서 제안하는 상품 분류 체계를 활용하여 구매이력 데이터에서 두 시퀀스 간의 유사도를 계산하는 제안 방법에 대해 자세히 설명한다.In this chapter, the proposed method for calculating the similarity between two sequences in the purchase history data using the product classification system proposed in the present invention will be described in detail.

3.1 개요3.1 Overview

본 발명에서 제안하는 시퀀스 간의 유사도 측정 방법은 구매이력 데이터에서 주어진 상품 분류 체계를 활용하여 두 시퀀스 간의 유사도를 측정한다. 구매이력 데이터에서 하나의 구매이력은 고객 한 명이 순차적으로 구매한 항목들이 나열된 시퀀스 데이터이다. 이러한 임의의 두 시퀀스 데이터가 주어졌을 때, 본 발명에서 제안한 유사도 측정방법은 항목간의 순서를 고려하여 유사도를 측정한다. 또한 주어진 상품 분류 체계를 활용하여 상품 간의 분류 체계도 고려하여 유사도를 계산한다는 점에서 기존의 시퀀스 유사도 측정 방법과는 차이가 있다.The similarity measurement method between sequences proposed in the present invention measures the similarity between two sequences by using a product classification system given in purchase history data. In the purchase history data, one purchase history is sequence data in which items sequentially purchased by one customer are listed. When these two arbitrary sequence data are given, the similarity measuring method proposed in the present invention measures the similarity in consideration of the order between the items. In addition, it is different from the existing sequence similarity measurement method in that the similarity is calculated by considering the classification system between products using a given product classification system.

본 발명에서 제안하는 구매이력 시퀀스 간의 유사도 측정 방법은 대표적인 시퀀스 유사도 측정 방법인 레벤슈타인 거리, 동적 타임 워핑 거리, 니들만-브니쉬 유사도를 사용하여 시퀀스 내 항목 간의 유사도를 계산한다. 유사도 계산 시 상품 분류 체계를 반영하기 위해 비교하고자 하는 두 항목의 간의 연관성을 세분화하도록 수행 과정 중 일부분을 변용하였다. The similarity measurement method between purchase history sequences proposed in the present invention calculates the similarity between items in a sequence using the Levenstein distance, the dynamic time warping distance, and the Needleman-Bnish similarity, which are representative sequence similarity measurement methods. In order to reflect the product classification system when calculating the similarity, a part of the execution process was modified to subdivide the correlation between the two items to be compared.

3.2 문제 정의3.2 Problem Definition

본 절에서는 본 발명에서 시퀀스 유사도 계산 시 사용하는 상품 분류 트리의 개념과 본 발명에서 정의한 유사한 구매이력에 대하여 설명한다.In this section, the concept of a product classification tree used in calculating sequence similarity in the present invention and similar purchase history defined in the present invention will be described.

1) 상품 분류 트리1) Product classification tree

도 2(a)는 본 발명에서 사용한 상품 분류 트리 중 일부를 도시한 것이다. 도 2(b)는 본 발명에서 사용한 상품 분류 트리의 longestPath 및 itemPath의 일 예를 도시한 것이다.Figure 2 (a) shows a part of the product classification tree used in the present invention. Figure 2 (b) shows an example of the longestPath and itemPath of the product classification tree used in the present invention.

도 2(a)를 참조하면, 일반적으로 백화점, 마트와 같은 유통 업체는 모든 상품에 대하여 대분류/ 중분류/ 소분류와 같이 계층이 나누어진 상품 분류 체계를 가진다. 예를 들어 '바지'라는 상품은 먼저 소분류인 '하의'에 속하며, 여기서 하의는 다시 중분류인 '의류'에 속하게 된다. 이렇게 모든 상품은 상품 분류 체계의 가장 하위 부분을 차지한다. 본 발명에서는 이러한 상품 분류 체계를 트리(tree) 자료구조로 표현하였다. Referring to FIG. 2( a ), in general, distribution companies such as department stores and marts have a product classification system in which layers are divided such as large/medium/small categories for all products. For example, a product called 'pants' first belongs to the subcategory 'bottoms', and here the bottoms again belong to the middle category 'clothes'. In this way, all products occupy the lowest part of the product classification system. In the present invention, such a product classification system is expressed as a tree data structure.

본 발명에서 사용한 상품 분류 트리의 체계는 미국 전자 상업 회사인 아마존(Amazon)의 분류 체계를 참고하여 구성하였다. 트리의 각 노드(node)에는 실제 상품이나 상품의 상위 범주명이 저장된다. The system of the product classification tree used in the present invention was constructed with reference to the classification system of Amazon, an American electronic commerce company. In each node of the tree, the name of the actual product or the upper category of the product is stored.

도 2(a)의 상품 분류 트리에서 트리의 단말 노드(leaf node)는 상품에 해당하며(예. a, b, c, d, e, f, g, h, i, j, k), 내부 노드(internal node)는 각 상품에 대한 상위 범주이다(예. C1, C2, C3, C4, C5, C6, C7, C8). 또한, 상품 분류 트리에서 최상단 노드는 Root로 표현된다.In the product classification tree of Fig. 2(a), the leaf node of the tree corresponds to the product (eg, a, b, c, d, e, f, g, h, i, j, k), and the inside The internal node is the parent category for each product (eg C1, C2, C3, C4, C5, C6, C7, C8). In addition, the top node in the product classification tree is expressed as a root.

이 상품 분류 트리는 구매이력 시퀀스 간의 유사도 비교 시 사용된다. 상품 분류 트리를 사용하여 시퀀스 내 항목들은 알고리즘 수행 과정 중 상품 분류 트리 내에서 서로 다른 연관정도에 따라 수치화되어 계산 시 반영된다. This product classification tree is used to compare similarities between purchase history sequences. Using the product classification tree, the items in the sequence are quantified according to different degrees of association in the product classification tree during the algorithm execution process and reflected in the calculation.

구매이력 데이터에서 시퀀스 내 모든 항목은 상품 분류 트리의 단말 노드(leaf node)에 해당하며, 단말 노드는 상품에 해당한다.In the purchase history data, all items in the sequence correspond to leaf nodes of the product classification tree, and the terminal nodes correspond to products.

본 발명에서 제안한 구매이력 시퀀스 간의 유사도 측정 방법은 도2 와 같은 상품 분류 체계를 사용하여 항목 간의 유사한 정도를 계산한다. 따라서 두 상품이 일치하지 않더라도 상품 분류 트리 내에서 두 상품 간의 가까운 정도를 반영하여 계산하기 때문에 상품간의 유사한 정도를 세분화 하여 계산 할 수 있다. The similarity measurement method between purchase history sequences proposed in the present invention calculates the similarity between items using the product classification system shown in FIG. 2 . Therefore, even if the two products do not match, the degree of similarity between the products can be subdivided and calculated because the calculation reflects the degree of closeness between the two products in the product classification tree.

2) 유사 구매이력 정의2) Definition of similar purchase history

본 발명에서 계산하는 구매이력 데이터는 각 고객들이 구매한 항목들이 순서대로 나열된 시퀀스 데이터이다. 구매이력 데이터에서 각 시퀀스는 고객 한명에 대한 구매이력을 나타내며,

Figure 112019123732271-pat00011
개의 구매 항목으로 이루어진 시퀀스
Figure 112019123732271-pat00012
Figure 112019123732271-pat00013
라 하자.
Figure 112019123732271-pat00014
는 시퀀스
Figure 112019123732271-pat00015
Figure 112019123732271-pat00016
번째 구매 항목을 나타내며, 이 시퀀스는 상품
Figure 112019123732271-pat00017
부터
Figure 112019123732271-pat00018
까지 순서대로 구매한 이력 데이터를 나타낸다. |S|는 시퀀스의 크기 또는 시퀀스 내 구매된 항목의 개수를 나타낸다.The purchase history data calculated in the present invention is sequence data in which items purchased by each customer are listed in order. In the purchase history data, each sequence represents the purchase history of one customer,
Figure 112019123732271-pat00011
sequence of purchases
Figure 112019123732271-pat00012
to
Figure 112019123732271-pat00013
let's say
Figure 112019123732271-pat00014
is the sequence
Figure 112019123732271-pat00015
of
Figure 112019123732271-pat00016
Represents the second purchase, this sequence is
Figure 112019123732271-pat00017
from
Figure 112019123732271-pat00018
Shows purchase history data in order up to. |S| indicates the size of the sequence or the number of purchased items in the sequence.

본 발명에서 제안하는 시퀀스 간의 유사도 측정방법은 두 시퀀스의 세부 항목들이 다르더라도 항목들의 상위 범주가 같은 경우 유사하다고 판단한다. In the method for measuring the similarity between sequences proposed in the present invention, even if detailed items of two sequences are different, it is determined that the items are similar when the upper category of the items is the same.

시퀀스 2는 본 발명에서 정의한 유사한 구매이력 대한 예이다.Sequence 2 is an example of a similar purchase history defined in the present invention.

[시퀀스 2][Sequence 2]

Figure 112019123732271-pat00019
Figure 112019123732271-pat00019

시퀀스 2에서 두 시퀀스

Figure 112019123732271-pat00020
,
Figure 112019123732271-pat00021
는 두 고객에 대한 구매이력 데이터로,
Figure 112019123732271-pat00022
Figure 112019123732271-pat00023
는 모두 서로 다른 구매항목으로 구성되어 있다. 하지만 두 시퀀스의 세부 항목들은 매우 연관성이 높으며, 유사한 구매 순서를 보인다. 시퀀스 내 각 항목을 상위 범주로 바꿀 경우, 두 시퀀스 모두 음료, 간식, 의류 범주에 속한 상품 순으로 구성된 구매 이력인 것을 볼 수 있다. 이처럼 두 상품이 완전히 동일하지 않더라도 동일한 상위 범주에 속한다면 그렇지 않은 경우보다 더 높은 유사도를 부여할 필요가 있다. 따라서 본 발명에서는 상품 분류 트리를 활용하여 두 항목들이 다르더라도 서로 동일한 상위 범주를 가진다면 더 높은 유사도를 부여하여 계산한다. two sequences in sequence 2
Figure 112019123732271-pat00020
,
Figure 112019123732271-pat00021
is the purchase history data for two customers,
Figure 112019123732271-pat00022
and
Figure 112019123732271-pat00023
are all made up of different purchase items. However, the details of the two sequences are highly related and show a similar purchase order. If you change each item in the sequence to a higher category, you can see that both sequences are purchase histories consisting of products belonging to the beverage, snack, and clothing categories in order. Even if two products are not completely identical, if they belong to the same upper category, it is necessary to give a higher degree of similarity than if they were not. Therefore, in the present invention, using the product classification tree, even if two items are different, if they have the same upper category, a higher degree of similarity is given and calculated.

3.3 시퀀스 유사도 측정 3.3 Measuring Sequence Similarity

본 절에서는 제2.3절에서 설명한 대표적인 시퀀스 간의 유사도 측정 방법인 레벤슈타인 거리, 동적 타임 워핑 거리, 니들만-브니쉬 유사도를 사용하여 상품 분류 체계를 활용한 구매이력 시퀀스 유사도 측정 방법에 대해 상세히 설명한다. This section describes in detail the similarity measurement method for purchase history sequences using the product classification system using the Levenstein distance, dynamic time warping distance, and Needlemann-Bnish similarity, which are the representative methods for measuring similarity between sequences described in Section 2.3. .

상품 분류 트리를 적용하기 위하여 알고리즘의 수행 과정 중 일부분을 변용하였으며, 아래 코드 1, 2, 3의 의사코드 중 네모 칸 부분은 제안 방법을 적용하기 위하여 새롭게 변형한 부분이다. In order to apply the product classification tree, a part of the algorithm's execution process has been modified, and the square part of the pseudocode of codes 1, 2, and 3 below is a newly modified part to apply the proposed method.

세 알고리즘 모두 유사도 계산을 위해 구매이력 시퀀스

Figure 112019123732271-pat00024
Figure 112019123732271-pat00025
에 대한 2차원 배열
Figure 112019123732271-pat00026
을 생성한다. 각 알고리즘의 배열
Figure 112019123732271-pat00027
의 값은 이전 원소(
Figure 112019123732271-pat00028
,
Figure 112019123732271-pat00029
,
Figure 112019123732271-pat00030
)를 활용하여 구한다(
Figure 112019123732271-pat00031
,
Figure 112019123732271-pat00032
). 배열
Figure 112019123732271-pat00033
의 마지막 원소가 각 알고리즘 별 유사도 값이 되며, 알고리즘 별로 다른 유사도 값의 범위를 가진다. 다음은 각 알고리즘 별 유사도 측정 방법에 대하여 상세히 설명한다.All three algorithms use the purchase history sequence to calculate the similarity.
Figure 112019123732271-pat00024
and
Figure 112019123732271-pat00025
2D array for
Figure 112019123732271-pat00026
create array of each algorithm
Figure 112019123732271-pat00027
The value of the previous element (
Figure 112019123732271-pat00028
,
Figure 112019123732271-pat00029
,
Figure 112019123732271-pat00030
) to find (
Figure 112019123732271-pat00031
,
Figure 112019123732271-pat00032
). Arrangement
Figure 112019123732271-pat00033
The last element of is the similarity value for each algorithm, and each algorithm has a different similarity value range. The following describes in detail the similarity measurement method for each algorithm.

1) 레벤슈타인(Levenshtein) 거리1) Levenshtein street

레벤슈타인 거리는 두 문자열을 한자 씩 비교해 나가며, 계산 후 배열의 가장 마지막 원소의 값이 두 문자열의 최소 편집 거리가 된다. 레벤슈타인 거리 Levenshtein Dist(

Figure 112019123732271-pat00034
,
Figure 112019123732271-pat00035
)는 0에서
Figure 112019123732271-pat00036
사이 값을 가진다. The Levenstein distance compares two strings one character at a time, and after calculation, the value of the last element of the array becomes the minimum editing distance of the two strings. Levenshtein Dist(
Figure 112019123732271-pat00034
,
Figure 112019123732271-pat00035
) is from 0
Figure 112019123732271-pat00036
has a value between

두 시퀀스

Figure 112019123732271-pat00037
,
Figure 112019123732271-pat00038
에 대하여 문자열이 없는 경우도 포함하여 2차원 배열
Figure 112019123732271-pat00039
을 행의 개수가
Figure 112019123732271-pat00040
이고 열의 개수가
Figure 112019123732271-pat00041
Figure 112019123732271-pat00042
크기로 생성한다. 배열의 첫 번째 행과 열은 0에서부터 두 문자열의 길이만큼 증가시켜가며 초기화한다. 배열의 두 번째 행과 열부터는 이전까지 계산된 배열 값을 사용하여 채워나간다.two sequences
Figure 112019123732271-pat00037
,
Figure 112019123732271-pat00038
2D array including no string for
Figure 112019123732271-pat00039
is the number of rows
Figure 112019123732271-pat00040
and the number of columns is
Figure 112019123732271-pat00041
sign
Figure 112019123732271-pat00042
create in size The first row and column of the array are initialized by increasing the length from 0 to the length of the two strings. From the second row and column of the array, the array values calculated previously are used to fill in.

코드 1은 Pseudo-code of Levenshtein distance algorithm에 관한 것이다.Code 1 relates to the pseudo-code of Levenshtein distance algorithm.

<코드 1><Code 1>

Figure 112019123732271-pat00043
Figure 112019123732271-pat00043

Figure 112019123732271-pat00044
에서 행에 해당하는
Figure 112019123732271-pat00045
은 원본 문자열을 의미하며 열에 해당하는
Figure 112019123732271-pat00046
는 바꾸고자 하는 목적 문자열을 의미한다.
Figure 112019123732271-pat00047
는 추가(
Figure 112019123732271-pat00048
), 대체(
Figure 112019123732271-pat00049
cost), 삭제(
Figure 112019123732271-pat00050
) 비용 중 가장 작은 값으로 채워진다. 삭제와 추가 연산은 이전 배열 값에 삭제, 추가 비용 1을 더한다. 대체 연산은 만일 현재 계산하는
Figure 112019123732271-pat00051
번째 문자와
Figure 112019123732271-pat00052
번째 문자가 일치한다면 대체 비용(cost)은 0을 더해주고, 다르다면 1을 더해준다. 코드 1은 레벤슈타인 거리 알고리즘을 활용하여 본 발명에서 제안하는 구매이력 시퀀스 유사도 계산 방법을 나타내는 의사코드이다. 코드 1의 의사코드 중 네모 칸은 새롭게 제안한 대체 연산 비용을 계산하는 함수로 코드 2의 의사코드가 수행된다. 만일 해당 부분이 문자 일치 유무에 따라 0 또는 1의 값을 가진다면 기존 레벤슈타인 거리 알고리즘이 수행된다.
Figure 112019123732271-pat00044
corresponding to the row in
Figure 112019123732271-pat00045
stands for the original string and corresponds to the column
Figure 112019123732271-pat00046
means the target string to be changed.
Figure 112019123732271-pat00047
is added (
Figure 112019123732271-pat00048
), how(
Figure 112019123732271-pat00049
cost), delete (
Figure 112019123732271-pat00050
) is filled with the smallest of the costs. Delete and append operations add 1 delete and add cost to the previous array value. The replacement operation is if the current computation
Figure 112019123732271-pat00051
second letter and
Figure 112019123732271-pat00052
If the first character matches, the replacement cost adds 0, otherwise adds 1. Code 1 is a pseudo-code indicating a method for calculating the similarity of a purchase history sequence proposed in the present invention by using the Levenstein distance algorithm. Among the pseudocodes of code 1, the square box is a function that calculates the newly proposed replacement operation cost, and the pseudocode of code 2 is executed. If the corresponding part has a value of 0 or 1 depending on whether characters match or not, the existing Levenstein distance algorithm is performed.

예를 들면, 다른 문자열을 가지는 2개의 시퀀스 S1 = [a, e, m], S2 = [a, d, c]가 있다가 가정할 경우 S1의 문자열을 S2의 문자열로 변환하기 위해 필요한 연산의 최소 횟수를 구해 본다. dist(i, j)는 S1의 i번째까지의 문자열과 S2의 번째까지의 문자열의 편집거리를 나타낸다. For example, assuming that there are two sequences S1 = [a, e, m], S2 = [a, d, c] having different character strings, the operation required to convert the character string of S1 to the character string of S2 is Find the minimum number of times. dist(i, j) represents the editing distance of the character string up to the i-th of S1 and the character string up to the S2-th.

dist(i, j) = min [dist(i-1, j-1)+c(i, j), dist(i-1, j)+1, dist(i, j-1)+1] 및 c(i, j) = 0 (if xi=yj) or 1 (otherwise)로 정의된다. 시퀀스 S1 및 S2의 각 문자열의 편집거리는 아래의 표 1와 같다.dist(i, j) = min [dist(i-1, j-1)+c(i, j), dist(i-1, j)+1, dist(i, j-1)+1] and It is defined as c(i, j) = 0 (if xi=yj) or 1 (otherwise). The edit distance of each character string of the sequences S1 and S2 is shown in Table 1 below.

[표 1][Table 1]

Figure 112019123732271-pat00053
Figure 112019123732271-pat00053

본 발명에서 제안하는 알고리즘은 기존의 레벤슈타인 거리 알고리즘의 대체 연산 중 더해지는 비용의 값을 상품 분류 트리를 이용하여 0에서 1사이로 세분화하여 보다 정확히 상품 간의 유사도를 계산한다. 따라서 본 발명에서 제안한 대체 연산 비용은 상품 분류 트리 내에서 가장 먼 두 항목인 경우에만 전혀 관련 없는 두 항목이라고 판단하여 최댓값 1을 부여하고, 그렇지 않은 경우에는 상품 분류 트리 내에서 서로 다른 두 상품 간의 최단 경로의 길이를 가지도록 대체 연산 비용의 값을 세분화 한다. 코드 2는 기존의 대체 연산 비용 계산 방법과 달리 상품 분류 트리를 활용하여 두 상품간의 연관정도를 세분화하여 계산하는 제안 방법에 대한 의사코드이다. The algorithm proposed in the present invention calculates the similarity between products more accurately by subdividing the value of the added cost during the replacement operation of the existing Levenstein distance algorithm from 0 to 1 using the product classification tree. Therefore, the substitution calculation cost proposed in the present invention is determined to be completely unrelated only in the case of the two most distant items in the product classification tree, and a maximum value of 1 is given. Otherwise, the shortest distance between two different products in the product classification tree. Subdivide the value of the replacement computation cost to have the length of the path. Code 2 is a pseudo-code for a proposed method of calculating the degree of association between two products by subdividing the degree of association between two products by using a product classification tree, unlike the existing alternative computation cost calculation method.

코드 2는 Pseudo-code of the proposed method에 관한 것이다.Code 2 relates to the pseudo-code of the proposed method.

<코드 2><Code 2>

Figure 112019123732271-pat00054
Figure 112019123732271-pat00054

비교하고자 하는 시퀀스 내 두 상품이 다른 경우 상품 분류 트리를 탐색하여 두 상품간의 연관정도를 계산한다. 수학식 1은 본 발명에서 제안하는 상품 분류 트리를 활용하여 두 상품관의 연관성을 계산하는 식이다.If the two products in the sequence to be compared are different, the product classification tree is searched to calculate the degree of association between the two products. Equation 1 is an equation for calculating the correlation between two product categories by using the product classification tree proposed in the present invention.

[수학식 1][Equation 1]

Figure 112019123732271-pat00055
Figure 112019123732271-pat00055

cost는 상품 분류 트리에서

Figure 112019123732271-pat00056
번째 항목과
Figure 112019123732271-pat00057
번째 항목과의 가까운 정도이다. cost 값은 상품 분류 트리 내에서 찾고자 하는 두 항목의 최단 경로의 길이가 가장 먼 두 항목의 길이에서 차지하는 비율을 나타낸다. cost in the product classification tree
Figure 112019123732271-pat00056
second item and
Figure 112019123732271-pat00057
It is close to the second item. The cost value represents the ratio of the length of the shortest path of the two items to be found in the product classification tree to the length of the two items that are farthest.

longestPath는 상품 분류 트리 내에서 가장 먼 두 노드의 경로의 길이이며, 다시 말해 상품 분류 트리 내에서 가장 연관성이 없는 두 항목의 엣지의 수를 의미한다. longestPath is the length of the path of the two most distant nodes in the product classification tree, that is, the number of edges of the two most unrelated items in the product classification tree.

itemPath는 상품 분류 트리 내에서

Figure 112019123732271-pat00058
번째 항목과
Figure 112019123732271-pat00059
번째 항목과의 최단 경로의 길이이다. 두 항목 사이의 최단 경로는 두 항목에서 가장 가까운 범주까지의 엣지(edge)의 수이다. 따라서 itemPath가 작을수록 두 항목은 높은 연관성을 가지며 가까운 범주에 분류되어 있는 상품임을 의미한다. itemPath is within the product classification tree.
Figure 112019123732271-pat00058
second item and
Figure 112019123732271-pat00059
It is the length of the shortest path to the second item. The shortest path between two items is the number of edges from the two items to the nearest category. Therefore, the smaller the itemPath, the higher the correlation between the two items and the product is classified into a close category.

itemPath가 0인 경우 두 상품은 같은 노드이며 cost는 0이 된다. itemPath가 1인 경우 longestPath와 같은 값을 가지게 되며 트리 내 항목 중 가장 연관성이 낮은 두 항목을 의미하며, cost는 1이 된다. If itemPath is 0, both products are the same node and cost is 0. If itemPath is 1, it has the same value as longestPath, meaning the two items with the lowest correlation among the items in the tree, and the cost becomes 1.

레벤슈타인 거리 알고리즘의 경우 새롭게 계산된 비용은 대체 연산 시 더해지는 비용으로 추가, 대체, 삭제 비용 중 최솟값 선택 시 사용된다. In the case of the Levenstein distance algorithm, the newly calculated cost is a cost added during the replacement operation and is used to select the minimum value among the addition, replacement, and deletion costs.

예를 들면, 앞서 설명한 c(i, j) = 0 (if xi=yj) or 1 (otherwise)를 대신하여 New c(i, j)으로 대체하며, New c(i, j)는 수학식 1의 cost로 표현될 수 있다. For example, New c(i, j) is substituted for c(i, j) = 0 (if xi=yj) or 1 (otherwise) described above, and New c(i, j) is Equation 1 It can be expressed as the cost of

도 2(b)를 참조하면, Candy 와 Polos는 서로 가장 연관성이 낮은 두 항목으로 lognestPath = 7인 경우이며, 동일한 노드(C5)인 Beverage 내의 Coke와 Sprite의 최단 경로는 itemPath = 2인 것을 알 수 있다. Referring to FIG. 2(b), Candy and Polos are the two items with the lowest correlation, and lognestPath = 7, and it can be seen that the shortest path of Coke and Sprite in Beverage, which is the same node (C5), is itemPath = 2. have.

2) 동적 타임 워핑(DTW) 거리2) Dynamic Time Warping (DTW) Distance

동적 타임 워핑 알고리즘은 두 시계열 간의 거리를 최소화하는 방향으로 움직이면서 매칭시켜 누적 거리를 활용하여 거리를 계산한다. 시퀀스

Figure 112019123732271-pat00060
,
Figure 112019123732271-pat00061
에 대하여
Figure 112019123732271-pat00062
크기의 2차원 무한대 값을 가지는 배열
Figure 112019123732271-pat00063
을 생성한다.
Figure 112019123732271-pat00064
는 레벤슈타인 거리 알고리즘과 달리 비교하고자 하는 두 항목에 대한 비용(cost)을 먼저 계산한 후, 삭제(
Figure 112019123732271-pat00065
), 일치(
Figure 112019123732271-pat00066
), 삽입(
Figure 112019123732271-pat00067
) 비용 중 최솟값에 더한다. The dynamic time warping algorithm calculates the distance using the accumulated distance by matching while moving in a direction that minimizes the distance between the two time series. sequence
Figure 112019123732271-pat00060
,
Figure 112019123732271-pat00061
about
Figure 112019123732271-pat00062
an array of two-dimensional infinity values
Figure 112019123732271-pat00063
create
Figure 112019123732271-pat00064
is different from the Levenstein distance algorithm, calculates the cost of the two items to be compared first, and then deletes (
Figure 112019123732271-pat00065
), Same(
Figure 112019123732271-pat00066
), insert (
Figure 112019123732271-pat00067
) to the minimum of the costs.

코드 3의 의사코드 중 네모 칸은 코드 2의 제안 방법을 적용한 동적 타임 워핑 유사도에 대한 의사 코드이며, 해당 부분이 두 값의 차이(

Figure 112019123732271-pat00068
)인 경우 기존의 동적 타임 워핑 알고리즘이 수행된다. 본 발명에서는
Figure 112019123732271-pat00069
의 한 지점에서
Figure 112019123732271-pat00070
의 다른 지점으로 할당되는 매핑(mapping) 비용을 두 값의 차이가 아닌 제안 방법을 통하여 0에서 1 사이의 값을 가지도록 하였다.Among the pseudocodes of Code 3, the squares are pseudocodes for the dynamic time warping similarity to which the proposed method of Code 2 is applied, and the corresponding part is the difference between the two values (
Figure 112019123732271-pat00068
), the existing dynamic time warping algorithm is performed. In the present invention
Figure 112019123732271-pat00069
at a point in
Figure 112019123732271-pat00070
The mapping cost, which is allocated to different points of , is set to have a value between 0 and 1 through the proposed method, rather than the difference between the two values.

코드 3은 Pseudo-code of DTW algorithm에 관한 것이다.Code 3 relates to the pseudo-code of DTW algorithm.

<코드 3><Code 3>

Figure 112019123732271-pat00071
Figure 112019123732271-pat00071

3) 니들만-브니쉬(NW: Needleman-Wunsch) 유사도3) Needleman-Wunsch (NW: Needleman-Wunsch) similarity

니들만-브니쉬 알고리즘은 두 시퀀스 간의 변화(mutation)를 최소화 하면서 공백을 사용하여 두 시퀀스의 유사도가 가장 높도록 정렬한다. 시퀀스

Figure 112019123732271-pat00072
,
Figure 112019123732271-pat00073
에 대하여
Figure 112019123732271-pat00074
크기의 2차원 배열
Figure 112019123732271-pat00075
을 생성하여 0으로 초기화한다. 알고리즘 수행을 위해 공백 페널티(gap penalty), 일치 보상(match award), 불일치 페널티(mismatch penalty) 세 변수에 대한 사용자 정의 값을 지정한다. 사용자 정의 값에 따라서 계산된 유사도 값의 범위가 달라지며, 본 발명에서는 상품 분류 트리를 활용한 연산 비용은 0에서 1 사이의 값을 가지므로 일치 보상은 1, 불일치 페널티는 0, 공백 페널티는 -1로 주었다. 사용자 정의 값이 다음과 같은 경우 니들만-브니쉬 유사도 NW Sim(
Figure 112019123732271-pat00076
,
Figure 112019123732271-pat00077
)는
Figure 112019123732271-pat00078
사이 값을 가진다. The Needleman-Bnish algorithm aligns the two sequences with the highest degree of similarity using spaces while minimizing mutations between the two sequences. sequence
Figure 112019123732271-pat00072
,
Figure 112019123732271-pat00073
about
Figure 112019123732271-pat00074
two-dimensional array of sizes
Figure 112019123732271-pat00075
is created and initialized to 0. Specify user-defined values for three variables: gap penalty, match award, and mismatch penalty to perform the algorithm. The range of the calculated similarity value varies according to the user-defined value, and in the present invention, the calculation cost using the product classification tree has a value between 0 and 1, so the match reward is 1, the mismatch penalty is 0, and the blank penalty is - given as 1. Needleman-Varnish Similarity NW Sim(
Figure 112019123732271-pat00076
,
Figure 112019123732271-pat00077
) is
Figure 112019123732271-pat00078
has a value between

코드 4는 Pseudo-code of Needleman-Wunsch algorithm에 관한 것이다.Code 4 relates to the Pseudo-code of Needleman-Wunsch algorithm.

<코드 4><Code 4>

Figure 112019123732271-pat00079
Figure 112019123732271-pat00079

코드 4는 제안 방법을 적용한 니들만-브니쉬 알고리즘에 대한 의사 코드이며, 네모 칸은 상품 분류 트리 내에서 두 상품 간의 연관성을 계산하는 제안 방법에 대한 코드 2의 의사 코드이다. 만일 해당 부분이 비교 하고자 하는 두 항목(

Figure 112019123732271-pat00080
,
Figure 112019123732271-pat00081
)의 일치 유무에 따라서 일치 보상(match award) 혹은 불일치 페널티(mismatch penalty)가 부여된다면 기존의 니들만-브니쉬 거리가 계산된다.Code 4 is the pseudo code for the Needlemann-Bnish algorithm to which the proposed method is applied, and the square box is the pseudo code of code 2 for the proposed method for calculating the association between two products in the product classification tree. If the part wants to compare two items (
Figure 112019123732271-pat00080
,
Figure 112019123732271-pat00081
), if a match award or a mismatch penalty is given depending on the presence or absence of a match, the existing Needleman-Bnish distance is calculated.

4. 실험 결과4. Experimental results

본 장에서는 본 발명에서 제안한 상품 분류 체계를 활용한 구매이력 시퀀스 간 유사도 측정 방법에 대한 성능 측정 결과를 보인다. 제2.3절에서 설명한 대표적인 유사도 측정 방법인 레벤슈타인 거리, 동적 타임 워핑 거리, 니들만-브니쉬 유사도에 대하여 기존 방법과 제안 방법과의 유사도 측정 비교 결과와 세 알고리즘에 대한 수행 시간 비교 결과를 보인다.This chapter shows the performance measurement results for the similarity measurement method between purchase history sequences using the product classification system proposed in the present invention. The comparison results of similarity measurements between the existing method and the proposed method with respect to the Levenstein distance, dynamic time warping distance, and Needlemann-Bnish similarity, which are representative similarity measurement methods described in Section 2.3, and the execution time comparison results for the three algorithms are shown.

4.1 실험 환경 및 방법4.1 Experimental environment and methods

본 발명에서 제안한 구매이력 데이터 시퀀스간의 유사도 측정 방법은 Python 3.7을 사용하여 동적 프로그래밍으로 구현하였으며, 상품 분류 트리는 anytree 라이브러리를 사용하여 구현하였다. 실험은 Intel i7-5820 3.3 GHz CPU, 8GB 메모리가 장착된 Windows 10 운영체제 환경의 PC에서 수행하였다. The similarity measurement method between purchase history data sequences proposed in the present invention was implemented by dynamic programming using Python 3.7, and the product classification tree was implemented using the anytree library. The experiment was performed on a PC running Windows 10 operating system equipped with Intel i7-5820 3.3 GHz CPU and 8GB memory.

실험에서 사용한 상품 분류 트리의 높이는 5이며, 총 37개의 노드를 가진다. 트리는 상품을 의미하는 26개의 단말 노드(leaf node)와 상품의 범주에 해당하는 11개의 노드로 구성된다. 실험에서는 시퀀스 내 항목의 개수가 3에서 10 사이를 가지는 가상의 시퀀스 데이터를 생성하여 사용하였다. The product classification tree used in the experiment has a height of 5 and has a total of 37 nodes. The tree consists of 26 leaf nodes representing products and 11 nodes corresponding to product categories. In the experiment, virtual sequence data in which the number of items in the sequence ranges from 3 to 10 was generated and used.

표 2은 Evaluation results for different similarity measures에 관한 것이다.Table 2 relates to Evaluation results for different similarity measures.

[표 2][Table 2]

Figure 112019123732271-pat00082
Figure 112019123732271-pat00082

4.2 실험 결과4.2 Experimental results

본 절에서는 다양한 시퀀스 간의 유사도 측정 방법에 따른 성능 측정 결과를 보인다. This section shows the performance measurement results according to the similarity measurement method between various sequences.

1) 정확성 비교 실험1) Accuracy comparison experiment

먼저 제안 방법이 기존의 시퀀스 유사도 측정 방법에 비하여 구매이력 데이터에서 시퀀스 간의 유사도를 더 정확히 계산할 수 있는지 평가하였다. First, it was evaluated whether the proposed method can more accurately calculate the similarity between sequences in the purchase history data compared to the existing sequence similarity measurement method.

시퀀스 3는 정확성 측정 실험에 사용한 가상의 시퀀스 데이터이다. 시퀀스 3에서 예제 1과 예제 2는 제안 방법이 기존의 유사도 방법에 비하여 구매 이력 시퀀스 간의 유사도를 더 정확히 계산하는지 측정하기 위한 실험 데이터로 예제 1은 가상의 시퀀스 데이터이며, 예제 2는 실제 소비자의 아마존 구매이력에 대한 실험 데이터이다. 마지막으로 예제 3은 서로 다른 크기를 가지는 시퀀스에 대한 유사도 측정 가상의 시퀀스 데이터이다.Sequence 3 is virtual sequence data used in the accuracy measurement experiment. In Sequence 3, Example 1 and Example 2 are experimental data to measure whether the proposed method more accurately calculates the similarity between purchase history sequences compared to the existing similarity method. This is experimental data on purchase history. Finally, Example 3 is similarity measurement virtual sequence data for sequences having different sizes.

시퀀스 3은 Examples of sequence data 에 관한 것이다.Sequence 3 relates to Examples of sequence data.

[시퀀스 3][Sequence 3]

Figure 112019123732271-pat00083
Figure 112019123732271-pat00083

예제 1의

Figure 112019123732271-pat00084
,
Figure 112019123732271-pat00085
과 예제 2의
Figure 112019123732271-pat00086
,
Figure 112019123732271-pat00087
는 서로 유사하지 않은 구매이력 시퀀스이며 예제 1의
Figure 112019123732271-pat00088
,
Figure 112019123732271-pat00089
과 예제 2의
Figure 112019123732271-pat00090
,
Figure 112019123732271-pat00091
는 서로 매우 유사도가 높은 구매 상품으로 구성된 시퀀스이다. 이를 통하여 제안 방법과 기존 방법과의 정확도를 비교하였다. 예제 3의 경우
Figure 112019123732271-pat00092
Figure 112019123732271-pat00093
과 시퀀스의 크기가 다르지만 크게 보면 동일한 범주의 구매순서(간식, 전자 제품, 음료 순)를 가진다. 이를 통해 서로 다른 길이를 가지는 시퀀스에 대해서도 정확히 유사도를 계산하는지 측정하였다.Example 1 of
Figure 112019123732271-pat00084
,
Figure 112019123732271-pat00085
and in Example 2
Figure 112019123732271-pat00086
,
Figure 112019123732271-pat00087
is a sequence of purchase history that are not similar to each other, and
Figure 112019123732271-pat00088
,
Figure 112019123732271-pat00089
and in Example 2
Figure 112019123732271-pat00090
,
Figure 112019123732271-pat00091
is a sequence composed of purchased products that are very similar to each other. Through this, the accuracy of the proposed method and the existing method was compared. For example 3
Figure 112019123732271-pat00092
is
Figure 112019123732271-pat00093
Although the size of the sequence is different, they have the same purchase order (snacks, electronic products, beverages) in the same category. Through this, it was measured whether similarity was accurately calculated even for sequences having different lengths.

<표 2>은 시퀀스 3의 가상의 시퀀스 데이터를 사용하여 기존의 세 알고리즘에서의 유사도 측정 결과와 제안 방법을 적용한 유사도 측정 결과에 대한 결과표이다. 예제 1에 대한 실험 결과, 기존의 레벤슈타인 거리와 니들만-브니쉬 유사도의 경우 세 시퀀스를 구성한 구매 상품이 모두 다르기 때문에 동일한 수치를 계산한다. 하지만 동적 타임 워핑 거리의 경우 2차원 배열을 다른 두 유사도 측정 방법과 달리 두 값의 차이(

Figure 112019123732271-pat00094
)를 사용하여 초기화하기 때문에
Figure 112019123732271-pat00095
,
Figure 112019123732271-pat00096
의 거리와
Figure 112019123732271-pat00097
,
Figure 112019123732271-pat00098
의 거리가 다르게 계산되지만 상품 간의 연관 정도는 고려하지 않고 계산한다. 반면 제안 방법을 적용한 세 알고리즘의 경우 모두 상품 간의 유사도가 낮은
Figure 112019123732271-pat00099
,
Figure 112019123732271-pat00100
에 비하여 상대적으로 시퀀스 내 상품 간의 연관성이 높은
Figure 112019123732271-pat00101
,
Figure 112019123732271-pat00102
에 대하여 더 정확히 계산하는 것을 볼 수 있다. <Table 2> is a result table for the similarity measurement results in the three existing algorithms using the virtual sequence data of Sequence 3 and the similarity measurement results by applying the proposed method. As a result of the experiment for Example 1, in the case of the existing Levenstein distance and Needleman-Bnish similarity, the same value is calculated because the purchased products constituting the three sequences are all different. However, in the case of dynamic time warping distance, the difference (
Figure 112019123732271-pat00094
) because it is initialized using
Figure 112019123732271-pat00095
,
Figure 112019123732271-pat00096
with the distance of
Figure 112019123732271-pat00097
,
Figure 112019123732271-pat00098
Although the distance of is calculated differently, it is calculated without considering the degree of association between products. On the other hand, in all three algorithms to which the proposed method is applied, the similarity between products is low.
Figure 112019123732271-pat00099
,
Figure 112019123732271-pat00100
relatively high correlation between products in the sequence compared to
Figure 112019123732271-pat00101
,
Figure 112019123732271-pat00102
It can be seen that a more accurate calculation of

또한 실제 데이터를 사용한 예제 2의 경우에도 예제 1과 같이 상품간의 연관성이 더 높은 두 시퀀스가 그렇지 않은 경우보다 더 높은 유사도를 보임을 실험을 통해 확인하였다. 이를 통해 기존의 방법들은 서로 다른 상품에 대해서 단순히 1을 부여 하여 계산하지만 제안 방법을 적용한 경우 상품 분류 트리를 고려하여 계산하기 때문에 서로 다른 상품으로 구성된 시퀀스라도 더 정확하게 유사도를 계산하게 된다. Also, in the case of Example 2 using real data, it was confirmed through experiment that two sequences with higher correlation between products as in Example 1 showed a higher similarity than the case where they were not. Through this, the existing methods calculate by simply assigning 1 to different products, but when the proposed method is applied, the similarity is calculated more accurately even in a sequence composed of different products because the calculation is performed in consideration of the product classification tree.

예제 3의 실험 결과, 레벤슈타인 거리와 니들만-브니쉬 유사도의 경우 두 시퀀스의 상품 하나하나에 대해서만 비교하기 때문에 비슷한 구매 순서를 보이더라도 제안 방법과 기존 방법 모두 동일한 유사도 값을 보인다. 하지만 제안 방법을 적용한 동적 타임 워핑 거리의 경우 길이가 다르더라도 기존 방법으로 측정한 거리(3)와 달리 더 낮은 수치(0.75)를 계산한다. 이는 동적 타임 워핑 거리의 경우 누적 거리를 활용하여 시퀀스 내 하나의 항목이 다른 시퀀스의 여러 항목과 대응되어 계산하기 때문에 있기 때문에

Figure 112019123732271-pat00103
Figure 112019123732271-pat00104
의 길이가 다르더라도 더 정확하게 유사도가 계산된 것이라고 판단된다.As a result of the experiment in Example 3, in the case of Levenstein distance and Needlemann-Bnish similarity, both the proposed method and the existing method show the same similarity value even if they show a similar purchase order because only each product of the two sequences is compared. However, in the case of the dynamic time warping distance to which the proposed method is applied, a lower value (0.75) is calculated unlike the distance (3) measured by the existing method even if the length is different. This is because in the case of dynamic time warping distance, one item in a sequence is calculated by using the cumulative distance to correspond to multiple items in another sequence.
Figure 112019123732271-pat00103
and
Figure 112019123732271-pat00104
Even if the lengths of are different, it is judged that the similarity is calculated more accurately.

구매이력 시퀀스에 대한 실험 결과 제안 방법을 적용한 세 알고리즘 모두 기존의 알고리즘에 비해 상품간의 관련성을 고려하여 계산하기 때문에 더 정확하게 유사도를 측정함을 확인하였다. 또한 동적 타임 워핑 알고리즘의 경우 서로 다른 길이의 시퀀스에 대한 유사도 측정에 대해서도 다른 두 유사도 측정 방법과 달리 정확히 측정함을 실험을 통해 확인하였다.As a result of the experiment on the purchase history sequence, it was confirmed that all three algorithms to which the proposed method was applied measure the similarity more accurately than the existing algorithms because they consider the relevance between products. In addition, it was confirmed through experiments that the dynamic time warping algorithm accurately measures the similarity of sequences of different lengths, unlike the other two similarity measurement methods.

2) 수행 속도 비교 실험2) Performance speed comparison experiment

다음으로는 제안하는 시퀀스 유사도 측정 기법의 수행 시간을 측정하여 수용가능한 수준인지 평가하였다. 실험은 기존 방법과 제안 방법을 적용한 레벤슈타인 거리, 동적 타임 워핑 거리, 니들만-브니쉬 유사도에 대해서 측정하였다. 두 시퀀스가 주어졌을 때, 시퀀스 간의 유사도 측정 횟수를 2000번에서 10000번까지 증가시켜가며 수행 시간을 측정하였다. 시퀀스 유사도 측정 시 매번 다른 임의의 상품 구성과 길이를 가지도록 가상의 시퀀스 데이터를 생성하였다. Next, the execution time of the proposed sequence similarity measurement technique was measured to evaluate whether it was an acceptable level. Experiments were performed on the Levenstein distance, the dynamic time warping distance, and the Needlemann-Bnish similarity to which the existing method and the proposed method were applied. When two sequences were given, the execution time was measured by increasing the number of similarity measurements between the sequences from 2000 to 10000 times. When measuring sequence similarity, virtual sequence data was generated to have a different random product composition and length each time.

도 3은 제안 방법을 적용한 수행 시간 측정 결과 (Experimental results for proposed methods)이다3 is a measurement result of the execution time applied to the proposed method (Experimental results for proposed methods)

<표 3>는 시퀀스 유사도 측정횟수가 10000번인 경우에 대한 기존 방법의 수행 시간을 나타낸 표이다. 도 3을 참조하면, 실험 결과 연산 속도는 세 유사도 비교 방법 모두 시퀀스 내 상품의 개수와 시퀀스 내 상품 구성에 따라 의존하는 경향을 보였으며, 기존 방법과 제안 방법의 수행 시간은 10번 측정 후 중앙값을 취하였다. 표 3는 Evaluation results for conventional methods에 관한 것이다. <Table 3> is a table showing the execution time of the existing method when the number of sequence similarity measurements is 10000 times. Referring to FIG. 3 , as a result of the experiment, the calculation speed of all three similarity comparison methods showed a tendency to depend on the number of products in the sequence and the composition of products in the sequence, and the execution time of the existing method and the proposed method was the median value after 10 measurements. took Table 3 relates to Evaluation results for conventional methods.

[표 3][Table 3]

Figure 112019123732271-pat00105
Figure 112019123732271-pat00105

측정 결과 비교 횟수가 증가할수록 수행 시간이 선형적으로 증가하는 모습을 보이며, 세 알고리즘은 모두 비슷한 수행 시간을 보인다. 이는 세 알고리즘 모두 알고리즘의 수행 과정이 두 시퀀스에 대한 2차원 배열을 활용하여 계산하기 때문에 비슷한 수행 시간을 보인 것으로 판단된다. 또한 <표 3>의 기존 방법의 수행 시간에 비하여 제안 방법의 수행 시간은 상품 분류 트리를 탐색 과정으로 인해 더 긴 수행시간을 보인다. 하지만 제안 방법을 적용한 세 가지 알고리즘 모두 수행시간은 최대 2분을 넘지 않으며, 이는 제안 방법의 수행 시간이 실제 사용 가능한 수준임을 나타낸다. As a result of the measurement, the execution time increases linearly as the number of comparisons increases, and all three algorithms show similar execution times. It is judged that all three algorithms show similar execution times because the algorithm's execution process is calculated using the two-dimensional array for the two sequences. In addition, compared to the execution time of the existing method in <Table 3>, the execution time of the proposed method is longer due to the product classification tree search process. However, the execution time of all three algorithms to which the proposed method is applied does not exceed a maximum of 2 minutes, indicating that the execution time of the proposed method is at a practically usable level.

5. 결 론5. Conclusion

본 발명에서는 기존의 시퀀스 유사도 측정방법을 확장하여 구매이력 데이터에서 상품 분류 체계를 고려하여 두 시퀀스 간의 유사도를 계산하는 새로운 방법을 제안하였다. 본 발명에서 계산하고자 하는 구매이력 시퀀스란 고객 한명이 구매한 항목들이 순서대로 나열된 데이터이다. 이러한 두 구매이력 시퀀스와 상품 분류 체계가 주어졌을 때, 기존의 유사도 측정 방법은 시퀀스를 구성한 구매 상품의 순서만을 고려하여 유사도를 계산한다. 이는 두 시퀀스가 구매 이력인 경우 비교하고자 하는 두 상품간의 연관성은 무시되게 된다. 따라서 본 발명에서는 시퀀스 내 구성 상품의 순서를 고려할 뿐만 상품 분류 체계를 활용하여 서로 다른 상품으로 구성된 시퀀스에 대해서도 보다 정확히 유사도를 계산한다.In the present invention, by extending the existing sequence similarity measurement method, a new method for calculating the similarity between two sequences in consideration of the product classification system in the purchase history data is proposed. The purchase history sequence to be calculated in the present invention is data in which items purchased by one customer are listed in order. Given these two purchase history sequences and the product classification system, the existing similarity measurement method calculates the similarity by considering only the order of purchased products constituting the sequence. In this case, if the two sequences are purchase histories, the correlation between the two products to be compared is ignored. Therefore, in the present invention, not only the order of the constituent products in the sequence is considered, but also the similarity is more accurately calculated for the sequence composed of different products by using the product classification system.

본 발명에서는 구매이력 시퀀스에 적합한 유사도 측정 방법을 찾기 위해 다양한 시퀀스 유사도 측정방법들을 고려하였다. 이를 위해 현재 대표적인 시퀀스 유사도 측정 방법인 레벤슈타인 거리, 동적 타임 워핑 거리, 니들만-브니쉬 유사도를 사용했으며, 제안 방법을 적용하기 위해 이들의 수행 과정 중 일부분을 변형하였다. 기존의 세 알고리즘은 시퀀스 내 항목 간의 연산 비용 계산 시 상품 일치 유무에 따라 단순히 0 또는 1을 부여하였다면, 본 발명에서 제안한 방법은 상품 분류 트리를 사용하여 연산 비용을 0에서 1 사이의 값을 가지도록 세분화하였다. 새롭게 계산한 연산 비용은 비교하고자 하는 두 상품이 상품 분류 트리에서 가장 가까운 공통 범주까지의 경로를 의미하며, 가장 가까운 공통 범주가 루트 노드(root node)인 경우에만 1을 부여한다. 이를 통해 상품간의 서로 다른 중요도를 고려할 수 있으며 독립적인 개체로 계산 할 때 보다 의미 있는 결과가 도출됨을 실험을 통해 확인하였다. 세 알고리즘에 대한 정확성 측정 비교 실험 결과 동적 타임 워핑 유사도가 다른 두 유사도 측정 방법에 비하여 시퀀스 내 상품의 연관 정도를 고려할 뿐만 아니라 두 시퀀스의 길이가 다른 경우에도 좋은 성능을 보였기 때문에 구매이력 데이터에서 시퀀스 간의 유사도 비교 시 가장 적합한 측정 방법임을 확인하였다.In the present invention, in order to find a similarity measurement method suitable for a purchase history sequence, various sequence similarity measurement methods are considered. To this end, we used Levenstein distance, dynamic time warping distance, and Needlemann-Bnish similarity, which are currently representative methods for measuring sequence similarity, and some of these performance processes were modified to apply the proposed method. If the existing three algorithms simply assign 0 or 1 depending on whether or not products match when calculating the calculation cost between items in a sequence, the method proposed in the present invention uses a product classification tree to set the calculation cost to have a value between 0 and 1. segmented. The newly calculated computational cost means the path from the product classification tree of the two products to be compared to the closest common category, and 1 is assigned only when the closest common category is the root node. Through this, it was confirmed through experiment that different importance between products can be considered and more meaningful results are derived when calculated as independent entities. As a result of the accuracy measurement comparison experiment for the three algorithms, compared to the two similarity measurement methods with different dynamic time warping similarity, not only the degree of correlation of products in a sequence was considered, but also good performance was shown even when the lengths of the two sequences were different. It was confirmed that it is the most suitable measurement method when comparing similarity.

본 발명에서는 시퀀스 유사도 측정 과정 중 서로 다른 상품이더라도 두 상품 간의 연관 정도를 계산하기 위하여 주어진 상품 분류 트리를 탐색하는 과정을 거친다. 추후 연구에는 시퀀스 내 상품 구성 복잡도를 높여가며 다양한 시퀀스 길이를 가지는 두 시퀀스에 대한 상품 분류 트리 고속화 탐색 방법과 유사도 측정 성능 향상 방법에 대하여 연구할 계획이다.In the present invention, a process of searching a given product classification tree is performed in order to calculate the degree of association between two products even for different products during the sequence similarity measurement process. In future research, we plan to study a method for speeding up the product classification tree search for two sequences with various sequence lengths while increasing the product composition complexity in the sequence and a method for improving the similarity measurement performance.

이하에서 상술한 본 발명의 일 실시예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치 및 그 제어 방법의 기계학습 모델(방법)에서 개량된 부분에 대해 설명한다. 상술한 본 발명의 내용과 후술할 본 발명의 내용은 서로 하나의 기술적 사상을 가지고 있으며, 각 부분의 조합으로 본 발명을 구성할 수 있다. Hereinafter, an improved part in the machine learning model (method) of an electronic device for determining the degree of similarity between sequences in consideration of the item classification system according to an embodiment of the present invention and a control method thereof will be described. The content of the present invention described above and the content of the present invention to be described later have a single technical idea, and the present invention can be configured by a combination of each part.

1. 서 론1. Introduction

각 고객이 구매한 상품들은 시간의 흐름에 따라 해당 고객의 구매 이력을 형성한다. 여기서 항목들 간의 순서가 존재하는 데이터를 시퀀스(sequence)라 부른다. 기업은 고객들의 특성과 소비 패턴이 담긴 구매 이력 혹은 구매 시퀀스를 분석하여 매출 증대를 위한 마케팅 전략으로 활용할 수 있다. 한편 유통업에서 거래되는 대부분의 상품들은 소분류, 중분류, 대분류 등과 같은 분류 체계를 가진다. 이 경우 서로 다른 상품이더라도 세부 분류가 동일할수록 두 상품은 그렇지 않은 경우보다 유사성이 더 높다고 할 수 있다. 예를 들어, 만약 두 상품이 같은 소분류에 속한다면, 두 상품이 소분류는 다르지만 같은 중분류에 속하는 경우보다 유사성이 더 높다고 할 수 있다. 지금까지 시퀀스 간의 유사도 측정 방법에 대해서는 많은 연구가 이루어져왔다. 하지만 이들 연구는 모두 시퀀스를 구성하는 각 항목들이 단순히 같은지 다른지 만을 고려하며, 항목들에 분류 체계가 존재하는 경우 이를 고려하는 연구는 거의 없었다.Products purchased by each customer form a purchase history of that customer over time. Here, data in which an order exists between items is called a sequence. A company can analyze the purchase history or purchase sequence containing the characteristics and consumption patterns of customers and use it as a marketing strategy to increase sales. On the other hand, most products traded in the distribution industry have a classification system such as small classification, medium classification, and large classification. In this case, it can be said that the similarity between the two products is higher as the detailed classification is the same even if they are different products. For example, if two products belong to the same sub-category, the similarity is higher than if the two products belong to the same sub-category although they are in different sub-categories. So far, many studies have been conducted on methods for measuring the similarity between sequences. However, all of these studies only consider whether each item constituting a sequence is the same or different, and there have been few studies considering the classification system in the items.

따라서 본 발명에서는 상품 구매 순서뿐만 아니라 상품들에 존재하는 분류 체계까지 고려하는 구매 이력 간 유사도 측정 방법을 제안한다. 본 발명에서 제안하는 구매 이력 간 유사도 측정 방법은 두 구매 이력의 상품이 다르더라도 상품들의 분류가 유사하면 두 구매 이력을 유사하다고 판단한다. 본 발명에서 제안하는 유사도 측정 방법은 기존의 대표적인 시퀀스 유사도 측정 방법인 동적 타임 워핑(dynamic time warping, DTW) 거리를 확장하여, 상품 분류 체계에 따른 상품들 간의 유사성을 거리 계산에 반영한다. 이와 함께 본 발명은 제안하는 유사도 측정 방법에 대한 효율적인 계산 기법을 제안한다. 제안 기법은 세그먼트 트리(segment tree)를 사용하여 상품 분류 체계 내에서 두 상품 간의 유사도를 매우 빠르게 계산한다. 이를 통해 제안 방법은 다수의 구매 이력들을 비교해야 할 때도 매우 효율적으로 사용될 수 있다.Therefore, the present invention proposes a method for measuring similarity between purchase histories that considers not only the order of purchase of products but also the classification system existing in products. The method for measuring the similarity between purchase histories proposed in the present invention determines that the two purchase histories are similar even if the products of the two purchase histories are different, if the classification of the products is similar. The similarity measurement method proposed in the present invention extends the dynamic time warping (DTW) distance, which is a representative sequence similarity measurement method, to reflect the similarity between products according to the product classification system in the distance calculation. In addition, the present invention proposes an efficient calculation technique for the proposed similarity measurement method. The proposed method calculates the similarity between two products very quickly within the product classification system using a segment tree. Through this, the proposed method can be used very efficiently when it is necessary to compare multiple purchase histories.

본 발명의 명세서의 구성은 다음과 같다. 2장에서는 관련 연구를 간략히 살펴보고, 3장에서는 제안 방법에 대하여 상세히 설명한다. 4장에서는 제안 방법의 성능 평가 결과를 보이며, 5장에서는 결론을 맺는다. The structure of the specification of the present invention is as follows. In Chapter 2, we briefly review the related research, and in Chapter 3, we describe the proposed method in detail. Section 4 shows the performance evaluation results of the proposed method, and Section 5 draws a conclusion.

2. 관련 연구2. Related Studies

시퀀스 간의 유사도 측정 방법에 대해서는 이미 많은 연구가 이루어졌다. 그 중 동적 타임 워핑 유사도는 서로 속도가 다른 두 개의 시계열 패턴 간의 유사도를 측정하기 위해 제안된 방법으로서, 두 시계열 간의 거리를 최소화하는 방향으로 항목들을 이동시키면서 누적 거리를 활용하여 유사도를 계산하기 때문에 서로 다른 길이의 시퀀스에 대해서 매우 효율적으로 유사도를 계산하는 것으로 알려져있다. A lot of research has already been done on how to measure the similarity between sequences. Among them, the dynamic time warping similarity is a method proposed to measure the similarity between two time series patterns with different speeds. The similarity is calculated using the accumulated distance while moving items in a direction that minimizes the distance between the two time series. It is known to calculate similarity very efficiently for sequences of different lengths.

본 발명은 상품 분류 체계를 고려하여 구매 이력 간의 유사도를 계산하기 위한 여러 선행 실험을 수행하였다. 본 발명은 시퀀스 간의 유사도를 측정하는 여러 방법들 중 동적 타임 워핑 유사도가 구매 이력 간 유사도 측정에 가장 효과적임을 보였으며, 따라서 이하에서 동적 타임 워핑 유사도를 기반으로 두 구매 이력 간의 유사도를 정확하고 빠르게 측정하는 방법을 제안한다. In the present invention, several previous experiments were performed to calculate the similarity between purchase histories in consideration of the product classification system. The present invention has shown that dynamic time warping similarity is the most effective for measuring similarity between purchase histories among various methods for measuring similarity between sequences. Therefore, the similarity between two purchase histories is accurately and quickly measured based on dynamic time warping similarity in the following. suggest how to

한편 본 발명에서는 제안하는 구매 이력 간 유사도를 빠르게 계산하기 위해 세그먼트 트리를 사용한다. 세그먼트 트리는 각 노드가 그의 자식 노드들이 나타내는 구간들에 대한 정보(예: 합, 최솟값, 최댓값)를 가지고 있는 트리이다. 세그먼트 트리는 각 구간에 대한 정보들을 미리 구해 저장해 두기 때문에 특정 범위 내 최솟값을 찾는 문제 등에 효과적인 것으로 알려져 있다.Meanwhile, in the present invention, a segment tree is used to quickly calculate the similarity between the proposed purchase histories. A segment tree is a tree in which each node has information (eg, sum, minimum, maximum) about the sections represented by its child nodes. The segment tree is known to be effective in the problem of finding the minimum value within a specific range because information on each section is obtained and stored in advance.

3. 제안 방법3. Suggestion method

본 장에서는 상품 분류 체계를 고려한 구매 이력 간 유사도 측정 방법 및 그에 대한 효율적인 계산 방법을 제안한다.In this chapter, we propose a method for measuring the similarity between purchase histories considering the product classification system and an efficient calculation method for it.

3.1 상품 분류 체계를 고려한 구매 이력 간 유사도 측정3.1 Measurement of similarity between purchase histories considering the product classification system

본 발명에서는 기존의 대표적인 시퀀스 유사도 측정 방법인 동적 타임 워핑 유사도를 상품 분류 체계를 반영하도록 확장한다. 두 구매 이력 s 1 = <x 1, x 2, ..., x n >과 s 2 = <y 1, y 2, ..., y m >이 주어졌다고 하자. 여기서 x i y i 는 각 구매 이력에서 i번째로 구매된 항목을 나타낸다. 제안 방법은 두 구매 이력 s 1s 2이 주어졌을 때

Figure 112019123732271-pat00106
크기의 2차원 배열 M 을 생성하고 모든 원소를 ∞로 초기화한다. 이후 M 의 각 원소 M [i][j]를 다음 수학식 2를 사용하여 업데이트한다. In the present invention, the dynamic time warping similarity, which is an existing representative method for measuring sequence similarity, is extended to reflect the product classification system. Suppose we are given two purchase histories s 1 = < x 1 , x 2 , ..., x n > and s 2 = < y 1 , y 2 , ..., y m >. Here, x i and y i represent the i- th purchased item in each purchase history. The proposed method is given when two purchase histories s 1 and s 2 are given.
Figure 112019123732271-pat00106
Create a two-dimensional array M of size M and initialize all elements to ∞. Since each element M [i] [j] of M is then updated by using the equation (2).

[수학식 2][Equation 2]

M [i][j]=dist(x i , y j )+min(M [i - 1][j], M [i][j - 1], M [i - 1][j - 1]) M [ i ][ j ]= dist ( x i , y j )+min( M [ i - 1][ j ], M [ i ][ j - 1], M [ i - 1][ j - 1] )

위 수학식 2에서 dist(x i , y j )는 s 1i번째 항목인 x i s 2j번째 항목인 y j 의 상품 분류 체계를 고려한 거리를 나타낸다. 상품 분류 체계를 고려하지 않는 기존의 동적 타임 워핑 유사도는 x i = y j 인 경우 dist(x i , y j ) = 0이고 x i y j 인 경우 dist(x i , y j ) = 1로 하는 경우에 해당한다. 위 식에서 dist(x i , y j )에 M[i - 1][j], M[i][j - 1], M[i - 1][j - 1] 중 최솟값이 더해지는 것은 각각 s 1의 항목만 하나 전진하여 비교를 계속하는 경우, s 2의 항목만 하나 전진하여 비교를 계속하는 경우, s 1s 2의 항목 모두 하나씩 전진하여 비교를 계속하는 경우를 각각 나타낸다. 본 발명에서는 상품 분류 체계를 반영하여 dist(x i , y j )의 값이 0에서 1 사이의 값을 가질 수 있도록 하였다. dist(x i , y j )는 다음 수학식 3와 같이 정의된다.In Equation 2 above, dist ( x i , y j ) represents a distance in consideration of the product classification system of the i- th item of s 1 , x i and the j- th item of s 2 , y j . Existing dynamic time warping degree of similarity is not considered a product classification system as dist (x i, y j) = 1 if x i = y j a case dist (x i, y j) = 0 , and x i y j applicable to the case In the above equation, the minimum of M [ i - 1][ j ], M [ i ][ j - 1], M [ i - 1][ j - 1] is added to dist ( x i , y j ) is s 1 The cases in which comparison is continued by advancing only one item of s 2 , the case of continuing comparison by advancing only one item of s 2 , and the case of continuing comparison by advancing both items of s 1 and s 2 one by one, respectively. In the present invention, the value of dist ( x i , y j ) can have a value between 0 and 1 by reflecting the product classification system. dist ( x i , y j ) is defined as in Equation 3 below.

[수학식 3] [Equation 3]

Figure 112019123732271-pat00107
Figure 112019123732271-pat00107

위 수학식 3에서 T는 주어진 상품 분류 체계 트리를, shortestPathLen(x i , y j , T)는 T에서 상품 x i y j 를 나타내는 단말 노드 간 최단 경로의 길이를, longestPathLen(T)는 T 내에서 가장 거리가 먼 두 단말 노드 간의 경로의 길이를 나타낸다. dist(x i , y j )은 0과 1 사이의 값을 가지며, 두 상품이 상품 분류 트리 내에서 가까울수록, 즉 세부 분류가 동일할수록 작은 값을 가지고, 두 상품이 상품 분류 트리 내에서 멀수록, 즉, 서로 다른 분류에 속할수록 큰 값을 가진다. 위 식을 통해 모든 M[i][j]의 값을 구하고 나면 최종적으로 M[n][m]의 값이 s 1s 2 간의 거리가 된다.In the above Equation 3 T is a given product taxonomy tree, shortestPathLen (x i, y j , T) is the length of the shortest path end-to-end node that represents a product x i and y j in T, longestPathLen (T) is T It represents the length of the path between the two terminal nodes that are the farthest in the . dist ( x i , y j ) has a value between 0 and 1, and has a smaller value as the two products are closer in the product classification tree, that is, the same subcategories are the same, and the further the two products are within the product classification tree, the smaller the value. , that is, it has a larger value as it belongs to different classifications. After obtaining all the values of M [ i ][ j ] through the above expression, the final value of M [ n ][ m ] becomes the distance between s 1 and s 2 .

3.2 효율적인 유사도 계산 기법3.2 Efficient similarity calculation technique

앞서 제안한 구매 이력 간 유사도 측정을 위해서는 s 1의 원소 x i s 2의 원소 y j 간의 거리를 나타내는 dist(x i , y j )를 모든 x i y j 에 대해 반복적으로 계산해야 한다. 따라서 s 1s 2의 길이가 길어질수록 계산 비용이 증가한다. dist(x i , y j )에서 longestPathLen(T)는 고정된 값이므로, shortestPathLen(x i , y j , T)를 효율적으로 구하는 것이 효율적인 유사도 계산에 매우 중요하다. 주어진 x i y j 에 대해 shortestPathLen(x i , y j , T)를 구하는 간단한 방법은 T의 루트 노드에서 x i 까지의 경로와 y j 까지의 경로를 각각 구한 후, 두 경로에 포함된 노드들을 하나씩 비교하여 서로 다른 노드들의 개수를 구하면 매우 간단히 계산할 수 있다. 하지만 이 방법은 T의 크기가 커질수록 계산 비용이 증가한다는 단점이 있다. 특히 s 1s 2의 길이가 길어질수록 이 연산을 반복해야 하므로 전체 유사도를 계산하는 비용이 크게 증가한다는 문제가 있다.In order to measure the degree of similarity between the previously proposed purchase history for dist (x i, y j) indicates the distance between the elements of the element y j x i and s 2 s 1 of the calculation should be repeated for all x i and y j. Therefore, the computational cost increases as the lengths of s 1 and s 2 increase. Since longestPathLen ( T ) in dist ( x i , y j ) is a fixed value, it is very important to efficiently calculate shortestPathLen ( x i , y j , T ) for efficient similarity calculation. A simple way to find the shortestPathLen ( x i , y j , T ) for a given x i and y j is to find the path from the root node of T to x i and y j , respectively, and then to the node included in the two paths. It can be calculated very simply by comparing them one by one and finding the number of different nodes. However, this method has the disadvantage that the computation cost increases as the size of T increases. In particular, as the lengths of s 1 and s 2 become longer, this operation has to be repeated, so there is a problem in that the cost of calculating the overall similarity greatly increases.

따라서 본 발명에서는 세그먼트 트리를 사용하여 shortestPathLen(x i , y j , T)를 매우 효율적으로 계산하는 기법을 제안한다. 제안하는 기법은 먼저 상품 분류 체계 트리를 한번 전위 순회하여 2개의 1차원 배열을 생성한다. 두 배열에는 순회하며 방문한 노드의 순서와 각 노드의 깊이가 각각 저장된다. 방문 노드 순서가 저장된 배열을 통해 생성된 세그먼트 트리를 활용하여 shortestPathLen(x i , y j , T)을 계산하기 위하는 새롭게 제안한 수학식 4는 다음과 같다. Therefore, the present invention proposes a technique for very efficiently calculating the shortestPathLen ( x i , y j , T ) using a segment tree. The proposed method first traverses the product classification system tree once to create two one-dimensional arrays. The two arrays store the order of the nodes visited and the depth of each node, respectively. The newly proposed Equation 4 for calculating the shortestPathLen ( x i , y j , T ) using the segment tree generated through the array in which the visited node order is stored is as follows.

[수학식 4][Equation 4]

shortestPathLen(x i , y j , T) = depth[x i ]+depth[y j ]-2

Figure 112019123732271-pat00108
depth[LCA(x i , y j , T)] shortestPathLen ( x i , y j , T ) = depth [ x i ]+ depth [ y j ]-2
Figure 112019123732271-pat00108
depth [ LCA ( x i , y j , T )]

위 식에서 LCA(x i , y j , T)는 세그먼트 트리로 계산된 두 상품의 가장 가까운 공통 분류이며, depth[]는 전위 순회 결과 저장된 각 노드의 깊이가 저장된 배열이다. x i 에서 LCA(x i , y j , T)까지 경로의 길이는 depth[x i ]-depth[LCA(x i , y j , T)]이며, LCA(x i , y j , T)에서 y j 까지 경로의 길이는 depth[y j ]-depth[LCA(x i , y j , T)]이므로 두 x i , y j 의 최단 경로의 길이는 위의 수학식 4가 된다.In the above equation, LCA ( x i , y j , T ) is the closest common classification of the two products calculated by the segment tree, and depth[] is an array in which the depth of each node stored as a result of the translocation traversal is stored. The length of the path from x i to LCA ( x i , y j , T ) is depth [ x i ] -depth [ LCA ( x i , y j , T )], and from LCA ( x i , y j , T ) Since the length of the path up to y j is depth [ y j ] -depth [ LCA ( x i , y j , T )], the length of the shortest path of two x i , y j becomes Equation 4 above.

이후 상품 분류 체계 트리 내에서 두 상품 간의 거리를 계산할 때는 이 세그먼트 트리를 사용하여 두 상품의 가장 가까운 공통 분류와 두 상품의 깊이 정보를 알아내고, 이를 활용하여 shortestPathLen(x i , y j , T)를 바로 계산한다. 따라서 shortestPathLen(x i , y j , T) 계산 시 T의 루트 노드에서 x i 까지의 경로와 y j 까지의 경로를 각각 구하고 두 경로를 비교하는 과정이 모두 제거되므로 총 계산 비용이 크게 감소된다.Then, when calculating the distance between two products in the product classification system tree, this segment tree is used to find the closest common classification of the two products and the depth information of the two products, and using this, shortestPathLen ( x i , y j , T ) calculate directly Therefore, when calculating shortestPathLen ( x i , y j , T ), the process of finding the path from the root node of T to x i and y j , and comparing the two paths is eliminated, so the total computation cost is greatly reduced.

4. 성능 평가4. Performance evaluation

본 장에서는 제안하는 구매 이력 간 유사도 계산 방법에 대한 실험 결과를 보인다. 제안 방법은 Python을 사용하여 구현하였으며, 실험은 Intel i7-5820 3.3GHz CPU, 8GB 메모리가 장착된 Windows 10 운영체제 환경의 PC에서 수행하였다. 상품 분류 체계는 대표적 온라인 쇼핑몰인 미국의 아마존(Amazon)의 실제 분류 체계를 수집한 뒤 이를 트리 형태로 구축하여 사용하였다.In this chapter, the experimental results of the proposed similarity calculation method between purchase histories are presented. The proposed method was implemented using Python, and the experiment was performed on a PC in Windows 10 operating system environment equipped with Intel i7-5820 3.3GHz CPU and 8GB memory. The product classification system was used after collecting the actual classification system of Amazon, a representative online shopping mall, and building it in the form of a tree.

4.1 유사도 측정 방법 효과 평가4.1 Evaluation of the effectiveness of the similarity measurement method

먼저 상품 분류 체계를 고려한 제안 유사도 측정 방법이 기존의 시퀀스 유사도 측정 방법에 비하여 구매 이력 간의 유사도를 더 효과적으로 계산하는지 평가하였다. 표 4은 간단한 가상 구매 이력 데이터에 대해 제안 방법을 적용한 결과(유사도 비교 실험 결과)이다. First, it was evaluated whether the proposed similarity measurement method considering the product classification system calculates the similarity between purchase histories more effectively than the existing sequence similarity measurement method. Table 4 shows the results of applying the proposed method to simple virtual purchase history data (similarity comparison experiment results).

주어진 세 개의 구매 이력 s 1, s 2, s 3은 그에 속한 상품들이 모두 다르지만 s 1s 2s 1s 3에 비해 상품들의 분류가 비슷하다 (예: Coke와 Sprite는 모두 음료에 속함) 이 경우 기존의 동적 타임 워핑 유사도는 s 1s 2간의 거리와 s 1s 3간의 거리를 모두 6으로 계산하지만, 제안 방법은 s 1s 2간의 거리와 s 1s 3간의 거리를 각각 1.5와 5.375로 계산한다. 따라서 제안 방법은 두 구매 이력이 서로 다른 상품들로 구성된 경우에도 상품 분류가 비슷한 상품들에는 더 가까운 거리를 부여함으로써 기존 방법과 비교하여 더 정확한 거리를 계산한다. 또한 동적 타임 워핑 유사도의 특성상 구매 이력의 길이가 서로 다르더라도 적용에 문제가 없음을 확인하였다.Given three purchase histories s 1 , s 2 , and s 3 have different products, s 1 and s 2 have similar product categories compared to s 1 and s 3 (eg, Coke and Sprite both belong to beverages) ) In this case, the existing dynamic time warping similarity calculates the distance between s 1 and s 2 and the distance between s 1 and s 3 as 6, but the proposed method calculates the distance between s 1 and s 2 and the distance between s 1 and s 3 . is calculated as 1.5 and 5.375, respectively. Therefore, the proposed method calculates a more accurate distance compared to the existing method by giving a closer distance to products with similar product classifications, even when the two purchase histories are composed of different products. In addition, it was confirmed that there is no problem in application even if the purchase history lengths are different due to the characteristics of the dynamic time warping similarity.

[표 4] [Table 4]

Figure 112019123732271-pat00109
Figure 112019123732271-pat00109

4.2 유사도 계산 기법 성능 평가4.2 Performance evaluation of similarity calculation technique

다음으로는 세그먼트 트리를 사용하는 유사도 계산 기법이 세그먼트 트리를 사용하지 않는 단순 기법에 비해 계산 속도를 얼마나 더 향상시키는지 평가하였다. 이를 위해 유사도를 100번 계산하고, 이에 걸린 평균 시간을 측정하였다. 유사도 계산을 위해서 랜덤하게 생성된 가상의 구매 이력 데이터를 사용하였으며, 구매 이력의 길이와 상품 분류 트리의 크기를 변화시켜가며 실험을 수행하였다.Next, we evaluated how much the similarity calculation technique using the segment tree improves the calculation speed compared to the simple technique that does not use the segment tree. To this end, the degree of similarity was calculated 100 times, and the average time taken was measured. Randomly generated virtual purchase history data was used to calculate the similarity, and the experiment was performed by changing the length of the purchase history and the size of the product classification tree.

도 4는 구매 이력 길이에 따른 단순 기법과 세그먼트 트리를 적용한 제안 기법의 성능을 비교 그래프이다. 도 5는 상품 분류 체계 트리의 상품 개수에 따른 단순 기법과 제안 기법의 성능을 비교한 그래프 이다. 이하에서 도 4 및 도 5를 참조하여 본 발명에서 제안된 기법의 성능을 설명한다.4 is a graph comparing the performance of a simple technique and a proposed technique to which a segment tree is applied according to a purchase history length. 5 is a graph comparing the performance of the simple technique and the proposed technique according to the number of products in the product classification system tree. Hereinafter, the performance of the technique proposed in the present invention will be described with reference to FIGS. 4 and 5 .

도 4는 상품 분류 체계 트리가 고정된 상태에서 구매 이력의 길이를 증가시켜가며 두 방법의 성능을 비교한 결과이다. 두 방법 모두 구매 이력의 길이가 증가할수록 계산 시간이 선형적으로 증가하지만, 제안 기법의 경우 사전에 구축된 세그먼트 트리를 사용하여 상품 분류 체계 트리에서 두 상품 간의 최단 거리를 빠르게 계산할 수 있으므로 전체 계산 성능이 크게 향상되었음을 알 수 있다.4 is a result of comparing the performance of the two methods while increasing the length of the purchase history while the product classification system tree is fixed. In both methods, the calculation time increases linearly as the length of the purchase history increases, but in the case of the proposed method, the shortest distance between two products in the product classification system tree can be quickly calculated using a pre-built segment tree, so the overall computational performance It can be seen that this has been greatly improved.

도 5는 상품 분류 체계 트리의 상품 개수를 7,000 개에서 25,000 개까지 증가시켜가며 두 방법의 성능을 비교한 결과이다. 단순 방법의 경우 상품 분류 체계 트리가 커질수록 두 상품 간의 최단 거리를 탐색하는 시간이 증가하지만, 제안 방법은 사전에 구축된 세그먼트 트리를 사용하기 때문에 시간이 증가하지 않는 것을 볼 수 있다.5 is a result of comparing the performance of the two methods while increasing the number of products in the product classification system tree from 7,000 to 25,000. In the case of the simple method, as the product classification system tree grows, the time to search for the shortest distance between two products increases, but it can be seen that the time does not increase because the proposed method uses a pre-built segment tree.

5. 결 론5. Conclusion

본 발명에서는 상품 분류 체계를 고려하여 두 구매 이력 간의 유사도를 측정하는 효과적인 방법 및 그의 효율적인 계산 기법을 제안하였다. 이를 위해 기존의 대표적인 시퀀스 유사도 측정 방법인 동적 타임 워핑 유사도를 확장하여 상품 분류 체계 내에서 상품들의 거리를 반영하도록 하였다. In the present invention, an effective method for measuring the similarity between two purchase histories in consideration of a product classification system and an efficient calculation technique thereof have been proposed. To this end, the dynamic time warping similarity, which is a representative method of measuring sequence similarity, was extended to reflect the distance between products within the product classification system.

또한 제안하는 유사도 측정 방법을 효율적으로 계산할 수 있도록 세그먼트 트리를 사용하여 상품 분류 체계 내에서 상품들 간의 거리를 빠르게 계산하는 기법을 제안하였다. 실험 결과 제안 방법은 상품 분류 체계가 존재하는 경우 기존 방법에 비해 더 효과적으로 구매 이력 간의 유사도를 측정함을 보였으며, 세그먼트 트리를 사용하여 매우 빠르게 계산될 수 있음을 확인하였다.In addition, we proposed a technique for quickly calculating the distance between products within the product classification system using a segment tree to efficiently calculate the proposed similarity measurement method. Experimental results showed that the proposed method measures the similarity between purchase histories more effectively than the existing method when a product classification system exists, and it is confirmed that it can be calculated very quickly using a segment tree.

도 6은 본 발명의 일 실시 예에 따른 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법의 흐름도를 도시한 것이다. 6 is a flowchart illustrating a control method for determining a degree of similarity between sequences in consideration of an item classification system according to an embodiment of the present invention.

도 6에 도시된 바와 같이, 본 발명의 일 실시 예에 따른 제어 방법은, 제1 시퀀스를 획득하는 과정(S210), 제2 시퀀스를 획득하는 과정(S230), 제1 및 제2 시퀀스들의 유사 여부를 판단하는 과정(S250)을 포함할 수 있다.As shown in FIG. 6 , in the control method according to an embodiment of the present invention, a process of acquiring a first sequence (S210), a process of acquiring a second sequence (S230), and similarities of the first and second sequences It may include a process of determining whether or not (S250).

과정 S210 및 과정 S230에서, 제1 시퀀스는 순서를 가지는 제1 항목들로 구성되며, 제2 시퀀스는 순서를 가지는 제2 항목들로 구성될 수 있다. 예를 들어, 제1 시퀀스는 순서대로 제1-1 항목, 제1-2 항목, 제1-3 항목을 포함할 수 있으며, 제2 시퀀스는 순서대로 제2-1 항목, 제2-2 항목, 제2-3 항목을 포함할 수 있다. 시퀀스 내 항목들의 수는 2 이상의 값을 가질 수 있다. In steps S210 and S230, the first sequence may be composed of first items having an order, and the second sequence may be composed of second items having an order. For example, the first sequence may include item 1-1, item 1-2, and item 1-3 in order, and the second sequence may include item 2-1 and item 2-2 in order. , items 2-3 may be included. The number of items in the sequence may have a value of two or more.

일 예로, 제1 및 제2 시퀀스는 상품의 구매이력일 수 있으며, 제 1 구매이력은 Sprite, Candy, Jeans 순서를 가지고, 제2 구매이력은 Coke, Chocolate, Skirt 순서를 가질 수 있다.For example, the first and second sequences may be product purchase history, the first purchase history may have the order of Sprite, Candy, and Jeans, and the second purchase history may have the order of Coke, Chocolate, and Skirt.

과정 S250에서, 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단할 수 있다. In step S250, it may be determined whether the first and second sequences are similar based on the first information and the second information.

상기 제1 및 제2 항목들은 동일한 항목 분류 트리의 단말 노드에 해당할 수 있다. 항목 분류 트리란 트리 구조를 가지는 항목 분류 체계로서, 최상단의 노드인 Root로부터 하위 계층으로 분지하여 복수개의 내부 노드(C1 내지 C8) 및 복수개의 내부 노드들 말단인 단말 노드에 항목들(a 내지 k)로 이뤄진다 (도 2(a) 참조). The first and second items may correspond to a terminal node of the same item classification tree. The item classification tree is an item classification system having a tree structure, and branches from the root, which is the top node, to a lower hierarchy, and includes items (a to k) in a plurality of internal nodes (C1 to C8) and a terminal node that is the end of the plurality of internal nodes. ) (see FIG. 2(a)).

시퀀스들의 유사여부를 판단하기 위하여 제1 시퀀스의 <제1-1 항목, 제1-2 항목, 제1-3 항목> 중 하나의 항목와 제2 시퀀스의 <제2-1 항목, 제2-2 항목, 제2-3 항목> 중 하나의 항목 간에 대비하여 시퀀스의 유사 여부를 판단할 수 있다.In order to determine whether the sequences are similar, one of <Item 1-1, Item 1-2, Item 1-3> of the first sequence and <Item 2-1 and Item 2-2 of the second sequence> It is possible to determine whether a sequence is similar by comparing one item among items and items 2-3>.

구체적인 방법 중 하나로, 상기 제1 정보는 제1 시퀀스의 각 항목들 중 하나를 제2 시퀀스의 각 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함할 수 있다. 환언하면 상기 제1 정보는 제1-1 항목을 제2-1 항목, 제2-2 항목, 제2-3 항목으로 변환하기 위한 연산 횟수, 제1-2 항목을 제2-1 항목, 제2-2 항목, 제2-3 항목으로 변환하기 위한 연산 횟수, 제1-3 항목을 제2-1 항목, 제2-2 항목, 제2-3 항목으로 변환하기 위한 연산 횟수를 포함할 수 있다.As a specific method, the first information may include information on the number of operations for converting one of the items of the first sequence into one of the items of the second sequence. In other words, the first information includes the number of operations for converting item 1-1 into item 2-1, item 2-2, item 2-3, and item 1-2 into item 2-1 and item 2-1. 2-2 items, the number of operations for converting items 2-3 into items, and the number of operations for converting items 1-3 into items 2-1, 2-2, and 2-3 can be included. have.

또한, 상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함할 수 있다. Also, the second information may include information about a length of a shortest path in the item classification tree between one of the first items and one of the second items.

종래에는 시퀀스 간 유사 판단을 하기 위하여 항목과 항목 사이의 동일 여부에 대한 정보(0 또는 1)를 사용하였으나, 이는 항목들 간 동일성만 볼 뿐 노드의 연관성에 대한 정보를 포함하지 못하였다. Conventionally, information (0 or 1) on whether an item is identical to an item is used to determine the similarity between sequences, but this only sees the sameness between the items and does not include information on the relationship of nodes.

예를 들어, 종래의 방법에 따르면, 동일 노드 내에 속하고 동일하지 않은 2개의 항목들(Coke, Sprite)과 다른 노드의 2개 항목들(Candy, Polos)의 연관성 정보는 동일하게 비동일 항목을 의미하는 정보(0)를 갖는다. 그러나 (Candy, Polos)의 항목들 보다 (Coke, Sprite)의 항목들이 서로 더 연관된 항목임을 나타내지 못하였다(도 2(a) 참조).For example, according to the conventional method, correlation information between two items (Coke, Sprite) belonging to the same node and not identical and two items (Candy, Polos) of a different node are identically non-identical items. It has the information (0) meaning. However, it did not indicate that the items of (Coke, Sprite) were more related to each other than the items of (Candy, Polos) (see Fig. 2(a)).

본 발명에서 제안하는 방법은 시퀀스 간 유사 판단을 더 정밀하게 하기 위하여 항목들간 최단 경로의 길이를 이용한다. 항목들간 최단 경로의 길이가 짧을수록 항목들 간 연관성 정보는 더 높다고 판단할 수 있다. 예를 들어, (Candy, Polos)의 항목들의 경로는 7이고, (Coke, Sprite)의 항목들의 경로는 2를 갖는다(도 2(b) 참조). 그러므로 (Candy, Polos)의 항목들에 비하여 (Coke, Sprite)의 항목들의 연관성이 높은 것을 의미한다.The method proposed in the present invention uses the length of the shortest path between items in order to more precisely determine the similarity between sequences. It may be determined that the shorter the length of the shortest path between items, the higher the correlation information between items. For example, the path of items of (Candy, Polos) is 7, and the path of items of (Coke, Sprite) has a path of 2 (see FIG. 2(b) ). Therefore, it means that the items of (Coke, Sprite) are highly correlated compared to the items of (Candy, Polos).

나아가, 상기 제2 정보는 상기 항목 분류 트리 내의 항목들의 최장 경로의 길이에 관한 정보를 더 포함할 수 있다. 본 발명에서 제안하는 방법은 항목들의 촤장 경로의 길이를 이용하여 항목들간 연관성 정보의 상대적인 수치를 이용하여 시퀀스들 간 유사도를 측정할 수 있다. 예를 들어, (Coke, Sprite)의 항목들의 상대적인 연관성 정보는 (Coke, Sprite)의 항목들의 경로 길이(2) 대비 항목 분류 트리 내의 항목들의 최장 경로 길이(7)으로 2/7의 값을 가질 수 있다.Furthermore, the second information may further include information about a length of a longest path of items in the item classification tree. The method proposed in the present invention can measure the similarity between sequences by using the relative value of the correlation information between the items using the length of the main path of the items. For example, relative association information of items of (Coke, Sprite) has a value of 2/7 as the longest path length (7) of items in the item classification tree compared to the path length (2) of items of (Coke, Sprite). can

또한, 본 발명에서 제안하는 방법은 항목들 간 연관성 정보를 빠르게 계산하기 위하여 항목 분류 트리의 각 노드에 대한 깊이 정보를 계산하여 미리 저장하고 있을 수 있다. 이후 2개의 항목들이 선택된 경우 항목들 간 최단 경로의 길이를 계산하기 위하여 모든 노드들(root, 내부노드, 단말노드)을 각각 대비하여 경로를 계산하는 것이 아니라 깊이 정보에 기초하여 항목들 간 최단 경로의 길이를 계산할 수 있다. 따라서 중복된 연산을 방지하고 빠르게 항목들 간 최단 경로의 길이를 제공할 수 있다.Also, in the method proposed by the present invention, depth information for each node of the item classification tree may be calculated and stored in advance in order to quickly calculate correlation information between items. Afterwards, when two items are selected, in order to calculate the length of the shortest path between the items, the shortest path between items based on the depth information, rather than calculating the path by comparing all nodes (root, internal node, terminal node) respectively. can calculate the length of Therefore, it is possible to prevent redundant operations and quickly provide the length of the shortest path between items.

도 2(a)와 같이 항목 분류 트리가 있는 경우 각 노드별로 순번을 매겨서 Root로부터 각 노드까지의 경로의 길이를 노드 깊이(node depth)로 정의할 수 있다. Root의 노드 깊이는 0를 가지며, C1, C2, C3의 노드 깊이는 1을 가지며, C4, C5, e, f, C6, C7의 노드 깊이는 2를 가지며, a, b, c, d, g, h, I, C8의 노드 깊이는 3을 가지며, j, k의 노드 깊이는 4를 가질 수 있다. 각 노드별 노드 깊이의 정보를 미래 계산하여 메모리(1100)에 저장해 둘 수 있다.If there is an item classification tree as shown in FIG. 2(a) , the length of a path from the root to each node may be defined as a node depth by assigning an order to each node. The node depth of the root is 0, the node depths of C1, C2, C3 are 1, the node depths of C4, C5, e, f, C6, C7 are 2, and a, b, c, d, g , h, I, and C8 may have a node depth of 3, and j and k may have a node depth of 4. The information of the node depth for each node may be calculated in the future and stored in the memory 1100 .

예를 들어, (Sandals, Jeans) 항목들 간 최단 경로의 길이를 구하고자 하는 경우 Sandals(g) 및 Jeans(i) 항목들의 마지막으로 공유하는 최하단 노드(Fashion, C3)를 결정하고, Sandals(g) 항목과 Fashion(C3) 내부노드 사이의 경로 길이와 Jeans(i) 항목과 Fashion(C3) 내부노드 사이의 경로 길이의 합을 통하여 (Sandals, Jeans) 항목들 간 최단 경로의 길이를 결정할 수 있다. 이 경우 미리 저장된 각 노드별 노드 깊이의 정보를 이용하여 [Sandals(g)의 깊이(3)+ Jeans(i)의 깊이(3) - 2*Fashion(C3)의 깊이(1) = 3 + 3 - 2*1 = 4]와 같이 (Sandals, Jeans) 항목들 간 최단 경로의 길이(4)를 결정할 수 있다.For example, if you want to find the length of the shortest path between items (Sandals, Jeans), determine the last shared lowest node (Fashion, C3) of Sandals(g) and Jeans(i) items, and Sandals(g) ), the length of the shortest path between items (Sandals, Jeans) can be determined through the sum of the path length between the item and the inner node of Fashion(C3) and the path length between the item and the inner node of Jeans(i) and Fashion(C3). . In this case, using the previously stored node depth information for each node, [depth(3) of Sandals(g) + depth(3) of Jeans(i) - depth(1) of 2*Fashion(C3) = 3 + 3) - 2*1 = 4], the length (4) of the shortest path between (Sandals, Jeans) items can be determined.

도 7 및 도 8은 일 실시예에 따른 전자장치(1000)의 블록도를 도시한 것이다.7 and 8 are block diagrams of an electronic device 1000 according to an exemplary embodiment.

일 실시예에 따른 전자 장치(1000)는, 단말기, 디바이스, 전자기기, 서버, 스마트폰, 태블릿 PC, PC, 스마트 TV, 휴대폰, PDA(personal digital assistant), 랩톱, 미디어 플레이어, 마이크로 서버, GPS(global positioning system) 장치, 전자책 단말기, 디지털방송용 단말기, 네비게이션, 키오스크, MP3 플레이어, 디지털 카메라, 가전기기 및 기타 컴퓨팅 장치 중 하나일 수 있다. 또한, 전자 장치는 디스플레이 기능 및 데이터 프로세싱 기능을 구비한 시계, 안경, 헤어 밴드 및 반지 등의 웨어러블 디바이스일 수 있다. 그러나, 이에 한정되지 않으며, 전자 장치(1000)는 데이터를 처리하고, 처리된 데이터를 제공할 수 있는 모든 종류의 기기를 포함할 수 있다.The electronic device 1000 according to an embodiment includes a terminal, a device, an electronic device, a server, a smart phone, a tablet PC, a PC, a smart TV, a mobile phone, a personal digital assistant (PDA), a laptop, a media player, a micro server, a GPS It may be one of a global positioning system device, an e-book terminal, a digital broadcast terminal, a navigation device, a kiosk, an MP3 player, a digital camera, a home appliance, and other computing devices. Also, the electronic device may be a wearable device such as a watch, glasses, a hair band, and a ring having a display function and a data processing function. However, the present invention is not limited thereto, and the electronic device 1000 may include all kinds of devices capable of processing data and providing the processed data.

도 7에 도시된 바와 같이, 일 실시 예에 따른 전자 장치(1000)는 메모리(1100), 출력부(1200), 통신부(1500) 및 프로세서(1300)를 포함할 수 있다. 7 , the electronic device 1000 according to an embodiment may include a memory 1100 , an output unit 1200 , a communication unit 1500 , and a processor 1300 .

프로세서(1300)은 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법을 수행하기 위하여 도 1 내지 도 6을 통해서 상술한 각 과정들을 프로세서 자체적으로 수행하거나 또는 전자 장치(1000)의 구성요소들을 제어하여 수행할 수 있다.The processor 1300 performs each of the processes described above with reference to FIGS. 1 to 6 by the processor itself or controls the components of the electronic device 1000 in order to perform a control method for determining the degree of similarity between sequences in consideration of the item classification system. can be done by

도 7에 도시된 구성 요소 모두가 전자 장치(1000)의 필수 구성 요소인 것은 아니며, 보다 많은 구성 요소에 의해 전자 장치(1000)가 구현될 수도 있고, 보다 적은 구성 요소에 의해 전자 장치(1000)가 구현될 수도 있다.Not all of the components shown in FIG. 7 are essential components of the electronic device 1000 , and the electronic device 1000 may be implemented with more components, and the electronic device 1000 with fewer components. may be implemented.

예를 들어, 도 8에 도시된 바와 같이, 일 실시 예에 따른 전자 장치(1000)는, 메모리(1100), 출력부(1200), 프로세서(1300), 센싱부(1400), 통신부(1500), A/V 입력부(1600) 및 사용자 입력부(1700)를 포함할 수도 있다.For example, as shown in FIG. 8 , the electronic device 1000 according to an embodiment includes a memory 1100 , an output unit 1200 , a processor 1300 , a sensing unit 1400 , and a communication unit 1500 . , an A/V input unit 1600 and a user input unit 1700 may be included.

*메모리(1100)*Memory (1100)

메모리(1100)는, 프로세서(1300)의 처리 및 제어를 위한 프로그램을 저장할 수 있고, 전자 장치(1000)로 입력되는 정보 또는 전자 장치(1000)로부터 출력되는 정보를 저장할 수도 있다.The memory 1100 may store a program for processing and controlling the processor 1300 , and may store information input to the electronic device 1000 or information output from the electronic device 1000 .

메모리(1100)는 플래시 메모리 타입(flash memory type), 하드디스크 타입(hard disk type), 멀티미디어 카드 마이크로 타입(multimedia card micro type), 카드 타입의 메모리(예를 들어 SD 또는 XD 메모리 등), 램(RAM, Random Access Memory) SRAM(Static Random Access Memory), 롬(ROM, Read-Only Memory), EEPROM(Electrically Erasable Programmable Read-Only Memory), PROM(Programmable Read-Only Memory), 자기 메모리, 자기 디스크, 광디스크 중 적어도 하나의 타입의 저장매체를 포함할 수 있다.The memory 1100 may include a flash memory type, a hard disk type, a multimedia card micro type, a card type memory (eg, SD or XD memory), and a RAM. (RAM, Random Access Memory) SRAM (Static Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), PROM (Programmable Read-Only Memory), magnetic memory, magnetic disk , may include at least one type of storage medium among optical disks.

메모리(1100)에 저장된 프로그램들은 그 기능에 따라 복수 개의 모듈들로 분류할 수 있는데, 예를 들어, UI 모듈(1110), 터치 스크린 모듈(1120), 알림 모듈(1130) 등으로 분류될 수 있다.Programs stored in the memory 1100 may be classified into a plurality of modules according to their functions, for example, may be classified into a UI module 1110 , a touch screen module 1120 , a notification module 1130 , etc. .

UI 모듈(1110)은, 애플리케이션 별로 전자 장치(1000)와 연동되는 특화된 UI, GUI 등을 제공할 수 있다. The UI module 1110 may provide a specialized UI, GUI, or the like that interworks with the electronic device 1000 for each application.

터치 스크린 모듈(1120)은 사용자의 터치 스크린 상의 터치 제스처를 감지하고, 터치 제스처에 관한 정보를 프로세서(1300)로 전달할 수 있다. 일 실시예에 따른 터치 스크린 모듈(1120)은 터치 코드를 인식하고 분석할 수 있다. 터치 스크린 모듈(1120)은 컨트롤러를 포함하는 별도의 하드웨어로 구성될 수도 있다.The touch screen module 1120 may detect a touch gesture on the user's touch screen and transmit information about the touch gesture to the processor 1300 . The touch screen module 1120 according to an embodiment may recognize and analyze a touch code. The touch screen module 1120 may be configured as separate hardware including a controller.

알림 모듈(1130)은 전자 장치(1000)의 이벤트 발생을 알리기 위한 신호를 발생할 수 있다. 전자 장치(1000)에서 발생되는 이벤트의 예로는 호 신호 수신, 메시지 수신, 키 신호 입력, 일정 알림 등이 있다. 알림 모듈(1130)은 디스플레이부(1210)를 통해 비디오 신호 형태로 알림 신호를 출력할 수도 있고, 음향 출력부(1220)를 통해 오디오 신호 형태로 알림 신호를 출력할 수도 있고, 진동 모터(1230)를 통해 진동 신호 형태로 알림 신호를 출력할 수도 있다. 예를 들어, 알림 모듈(1130)은 추정된 차선 정보에 기초하여 가이드 정보를 출력하기 위한 신호를 발생할 수 있다.The notification module 1130 may generate a signal for notifying the occurrence of an event in the electronic device 1000 . Examples of events generated in the electronic device 1000 include call signal reception, message reception, key signal input, schedule notification, and the like. The notification module 1130 may output a notification signal in the form of a video signal through the display unit 1210 , may output a notification signal in the form of an audio signal through the sound output unit 1220 , and the vibration motor 1230 . It is also possible to output a notification signal in the form of a vibration signal through For example, the notification module 1130 may generate a signal for outputting guide information based on the estimated lane information.

*출력부(1200)*Output unit (1200)

출력부(1200)는, 오디오 신호 또는 비디오 신호 또는 진동 신호를 출력할 수 있으며, 출력부(1200)는 디스플레이부(1210), 음향 출력부(1220), 및 진동 모터(1230)를 포함할 수 있다.The output unit 1200 may output an audio signal, a video signal, or a vibration signal, and the output unit 1200 may include a display unit 1210 , a sound output unit 1220 , and a vibration motor 1230 . have.

디스플레이부(1210)는 전자 장치(1000)에서 처리되는 정보를 표시 출력한다. 구체적으로, 디스플레이부(1210)는 카메라(1610)에서 촬영된 이미지를 출력할 수 있다. 디스플레이부(1210)는, 사용자의 입력에 대한 응답으로, 응답에 관련된 동작을 실행하기 위한 사용자 인터페이스를 디스플레이할 수 있다.The display unit 1210 displays and outputs information processed by the electronic device 1000 . Specifically, the display unit 1210 may output an image captured by the camera 1610 . The display 1210 may display a user interface for executing an operation related to a response in response to a user's input.

음향 출력부(1220)는 통신부(1500)로부터 수신되거나 메모리(1100)에 저장된 오디오 데이터를 출력한다. 또한, 음향 출력부(1220)는 전자 장치(1000)에서 수행되는 기능(예를 들어, 호신호 수신음, 메시지 수신음, 알림음)과 관련된 음향 신호를 출력한다. The sound output unit 1220 outputs audio data received from the communication unit 1500 or stored in the memory 1100 . Also, the sound output unit 1220 outputs a sound signal related to a function (eg, a call signal reception sound, a message reception sound, and a notification sound) performed by the electronic device 1000 .

*프로세서(1300)*Processor (1300)

프로세서(1300)는, 통상적으로 전자 장치(1000)의 전반적인 동작을 제어한다. 예를 들어, 프로세서(1300)는, 메모리(1100)에 저장된 프로그램들을 실행함으로써, 사용자 입력부(1700), 출력부(1200), 센싱부(1400), 통신부(1500), A/V 입력부(1700) 등을 전반적으로 제어할 수 있다.The processor 1300 generally controls the overall operation of the electronic device 1000 . For example, the processor 1300 executes programs stored in the memory 1100 , and thus the user input unit 1700 , the output unit 1200 , the sensing unit 1400 , the communication unit 1500 , and the A/V input unit 1700 . ) can be controlled in general.

*센싱부(1400)*Sensing unit (1400)

센싱부(1400)는, 전자 장치(1000)의 상태 또는 전자 장치(1000) 주변의 상태를 감지하고, 감지된 정보를 프로세서(1300)로 전달할 수 있다.The sensing unit 1400 may detect a state of the electronic device 1000 or a state around the electronic device 1000 , and transmit the sensed information to the processor 1300 .

센싱부(1400)는, 지자기 센서(Magnetic sensor)(1410), 가속도 센서(Acceleration sensor)(1420), 온/습도 센서(1430), 적외선 센서(1440), 자이로스코프 센서(1450), 위치 센서(예컨대, GPS)(1460), 기압 센서(1470), 근접 센서(1480), 및 RGB 센서(RGB sensor)(1490) 중 적어도 하나를 포함할 수 있으나, 이에 한정되는 것은 아니다. 각 센서들의 기능은 그 명칭으로부터 당업자가 직관적으로 추론할 수 있으므로, 구체적인 설명은 생략하기로 한다.The sensing unit 1400 includes a magnetic sensor 1410 , an acceleration sensor 1420 , a temperature/humidity sensor 1430 , an infrared sensor 1440 , a gyroscope sensor 1450 , and a position sensor. (eg, GPS) 1460 , a barometric pressure sensor 1470 , a proximity sensor 1480 , and at least one of an RGB sensor 1490 , but is not limited thereto. Since a function of each sensor can be intuitively inferred from the name of a person skilled in the art, a detailed description thereof will be omitted.

*통신부(1500)*Communication Department (1500)

통신부(1500)는, 전자 장치(1000)가 다른 장치(미도시) 및 서버(미도시)와 통신을 하게 하는 하나 이상의 구성요소를 포함할 수 있다. 다른 장치(미도시)는 전자 장치(1000)와 같은 컴퓨팅 장치이거나, 센싱 장치일 수 있으나, 이에 한정되는 것은 아니다. 예를 들어, 통신부(1500)는, 근거리 통신부(1510), 이동 통신부(1520), 방송 수신부(1530)를 포함할 수 있다.The communication unit 1500 may include one or more components that allow the electronic device 1000 to communicate with another device (not shown) and a server (not shown). The other device (not shown) may be a computing device such as the electronic device 1000 or a sensing device, but is not limited thereto. For example, the communication unit 1500 may include a short-range communication unit 1510 , a mobile communication unit 1520 , and a broadcast receiving unit 1530 .

근거리 통신부(short-range wireless communication unit)(1510)는, 블루투스 통신부, BLE(Bluetooth Low Energy) 통신부, 근거리 무선 통신부(Near Field Communication unit), WLAN(와이파이) 통신부, 지그비(Zigbee) 통신부, 적외선(IrDA, infrared Data Association) 통신부, WFD(Wi-Fi Direct) 통신부, UWB(ultra wideband) 통신부, Ant+ 통신부 등을 포함할 수 있으나, 이에 한정되는 것은 아니다. Short-range wireless communication unit 1510, Bluetooth communication unit, BLE (Bluetooth Low Energy) communication unit, short-range wireless communication unit (Near Field Communication unit), WLAN (Wi-Fi) communication unit, Zigbee (Zigbee) communication unit, infrared ( It may include an IrDA, infrared Data Association) communication unit, a Wi-Fi Direct (WFD) communication unit, an ultra wideband (UWB) communication unit, an Ant+ communication unit, and the like, but is not limited thereto.

이동 통신부(1520)는, 이동 통신망 상에서 기지국, 외부의 단말, 서버 중 적어도 하나와 무선 신호를 송수신한다. 여기에서, 무선 신호는, 음성 호 신호, 화상 통화 호 신호 또는 문자/멀티미디어 메시지 송수신에 따른 다양한 형태의 데이터를 포함할 수 있다.The mobile communication unit 1520 transmits/receives a radio signal to and from at least one of a base station, an external terminal, and a server on a mobile communication network. Here, the wireless signal may include various types of data according to transmission/reception of a voice call signal, a video call signal, or a text/multimedia message.

방송 수신부(1530)는, 방송 채널을 통하여 외부로부터 방송 신호 및/또는 방송 관련된 정보를 수신한다. 방송 채널은 위성 채널, 지상파 채널을 포함할 수 있다. 구현 예에 따라서 전자 장치(1000)가 방송 수신부(1530)를 포함하지 않을 수도 있다.The broadcast receiver 1530 receives a broadcast signal and/or broadcast-related information from the outside through a broadcast channel. The broadcast channel may include a satellite channel and a terrestrial channel. According to an embodiment, the electronic device 1000 may not include the broadcast receiver 1530 .

*A/V(Audio/Video) 입력부(1600)**A/V (Audio/Video) input unit (1600)*

A/V(Audio/Video) 입력부(1600)는 오디오 신호 또는 비디오 신호 입력을 위한 것으로, 이에는 카메라(1610)와 마이크로폰(1620) 등이 포함될 수 있다. The A/V (Audio/Video) input unit 1600 is for inputting an audio signal or a video signal, and may include a camera 1610 , a microphone 1620 , and the like.

카메라(1610)는 화상 통화모드 또는 촬영 모드에서 이미지 센서를 통해 정지영상 또는 동영상 등의 화상 프레임을 얻을 수 있다. 이미지 센서를 통해 캡처된 이미지는 프로세서(1300) 또는 별도의 이미지 처리부(미도시)를 통해 처리될 수 있다.The camera 1610 may obtain an image frame such as a still image or a moving image through an image sensor in a video call mode or a shooting mode. The image captured through the image sensor may be processed through the processor 1300 or a separate image processing unit (not shown).

마이크로폰(1620)은, 외부의 음향 신호를 입력 받아 전기적인 음성 데이터로 처리한다. 예를 들어, 마이크로폰(1620)은 외부 디바이스 또는 사용자로부터 음향 신호를 수신할 수 있다. 마이크로폰(1620)은 사용자의 음성 입력을 수신할 수 있다. 마이크로폰(1620)은 외부의 음향 신호를 입력 받는 과정에서 발생 되는 잡음(noise)을 제거하기 위한 다양한 잡음 제거 알고리즘을 이용할 수 있다.The microphone 1620 receives an external sound signal and processes it as electrical voice data. For example, the microphone 1620 may receive an acoustic signal from an external device or a user. The microphone 1620 may receive a user's voice input. The microphone 1620 may use various noise removal algorithms for removing noise generated in the process of receiving an external sound signal.

*사용자 입력부(1700)*User input unit (1700)

사용자 입력부(1700)는, 사용자가 전자 장치(1000)를 제어하기 위한 데이터를 입력하는 수단을 의미한다. 예를 들어, 사용자 입력부(1700)에는 키 패드(key pad), 돔 스위치 (dome switch), 터치 패드(접촉식 정전 용량 방식, 압력식 저항막 방식, 적외선 감지 방식, 표면 초음파 전도 방식, 적분식 장력 측정 방식, 피에조 효과 방식 등), 조그 휠, 조그 스위치 등이 있을 수 있으나 이에 한정되는 것은 아니다.The user input unit 1700 means a means for a user to input data for controlling the electronic device 1000 . For example, the user input unit 1700 includes a key pad, a dome switch, and a touch pad (contact capacitive method, pressure resistance film method, infrared sensing method, surface ultrasonic conduction method, integral type). There may be a tension measurement method, a piezo effect method, etc.), a jog wheel, a jog switch, and the like, but is not limited thereto.

본 발명은 도면에 도시된 실시 예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시 예가 가능하다는 점을 이해할 것이다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 등록청구범위의 기술적 사상에 의해 정해져야 할 것이다.Although the present invention has been described with reference to the embodiment shown in the drawings, this is merely exemplary, and those skilled in the art will understand that various modifications and equivalent other embodiments are possible therefrom. Accordingly, the true technical protection scope of the present invention should be determined by the technical spirit of the appended claims.

Claims (8)

항목 분류 트리에 대한 정보를 기 저장한 메모리 및 상기 메모리를 제어하는 프로세서를 포함하는 전자 장치에 의해 수행되는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법에 있어서,
상기 전자 장치에 의해, 순서를 가지는 제1 항목들로 구성된 제1 시퀀스를 획득하는 과정;
상기 전자 장치에 의해, 순서를 가지는 제2 항목들로 구성된 제2 시퀀스를 획득하는 과정; 및
상기 전자 장치에 의해, 상기 기 저장된 항목 분류 트리에 대한 정보를 이용하여 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단하는 과정을 포함하며,
상기 항목 분류 트리는 최상단 노드, 상기 최상단 노드의 하위 분류로서 상기 최상단 노드로부터 분지된 복수개의 내부 노드들, 및 상기 복수개의 내부 노드들 각각의 하위 분류이고 최하단 노드에 해당하며 상기 복수개의 내부 노드들 각각으로부터 분지되며 상기 제1 및 제2 항목들에 각각 대응하는 복수개의 단말 노드로 구성되며,
상기 제1 정보는 상기 제1 항목들 중 하나를 상기 제2 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함하며,
상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함하며, 상기 항목 분류 트리 내의 최단 경로의 길이는 2개의 단말 노드에서 가장 가까운 공통 분류에 해당하는 내부 노드와 상기 2개의 단말 노드 사이의 경로의 합이며,
상기 제1 및 제2 시퀀스의 유사 여부를 판단하는 과정은, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이가 짧을 수록 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나의 유사도를 높게 판단하고, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나의 유사도가 높을수록 상기 제1 및 제2 시퀀스의 유사도를 높게 판단하는 것을 특징으로 하는,
항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법.
A control method for determining a degree of similarity between sequences in consideration of an item classification system, performed by an electronic device including a memory in which information on an item classification tree is previously stored and a processor controlling the memory, the control method comprising:
obtaining, by the electronic device, a first sequence including first items having an order;
obtaining, by the electronic device, a second sequence including second items having an order; and
determining, by the electronic device, whether the first and second sequences are similar to each other based on first information and second information by using the pre-stored information on the item classification tree;
The item classification tree is a top node, a plurality of internal nodes branched from the top node as a sub-class of the top node, and a sub-classification of each of the plurality of internal nodes and corresponds to the lowest node, each of the plurality of internal nodes Branched from and composed of a plurality of terminal nodes respectively corresponding to the first and second items,
The first information includes information about the number of operations for converting one of the first items into one of the second items,
The second information includes information about a length of a shortest path in the itemized tree between one of the first items and one of the second items, wherein the length of the shortest path in the itemized tree is two It is the sum of the paths between the internal node corresponding to the closest common classification in the terminal node and the two terminal nodes,
In the process of determining whether the first and second sequences are similar, the shorter the length of the shortest path in the item classification tree between one of the first items and one of the second items, the shorter the length of the first items. determining a high degree of similarity between one of the first items and one of the second items, and determining a higher degree of similarity between the first and second sequences as the similarity between one of the first items and one of the second items increases. characterized by,
A control method for determining the similarity between sequences considering the item classification system.
삭제delete 제1항에 있어서,
상기 제2 정보는 상기 항목 분류 트리 내의 항목들의 최장 경로의 길이에 관한 정보를 더 포함하는 것을 특징으로 하는,
항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법.
According to claim 1,
wherein the second information further includes information about a length of a longest path of items in the item classification tree;
A control method for determining the similarity between sequences considering the item classification system.
제1항에 있어서,
상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이는 기 저장된 상기 항목 분류 트리의 각 노드에 대한 깊이 정보에 기초하여 결정되는 것을 특징으로 하는,
항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 제어 방법.
According to claim 1,
The length of the shortest path in the item classification tree between one of the first items and one of the second items is determined based on pre-stored depth information for each node of the item classification tree,
A control method for determining the similarity between sequences considering the item classification system.
항목 분류 트리에 대한 정보를 저장하는 메모리; 및
상기 메모리를 제어하는 프로세서를 포함하며,
상기 프로세서는, 순서를 가지는 제1 항목들로 구성된 제1 시퀀스를 획득하고, 순서를 가지는 제2 항목들로 구성된 제2 시퀀스를 획득하고, 상기 기 저장된 항목 분류 트리에 대한 정보를 이용하여 제1 정보 및 제2 정보에 기초하여 상기 제1 및 제2 시퀀스의 유사 여부를 판단하도록 제어하며,
상기 항목 분류 트리는 최상단 노드, 상기 최상단 노드의 하위 분류로서 상기 최상단 노드로부터 분지된 복수개의 내부 노드들, 및 상기 복수개의 내부 노드들 각각의 하위 분류이고 최하단 노드에 해당하며 상기 복수개의 내부 노드들 각각으로부터 분지되며 상기 제1 및 제2 항목들에 각각 대응하는 복수개의 단말 노드로 구성되며,
상기 제1 정보는 상기 제1 항목들 중 하나를 상기 제2 항목들 중 하나로 변환하기 위한 연산의 횟수에 관한 정보를 포함하며,
상기 제2 정보는 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이에 관한 정보를 포함하며, 상기 항목 분류 트리 내의 최단 경로의 길이는 2개의 단말 노드에서 가장 가까운 공통 분류에 해당하는 내부 노드와 상기 2개의 단말 노드 사이의 경로의 합이며,
상기 제1 및 제2 시퀀스의 유사 여부를 판단하는 과정은, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이가 짧을 수록 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나의 유사도를 높게 판단하고, 상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나의 유사도가 높을수록 상기 제1 및 제2 시퀀스의 유사도를 높게 판단하는 것을 특징으로 하는, 항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치.
a memory for storing information about the item classification tree; and
A processor for controlling the memory,
The processor obtains a first sequence composed of first items having an order, obtains a second sequence composed of second items having an order, and uses the pre-stored information about the item classification tree to obtain a first Control to determine whether the first and second sequences are similar based on the information and the second information,
The item classification tree is a top node, a plurality of internal nodes branched from the top node as a sub-class of the top node, and a sub-classification of each of the plurality of internal nodes and corresponds to the lowest node, each of the plurality of internal nodes Branched from and composed of a plurality of terminal nodes respectively corresponding to the first and second items,
The first information includes information about the number of operations for converting one of the first items into one of the second items,
the second information includes information about a length of a shortest path in the itemized tree between one of the first items and one of the second items, wherein the length of the shortest path in the itemized tree is two It is the sum of the paths between the internal node corresponding to the closest common classification in the terminal node and the two terminal nodes,
In the process of determining whether the first and second sequences are similar, the shorter the length of the shortest path in the item classification tree between one of the first items and one of the second items, the shorter the length of the first items. determining a high degree of similarity between one of the first items and one of the second items, and determining a higher degree of similarity between the first and second sequences as the similarity between one of the first items and one of the second items increases. An electronic device for determining a degree of similarity between sequences in consideration of an item classification system.
삭제delete 제5항에 있어서,
상기 제2 정보는 상기 항목 분류 트리 내의 항목들의 최장 경로의 길이에 관한 정보를 더 포함하는 것을 특징으로 하는,
항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치.
6. The method of claim 5,
wherein the second information further includes information about a length of a longest path of items in the item classification tree;
An electronic device for determining the similarity between sequences in consideration of the item classification system.
제5항에 있어서,
상기 제1 항목들 중 하나와 상기 제2 항목들 중 하나 사이의 상기 항목 분류 트리 내의 최단 경로의 길이는 상기 메모리에 기 저장된 상기 항목 분류 트리의 각 노드에 대한 깊이 정보에 기초하여 결정되는 것을 특징으로 하는,
항목 분류 체계를 고려한 시퀀스 간 유사도를 판단하는 전자 장치.
6. The method of claim 5,
and a length of a shortest path in the item classification tree between one of the first items and one of the second items is determined based on depth information about each node of the item classification tree pre-stored in the memory. to do,
An electronic device for determining the similarity between sequences in consideration of the item classification system.
KR1020190157364A 2019-11-29 2019-11-29 Electronic device for determining similarity between sequences considering item classification scheme and control method thereof KR102279210B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020190157364A KR102279210B1 (en) 2019-11-29 2019-11-29 Electronic device for determining similarity between sequences considering item classification scheme and control method thereof
PCT/KR2020/012648 WO2021107360A2 (en) 2019-11-29 2020-09-18 Electronic device for determining similarity degree and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190157364A KR102279210B1 (en) 2019-11-29 2019-11-29 Electronic device for determining similarity between sequences considering item classification scheme and control method thereof

Publications (2)

Publication Number Publication Date
KR20210067588A KR20210067588A (en) 2021-06-08
KR102279210B1 true KR102279210B1 (en) 2021-07-19

Family

ID=76399538

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190157364A KR102279210B1 (en) 2019-11-29 2019-11-29 Electronic device for determining similarity between sequences considering item classification scheme and control method thereof

Country Status (1)

Country Link
KR (1) KR102279210B1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2023012933A1 (en) * 2021-08-04 2023-02-09
KR102591504B1 (en) * 2021-10-26 2023-10-19 한양대학교 산학협력단 Logistics prediction technology using product association graph structure
WO2023144967A1 (en) * 2022-01-27 2023-08-03 日本電信電話株式会社 Processing device, processing method, and program
CN115729981B (en) * 2022-11-29 2024-02-13 中国长江电力股份有限公司 Editing distance-based similar water condition data mining method and application thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140103058A (en) * 2013-02-15 2014-08-25 삼성전자주식회사 Electronic device, method and computer readable recording medium for operating the electronic device
KR101937989B1 (en) 2017-12-29 2019-01-11 연세대학교 원주산학협력단 Set-based similar sequence matching apparatus and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
김성환 외 2인. "A New String Search Tree with Multiple Alignment." 2012 IEEE 12th International Conference on Computer and Information Technology. (2012.10.29. 공개)*

Also Published As

Publication number Publication date
KR20210067588A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
KR102279210B1 (en) Electronic device for determining similarity between sequences considering item classification scheme and control method thereof
US20190138917A1 (en) Behavioral Prediction for Targeted End Users
EP3779841B1 (en) Method, apparatus and system for sending information, and computer-readable storage medium
KR101778679B1 (en) Method and system for classifying data consisting of multiple attribues represented by sequences of text words or symbols using deep learning
CN105447730B (en) Target user orientation method and device
US20190370695A1 (en) Enhanced pipeline for the generation, validation, and deployment of machine-based predictive models
US10628775B2 (en) Sankey diagram graphical user interface customization
JP2021108188A (en) Visual search based on image analysis and prediction
US20180342004A1 (en) Cumulative success-based recommendations for repeat users
WO2018040069A1 (en) Information recommendation system and method
US20140288999A1 (en) Social character recognition (scr) system
Dogan et al. Genders prediction from indoor customer paths by Levenshtein-based fuzzy kNN
CN104751354A (en) Advertisement cluster screening method
JP2019125257A (en) Information processing device, information processing method, and information processing program
CN107092609A (en) A kind of information-pushing method and device
US20210103925A1 (en) Feature subspace isolation and disentanglement in merchant embeddings
CN115578163A (en) Personalized pushing method and system for combined commodity information
US9342834B2 (en) System and method for setting goals and modifying segment criteria counts
TW201514730A (en) Electronic calculatiing apparatus, personal information recommonding method thereof, and computer program product thereof
CN115423555A (en) Commodity recommendation method and device, electronic equipment and storage medium
KR102376652B1 (en) Method and system for analazing real-time of product data and updating product information using ai
Bhargavi et al. Comparative study of consumer purchasing and decision pattern analysis using pincer search based data mining method
CN115618126A (en) Search processing method, system, computer readable storage medium and computer device
JP6960361B2 (en) Information processing equipment, information processing methods, and information processing programs
KR101985603B1 (en) Recommendation method based on tripartite graph

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant