A negative sequence pattern analysis system and method based on influence degree
By using an impact-based negative sequence pattern analysis system and method, the problem of existing technologies failing to accurately reflect the interest level of negative sequence patterns is solved, enabling more accurate product display order recommendations in live shopping, thereby increasing transaction opportunities and live streaming revenue.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
- Filing Date
- 2022-12-19
- Publication Date
- 2026-05-19
AI Technical Summary
In existing sequence pattern mining techniques, using only support as a measure of interest cannot truly reflect the interest of negative sequence patterns, resulting in a large amount of worthless information in the mining results. Furthermore, traditional algorithms fail to effectively consider the sequential features between elements, especially in live shopping where they cannot find a suitable product display order to increase transaction opportunities.
A negative sequence pattern analysis system and method based on influence degree is adopted. Through data preprocessing, frequent pattern mining, influence degree analysis and graphical interface representation, the Inf-NSP algorithm is used to mine frequent patterns that meet the influence degree constraints. Considering the support of elements within the pattern and the order features between elements, valuable product display suggestions are provided.
Effectively uncover truly interesting purchasing information in live shopping, improve the relevance of product displays, increase transaction opportunities, and boost live streaming revenue.
Smart Images

Figure CN116342156B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sequence pattern mining technology, and in particular to a negative sequence pattern analysis system and method based on influence. Background Technology
[0002] Currently, livestreaming merchants typically lack direct insights into their customers, with limited access to relevant data such as user registration information and purchase history. By mining and analyzing large amounts of customer purchase records, interesting patterns in frequent purchases can be discovered, yielding valuable information on the order in which products are displayed during livestreams. This information can then be provided to merchants for reference, enabling them to recommend and display products to customers in an appropriate order during livestreams, converting viewers into buyers. This can effectively increase customer transaction opportunities and improve the merchant's livestream sales volume and economic benefits.
[0003] Sequence pattern analysis can uncover patterns in the relationships between transactions, that is, it can obtain information about the relationships between products based on the buying and selling situation, thereby making better product combination recommendations and sales decisions. Its main purpose is to study the order in which products are purchased, finding the patterns within them. This requires not only knowing whether a product has been purchased, but also determining the order in which that product is purchased relative to other products. For example, a typical order of purchasing stationery is buying "pencils," followed by "knives," and then "erasers." Sequence pattern mining can discover frequent sequences within a database over a certain period, that is, which products are purchased more frequently by customers during this time period. The standard for "more" or "less" is determined by a user-defined minimum support threshold (min-sup). Each sequence is a set arranged according to the transaction time, and users can mine sequence patterns of different frequencies by setting the minimum support threshold. In live shopping, live-streaming merchants can use the information provided by these frequent sequence patterns to determine the order in which products are displayed. For example, when selling stationery in a live stream, the merchant can first display pencils, then knives, and finally erasers. When applying sequence pattern analysis to live shopping behavior, the focus is on behaviors that have already occurred, also known as Positive Sequential Pattern (PSP) mining.
[0004] However, analysis of actions not yet performed often yields more valuable information and plays an irreplaceable role in certain aspects. Therefore, the Negative Sequential Pattern (NSP) was proposed, which includes information about both performed and unperformed actions, taking into account more possible scenarios. For example: 'a' represents the computer, 'b' represents the keyboard, 'c' represents the USB drive, and 'd' represents the mouse. This represents a live-stream purchase sequence pattern, indicating that within a certain timeframe, a customer purchased product a and b, and then purchased product d without first purchasing product c. In live-stream shopping, merchants can use this sequence pattern to determine the order in which products are displayed, and whether to show certain products at all. The value of negative sequence patterns is increasingly recognized, playing an irreplaceable role in the processing and analysis of sequence data.
[0005] For sequence pattern mining, most current algorithms use support as a measure of sequence pattern interest. Support primarily represents the proportion of a sequence in a sequence database, indicating its frequency. It compares the number of times a sequence appears in the database with a user-specified minimum support threshold (min-sup) to determine its frequency. However, while support is the most basic measure of interest, it sometimes fails to accurately reflect the true interest of sequence patterns, leading to the inclusion of some sequence patterns in the mining results that provide no valuable information. Specifically, using only support for sequence pattern mining has two problems: first, the support of elements within a sequence pattern significantly influences its own support; second, the support of a sequence pattern cannot reflect the sequential characteristics of its internal elements. For example, in the stationery sales scenario, if 98% of customers purchased a handbag (a promotional item offered by the livestreaming merchant to attract followers at a price far below its usual selling price, and is a limited-time, flash sale item; therefore, the order in which handbags are displayed during the livestream and whether customers purchase them cannot be used as a reference for the livestreaming merchant to decide the order or absence of product displays), and 90% of people purchased pencils but not mechanical pencils, then even though there is no correlation between purchasing a handbag and purchasing pencils but not mechanical pencils, the negative sequence is <handbag, (pencil, ... Mechanical pencils (>) also appear frequently. At the same time, the negative frequency patterns discovered may also include <(pencil, Mechanical pen), handbag >, and negative mode < handbag, (pencil, The support levels for mechanical pencils and handbags are similar, indicating that handbags and pencils have similar support levels. The order of the two elements (mechanical pen, etc.) is irrelevant, which contradicts the importance of order in the sequence pattern definition. Therefore, the negative sequence pattern < handbag, (pencil, etc.) is: Mechanical pencil)> and <(pencil) The information provided by mechanical pencils (and handbags) is worthless and should not appear in the final results. Especially when processing a large database of live streaming sequences, using only support for mining may result in a large number of frequent but uninteresting sequence patterns in the mining results, thus providing live streaming merchants with worthless reference information and wasting time and effort.
[0006] In response to the problems discussed above, the influence degree, an interest measurement method, has been proposed. The influence degree not only considers the influence of the support of elements within the pattern on the support of the pattern itself, but also considers the order features between these elements, which can truly reflect the interest of the sequence pattern. However, there is very little research on influence degree at present, and the only one we can find is the ISSPM algorithm proposed by Wu et al. [1]. In this study, the relevant concepts and calculation methods of influence degree were proposed. However, it has two limitations. One is that it only targets positive sequence pattern mining and does not involve negative sequence patterns. The other is that the influence degree targets element-based sequences and does not consider item-based sequences. However, negative sequence pattern mining considers more situations, and it mines more patterns that satisfy the min-sup constraint. Therefore, there may be more uninteresting frequent patterns in the mining results. In summary, how to mine those truly interesting negative sequence patterns is an urgent problem to be solved in the research of negative sequence pattern mining. When analyzing live shopping transaction sequences, the main problems encountered include: (1) how merchants can find the most suitable product display order in the live stream to better attract fans and thus encourage them to buy more products, thereby increasing the revenue of the live stream; (2) how to solve the problem that the support in traditional negative sequence pattern mining cannot truly reflect the interest of the pattern, thus resulting in some sequence patterns in the mining results providing worthless information; (3) how to effectively mine more comprehensive and realistic negative sequence patterns in live shopping sequences.
[0007] To overcome the shortcomings of existing technologies, this invention provides a negative sequence pattern analysis system and method based on influence degree.
[0008] This invention is achieved through the following technical solution:
[0009] A negative sequence pattern analysis system based on influence includes a data preprocessing module for acquiring data, preprocessing the acquired data, and storing the data in a database.
[0010] The frequent pattern mining module is used to mine frequent patterns in the dataset processed by the data preprocessing module using a pre-set algorithm and based on the minimum support threshold set by the user.
[0011] The influence analysis module is used to calculate the influence of positive and negative frequent sequence patterns obtained by the frequent pattern mining module, extract the influence of the pattern, and select frequent patterns that meet the influence constraints according to the minimum influence threshold (min-inf) set by the user.
[0012] The graphical interface module is used to display the mining results of the influence analysis module on the system's graphical interface and provide users with a search box on this page.
[0013] A negative sequence pattern analysis method based on influence degree is characterized by the following definition:
[0014] Negative size: The total number of negative elements in a negative sequence ns is called the negative size of ns. If negsize(ns) = n, then ns is an n-neg-size sequence. For example, given... The number of negative elements is 2, therefore ns is a 2-neg-size sequence;
[0015] Positive partner: a negative element The positive partner is (ab), denoted as Right now A positive partner of a positive element (ab) is (ab) itself, i.e., p((ab)) = (ab). A negative sequence ns = <s1s2,…,s k The positive partner of > is to make all negative elements in ns their positive partners, denoted as p(ns), that is, p(ns) = <s1s2,…,s k >|s j =p(s i ),s i ∈ns;
[0016] Maximum positron sequence: Assume ns= <s1s2,…,s m If a negative sequence > is of size m and size n (m>n), and its subsequence s contains all positive elements, then s is called the maximum positive subsequence of ns, denoted as MPS(ns);
[0017] 1-Neg-Size Maximum Subsequence: For a negative sequence ns, the subsequence containing MPS(ns) and a negative element e is called the 1-neg-size maximum subsequence, denoted as 1-negMS. i The set of all 1-neg-size largest subsequences containing ns is called the 1-neg-size largest subsequence set, denoted as 1-negMSS. ns ;
[0018] Frequent element constraint: a negative element en It cannot appear in NSC unless its positive element partner p(e) n ) is frequent, i.e., sup(p(e) n ))≥min-sup. For example, if Then element This constraint must be satisfied;
[0019] 1-length-neg element format constraint: NSC only allows consecutive 1-length negative elements. For example, This constraint is satisfied, but Not satisfied;
[0020] Negative inclusion: Let ds = <d1,d2,…,d t For a customer purchasing a data sequence, ns = <s1,s2,…,s m > For a negative sequence of m-size and n-neg-size: (1) If m>2t+1, then ds does not contain ns; (2) If m≥1 and n=1, then when When ds contains ns; (3) otherwise, if Then ds contains ns;
[0021] The negative sequence pattern analysis method based on influence degree specifically includes the following steps:
[0022] S100 Data Acquisition and Preprocessing: Acquire live transaction data, clean the data in the live shopping transaction data, represent the product names in the cleaned data with numbers, and store the corresponding relationship in the database. Next, represent the processed data in the form of a sequence, and use the resulting live transaction sequences as a dataset for frequent pattern mining.
[0023] S200 Frequent Pattern Mining: Using the modified sc-NSP algorithm and based on the minimum support threshold set by the user, frequent patterns are mined from the dataset obtained by the above processing.
[0024] S300 Frequent Pattern Influence Analysis: The influence of the positive and negative frequent sequence patterns obtained through support mining is calculated to extract the influence of the pattern. Based on the minimum influence threshold set by the user, the frequent live purchase patterns that meet the influence constraints are selected.
[0025] The S400 graphical interface displays the above mining results on the system's graphical interface, and provides users with a search box on this page. Live merchants can enter the currently displayed product to display the next recommended product.
[0026] The step S200 specifically includes S210 generating NSC; S220 calculating the support of NSC, using the support calculation method in the NegI-NSP algorithm [2] to calculate the support.
[0027] The step S210 of generating NSC specifically includes S211, where a 1-size NSC is generated from a 1-size PSP according to the negative element constraint;
[0028] S212, the generation of n-size (n≥2) NSCs is divided into two cases: 1) a (n-1)-size PSP is connected to a 1-size NSC, 2) a (n-1)-size NSC is connected to a 1-size PSP and a 1-size NSC.
[0029] S213, Repeat the above process until no NSC is generated or the size of the NSC is greater than 2m+1, where m represents the maximum size of the sequence in the PSP;
[0030] The size is the sequence size.
[0031] It also includes a pruning step. Based on the definition of the 1-Neg-Size maximum subsequence and the element frequency constraint, the following two pruning strategies are adopted: 1) If and The sequence ns is pruned; 2) if and The sequence ns is pruned.
[0032] Step S300 includes S310, where a sequence pattern s = ... <e1,e2,…,e l If the elements in s are independent, then the expected support of s is:
[0033]
[0034] S320, the corrected support of s obtained by subtracting this effect is:
[0035] adsup(s) = sup(s) - exsup(s);
[0036] S330 Assume h(s) represents the first element of s, and r(s) represents the elements of s excluding the first element. s can be represented as:<h(s),r(s)> Given two patterns s a and s b The possible sequence patterns ger(s) a ,s b It can be recursively calculated using the following formula:
[0037] ger(s as b ) = G a ∪G b
[0038] G a ={<h(s) a ), X>|X∈ger(r(s) a ), s b )}
[0039] G b ={<h(s) b ), Y>|Y∈ger(s a ,r(s b ))}
[0040] in,
[0041] S340, Next, the modified support of the pattern is further adjusted to introduce the order features between elements. First, the adjusted value of the modified support of sequence s is calculated.
[0042]
[0043] Then calculate the influence of sequence s.
[0044] inf(s) = adsup(s) - mesup(s)
[0045] Among them, G ger It means ger(s) a ,s b The result set of ) , avg() represents G ger The average support of sequence patterns in the set.
[0046] The s a s b For an assumed n-size sequence <x1x2,…,x n >, take the first (n-1) elements as s a The last element is s b .
[0047] The present invention has the following technical effects:
[0048] This invention provides a system for recommending and displaying products in live streams. Based on a live shopping transaction sequence database, it uses an impact-based negative sequence pattern mining algorithm to present truly interesting live purchase information to users through a graphical interface. Users can select interesting sequence patterns from the mining results according to their preferences. The Inf-NSP algorithm effectively mines more realistic negative sequence patterns while considering both the influence of the support of elements within the pattern on the pattern's overall support and the sequential characteristics between these elements. By mining more comprehensive information, it more realistically measures the interest of sequence patterns, effectively discovering truly valuable information. When analyzing live streaming purchasing behavior, this invention can fully mine truly interesting live purchase sequence patterns, thereby discovering more comprehensive and truly valuable live product purchase information. When live stream merchants are showcasing products, this invention can provide them with recommended products to be displayed next. These products are those that customers have purchased frequently after the previous live stream showcase, making them more likely to be purchased. This increases the transaction opportunities for customers in live shopping, converting viewers into buyers, increasing the probability of purchase, and ultimately improving the revenue of the live stream. Attached Figure Description
[0049] The invention will now be further described with reference to the accompanying drawings.
[0050] Appendix Figure 1 This is a flowchart illustrating the Inf-NSP algorithm used in this invention to mine positive and negative sequence patterns that satisfy influence constraints.
[0051] Appendix Figure 2 This is the flowchart of the method for analyzing the influence of negative sequence patterns based on live shopping sequences in this invention.
[0052] Appendix Figure 3 This is the implementation system of the method for analyzing the influence of negative sequence patterns based on live shopping sequences according to the present invention. Detailed Implementation
[0053] In order to effectively analyze the transaction sequence in live shopping, the following key issues should be addressed: (1) How can merchants find the most suitable product display order in live streaming to better attract fans and encourage them to buy more products, thereby increasing the revenue of live streaming; (2) How to solve the problem that the support in traditional negative sequence pattern mining cannot truly reflect the interest of the pattern, thus resulting in some sequence patterns in the mining results providing worthless information; (3) How to effectively mine more comprehensive and realistic negative sequence patterns in live shopping sequences.
[0054] The specific technical issues addressed in the research on influence in negative sequence pattern mining mainly include the following aspects:
[0055] (1) How to find a suitable traditional negative sequence pattern mining algorithm that can utilize influence? Because existing influence methods are not only for positive sequence pattern mining but also for element-based sequences, there is no research on negative sequence pattern mining in this area. Therefore, we need to analyze the applicability of influence in traditional negative sequence pattern mining and consider which algorithm can utilize influence. Furthermore, our research focuses on negative sequence pattern mining with missing items. For example, the sequence <(keyboard, mouse, ... The USB drive is a missing negative sequence pattern. Elements (keyboard, mouse, ...) The "USB flash drive" example indicates that the customer purchased a keyboard and mouse in a single transaction, but not a USB flash drive. Therefore, the appropriate algorithm needed is one that mines negative sequence patterns with missing items. Mining negative sequence patterns with missing items is more comprehensive, making its study more complex.
[0056] (2) How to match the influence candidate sequence generation method? The generation method for influence candidate sequences (the sequence before being constrained by the minimum influence threshold) is closely related to the candidate sequence generation method of traditional negative sequence pattern mining algorithms, and the candidate sequence generation methods of different traditional negative sequence pattern mining algorithms differ significantly. Therefore, we need to modify the influence candidate sequence generation method to match these two methods. This ensures that the generated influence candidate sequences are consistent with the sequence patterns mined by traditional negative sequence pattern mining algorithms, meaning that influence candidate sequences can be found in the sequence pattern set based solely on support mining. Furthermore, some negative sequence pattern mining algorithms currently cannot use influence because their candidate sequence generation methods differ significantly from those of influence candidate sequences.
[0057] (3) At which step in traditional negative sequence pattern mining is influence value appropriate? Influence value can be used in different steps of traditional negative sequence pattern mining, such as during candidate sequence generation or after frequent patterns are discovered. The usefulness of influence value and algorithm efficiency may vary greatly depending on the step used. Therefore, we need to consider at which step in traditional negative sequence pattern mining is it appropriate to use influence value, depending on the negative sequence pattern mining algorithm used. Furthermore, the appropriate step for using influence value may also differ for different traditional negative sequence pattern mining algorithms.
[0058] To address the aforementioned problems, this invention proposes a novel algorithm, InfI-NSP, to mine interesting negative sequence patterns based on influence. To our knowledge, InfI-NSP is the first negative sequence pattern mining algorithm to consider influence. The main contributions of this invention are summarized as follows:
[0059] First, we modified the traditional negative sequence pattern mining algorithm sc-NSP[3] to mine negative sequence patterns with missing items based on influence. This is because the candidate sequence generation method of the sc-NSP algorithm has a high degree of matching with the influence candidate sequence generation method, and the algorithm is also very fast. In addition, the ISSPM algorithm[1] proposed by Wu et al. is for element-based sequences, but we are studying item-based sequences. Since the items in the elements are unordered, that is, there is no need to consider the order between the items in the elements, the correlation influence method can be extended to item-based negative sequence pattern mining.
[0060] Secondly, we modified the influence candidate sequence generation method in the ISSPM algorithm [1]. We modified it accordingly during the process of splicing patterns to generate influence candidate sequences, so that the influence candidate sequence generation method is compatible with the candidate sequence generation method of the traditional negative sequence pattern mining algorithm.
[0061] Third, we choose to use influence at a suitable step in traditional negative sequence pattern mining. That is, after obtaining patterns that satisfy the minimum support threshold constraint, we calculate the influence of the patterns. This not only ensures the usefulness of influence, but also makes the algorithm more efficient compared to using influence in other steps of traditional negative sequence pattern mining.
[0062] Finally, we propose a novel algorithm, InfI-NSP, to mine interesting negative sequence patterns based on influence. This algorithm considers not only the support of each element within the pattern but also the order features between these elements during the mining process. Therefore, the interest level of the pattern can be accurately reflected.
[0063] For a sequence, items that have occurred are called positive items, and correspondingly, items that have not occurred are called negative items. If an element contains negative items, then that element is called a negative element. Furthermore, if a sequence contains negative elements, then that sequence is called a negative sequence. The sequence in the customer purchase source data is a customer purchase data sequence. Next, some important definitions of positive sequence patterns and negative sequence patterns are introduced. Some of the main symbols involved in this invention are shown in the following table:
[0064] The main symbols involved in this invention are shown in the table below:
[0065]
[0066]
[0067] First, we define the following:
[0068] Positive sequence pattern: Let I = {x1, x2, ..., x} n} represents a set of items, an itemset is a subset of I, and a sequence is an ordered arrangement of itemsets. A sequence can be represented as s = <s1s2…s l >, among which s j Any element in a sequence s can be represented as s j =(x1x2…x m ), where x k x is a term in I. k ∈I and 1≤k≤m. For simplicity, if an element contains only one item, the parentheses can be omitted, that is, element (x) can also be written directly as x. To reduce complexity, we assume that the same item can only appear once in an element, but it can appear multiple times in different elements of a sequence.
[0069] The length of sequence s, denoted as length(s), refers to the total number of items contained in all elements of the sequence. If length(s) = k, then s is a sequence of length k. The size of sequence s, denoted as size(s), refers to the total number of elements contained in the sequence. If size(s) = k, then s is a sequence of size k. For example, sequence s = ...<a(bc)d> It consists of 3 elements a, (bc) and d, and contains a total of 4 items a, b, c and d. Therefore, length(s) = 4 and size(s) = 3.
[0070] Suppose there are two sequences s α =<α1α2…α i >and s β =<β1β2…β k > If there exists 1≤j1 <j2<…<j i ≤k makes We call sequence s α =<α1α2…α i > is sequence s β =<β1β2…β k A sub-sequence of > is denoted as sequence s β Called sequence s α A super-sequence. For example, sequence s1 =<ab(cd)> It is a supersequence of sequence s2 = <(cd)> (sequence s2 = <(cd)> is a supersequence of sequence s1 =<ab(cd)> a subsequence of ).
[0071] The number of tuples in the sequence database D is denoted as |D|, where a tuple is <sid (sequence ID), ds (data sequence)>. The set of tuples containing the sequence s is denoted as { <s>The support of sequence s is denoted as sup(s), which is the sum of the support values of sequences contained in {}. <s>The number of tuples in}. That is min-sup is a user-defined minimum support threshold. If sup(s) ≥ min-sup, then the sequence s is called a frequent sequence pattern. Conversely, if sup(s) < min-sup, then the sequence s is infrequent.
[0072] Negative sequence pattern,
[0073] The items that a customer originally intended to purchase but did not purchase are negative items, also known as non-occurrence behaviors; a customer's shopping record at one time is an element; an element containing at least one negative item is a negative element; a customer's shopping records over a period of time are called a data sequence, and a sequence containing at least one negative element is called a negative sequence.
[0074] When mining in a customer purchase sequence, sometimes the number of NSCs generated is large, but many of them may be meaningless. Therefore, constraints are added to reduce the number of NSCs and effectively discover meaningful NSPs. The key concepts and definitions of the negative constraints involved in this invention are introduced as follows:
[0075] Definition 1 - Negative size: The total number of negative elements in a negative sequence ns is called the negative size of ns. If negsize(ns) = n, then ns is an n-neg-size sequence. For example, given The number of negative elements is 2, so ns is a 2-neg-size sequence.
[0076] Definition 2 - Positive partner: A negative element 's positive partner is (ab), denoted as That is The positive partner of the positive element (ab) is (ab) itself, that is, p((ab)) = (ab). The positive partner of a negative sequence ns = <s1s2,…,s k >] is obtained by changing all negative elements in ns to their positive partners, denoted as p(ns), that is, p(ns) = <s1s2,…,s k >|s j = p(s i ), s i ∈ ns. For example,
[0077] Definition 3 - Maximum positive subsequence: Suppose ns = <s1s2,…,s m >] is a negative sequence of m-size and n-neg-size (m > n), and the subsequence s contains all positive elements. Then s is called the maximum positive subsequence of ns, denoted as MPS(ns). For example, given We can get MPS(ns) = <ac>.
[0078] Definition 4-1-Neg-Size Maximum Subsequence: For a negative sequence ns, the subsequence containing MPS(ns) and a negative element e is called the 1-neg-size maximum subsequence, denoted as 1-negMS. i The set of all 1-neg-size largest subsequences containing ns is called the 1-neg-size largest subsequence set, denoted as 1-negMSS. ns For example, given
[0079] Constraint 1 - Frequent Element Constraint: A negative element e n It cannot appear in NSC unless its positive element partner p(e) n ) is frequent, i.e., sup(p(e) n ))≥min-sup. For example, if Then element This constraint is satisfied.
[0080] It should be noted that, similar to the NegI-NSP algorithm [2], this invention does not consider and This is because it is difficult to distinguish negative elements when conducting customer purchase behavior analysis. and The difference between them. Although the sequences It is frequent and difficult to apply to customer purchase behavior analysis.
[0081] Constraint 2-1-length-neg element format constraint: NSC only allows consecutive 1-length negative elements. For example, This constraint is satisfied, but Not satisfied.
[0082] Negative inclusion can be transformed into positive inclusion; the support level of an NSP can depend on the information of the corresponding PSP.
[0083] Definition 5 - Negative Inclusion: Let ds = <d1,d2,…,d t For a customer purchasing a data sequence, ns = <s1,s2,…,s m > For a negative sequence of m-size and n-neg-size: (1) If m>2t+1, then ds does not contain ns; (2) If m≥1 and n=1, then when When ds contains ns; (3) otherwise, if Then ds contains ns.
[0084] For example, given ds =<ab(cd)(ade)fc> (1) If Then ds does not contain ns, because if Then ds contains ns because
[0085] This invention provides an impact analysis system for negative sequence patterns based on live shopping sequences, including a data preprocessing module for acquiring data, preprocessing the data, and storing the data in a database D;
[0086] The frequent pattern mining module is used to mine frequent patterns in the dataset processed by the data preprocessing module using a pre-set algorithm and based on the minimum support threshold set by the user.
[0087] The influence analysis module is used to calculate the influence of positive and negative frequent sequence patterns obtained by the frequent pattern mining module, extract the influence of the pattern, and select frequent patterns that meet the influence constraints according to the minimum influence threshold set by the user.
[0088] The graphical interface module is used to display the mining results of the influence analysis module on the system's graphical interface and provide users with a search box on this page.
[0089] Based on the above system, a negative sequence pattern analysis method based on influence degree is provided. First, a set of sequence patterns Q that satisfy the support degree constraint is obtained by mining through the modified sc-NSP algorithm; then, the influence degree of each sequence pattern in set Q is calculated according to the modified influence degree calculation method, and the sequence patterns that satisfy the influence degree constraint are stored in set G; finally, the set of sequence patterns G that satisfy the influence degree constraint is returned.
[0090] The specific steps are as follows:
[0091] S100 Data Acquisition and Preprocessing: Acquire live-stream transaction data and clean the data, as real-world data is generally incomplete, noisy, and inconsistent. The acquired live-stream transaction data may contain missing values, duplicates, and inconsistent data. Data cleaning involves: for missing values, determining the range of missing values, removing unnecessary fields, and filling in the missing content; for duplicate data, deleting and retaining only one record; and for inconsistent data, filling in the missing data. The product names in the cleaned data are represented numerically, and this correspondence is stored in database D. Next, the processed data is represented as a sequence. Several live-stream transaction sequences are used as the dataset for frequent pattern mining. Specifically, the data records of a user's purchases in a shopping live stream are a sequence, and all products purchased in a single live-stream product display are an element, with each product as an item within that element. For example, in a clothing live stream, a user bought a sweatshirt and a jacket when the live streamer was showing tops, a pair of jeans when the live streamer was showing pants, and a baseball cap when the live streamer was showing hats. If the sweatshirt is represented by the number 1, the jacket by the number 2, the jeans by the number 3, and the baseball cap by the number 4, then after processing, the user's purchase sequence is <(1,2),3,4>.
[0092] S200 Frequent Pattern Mining: Using a modified sc-NSP algorithm and based on the minimum support threshold set by the user, frequent patterns are mined from the dataset obtained through the above processing.
[0093] The frequent pattern mining module performs frequent pattern mining in live shopping transaction data using the modified sc-NSP algorithm and a user-defined minimum support threshold. This invention studies item-based negative sequence patterns. Therefore, for the NSC generation method, we further combine the NSC generation method in the NegI-NSP algorithm [2] with the sc-NSP algorithm [3].
[0094] S210 generates NSC.
[0095] S211, a 1-size NSC is generated from a 1-size PSP according to the negative element constraint. The basic idea is to change any terms in the PSP to their negative form. For example, the NSC obtained based on the 1-size PSP <(abc)> includes: Clearly, this method can generate all possible 1-size NSCs that satisfy the two constraints.
[0096] S212, the generation of an n-size (n≥2) NSC falls into two cases: 1) Connecting a (n-1)-size PSP to a 1-size NSC, that is, connecting a positive sequence pattern of size (n-1) with a negative candidate sequence of size 1. It should be noted that the 1-size NSC includes negative elements in the sequence where the element is a missing item (e.g., ...). ) and negative single elements (such as Two cases; 2)(n-1)-size NSC connects 1-size PSP and 1-size NSC, that is, the negative candidate sequence of size (n-1) is connected with the positive sequence pattern of size 1 and the negative candidate sequence of size 1 respectively. Generate negative sequence candidates that satisfy the format constraints. It should be noted that we use (k-1)-size NSC to generate k-size NSC instead of (k-1)-size NSP, because NSP does not satisfy the Apriori property [4].
[0097] S213, Repeat the above process until no NSC is generated or the size of the NSC is greater than 2m+1, where m represents the maximum size of the sequence in the PSP. If the maximum size of the sequence in the PSP is m, then the maximum size of the generated NSP is 2m+1.
[0098] Some n-size NSCs can be removed before calculating their support. Based on the definition of the 1-Neg-Size maximum subsequence and the element frequency constraint, we use the following two pruning strategies: 1) If and The sequence ns is pruned; 2) if and The sequence ns is pruned.
[0099] S220 calculates the support of NSC. The support calculation method used in the InfI-NSP algorithm is the same as that in the NegI-NSP algorithm [2]. The support calculation formula in the NegI-NSP algorithm conforms to the principles of set theory. Specifically, it is as follows:
[0100] Given a negative sequence ns of size m containing n negative elements, for these n negative elements, Then the support of ns in database D is:
[0101] sup(ns) = sup(MPS(ns)) - |∪ n i=1 {p(1-negMS i )}| (1)
[0102] In particular, for negative sequences
[0103]
[0104] Due to (MPS(ns)) and p(1-negMS) i Both are frequent, and the value of sup(MPS(ns)) can be obtained from traditional positive sequence pattern mining methods.
[0105] The pseudocode generated by NSC is as follows:
[0106] Algorithm 1: NSC Generation
[0107] Input: Customer purchases sequence database D, PSP;
[0108] Output: NSC;
[0109]
[0110]
[0111] S300 Frequent Pattern Influence Analysis: The influence of the positive and negative frequent sequence patterns obtained through support mining is calculated to extract the influence of the patterns. Based on the minimum influence threshold set by the user, the frequent live purchase patterns that meet the influence constraints are selected.
[0112] The impact analysis module performs impact analysis on the live purchase sequence pattern using a modified impact calculation method and a user-defined minimum impact threshold.
[0113] The two problems discussed in the background section above regarding the mining of sequence patterns using only support can be effectively solved using influence. For convenience, we reiterate these two problems: (1) The support of elements within a sequence pattern has a significant impact on the support of the pattern itself; (2) The support of a sequence pattern cannot reflect the sequential characteristics between its internal elements.
[0114] The steps for calculating the impact are as follows:
[0115] S310, Given a sequence pattern s = <e1,e2,…,e l If the elements in s are independent, then the expected support of s is:
[0116]
[0117] This expected value means that even if there is no sequential relationship between the elements of s, s will appear in D with a relatively high probability of exsup(s)×|D| times. exsup(s) quantifies, to some extent, the impact of the support of each element on the support of the pattern itself.
[0118] S320, the corrected support of s is obtained by subtracting this effect:
[0119] adsup(s)=sup(s)-exsup(s) (4)
[0120] Correcting the support for sequence patterns can effectively solve the first problem mentioned above.
[0121] S330. Since we need to calculate the support of the possible sequence patterns formed by the two sub-patterns to determine whether the order of these elements is important, we first need to obtain the set of possible sequence patterns formed by the two sub-patterns. Assume h(s) represents the first element of s, and r(s) represents the elements of s excluding the first element. s can be represented as...<h(s),r(s)> Given two patterns s a and s b The possible sequence patterns ger(s) a s b It can be recursively calculated using the following formula:
[0122] ger(s a s b ) = G a ∪G b (5)
[0123] G a ={ <h(s a ), X>|X∈ger(r(s) a ), s b (6)
[0124] G b ={ <h(s b ), Y>|Y∈ger(s a ,r(s b ))} (7)
[0125] in, For example, suppose and Then the possible sequence patterns formed by sa and sb are: If ger(s) a s b If the support of sequence patterns in s are not significantly different, it indicates that s a and s b The order of the middle terms is irrelevant, therefore ger(s) a s b Sequence patterns in () should not be considered interesting sequence patterns.
[0126] S340, Next, the modified support of the pattern is further adjusted to introduce the order features between elements, as follows:
[0127]
[0128] inf(s)=adsup(s)-mesup(s) (9)
[0129] Among them, G ger It means ger(s) a s b The result set of ) , avg() represents G ger The average support of sequence patterns in the set. The above inf() is called the influence of s, which considers not only the influence of the support of elements within s on the support of s itself, but also the order features between these elements.
[0130] The relevant process for calculating the above influence is modified as follows:
[0131] Since this embodiment uses a connection-based approach to generate NSC, we modified the influence calculation process described above. We calculated the influence of each sequence pattern derived solely from support, for each s... a and s b The method for obtaining this has been modified. Specifically, it assumes an n-size sequence. <x1x2,…,x n >, take the first (n-1) elements as s a The last element is s b , that is s a = <x1x2,…,x n-1 >,s b = <x n Then, S330 obtains a set of possible sequence patterns, and then performs subsequent calculations.
[0132] The method and process of calculating influence in this invention are based on the idea of influence used in the ISSPM algorithm [1], and some modifications are made to it to mine interesting negative sequence patterns.
[0133] Because there is a matching problem between the candidate sequence generation method and the influence degree in traditional negative sequence pattern mining, we modified the influence degree candidate sequence generation method in the ISSPM algorithm [1]. In the process of splicing patterns to generate influence degree candidate sequences, we made corresponding modifications to make the influence candidate sequence generation method match the candidate sequence generation method of the modified sc-NSP algorithm. This ensures that the generated influence degree candidate sequence is consistent with the sequence pattern mined by the modified sc-NSP algorithm, that is, the influence degree candidate sequence can be found in the sequence pattern set based on support mining. The details are as follows:
[0134] In the modified sc-NSP, a traditional negative sequence pattern mining algorithm, we use an additional method to generate negative candidate sequences, as detailed in step S210. Therefore, we modified the influence candidate sequence generation method in the ISSPM algorithm [1] in conjunction with this aspect. In the ISSPM algorithm, the patterns that meet specific conditions in the sequence patterns mined by support are concatenated pairwise according to their length. Therefore, for the s in step S330 a and s b These are all patterns of the same length obtained from support mining. Unlike the ISSPM algorithm, we first obtain all sequence patterns that satisfy the support constraints, and then calculate the influence of each of these patterns individually. To make the method for generating influence candidate sequences match the candidate sequence generation method of the modified sc-NSP algorithm, we modified the s... a and s b The methods for obtaining these sequences all involve using the same pattern. Specifically, assuming an n-size sequence... <x1x2,…,x n >, take the first (n-1) elements as s a The last element is s b , that is s a = <x1x2,…,x n-1 >,s b = <x n Then, the set of possible patterns is obtained using the method in step S330, and subsequent calculations are performed. The pseudocode for influence calculation is as follows:
[0135] Algorithm 2: Influence Calculation
[0136] Input: a set of sequence patterns Q (PSP or NSP), and a minimum influence threshold min-inf;
[0137] Output: A set of sequence patterns G (Inf-PSP or Inf-NSP);
[0138]
[0139] Analysis shows that influence can be used during candidate sequence generation or after frequent patterns are identified. However, a large number of redundant patterns exist in the generated candidate sequences, and using influence at this step would result in ineffective influence calculation, leading to significant time and space waste. Therefore, in the InfI-NSP algorithm, we choose to calculate the influence of patterns after obtaining those that satisfy the support constraints. This not only ensures the usefulness of influence but also makes the algorithm more efficient compared to using influence in other steps of traditional negative sequence pattern mining.
[0140] The pseudocode for the InfI-NSP algorithm is as follows:
[0141] Algorithm 3: InfI-NSP Algorithm Input: Customer purchase sequence database D, minimum support threshold min-sup, minimum influence threshold min-inf;
[0142] Output: Inf-PSP, Inf-NSP;
[0143]
[0144] The InfI-NSP algorithm first mines all PSPs from the sequence database D using a modified sc-NSP algorithm (line 1). Second, it uses the influence calculation method in S300 to obtain all positive sequence patterns Inf-PSPs that satisfy the influence constraints (line 2). Third, it uses the NSC generation method in S210 to generate all NSCs (line 3). The support of each nsc in the NSC is calculated using the support calculation formulas (1) and (2) in S220 (lines 4-9). If the support of an nsc satisfies the min-sup constraint, it is an NSP (lines 10-12). Finally, it uses the influence calculation method in S300 to obtain all negative sequence patterns Inf-NSPs that satisfy the influence constraints (line 14).
[0145] The S400 graphical interface displays the above mining results on the system's graphical interface, and provides a search box for users on this page. Merchants can enter the product currently being displayed in the live stream to display the next recommended product.
[0146] In this embodiment, a sequence pattern that satisfies the support constraint refers to a sequence pattern whose support value is within the range of the support constraint set by the user; for example, in the example of live-streaming stationery sales, the sequence <(pencil, Mechanical pencil), handbag > support level sup(<(pencil, If the support constraint set by the user is sup(s)≥min-sup=0.16, then the sequence <(pencil, handbag>)=0.16. The sequence <(pencil, tote bag)> is a sequence pattern that satisfies the support constraint. Alternatively, in the example of live-streaming stationery sales, the sequence <(pencil, tote bag)> is a sequence pattern that satisfies the support constraint. The influence of mechanical pencil, knife, eraser > inf(<(pencil, If the influence constraint set by the user is inf(s)≥min-inf=0.08, then the sequence <(pencil, knife, eraser) = 0.08. The sequence pattern > mechanical pen, knife, eraser is a sequence pattern that satisfies the influence constraint.
[0147] Taking the transactions of 6 customers in a live shopping session as an example, Table 1 shows the compiled customer purchase sequence database. The letters represent product IDs.
[0148] Table 1 shows the compiled customer purchase sequence database.
[0149] Customer ID Customer purchase sequence 1 <{a}{c,e}> 2 <{a,b}{c}{a,d,g}> 3 <{c,h}> 4 <{c}{c,e,g,h}{i}> 5 〈{i}〉 6 <{a}{c}{f,g}>
[0150] A customer's transaction records during a live-stream shopping session constitute an ordered sequence, denoted by <>. Within this sequence, items / itemsets are ordered; each item represents a purchased product, while elements refer to all the products purchased by the customer during a particular product showcase in the live stream, denoted by {} or (). The customer may purchase the same product in different product showcases during the live stream, meaning an item may appear in different elements of the sequence. For example, in Table 1, the purchase sequence for customer ID 2 is <{a,b}{c}{a,d,g}>. This customer purchased product 'a' in the first and third transactions during the live stream. The itemsets {a,b}, {c}, and {a,d,g} can be called elements of the sequence, and a, b, c, d, and g are called items. If an element contains only one item, the parentheses can be omitted; for example, the element {c} in this sequence can be simply written as 'c'. The purchase sequence of customer ID 2 in the live stream is <{a,b}{c}{a,d,g}>, which means that customer ID 2 purchased products a and b in the first transaction, product c in the second transaction, and products a, d, and g in the third transaction.
[0151] Experiments were conducted based on the InfI-NSP algorithm's mining steps. Table 1 shows some of the higher-supported sequence patterns among the positive and negative sequence patterns of size 2 removed from the results mined solely by support analysis, after using influence analysis. From Table 1, we can see that these patterns are all composed of repeated or combined elements with high support. Therefore, the support of these sequence patterns mainly originates from their internal elements, and the support does not reflect their true interest. Furthermore, these sequences obtained by changing the order of elements in the sequence have similar support levels, meaning the order characteristics of the elements in the sequence are not considered. Therefore, the information provided by these sequence patterns is worthless and should not be considered interesting sequence patterns. The InfI-NSP algorithm improves the quality of patterns in the mining results by removing uninteresting frequent patterns through influence analysis during the NSP mining process. If the numbers in the table below represent different products displayed in the live stream, then the information provided by these sequence patterns to the live stream merchants is worthless and cannot provide a reference for the live stream merchants to decide the order of product display.
[0152] Table 2 shows the partial positive and negative sequence patterns removed in the experiment (min-sup = 0.26, min-inf = 0.01).
[0153]
[0154] References [1] Wu Jun, Ouyang Aijia, Zhang Lin. Statistical significant sequence pattern mining algorithm based on influence degree [J]. Computer Applications, 2022, 42(09):2713-2721.
[0155] References [2] Qiu, P.; Zhao, L.; Dong,
[0156] Reference [3] Gao, X.; Gong, Y.; Xu, T.; Lü, J.; Zhao, Y.; Dong, X. Toward to better structure and constraint to mine negative sequential patterns. IEEE Transactions on Neural Networks and Learning Systems 2020.
[0157] Reference [4] Dong, X.; Zheng, Z.; Cao, L.; Zhao, Y.; Zhang, C.; Li, J.; Wei, W.; Ou, Y. e-NSP: efficient negative sequential pattern mining based on identified positive patterns without database rescanning. In Proceedings of the Proceedings of the 20th ACM international conference on Information and knowledge management, 2011, pp. 825–830.< / ac> < / s> < / s>
Claims
1. A method for negative sequence pattern analysis based on influence degree, characterized in that: The following definition is made: Negative size: The total number of negative elements in a negative sequence ns is called the negative size of ns; if negsize(ns) = n, then ns is an n-neg-size sequence; Positive partner: a negative element The positive partner is (ab), denoted as ,Right now The positive partner of a positive element (ab) is (ab) itself, i.e., p((ab)) = (ab); a negative sequence ns = <s1,s2,… ,s k The positive partner of > is to make all negative elements in ns their positive partners, denoted as p(ns), that is, p(ns) = <s1,s2,…,s k >|s j =p(s i ),s i ∈ns; Maximum positron sequence: Assume ns= <s1,s2,… ,s m If a negative sequence > is of size m and size n (m>n), and its subsequence s contains all positive elements, then s is called the maximum positive subsequence of ns, denoted as MPS(ns); 1-Neg-Size Maximum Subsequence: For a negative sequence ns, the subsequence containing MPS(ns) and a negative element e is called the 1-neg-size maximum subsequence, denoted as 1-negMS. i The set of all 1-neg-size largest subsequences containing ns is called the 1-neg-size largest subsequence set, denoted as 1-negMSS. ns ; Element Frequent Constraint: A negative element e n It cannot appear in NSC unless its positive element partner p(e) n ) is frequent, i.e., sup(p(e) n )) ≥min-sup; if Then element This constraint must be satisfied; 1-length-neg element format constraint: NSC only allows consecutive 1-length negative elements; This constraint is satisfied, but Not satisfied; Negative inclusion: Let ds = <d1,d2,…,d t For a customer purchasing a data sequence, ns = <s1,s2,…,s m > is a negative sequence of m-size and n-neg-size; (1) if m>2t+1, then ds does not contain ns; (2) if m≥1 and n=1, then when When, ds contains ns; (3) otherwise, if If , then ds contains ns; The negative sequence pattern analysis method based on influence degree specifically includes the following steps: S100 Data Acquisition and Preprocessing: Acquire live transaction data, clean the transaction data in live shopping, represent the product names in the cleaned data with numbers, and store the corresponding relationships in the database. Next, represent the processed data as a sequence, and use the resulting live transaction sequences as a dataset for frequent pattern mining. S200 Frequent Pattern Mining: Using the modified sc-NSP algorithm and based on the minimum support threshold set by the user, frequent patterns are mined from the dataset obtained by the above processing. S300 Frequent Pattern Impact Analysis: The impact of the positive and negative frequent patterns obtained through support mining is calculated to obtain the impact of the pattern. Based on the minimum impact threshold set by the user, the frequent live purchase patterns that meet the impact constraints are selected. Step S300 includes S310, given a sequence pattern s = <e1,e2,… ,e l If the elements in s are independent, then the expected support of s is: ; S320, the corrected support of s obtained by subtracting this effect is: adsup(s) = sup(s) - exsup(s); S330 Assume h(s) represents the first element of s, and r(s) represents the elements of s excluding the first element. s can be represented as:<h(s) ,r(s)> Given two patterns s a and s b The possible sequence patterns ger(s) a ,s b It can be recursively calculated using the following formula: ger(s a ,s b )=G a ∪G b G a ={<h(s a ),X>|X∈ger(r(s a ),s b )} G b ={<h(s b ),Y>|Y∈ger(s a ,r(s b ))} in, , ; S340, Next, the modified support of the pattern is further adjusted to introduce the order features between elements. First, the adjusted value of the modified support of sequence s is calculated. , Then calculate the influence of sequence s. inf(s) = adsup(s) - mesup(s) Among them, G ger It means ger(s) a ,s b The result set of G, where avg() represents G ger The average support of sequence patterns in the set; The s a s b For an assumed n-size sequence <x1,x2,… ,x n >, take the first (n-1) elements as s a The last element is s b ; The S400 graphical interface displays the above mining results on the system's graphical interface, which provides a search box for users. Merchants can enter the currently displayed product to display the next recommended product.
2. The method for negative sequence pattern analysis based on influence degree according to claim 1, characterized in that... Step S200 specifically includes S210 generating NSC; and S220 calculating the support of NSC using the support calculation method in the NegI-NSP algorithm.
3. The method for negative sequence pattern analysis based on influence degree according to claim 2, characterized in that: The step S210 of generating NSC specifically includes S211, where a 1-size NSC is generated from a 1-size PSP according to the negative element constraint; S212, the generation of an n-size (n≥2) NSC is divided into two cases: 1) a (n-1)-size PSP is connected to a 1-size NSC, 2) a (n-1)-size NSC is connected to a 1-size PSP and a 1-size NSC. S213, Repeat the above process until no NSC is generated or the size of the NSC is greater than 2m+1, where m represents the maximum size of the sequence in the PSP; The size is the sequence size.
4. The method for negative sequence pattern analysis based on influence degree according to claim 3, characterized in that... Including pruning steps, based on the definition of the 1-Neg-Size maximum subsequence and element frequency constraints, the following two pruning strategies are adopted: 1) If and 1) The sequence ns is pruned; 2) If and The sequence ns is pruned.
5. A negative sequence pattern analysis system based on influence degree, characterized in that: The influence-based negative sequence pattern analysis system is used to implement the influence-based negative sequence pattern analysis method as described in claim 1. The negative sequence pattern analysis system based on influence includes a data preprocessing module, used to acquire data, preprocess the data, and store the data in a database; The frequent pattern mining module is used to mine frequent patterns in the dataset processed by the data preprocessing module using a pre-set algorithm and based on the minimum support threshold set by the user. The influence analysis module is used to calculate the influence of positive and negative frequent sequence patterns obtained by the frequent pattern mining module, extract the influence of the pattern, and select frequent patterns that meet the influence constraints according to the minimum influence threshold set by the user. The graphical interface representation module is used to display the mining results of the influence analysis module on the system's graphical interface, and to provide users with a search box in the graphical interface.