Campus one-card consumption scene behavior analysis method based on YOLO target detection algorithm

CN122888541APending Publication Date: 2026-10-09NANJING TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611373448.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

然而,这种基于纯交易记录的分析方式存在明显不足:交易数据仅记录了刷卡完成的最终结果,无法反映学生在消费场景中的行为过程信息,例如学生是否实际进入消费区域、在不同窗口或设备前的停留时长、高峰时段的排队密度以及携带一卡通参与各类校园活动的真实状态,导致分析结论较为宏观且缺乏对个体行为细节的刻画能力

Benefits of technology

[0015]本发明属于计算机视觉分析技术领域,涉及基于YOLO目标检测算法的校园一卡通消费场景行为分析方法。获取学生刷卡行为视频流,利用YOLO目标检测模型识别学生个体,生成结构化消费行为记录,统计各消费场景下的消费频次与金额,预测学生的消费倾向场景与时间段,引入各场景的价值权重及影响因子,构建消费行为质量关联矩阵,输出各场景在各时间段下的参考质量评分,构建采集关联矩阵并计算采集参考评分,动态调整不同场景下采集设备的帧率和分辨率,实现差异化采集策略。本发明可有效提升校园一卡通消费行为分析的针对性和资源利用效率,能够根据场景价值自适应调整采集参数,显著提高分析处理精度与系统运行效能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888541A_ABST
    Figure CN122888541A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of computer vision analysis, and relates to a campus one-card consumption scene behavior analysis method based on a YOLO target detection algorithm. A student card swiping behavior video stream is acquired, a YOLO target detection model is used to identify student individuals, structured consumption behavior records are generated, consumption frequencies and amounts in each consumption scene are counted, consumption tendency scenes and time periods of students are predicted, value weights and influence factors of each scene are introduced, a consumption behavior quality correlation matrix is constructed, reference quality scores of each scene in each time period are output, a collection correlation matrix is constructed and a collection reference score is calculated, frame rates and resolutions of collection devices in different scenes are dynamically adjusted, and a differentiated collection strategy is realized. The application can effectively improve the pertinence and resource utilization efficiency of campus one-card consumption behavior analysis, can adaptively adjust collection parameters according to scene values, and can significantly improve analysis and processing precision and system operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision analysis technology, and relates to a method for analyzing campus card consumption scenarios based on the YOLO object detection algorithm. Background Technology

[0002] Currently, universities have generally implemented campus card systems, which provide identity authentication and payment functions in various scenarios such as dining in cafeterias, shopping in supermarkets, accessing bathhouses, entering and exiting libraries, and visiting campus hospitals, generating a massive amount of card transaction records daily. Existing technologies for analyzing campus card spending behavior primarily rely on transaction log data in the backend database. This involves statistically querying and generating reports from structured fields such as transaction time, location, and amount to understand students' overall spending patterns. However, this analysis method based solely on transaction records has significant shortcomings: the transaction data only records the final result of the card swipe, failing to reflect the student's behavioral process within the consumption scenario. For example, it doesn't reflect whether the student actually entered the designated area, the duration of their stay at different windows or devices, queue density during peak hours, or their actual participation in various campus activities with their card. This results in overly macro-level analysis conclusions lacking the ability to depict the details of individual behavior.

[0003] In recent years, with the large-scale deployment of surveillance cameras on campuses and the rapid development of deep learning object detection technology, some research has attempted to introduce computer vision methods into the field of campus behavior analysis. For example, general object detection algorithms are used to detect and count people at campus entrances and exits, or to estimate the population density in specific locations. However, when dealing with campus card payment scenarios, existing visual analysis methods typically use general object detection models directly, without specifically optimizing for characteristics such as card holding, body posture, and changes in ambient lighting during card swiping. This results in significant fluctuations in detection accuracy across different scenarios. Furthermore, existing solutions often process video data in isolation, ignoring the inherent correlation between consumption behavior and the physical spatial location and time period attributes of the consumption scenario. They lack the ability to dynamically predict individual consumption tendencies and struggle to effectively infer future consumption locations and time intervals based on students' historical behavior patterns, thus significantly limiting the application value of the analysis results.

[0004] Furthermore, existing campus consumption behavior analysis systems lack a differentiated evaluation mechanism for the value weight of different consumption scenarios, and also lack the technical means to dynamically adjust the collection strategy based on the importance of the scenario and the feedback from video collection quality. Specifically, different consumption scenarios have varying reference value for analyzing students' living habits and learning engagement, while existing methods typically use a uniform analysis process and collection parameters for all scenarios. This leads to high-value scenarios potentially losing key details due to insufficient collection resolution or frame rate, while low-value scenarios consume significant storage and computing resources. Simultaneously, once video collection equipment is deployed, its collection parameters are often fixed for a long period, making it impossible to optimize subsequent collection behavior based on real-time analysis results, thus forming a one-way open-loop analysis mode. Therefore, there is an urgent need for a campus card consumption scenario behavior analysis method that can fully utilize video visual information, combine spatiotemporal context, and possess the ability to adaptively adjust scenario value assessment and collection quality, in order to improve the precision of campus management and the efficiency of resource utilization. Summary of the Invention

[0005] To achieve the above objectives, this application provides the following technical solution: A method for analyzing campus card consumption scenarios based on the YOLO object detection algorithm includes: S1, acquire video stream data of consumption behavior collected by multiple video capture devices deployed on campus in multiple all-in-one card consumption scenarios; S2, input the consumption behavior video stream data into the pre-deployed YOLO object detection model to perform object detection operation, output the student individual bounding box information carrying the campus card in each consumption behavior video stream data and the timestamp information associated with the bounding box information, and generate multiple structured consumption behavior records; S3, perform consumption frequency statistics and consumption amount statistics operations on multiple structured consumption behavior records, calculate the number of times a single student swipes their card in each consumption scenario within a preset time window and the cumulative consumption amount, combine the number of times the card swipes occurred and the cumulative consumption amount into a frequency-amount feature vector and output it; S4, acquire multiple spatiotemporal location monitoring data, and perform an association mapping operation between the frequency amount feature vector and the multiple spatiotemporal location monitoring data; S5. Based on the result of the association mapping operation, perform a consumption tendency prediction operation and output consumption tendency data for the individual student, which includes a high-probability consumption scenario label sequence and a predicted consumption time period label sequence.

[0006] Furthermore, before performing the target detection operation, the YOLO target detection model loads a pre-configured set of scene detection parameters for the campus card consumption scenario. The set of scene detection parameters includes the detection confidence threshold and the aspect ratio constraint range of the detection box corresponding to each consumption scenario. The YOLO object detection model performs feature extraction on each frame of the consumer behavior video stream data to obtain a multi-scale feature map, and performs anchor box regression on the multi-scale feature map to generate a set of candidate student individual detection boxes. Calculate the confidence score of each candidate detection box in the candidate student individual detection box set, remove candidate detection boxes with confidence scores lower than the detection confidence threshold, and retain candidate detection boxes with confidence scores higher than or equal to the detection confidence threshold as valid detection boxes; Perform non-maximum suppression on the valid detection boxes to eliminate overlapping detection boxes and obtain the student individual bounding box information; bind the student individual bounding box information with the timestamp information and store it in the consumption behavior cache queue.

[0007] Furthermore, the consumption frequency statistics operation performs a scenario tag mapping operation on each structured consumption behavior record stored in the consumption behavior cache queue. The scenario tag mapping operation assigns a corresponding consumption scenario type tag to each structured consumption behavior record. The consumption scenario type tags include cafeteria tags, supermarket tags, bathhouse tags, library tags, and school hospital tags. Based on the consumption scenario type tags, grouping and aggregation operations are performed on all structured consumption behavior records within the preset time window to obtain the statistical value of the number of card swipes corresponding to each consumption scenario type tag; The consumption amount statistics operation is based on the number of card swipes corresponding to each consumption scenario type label, combined with the preset unit consumption amount benchmark value for each consumption scenario, to calculate the estimated cumulative consumption amount of a single student in each consumption scenario. The statistical value of the number of card swipes and the estimated cumulative consumption amount are concatenated to form the frequency-amount feature vector.

[0008] Furthermore, S4 and S5 include: Send a spatiotemporal data request instruction, the spatiotemporal data request instruction carrying the time boundary parameters of the preset time window and the scenario identifier list of the multiple all-in-one card consumption scenarios; Receive the multiple spatiotemporal location monitoring data returned in response to the spatiotemporal data request instruction, perform parsing operations to extract the longitude and latitude values ​​from the physical space coordinate information corresponding to each consumption scenario and the opening time period identifier, business time period identifier, and closing time period identifier from the time period attribute information corresponding to each consumption scenario. The frequency-amount feature vector is split into multiple sub-vectors according to the consumption scenario type label, and each sub-vector corresponds to the frequency-amount combination data of a single consumption scenario; For each sub-vector, calculate the spatial Euclidean distance between the physical spatial coordinates of the consumption scenario corresponding to the sub-vector and the physical spatial coordinates of the other consumption scenarios, and mark the consumption scenarios with a distance lower than the preset distance threshold as spatially adjacent scenarios; The time period attribute information of the consumption scenario corresponding to each sub-vector is compared with the preset time window to calculate the time period overlap coefficient. Consumption scenarios with an overlap coefficient higher than the preset overlap threshold are marked as time-adjacent scenarios. Based on the labeling results of the spatially adjacent scenes and the labeling results of the temporally adjacent scenes, a scene transition preference map for the individual student is constructed. A path search operation is performed on the scenario transition preference map to search for the transition path with the highest probability starting from the current consumption scenario, and the sequence of scenarios traversed is determined as the high-probability consumption scenario label sequence. Perform time period clustering on the scene transfer preference map, divide the preset time window into multiple candidate time period partitions, calculate the occurrence frequency of each consumption scene in each candidate time period partition, and determine the time boundary of the candidate time period partition with the highest occurrence frequency as the predicted consumption time period label sequence.

[0009] Further, the step of performing a path search operation on the scene transition preference graph to search for the transition path with the highest probability starting from the current consumption scene, and determining the sequence of scenes traversed as the high-probability consumption scene label sequence, includes: Determine the starting node corresponding to the current consumption scenario in the scenario transition preference graph, obtain all adjacent nodes connected to the starting node and the edge connection weight value corresponding to each adjacent node, perform a normalization ratio transformation operation on each edge connection weight value, and obtain the state transition probability value from the starting node to each adjacent node. Starting from the initial node, a breadth-first search operation is performed. In each search iteration, the neighboring node with the highest state transition probability value is selected as the next access node. The selected neighboring node is added to the path node sequence, and the state transition probability value of the neighboring node is multiplied to the total path probability value. When the length of the path node sequence reaches a preset path length threshold, the width-first search operation is terminated, and the consumption scenario type tags corresponding to all nodes in the current path node sequence are arranged in order to generate the high-probability consumption scenario tag sequence.

[0010] Furthermore, after the consumption tendency prediction operation outputs consumption tendency data for the individual student, it obtains target value assessment scenario data of campus card consumption behavior in the campus setting. The target value assessment scenario data includes scenario value weight coefficients and a set of scenario influencing factors for each consumption scenario. The set of scenario influencing factors includes at least the population density factor of the consumption scenario, the time period busyness factor of the consumption scenario, and the service carrying capacity factor of the consumption scenario. The consumption tendency data and the target value assessment scenario data are subjected to a weighted fusion operation. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data to obtain the weighted consumption scenario label sequence. The scene-adaptive adjustment operation is performed on the weighted consumption scene label sequence using the scene-influence factor set. The scene-adaptive adjustment operation adds a scene-adaptive adjustment coefficient to each consumption scene label and outputs the adjusted consumption behavior parameters. The adjusted consumption behavior parameters include the adjusted scene label sequence and the adjusted consumption time window.

[0011] Furthermore, the acquisition of target value assessment scenario data of campus card consumption behavior in the campus setting includes scenario value weight coefficients and scenario influencing factor set for each consumption scenario. The scenario influencing factor set includes at least the population density factor, the time period busyness factor, and the service carrying capacity factor of the consumption scenario. The consumption tendency data and the target value assessment scenario data are subjected to a weighted fusion operation. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data to obtain the weighted consumption scenario label sequence. The set of scenario influence factors is used to perform a scenario-adaptive adjustment operation on the weighted consumer scenario label sequence. A scenario-adaptive adjustment coefficient is added to each consumer scenario label, and the adjusted consumer behavior parameters are output, including the adjusted scenario label sequence and the adjusted consumption time window, specifically including: Send a target value assessment scenario data acquisition request, wherein the target value assessment scenario data acquisition request carries a set of scenario identifiers for the multiple all-in-one card consumption scenarios; Receive the returned target value assessment scenario data, parse the target value assessment scenario data, and extract the scenario value weight coefficient, traffic density factor, time period busyness factor and service carrying capacity factor corresponding to each consumption scenario; For each consumption scenario tag in the high-probability consumption scenario tag sequence, obtain the corresponding scenario value weight coefficient, multiply it by the sequence position weight of the consumption scenario tag in the high-probability consumption scenario tag sequence, and obtain the weight correction value of the consumption scenario tag to replace the original weight value, thus obtaining the weight-corrected consumption scenario tag sequence. Each consumption scenario label in the weighted consumption scenario label sequence is combined with the corresponding consumption scenario's traffic density factor, time period busyness factor, and service carrying capacity factor to obtain the scenario adaptive adjustment base. A threshold mapping operation is performed on the scene adaptation adjustment base number to map the scene adaptation adjustment base number to a preset adjustment coefficient value range, thereby obtaining the scene adaptation adjustment coefficient. The scene adaptability adjustment coefficient is attached to the corresponding consumption scene label to form a scene label item with adjustment coefficient; Traverse all consumption scenario tags in the weighted consumption scenario tag sequence, complete the append operation for all scenario tag items, and generate the adjusted scenario tag sequence; Based on the time-duration busyness factor corresponding to each consumption scenario label in the adjusted scenario label sequence, the time-duration boundary in the predicted consumption time-duration label sequence is contracted or expanded to generate the adjusted consumption time window.

