An analytical method based on big data from smart card systems
By performing multi-dimensional information mining and cluster analysis on campus card data, combined with association rule analysis, the problem of single analysis dimensions in existing technologies has been solved, realizing multi-dimensional automated analysis of student consumption behavior and providing more comprehensive management suggestions and early warning information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 钱堃
- Filing Date
- 2022-07-12
- Publication Date
- 2026-04-21
AI Technical Summary
Existing campus card data analysis technology is limited to consumption data, has a single analysis dimension, and is difficult to determine the data distribution and number of categories, resulting in poor clustering effect and failing to provide efficient and reliable analysis results, thus failing to meet the multi-dimensional analysis needs of students and schools.
By conducting multi-dimensional information mining on campus card data, using the mean shift method for cluster analysis, and combining Apriori association rule analysis to identify student consumption behavior characteristics, we can obtain students' life trajectory preferences and reflect their life behavior characteristics, providing management suggestions and early warning information for students and schools.
It enables multidimensional automated analysis of student consumption behavior, provides more comprehensive consumption behavior analysis results, eliminates the artificial limitation on the number of clusters, improves the objectivity and inclusiveness of the analysis results, and meets the multidimensional analysis needs of students and schools.
Smart Images

Figure CN115239106B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data analysis technology, and in particular to an analysis method based on big data from a smart card system. Background Technology
[0002] With the rapid development of information technology and related hardware and software, campus cards have become indispensable in all aspects of student campus life. Through a single card and corresponding data management system, schools can provide students with integrated and efficient information services, such as payment, access control, library borrowing, identity authentication, and service reservations. The widespread use of campus cards not only facilitates student life but also makes campus management more standardized and intelligent.
[0003] In the construction of digital and smart campuses, campus card data is undoubtedly a crucial foundation. To extract valuable information from the massive amounts of raw data generated by student card swipes and to support student behavior analysis and campus security management, appropriate data analysis or mining methods are essential. Based on data analysis methods, extracting high-level semantic information from raw data can, on the one hand, provide students with lifestyle habit analysis and healthy living suggestions, and on the other hand, offer effective references for the school's daily management and security work.
[0004] Currently, research on campus card data analysis technology remains relatively limited. On the one hand, the analysis primarily focuses on consumption data, with limited data analysis dimensions, and the conclusions are mainly geared towards school administrators. However, with the popularization and development of mobile devices, mobile applications, and big data concepts, students are increasingly interested in the statistical patterns of their own data and have a stronger desire to assess their own situation and adopt corresponding suggestions based on big data analysis results. For example, the annual plans launched by various mobile applications are currently very popular among teenagers. On the other hand, the analysis methods used are relatively limited. One of the most commonly used methods is K-means clustering, which requires pre-setting the number of clusters. However, with the ever-growing volume of campus card data, it is often difficult to determine the data distribution and the number of possible categories, resulting in inefficient clustering and the inability to obtain optimal analysis results. Therefore, the massive and multidimensional campus card data places more diverse demands on analysis technology research, hoping to minimize human intervention and provide efficient and reliable analysis services for both schools and students, thereby promoting the development of related applications.
[0005] To address the aforementioned background and issues, an analytical method based on campus card data is needed. This method should be capable of efficiently and automatically analyzing the massive amounts of multidimensional data generated from campus card swiping, extracting characteristics of students' campus life behaviors and their correlations. On one hand, it should provide students with a profile reflecting their behavioral characteristics, aiding in self-management and improvement. On the other hand, it should provide school administrators with suggestions for the overall management of student living and learning environments such as canteens, dormitories, and teaching buildings, as well as early warnings of student economic and safety issues. By fully mining the rich information contained in the campus card data, valuable data analysis results can be provided to both students and schools. Summary of the Invention
[0006] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide an analysis method based on big data from campus cards. This invention fully mines multi-dimensional information from campus card data, providing valuable data analysis results for both students and schools. On the one hand, it provides students with a profile reflecting their lifestyle and behavioral characteristics, helping them to manage and improve themselves. On the other hand, it provides school administrators with suggestions for the overall management of students' living and learning environments, such as canteens, dormitories, and teaching buildings, as well as early warnings of potential problems. It has more multi-dimensional and broader application scenarios.
[0007] To achieve the above objectives, the present invention provides the following solution:
[0008] An analysis method based on big data from smart card systems includes the following steps:
[0009] S1: Read in the personal information of a certain student group of campus card users within a preset period, campus card consumption records, and access control records within the same period, and obtain the raw dataset reflecting campus life. The raw dataset is uniquely identified by the card number and corresponds one-to-one with each student.
[0010] S2: Clean and statistically analyze the original dataset, and process the original dataset according to different life behavior characteristics to obtain a campus life behavior dataset and its effective data subset that can be used for analysis;
[0011] S3: Using the effective subset of data available for analysis, obtain two-dimensional data consisting of consumption frequency and total consumption amount, and perform cluster analysis on the two-dimensional data consisting of consumption frequency and total consumption amount using the mean shift method to obtain data after cluster analysis;
[0012] S4: Through the data obtained after the cluster analysis, student consumption behavior characteristics are obtained, providing references for management and self-management for schools and students respectively.
[0013] S5: Using the campus life behavior dataset and its effective data subset that can be used for analysis, the Apriori association rule analysis method is used to perform joint analysis on the campus life behavior dataset and its effective data subset that can be used for analysis, obtain joint analysis results, and analyze the life behavior trajectory preferences of different student groups;
[0014] S6: Based on the joint analysis results, obtain the behavioral characteristics of students' life trajectories, and provide meal preparation planning suggestions and dining recommendations for canteen management and students respectively.
[0015] Preferably, step S1 includes: for a preset period Dur, reading in N transaction records of student campus cards within that period, each transaction record p n The set of features can be expressed as follows:
[0016] p n ={(CardNo n Time n ,Loction n Money n (1) | n = 1, 2, 3, ..., N
[0017] Among them, CardNo n Time n ,Loction n Money n These are the credit card transaction records (p). n Card number, transaction time, transaction location, and transaction amount;
[0018] The student's personal information refers to the Card No. in each record. n Query and retrieve the access control identification code (Acc) corresponding to the student with this card number. n and gender information (Sex) n ;
[0019] The student's personal information and the transaction card records p n Together, they constitute a dataset of consumption locations containing N card swipe records and student personal information within a preset period Dur:
[0020] l n ={(CardNo n Time n ,Loction n Money n Acc n Sex n )|n=1,2,3,…,N} (2)
[0021] Preferably, step S2 includes:
[0022] For each student, the frequency and total amount of consumption within a preset period are statistically analyzed, and expressed as a two-dimensional feature vector set of consumption frequency minus total amount:
[0023] {v i =(t i ,f i (3) | i = 1, 2, ..., I
[0024] Where I represents the total number of students, and each student i has a corresponding campus card number C. i Then all card numbers in the consumption data set n =C i Consumption records p n (n≤N) constitute a subset P of the student's consumption records. i Then its total consumption t i The value is P i The sum of the amount spent, the frequency of purchase f i Then it is P i Number of records in:
[0025]
[0026] f i =|P i | (5)
[0027] Obtain a subset L of valid spending location records for student i. i For each student i, their corresponding campus card number is C. i All card numbers in the collection of spending locations n =C i Consumption records n (n≤N) constitute a subset L of the student's spending location records. i Let the time interval threshold be T. interv ,like:
[0028]
[0029] Then see l n+m With l n For the same transaction, only one card swipe record will be retained. n And from L i Remove l from middle n+m , for l n Traverse all l n+m Until the condition described in equation (6) is no longer satisfied, then let l n =l n+m+1 Repeat the above conditional checks until Li After all data items have been checked, a subset L of valid consumption location records for student i has been obtained. i ;
[0030] Repeat the above steps until you have obtained a subset of the consumption location records for each student.
[0031] Obtain valid access control card swipe records for student i: For the preset period Dur, read in and l n The data includes access card swipe records of the same group of students within the same consumption period, using l n Access control identification code Acc n and the time of swiping the card n Filter the access control card swipe records to find records where the swipe time and the consumption time are close together, and then select the access control card swipe location Tbuilding from the records. n Add the consumption location data records to obtain a complete dataset of student campus life behavior. n :
[0032] a n ={(CardNo n Time n Location n Tbuilding n Money n Acc n Sex n )|n=1, 2, 3,..., N} (7)
[0033] The complete dataset of student campus life behavior a n This refers to the effective data set that can be used for analysis.
[0034] Preferably, step S3 includes:
[0035] S3.1: For the two-dimensional eigenvector v i It can be regarded as a set of (t) in a two-dimensional space i ,f i Let i be a set of points with horizontal and vertical coordinates, where i = 1, 2, ..., I. Each point corresponds to the consumption behavior of a student. Each point is treated as a separate initial class to initialize the clustering process.
[0036] S3.2: Randomly select a point v x As the initial centroid cen x ;
[0037] S3.3: Using the center of mass cen xA sliding window with bandwidth r is selected as the center. The set of all points within the window is denoted as W, and temporarily marked as belonging to class clu. x The elements, and the access frequency of these points within the class is increased by 1;
[0038] S3.4: Calculate the distance from all points within the sliding window to the initial centroid cen. x Radial base weighted average distance M r , as the mean shift vector:
[0039]
[0040] S3.5: With mean shift vector M r Update the centroid coordinates as follows:
[0041] cen x+1 =M r +cen x (9)
[0042] S3.6: Repeat steps 3.3 to 3.5 until offset M. r Less than threshold T conv Then the centroid at this time will be cen. X As a cluster center, all points visited during the repeated iterations in steps 3.3 to 3.5 belong to the class clu corresponding to this center. X This drift converged;
[0043] S3.7: If the current class clu X The distance between the cluster center and the center of an existing class is less than a threshold T. dis If the condition is met, the current class will be assigned to an existing class; otherwise, the current class will be retained as a new class.
[0044] S3.8: Repeat steps 3.1 to 3.7 until all points have been visited, and the mean-shift clustering process ends;
[0045] S3.9: Assign all points to their corresponding cluster centers according to their labels. If a point has been visited and labeled by multiple classes, then cluster it into the class with the higher visit frequency.
[0046] Preferably, step S4 includes:
[0047] Based on the frequency-total amount clustering results, the system provides students with feedback on their position in the frequency-total amount two-dimensional space, provides students with personal consumption behavior reports, analyzes these reports to identify anomalous categories and items, and feeds this feedback to the student management department as early warning information, reminding them to pay special attention to the corresponding student groups, and at the same time providing students with necessary consumption advice.
[0048] Preferably, the exception type and exception item include:
[0049] Potential students facing financial difficulties; potential students not attending school; potential high-spending groups;
[0050] Potential students with financial difficulties: For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that this type of student has a very low total consumption amount but a high consumption frequency within the preset period.
[0051]
[0052] Among them, t CEN Let f be the set of x-coordinates of the center point set CEN. I Let be the set of y-coordinates of all points, and mean(), std(), and num() be the mean, standard deviation, and counting function, respectively.
[0053] Potential absent students: For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that the total amount and frequency of consumption of this type of student within the preset period are both extremely low.
[0054]
[0055] Potential high-spending group: For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x The following conditions indicate that students of this type have extremely high total spending and spending frequency within a preset period.
[0056]
[0057] Preferably, step S5 includes:
[0058] Association rule mining is performed on the gender itemset and consumption location itemset in the subset of consumption location records to determine whether strong association rules exist. If they exist, it reflects a relatively clear association between student gender and canteen selection; if they do not exist, it indicates that there is no significant mutual influence between student gender and canteen selection. Specifically, this includes the following steps:
[0059] Step 5.1.1, record a subset l from the consumption location nTake the consumption location and gender from each item to form τ n ={Loction n Sex n |n=1,2,…,N}, representing transactions for association rule mining, containing M different locations and 2 different genders. m Sex q (m=1,2,…,M,q=1,2) represents the items in a transaction, and the transaction database is D. l ={τ1,τ2,…,τ N};
[0060] Step 5.1.2, let Ite = {Loction m Sex q |m=1,2,…,M,q=1,2} is D l If any term in it is an item, then any nonempty subset X of it is D. l To find the association rule between gender and consumption location, we first examine the 2-itemsset X, which consists of two items and represents the location and gender items in Ite. k (k = 1, 2, ..., M × 2) Calculate the support:
[0061]
[0062] in, D l Includes itemset X k The number of transactions, N is D l Total number of transactions;
[0063] Step 5.1.3, set the minimum support threshold as... For the 2-itemset X in step 5.1.2 k ,like Then X k Let X be the set of all frequent itemsets. F ;
[0064] Step 5.1.4, to determine whether there is a strong correlation between student gender and cafeteria choice, start from the frequent itemset set X. F Generate all association rules between gender and consumption location. For example, consider association rules where gender is the condition and location is the result:
[0065] Sex q →Location m ,m=1,2,…,M,q=1,2 (14)
[0066] Step 5.1.5, calculate the confidence score for each association rule:
[0067]
[0068] Step 5.1.6, set the minimum confidence threshold as... Given a set of frequent itemsets X F middle like Then Sex q →Location m This is a strong association rule;
[0069] The access control location itemset and consumption location itemset in the campus life behavior dataset are subjected to association rule mining to determine whether there are strong association rules. If they exist, it reflects a relatively clear association between the choice of teaching building and the choice of canteen; if they do not exist, it indicates that there is no obvious mutual influence between the choice of teaching building and the choice of canteen. The specific steps include the following:
[0070] Step 5.2.1, from the campus life behavior dataset a n Take the consumption location and gender from each item to form α n ={Loction n Tbuilding n |n=1,2,…,N}, representing transactions for association rule mining, includes M different cafeterias and S different teaching building locations. m Tbuilding s (m = 1, 2, ..., M, s = 1, 2, ..., S) represent items in a transaction, and the transaction database is D. a ={τ1,τ2,…,τ N};
[0071] Step 5.2.2, let Ite = {Location} m Tbuilding s |m=1,2,…,M,s=1,2,…,S} is D a If any term in it is a nonempty subset X of it, then it is D. a To find the association rule between the teaching building and the cafeteria in Ite, we first consider the 2-itemsset X consisting of the teaching building and cafeteria items in Ite, which contains 2 items. k (k = 1, 2, ..., S × M) Calculate the support:
[0072]
[0073] in, D a Includes itemset X k The number of transactions, N is Da Total number of transactions;
[0074] Step 5.2.3, set the minimum support threshold as... For the 2-itemset X in step 5.2.2 k , like Then X k Let X be the set of all frequent itemsets. F ;
[0075] Step 5.2.4: To determine whether there is a strong correlation between the choice of the teaching building and the cafeteria, start from the frequent itemset set X. F Generate all association rules between the teaching building and the cafeteria, taking the teaching building as the condition and the cafeteria as the result as an example:
[0076] Tbuilding s →Location m ,m=1,2,…,M,s=1,2,…,S (17)
[0077] Step 5.2.5, calculate the confidence score for each association rule:
[0078]
[0079] Step 5.2.6, set the minimum confidence threshold as... Given a set of frequent itemsets X F middle like Then Tbuilding s →Location m This is a strong association rule.
[0080] Preferably, step S6 includes:
[0081] Using the strong association rules, the potential impact of gender on canteen selection is known, and suggestions are made on the amount and types of food prepared for canteens. For canteens that have strong associations with women and men respectively, food categories that are more in line with the preferences of women or men are added respectively, and the amount of food prepared is adjusted according to the number of people and the amount of food consumed by different genders.
[0082] Using the strong association rules, we can understand the potential impact of students entering and exiting different teaching buildings on the choice of canteens. For canteens that are strongly associated with the teaching buildings, we can provide suggestions on meal service time and food preparation quantity to the canteen management, in conjunction with the class start and end times of the courses scheduled for the day and the student capacity of the courses in the corresponding teaching buildings, and provide suggestions on the choice of dining location and staggered dining location for students.
[0083] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0084] This invention can automatically analyze multiple dimensions of consumption behavior, life trajectory, and consumption location preferences using data generated by campus card swiping, providing valuable data analysis results for both students and schools. This invention uses a two-dimensional clustering method for consumption data, which can jointly analyze the total amount and frequency of consumption to obtain more comprehensive consumption behavior analysis results. It also eliminates the artificial limitation on the number of clusters during the clustering process, making the results more consistent with the objective situation and more inclusive. Attached Figure Description
[0085] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0086] Figure 1 A flowchart illustrating the method in an embodiment of the present invention. Detailed Implementation
[0087] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0088] The purpose of this invention is to provide an analysis method based on big data from campus card systems. By fully mining multi-dimensional information from campus card data, this invention can provide valuable data analysis results for both students and schools. On the one hand, it provides students with a profile reflecting their lifestyle and behavioral characteristics, helping them to manage and improve themselves. On the other hand, it provides school administrators with suggestions for the overall management of students' living and learning environments, such as canteens, dormitories, and teaching buildings, as well as early warnings of potential problems. It has a more multi-dimensional and extensive range of application scenarios.
[0089] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0090] like Figure 1 As shown, this invention provides an analysis method based on big data from a smart card system, comprising the following steps:
[0091] S1: Read in the personal information of a certain student group of campus card users within a preset period, campus card consumption records, and access control records within the same period to obtain the raw dataset reflecting campus life. The raw dataset is uniquely identified by the card number and corresponds one-to-one with the student. Both consumption and access control records contain card number information. Therefore, the above three sets of data records can be correlated with each other through card number information.
[0092] S2: Clean and statistically analyze the original dataset, and process the original dataset according to different life behavior characteristics to obtain a campus life behavior dataset and its effective data subset that can be used for analysis;
[0093] S3: Using the effective subset of data available for analysis, obtain two-dimensional data consisting of consumption frequency and total consumption amount, and perform cluster analysis on the two-dimensional data consisting of consumption frequency and total consumption amount using the mean shift method to obtain data after cluster analysis;
[0094] S4: Through the data obtained after the cluster analysis, student consumption behavior characteristics are obtained, providing references for management and self-management for schools and students respectively.
[0095] S5: Using the campus life behavior dataset and its effective data subset that can be used for analysis, the Apriori association rule analysis method is used to perform joint analysis on the campus life behavior dataset and its effective data subset that can be used for analysis, obtain joint analysis results, and analyze the life behavior trajectory preferences of different student groups;
[0096] S6: Based on the joint analysis results, obtain the behavioral characteristics of students' life trajectories, and provide meal preparation planning suggestions and dining recommendations for canteen management and students respectively.
[0097] Furthermore, step S1 includes: for a preset period Dur, reading in N transaction records of student campus cards within that period, with each transaction record p... n The set of features can be expressed as follows:
[0098] p n ={(CardNo n Time n ,Loction n Money n (1) | n = 1, 2, 3, ..., N
[0099] Among them, CardNo n Time n ,Loction n Money n These are the credit card transaction records (p).n The card number, transaction time, transaction location, and transaction amount; it should be noted that the actual card transaction record generally contains more information, and only the features relevant to this invention are listed here;
[0100] The student's personal information refers to the Card No. in each record. n Query and retrieve the access control identification code (Acc) corresponding to the student with this card number. n and gender information (Sex) n ;
[0101] The student's personal information and the transaction card records p n Together, they constitute a dataset of consumption locations containing N card swipe records and student personal information within a preset period Dur:
[0102] l n ={(CardNo n Time n ,Loction n Money n Acc n Sex n )|n=1,2,3,…,N} (2)
[0103] Furthermore, step S2 includes:
[0104] For each student, the frequency and total amount of consumption within a preset period are statistically analyzed, and expressed as a two-dimensional feature vector set of consumption frequency minus total amount:
[0105] {v i =(t i ,f i (3) | i = 1, 2, ..., I
[0106] Where I represents the total number of students, and each student i has a corresponding campus card number C. i Then all card numbers in the consumption data set n =C i Consumption records p n (n≤N) constitute a subset P of the student's consumption records. i Then its total consumption t i The value is P i The sum of the amount spent, the frequency of purchase f i Then it is P i Number of records in:
[0107]
[0108] f i =|P i| (5)
[0109] Obtain a subset L of valid spending location records for student i. i For each student i, their corresponding campus card number is C. i For card transaction data, transactions with the same card number and at the same transaction location that occur within a time interval of less than a preset threshold are considered as the same transaction. Only one record is retained to represent the transaction location, while other records are discarded. All card numbers in the transaction location set are included. n =C i Consumption records n (n≤N) constitute a subset L of the student's spending location records. i Let the time interval threshold be T. interv ,like:
[0110]
[0111] Then see l n+m With l n For the same transaction, only one card swipe record will be retained. n And from L i Remove l from middle n+m , for l n Traverse all l n+m Until the condition described in equation (6) is no longer satisfied, then let l n =l n+m+1 Repeat the above conditional checks until L i After all data items have been checked, a subset L of valid consumption location records for student i has been obtained. i ;
[0112] Repeat the above steps until you have obtained a subset of the consumption location records for each student.
[0113] Obtain valid access control card swipe records for student i: For the preset period Dur, read in and l n The data includes access card swipe records of the same group of students within the same consumption period, using l n Access control identification code Acc n and the time of swiping the card n Filter the access control card swipe records to find records where the swipe time and the consumption time are close together, and then select the access control card swipe location Tbuilding from the records. n Add the consumption location data records to obtain a complete dataset of student campus life behavior. n :
[0114] a n ={(CardNo n Timen Location n Tbuilding n Money n ,Accn,Sex n )|n=1, 2, 3,..., N} (7)
[0115] The complete dataset of student campus life behavior a n This refers to the effective data set that can be used for analysis.
[0116] Furthermore, step S3 includes:
[0117] S3.1: For the two-dimensional eigenvector v i It can be regarded as a set of (t) in a two-dimensional space i ,f i Let i be a set of points with horizontal and vertical coordinates, where i = 1, 2, ..., I. Each point corresponds to the consumption behavior of a student. Each point is treated as a separate initial class to initialize the clustering process.
[0118] S3.2: Randomly select a point v x As the initial centroid cen x ;
[0119] S3.3: Using the center of mass cen x A sliding window with bandwidth r is selected as the center. The set of all points within the window is denoted as W, and temporarily marked as belonging to class clu. x The elements, and the access frequency of these points within the class is increased by 1;
[0120] S3.4: Calculate the distance from all points within the sliding window to the initial centroid cen. x Radial base weighted average distance M r , as the mean shift vector:
[0121]
[0122] S3.5: With mean shift vector M r Update the centroid coordinates as follows:
[0123] cen x+1 =M r +cen x (9)
[0124] S3.6: Repeat steps 3.3 to 3.5 until offset M. r Less than threshold T conv Then the centroid at this time will be cen. XAs a cluster center, all points visited during the repeated iterations in steps 3.3 to 3.5 belong to the class clu corresponding to this center. X This drift converged;
[0125] S3.7: If the current class clu X The distance between the cluster center and the center of an existing class is less than a threshold T. dis If the condition is met, the current class will be assigned to an existing class; otherwise, the current class will be retained as a new class.
[0126] S3.8: Repeat steps 3.1 to 3.7 until all points have been visited, and the mean-shift clustering process ends;
[0127] S3.9: Assign all points to their corresponding cluster centers according to their labels. If a point has been visited and labeled by multiple classes, then cluster it into the class with the higher visit frequency.
[0128] Preferably, step S4 includes:
[0129] Based on the frequency-total amount clustering results, the system provides students with feedback on their position in the frequency-total amount two-dimensional space, provides students with personal consumption behavior reports, analyzes these reports to identify anomalous categories and items, and feeds this feedback to the student management department as early warning information, reminding them to pay special attention to the corresponding student groups, and at the same time providing students with necessary consumption advice.
[0130] Furthermore, exception classes and exception items include:
[0131] Potential students facing financial difficulties; potential students not attending school; potential high-spending groups;
[0132] Potential students with financial difficulties: For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that this type of student has a very low total consumption amount but a high consumption frequency within the preset period.
[0133]
[0134] Among them, t CEN Let f be the set of x-coordinates of the center point set CEN. I Let be the set of y-coordinates of all points, and mean(), std(), and num() be the mean, standard deviation, and counting function, respectively.
[0135] Potential absent students: For the cluster centroid set CEN, if cen x (t x ,fx ) and its corresponding class clus x If the following conditions are met, it indicates that the total amount and frequency of consumption of this type of student within the preset period are both extremely low.
[0136]
[0137] Potential high-spending group: For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x The following conditions indicate that students of this type have extremely high total spending and spending frequency within a preset period.
[0138]
[0139] Furthermore, step S5 includes:
[0140] Association rule mining is performed on the gender itemset and consumption location itemset in the subset of consumption location records to determine whether strong association rules exist. If they exist, it reflects a relatively clear association between student gender and canteen selection; if they do not exist, it indicates that there is no significant mutual influence between student gender and canteen selection. Specifically, this includes the following steps:
[0141] Step 5.1.1, record a subset l from the consumption location n Take the consumption location and gender from each item to form τ n ={Loction n Sex n |n=1,2,…,N}, representing transactions for association rule mining, containing M different locations and 2 different genders. m Sex q (m=1,2,…,M,q=1,2) represents the items in a transaction, and the transaction database is D. l ={τ1,τ2,…,τ N};
[0142] Step 5.1.2, let Ite = {Loction m Sex q |m=1,2,…,M,q=1,2} is D l If any term in it is an item, then any nonempty subset X of it is D. l To find the association rule between gender and consumption location, we first examine the 2-itemsset X, which consists of two items and represents the location and gender items in Ite. k (k = 1, 2, ..., M × 2) Calculate the support:
[0143]
[0144] in, D l Includes itemset X k The number of transactions, N is D l Total number of transactions;
[0145] Step 5.1.3, set the minimum support threshold as... For the 2-itemset X in step 5.1.2 k ,like Then X k Let X be the set of all frequent itemsets. F ;
[0146] Step 5.1.4, to determine whether there is a strong correlation between student gender and cafeteria choice, start from the frequent itemset set X. F Generate all association rules between gender and consumption location. For example, consider association rules where gender is the condition and location is the result:
[0147] Sex q →Location m ,m=1,2,…,M,q=1,2 (14)
[0148] Step 5.1.5, calculate the confidence score for each association rule:
[0149]
[0150] Step 5.1.6, set the minimum confidence threshold as... Given a set of frequent itemsets X F middle like Then Sex q →Location m This is a strong association rule;
[0151] The access control location itemset and consumption location itemset in the campus life behavior dataset are subjected to association rule mining to determine whether there are strong association rules. If they exist, it reflects a relatively clear association between the choice of teaching building and the choice of canteen; if they do not exist, it indicates that there is no obvious mutual influence between the choice of teaching building and the choice of canteen. The specific steps include the following:
[0152] Step 5.2.1, from the campus life behavior dataset a n Take the consumption location and gender from each item to form α n ={Loction n Tbuildingn |n=1,2,…,N}, representing transactions for association rule mining, includes M different cafeterias and S different teaching building locations. m Tbuilding s (m = 1, 2, ..., M, s = 1, 2, ..., S) represent items in a transaction, and the transaction database is D. a ={τ1,τ2,…,τ N};
[0153] Step 5.2.2, let Ite = {Location} m Tbuilding s |m=1,2,…,M,s=1,2,…,S} is D a If any term in it is a nonempty subset X of it, then it is D. a To find the association rule between the teaching building and the cafeteria in Ite, we first consider the 2-itemsset X consisting of the teaching building and cafeteria items in Ite, which contains 2 items. k (k = 1, 2, ..., S × M) Calculate the support:
[0154]
[0155] in, D a Includes itemset X k The number of transactions, N is D a Total number of transactions;
[0156] Step 5.2.3, set the minimum support threshold as... For the 2-itemset X in step 5.2.2 k , like Then X k Let X be the set of all frequent itemsets. F ;
[0157] Step 5.2.4: To determine whether there is a strong correlation between the choice of the teaching building and the cafeteria, start from the frequent itemset set X. F Generate all association rules between the teaching building and the cafeteria, taking the teaching building as the condition and the cafeteria as the result as an example:
[0158] Tbuilding s →Location m ,m=1,2,…,M,s=1,2,…,S (17)
[0159] Step 5.2.5, calculate the confidence score for each association rule:
[0160]
[0161] Step 5.2.6, set the minimum confidence threshold as... Given a set of frequent itemsets X F middle like Then Tbuilding s →Location m This is a strong association rule.
[0162] Furthermore, step S6 includes:
[0163] Using the strong association rules, the potential impact of gender on canteen selection is known, and suggestions are made on the amount and types of food prepared for canteens. For canteens that have strong associations with women and men respectively, food categories that are more in line with the preferences of women or men are added respectively, and the amount of food prepared is adjusted according to the number of people and the amount of food consumed by different genders.
[0164] Using the strong association rules, we can understand the potential impact of students entering and exiting different teaching buildings on the choice of canteens. For canteens that are strongly associated with the teaching buildings, we can provide suggestions on meal service time and food preparation quantity to the canteen management, in conjunction with the class start and end times of the courses scheduled for the day and the student capacity of the courses in the corresponding teaching buildings, and provide suggestions on the choice of dining location and staggered dining location for students.
[0165] The present invention also provides specific embodiments:
[0166] The implementation example focuses on campus card transaction data to analyze students' spending behavior characteristics, transaction location associations and preferences, and abnormal spending behaviors.
[0167] Step 1: Read in the personal information of a specific student group within a preset period, campus card transaction records, and access control card transaction records within the same period. These together form the raw dataset reflecting campus life behavior. (Note that the campus card data uses the card number as a unique identifier, corresponding one-to-one with each student. Transaction and access control card transaction records both contain card number information. Therefore, the above three sets of data records can be correlated through card number information.) This includes the following sub-steps:
[0168] Step 1.1: In this embodiment, the preset period Dur is March 1st to 30th. The system reads in N = 241014 transaction records from the campus cards of 3267 students within this period. Each transaction record is p. n The set of features can be expressed as follows:
[0169] p n ={(CardNo n Time n ,Loction nMoney n (1) | n = 1, 2, 3, ..., N
[0170] Among them, CardNo n Time n ,Loction n Money n These are the credit card transaction records (p). n The card number, transaction time, transaction location, and transaction amount are listed. It should be noted that actual card transaction records generally contain more information; only the features relevant to this invention are listed here.
[0171] Step 1.2: The campus card uses the card number as a unique identifier, corresponding one-to-one with each student. The acquisition of student personal information here refers to using the card number (CardNo.) in each record. n Query and retrieve the access control identification code (Acc) corresponding to the student with this card number. n and gender information (Sex) n Student personal information data and the card swipe records described in step 1.1 n Together, they constitute a dataset of consumption locations containing N=241014 card swipe records and student personal information within a preset period Dur:
[0172] l n ={(CardNo n Time n ,Loction n Money n Acc n Sex n )|n=1,2,3,…,N} (2)
[0173] Step 2, Dataset Cleaning and Statistics. Based on different behavioral characteristics, the raw dataset obtained in Step 1 is processed to obtain a campus life behavior dataset suitable for analysis. This includes the following sub-steps:
[0174] Step 2.1 For each card number (i.e., each student), calculate the frequency and total amount of spending within a preset period, expressed as a two-dimensional feature vector set of frequency-to-total spending:
[0175] {v i =(t i ,f i (3) | i = 1, 2, ..., I
[0176] Where I = 3267 represents the total number of students. It should be noted that the campus card uses a unique card number as its identifier, corresponding one-to-one with each student. For each student i, the corresponding campus card number is C.i Then all card numbers in the consumption data set n =C i Consumption records p n (n≤N) constitute a subset P of the student's consumption records. i Then its total consumption t i The value is P i The sum of the amount spent, the frequency of purchase f i Then it is P i Number of records in:
[0177]
[0178] f i =|P i | (5)
[0179] Step 2.2: For the card swipe data, swipe records with the same card number and the same transaction location where the time interval is less than a preset threshold are considered as the same transaction. Only one record is retained to represent the transaction location, while the other records are discarded, forming a subset of transaction location records. Specifically, for each student i, their corresponding campus card number is C. i Then all card numbers in the set of consumption locations n =C i Consumption records n (n≤N) constitute a subset L of the student's spending location records. i Time interval threshold T interv The value can be determined by those skilled in the art; in this embodiment, the time interval threshold T is used. interv = 60min, if:
[0180]
[0181] Then see l n+m With l n For the same transaction, only one card swipe record will be retained. n And from L i Remove l from middle n+m For l n Traverse all l n+m Until the condition described in equation (6) is no longer satisfied, then let l n =l n+m+1 Repeat the above conditional checks until L i After all data items have been checked, a subset L of valid consumption location records for student i has been obtained. i .
[0182] Step 2.3, repeat step 2.2 until a subset of consumption location records corresponding to all card numbers is obtained. In this embodiment, 133,082 valid consumption location data for 3,267 students are finally obtained.
[0183] Step 2.4, for the preset period Dur, read in l n The data includes access control card swipe records of the same group of students within the same consumption period (March 1st to 30th), using l n Access control identification code Acc n and the time of swiping the card n Filter the access control card swipe records to find records where the swipe time and the consumption time are close together, and then select the access control card swipe location Tbuilding from the records. n Add the consumption location data records to obtain a complete dataset of student campus life behavior. n :
[0184] a n ={(CardNo n Time n ,Loction n Tbuilding n Money n Acc n Sex n )|n=1,2,3,…,N}(7)
[0185] Step 3: Perform cluster analysis using the mean-shift method on the two-dimensional data consisting of purchase frequency and total purchase amount. This includes the following sub-steps:
[0186] Step 3.1, for the two-dimensional feature vector v i It can be regarded as a set of (t) in a two-dimensional space i ,f i Let be a set of points with horizontal and vertical coordinates, where i = 1, 2, ..., I, and each point corresponds to the consumption behavior of a student. Each point is treated as a separate initial class to initialize the clustering process.
[0187] Step 3.2, randomly select a point v x As the initial centroid cen x ;
[0188] Step 3.3, with the centroid cen x A sliding window with bandwidth r is selected as the center. The set of all points within the window is denoted as W, and temporarily marked as belonging to class clu. x The elements are then accessed, and the frequency of access to these points within the class is increased by 1.
[0189] Step 3.4: Calculate the distance from all points within the sliding window to the initial centroid cen. x Radial base weighted average distance M r As the mean shift vector:
[0190]
[0191] Where g() represents the radial basis kernel function.
[0192] Step 3.5, using the mean shift vector M r Update the centroid coordinates as follows:
[0193] cen x+1 =M r +cen x (9)
[0194] Step 3.6, repeat steps 1.3.3 to 1.3.5 until offset M. r Less than threshold T conv Then the centroid at this time will be cen. X As a cluster center, all points visited during the repeated iterations in steps 1.3.3 to 1.3.5 belong to the class clu corresponding to this center. X This drift converged.
[0195] Step 3.7, if the current class clu X The distance between the cluster center and the center of an existing class is less than a threshold T. dis If the condition is met, the current class will be assigned to an existing class; otherwise, the current class will be retained as a new class.
[0196] Step 3.8: Repeat steps 1.3.1 to 1.3.7 until all points have been visited, at which point the mean-shift clustering process ends.
[0197] Step 3.9: Assign all points to their corresponding cluster centers according to their labels. If a point has been visited and labeled by multiple classes, then cluster it into the class with the higher visit frequency. In this embodiment, the final number of clusters is 6.
[0198] Step 4: Based on the cluster analysis results, obtain the characteristics of students' consumption behavior to provide references for management and self-management for both the school and students. This includes the following sub-steps:
[0199] Step 4.1: Based on the frequency-total amount clustering results, provide students with feedback on their position in the frequency-total amount two-dimensional space, and provide them with a personal consumption behavior report to help them understand and improve their consumption behavior and habits, and cultivate financial awareness. For example, if a student is in a class with relatively low consumption frequency but relatively high total consumption, it indicates that the student's average single consumption amount is high, reflecting that they have high requirements for consumption or quality of life.
[0200] Step 4.2 involves analyzing the frequency-total-amount clustering results to identify outliers and anomalies. This information is then fed back to the student management department as an early warning, prompting them to pay special attention to the relevant student groups and providing necessary consumption advice. Specifically, the following data categories are marked as potential outliers:
[0201] (1) For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that this type of student has a very low total consumption amount but a high consumption frequency within the preset period, and is therefore considered a student with potential financial difficulties:
[0202]
[0203] Among them, t CEN Let f be the set of x-coordinates of the center point set CEN. I Let be the set of y-coordinates of all points, and let mean(), std(), and num() be the mean, standard deviation, and counting function, respectively.
[0204] (2) For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that this type of student has extremely low total spending and spending frequency within the preset period, and is considered a potential off-campus student:
[0205]
[0206] (3) For the cluster centroid set CEN, if cen x (t x ,f x ) and its corresponding class clus x If the following conditions are met, it indicates that this type of student has extremely high total spending and spending frequency within the preset period, and belongs to a potential high-spending group:
[0207]
[0208] In this embodiment, there are no classes that meet the above conditions (1) and (2). There is one class that meets condition (3). The class includes students who are potential high-spending groups. Rational consumption suggestions can be made to them in the campus card-linked application, and they can be continuously monitored as a special group of student management departments.
[0209] Step 5: For the campus life behavior dataset and its subsets, perform joint analysis using the Apriori association rule analysis method. Focusing on the cafeteria, explore the association between student attributes and access to / from teaching buildings and cafeteria choices, and analyze the life behavior trajectory preferences of different student groups. This includes the following sub-steps:
[0210] Step 5.1 involves performing association rule mining on the gender and consumption location itemsets within the subset of consumption location records obtained in Step 2.3 to determine if strong association rules exist. If they exist, it indicates a clear association between student gender and cafeteria choice; if they do not, it indicates no significant mutual influence between student gender and cafeteria choice. The specific implementation process is as follows:
[0211] Step 5.1.1, record a subset l from the consumption location n Take the consumption location and gender from each item to form τ n ={Loction n Sex n |n=1,2,…,N}, representing the transactions for association rule mining, in this embodiment includes 6 different locations and 2 different genders. m Sex q (m = 1, 2, ..., 6, q = 1, 2) are items in a transaction, and the transaction database is D. l ={τ1,τ2,…,τ N}
[0212] Step 5.1.2, let Ite = {Loction m Sex q |m=1,2,…,6,q=1,2} is D l If any term in it is an item, then any nonempty subset X of it is D. l To find the association rule between gender and consumption location, we first examine the 2-itemsset X, which consists of two items and represents the location and gender items in Ite. k (k = 1, 2, ..., 12) Find the support:
[0213]
[0214] in, Dl Includes itemset X k The number of transactions, N is D l Total number of transactions.
[0215] Step 5.1.3, set the minimum support threshold as... In practice, the threshold value should be selected by those skilled in the art; in this embodiment, it is set as follows: For the 2-itemset X in step 5.1.2 k , like Then X k Let X be the set of all frequent itemsets. F .
[0216] Step 5.1.4, to determine whether there is a strong correlation between student gender and cafeteria choice, start from the frequent itemset set X. F Generate all association rules between gender and consumption location. For example, consider association rules where gender is the condition and location is the result:
[0217] Sex q →Location m ,m=1,2,…,6,q=1,2 (14)
[0218] Step 5.1.5, calculate the confidence score for each association rule:
[0219]
[0220] Step 5.1.6, set the minimum confidence threshold as... In practice, the threshold value should be selected by those skilled in the art; in this embodiment, it is set as follows: Given a set of frequent itemsets X F middle like Then Sex q →Location m This is a strong association rule. Regarding the association rule Location... m →Sex q The calculation process for support and confidence is the same, and will not be repeated here. Analysis shows that the strong association rule in this embodiment is "Bamboo Garden Canteen → Female", with support and confidence of 0.1502 and 0.7366, respectively.
[0221] Step 5.2 involves performing association rule mining on the access control locations (i.e., teaching buildings) and consumption locations (i.e., canteens) itemsets in the campus life behavior dataset obtained in Step 2.4 to determine whether strong association rules exist. If they exist, it indicates a clear association between the choice of teaching buildings and the choice of canteens; if they do not exist, it indicates no significant mutual influence between the choices of teaching buildings and canteens. The specific implementation process is as follows:
[0222] Step 5.2.1, from the campus life behavior dataset a n Take the consumption location and gender from each item to form α n ={Loction n Tbuilding n |n=1,2,…,N}, representing transactions for association rule mining, includes 6 different cafeterias and 8 different teaching building locations. m Tbuilding s (m = 1, 2, ..., 6, s = 1, 2, ..., 8) are items in a transaction, and the transaction database is D. a ={τ1,τ2,…,τ N}
[0223] Step 5.2.2, let Ite = {Location} m Tbuilding s |m=1,2,…,6,s=1,2,…,8} is D a If any term in it is a nonempty subset X of it, then it is D. a To find the association rule between the teaching building and the cafeteria in Ite, we first consider the 2-itemsset X consisting of the teaching building and cafeteria items in Ite, which contains 2 items. k (k = 1, 2, ..., 48) Find the support:
[0224]
[0225] in, D a Includes itemset X k The number of transactions, N is D a Total number of transactions.
[0226] Step 5.2.3, set the minimum support threshold as... In practice, the threshold value should be selected by those skilled in the art; in this embodiment, it is set as follows: For the 2-itemset X in step 5.2.2 k , like Then X k Let X be the set of all frequent itemsets.F .
[0227] Step 5.2.4: To determine whether there is a strong correlation between the choice of the teaching building and the cafeteria, start from the frequent itemset set X. F Generate all association rules between the teaching building and the cafeteria, taking the teaching building as the condition and the cafeteria as the result as an example:
[0228] Tbuilding s →Location m ,m=1,2,…,6,s=1,2,…,8 (17)
[0229] Step 5.2.5, calculate the confidence score for each association rule:
[0230]
[0231] Step 5.2.6, set the minimum confidence threshold as... In practice, the threshold value should be selected by those skilled in the art; in this embodiment, it is set as follows: Given a set of frequent itemsets X F middle like Then Tbuilding s →Location m This is a strong association rule. Regarding the association rule Location... m →Tbuilding s The calculation process for support and confidence is the same, and will not be repeated here. Analysis shows that the strong association rules in this embodiment are "Lanyuan Canteen → Teaching Building 8", with support and confidence of 0.1520 and 0.5080, respectively; and "Zhuyuan Canteen → Teaching Building 2", with support and confidence of 0.1566 and 0.6731, respectively.
[0232] Step 6: Based on the association rule analysis results, obtain the behavioral characteristics of students' daily life trajectories, and provide meal preparation planning suggestions and dining recommendations for both the canteen management and students. This includes the following sub-steps:
[0233] Step 6.1: Using the strong association rule obtained in Step 5.1, it can be seen that there is a high probability that females will go to Zhuyuan Canteen for meals. Therefore, the types of meals that are more in line with females' preferences can be increased accordingly. Considering that females' need for food quantity is relatively lower than that of males, the amount of food prepared can be reduced appropriately to avoid waste.
[0234] Step 6.2, using the strong association rule obtained in Step 5.2, shows that students going to Lanyuan Cafeteria are more likely to come from Building 8, while students going to Zhuyuan Cafeteria are more likely to come from Building 2. Therefore, the cafeteria management can adjust meal service times and food preparation quantities in conjunction with the class schedules (such as get out of class start and end times and student capacity) of each classroom in Buildings 8 and 2. For students, the cafeteria's visitor flow can be estimated based on the student capacity of the teaching buildings that day, thus helping them to appropriately choose off-peak dining methods.
[0235] The beneficial effects of this invention are as follows:
[0236] This invention can automatically analyze multiple dimensions of consumption behavior, life trajectory, and consumption location preferences by utilizing data generated from campus card swiping. It can provide valuable data analysis results for both students and schools. This invention uses a two-dimensional clustering method for consumption data, which can jointly analyze the total amount and frequency of consumption to obtain more comprehensive consumption behavior analysis results. It also eliminates the artificial limitation on the number of clusters during the clustering process, making the results more consistent with the objective situation and more inclusive.
[0237] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0238] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. An analysis method based on big data from a smart card system, characterized in that, Includes the following steps: S1: Read in the personal information of a certain student group of campus card within a preset period, campus card consumption records, and access control records within the same period to obtain the original dataset reflecting campus life. The original dataset is uniquely identified by the card number and corresponds one-to-one with the student. S2: Clean and statistically analyze the original dataset, and process the original dataset according to different life behavior characteristics to obtain a campus life behavior dataset and its effective data subset that can be used for analysis; S3: Using the effective subset of data available for analysis, obtain two-dimensional data consisting of consumption frequency and total consumption amount, and perform cluster analysis on the two-dimensional data consisting of consumption frequency and total consumption amount using the mean shift method to obtain data after cluster analysis; S4: Through the data obtained after the cluster analysis, student consumption behavior characteristics are obtained, providing references for management and self-management for schools and students respectively; S5: Using the campus life behavior dataset and its effective data subset that can be used for analysis, the Apriori association rule analysis method is used to perform joint analysis on the campus life behavior dataset and its effective data subset that can be used for analysis, to obtain joint analysis results and analyze the life behavior trajectory preferences of different student groups; S6: Based on the joint analysis results, obtain the behavioral characteristics of students' life trajectories, and provide meal preparation planning suggestions and dining recommendations for canteen management and students respectively; Step S3 includes: S3.1: For two-dimensional eigenvectors It is regarded as a set of two-dimensional spaces. Let be the set of points with x and y coordinates, where Each point corresponds to a student's consumption behavior. Each point is treated as a separate initial class to initialize the clustering process. S3.2: Randomly select a point as the initial centroid ; S3.3: Center of mass Select a bandwidth of [value] for the center. A sliding window, the set of all points within the window's range is denoted as . Temporarily marked as belonging to class The elements, and the access frequency of these points within the class is increased by 1; S3.4: Calculate the distance from all points within the sliding window to the initial centroid. Radial base weighted average distance As the mean shift vector: (8) S3.5: Mean shift vector Update the centroid coordinates as follows: (9) S3.6: Repeat steps 3.3 to 3.5 until the offset is reached. Less than the threshold Then the center of mass at this time As a cluster center, all points visited during the repeated iterations in steps 3.3 to 3.5 belong to the class corresponding to this center. This drift converged; S3.7: If the current class The distance between the cluster center and the center of an existing class is less than a threshold. If the condition is met, the current class will be assigned to an existing class; otherwise, the current class will be retained as a new class. S3.8: Repeat steps 3.1 to 3.7 until all points have been visited, and the mean-shift clustering process ends; S3.9: Assign all points to their corresponding cluster centers according to their labels. If a point has been visited and labeled by multiple classes, then cluster it into the class with the higher visit frequency to obtain the frequency-total clustering result.
2. The method for analyzing big data of a smart card system according to claim 1, characterized in that, Step S1 includes: preset period It also reads the student campus card transaction records for that period. Each item, each transaction record. The set of features is expressed as follows: (1) in, These are the credit card transaction records. Card number, transaction time, transaction location, and transaction amount; Student personal information refers to the card number in each record. Query and retrieve the access control identification code corresponding to the student with this card number. and gender information ; The student's personal information and the transaction card records Together they constitute the preset cycle Contains Data set of card swipe records and student personal information: (2)。 3. The method for analyzing big data of a smart card system according to claim 2, characterized in that, Step S2 includes: For each student, the frequency and total amount of consumption within a preset period are statistically analyzed, and expressed as a two-dimensional feature vector set of consumption frequency minus total amount: (3) in, For the total number of students, each student Its corresponding campus card number is Then all card numbers in the consumption data set Consumption records This constitutes a subset of the student's spending records. Then its total consumption The value is The sum of the amount spent and the frequency of purchases. Then it is Number of records in: (4) (5) Get students Valid subset of consumption location records For each student Its corresponding campus card number is All card numbers in the collection of consumption locations Consumption records This constitutes a subset of the student's spending location records. Let the time interval threshold be... ,like: (6) Then see and For the same transaction, only the card swipe records generated during that transaction will be retained. And from Remove from ,right Traverse all Until the condition described in equation (6) is no longer satisfied, then let = Repeat the above conditional checks until... All data items have been checked, and the student's information has been obtained. Valid subset of consumption location records ; Repeat the above steps until you have obtained a subset of the consumption location records for each student. Get students Valid access control card swipe records: for preset periods , read in and The data includes access card swipe records of the same group of students within the same consumption period. Access control identification code and card swipe time Filter the access control card swipe records to find records where the swipe time and the consumption time are close together, and then select the access control card swipe locations from the records. By adding the consumption location data records, a complete dataset of student campus life behavior can be obtained. : : The complete dataset of student campus life behaviors This refers to the effective data set that can be used for analysis.
4. The method for analyzing big data of a smart card system according to claim 3, characterized in that, Step S4 includes: Based on the frequency-total amount clustering results, the system provides students with feedback on their position in the frequency-total amount two-dimensional space, provides students with personal consumption behavior reports, analyzes these reports to identify anomalous categories and items, and feeds this feedback to the student management department as early warning information, reminding them to pay special attention to the corresponding student groups, and at the same time providing students with necessary consumption advice.
5. The method for analyzing big data of a smart card system according to claim 4, characterized in that, Exception types and exception items include: Potential students facing financial difficulties; potential students not attending school; potential high-spending groups; Potentially economically disadvantaged students: set of cluster centroids If there is and its corresponding class If the following conditions are met, it indicates that this type of student has a very low total consumption amount but a high consumption frequency within the preset period. ; in, For the center point set The set of x-coordinates, The set of y-coordinates of all points. ; Potential absent students: set of cluster centroids If there is and its corresponding class If the following conditions are met, it indicates that the total amount and frequency of consumption of this type of student within the preset period are both extremely low. ; Potential high-spending groups: the set of cluster centroids If there is and its corresponding class The following conditions indicate that students of this type have extremely high total spending and spending frequency within a preset period. 。 6. The method for analyzing big data of a smart card system according to claim 5, characterized in that, Step S5 includes: Association rule mining is performed on the gender itemset and consumption location itemset in the subset of consumption location records to determine whether strong association rules exist. If they exist, it reflects a relatively clear association between student gender and canteen selection; if they do not exist, it indicates that there is no significant mutual influence between student gender and canteen selection. Specifically, this includes the following steps: Step 5.1.1: Record a subset from the consumption locations. Each item is composed of two elements: the place of consumption and gender. As a transaction in association rule mining, it contains Two different locations and two different genders For items in a transaction, the transaction database ; Step 5.1.2, set for The items in the middle, then any non-empty subset for In the itemset, to find the association rule between gender and consumption location, we first... A 2-itemset consisting of two items, namely location and gender. Seeking support: (13) in, for Includes itemsets The number of transactions, for Total number of transactions; Step 5.1.3, set the minimum support threshold as... For the 2-itemset in step 5.1.2 ,like ,but For frequent itemsets, the set of all frequent itemsets is denoted as . ; Step 5.1.4, to determine whether there is a strong correlation between student gender and cafeteria choice, starts from the frequent itemset set. Generate all association rules between gender and consumption location. Among them, the association rules with gender as the condition and location as the result are: (14) Step 5.1.5, calculate the confidence score for each association rule: (15) Step 5.1.6, set the minimum confidence threshold as... Given a set of frequent itemsets middle ,like ,but This is a strong association rule; Association rule mining is performed on the access control location itemset and consumption location itemset in the campus life behavior dataset to determine whether strong association rules exist. If they exist, it reflects a clear association between the choice of teaching building and the choice of canteen; if they do not exist, it indicates that there is no obvious mutual influence between the choice of teaching building and the choice of canteen. The specific steps include the following: Step 5.2.1, from the campus life behavior dataset Each item is composed of two elements: the place of consumption and gender. As a transaction in association rule mining, it contains A different canteen and Different teaching buildings For items in a transaction, the transaction database ; Step 5.2.2, let for The items in the middle, then any non-empty subset for In order to find the association rule between the teaching building and the cafeteria, we first need to consider the itemsets in the set. The term "teaching building and canteen" constitutes a 2-itemset containing 2 terms. Seeking support: (16) in, for Includes itemsets The number of transactions, N is Total number of transactions; Step 5.2.3, set the minimum support threshold as... For the 2-itemsets in step 5.2.2 ,like ,but For frequent itemsets, the set of all frequent itemsets is denoted as . ; Step 5.2.4: To determine whether there is a strong correlation between the choices of the teaching building and the cafeteria, we start from the frequent itemset set. Generate all association rules between the teaching building and the cafeteria. The association rule where the teaching building is the condition and the cafeteria is the result is: (17) Step 5.2.5, calculate the confidence score for each association rule: (18) Step 5.2.6, set the minimum confidence threshold as... Given a set of frequent itemsets middle ,like ,but This is a strong association rule.
7. The method for analyzing big data of a smart card system according to claim 6, characterized in that, Step S6 includes: Using the strong association rules, the potential impact of gender on canteen selection is known, and suggestions are made on the amount and types of food prepared for canteens. For canteens that have strong associations with women and men respectively, food categories that are more in line with the preferences of women or men are added respectively, and the amount of food prepared is adjusted according to the number of people and the amount of food consumed by different genders. Using the strong association rules, we can understand the potential impact of students entering and exiting different teaching buildings on the choice of canteens. For canteens that are strongly associated with the teaching buildings, we can provide suggestions on meal service time and food preparation quantity to the canteen management, in conjunction with the class start and end times of the courses scheduled for the day and the student capacity of the courses in the corresponding teaching buildings, and provide suggestions on the choice of dining location and staggered dining location for students.