[0012] Furthermore, after outputting the adjusted consumption behavior parameters, a consumption behavior quality correlation matrix is ​​constructed based on the adjusted scenario label sequence and the adjusted consumption time window. The row index of the consumption behavior quality correlation matrix is ​​each consumption scenario label, and the column index of the consumption behavior quality correlation matrix is ​​each consumption time period label. The matrix elements of the consumption behavior quality correlation matrix are determined by the product of the scenario adaptability adjustment coefficient under the corresponding consumption scenario label and the time adaptability coefficient under the corresponding consumption time period label. Perform row vector analysis on the consumer behavior quality correlation matrix to calculate the row vector magnitude of each row vector, and use the row vector magnitude as the basic score of behavior quality for the corresponding consumption scenario in that row; perform column vector analysis on the consumer behavior quality correlation matrix to calculate the column vector magnitude of each column vector, and use the column vector magnitude as the basic score of behavior time adaptation for the corresponding consumption time period in that column. Perform a cross-matching operation between the basic behavioral quality score corresponding to each consumption scenario and the basic behavioral time adaptation score corresponding to each consumption time period. Then, weight the basic behavioral quality score and the basic behavioral time adaptation score according to the scenario-time period pairing relationship to output the reference quality score of each consumption scenario under each consumption time period.

[0013] Furthermore, after outputting the reference quality scores for each consumption scenario under each consumption time period, a video acquisition device deployment topology map of the campus card consumption scenario is obtained. The video acquisition device deployment topology map includes the device location nodes and device coverage boundaries of the video acquisition devices in each consumption scenario. Based on the deployment topology of the video capture devices and the consumer behavior quality correlation matrix, a consumer behavior acquisition correlation matrix is ​​constructed, where the row index is the identifier of each video capture device and the column index is the label of each consumer scenario. The matrix elements of the consumer behavior collection association matrix are determined by the product of the coverage overlap coefficient of the corresponding video collection device to the corresponding consumer scene and the reference quality score of the corresponding consumer scene. The coverage overlap coefficient is calculated based on the ratio of the intersection area of ​​the device coverage boundary and the physical space boundary of the consumer scene to the total physical space area of ​​the consumer scene. Perform a row summation operation on the consumer behavior collection association matrix to obtain the comprehensive collection coverage value of each video collection device, and perform a column summation operation on the consumer behavior collection association matrix to obtain the comprehensive scene coverage value of each consumption scenario; The comprehensive values ​​of the acquired coverage are sorted in descending order of numerical value to obtain a priority sequence of video acquisition devices, and the comprehensive values ​​of the scene coverage are sorted in ascending order of numerical value to obtain a priority sequence of consumer scene acquisition needs. Based on the priority sequence of the video acquisition devices and the priority sequence of acquisition requirements for the consumption scenarios, an acquisition reference score for each video acquisition device in each consumption scenario is calculated. The acquisition reference score is the ratio of the comprehensive acquisition coverage value of the video acquisition device to the comprehensive scenario coverage value of the corresponding consumption scenario.

[0014] Furthermore, after calculating the acquisition reference score for each video acquisition device in each consumption scenario, an acquisition strategy adjustment operation is performed on multiple video streams of the aforementioned consumption behavior based on the acquisition reference score for each video acquisition device in each consumption scenario. The acquisition strategy adjustment operation includes the following steps: The acquisition reference score of each video acquisition device is compared with the preset acquisition score threshold. When the acquisition reference score of a certain video acquisition device in a certain consumption scenario is higher than the acquisition score threshold, the video acquisition frame rate of the video acquisition device in the consumption scenario is adjusted to the first frame rate value, and the image resolution of the video acquisition device in the consumption scenario is adjusted to the first resolution value. When the reference score of a video capture device in a certain consumption scenario is lower than or equal to the capture score threshold, the video capture frame rate of the video capture device in that consumption scenario is adjusted to the second frame rate value, and the image resolution of the video capture device in that consumption scenario is adjusted to the second resolution value. The multiple consumer behavior video streams are re-acquired according to the adjusted video capture frame rate and adjusted image resolution to obtain multiple optimized video data streams. Multiple optimized video data sets are input into the YOLO target detection model to perform a secondary target detection operation, thereby obtaining secondary detection consumption behavior records. Perform a difference comparison operation between the secondary detection consumption behavior record and multiple structured consumption behavior records, and update the consumption behavior quality correlation matrix and the consumption behavior collection correlation matrix based on the result of the difference comparison operation.

[0015] This invention belongs to the field of computer vision analysis technology and relates to a method for analyzing campus card consumption scenarios based on the YOLO object detection algorithm. It acquires video streams of student card-swiping behavior, uses the YOLO object detection model to identify individual students, generates structured consumption behavior records, statistically analyzes the frequency and amount of consumption in each scenario, predicts students' consumption preference scenarios and time periods, introduces value weights and influencing factors for each scenario, constructs a consumption behavior quality correlation matrix, outputs reference quality scores for each scenario in each time period, constructs a collection correlation matrix and calculates collection reference scores, and dynamically adjusts the frame rate and resolution of the collection device under different scenarios to achieve differentiated collection strategies. This invention can effectively improve the targeting and resource utilization efficiency of campus card consumption behavior analysis, adaptively adjust collection parameters according to scenario value, and significantly improve analysis and processing accuracy and system operating efficiency. Attached Figure Description

[0016] Figure 1 The flowchart illustrates a campus card consumption scenario behavior analysis method based on the YOLO object detection algorithm, as claimed in this embodiment of the invention. Figure 2 The second workflow diagram is shown for a campus card consumption scenario behavior analysis method based on the YOLO object detection algorithm claimed in the embodiments of the present invention. Figure 3 The third flowchart is a method for analyzing campus card consumption scenarios based on the YOLO target detection algorithm, as claimed in an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0018] The terms "first," "second," and "third" in this application are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of those features. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. Furthermore, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.

[0019] References to embodiments herein mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] According to the first embodiment of the present invention, referring to Figure 1 This invention claims protection for a method for analyzing campus card consumption scenarios based on the YOLO object detection algorithm, comprising: S1, acquire video stream data of consumption behavior collected by multiple video capture devices deployed on campus in multiple all-in-one card consumption scenarios; S2, input the consumption behavior video stream data into the pre-deployed YOLO object detection model to perform object detection operation, output the student individual bounding box information carrying the campus card in each consumption behavior video stream data and the timestamp information associated with the bounding box information, and generate multiple structured consumption behavior records; S3 performs consumption frequency and consumption amount statistics operations on multiple structured consumption behavior records, calculates the number of times a single student swipes their card in each consumption scenario within a preset time window and the cumulative consumption amount, combines the number of times the card swipes occur and the cumulative consumption amount into a frequency-amount feature vector and outputs it. S4, acquire multiple spatiotemporal location monitoring data, and perform an association mapping operation between the frequency-amount feature vector and the multiple spatiotemporal location monitoring data; S5 performs a consumption tendency prediction operation based on the result of the association mapping operation, and outputs consumption tendency data for a single student, including a sequence of high-probability consumption scenario labels and a sequence of predicted consumption time period labels.

[0021] In this embodiment, taking a smart campus construction project of a university as the application background, video capture equipment is deployed in five main campus card consumption scenarios of the university. In the cafeteria dining scenario, a Hikvision network camera is installed above each of the four entrances and exits of the cafeteria. The cameras are installed at a height of 3.2 meters above the ground, and the lens tilt angle is set to 25 degrees downward to ensure that the upper body posture and card position of students holding campus cards can be fully captured when they swipe their cards. In the supermarket shopping scenario, a camera is installed directly above each of the two checkout counters in the supermarket. The cameras are installed at a vertical height of 1.8 meters above the checkout counters to capture video. The camera covers the card-swiping area at the cashier and the student's face. In the bathing service scenario, a camera is installed at the entrance gate of the bathing center, 0.6 meters horizontally from the card-swiping panel, to capture a side view of the student swiping their card to enter. In the library access scenario, cameras are installed above the security checkpoints at the main entrance and exit of the library, 2.8 meters high, to capture the complete card-swiping action of the student in the checkpoint. In the school hospital scenario, a camera is installed above the registration and payment window, 1.5 meters vertically from the window counter, to capture the card-swiping operation of the student during registration and payment.

[0022] All the cameras continuously collect video stream data of consumer behavior at a frame rate of 25 frames per second. Each camera is equipped with an independent network storage device. The video data is compressed in H.264 encoding format and stored in the disk array of the campus video surveillance server. The server classifies and stores the video data according to scene identifiers: the canteen scene video is stored in the storage directory named canteen, the supermarket scene video is stored in the market directory, the bath scene video is stored in the bath directory, the library scene video is stored in the library directory, and the school hospital scene video is stored in the clinic directory.

[0023] During the deployment phase of the YOLO object detection model, technicians pre-collected a dataset of 8,000 labeled images representing campus card payment scenarios on campus. For each image in this dataset, a rectangular bounding box was drawn for each student carrying a campus card using an annotation tool. The bounding box annotation information included the pixel values ​​of the top-left corner (x-coordinate), top-left corner (y-coordinate), width, and height of the rectangle. A scene type label and a campus card carrying attribute label were also added to each bounding box. This dataset was used to fine-tune the YOLOv8 model, with 300 training epochs, an initial learning rate of 0.001, and a batch size of 16. After training, a weight file for the YOLO object detection model optimized for campus card payment scenarios was obtained. For each image in this dataset, a rectangular bounding box was drawn for each student performing a card swiping operation. The "student performing a card swiping operation" was defined as a student holding a campus card whose hand is above or in contact with the card reader's sensing area. The bounding box should include the student's upper body and hand area. The bounding box annotation information includes the pixel values ​​of the top left corner, the top left corner, the width, and the height of the rectangle. At the same time, each bounding box should be labeled with a scene type and a "carrying campus card" attribute.

[0024] During the real-time analysis phase, the video processing server reads video stream data from the disk array in chronological order for each scene. Each frame is scaled to a standard input size of 640 pixels by 640 pixels before being fed into the YOLO object detection model. The model performs forward inference calculations on each frame, outputting bounding box information for all detected student individuals in that frame. Each bounding box is accompanied by a confidence score, ranging from 0 to 1. The server classifies bounding boxes with confidence scores higher than 0.45 as valid detection results and records the corresponding acquisition timestamp for that frame with millisecond precision in the format YYYY-MM-DD HH:MM:SS.sss. The server combines the bounding box information and timestamp information into a structured consumption behavior record. Each record contains six fields: the student's unique tracking number in the image, the pixel value of the top-left corner of the bounding box (horizontal coordinate), the pixel value of the top-left corner of the bounding box (vertical coordinate), the pixel value of the bounding box width, the pixel value of the bounding box height, and the timestamp string.

[0025] The server performs a consumption frequency statistics operation on each structured consumption behavior record. Specifically, the server uses the unique tracking number of each individual student as the grouping key, sets the preset time window to the most recent 7 natural days, and groups and counts all structured consumption behavior records belonging to the same tracking number within the 7-day time window according to the consumption scenario type. For example, for the individual student with tracking number S20240001, the server counts that he / she appears in the cafeteria scenario 18 times, in the supermarket scenario 6 times, in the bathhouse scenario 4 times, in the library scenario 10 times, and in the school hospital scenario 1 time. The server simultaneously performs consumption amount statistics: For each consumption scenario, the server multiplies the number of times the student appears in that scenario by the preset average consumption amount benchmark for that scenario—the benchmark for the average consumption amount per transaction is set to 12.5 yuan for the cafeteria scenario, 8.3 yuan for the supermarket scenario, 3.0 yuan for the bathhouse scenario, 0 yuan for the library scenario (since it does not involve direct consumption), and 15.0 yuan for the school hospital scenario—to calculate the estimated cumulative consumption amount for the student in each scenario. The server combines the frequency statistics (18 times, 6 times, 4 times, 10 times, 1 time) and amount statistics (225.0 yuan, 49.8 yuan, 12.0 yuan, 0 yuan, 15.0 yuan) into a ten-dimensional frequency-amount feature vector. The estimated cumulative consumption amount is an estimate calculated based on the product of the preset unit consumption amount benchmark for each consumption scenario and the number of times the card swipe occurs. It is used to represent the student's relative consumption scale in each consumption scenario, rather than a precise record of the transaction amount.

[0026] The server sends a request to obtain the physical coordinates of five consumption scenarios: The canteen scenario's coordinates are 116.3857 degrees east longitude and 39.9123 degrees north latitude, corresponding to meal times of 6:30-8:30 AM, 11:00-1:00 PM, and 5:00-7:00 PM; the supermarket scenario's coordinates are 116.3865 degrees east longitude and 39.9118 degrees north latitude, corresponding to business hours of 8:00 AM to 10:00 PM; the bathhouse scenario's coordinates are... The coordinates for the library scene are 116.3849 degrees east longitude and 39.9129 degrees north latitude, corresponding to an opening time of 12:00 noon to 23:00; the coordinates for the library scene are 116.3871 degrees east longitude and 39.9120 degrees north latitude, corresponding to an opening time of 7:00 am to 22:00 pm; the coordinates for the school hospital scene are 116.3851 degrees east longitude and 39.9115 degrees north latitude, corresponding to a consultation time of 8:00 am to 12:00 pm and 2:00 pm to 5:30 pm. The server performs an association mapping operation between the frequency-amount feature vector and the aforementioned spatiotemporal location monitoring data, attaching corresponding spatial coordinates and time period attributes to the frequency-amount data of each consumption scenario. Based on the results of the association mapping, the server performs a consumption tendency prediction operation: for a student individual with tracking number S20240001, the server predicts, based on the frequency distribution of the student's appearance in each scenario in the past 7 days, combined with the spatial proximity and time period overlap of each scenario, that the student is most likely to visit the consumption scenarios in the next 24 hours in the following order: cafeteria scenario, supermarket scenario, and library scenario, with the predicted consumption time period being from 11:30 am to 12:30 pm, and outputs consumption tendency data containing the above prediction results.

[0027] Furthermore, before performing the target detection operation, the YOLO target detection model loads a pre-configured set of scene detection parameters for the campus card consumption scenario. The set of scene detection parameters includes the detection confidence threshold and the aspect ratio constraint range of the detection box corresponding to each consumption scenario. The YOLO object detection model performs feature extraction on each frame of the consumer behavior video stream data to obtain a multi-scale feature map. It then performs anchor box regression on the multi-scale feature map to generate a set of candidate student individual detection boxes. Calculate the confidence score of each candidate detection box in the candidate student individual detection box set, remove candidate detection boxes with confidence scores lower than the detection confidence threshold, and retain candidate detection boxes with confidence scores higher than or equal to the detection confidence threshold as valid detection boxes; Perform nonmaximum suppression on valid detection boxes to eliminate overlapping detection boxes and obtain individual student bounding box information; bind the individual student bounding box information with timestamp information and store it in the consumption behavior cache queue.

[0028] In this embodiment, before the YOLO object detection model performs object detection operations, the video processing server first loads a pre-configured scene detection parameter set for the campus card consumption scenario. This scene detection parameter set is stored in the server's configuration file in JSON format and includes the detection confidence threshold and the aspect ratio constraint range for each of the five consumption scenarios. For the cafeteria scenario, the detection confidence threshold is set to 0.40, and the aspect ratio constraint range is set to 0.35 to 0.85; for the supermarket scenario, the detection confidence threshold is set to 0.45, and the aspect ratio constraint range is set to 0.30 to 0.90; for the washing machine scenario... The detection confidence threshold for the bathing scene was set at 0.50, and the aspect ratio constraint range for the detection box was set from 0.25 to 0.80. The higher threshold for this scene is because students in bathhouses wear relatively uniform clothing and the differences in target features are small, requiring a higher confidence level to ensure detection accuracy. The detection confidence threshold for the library scene was set at 0.35, and the aspect ratio constraint range for the detection box was set from 0.40 to 0.95. The lower threshold for this scene is because a higher proportion of students in the library carry campus cards and there is less target occlusion. The detection confidence threshold for the school hospital scene was set at 0.48, and the aspect ratio constraint range for the detection box was set from 0.30 to 0.85.

[0029] The YOLO object detection model performs feature extraction on each frame of a consumer behavior video stream. The model first passes the input image through a backbone network consisting of convolutional and pooling layers, sequentially through five feature extraction stages at different scales. The output feature maps from each stage are 1 / 2, 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image size, respectively, thus obtaining multi-scale feature maps. After obtaining the multi-scale feature maps, the model pre-sets multiple anchor boxes of different sizes and aspect ratios for each grid cell in each feature map layer. For a 640-pixel by 640-pixel input image, the model pre-sets three anchor boxes per grid cell at the 80-pixel feature map level, with anchor box sizes of (10 pixels x 13 pixels), (16 pixels x 30 pixels), and (33 pixels x 23 pixels), respectively. In a 40x40 feature map layer, each grid cell has three pre-defined anchor boxes with sizes of (30 pixels x 61 pixels), (62 pixels x 45 pixels), and (59 pixels x 119 pixels). In a 20x20 feature map layer, each grid cell has three pre-defined anchor boxes with sizes of (116 pixels x 90 pixels), (156 pixels x 198 pixels), and (373 pixels x 326 pixels). The model performs bounding box regression on each anchor box, predicting the x-coordinate offset, y-coordinate offset, width scaling, and height scaling of the anchor box relative to the ground truth bounding box, generating a set of candidate student individual detection boxes.

[0030] The model calculates the confidence score of each candidate detection box in the set of candidate student individual detection boxes. This confidence score is the product of two parts: the first part is the probability that the target is contained within the anchor box, and the second part is the intersection-union ratio (IUGR) between the predicted bounding box of the anchor box and the ground truth bounding box. For video frames of the cafeteria scene, the model removes candidate detection boxes with a confidence score below 0.40 and retains those with a confidence score of 0.40 or higher as valid detection boxes. For example, in a certain frame of the cafeteria scene image, the model generates 156 candidate detection boxes, and after filtering by the confidence threshold, 42 valid detection boxes are retained.

[0031] The server performs non-maximum suppression on the valid detection boxes. Specifically, the server sorts all valid detection boxes from highest to lowest confidence score, selects the detection box with the highest confidence score as the reference box, and iterates through the remaining detection boxes, calculating the intersection-union ratio (IU) of each remaining detection box with the reference box. When the IU of a given remaining detection box with the reference box is higher than 0.50, the server determines that the two detection boxes detect the same target and removes the remaining detection box from the set of valid detection boxes. The server repeats the above process until all detection boxes have been processed, finally obtaining the student's individual bounding box information. In the example above, after the non-maximum suppression operation, 18 non-overlapping student individual bounding box information remain from the 42 valid detection boxes.

[0032] The server binds the bounding box information of each student to the capture timestamp of the video frame containing that bounding box, with the timestamp accurate to the millisecond level, such as 2026-08-14 12:05:23.456. The bound data is stored in the form of key-value pairs in a consumption behavior cache queue. This cache queue adopts a first-in, first-out data structure, with a maximum capacity of 10,000 records. When the queue is full, the earliest stored record is automatically removed and persisted to an SQLite database on the server's hard drive.

[0033] The data source for the consumption frequency statistics operation is the union of the consumption behavior cache queue and the SQLite database. When the server performs the statistics operation, it first reads all non-persistent real-time records from the consumption behavior cache queue, and simultaneously sends a query request by timestamp range to the SQLite database to obtain the persisted historical records within a preset time window. The two are then merged and a grouping aggregation operation is performed. The records in the SQLite database are indexed by the timestamp field, supporting efficient time range queries.

[0034] Furthermore, the consumption frequency statistics operation performs a scenario tag mapping operation on each structured consumption behavior record stored in the consumption behavior cache queue. The scenario tag mapping operation assigns a corresponding consumption scenario type tag to each structured consumption behavior record. The consumption scenario type tags include cafeteria tags, supermarket tags, bathhouse tags, library tags, and school hospital tags. Based on the consumption scenario type tags, perform grouping and aggregation operations on all structured consumption behavior records within a preset time window to obtain the statistical value of the number of card swipes corresponding to each consumption scenario type tag; The consumption amount statistics operation is based on the number of card swipes corresponding to each consumption scenario type label, combined with the preset unit consumption amount benchmark value for each consumption scenario, to calculate the estimated cumulative consumption amount of a single student in each consumption scenario. The statistical value of the number of card swipes and the estimated cumulative consumption amount are concatenated to form a frequency-amount feature vector.

[0035] In this embodiment, the consumption amount is estimated based on the scenario benchmark value because: the video analysis system and the all-in-one card transaction system belong to different security domains, and directly obtaining transaction data requires complex cross-system security approval. However, this invention aims to analyze consumption behavior patterns rather than accurately calculate the amount. The combination of video analysis and scenario benchmark value is sufficient to meet the needs of behavior pattern analysis. The benchmark value of the unit consumption amount for each scenario is derived from the statistical analysis of actual transaction data over a long period of that scenario, which can reflect the average consumption level of that scenario and has reference value at the statistical level.

[0036] The consumption frequency statistics operation performs scene tag mapping on each structured consumption behavior record stored in the consumption behavior cache queue. The server reads the video source file path corresponding to the bounding box information from each structured consumption behavior record and extracts the scene identifier from the video source file path. After the scene tag mapping is completed, each structured consumption behavior record is assigned a scene type tag field, which takes one of five strings: cafeteria, supermarket, bathhouse, library, or school hospital.

[0037] As an alternative to scene tag mapping, the server establishes a static mapping table in the system configuration file that links video capture device identifiers to consumption scene type tags. Each structured consumption behavior record carries a unique identifier for the capture device (such as a device serial number or network address) upon generation. The server maps the device identifier to the corresponding scene type tag by querying the mapping table, rather than relying on the storage path of the video file. The mapping table is configured by the administrator during system deployment based on the actual installation location of each video capture device, and is updated synchronously when the device installation location changes.

[0038] The server performs grouping and aggregation operations on all structured consumption behavior records within a preset time window based on consumption scenario type tags. The preset time window is set to the most recent 7 natural days, with the time boundary from 00:00:00 on the 7th day ago to the current time. The server uses the student's unique tracking number and scenario type tag as a composite grouping key to group all records in the cache queue. For the student with tracking number S20240001, the server counts that the student swiped their card 18 times in the cafeteria scenario, 6 times in the supermarket scenario, 4 times in the bathhouse scenario, 10 times in the library scenario, and 1 time in the school hospital scenario. The server stores these statistical values ​​as a five-dimensional frequency vector [18, 6, 4, 10, 1].

[0039] The consumption amount statistics are calculated based on the number of card swipes corresponding to each consumption scenario type label, combined with the preset unit consumption amount benchmark value for each consumption scenario. The server reads the unit consumption amount benchmark value for each scenario from the configuration file: 12.5 yuan per transaction for the cafeteria scenario, calculated by dividing the total amount of all card swipe transactions in the school cafeteria over the past three months by the total number of transactions; 8.3 yuan per transaction for the supermarket scenario, determined based on the average transaction value of the campus supermarket over the past three months; 3.0 yuan per transaction for the bathhouse scenario, determined based on the single bathing fee standard of the bathhouse; 0 yuan per transaction for the library scenario, as card swipes for entering and exiting the library do not involve consumption amount; and 15.0 yuan per transaction for the school hospital scenario, determined based on the average value of registration and basic drug costs for general outpatient services at the school hospital. The server multiplies the frequency statistics of each scenario by the corresponding unit consumption amount benchmark value to calculate the estimated cumulative consumption amount of student individual with tracking number S20240001 in each scenario: cafeteria scenario: 18 multiplied by 12.5 equals 225.0 yuan; supermarket scenario: 6 multiplied by 8.3 equals 49.8 yuan; bathhouse scenario: 4 multiplied by 3.0 equals 12.0 yuan; library scenario: 10 multiplied by 0 equals 0 yuan; school hospital scenario: 1 multiplied by 15.0 equals 15.0 yuan.

[0040] The server concatenates the card swipe count statistics [18, 6, 4, 10, 1] with the estimated cumulative consumption amount [225.0, 49.8, 12.0, 0, 15.0] in the order of the scenarios to generate a ten-dimensional frequency-amount feature vector. The vector format is [18, 225.0, 6, 49.8, 4, 12.0, 10, 0, 1, 15.0], where odd-numbered positions represent frequency values ​​and even-numbered positions represent the corresponding amount values. The server then associates this frequency-amount feature vector with the corresponding student individual tracking number and stores it in a Redis cache database with the key name student_feature_S20240001. The key's expiration time is set to 24 hours.

[0041] Furthermore, referring to Figure 2 S4 and S5 include: Send a spatiotemporal data request command, which carries the time boundary parameters of a preset time window and a list of scene identifiers for multiple smart card consumption scenarios; Receive multiple spatiotemporal location monitoring data returned in response to the spatiotemporal data request command, perform parsing operations to extract the longitude and latitude values ​​from the physical space coordinate information corresponding to each consumption scenario, and the opening time period identifier, business time period identifier, and closing time period identifier from the time period attribute information corresponding to each consumption scenario. The frequency-amount feature vector is split into multiple sub-vectors according to the consumption scenario type label, and each sub-vector corresponds to the frequency-amount combination data of a single consumption scenario; For each sub-vector, calculate the spatial Euclidean distance between the physical spatial coordinates of the consumption scenario corresponding to the sub-vector and the physical spatial coordinates of the other consumption scenarios, and mark the consumption scenarios with a distance lower than the preset distance threshold as spatially adjacent scenarios; The time period attribute information of the consumption scenario corresponding to each sub-vector is compared with the preset time window to calculate the time period overlap coefficient. Consumption scenarios with an overlap coefficient higher than the preset overlap threshold are marked as time-adjacent scenarios. Based on the labeling results of spatially and temporally adjacent scenes, a scene transition preference map for a single student is constructed. Perform a path search operation on the scene transition preference map to search for the transition path with the highest probability starting from the current consumption scene, and determine the scene sequence traversed as a high-probability consumption scene label sequence; Perform time period clustering on the scene transfer preference map, divide the preset time window into multiple candidate time period partitions, calculate the occurrence frequency of each consumption scene in each candidate time period partition, and determine the time boundary of the candidate time period partition with the highest occurrence frequency as the predicted consumption time period label sequence.

[0042] In this embodiment, the server sends a spatiotemporal data request instruction, which is sent to the API using the HTTP POST protocol. The message body of the request instruction contains time boundary parameters of a preset time window, with a start time of 2026-08-08 00:00:00 and an end time of 2026-08-14 23:59:59, as well as a list of scene identifiers for five all-in-one card consumption scenarios [canteen, market, bath, library, clinic].

[0043] The server receives multiple spatiotemporal location monitoring data returned in response to the aforementioned request command. The response data is in JSON format, and the server parses it. After parsing, the physical spatial coordinates of the cafeteria scene are obtained as longitude 116.3857 degrees and latitude 39.9123 degrees, with time period attributes of breakfast 06:30-08:30, lunch 11:00-13:00, and dinner 17:00-19:00; the longitude of the supermarket scene is 116.3865 degrees and latitude 39.9118 degrees, with an operating period of 08:00. The opening hours for the following locations are as follows: 0:00-22:00; 116.3849 degrees longitude and 39.9129 degrees latitude for the bathing area, 12:00-23:00 for the library area, 116.3871 degrees longitude and 39.9120 degrees latitude for the library area, 07:00-22:00 for the library area; and 116.3851 degrees longitude and 39.9115 degrees latitude for the school hospital area, 08:00-12:00 and 14:00-17:30 for the school hospital area.

[0044] The server splits the frequency-amount feature vector into five sub-vectors based on the consumption scenario type label: the sub-vector for the cafeteria scenario is [18, 225.0], the sub-vector for the supermarket scenario is [6, 49.8], the sub-vector for the bathhouse scenario is [4, 12.0], the sub-vector for the library scenario is [10, 0], and the sub-vector for the school hospital scenario is [1, 15.0]. Each sub-vector corresponds to the frequency-amount combination data for a single consumption scenario.

[0045] For each sub-vector, the server calculates the spatial Euclidean distance between the physical spatial coordinates of the corresponding consumption scenario and the physical spatial coordinates of other consumption scenarios. Taking the cafeteria scenario as an example, the server calculates the spatial Euclidean distance between the cafeteria scenario and the supermarket scenario: the absolute value of the longitude difference is 0.0008 degrees, and the absolute value of the latitude difference is 0.0005 degrees. Based on the conversion relationship that each degree of latitude corresponds to approximately 111 kilometers and each degree of longitude corresponds to approximately 111 kilometers, multiplied by the cosine value of latitude, the straight-line distance between the two scenarios is calculated to be approximately 95 meters. The distance between the cafeteria scenario and the bathhouse scenario is approximately 78 meters, the distance between the cafeteria scenario and the library scenario is approximately 142 meters, and the distance between the cafeteria scenario and the school hospital scenario is approximately 107 meters. The server marks consumption scenarios with spatial Euclidean distance values ​​lower than the preset distance threshold of 120 meters as spatially adjacent scenarios. Accordingly, the cafeteria scenario is marked as spatially adjacent to the supermarket scenario (95 meters), the bathhouse scenario (78 meters), and the school hospital scenario (107 meters), while the cafeteria scenario (142 meters) does not meet the proximity condition.

[0046] The server calculates the overlap between the consumption scenario time period attribute information corresponding to each sub-vector and the preset time window. The preset time window is 24 hours a day. The overlap between the cafeteria scenario's lunch period (11:00-13:00) and the preset time window is 2 hours, the breakfast period is 2 hours, the dinner period is 2 hours, and the total overlap is 6 hours. The overlap between the supermarket scenario's business hours (08:00-22:00) and the bathhouse scenario's opening hours (12:00-23:00) is 11 hours. The overlap between the library scenario's opening hours (07:00-22:00) is 15 hours. The total overlap between the school hospital scenario's consultation periods (08:00-12:00 and 14:00-17:30) is 7.5 hours. The server defines the time period overlap coefficient as the ratio of the overlap duration to 24 hours: 0.25 for the cafeteria, 0.583 for the supermarket, 0.458 for the bathhouse, 0.625 for the library, and 0.313 for the school hospital. The server marks consumption scenarios with a time period overlap coefficient higher than the preset overlap threshold of 0.40 as time proximity scenarios. Accordingly, the supermarket, bathhouse, and library scenarios are marked as time proximity scenarios, while the cafeteria and school hospital scenarios do not meet the time proximity condition.

[0047] Based on the labeling results of spatially and temporally proximate scenes, the server constructs a scene transition preference graph for each student. The graph consists of five consumption scenes as nodes. The edge connection weights between nodes are determined by a weighted sum of spatial Euclidean distance and temporal overlap coefficients, with the spatial distance weight set to 0.6 and the temporal overlap weight set to 0.4. For example, the edge connection weight between the cafeteria scene and the supermarket scene is calculated as 0.6 multiplied by (1 minus 95 divided by 200) plus 0.4 multiplied by 0.583, yielding approximately 0.548. The server calculates the edge connection weights between all scene pairs in the same way, constructing a complete scene transition preference graph.

[0048] The server performs a path search operation on the scene transition preference graph. Taking the current consumption scene as the cafeteria scene as the starting node, the server searches for the transition path with the highest probability starting from the cafeteria scene. Among all the adjacent nodes connected to the cafeteria scene, the edge connection weight for transitioning to the supermarket scene is 0.548, the edge connection weight for transitioning to the bath scene is 0.512, the edge connection weight for transitioning to the school hospital scene is 0.467, and the edge connection weight for transitioning to the library scene is 0.398. The server selects the supermarket scene with the highest edge connection weight as the first access node, and then continues to search for the adjacent node with the highest probability of transitioning to the next step, using the supermarket scene as the current node. When the length of the path node sequence reaches the preset path length threshold of 3, the server terminates the path search operation, resulting in a path node sequence of [cafeteria scene, supermarket scene, library scene], which is identified as a high-probability consumption scene label sequence.

[0049] The server performs time-segment clustering on the scenario transfer preference map. The server divides a preset time window (24 hours) into 48 candidate time-segment partitions, each partitioned into 30-minute segments. For each candidate time-segment partition, the server calculates the sum of the frequencies of the five consumption scenarios within that partition in the historical 7-day data. The statistics show that the sum of the frequencies of all consumption scenarios is highest in the 11:30 AM to 12:30 PM time-segment, reaching an average of 287 times per day. The server then defines the time boundary of this time-segment partition, 11:30 AM to 12:30 PM, as the predicted consumption time-segment label sequence.

[0050] Furthermore, a path search operation is performed on the scene transition preference graph to search for the transition path with the highest probability starting from the current consumption scene. The sequence of scenes traversed is identified as a high-probability consumption scene label sequence, including: Determine the starting node of the current consumption scenario in the scenario transition preference graph, obtain all adjacent nodes connected to the starting node and the edge connection weight value corresponding to each adjacent node, perform a normalization ratio transformation operation on each edge connection weight value, and obtain the state transition probability value from the starting node to each adjacent node. Starting from the initial node, perform a breadth-first search. In each search iteration, select the neighboring node with the highest state transition probability as the next access node, add the selected neighboring node to the path node sequence, and multiply the state transition probability of the neighboring node to the total path probability value. When the length of the path node sequence reaches the preset path length threshold, the width-first search operation is terminated, and the consumption scenario type tags corresponding to all nodes in the current path node sequence are arranged in order to generate a high-probability consumption scenario tag sequence.

[0051] In this embodiment, the server determines the starting node corresponding to the current consumption scenario in the scenario transition preference graph. If the current time is 11:45 AM, the server determines that the student's most likely consumption scenario is the cafeteria scenario based on the time period attribute corresponding to that time, and therefore determines the node corresponding to the cafeteria scenario as the starting node. The server obtains all adjacent nodes connected to the starting node and the edge connection weight values ​​corresponding to each adjacent node. The cafeteria scenario node is connected to four adjacent nodes: the edge connection weight of the supermarket scenario node is 0.548, the edge connection weight of the bath scenario node is 0.512, the edge connection weight of the school hospital scenario node is 0.467, and the edge connection weight of the library scenario node is 0.398.

[0052] The server performs a normalization scaling operation on the edge connection weights. Specifically, the server calculates the sum of all edge connection weights as 0.548 + 0.512 + 0.467 + 0.398 = 1.925. Then, it divides each edge connection weight by the sum of 1.925 to obtain the state transition probability values ​​from the starting node to each adjacent node: the probability of transitioning to the supermarket scenario is 0.548 divided by 1.925 = 0.285, the probability of transitioning to the bathhouse scenario is 0.512 divided by 1.925 = 0.266, the probability of transitioning to the school hospital scenario is 0.467 divided by 1.925 = 0.243, and the probability of transitioning to the library scenario is 0.398 divided by 1.925 = 0.207. The sum of the above four state transition probability values ​​is 1.001, with a slight error due to rounding.

[0053] The server uses the starting node as the search origin and performs a breadth-first search. In the first search iteration, the server compares the state transition probabilities of its four neighboring nodes and selects the supermarket scene node corresponding to the maximum value of 0.285 as the next access node. The supermarket scene node is added to the path node sequence, and the current path node sequence is [cafeteria scene, supermarket scene]. The server multiplies the state transition probability value of the supermarket scene node (0.285) to the total path probability value, which is initially 1 and multiplied to 0.285.

[0054] In the second search iteration, the server takes the supermarket scene node as the current node and obtains all adjacent nodes connected to the supermarket scene node. The supermarket scene connects to the cafeteria scene, bathhouse scene, library scene, and school hospital scene, with corresponding edge connection weights of 0.548, 0.435, 0.502, and 0.389, respectively. The server performs a normalized scaling transformation on the above edge connection weights, with a sum of 1.874, and calculates the state transition probabilities to be 0.292, 0.232, 0.268, and 0.208, respectively. The server selects the cafeteria scene node corresponding to the maximum value of 0.292 as the next access node; however, the cafeteria scene node has already appeared in the path node sequence. To avoid path loops, the server selects the library scene node corresponding to the second largest value of 0.268 as the access node and adds the library scene node to the path node sequence. The current path node sequence is [cafeteria scene, supermarket scene, library scene]. The server multiplies the state transition probability value of the library scene node, 0.268, into the total path probability value, and updates the total path probability value to 0.285 multiplied by 0.268, which equals 0.076.

[0055] When the length of the path node sequence reaches the preset path length threshold of 3, the server terminates the width-first search operation; the server arranges the consumption scenario type tags corresponding to all nodes in the current path node sequence in order to generate a high-probability consumption scenario tag sequence [canteen, supermarket, library].

[0056] Furthermore, after the consumption tendency prediction operation outputs consumption tendency data for a single student, it obtains target value assessment scenario data for campus card consumption behavior in the campus setting. The target value assessment scenario data includes the scenario value weight coefficient and scenario influencing factor set for each consumption scenario. The scenario influencing factor set includes at least the population density factor, the time period busyness factor, and the service carrying capacity factor of the consumption scenario. A weighted fusion operation is performed on the consumption tendency data and the target value assessment scenario data. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data, and obtains the weighted consumption scenario label sequence. The scenario-adaptive adjustment operation is performed on the weighted consumer scenario label sequence using the scenario-influence factor set. The scenario-adaptive adjustment operation adds a scenario-adaptive adjustment coefficient to each consumer scenario label and outputs the adjusted consumer behavior parameters, which include the adjusted scenario label sequence and the adjusted consumption time window.

[0057] In this embodiment, after the consumption tendency prediction operation outputs consumption tendency data for a single student, the server sends a request to obtain target value assessment scenario data. This request is sent through an internal RESTful API interface, and the request parameters include a set of scenario identifiers for five consumption scenarios [canteen, market, bath, library, clinic].

[0058] Scenario Value Weighting Coefficients: These are pre-set by the campus management department based on the importance of each consumption scenario in the talent cultivation evaluation system and are updated annually. The sum of the weighting coefficients is 1. For example, the cafeteria scenario reflects students' basic living needs and has the highest weight; the library scenario reflects students' engagement in learning and has the next highest weight; scenarios such as bathhouses, supermarkets, and the campus hospital have relatively lower weights.

[0059] People density factor: The ratio of the average hourly people flow in each scene during the same time period in real time over the past 7 days to the preset benchmark value (such as the number of people served per hour of the scene's design capacity) is calculated and updated every day at midnight.

[0060] Busyness factor during different time periods: determined based on the rate of change of queue length in different consumption scenarios at different time periods. The average queue length of each time period (in 30-minute increments) over the past 7 days is statistically analyzed in real time. The rate of change of queue length between off-peak and peak hours is calculated and updated every day at midnight.

[0061] Service capacity factor: determined based on the ratio of the number of currently available service windows / devices to the total number of service windows / devices in each consumption scenario. The availability status of service resources in each scenario is checked periodically and updated once per hour.

[0062] The server receives the target value assessment scenario data returned. The returned data is in JSON format and contains the scenario value weight coefficients and scenario influencing factor set for each consumption scenario. After parsing, the scenario value weight coefficients are: 0.35 for the cafeteria scenario, 0.25 for the supermarket scenario, 0.10 for the bathhouse scenario, 0.20 for the library scenario, and 0.10 for the school hospital scenario. The sum of these weight coefficients is 1.00. The scenario influencing factor set includes three factors: traffic density factor, time period busyness factor, and service carrying capacity factor. The traffic density factor for the cafeteria scenario is 0.82 (based on an average of 8.2 people served per minute during the lunch peak period), the time period busyness factor is 0.75 (based on the rate of change in queue length during different time periods, with the queue length changing from an average of 2 people during off-peak periods to an average of 12 people during peak periods, a change rate of 6 people), and the service carrying capacity factor is 0.90 (based on the fact that there are 9 available service windows and a total of 10 service windows in this scenario, with a ratio of 0.90). The pedestrian density factor for a supermarket is 0.55, the peak hour factor is 0.60, and the service capacity factor is 0.85. For a bathhouse, the pedestrian density factor is 0.40, the peak hour factor is 0.50, and the service capacity factor is 0.70. For a library, the pedestrian density factor is 0.70, the peak hour factor is 0.45, and the service capacity factor is 0.95. For a school hospital, the pedestrian density factor is 0.30, the peak hour factor is 0.35, and the service capacity factor is 0.60.

[0063] The server performs a weighted fusion operation on the consumer preference data and the target value assessment scenario data. The high-probability consumption scenario label sequence in the consumer preference data is [canteen, supermarket, library], and the corresponding sequence position weights are set as follows: first position weight 0.50, second position weight 0.30, and third position weight 0.20, respectively. The server uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the consumer preference data: the original sequence position weight of the canteen scenario is 0.50, multiplied by the scenario value weight coefficient of the canteen scenario 0.35, resulting in a weight adjustment value of 0.175; the original sequence position weight of the supermarket scenario is 0.30, multiplied by the scenario value weight coefficient of the supermarket scenario 0.25, resulting in a weight adjustment value of 0.075; the original sequence position weight of the library scenario is 0.20, multiplied by the scenario value weight coefficient of the library scenario 0.20, resulting in a weight adjustment value of 0.040. The server re-normalizes the weighted values, and the sum is 0.175 plus 0.075 plus 0.040 equals 0.290. After normalization, the corrected weight for the canteen scene is 0.603, for the supermarket scene it is 0.259, and for the library scene it is 0.138, thus obtaining the weighted consumer scene label sequence.

[0064] The server uses a set of scene influence factors to perform scene-adaptive adjustments on the weighted consumer scene label sequence. For the cafeteria scene, the server weights and sums the pedestrian density factor (0.82), the time-of-day busyness factor (0.75), and the service carrying capacity factor (0.90) according to predetermined proportional coefficients. The predetermined proportional coefficients are set to 0.30, 0.40, and 0.30, respectively, resulting in a scene-adaptive adjustment base of 0.816. The server then maps this base to a preset adjustment coefficient range of 0.80 to 1.2. Within 0, the mapping method is to multiply the base 0.816 by 0.40 and add 0.80 to obtain a scene adaptability adjustment coefficient of 1.126; the server appends the adjustment coefficient 1.126 to the canteen scene label to form a scene label item canteen (1.126) with adjustment coefficient; the server calculates the adjustment coefficient of the supermarket scene in the same way as 1.064; the adjustment coefficient of the library scene is 1.070; the server traverses all scene labels to complete the append operation and generates the adjusted scene label sequence [canteen (1.126), supermarket (1.064), library (1.070)].

[0065] The server adjusts the time period boundaries in the predicted consumption time period label sequence based on the time period busyness factor corresponding to each consumption scenario label in the adjusted scenario label sequence. The predicted consumption time period label sequence is 11:30-12:30. The time period busyness factor of the canteen scenario is 0.75, which is higher than the busy threshold of 0.60. The server determines that the scenario is busy within the predicted time period, adjusts the start time of the time period forward by 15 minutes to 11:15, and the end time backward by 10 minutes to 12:40, generating an adjusted consumption time window of 11:15-12:40.

[0066] Furthermore, target value assessment scenario data of campus card consumption behavior in the campus setting is obtained. The target value assessment scenario data includes the scenario value weight coefficient of each consumption scenario and the set of scenario influencing factors. The set of scenario influencing factors includes at least the population density factor of the consumption scenario, the time period busyness factor of the consumption scenario, and the service carrying capacity factor of the consumption scenario. A weighted fusion operation is performed on the consumption tendency data and the target value assessment scenario data. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data, and obtains the weighted consumption scenario label sequence. Reference Figure 3 The system utilizes a set of scenario influence factors to perform scenario-adaptive adjustment on the weighted consumer scenario label sequence, attaching a scenario-adaptive adjustment coefficient to each consumer scenario label and outputting adjusted consumer behavior parameters, including the adjusted scenario label sequence and the adjusted consumption time window. Specifically, this includes: Send a target value assessment scenario data acquisition request, which carries a set of scenario identifiers for multiple smart card consumption scenarios; Receive the returned target value assessment scenario data, parse the target value assessment scenario data, and extract the scenario value weight coefficient, traffic density factor, time period busyness factor and service carrying capacity factor corresponding to each consumption scenario; For each consumption scenario tag in the high-probability consumption scenario tag sequence, obtain the corresponding scenario value weight coefficient, multiply it by the sequence position weight of the consumption scenario tag in the high-probability consumption scenario tag sequence, and obtain the weight correction value of the consumption scenario tag to replace the original weight value, thus obtaining the weight correction consumption scenario tag sequence. Each consumption scenario label in the weighted consumption scenario label sequence is combined with the corresponding consumption scenario's traffic density factor, time period busyness factor, and service carrying capacity factor to obtain the scenario adaptive adjustment base. Perform a threshold mapping operation on the scene adaptation adjustment base to map the scene adaptation adjustment base to a preset range of adjustment coefficient values ​​to obtain the scene adaptation adjustment coefficient; The scene adaptability adjustment coefficient is attached to the corresponding consumption scene label to form a scene label item with the adjustment coefficient; Iterate through all consumption scenario tags in the weighted consumption scenario tag sequence, complete the additional operations for all scenario tag items, and generate the adjusted scenario tag sequence; Based on the busyness factor of each consumption scenario label in the adjusted scenario label sequence, the time period boundaries in the predicted consumption time period label sequence are contracted or expanded to generate an adjusted consumption time window.

[0067] In this embodiment, the server sends a request to obtain target value assessment scenario data. The request is sent through an internal RESTful API interface. The request message body is in JSON format and contains a set of scenario identifiers for five consumption scenarios ["canteen", "market", "bath", "library", "clinic"], as well as the request timestamp field "2026-08-14 11:30:00".

[0068] The server receives the target value assessment scenario data returned in response to the above request. The returned data is in JSON format, which the server parses. After parsing, the server extracts the scenario value weight coefficients corresponding to each consumption scenario: 0.35 for the cafeteria scenario, 0.25 for the supermarket scenario, 0.10 for the bathhouse scenario, 0.20 for the library scenario, and 0.10 for the campus hospital scenario. The magnitude of the scenario value weight coefficient represents the importance of the corresponding consumption scenario in the overall campus consumption behavior analysis system. The cafeteria scenario has the highest weight because cafeteria consumption is the most frequent daily consumption behavior of students, covering all student groups on campus; the library scenario has a weight of 0.20 because library visits reflect students' study habits and learning engagement; the supermarket and campus hospital scenarios have relatively low weights because the consumption frequency and coverage of these scenarios are limited.

[0069] The server extracts the pedestrian density factor corresponding to each consumption scenario. This factor is determined based on the average number of people served in each consumption scenario per unit of time. For the cafeteria scenario, the average number of people served during the lunch peak (11:00-13:00) is 492 per hour. Using 500 people per hour as a baseline, the pedestrian density factor is 492 divided by 500, which equals 0.984, rounded to two decimal places, resulting in 0.98. For the supermarket scenario, the average number of people served during the peak business hours (17:00-19:00) is 165 per hour. Using 300 people per hour as a baseline, the factor is 0.55. For the bathhouse scenario, the average number of people served during the evening peak hours (21:00-23:00) is 120 per hour. Using 300 people per hour as a baseline, the factor is 0.40. For the library scenario, the average number of visitors during the morning hours (09:00-11:00) is 280 per hour. Using 400 people per hour as a baseline, the factor is 0.70. The average number of patients served by the school hospital during the morning consultation period (09:00-11:00) is 45 per hour. Based on a baseline of 150 per hour, the factor is 0.30.

[0070] The server extracts the time-based busyness factor for each consumption scenario. This factor is determined based on the rate of change of queue length in different time periods for each consumption scenario. In the canteen scenario, the average queue length is 2 people during off-peak hours (14:00-16:00) and 14 people during peak hours (11:30-12:30), with a queue length change rate of 12 people. Based on the maximum possible change rate of 16 people, the time-based busyness factor is 12 divided by 16, which equals 0.75. In the supermarket scenario, the queue length is 1 person during off-peak hours and 7 people during peak hours, with a change rate of 6 people. Based on the baseline of 10 people, the factor is calculated to be 0.60. In the shower area, the queue length during off-peak hours is 0 people, while the queue length during peak hours is 5 people, with a variation rate of 5 people. The factor is calculated based on a baseline of 10 people and is 0.50. In the library area, the queue length during off-peak hours is 1 person, while the queue length during peak hours is 6 people, with a variation rate of 5 people. The factor is calculated based on a baseline of 11 people and is 0.45. In the school hospital area, the queue length during off-peak hours is 0 people, while the queue length during peak hours is 4 people, with a variation rate of 4 people. The factor is calculated based on a baseline of 11 people and is 0.36, rounded to two decimal places.

[0071] The server extracts the service capacity factor corresponding to each consumption scenario. This factor is determined based on the ratio of the number of available service windows to the total number of service windows in each consumption scenario. For the cafeteria scenario, there are 9 available service windows out of a total of 10, resulting in a ratio of 0.90. For the supermarket scenario, there are 4 available cash registers out of a total of 5 (one of which is temporarily unavailable due to maintenance), resulting in a ratio of 0.80 (rounded to two decimal places). For the shower scenario, there are 28 available shower heads out of a total of 40 (some are temporarily unavailable due to malfunction), resulting in a ratio of 0.70. For the library scenario, there are 6 available entrance / exit turnstiles out of a total of 7 (one is closed for maintenance), resulting in a ratio of 0.86 (rounded to two decimal places). For the school hospital scenario, there are 2 available registration windows out of a total of 3 (one window is closed due to insufficient staff), resulting in a ratio of 0.67 (rounded to two decimal places).

[0072] For each consumption scenario tag in the high-probability consumption scenario tag sequence, the server obtains the scenario value weight coefficient corresponding to that consumption scenario tag. The high-probability consumption scenario tag sequence is ["canteen", "supermarket", "library"], with corresponding scenario value weight coefficients of 0.35, 0.25, and 0.20, respectively. The sequence position weights are set as follows: 0.50 for the first position, 0.30 for the second position, and 0.20 for the third position. The server multiplies the scenario value weight coefficients by the sequence position weights: 0.35 multiplied by 0.50 equals 0.175 for the canteen scenario, 0.25 multiplied by 0.30 equals 0.075 for the supermarket scenario, and 0.20 multiplied by 0.20 equals 0.040 for the library scenario. The server uses the above product value to replace the original weight value of the corresponding consumption scenario tag, obtaining the weight-corrected consumption scenario tag sequence [canteen (0.175), supermarket (0.075), library (0.040)].

[0073] The server sequentially combines each consumption scenario label in the weighted consumption scenario label sequence with the corresponding consumption scenario's pedestrian flow density factor, time-of-day busyness factor, and service capacity factor. The combination operation involves weighting and summing these three factors according to predetermined coefficients: 0.30, 0.40, and 0.30. For the cafeteria scenario, the combination result is 0.98 x 0.30 + 0.75 x 0.40 + 0.90 x 0.30 = 0.294 + 0.300 + 0.270 = 0.864. For the supermarket scenario, it's 0.55 x 0.30 + 0.60 x 0.40 + 0.80 x 0.30 = 0.165 + 0.240 + 0.240 = 0.645. The library scene is calculated as follows: 0.70 multiplied by 0.30 plus 0.45 multiplied by 0.40 plus 0.86 multiplied by 0.30 equals 0.210 plus 0.180 plus 0.258 equals 0.648.

[0074] The server performs a threshold mapping operation on the adaptive adjustment base for the above scenarios. The preset adjustment coefficient range is 0.80 to 1.20. The mapping method is to multiply the base by 0.40 and add 0.80. The adjustment coefficient for the canteen scenario is 0.864 multiplied by 0.40 and added by 0.80, which equals 1.146. The adjustment coefficient for the supermarket scenario is 0.645 multiplied by 0.40 and added by 0.80, which equals 1.058. The adjustment coefficient for the library scenario is 0.648 multiplied by 0.40 and added by 0.80, which equals 1.059. The server attaches the above scenario adaptive adjustment coefficients to the corresponding consumption scenario tags to form scenario tag items with adjustment coefficients: the canteen tag is attached with an adjustment coefficient of 1.146, the supermarket tag is attached with an adjustment coefficient of 1.058, and the library tag is attached with an adjustment coefficient of 1.059. The server traverses all consumption scenario tags in the weighted consumption scenario tag sequence, completes the attachment operation of all scenario tag items, and generates the adjusted scenario tag sequence [canteen (1.146), supermarket (1.058), library (1.059)].

[0075] The server adjusts the time period boundaries in the predicted consumption time period label sequence based on the time period busyness factor corresponding to each consumption scenario label in the adjusted scenario label sequence, performing either contraction or expansion operations. The predicted consumption time period label sequence is "11:30-12:30"; the time period busyness factor for the cafeteria scenario is 0.75, for the supermarket scenario it's 0.60, and for the library scenario it's 0.45; the server calculates the average of the three scenario time period busyness factors as (0.75 + 0.60 + 0.45) divided by 3, which equals 0.60; this average is equal to the preset busyness threshold of 0.60, so the server determines that this time period is in a moderately busy state, and does not make significant adjustments to the time period boundaries, only delaying the start time by 5 minutes to 11:35 and advancing the end time by 5 minutes to 12:25, generating the adjusted consumption time window "11:35-12:25".

[0076] Furthermore, after outputting the adjusted consumption behavior parameters, a consumption behavior quality correlation matrix is ​​constructed based on the adjusted scenario label sequence and the adjusted consumption time window. The row index of the consumption behavior quality correlation matrix is ​​each consumption scenario label, and the column index of the consumption behavior quality correlation matrix is ​​each consumption time period label. The matrix elements of the consumption behavior quality correlation matrix are determined by the product of the scenario adaptability adjustment coefficient under the corresponding consumption scenario label and the time adaptability coefficient under the corresponding consumption time period label. Perform row vector analysis on the consumer behavior quality correlation matrix, calculate the row vector magnitude of each row vector, and use the row vector magnitude as the basic score of behavior quality for the corresponding consumption scenario in that row; perform column vector analysis on the consumer behavior quality correlation matrix, calculate the column vector magnitude of each column vector, and use the column vector magnitude as the basic score of behavior time adaptation for the corresponding consumption time period in that column. Perform cross-matching operation between the basic behavioral quality score corresponding to each consumption scenario and the basic behavioral time adaptation score corresponding to each consumption time period. Then, weight the basic behavioral quality score and the basic behavioral time adaptation score according to the scenario-time period pairing relationship to output the reference quality score of each consumption scenario under each consumption time period.

[0077] In this embodiment, after the server outputs the adjusted consumption behavior parameters, it constructs a consumption behavior quality correlation matrix based on the adjusted scene label sequence and the adjusted consumption time window. The adjusted scene label sequence is [canteen (1.146), supermarket (1.058), library (1.059)], from which the scene label list is extracted as ["canteen", "supermarket", "library"], which serves as the row index of the matrix. The adjusted consumption time window is "11:35-12:25", and the server divides this time window into 5 consumption time period labels in 10-minute intervals: "11:35-11:45", "11:45-11:55", "11:55-12:05", "12:05-12:15", and "12:15-12:25", which serve as the column index of the matrix.

[0078] The server calculates the elements of the consumer behavior quality correlation matrix. Each element is determined by the product of the scenario adaptability adjustment coefficient under the corresponding consumption scenario label and the time adaptability coefficient under the corresponding consumption time period label. The time adaptability coefficient is calculated as follows: for each consumption time period label, the server calculates the degree of matching between that time period and the time period busyness factor of each consumption scenario. The time period busyness factor for the canteen scenario is 0.75. During the time period "11:35-11:45", the canteen is in the beginning stage of the lunch peak, and the time adaptability coefficient is set to 0.90; during "11:45-11:55", it is 0.95; during "11:55-12:05", it is 1.00; during "12:05-12:15", it is 0.85; and during "12:15-12:25", it is 0.70. The peak time factor for the supermarket scenario is 0.60, with adaptation coefficients of 0.70, 0.80, 0.85, 0.90, and 0.85 for each time period. The peak time factor for the library scenario is 0.45, with adaptation coefficients of 0.60, 0.65, 0.70, 0.75, and 0.80 for each time period.

[0079] The server calculates the matrix element values. The adjustment coefficient for the canteen scene tag is 1.146, which, when multiplied by the adaptation coefficients for the five time periods, yields five element values: 1.146 multiplied by 0.90 equals 1.031, 1.146 multiplied by 0.95 equals 1.089, 1.146 multiplied by 1.00 equals 1.146, 1.146 multiplied by 0.85 equals 0.974, and 1.146 multiplied by 0.70 equals 0.802. The adjustment coefficient for the supermarket scene tag is 1.058, with element values ​​of: 1.058 multiplied by 0.70 equals 0.741, 1.058 multiplied by 0.80 equals 0.846, 1.058 multiplied by 0.85 equals 0.899, 1.058 multiplied by 0.90 equals 0.952, and 1.058 multiplied by 0.85 equals 0.899. The adjustment factor for the library scene label is 1.059, and the element values ​​are: 1.059 multiplied by 0.60 equals 0.635, 1.059 multiplied by 0.65 equals 0.688, 1.059 multiplied by 0.70 equals 0.741, 1.059 multiplied by 0.75 equals 0.794, and 1.059 multiplied by 0.80 equals 0.847. The server fills the above element values ​​into a 3x5 matrix to complete the construction of the consumer behavior quality correlation matrix.

[0080] The server performs row vector analysis on the consumer behavior quality correlation matrix; the row vector consists of all the element values ​​in each row of the matrix. The row vector for the cafeteria scenario is [1.031, 1.089, 1.146, 0.974, 0.802]. The server calculates the row vector magnitude of this vector, which is calculated as the square root of the sum of the squares of each element: the square of 1.031 is 1.063, the square of 1.089 is 1.186, the square of 1.146 is 1.313, the square of 0.974 is 0.949, and the square of 0.802 is 0.643. The sum of these five terms is 5.154, and the square root is 2.270, which serves as the basic score for the behavior quality in the cafeteria scenario. The row vector for the supermarket scenario is [0.741, 0.846, 0.899, 0.952, ...]. The squared values ​​for the supermarket scene are [0.899], 0.549, 0.716, 0.808, 0.906, and 0.808, respectively. The sum of the five terms is 3.787, and the square root is 1.946, which is used as the basic score for behavior quality in the supermarket scene. The row vector for the library scene is [0.635, 0.688, 0.741, 0.794, 0.847], with squared values ​​of 0.403, 0.473, 0.549, 0.630, and 0.717, respectively. The sum of the five terms is 2.772, and the square root is 1.665, which is used as the basic score for behavior quality in the library scene.

[0081] The server performs column vector analysis on the consumer behavior quality correlation matrix; the column vector is all the element values ​​in each column of the matrix. The column vector of the first column (11:35-11:45) is [1.031, 0.741, 0.635], with square values ​​of 1.063, 0.549, and 0.403 respectively. The sum of the three terms is 2.015, and the square root is 1.420, which is used as the basic score for the behavior time adaptation for the corresponding consumption time period in this column. The column vector for the second column (11:45-11:55) is [1.089, 0.846, 0.688], with square values ​​of 1.186, 0.716, and 0.473 respectively. The sum of the three terms is 2.375, and the square root is 1.541. The column vector for the third column (11:55-12:05) is [1.146, 0.899, 0.741], with square values ​​of 1.313, 0.808, and 0.549 respectively. The sum of the three terms is 2.670, and the square root is 1.634. The column vector for the fourth column (12:05-12:15) is [0.974, 0.952, 0.794], with squared values ​​of 0.949, 0.906, and 0.630 respectively. The sum of these three terms is 2.485, and the square root is 1.576. The column vector for the fifth column (12:15-12:25) is [0.802, 0.899, 0.847], with squared values ​​of 0.643, 0.808, and 0.717 respectively. The sum of these three terms is 2.168, and the square root is 1.472.

[0082] The server performs a cross-matching operation between the baseline behavioral quality score for each consumption scenario and the baseline behavioral time adaptation score for each consumption time period. The cross-matching operation involves weighting the baseline behavioral quality score and the baseline behavioral time adaptation score according to the scenario-time period pairing relationship. For the cafeteria scenario pairing in the third time period (11:55-12:05), the server multiplies the cafeteria scenario's baseline behavioral quality score (2.270) with the third time period's baseline behavioral time adaptation score (1.634) to obtain 3.709, which is used as the reference quality score for that scenario in that time period. The server calculates the reference quality scores for all pairings in the same way and outputs the reference quality score matrix for each consumption scenario in each consumption time period.

[0083] Furthermore, after outputting the reference quality scores for each consumption scenario under each consumption time period, a video acquisition device deployment topology map of the campus card consumption scenario is obtained. The video acquisition device deployment topology map includes the device location nodes and device coverage boundaries of the video acquisition devices in each consumption scenario. A consumer behavior acquisition correlation matrix is ​​constructed based on the deployment topology of video acquisition devices and the correlation matrix of consumer behavior quality. The row index is the identifier of each video acquisition device, and the column index is the label of each consumer scenario. The matrix elements of the consumer behavior collection association matrix are determined by the product of the coverage overlap coefficient of the corresponding video collection device to the corresponding consumption scene and the reference quality score of the corresponding consumption scene. The coverage overlap coefficient is calculated based on the ratio of the intersection area of ​​the device coverage boundary and the physical space boundary of the consumption scene to the total physical space area of ​​the consumption scene. Perform a row summation operation on the consumer behavior collection association matrix to obtain the comprehensive collection coverage value of each video collection device, and perform a column summation operation on the consumer behavior collection association matrix to obtain the comprehensive scene coverage value of each consumption scenario; The comprehensive coverage values ​​are sorted in descending order to obtain the priority sequence of video acquisition devices, and the comprehensive scene coverage values ​​are sorted in ascending order to obtain the priority sequence of consumer scene acquisition needs. Based on the priority sequence of video acquisition devices and the priority sequence of acquisition needs in consumption scenarios, the acquisition reference score of each video acquisition device in each consumption scenario is calculated. The acquisition reference score is the ratio of the comprehensive acquisition coverage value of the video acquisition device to the comprehensive scene coverage value of the corresponding consumption scenario.

[0084] In this embodiment, after the server outputs the reference quality scores for each consumption scenario under each consumption time period, it obtains the deployment topology map of the video acquisition devices for the campus card consumption scenario; the server sends a request to the topology service module already deployed on campus, the request parameters of which include scenario identifiers for the five consumption scenarios; the topology service module returns the deployment topology data of the video acquisition devices, which describes the device location nodes and device coverage boundaries of the video acquisition devices in each consumption scenario in a graphical structure.

[0085] The server parses the topology data to obtain information on video capture devices for each consumption scenario. In the canteen scenario, four cameras are deployed, identified as CAM-C01, CAM-C02, CAM-C03, and CAM-C04. The location coordinates of each device are (23.5m, 12.8m), (23.5m, 27.2m), (76.5m, 12.8m), and (76.5m, 27.2m), respectively. The coverage area of ​​the devices is a circular area with a radius of 6 meters centered on the device location. Two cameras were deployed in the supermarket scene, identified as CAM-M01 and CAM-M02, with location coordinates of (5.2m, 3.8m) and (5.2m, 16.2m) respectively, both with a coverage radius of 5m. One camera was deployed in the shower scene, identified as CAM-B01, with location coordinates of (3.5m, 2.0m) and a coverage radius of 4m. Three cameras were deployed in the library scene, identified as CAM-L01, CAM-L02, and CAM-L03, with location coordinates of (2.0m, 1.5m), (2.0m, 8.5m), and (2.0m, 15.5m) respectively, all with a coverage radius of 5m. One camera was deployed in the school hospital scene, identified as CAM-CL01, with location coordinates of (2.0m, 1.8m) and a coverage radius of 4m.

[0086] The server constructs a consumer behavior acquisition correlation matrix based on the deployment topology of video acquisition devices and the consumer behavior quality correlation matrix. The row index of the consumer behavior acquisition correlation matrix is ​​the identifier of each video acquisition device, with a total of 11 device identifiers: CAM-C01 to CAM-C04, CAM-M01 to CAM-M02, CAM-B01, CAM-L01 to CAM-L03, and CAM-CL01. The column index is the label of each consumer scenario, with a total of 5 labels: canteen, supermarket, bathhouse, library, and school hospital. The matrix elements are determined by the product of the coverage overlap coefficient of the corresponding video acquisition device to the corresponding consumer scenario and the reference quality score of the corresponding consumer scenario.

[0087] The coverage overlap coefficient is calculated as follows: the ratio of the area where the boundary of the device's coverage area intersects with the boundary of the physical space of the consumption scene to the total area of ​​the physical space of the consumption scene; the physical space of the canteen scene is a rectangular area with a length of 100 meters and a width of 40 meters, with a total area of ​​4000 square meters; the CAM-C01 device is located inside the canteen scene, and the area where its coverage circular area intersects with the boundary of the canteen scene is 113 square meters (the area of ​​the circle is π multiplied by 6 squared, which equals 113), and the coverage overlap coefficient is 113 divided by 4000, which equals 0.028. The coverage overlap coefficient of CAM-C02 is also 0.028; the physical space of the supermarket scene is a square area with a length of 20 meters and a width of 20 meters, with a total area of ​​400 square meters; the intersection area of ​​the circular coverage area of ​​CAM-M01 with the boundary of the supermarket scene is 78.5 square meters, and the coverage overlap coefficient is 78.5 divided by 400, which equals 0.196; the physical space of the bath scene is a rectangular area with a length of 15 meters and a width of 8 meters, with a total area of ​​120 square meters; the intersection area of ​​the circular coverage area of ​​CAM-B01 with the boundary of the bath scene is 50.3 square meters (π multiplied by 4 squared), and the coverage overlap coefficient is 50. 3 divided by 120 equals 0.419; the physical space of the library scene is a rectangular area 30 meters long and 20 meters wide, with a total area of ​​600 square meters; the intersection area of ​​the CAM-L01's coverage circular area with the boundary of the library scene is 78.5 square meters, and the coverage overlap coefficient is 78.5 divided by 600 equals 0.131; the physical space of the school hospital scene is a rectangular area 12 meters long and 10 meters wide, with a total area of ​​120 square meters; the intersection area of ​​the CAM-CL01's coverage circular area with the boundary of the school hospital scene is 50.3 square meters, and the coverage overlap coefficient is 50.3 divided by 120 equals 0.419.

[0088] The server multiplies the coverage overlap coefficient of each device with the reference quality score of the corresponding consumption scenario to obtain the matrix element value. Taking the pairing of CAM-C01 device with the canteen scenario as an example, the coverage overlap coefficient is 0.028, and the reference quality score of the canteen scenario in the third time period (11:55-12:05) is 3.709, with a product of 0.104. The server calculates the pairing element value of all devices and all scenarios in the same way to complete the construction of the consumption behavior collection association matrix.

[0089] The server performs a row summation operation on the consumer behavior collection association matrix to obtain the comprehensive collection coverage value of each video collection device. The row vector element of CAM-C01 is the sum of the collection association values ​​of this device for all five scenes. Assuming that the value of CAM-C01 for the canteen scene is 0.104, for the supermarket scene is 0.015, for the bath scene is 0.008, for the library scene is 0.022, and for the school hospital scene is 0.005, the row sum is 0.154; the row sum of CAM-C02 is 0.148, CAM-C03 is 0.156, CAM-C04 is 0.150, CAM-M01 is 0.320, CAM-M02 is 0.305, CAM-B01 is 0.180, CAM-L01 is 0.260, CAM-L02 is 0.255, CAM-L03 is 0.250, and CAM-CL01 is 0.175.

[0090] The server performs a column summation operation on the consumer behavior collection association matrix to obtain the comprehensive scenario coverage value for each consumption scenario. The column summation for the cafeteria scenario is the sum of the collection association values ​​of all devices in that scenario, assumed to be 0.104 + 0.098 + 0.106 + 0.102 = 0.410. The column summation for the supermarket scenario is 0.320 + 0.305 = 0.625. The column summation for the bathhouse scenario is 0.180. The column summation for the library scenario is 0.260 + 0.255 + 0.250 = 0.765. The column summation for the school hospital scenario is 0.175.

[0091] The server sorts the comprehensive coverage values ​​in descending order to obtain the priority sequence of video acquisition devices: CAM-M01 (0.320), CAM-M02 (0.305), CAM-L01 (0.260), CAM-L02 (0.255), CAM-L03 (0.250), CAM-B01 (0.180), CAM-CL01 (0.175), CAM-C03 (0.156), CAM-C01 (0.154), CAM-C04 (0.150), CAM-C02 (0.148). The server then sorts the comprehensive scene coverage values ​​in ascending order to obtain the priority sequence of consumer scene acquisition needs: bathhouse scene (0.180), school hospital scene (0.175), cafeteria scene (0.410), supermarket scene (0.625), and library scene (0.765).

[0092] Based on the priority sequence of video capture devices and the priority sequence of capture requirements for consumption scenarios, the server calculates the capture reference score for each video capture device in each consumption scenario. The capture reference score is the ratio of the comprehensive capture coverage value of the video capture device to the comprehensive scene coverage value of the corresponding consumption scenario. Taking the capture reference score of the CAM-M01 device in the supermarket scenario as an example, the comprehensive capture coverage value of CAM-M01 is 0.320, and the comprehensive scene coverage value of the supermarket scenario is 0.625, with a ratio of 0.512. The capture reference score of CAM-L01 in the library scenario is 0.260 divided by 0.765, which equals 0.340. The capture reference score of CAM-C01 in the cafeteria scenario is 0.154 divided by 0.410, which equals 0.376. The server calculates the capture reference score for all device-scenario pairs in the same way.

[0093] Furthermore, after calculating the acquisition reference score for each video acquisition device in each consumption scenario, the acquisition strategy adjustment operation is performed on multiple consumption behavior video streams based on the acquisition reference score of each video acquisition device in each consumption scenario. The acquisition strategy adjustment operation includes the following steps: The acquisition reference score of each video acquisition device is compared with the preset acquisition score threshold. When the acquisition reference score of a certain video acquisition device in a certain consumption scenario is higher than the acquisition score threshold, the video acquisition frame rate of the video acquisition device in that consumption scenario is adjusted to the first frame rate value, and the image resolution of the video acquisition device in that consumption scenario is adjusted to the first resolution value. When the reference score of a video capture device in a certain consumption scenario is lower than or equal to the capture score threshold, the video capture frame rate of the video capture device in that consumption scenario is adjusted to the second frame rate value, and the image resolution of the video capture device in that consumption scenario is adjusted to the second resolution value. Multiple consumer behavior video streams were re-acquired based on the adjusted video capture frame rate and adjusted image resolution to obtain multiple optimized video data streams. Multiple optimized video data points are input into the YOLO object detection model to perform secondary object detection operations, thereby obtaining secondary detection consumption behavior records. Perform a difference comparison operation between the secondary detection consumer behavior records and multiple structured consumer behavior records, and update the consumer behavior quality association matrix and the consumer behavior collection association matrix based on the results of the difference comparison operation.

[0094] In this embodiment, a baseline of concurrent pedestrian traffic based on historical data is introduced during the difference comparison operation. Specifically, the historical 7-day average number of detection records for the same week and time period as the current adjustment period (e.g., Tuesday, 11:30-12:30 this week) is selected as the baseline value B. The difference between the number of secondary detection records D2 and the number of initial detection records D1 is Δ = (D2-D1)-(B2-B1), where B1 is the historical baseline value for the time period corresponding to D1, and B2 is the historical baseline value for the time period corresponding to D2, representing the net difference after excluding natural fluctuations over time. When the net difference is positive, it indicates that the improvement in the collection parameters has indeed brought additional detection benefits.

[0095] The update coefficient of 1.05 is a statistical learning result based on historical data. Specifically, during the initial deployment phase, multiple sets of control experiments (keeping the scene conditions unchanged and only adjusting the acquisition parameters) were used to establish a mapping relationship between "changes in acquisition parameters and changes in detection records," and the update coefficient was obtained through linear regression fitting. In the absence of historical data, a conservative value of 1.05 was used by default, and it was gradually optimized based on actual feedback in subsequent updates.

[0096] Instead of unconditionally performing closed-loop updates after each adjustment of the acquisition strategy, updates are stopped when the following convergence conditions are met: (1) the difference in the Frobenius norm of the consumer behavior quality correlation matrix between two consecutive updates is less than a predetermined threshold (e.g., 0.01); (2) or the number of update iterations reaches the maximum number of iterations (e.g., 5). The matrix difference value is calculated after each update. When the difference value is less than the threshold, the system is determined to have converged, subsequent update operations are stopped, and the system enters the steady-state acquisition phase.

[0097] After the server calculates the reference scores for each video capture device in each consumption scenario, it performs capture strategy adjustment operations on multiple consumption behavior video streams based on the reference scores for each video capture device in each consumption scenario.

[0098] The first step involves the server comparing the acquisition reference score of each video acquisition device with a preset acquisition score threshold, which is set to 0.350. For the CAM-M01 device in the supermarket scenario, the acquisition reference score is 0.512, which is higher than 0.350, indicating that the server determines this device requires high-precision acquisition in this scenario. For the CAM-L01 device in the library scenario, the acquisition reference score is 0.340, which is lower than 0.350, indicating that the server determines this device can use a lower-precision acquisition strategy in this scenario. For the CAM-C01 device in the cafeteria scenario, the acquisition reference score is 0.376, which is higher than 0.350, indicating a high-precision acquisition requirement. For the CAM-B01 device in the bathhouse scenario, the acquisition reference score is 0.300 (hypothetical value), which is lower than 0.350, indicating a low-precision acquisition requirement.

[0099] The second step involves adjusting the video capture frame rate of a video capture device in a specific consumption scenario to a first frame rate value of 30 frames per second (fps) and a first resolution value of 1920 pixels multiplied by 1080 pixels. When the reference score of a video capture device in a specific consumption scenario is lower than or equal to the threshold, the server adjusts the frame rate to a second frame rate value of 15 fps and a second resolution value of 1280 pixels multiplied by 720 pixels. The first frame rate of 30 fps is greater than the second frame rate of 15 fps, and the first resolution of 1920 x 1080 is greater than the second resolution of 1280 x 720.

[0100] In the specific adjustments, the frame rate of the CAM-M01 device in the supermarket scene was increased from the default 25 frames per second to 30 frames per second, while the resolution remained at 1920x1080. The frame rate of the CAM-L01 device in the library scene was decreased from 25 frames per second to 15 frames per second, and the resolution was decreased from 1920x1080 to 1280x720. The frame rate of the CAM-C01 device in the cafeteria scene was increased to 30 frames per second, while the resolution remained at 1920x1080. The frame rate of the CAM-B01 device in the bathhouse scene was decreased to 15 frames per second, and the resolution was reduced to 1280x720.

[0101] The third step involves the server re-acquiring multiple consumer behavior video streams according to the adjusted video capture frame rate and image resolution. The server sends configuration update instructions to each video capture device, including the device identifier, adjusted frame rate parameters, and resolution parameters. Upon receiving the instructions, each video capture device applies the new capture parameters at the start of the next video capture cycle. The re-acquisition lasts for one hour, from 11:30 AM to 12:30 PM. During this period, the CAM-M01 device captures supermarket scene video data at 30 frames per second and a resolution of 1920 x 1080, totaling 108,000 frames; the CAM-L01 device captures library scene video data at 15 frames per second and a resolution of 1280 x 720, totaling 54,000 frames; the CAM-C01 device captures cafeteria scene video data at 30 frames per second and a resolution of 1920 x 1080; and the CAM-B01 device captures bathhouse scene video data at 15 frames per second and a resolution of 1280 x 720. The server stores the newly acquired video data in a temporary directory, thus obtaining multiple optimized video data sets.

[0102] In the fourth step, the server inputs multiple optimized video data sets into the YOLO object detection model to perform a secondary object detection operation. The YOLO object detection model re-performs object detection on each frame of the optimized video data, outputting secondary detection consumption behavior records. The data structure of the secondary detection consumption behavior records is the same as that of the initial detection, including student individual bounding box information, timestamp information, and scene label information. The server summarizes the detection results of the secondary detection: In the supermarket scene, due to the frame rate being increased from 25 frames to 30 frames, 5 more images are detected per second, resulting in 12 more student card swiping behavior records detected during the 1-hour collection period, increasing the total number of detection records from 85 to 97. In the library scene, due to the frame rate being reduced from 25 frames to 15 frames, 10 fewer images are detected per second, reducing the number of detection records from 220 to 132. However, since the collection reference score for this scene is below the threshold, it indicates that the analysis value of this scene is low, and the impact of reducing the number of detection records on the overall analysis quality is within an acceptable range.

[0103] The server performs a difference comparison operation between the secondary detection of consumption behavior records and multiple structured consumption behavior records. This comparison is achieved by comparing the difference in the number of records and the difference in the position of the detection boxes between the two detections within the same time period. The server calculates the difference in the number of records for each scenario: the difference for the supermarket scenario is 97 minus 85, which equals 12 records, with a difference rate of 12 divided by 85 equaling 0.141; the difference for the library scenario is 132 minus 220, which equals -88 records, with a difference rate of -88 divided by 220 equaling -0.400. The server also calculates the difference in the position of the detection boxes. For the same student, the average Euclidean distance between the center points of the bounding boxes in the two detections is calculated. The average distance for the supermarket scenario is 3.2 pixels, and the average distance for the library scenario is 5.8 pixels.

[0104] The server updates the consumer behavior quality correlation matrix and the consumer behavior collection correlation matrix based on the results of the difference comparison operation. The update operation uses the difference values ​​in the number of records and the difference values ​​in the detection box positions obtained from the difference comparison operation as feedback signals to fine-tune the element values ​​of the corresponding scenarios and devices in the matrices. The supermarket scenario has 12 positive difference values, indicating that more effective consumer behaviors were detected after improving collection accuracy. The server multiplies the reference quality score of the supermarket scenario in each time period in the consumer behavior quality correlation matrix by a coefficient of 1.05 to increase it, and multiplies the collection reference score of the CAM-M01 device in the supermarket scenario in the consumer behavior collection correlation matrix by a coefficient of 1.05 to increase it as well. The library scenario has 88 negative difference values, indicating that many consumer behaviors were missed after reducing collection accuracy. However, the collection reference score for this scenario was originally below the threshold, so the server keeps the matrix element values ​​for this scenario unchanged and records the difference value as a reference for subsequent adjustments to the collection score threshold. After completing the above update operations, the server persistently stores the updated matrices in the server's database for use in the next analysis cycle.

[0105] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0106] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units. The above are merely embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made based on the description and drawings of this application, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

[0107] The specific embodiments of the invention have been described in detail above, but they are only examples, and this application is not limited to the specific embodiments described above. For those skilled in the art, any equivalent modifications or substitutions to the invention are also within the scope of this application. Therefore, all equivalent changes, modifications, and improvements made without departing from the spirit and principles of this application should be covered within the scope of this application.

Claims

1. A method for analyzing campus card consumption scenarios based on the YOLO object detection algorithm, characterized in that, include: S1, acquire video stream data of consumption behavior collected by multiple video capture devices deployed on campus in multiple all-in-one card consumption scenarios; S2, input the consumption behavior video stream data into the pre-deployed YOLO object detection model to perform object detection operation, output the student individual bounding box information carrying the campus card in each consumption behavior video stream data and the timestamp information associated with the bounding box information, and generate multiple structured consumption behavior records; S3, perform consumption frequency statistics and consumption amount statistics operations on multiple structured consumption behavior records, calculate the number of times a single student swipes their card in each consumption scenario within a preset time window and the cumulative consumption amount, combine the number of times the card swipes occurred and the cumulative consumption amount into a frequency-amount feature vector and output it; S4, acquire multiple spatiotemporal location monitoring data, and perform an association mapping operation between the frequency amount feature vector and the multiple spatiotemporal location monitoring data; S5. Based on the result of the association mapping operation, perform a consumption tendency prediction operation and output consumption tendency data for the individual student, which includes a high-probability consumption scenario label sequence and a predicted consumption time period label sequence.

2. The method according to claim 1, characterized in that, Before performing the target detection operation, the YOLO target detection model loads a pre-configured set of scene detection parameters for the campus card consumption scenario. The set of scene detection parameters includes the detection confidence threshold and the aspect ratio constraint range of the detection box corresponding to each consumption scenario. The YOLO object detection model performs feature extraction on each frame of the consumer behavior video stream data to obtain a multi-scale feature map, and performs anchor box regression on the multi-scale feature map to generate a set of candidate student individual detection boxes. Calculate the confidence score of each candidate detection box in the candidate student individual detection box set, remove candidate detection boxes with confidence scores lower than the detection confidence threshold, and retain candidate detection boxes with confidence scores higher than or equal to the detection confidence threshold as valid detection boxes; Perform non-maximum suppression on the valid detection boxes to eliminate overlapping detection boxes and obtain the individual student bounding box information; The student's individual bounding box information and the timestamp information are bound and stored in the consumption behavior cache queue.

3. The method according to claim 2, characterized in that, The consumption frequency statistics operation performs a scenario tag mapping operation on each structured consumption behavior record stored in the consumption behavior cache queue. The scenario tag mapping operation assigns a corresponding consumption scenario type tag to each structured consumption behavior record. The consumption scenario type tags include cafeteria tags, supermarket tags, bathhouse tags, library tags, and school hospital tags. Based on the consumption scenario type tags, grouping and aggregation operations are performed on all structured consumption behavior records within the preset time window to obtain the statistical value of the number of card swipes corresponding to each consumption scenario type tag; The consumption amount statistics operation is based on the number of card swipes corresponding to each consumption scenario type label, combined with the preset unit consumption amount benchmark value for each consumption scenario, to calculate the estimated cumulative consumption amount of a single student in each consumption scenario. The statistical value of the number of card swipes and the estimated cumulative consumption amount are concatenated to form the frequency-amount feature vector.

4. The method according to claim 1, characterized in that, S4 and S5 include: Send a spatiotemporal data request instruction, the spatiotemporal data request instruction carrying the time boundary parameters of the preset time window and the scenario identifier list of the multiple all-in-one card consumption scenarios; Receive the multiple spatiotemporal location monitoring data returned in response to the spatiotemporal data request instruction, perform parsing operations to extract the longitude and latitude values ​​from the physical space coordinate information corresponding to each consumption scenario and the opening time period identifier, business time period identifier, and closing time period identifier from the time period attribute information corresponding to each consumption scenario. The frequency-amount feature vector is split into multiple sub-vectors according to the consumption scenario type label, and each sub-vector corresponds to the frequency-amount combination data of a single consumption scenario; For each sub-vector, calculate the spatial Euclidean distance between the physical spatial coordinates of the consumption scenario corresponding to the sub-vector and the physical spatial coordinates of the other consumption scenarios, and mark the consumption scenarios with a distance lower than the preset distance threshold as spatially adjacent scenarios; The time period attribute information of the consumption scenario corresponding to each sub-vector is compared with the preset time window to calculate the time period overlap coefficient. Consumption scenarios with an overlap coefficient higher than the preset overlap threshold are marked as time-adjacent scenarios. Based on the labeling results of the spatially adjacent scenes and the labeling results of the temporally adjacent scenes, a scene transition preference map for the individual student is constructed. A path search operation is performed on the scenario transition preference map to search for the transition path with the highest probability starting from the current consumption scenario, and the sequence of scenarios traversed is determined as the high-probability consumption scenario label sequence. Perform time period clustering on the scene transfer preference map, divide the preset time window into multiple candidate time period partitions, calculate the occurrence frequency of each consumption scene in each candidate time period partition, and determine the time boundary of the candidate time period partition with the highest occurrence frequency as the predicted consumption time period label sequence.

5. The method according to claim 4, characterized in that, The step of performing a path search operation on the scenario transition preference map, searching for the transition path with the highest probability starting from the current consumption scenario, and determining the sequence of scenarios traversed as the high-probability consumption scenario label sequence, includes: Determine the starting node corresponding to the current consumption scenario in the scenario transition preference graph, obtain all adjacent nodes connected to the starting node and the edge connection weight value corresponding to each adjacent node, perform a normalization ratio transformation operation on each edge connection weight value, and obtain the state transition probability value from the starting node to each adjacent node. Starting from the initial node, a breadth-first search operation is performed. In each search iteration, the neighboring node with the highest state transition probability value is selected as the next access node. The selected neighboring node is added to the path node sequence, and the state transition probability value of the neighboring node is multiplied to the total path probability value. When the length of the path node sequence reaches a preset path length threshold, the width-first search operation is terminated, and the consumption scenario type tags corresponding to all nodes in the current path node sequence are arranged in order to generate the high-probability consumption scenario tag sequence.

6. The method according to claim 1, characterized in that, After the consumption tendency prediction operation outputs consumption tendency data for the individual student, it obtains target value assessment scenario data of campus card consumption behavior in the campus scenario. The target value assessment scenario data includes scenario value weight coefficients and scenario influencing factor set for each consumption scenario. The scenario influencing factor set includes at least the population density factor of the consumption scenario, the time period busyness factor of the consumption scenario, and the service carrying capacity factor of the consumption scenario. The consumption tendency data and the target value assessment scenario data are subjected to a weighted fusion operation. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data to obtain the weighted consumption scenario label sequence. The scene-adaptive adjustment operation is performed on the weighted consumption scene label sequence using the scene-influence factor set. The scene-adaptive adjustment operation adds a scene-adaptive adjustment coefficient to each consumption scene label and outputs the adjusted consumption behavior parameters. The adjusted consumption behavior parameters include the adjusted scene label sequence and the adjusted consumption time window.

7. The method according to claim 6, characterized in that, The acquisition of target value assessment scenario data for campus card consumption behavior within the campus setting includes scenario value weight coefficients and a set of scenario influencing factors for each consumption scenario. The set of scenario influencing factors includes at least the population density factor, the time period busyness factor, and the service carrying capacity factor of the consumption scenario. The consumption tendency data and the target value assessment scenario data are subjected to a weighted fusion operation. The weighted fusion operation uses the scenario value weight coefficient of each consumption scenario to adjust the weight of the high probability consumption scenario label sequence in the consumption tendency data to obtain the weighted consumption scenario label sequence. The set of scenario influence factors is used to perform a scenario-adaptive adjustment operation on the weighted consumer scenario label sequence. A scenario-adaptive adjustment coefficient is added to each consumer scenario label, and the adjusted consumer behavior parameters are output, including the adjusted scenario label sequence and the adjusted consumption time window, specifically including: Send a target value assessment scenario data acquisition request, wherein the target value assessment scenario data acquisition request carries a set of scenario identifiers for the multiple all-in-one card consumption scenarios; Receive the returned target value assessment scenario data, parse the target value assessment scenario data, and extract the scenario value weight coefficient, traffic density factor, time period busyness factor and service carrying capacity factor corresponding to each consumption scenario; For each consumption scenario tag in the high-probability consumption scenario tag sequence, obtain the corresponding scenario value weight coefficient, multiply it by the sequence position weight of the consumption scenario tag in the high-probability consumption scenario tag sequence, and obtain the weight correction value of the consumption scenario tag to replace the original weight value, thus obtaining the weight-corrected consumption scenario tag sequence. Each consumption scenario label in the weighted consumption scenario label sequence is combined with the corresponding consumption scenario's traffic density factor, time period busyness factor, and service carrying capacity factor to obtain the scenario adaptive adjustment base. A threshold mapping operation is performed on the scene adaptation adjustment base number to map the scene adaptation adjustment base number to a preset adjustment coefficient value range, thereby obtaining the scene adaptation adjustment coefficient. The scene adaptability adjustment coefficient is attached to the corresponding consumption scene label to form a scene label item with adjustment coefficient; Traverse all consumption scenario tags in the weighted consumption scenario tag sequence, complete the append operation for all scenario tag items, and generate the adjusted scenario tag sequence; Based on the time-duration busyness factor corresponding to each consumption scenario label in the adjusted scenario label sequence, the time-duration boundary in the predicted consumption time-duration label sequence is contracted or expanded to generate the adjusted consumption time window.

8. The method according to claim 7, characterized in that, After outputting the adjusted consumption behavior parameters, a consumption behavior quality correlation matrix is ​​constructed based on the adjusted scenario label sequence and the adjusted consumption time window. The row index of the consumption behavior quality correlation matrix is ​​each consumption scenario label, and the column index of the consumption behavior quality correlation matrix is ​​each consumption time period label. The matrix elements of the consumption behavior quality correlation matrix are determined by the product of the scenario adaptability adjustment coefficient under the corresponding consumption scenario label and the time adaptability coefficient under the corresponding consumption time period label. Perform row vector analysis on the consumer behavior quality correlation matrix to calculate the row vector magnitude of each row vector, and use the row vector magnitude as the basic score of behavior quality for the corresponding consumption scenario in that row; perform column vector analysis on the consumer behavior quality correlation matrix to calculate the column vector magnitude of each column vector, and use the column vector magnitude as the basic score of behavior time adaptation for the corresponding consumption time period in that column. Perform a cross-matching operation between the basic behavioral quality score corresponding to each consumption scenario and the basic behavioral time adaptation score corresponding to each consumption time period. Then, weight the basic behavioral quality score and the basic behavioral time adaptation score according to the scenario-time period pairing relationship to output the reference quality score of each consumption scenario under each consumption time period.

9. The method according to claim 8, characterized in that, After outputting the reference quality scores for each consumption scenario under each consumption time period, a video acquisition device deployment topology map of the campus card consumption scenario is obtained. The video acquisition device deployment topology map includes the device location nodes and device coverage boundaries of the video acquisition devices in each consumption scenario. Based on the deployment topology of the video capture devices and the consumer behavior quality correlation matrix, a consumer behavior acquisition correlation matrix is ​​constructed, where the row index is the identifier of each video capture device and the column index is the label of each consumer scenario. The matrix elements of the consumer behavior collection association matrix are determined by the product of the coverage overlap coefficient of the corresponding video collection device to the corresponding consumer scene and the reference quality score of the corresponding consumer scene. The coverage overlap coefficient is calculated based on the ratio of the intersection area of ​​the device coverage boundary and the physical space boundary of the consumer scene to the total physical space area of ​​the consumer scene. Perform a row summation operation on the consumer behavior collection association matrix to obtain the comprehensive collection coverage value of each video collection device, and perform a column summation operation on the consumer behavior collection association matrix to obtain the comprehensive scene coverage value of each consumption scenario; The comprehensive values ​​of the acquired coverage are sorted in descending order of numerical value to obtain a priority sequence of video acquisition devices, and the comprehensive values ​​of the scene coverage are sorted in ascending order of numerical value to obtain a priority sequence of consumer scene acquisition needs. Based on the priority sequence of the video acquisition devices and the priority sequence of acquisition requirements for the consumption scenarios, an acquisition reference score for each video acquisition device in each consumption scenario is calculated. The acquisition reference score is the ratio of the comprehensive acquisition coverage value of the video acquisition device to the comprehensive scenario coverage value of the corresponding consumption scenario.

10. The method according to claim 9, characterized in that, After calculating the acquisition reference score for each video acquisition device in each consumption scenario, an acquisition strategy adjustment operation is performed on multiple video streams of the aforementioned consumption behavior based on the acquisition reference score of each video acquisition device in each consumption scenario. The acquisition strategy adjustment operation includes the following steps: The acquisition reference score of each video acquisition device is compared with the preset acquisition score threshold. When the acquisition reference score of a certain video acquisition device in a certain consumption scenario is higher than the acquisition score threshold, the video acquisition frame rate of the video acquisition device in the consumption scenario is adjusted to the first frame rate value, and the image resolution of the video acquisition device in the consumption scenario is adjusted to the first resolution value. When the reference score of a video capture device in a certain consumption scenario is lower than or equal to the capture score threshold, the video capture frame rate of the video capture device in that consumption scenario is adjusted to the second frame rate value, and the image resolution of the video capture device in that consumption scenario is adjusted to the second resolution value. The multiple consumer behavior video streams are re-acquired according to the adjusted video capture frame rate and adjusted image resolution to obtain multiple optimized video data streams. Multiple optimized video data sets are input into the YOLO target detection model to perform a secondary target detection operation, thereby obtaining secondary detection consumption behavior records. Perform a difference comparison operation between the secondary detection consumption behavior record and multiple structured consumption behavior records, and update the consumption behavior quality correlation matrix and the consumption behavior collection correlation matrix based on the result of the difference comparison operation.