A data visualization method and device for smart bluetooth electronic cigarette
Through the data visualization method of smart Bluetooth e-cigarettes, users' smoking habits and taste preferences are analyzed, and personalized smoking recommendation strategies are provided, which solves the problem that users find it difficult to understand their own usage status and improves health management and user experience.
Patent Information
- Application Number
- CN202411529334.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-30
AI Technical Summary
Existing smart electronic cigarette devices are difficult to effectively analyze and display user usage data, resulting in users being unable to fully and intuitively understand their own usage status, which affects health and safety.
A data visualization method is adopted to obtain real-time status information and historical operation monitoring logs of intelligent Bluetooth electronic cigarettes, and perform data mining and analysis, generate user smoking habits and taste preference data, build smoking frequency trend curve, and conduct scenario analysis and prediction. Provide personalized smoking recommendation strategies and visual rendering.
Help users better manage smoking habits, improve user experience and health management level, enhance their understanding and sense of participation in smoking data, provide personalized smoking suggestions, and ensure users' health and safety.
Smart Images

Figure CN119014600B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a data visualization method and device for a smart Bluetooth electronic cigarette. Background Art
[0002] Faced with a large number of user groups and complex usage scenarios, how to effectively analyze and display the operating data of these smart electronic cigarette devices, so as to provide users and enterprises with more intelligent and personalized services, has become an urgent problem to be solved in the industry. For users with poor self-control, too much smoking will affect the body. Most electronic cigarettes can only provide users with simple data reports, which cannot help users fully and intuitively understand their own usage status, which not only reduces the user's experience. Therefore, an intelligent electronic cigarette data visualization method is needed to help users reasonably control the frequency of smoking and ensure the health and safety of users by visualizing the user's electronic cigarette usage data. Summary of the invention
[0003] In order to solve the above technical problems, the present invention proposes a data visualization method and device for a smart Bluetooth electronic cigarette to solve at least one of the above technical problems.
[0004] To achieve the above object, the present invention provides a data visualization method for a smart Bluetooth electronic cigarette, comprising the following steps:
[0005] Step S1: obtaining the current real-time status information of the cigarette cartridge; extracting the ID information of the current real-time status information of the cigarette cartridge, and performing real-time status feature mining to generate the current cigarette cartridge status feature data;
[0006] Step S2: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; count the number of times the user smokes according to the historical operation monitoring log, and calculate the number of times the cigarette cartridge flavors are used, thereby generating data on the number of times the cigarette cartridge flavors are used;
[0007] Step S3: Calculate the frequency distribution of different cigarette cartridges for the smoking frequency data of different cigarette cartridge flavors, and perform frequency trend analysis within the period to construct frequency trend curves of multiple cigarette cartridge flavors;
[0008] Step S4: Performing user behavior scenario analysis based on the frequency trend curves of multiple cigarette cartridge flavors, and then performing scenario frequency time series analysis to obtain cigarette cartridge frequency trend characteristics in multiple scenarios;
[0009] Step S5: Predict the smoking frequency in time series based on the frequency trend characteristics of cigarette cartridges in multiple scenarios to generate the smoking frequency prediction data within the user cycle; make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle to generate a personalized smoking recommendation strategy for the user;
[0010] Step S6: Visualize and render the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data to construct a current cigarette cartridge-personalized recommendation visualization view.
[0011] The present invention generates current cartridge status feature data by extracting ID information and performing real-time status feature mining, thereby realizing real-time monitoring and data collection of electronic cigarette cartridges, providing basic data for subsequent analysis, counting the number of times users smoke and the types of flavors, generating data on the number of times they smoke and the number of times they taste, which helps to understand users' smoking habits and taste preferences. By analyzing historical operation monitoring logs, the present invention accumulates smoking data, provides historical data support for subsequent analysis, calculates the smoking frequency distribution of different cartridge flavors, analyzes the frequency trend within a period, and constructs a frequency trend curve, which helps to understand the popularity of different flavors in different time periods. By trend analysis, the changing trend of taste preferences is predicted, which provides data support for personalized recommendations, and user behavior scenario analysis is performed based on the frequency trend curve. Analysis: Analyze the frequency characteristics of cigarette cartridges in various scenarios to help understand the motivations and patterns behind users' smoking behaviors. Through scene frequency time series analysis, obtain the trend characteristics of cigarette cartridge frequency in multiple scenarios to provide a basis for personalized recommendation decisions. Based on time series smoking frequency prediction, generate smoking frequency prediction data within the user's cycle, realize personalized smoking frequency recommendation decisions, and provide users with customized smoking suggestions. Through prediction and recommendation, improve user experience and help users better manage smoking habits. Visualize personalized smoking recommendation strategies and current cigarette cartridge status feature data, build a visualization view, and let users intuitively understand smoking data and recommendations. Through visualization views, provide user-friendly data display methods to enhance users' understanding and participation in smoking data.
[0012] Preferably, step S1 comprises the following steps:
[0013] Step S11: Perform encryption detection on the current cartridge based on the smart Bluetooth electronic cigarette, and extract the real-time status information of the current cartridge when the encryption detection passes;
[0014] Step S12: extracting ID information from the current real-time status information of the cigarette cartridge to obtain the current cigarette cartridge ID information;
[0015] Step S13: performing cigarette cartridge flavor identification on the current cigarette cartridge ID information based on a preset flavor database to generate current cigarette cartridge flavor information;
[0016] Step S14: estimating the residual capacity of the cigarette cartridge based on the current real-time status information of the cigarette cartridge to generate a residual capacity value of the cigarette cartridge;
[0017] Step S15: Perform usage time statistics on the real-time status information of the current cigarette cartridge to obtain the current cigarette cartridge usage time;
[0018] Step S16: Perform real-time state feature mining on the current cartridge usage time, the residual capacity value of the cartridge, and the current cartridge flavor information, so as to generate current cartridge state feature data.
[0019] The present invention ensures the security and integrity of data and improves the confidentiality of cigarette cartridge information through encryption detection. When the encryption detection is passed, the real-time status information is extracted to provide accurate data support for subsequent analysis, and the unique ID information of the cigarette cartridge is extracted to facilitate personalized analysis and tracking of different cigarette cartridges. The cigarette cartridge ID is associated with other data to help establish a complete cigarette cartridge usage information file. The flavor information of the current cigarette cartridge is identified through the flavor database, providing a data basis for user flavor preference analysis and personalized recommendation, providing more accurate flavor information, improving user experience, increasing user satisfaction with the product, estimating the residual capacity of the cigarette cartridge, and helping users to replace the cigarette cartridge in time. Improve usage efficiency and convenience, provide real-time residual capacity information, help users understand the usage status of cigarette cartridges, provide data support for subsequent analysis, count the usage time of cigarette cartridges, help users understand their smoking habits and frequency, and provide a reference for health management. The usage time data is helpful to analyze user behavior patterns and cigarette cartridge usage patterns, and provide data support for personalized recommendations. Combined with usage time, residual capacity and flavor information, the status characteristics of cigarette cartridges are explored to provide users with more comprehensive data analysis and personalized recommendations. The status characteristic data is visualized to help users intuitively understand the usage and status changes of cigarette cartridges, and improve users' understanding and application of data.
[0020] Preferably, step S2 comprises the following steps:
[0021] Step S21: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette;
[0022] Step S22: performing timestamp synchronization processing on the historical operation monitoring log, thereby obtaining a time-aligned monitoring log;
[0023] Step S23: Counting the number of times the user smokes from the time-aligned monitoring log, and extracting the data on the number of times the user smokes;
[0024] Step S24: classifying the flavors of cigarette cartridges in the time-aligned monitoring logs to obtain the user's cigarette cartridge flavor classification data;
[0025] Step S25: Calculate the number of puffs per cigarette cartridge flavor based on the user's cigarette cartridge flavor classification data, thereby generating puff data for different cigarette cartridge flavors.
[0026] The present invention obtains detailed smoking behavior data, including information such as smoking time, frequency and duration, by acquiring the historical operation monitoring log of the smart Bluetooth electronic cigarette, providing the necessary basic data for subsequent analysis. Timestamp synchronization processing ensures the time consistency between different data sources, thereby obtaining a time-aligned monitoring log, which helps to accurately analyze the user's smoking behavior and ensure the accuracy and reliability of the data. By counting the number of times users smoke in the time-aligned monitoring log, the user's smoking frequency and habits can be accurately understood, which helps to identify the user's behavior pattern and change trend, and provide important indicators for subsequent data visualization. The monitoring log is classified by the flavor of the cigarette cartridge, and the user's smoking behavior is subdivided into different flavor categories, providing more specific and detailed information for subsequent data analysis and visualization. The number of cigarette cartridge flavors is calculated according to the user's cigarette cartridge flavor classification data, and the number of smoking times of various flavors is generated, which helps to analyze the popularity of different flavors, the changing trend of user taste preferences, and the comparison between flavors, providing more dimensions and information for data visualization.
[0027] Preferably, the specific steps of step S22 are:
[0028] Extracting parameterized data according to the historical operation monitoring log;
[0029] Performing standard numerical encoding on parameterized data to obtain a standard numerical encoding row monitoring log;
[0030] Perform global abnormal missing value detection on standard numerical encoding line monitoring logs and mark abnormal missing values;
[0031] Performing a sliding average calculation on the historical operation monitoring log to obtain a sliding average value;
[0032] Perform missing value filling processing on abnormal missing values according to the sliding average value and generate missing value filling monitoring log;
[0033] Perform timestamp synchronization on the missing value filling monitoring log to obtain a time-aligned monitoring log.
[0034] The present invention converts complex monitoring information into a parameter form that is easy to process and analyze by extracting parameterized data from historical operation monitoring logs, thereby providing a basis for subsequent data processing and analysis. Standard numerical encoding of parameterized data helps to unify data formats, simplify data processing procedures, and improve data comparability and interpretability. Global abnormal missing value detection effectively identifies abnormal missing values in monitoring data, helps ensure data quality and accuracy, and improves the reliability of data analysis. The sliding average value obtained by sliding average calculation smoothes data sequences, helps identify data trends and cyclical changes, and provides a more stable reference basis for data analysis. Abnormal missing values are filled in according to the sliding average value to repair abnormal missing values in the data, thereby improving data integrity and continuity and ensuring the accuracy of subsequent analysis. Timestamp synchronization is performed on the missing value filling monitoring log to ensure data time consistency and ensure data alignment in the time dimension, thereby providing an accurate timeline reference for subsequent data visualization and analysis.
[0035] Preferably, step S3 specifically comprises the following steps:
[0036] Step S31: Divide the time-aligned monitoring log into multiple time windows to obtain multiple time window monitoring logs;
[0037] Step S32: extracting the timestamp of each time window monitoring log based on multiple time window monitoring logs;
[0038] Step S33: performing different cigarette cartridge frequency distribution calculations on the smoking frequency data of different cigarette cartridge flavors based on the timestamp, thereby obtaining frequency distribution data of each cigarette cartridge flavor;
[0039] Step S34: performing frequency trend analysis on the frequency distribution data of each cigarette cartridge flavor within a period to generate frequency trend change data of different cigarette cartridges;
[0040] Step S35: Perform frequency trend fitting on the frequency trend change data of different cigarette cartridges to construct frequency trend curves of multiple cigarette cartridge flavors.
[0041] The present invention divides the monitoring log data into different time periods by dividing a plurality of time windows, so as to better observe and analyze the data change trends in different time periods. The division of different time windows helps to capture the periodicity and regularity of data changes, and provides richer information for subsequent analysis. Extracting timestamps helps to establish time series data, so that the monitoring data of different time windows can accurately correspond to specific time points, and provide accurate time references for time-related analysis. The frequency distribution of the number of smoking times of different cartridge flavors is analyzed to help understand the user's preference for different flavors, and provide data support for flavor recommendation and product strategy. The frequency distribution data reflects the user's use frequency of various flavors, and provides a basis for user behavior analysis and personalized services. The frequency trend is analyzed within a period, and the change law of the use frequency of different cartridge flavors in different time periods is revealed, and support is provided for user use habits and market demand analysis. The frequency trend analysis helps to predict the change of user demand for different flavors, and provides a reference for inventory management and market strategy formulation. The frequency trend curve of the flavor is constructed by frequency trend fitting, and the use frequency change trend of different cartridge flavors is more intuitively displayed, and an intuitive display form is provided for data visualization.
[0042] Preferably, the specific steps of step S4 are:
[0043] Step S41: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user;
[0044] Step S42: performing user behavior scenario analysis on the user location data of each time window based on the timestamp, thereby generating multiple user behavior scenarios;
[0045] Step S43: performing frequency distribution association mining on multiple user behavior scenarios based on the frequency distribution data of each cigarette cartridge flavor to obtain frequency distribution association data under different scenarios;
[0046] Step S44: performing scene frequency time series analysis on the frequency trend curves of multiple cigarette cartridge flavors based on the frequency distribution association data in different scenes, so as to obtain the cigarette cartridge frequency trend characteristics in multiple scenes.
[0047] The present invention helps to ensure the health and safety of users by making personalized smoking frequency recommendation decisions based on user safety assessment values, provides reasonable smoking frequency suggestions based on individual circumstances, generates personalized smoking recommendation strategies to improve user experience and satisfaction, performs behavioral scenario analysis on user location data, deeply understands the user's usage habits and behavior patterns in different scenarios, and provides data support for personalized services and user experience optimization. User behavior scenario analysis helps to accurately locate user needs and behavioral preferences, performs frequency distribution association mining on multiple user behavior scenarios, discovers the usage correlation of cigarette cartridge flavors in different scenarios, and provides data support for personalized recommendations and scenario customization. Frequency distribution association data helps to discover the relationship between user behavior and flavor preferences. The trend characteristics of cigarette cartridge frequencies in multiple scenarios are obtained through scenario frequency time series analysis, revealing the changing rules of user demand for flavors in different scenarios, and providing a basis for personalized recommendations and product strategy adjustments. Scenario frequency time series analysis helps to predict user taste preferences and demand changes in different scenarios.
[0048] Preferably, the specific steps of step S42 are:
[0049] Perform location area scene judgment on the user location data of each time window to generate a location area scene for each time window, wherein the location area scene includes a home scene, an office scene, an outdoor scene, a leisure scene, and other unknown scenes;
[0050] Perform scene label clustering on the location area scene of each time window to obtain the location scene label for each time window;
[0051] A user behavior scenario analysis is performed on the location scenario tag of each time window based on the timestamp, thereby generating multiple user behavior scenarios.
[0052] The present invention clusters location area scenes with scene labels, which helps to classify similar scenes into one category, improves the accuracy and interpretability of scene classification, and provides clear scene labels for subsequent analysis and application. Scene label clustering helps to discover patterns and regularities of user behavior, and provides a deeper understanding for user behavior analysis and personalized recommendations. User behavior scenario analysis is performed based on location scene labels to generate multiple user behavior scenarios, deeply understand the user's behavioral habits and needs in different scenarios, and provide a basis for personalized recommendations and service optimization. Location area scene judgment is performed on user location data in each time window, and the user's behavior environment is divided into home, office, outdoor, leisure and other scenarios, which helps to understand the user's behavioral characteristics in different environments. Through location area scene judgment, a user's scene portrait is constructed, and the user's behavioral preferences and habits in different scenarios are understood, providing a basis for personalized recommendations and customized services.
[0053] Preferably, the specific steps of step S5 are:
[0054] Step S51: performing time series evolution analysis on the frequency trend characteristics of the cigarette cartridges in multiple scenarios to generate frequency trend rules for multiple scenarios;
[0055] Step S52: simulating the evolution of multiple user behavior scenarios according to the frequency trend rules of multiple scenarios, thereby generating user smoking frequency simulation data of multiple scenarios;
[0056] Step S53: performing periodic smoking frequency prediction on the user smoking frequency simulation data of multiple scenarios to generate periodic smoking frequency prediction data of the user;
[0057] Step S54: Perform a smoking frequency safety assessment on the user's smoking frequency prediction data within a period to obtain a user safety assessment value;
[0058] Step S55: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user.
[0059] The present invention generates the frequency trend law of cigarette cartridges for multiple scenarios through time-series evolution analysis, reveals the changing trend of users' smoking behavior in different scenarios, and provides a basis for behavior prediction and personalized recommendation. Time-series evolution analysis helps to explore the periodicity and regularity of users' smoking behavior, and provides data support for subsequent simulation and prediction. According to the frequency trend law, the evolution of user behavior scenarios is simulated to generate user smoking frequency simulation data for multiple scenarios, and the changing trend of user behavior in different scenarios is simulated to provide a reference for behavior prediction and strategy formulation. The scenario evolution simulation helps to predict the changes in users' smoking behavior in different situations, and provides a more accurate data basis for personalized recommendation and safety assessment. The smoking frequency simulation data is used to predict the smoking frequency within a period, and the predicted data of the user's smoking frequency within a period is generated to help users understand the changing trend of their own smoking behavior, so as to take corresponding measures. Action, the prediction of smoking frequency within the cycle helps to discover potential smoking risks in advance, provide users with health management and safety warnings, and promote the formation of a healthy lifestyle. The smoking frequency safety assessment is performed on the user's smoking frequency prediction data within the cycle to obtain the user's safety assessment value, which helps users understand the health risks of their smoking behavior and provides a basis for personalized recommendations and interventions. The smoking frequency safety assessment helps users manage smoking behavior, promote users to be aware of the impact of smoking on health, and guide users to adopt a healthier lifestyle. Personalized smoking frequency recommendation decisions are made based on the user's safety assessment value, and personalized smoking recommendation strategies are generated for users to help users reasonably control smoking frequency and ensure user health and safety. Personalized smoking recommendation strategies help increase users' trust and dependence on smart Bluetooth electronic cigarettes, reflect care for user health and safety, and improve user satisfaction and loyalty.
[0060] Preferably, the specific steps of step S6 are:
[0061] Step S61: Real-time visualization rendering of the user's personalized smoking recommendation strategy to generate a user's personalized recommendation visualization view;
[0062] Step S62: Mapping the current cartridge state to the user's personalized recommendation visualization view using the current cartridge state feature data to construct the current cartridge-personalized recommendation visualization view;
[0063] Step S63: Upload the current cartridge-personalized recommendation visualization view to the APP for cloud storage based on Bluetooth communication to complete the data visualization operation of the smart Bluetooth electronic cigarette.
[0064] The present invention generates a visualization view of user personalized recommendation through instant visualization rendering, improves user experience and interactivity, and enables users to intuitively understand their smoking recommendation strategies. The personalized recommendation visualization view helps users to more clearly understand the content and suggestions of the recommendation strategy, and helps users make more informed smoking decisions. The personalized recommendation visualization view uses the current cartridge state feature data to map the cartridge state to the personalized recommendation visualization view, and helps users to monitor the current smoking situation and the degree of compliance with the recommendation strategy in real time, improve the user's cognition and control of smoking behavior, and build the correlation between the current cartridge and the personalized recommendation visualization view, so that users can intuitively understand the relationship between the current cartridge state and the recommendation strategy, and provide users with more accurate smoking suggestions. Based on Bluetooth communication, the current cartridge-personalized recommendation visualization view is uploaded to the APP for cloud storage, realizing data sharing and remote monitoring, and users can view their smoking information and recommendation strategies anytime and anywhere. Cloud storage and real-time uploading are conducive to remote management and monitoring of smart Bluetooth electronic cigarettes, and users can view their smoking situation at any time through mobile phones or other devices, and improve the user's self-management and monitoring capabilities of smoking behavior.
[0065] In this specification, a data visualization device for a smart Bluetooth electronic cigarette is provided, which is used to execute the data visualization method for a smart Bluetooth electronic cigarette as described above, including:
[0066] The real-time status module of the cigarette cartridge is used to obtain the real-time status information of the current cigarette cartridge; extract the ID information of the real-time status information of the current cigarette cartridge, and perform real-time status feature mining to generate the current cigarette cartridge status feature data;
[0067] The frequency statistics module is used to obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; count the number of times the user smokes in the historical operation monitoring log, and calculate the number of times the cigarette cartridge flavors are used, so as to generate the number of times the cigarette cartridge flavors are used;
[0068] The frequency distribution module is used to calculate the frequency distribution of different cartridges for the number of puffs of different cartridges, and to perform frequency trend analysis within a period to construct frequency trend curves for multiple cartridges flavors;
[0069] The scenario trend module is used to perform user behavior scenario analysis based on the frequency trend curves of multiple cartridge flavors, and then perform scenario frequency time series analysis to obtain the cartridge frequency trend characteristics in multiple scenarios;
[0070] The smoking frequency prediction module is used to predict the smoking frequency of cigarette cartridges in multiple scenarios in time series, so as to generate the smoking frequency prediction data within the user cycle; and to make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle, so as to generate a personalized smoking recommendation strategy for the user;
[0071] The visualization rendering module is used to visualize the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data, and build a current cigarette cartridge-personalized recommendation visualization view.
[0072] The present invention helps users understand their current smoking situation by acquiring cigarette cartridge status information in real time, improves users' real-time monitoring and perception capabilities of smoking behavior, generates current cigarette cartridge status feature data through real-time status information extraction and feature mining, provides basic data for subsequent analysis, helps users understand their smoking habits and taste preferences by counting the number of puffs and the number of cigarette cartridge flavors, provides historical data support for personalized recommendations, and generates puff number data and flavor number data to help users understand their smoking behavior more accurately. It helps users understand the distribution of smoking frequencies of different flavors through frequency distribution calculation and trend analysis of different cigarette cartridge flavors, provides data support for subsequent scenario analysis, constructs a frequency trend curve, intuitively displays the changing trend of smoking frequencies of various flavors over time, and helps users better understand smoking Changes in habits, user behavior scenario analysis based on frequency trend curves, helps users understand the characteristics of smoking behavior in different scenarios, and provides a basis for subsequent predictions and recommendations. Through scene frequency time series analysis, the frequency trend characteristics of cigarette cartridges in multiple scenarios are obtained to provide data support for smoking frequency prediction and recommendation. Smoking frequency prediction is performed based on the frequency trend characteristics of cigarette cartridges, and personalized smoking frequency recommendation decisions are generated to help users better manage their smoking behavior. Smoking frequency prediction data is generated to provide users with personalized smoking recommendation strategies, which helps users adjust their smoking frequency and improve the health management level of smoking behavior. Through visual rendering, a current cigarette cartridge-personalized recommendation visualization view is constructed, allowing users to intuitively understand personalized smoking recommendation strategies and current cigarette cartridge status characteristics, and improve users' cognition and management capabilities of smoking behavior. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1A schematic diagram of the steps of a data visualization method for a smart Bluetooth electronic cigarette according to the present invention;
[0074] Figure 2 Detailed implementation flow chart of step S1;
[0075] Figure 3 Detailed implementation flow chart of step S2;
[0076] Figure 4 Detailed implementation flow chart of step S3. DETAILED DESCRIPTION
[0077] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0078] The present application example provides a data visualization method and device for smart Bluetooth electronic cigarettes. The execution subject of the data visualization method and device for smart Bluetooth electronic cigarettes includes but is not limited to: mechanical equipment, data processing platform, cloud server node, network upload device, etc. equipped with the system can be regarded as the general computing node of the present application, and the data processing platform includes but is not limited to: at least one of an audio image management system, an information management system, and a cloud data management system.
[0079] See also Figures 1 to 4 The present invention provides a data visualization method for a smart Bluetooth electronic cigarette, comprising the following steps:
[0080] Step S1: obtaining the current real-time status information of the cigarette cartridge; extracting the ID information of the current real-time status information of the cigarette cartridge, and performing real-time status feature mining to generate the current cigarette cartridge status feature data;
[0081] Step S2: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; count the number of times the user smokes according to the historical operation monitoring log, and calculate the number of times the cigarette cartridge flavors are used, thereby generating data on the number of times the cigarette cartridge flavors are used;
[0082] Step S3: Calculate the frequency distribution of different cigarette cartridges for the smoking frequency data of different cigarette cartridge flavors, and perform frequency trend analysis within the period to construct frequency trend curves of multiple cigarette cartridge flavors;
[0083] Step S4: Performing user behavior scenario analysis based on the frequency trend curves of multiple cigarette cartridge flavors, and then performing scenario frequency time series analysis to obtain cigarette cartridge frequency trend characteristics in multiple scenarios;
[0084] Step S5: Predict the smoking frequency in time series based on the frequency trend characteristics of cigarette cartridges in multiple scenarios to generate the smoking frequency prediction data within the user cycle; make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle to generate a personalized smoking recommendation strategy for the user;
[0085] Step S6: Visualize and render the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data to construct a current cigarette cartridge-personalized recommendation visualization view.
[0086] The present invention generates current cartridge status feature data by extracting ID information and performing real-time status feature mining, thereby realizing real-time monitoring and data collection of electronic cigarette cartridges, providing basic data for subsequent analysis, counting the number of times users smoke and the types of flavors, generating data on the number of times they smoke and the number of times they taste, which helps to understand users' smoking habits and taste preferences. By analyzing historical operation monitoring logs, the present invention accumulates smoking data, provides historical data support for subsequent analysis, calculates the smoking frequency distribution of different cartridge flavors, analyzes the frequency trend within a period, and constructs a frequency trend curve, which helps to understand the popularity of different flavors in different time periods. By trend analysis, the changing trend of taste preferences is predicted, which provides data support for personalized recommendations, and user behavior scenario analysis is performed based on the frequency trend curve. Analysis: Analyze the frequency characteristics of cigarette cartridges in various scenarios to help understand the motivations and patterns behind users' smoking behaviors. Through scene frequency time series analysis, obtain the trend characteristics of cigarette cartridge frequency in multiple scenarios to provide a basis for personalized recommendation decisions. Based on time series smoking frequency prediction, generate smoking frequency prediction data within the user's cycle, realize personalized smoking frequency recommendation decisions, and provide users with customized smoking suggestions. Through prediction and recommendation, improve user experience and help users better manage smoking habits. Visualize personalized smoking recommendation strategies and current cigarette cartridge status feature data, build a visualization view, and let users intuitively understand smoking data and recommendations. Through visualization views, provide user-friendly data display methods to enhance users' understanding and participation in smoking data.
[0087] In the embodiment of the present invention, refer to Figure 1 , is a schematic flow chart of the steps of a data visualization method for a smart Bluetooth electronic cigarette of the present invention. In this example, the steps of the method include:
[0088] Step S1: obtaining the current real-time status information of the cigarette cartridge; extracting the ID information of the current real-time status information of the cigarette cartridge, and performing real-time status feature mining to generate the current cigarette cartridge status feature data;
[0089] In this embodiment, it is ensured that the smart Bluetooth electronic cigarette has Bluetooth communication function and can transmit status information in real time. The development environment is prepared. Python or other suitable programming languages are used to install relevant Bluetooth libraries (such as PyBluez, Bluepy, etc.), confirm that the smart Bluetooth electronic cigarette has been paired with the mobile phone or computer, obtain the Bluetooth address required for connection, send a request for obtaining status information to the cigarette cartridge through Bluetooth connection, and the specific request format needs to refer to the communication protocol of the cigarette cartridge. The real-time status information returned by the cigarette cartridge is received. The data format returned is usually JSON or a custom format. The received raw data is parsed to extract important information fields, such as cigarette cartridge ID, remaining power, number of uses, flavor type, etc., and the state features to be mined are determined, including: cigarette cartridge ID: uniquely identifies the cigarette cartridge, remaining power: expressed as a percentage, number of uses: indicates the frequency of use of the cigarette cartridge, flavor type: the flavor of the cigarette cartridge currently used, and the extracted feature information is stored in a data structure, such as a dictionary or a data frame, to ensure that the extracted data is complete and meets expectations, set conditional judgment, ensure that each field has a valid value, and choose to store the state feature data in a local database (such as SQLite) or a cloud database (such as Firebase, AWS). DynamoDB, etc.), and output the extracted feature data to the console for easy debugging and verification.
[0090] Step S2: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; count the number of times the user smokes according to the historical operation monitoring log, and calculate the number of times the cigarette cartridge flavors are used, thereby generating data on the number of times the cigarette cartridge flavors are used;
[0091] In this embodiment, the storage location of the historical operation monitoring log is determined, which is a local device, a cloud server, or obtained through a Bluetooth connection. If the data is stored in the cloud, a REST API interface is designed or an SDK is used to pull data. If the data is stored locally, it is obtained by reading a local file or querying a database. An example of obtaining a historical operation monitoring log is obtained through an API. The historical log is read from a local JSON file. The integrity and validity of the historical log data are checked. Invalid records or duplicate records are cleared to ensure that the data types of all fields are consistent, such as converting the timestamp to a date format. The smoking event marker in each log item is determined, which is usually identified by the record of the start and end of smoking. The historical log is traversed, and the number of times each user smokes is counted. A dictionary or a counter is used for statistics. The number of times each user smokes is printed or stored. A dictionary is prepared to store the number of times each flavor is smoked. The historical log is traversed, and the cartridge flavor ID is extracted and counted. The number of times each flavor is smoked is printed or stored. The number of times a user smokes and the number of times a cartridge flavor is organized into a structured data format (such as a dictionary or a data frame). A visualization tool (such as Matplotlib or Seaborn) is used to generate a visualization report of the number of times a user smokes and the number of flavors.
[0092] Step S3: Calculate the frequency distribution of different cigarette cartridges for the smoking frequency data of different cigarette cartridge flavors, and perform frequency trend analysis within the period to construct frequency trend curves of multiple cigarette cartridge flavors;
[0093] In this embodiment, ensure that the data on the number of times smoked for different cartridge flavors has been obtained and organized. The data should contain each flavor and its corresponding number of times smoked. Calculate the total number of times smoked for all flavors for frequency calculation. Traverse each cartridge flavor, calculate its frequency, and store the result. For example, the frequency is expressed as the proportion of the number of times smoked for each flavor to the total number of times smoked. Determine the time period for analysis, such as day, week, month, etc. Select a fixed time window. Group the historical smoking data according to the defined analysis period. Use the Pandas database to process time series data. Calculate the trend of the smoking frequency for each flavor and generate a trend curve. Use linear interpolation or moving average to smooth the data. Extract features from the frequency trend curve, such as identifying peaks, troughs, and trend changes, for further market analysis.
[0094] Step S4: Performing user behavior scenario analysis based on the frequency trend curves of multiple cigarette cartridge flavors, and then performing scenario frequency time series analysis to obtain cigarette cartridge frequency trend characteristics in multiple scenarios;
[0095] In this embodiment, it is ensured that frequency trend curve data of multiple cigarette cartridge flavors have been obtained, including the number of times each flavor is smoked in different time periods, and different user behavior scenarios are identified according to the frequency trend curve, for example: high-frequency smoking scenario: when the number of times a certain flavor is smoked increases significantly, low-frequency smoking scenario: when the number of times a certain flavor is smoked decreases significantly, flavor preference scenario: the user prefers a certain flavor in a specific time period, and the smoking frequency data is analyzed using a threshold method or a clustering algorithm (such as K-means), and different user behavior scenarios are identified and marked, and the scene data is sorted by timestamp for time series analysis, ensuring that each scene is recorded in the corresponding time period, and selecting a suitable time series analysis method, such as moving average, exponential smoothing or ARIMA model, to identify the changing trend of the scene frequency, and using the selected time series analysis method to analyze the frequency of each scene to extract trend features, sort the frequency trend analysis results of each scene, and generate a visual chart to show the changes in smoking frequency in different scenes.
[0096] Step S5: Predict the smoking frequency in time series based on the frequency trend characteristics of cigarette cartridges in multiple scenarios to generate the smoking frequency prediction data within the user cycle; make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle to generate a personalized smoking recommendation strategy for the user;
[0097] In this embodiment, ensure that the cartridge frequency trend data in multiple scenarios has been obtained and converted into a format suitable for time series prediction. Select a suitable time series prediction model, such as ARIMA, SARIMA or LSTM, etc. Here, it is assumed that the ARIMA model is used for prediction. Determine the parameters of the ARIMA model, including the autoregressive term (p), the difference term (d), and the moving average term (q). Use ACF and PACF graphs to help with the selection. Fit the ARIMA model to the data of each scenario and generate future smoking frequency predictions. Integrate the user's historical smoking data with the predicted frequency data, taking into account the user's smoking habits and preferences. Set personalized recommendation standards based on the user's health status, smoking frequency prediction, and personalized needs. For example, set a safe smoking frequency range. Implement a personalized recommendation algorithm to generate a personalized smoking recommendation strategy based on the predicted frequency data and user historical data.
[0098] Step S6: Visualize and render the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data to construct a current cigarette cartridge-personalized recommendation visualization view.
[0099] In this embodiment, ensure that the user's personalized smoking recommendation strategy and current cartridge status feature data have been obtained. These data should be organized into a format suitable for visualization. Select a suitable visualization library, such as Matplotlib, Plotly or other interactive visualization libraries, to create a chart. Integrate the personalized recommendation strategy and the current cartridge status feature data into a structure suitable for visualization, usually DataFrame, and determine the layout of the visualization view, including: a bar chart of recommendation frequency, a dashboard of the current cartridge status (such as battery level, remaining e-liquid), and an indicator of the number of puffs. Generate a visualization view using the selected visualization library, for example, use Matplotlib to create a bar chart and a dashboard, save the rendered chart as an image file or embed it directly into the user interface, ensure that the user can easily view the recommendation strategy and current status, and if it is an application, embed the generated visualization view into the user interface of the application, and ensure responsive design so that it can be well displayed on different devices.
[0100] In this embodiment, refer to Figure 2 , is a flowchart of detailed implementation steps of step S1. In this embodiment, the detailed implementation steps of step S1 include:
[0101] Step S11: Perform encryption detection on the current cartridge based on the smart Bluetooth electronic cigarette, and extract the real-time status information of the current cartridge when the encryption detection passes;
[0102] Step S12: extracting ID information from the current real-time status information of the cigarette cartridge to obtain the current cigarette cartridge ID information;
[0103] Step S13: performing cigarette cartridge flavor identification on the current cigarette cartridge ID information based on a preset flavor database to generate current cigarette cartridge flavor information;
[0104] Step S14: estimating the residual capacity of the cigarette cartridge based on the current real-time status information of the cigarette cartridge to generate a residual capacity value of the cigarette cartridge;
[0105] Step S15: Perform usage time statistics on the real-time status information of the current cigarette cartridge to obtain the current cigarette cartridge usage time;
[0106] Step S16: Perform real-time state feature mining on the current cartridge usage time, the residual capacity value of the cartridge, and the current cartridge flavor information, so as to generate current cartridge state feature data.
[0107] In this embodiment, to ensure that the smart Bluetooth electronic cigarette device and its cartridge have encryption detection function, the device needs to include a Bluetooth module and an encryption chip. After the cartridge is inserted into the electronic cigarette, the device starts the encryption detection program and sends an encryption verification request to the cartridge. The encryption chip inside the cartridge receives the request and returns an encrypted data response. The electronic cigarette verifies the returned encrypted data, for example, using a symmetric encryption algorithm (such as AES) to verify to ensure the legitimacy of the cartridge. If the encryption verification passes, proceed to the next step; otherwise, prompt the user to replace the cartridge. After the encryption verification passes, the electronic cigarette reads real-time status information from the cartridge, including ID information, parses the status information of the cartridge, and extracts a unique cartridge ID. The ID is usually a string or a number, representing a specific version of the cartridge. A database containing different cartridge IDs and corresponding flavors is pre-established. The database is continuously updated through market research and user feedback. The extracted cartridge ID is used to query the flavor database, and the corresponding cartridge flavor information is obtained according to the ID. This process is performed through SQL The residual capacity estimation algorithm based on battery voltage and current is adopted to estimate the remaining power by monitoring the battery voltage and current of the cartridge in real time, and the battery status information is continuously collected through built-in sensors (such as voltage sensor and current sensor). The residual capacity is calculated using the formula: Remaining capacity = battery voltage × battery capacity × usage time. The generated residual capacity value will be recorded and stored. A timer is embedded in the electronic cigarette device to record the timestamp of the first use of the cartridge. The timer is updated each time it is used to record the usage time of the current cartridge, calculate the total time since the first use, and obtain the usage time by simple subtraction: usage time = current time − first use time. The usage time, residual capacity and flavor information are integrated into a state feature data structure (such as a dictionary or object). A suitable feature mining method is selected, such as cluster analysis or decision tree algorithm, to extract implicit patterns or laws. The feature mining algorithm is applied to the integrated feature data to generate the state feature data of the current cartridge, including classification, clustering or trend analysis. The extracted state feature data is stored in a database, and the information is fed back to the user's mobile phone application or management system via Bluetooth.
[0108] In this embodiment, refer to Figure 3 , is a flowchart of detailed implementation steps of step S2. In this embodiment, the detailed implementation steps of step S2 include:
[0109] Step S21: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette;
[0110] Step S22: performing timestamp synchronization processing on the historical operation monitoring log, thereby obtaining a time-aligned monitoring log;
[0111] Step S23: Counting the number of times the user smokes from the time-aligned monitoring log, and extracting the data on the number of times the user smokes;
[0112] Step S24: classifying the flavors of cigarette cartridges in the time-aligned monitoring logs to obtain the user's cigarette cartridge flavor classification data;
[0113] Step S25: Calculate the number of puffs per cigarette cartridge flavor based on the user's cigarette cartridge flavor classification data, thereby generating puff data for different cigarette cartridge flavors.
[0114] In this embodiment, historical operation monitoring logs are extracted from the smart Bluetooth electronic cigarette. These logs are obtained through Bluetooth connection, USB interface or cloud service. The monitoring logs should include the user's usage records, such as the number of times smoked, the type of cartridge, the usage time, etc. Ensure that the obtained logs are stored in a standardized format (such as JSON, CSV or XML) to facilitate subsequent processing and analysis. The timestamp of each record is extracted from the historical operation monitoring log. These timestamps should be accurate to milliseconds to ensure the accuracy of synchronization processing. All timestamps are converted to a unified format (such as UTC) to eliminate the influence of inconsistent time zones and formats. Timestamps are synchronized for logs from different devices or users. Interpolation or time window methods are used to align all records. For example, resample of the Pandas library is used. Methods: Resample and align time series data: Store the synchronized logs as a new data structure to ensure that the timestamps of each record are consistent for subsequent analysis. Identify smoking events in the time-aligned monitoring logs. Usually, the number of smoking times is represented by specific event markers (such as the start and end of smoking). Traverse the time-aligned logs and use counting methods to count the number of times users smoke. Extract the ID of each cartridge used from the time-aligned monitoring logs and find the corresponding flavor information. This usually requires accessing a predefined flavor database. Use dictionary lookup or database query methods to map the cartridge ID of each record to the corresponding flavor. Merge the cartridge flavor information of each record with the time-aligned logs to generate a new data structure containing timestamps, smoking events, and flavor classifications. Traverse the flavor classification data in the time-aligned monitoring logs, count the number of smoking times for each flavor, use a dictionary to store each flavor and its corresponding number of smoking times, organize the statistical number of smoking times for each cartridge flavor into structured data (such as a dictionary or DataFrame) for subsequent analysis and visualization, store the generated flavor smoking times data in the database, and generate user reports or visualization charts to help users understand their smoking habits and preferences.
[0115] In this embodiment, the specific steps of step S22 are:
[0116] Extracting parameterized data according to the historical operation monitoring log;
[0117] Performing standard numerical encoding on parameterized data to obtain a standard numerical encoding row monitoring log;
[0118] Perform global abnormal missing value detection on standard numerical encoding line monitoring logs and mark abnormal missing values;
[0119] Performing a sliding average calculation on the historical operation monitoring log to obtain a sliding average value;
[0120] Perform missing value filling processing on abnormal missing values according to the sliding average value and generate missing value filling monitoring log;
[0121] Perform timestamp synchronization on the missing value filling monitoring log to obtain a time-aligned monitoring log.
[0122] In this embodiment, the structure of the historical operation monitoring log is analyzed to determine the parameters that need to be extracted. For example, assuming that the log contains fields such as timestamp, event type, cartridge flavor, remaining power, etc., a programming language (such as Python) is used to read the log file and extract the required parameters. A JSON or CSV parsing tool is used to convert categorical variables (such as cartridge flavor) into numerical format using One-Hot Encoding. The categorical variables are encoded using the get_dummies method of Pandas, and the results are combined with the original data. The isnull method provided by Pandas is used to detect missing values. The number of missing values in each column is calculated to identify the rows with missing values. A new column is added to the data frame to mark the rows with missing values. Boolean tags are used to identify these rows. The sliding window size (for example, 3 data points or 5 data points) is determined to calculate the sliding average. The rolling method of Pandas is used to add the calculated sliding average to the data frame to facilitate subsequent missing value filling. The missing values are filled using the sliding average. Pandas The fillna method replaces missing values with sliding averages, ensuring that the timestamp format in the missing value filling monitoring log is unified. If necessary, format conversion is performed, and the filled logs are sorted by timestamp to ensure the continuity of the time series. The final time-aligned monitoring log is generated, which contains the timestamps, events, flavor information and remaining capacity of all records after filling.
[0123] In this embodiment, reference Figure 4 The above is a schematic flow chart of the detailed implementation steps of step S3. In this embodiment, the detailed implementation steps of step S3 include:
[0124] Step S31: Divide the time-aligned monitoring log into multiple time windows to obtain multiple time window monitoring logs;
[0125] Step S32: extracting the timestamp of each time window monitoring log based on multiple time window monitoring logs;
[0126] Step S33: performing different cigarette cartridge frequency distribution calculations on the puff count data of different cigarette cartridge flavors based on the timestamp, thereby obtaining frequency distribution data of each cigarette cartridge flavor;
[0127] Step S34: performing frequency trend analysis on the frequency distribution data of each cigarette cartridge flavor within a period to generate frequency trend change data of different cigarette cartridges;
[0128] Step S35: Perform frequency trend fitting on the frequency trend change data of different cigarette cartridges to construct frequency trend curves of multiple cigarette cartridge flavors.
[0129] In this embodiment, the size of the time window is determined, such as 1 hour, 1 day or 1 week, and the appropriate time span is selected according to the analysis requirements. Use the pd.Grouper method of Pandas to group the time-aligned monitoring logs by time window. Divide the log data into multiple sub-datasets according to the set time window. Store the data of each time window as an independent data frame for subsequent processing. For each time window monitoring log, extract its timestamp. Use a dictionary or list to store the timestamps of each time window. Generate a dictionary containing the timestamp of each time window for subsequent frequency distribution calculation. For each time window monitoring log, count the number of times different cartridge flavors are smoked. Use the groupby method to summarize by flavor. Arrange the cartridge flavors and their corresponding number of times smoked in each time window into a data frame or dictionary format. Select a suitable trend analysis method, such as linear regression, moving average, etc., according to the characteristics of the data. Perform trend analysis on the frequency distribution data of each cartridge flavor in different time windows, and calculate the frequency changes in each time window.
[0130] trend_analysis = {}
[0131] for flavor in frequency_distribution[next(iter(frequency_distribution))].index: # Get the flavor of the first window
[0132] flavor_trends = []
[0133] for key in frequency_distribution:
[0134] count = frequency_distribution[key].get(flavor, 0)
[0135] flavor_trends.append(count)
[0136] trend_analysis[flavor] = flavor_trends
[0137] Select a suitable fitting model according to the data characteristics, such as polynomial regression, exponential smoothing, etc. Use scikit-learn or numpy for fitting. Fit the frequency trend data of each cartridge flavor to generate a frequency trend curve.
[0138] import numpy as np
[0139] from sklearn.linear_model import LinearRegression
[0140] fit_results = {}
[0141] for flavor, trends in trend_analysis.items():
[0142] x = np.arange(len(trends)).reshape(-1, 1)
[0143] y = np.array(trends).reshape(-1, 1)
[0144] model = LinearRegression().fit(x, y)
[0145] fit_results[flavor] = model.predict(x)
[0146] Generate a data structure containing the frequency trend fitting results of each cartridge flavor for subsequent analysis and visualization.
[0147] In this embodiment, step S4 includes the following steps:
[0148] Step S41: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user;
[0149] Step S42: performing user behavior scenario analysis on the user location data of each time window based on the timestamp, thereby generating multiple user behavior scenarios;
[0150] Step S43: performing frequency distribution association mining on multiple user behavior scenarios based on the frequency distribution data of each cigarette cartridge flavor to obtain frequency distribution association data under different scenarios;
[0151] Step S44: performing scene frequency time series analysis on the frequency trend curves of multiple cigarette cartridge flavors based on the frequency distribution association data in different scenes, so as to obtain the cigarette cartridge frequency trend characteristics in multiple scenes.
[0152] In this embodiment, the user's health data, such as smoking history, physical health, age and gender, etc., are collected to calculate the user's safety assessment value. Based on the user's safety assessment value, an appropriate recommendation algorithm (such as content-based recommendation, collaborative filtering, etc.) is selected to generate a personalized smoking frequency recommendation strategy. According to the recommendation algorithm, a personalized smoking frequency is generated. For example, if a user has a low safety assessment value, it is recommended that the user reduce his smoking frequency. The generated personalized smoking recommendation strategy is stored in the user profile, and feedback can be provided to the user to help him understand the reason for the recommendation and how to follow it. The user's location information is extracted from the time-aligned monitoring log. The location data is obtained through GPS. Or other positioning services, combine the user's location information and timestamp, divide it into multiple time windows (such as hours, days, etc.) to analyze user behavior in different time periods, define different user behavior scenarios based on the user's location data and time information, such as "smoking at home", "smoking at work", etc., analyze the user's location in each time window, generate multiple user behavior scenarios, and store them in the data structure for subsequent analysis, obtain the frequency distribution data of each cartridge flavor from the previous step, which is usually a frequency data table containing different time windows and cartridge flavors, combine the user behavior scenarios and the frequency distribution of cartridge flavors, perform frequency distribution association mining, use association rule learning algorithms (such as Apriori algorithm) to discover the frequency distribution relationship in different scenarios, organize the frequency distribution association data in different scenarios, ensure that the data is arranged in scene and time order for time series analysis, select appropriate time series analysis methods (such as time series decomposition, seasonal adjustment) to analyze the frequency trend characteristics in different scenarios, use time series analysis tools (such as Statsmodels or Pandas) to analyze the frequency trend curve, extract trend, seasonality and periodicity characteristics, organize and store the analyzed frequency trend characteristics for subsequent use and report generation, and generate visual charts to help understand the changes in smoking behavior in different scenarios.
[0153] In this embodiment, the specific steps of step S42 are:
[0154] Perform location area scene judgment on the user location data of each time window to generate a location area scene for each time window, wherein the location area scene includes a home scene, an office scene, an outdoor scene, a leisure scene, and other unknown scenes;
[0155] Perform scene label clustering on the location area scene of each time window to obtain the location scene label for each time window;
[0156] A user behavior scenario analysis is performed on the location scenario tag of each time window based on the timestamp, thereby generating multiple user behavior scenarios.
[0157] In this embodiment, the user's location information, including longitude, latitude and timestamp, is extracted from the time-aligned monitoring log to form a location data set. Different location area scenarios are defined, including:
[0158] Home scenario: The user is at home.
[0159] Office scenario: users are in the workplace.
[0160] Outdoor scenario: The user is in a public place or outdoors.
[0161] Leisure scenario: users are in entertainment or social places.
[0162] Unknown scene: other scenes that cannot be identified. Use geographic location data and predefined scene rules (such as coordinate range, address information) to determine the user scene for each time window. For example: def determine_scene(location):
[0163] if is_home(location):
[0164] return 'Home scene'
[0165] elif is_office(location):
[0166] return 'Office scene'
[0167] elif is_outdoor(location):
[0168] return 'Outdoor scene'
[0169] elif is_leisure(location):
[0170] return 'Leisure scene'
[0171] else:
[0172] return 'Unknown scene'
[0173] Traverse the location information of each time window, apply the scene judgment algorithm, and generate the corresponding location area scene for each time window.
[0174] The scene data of each time window is organized into a structured dataset, including timestamps and corresponding scene labels.
[0175] Select a suitable clustering algorithm (such as K-Means, hierarchical clustering, etc.) to cluster the scene labels. Use the KMeans algorithm in the sklearn library.
[0176] from sklearn.cluster import KMeans
[0177] # Assume there is a number of scene labels
[0178] scene_labels = time_windows['scene'].unique()
[0179] kmeans = KMeans(n_clusters=len(scene_labels))
[0180] time_windows['scene_label'] = kmeans.fit_predict(time_windows[['latitude', 'longitude']])
[0181] Apply the clustering results to each time window to obtain the scene label of each time window. Standardize the clustered data for easy understanding and use. Merge the scene label with the time window data to form a new data structure for subsequent analysis. Define different user behavior scenarios based on the scene label and timestamp. For example, the user's smoking behavior in the home scene is different from that in the outdoor scene. Use frequency statistics or pattern recognition methods to analyze the user behavior under each scene label. Count the number of smoking times and duration in each scene. Organize the analysis results into structured data to form descriptions of multiple user behavior scenarios, such as "smoking behavior in the home scene". Use visualization tools (such as Matplotlib, Seaborn) to visualize the analysis results of user behavior scenarios and generate reports for users to view.
[0182] import seaborn as sns
[0183] import matplotlib.pyplot as plt
[0184] sns.barplot(x='scene', y='smoking_count', data=behavior_analysis)
[0185] plt.title('Number of times users smoke in different scenarios')
[0186] plt.show()
[0187] In this embodiment, the specific steps of step S5 are:
[0188] Step S51: performing time series evolution analysis on the frequency trend characteristics of the cigarette cartridges in multiple scenarios to generate frequency trend rules for multiple scenarios;
[0189] Step S52: simulating the evolution of multiple user behavior scenarios according to the frequency trend rules of multiple scenarios, thereby generating user smoking frequency simulation data of multiple scenarios;
[0190] Step S53: performing periodic smoking frequency prediction on the user smoking frequency simulation data of multiple scenarios to generate periodic smoking frequency prediction data of the user;
[0191] Step S54: Perform a smoking frequency safety assessment on the user's smoking frequency prediction data within a period to obtain a user safety assessment value;
[0192] Step S55: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user.
[0193] In this embodiment, the frequency trend data of cigarette cartridges in different scenarios are collected, and these data should include timestamps, scene labels, and the corresponding frequency of cigarette cartridges. Select an appropriate time series analysis method, such as time series decomposition, smoothing, or autoregressive moving average (ARMA) model, to analyze the evolution of frequency trends. Analyze the decomposition results, extract trends, seasonality, and residuals, and identify the frequency trend laws in different scenarios. For example, calculate the growth rate or periodic changes of each scenario. According to the frequency trend law, design a scene evolution model. Use a Markov model or a rule-based model to simulate the evolution of user behavior scenarios. Generate user smoking frequency simulation data for multiple scenarios using an evolution model. Use random number generation and frequency trend laws to generate simulated data that conforms to the characteristics of the scene. Organize the generated simulated data into structured data for subsequent analysis. For example, store the simulated smoking frequency of each scene in a data frame. Determine the analysis period, such as daily, weekly, or monthly, for frequency prediction. Select a suitable prediction model, such as ARIMA, SARIMA, or LSTM network, which is suitable for the prediction of time series data. Use the trained model to generate smoking frequency prediction data within the user cycle. Store the prediction results in a data frame for subsequent use and report generation. Set smoking frequency safety assessment criteria based on health guidelines or individual user differences. For example, set a safe upper limit for the number of cigarettes smoked per day. Evaluate the predicted smoking frequency data and calculate the user's safety assessment value. Use simple statistical methods, such as counting the number of times the safety limit is exceeded.
[0194] safe_limit = 10 # safe number of cigarettes per day
[0195] unsafe_count = sum(frequency>safe_limit for frequency in forecast)
[0196] user_safety_score = 1 - (unsafe_count / len(forecast))
[0197] Design a personalized smoking frequency recommendation strategy based on the user's safety assessment value. For example, users with low safety assessment values need to reduce their smoking frequency. Implement a recommendation algorithm to generate personalized smoking frequency recommendations.
[0198] def recommend_frequency(safety_score):
[0199] if safety_score == 'safety':
[0200] return recommended_frequency * 1.2 # Increase the recommended frequency
[0201] else:
[0202] return recommended_frequency * 0.5 # Reduce the recommended frequency
[0203] In this embodiment, the specific steps of step S6 are:
[0204] Step S61: Real-time visualization rendering of the user's personalized smoking recommendation strategy to generate a user's personalized recommendation visualization view;
[0205] Step S62: Mapping the current cartridge state to the user's personalized recommendation visualization view using the current cartridge state feature data to construct the current cartridge-personalized recommendation visualization view;
[0206] Step S63: Upload the current cartridge-personalized recommendation visualization view to the APP for cloud storage based on Bluetooth communication to complete the data visualization operation of the smart Bluetooth electronic cigarette.
[0207] In this example, data for a personalized smoking recommendation strategy for users is collected, including recommended smoking frequency, smoking flavors, and user health assessment information. Select a suitable visualization library, such as Matplotlib, Plotly, or D3.js, to generate a visualization view. Determine the layout of the visualization, including a bar chart of recommended smoking frequency, a pie chart of flavor preferences, and an indicator of user health status. Use the selected visualization library to render the personalized recommendation strategy. For example, to create an interactive chart using Plotly: import plotly.graph_objects as go
[0208] fig = go.Figure()
[0209] fig.add_trace(go.Bar(x=['recommended frequency'], y=[recommended_frequency], name='recommended frequency'))
[0210] fig.add_trace(go.Pie(labels=flavor_labels, values=flavor_counts, name='flavor preference'))
[0211] fig.update_layout(title='User personalized smoking recommendation strategy')
[0212] fig.show()
[0213] Get the current status data of the cartridge, including information such as battery level, remaining oil level, and usage history. Determine how to map the cartridge status features to the visualization. For example, use color coding or indicators to indicate the battery level and remaining oil level of the cartridge. Add the mapping of the cartridge status features to the visualization generated previously. For example, use color changes to indicate the battery level:
[0214] battery_color = 'green' if battery_level>20 else 'red'
[0215] fig.add_trace(go.Indicator(
[0216] mode="gauge+number",
[0217] value=battery_level,
[0218] title={'text': "Battery Power"},
[0219] gauge={'axis': {'range': [0, 100]}, 'bar': {'color': battery_color}} ))
[0221] Determine the protocol for Bluetooth communication, including data transmission format (such as JSON) and instruction set, in order to interact with smart Bluetooth e-cigarettes. Use Bluetooth libraries (such as PyBluez) to write code and upload the generated data of the current cartridge-personalized recommendation visualization view to the APP.
[0222] import bluetooth
[0223] def upload_visualization_data(data):
[0224] target_device = "XX:XX:XX:XX:XX:XX:XX" # Bluetooth address of the cigarette cartridge
[0225] sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
[0226] sock.connect((target_device, 1))
[0227] sock.send(data)
[0228] sock.close() connects the APP to a cloud storage platform (such as AWS S3, Firebase, etc.) to ensure that the uploaded data can be stored securely.
[0229] In this embodiment, a data visualization device for a smart Bluetooth electronic cigarette is provided, which is used to execute the data visualization method for a smart Bluetooth electronic cigarette as described above, including:
[0230] The real-time status module of the cigarette cartridge is used to obtain the real-time status information of the current cigarette cartridge; extract the ID information of the real-time status information of the current cigarette cartridge, and perform real-time status feature mining to generate the current cigarette cartridge status feature data;
[0231] The frequency statistics module is used to obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; count the number of times the user smokes in the historical operation monitoring log, and calculate the number of times the cigarette cartridge flavors are used, so as to generate the number of times the cigarette cartridge flavors are used;
[0232] The frequency distribution module is used to calculate the frequency distribution of different cartridges for the number of puffs of different cartridges, and to perform frequency trend analysis within a period to construct frequency trend curves for multiple cartridges flavors;
[0233] The scenario trend module is used to perform user behavior scenario analysis based on the frequency trend curves of multiple cartridge flavors, and then perform scenario frequency time series analysis to obtain the cartridge frequency trend characteristics in multiple scenarios;
[0234] The smoking frequency prediction module is used to predict the smoking frequency of cigarette cartridges in multiple scenarios in time series, so as to generate the smoking frequency prediction data within the user cycle; and to make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle, so as to generate a personalized smoking recommendation strategy for the user;
[0235] The visualization rendering module is used to visualize the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data, and build a current cigarette cartridge-personalized recommendation visualization view.
[0236] The present invention helps users understand their current smoking situation by acquiring cigarette cartridge status information in real time, improves users' real-time monitoring and perception capabilities of smoking behavior, generates current cigarette cartridge status feature data through real-time status information extraction and feature mining, provides basic data for subsequent analysis, helps users understand their smoking habits and taste preferences by counting the number of puffs and the number of cigarette cartridge flavors, provides historical data support for personalized recommendations, and generates puff number data and flavor number data to help users understand their smoking behavior more accurately. It helps users understand the distribution of smoking frequencies of different flavors through frequency distribution calculation and trend analysis of different cigarette cartridge flavors, provides data support for subsequent scenario analysis, constructs a frequency trend curve, intuitively displays the changing trend of smoking frequencies of various flavors over time, and helps users better understand smoking Changes in habits, user behavior scenario analysis based on frequency trend curves, helps users understand the characteristics of smoking behavior in different scenarios, and provides a basis for subsequent predictions and recommendations. Through scene frequency time series analysis, the frequency trend characteristics of cigarette cartridges in multiple scenarios are obtained to provide data support for smoking frequency prediction and recommendation. Smoking frequency prediction is performed based on the frequency trend characteristics of cigarette cartridges, and personalized smoking frequency recommendation decisions are generated to help users better manage their smoking behavior. Smoking frequency prediction data is generated to provide users with personalized smoking recommendation strategies, which helps users adjust their smoking frequency and improve the health management level of smoking behavior. Through visual rendering, a current cigarette cartridge-personalized recommendation visualization view is constructed, allowing users to intuitively understand personalized smoking recommendation strategies and current cigarette cartridge status characteristics, and improve users' cognition and management capabilities of smoking behavior.
[0237] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.
[0238] The above is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.
Claims
1. A data visualization method for a smart Bluetooth electronic cigarette, characterized in that: The following steps are involved: Step S1: Obtain the real-time status information of the current cartridge, and estimate the remaining capacity of the cartridge and count the usage time; Extract ID information from the current real-time status information of the cigarette cartridge and identify the flavor of the cigarette cartridge; Perform real-time state feature mining on the current cartridge usage time, the remaining capacity of the cartridge, and the current cartridge flavor information to generate current cartridge state feature data; Step S2: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; perform statistics on the number of times users smoke and classify the flavors of cigarette cartridges on the historical operation monitoring log, and calculate the number of times users smoke according to the cigarette cartridge flavor classification data, thereby generating data on the number of times users smoke for different cigarette cartridge flavors; Step S3: Calculate the smoking frequency distribution of different cigarette cartridge flavors based on the smoking frequency data of different cigarette cartridge flavors, and perform a smoking frequency trend analysis on the smoking frequency of different cigarette cartridge flavors within a period to construct smoking frequency trend curves of multiple cigarette cartridge flavors; Step S4: Performing user behavior scenario analysis based on the smoking frequency trend curves of multiple cigarette cartridge flavors, and then performing scenario frequency time series analysis to obtain smoking frequency trend characteristics of cigarette cartridges in multiple scenarios; Step S5: performing time series smoking frequency prediction on the smoking frequency trend characteristics of the cigarette cartridges in multiple scenarios, and generating smoking frequency prediction data within the user cycle based on the time series prediction model; performing personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle, and generating a personalized smoking recommendation strategy for the user; Step S6: Visualize and render the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data to construct a current cigarette cartridge-personalized recommendation visualization view.
2. The data visualization method for a smart Bluetooth electronic cigarette according to claim 1, characterized in that: The specific steps of step S1 are: Step S11: Perform encryption detection on the current cartridge based on the smart Bluetooth electronic cigarette, and extract the real-time status information of the current cartridge when the encryption detection passes; Step S12: extracting ID information from the current real-time status information of the cigarette cartridge to obtain the current cigarette cartridge ID information; Step S13: performing cigarette cartridge flavor identification on the current cigarette cartridge ID information based on a preset flavor database to generate current cigarette cartridge flavor information; Step S14: estimating the residual capacity of the cigarette cartridge based on the current real-time status information of the cigarette cartridge to generate a residual capacity value of the cigarette cartridge; Step S15: Perform usage time statistics on the real-time status information of the current cigarette cartridge to obtain the current cigarette cartridge usage time; Step S16: Perform real-time state feature mining on the current cartridge usage time, the residual capacity value of the cartridge, and the current cartridge flavor information, so as to generate current cartridge state feature data.
3. The data visualization method for a smart Bluetooth electronic cigarette according to claim 1, characterized in that: The specific steps of step S2 are: Step S21: Obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; Step S22: performing timestamp synchronization processing on the historical operation monitoring log, thereby obtaining a time-aligned monitoring log; Step S23: Counting the number of times the user smokes from the time-aligned monitoring log, and extracting the data on the number of times the user smokes; Step S24: classifying the flavors of cigarette cartridges in the time-aligned monitoring logs to obtain the user's cigarette cartridge flavor classification data; Step S25: Calculate the number of puffs per cigarette cartridge flavor based on the user's cigarette cartridge flavor classification data, thereby generating puff data for different cigarette cartridge flavors.
4. The data visualization method for a smart Bluetooth electronic cigarette according to claim 3, characterized in that: The specific steps of step S22 are: Extracting parameterized data according to the historical operation monitoring log; Performing standard numerical encoding on parameterized data to obtain a standard numerical encoding row monitoring log; Perform global abnormal missing value detection on standard numerical encoding line monitoring logs and mark abnormal missing values; Performing a sliding average calculation on the historical operation monitoring log to obtain a sliding average value; Perform missing value filling processing on abnormal missing values according to the sliding average value and generate missing value filling monitoring log; Perform timestamp synchronization on the missing value filling monitoring log to obtain a time-aligned monitoring log.
5. The data visualization method for a smart Bluetooth electronic cigarette according to claim 3, characterized in that: The specific steps of step S3 are: Step S31: Divide the time-aligned monitoring log into multiple time windows to obtain multiple time window monitoring logs; Step S32: extracting the timestamp of each time window monitoring log based on multiple time window monitoring logs; Step S33: calculating the smoking frequency distribution of different cigarette cartridge flavors for the smoking frequency data of different cigarette cartridge flavors based on the timestamp, thereby obtaining the smoking frequency distribution data of each cigarette cartridge flavor; Step S34: performing frequency trend analysis on the smoking frequency distribution data of each cigarette cartridge flavor within a period to generate smoking frequency trend change data of different cigarette cartridges; Step S35: Perform frequency trend fitting on the smoking frequency trend change data of different cigarette cartridges to construct smoking frequency trend curves of multiple cigarette cartridge flavors.
6. The data visualization method for a smart Bluetooth electronic cigarette according to claim 5, characterized in that: The specific steps of step S4 are: Step S41: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user; Step S42: performing user behavior scenario analysis on the user location data of each time window based on the timestamp, thereby generating multiple user behavior scenarios; Step S43: performing frequency distribution association mining on multiple user behavior scenarios based on the smoking frequency distribution data of each cigarette cartridge flavor to obtain smoking frequency distribution association data in different scenarios; Step S44: performing scene frequency time series analysis on the smoking frequency trend curves of multiple cigarette cartridge flavors based on the smoking frequency distribution association data in different scenes, so as to obtain the smoking frequency trend characteristics of the cigarette cartridges in multiple scenes.
7. The data visualization method for a smart Bluetooth electronic cigarette according to claim 6, characterized in that: The specific steps of step S42 are: Perform location area scene judgment on the user location data of each time window to generate a location area scene for each time window, wherein the location area scene includes a home scene, an office scene, an outdoor scene, a leisure scene, and other unknown scenes; Perform scene label clustering on the location area scene of each time window to obtain the location scene label for each time window; A user behavior scenario analysis is performed on the location scenario tag of each time window based on the timestamp, thereby generating multiple user behavior scenarios.
8. The data visualization method for a smart Bluetooth electronic cigarette according to claim 1, characterized in that: The specific steps of step S5 are: Step S51: performing time series evolution analysis on the smoking frequency trend characteristics of the cigarette cartridges in multiple scenarios to generate smoking frequency trend rules for multiple scenarios; Step S52: simulating the scene evolution of multiple user behavior scenes according to the smoking frequency trend rules of multiple scenes, thereby generating user smoking frequency simulation data of multiple scenes; Step S53: performing periodic smoking frequency prediction on the user smoking frequency simulation data of multiple scenarios to generate periodic smoking frequency prediction data of the user; Step S54: Perform a smoking frequency safety assessment on the user's smoking frequency prediction data within a period to obtain a user safety assessment value; Step S55: making a personalized smoking frequency recommendation decision based on the user safety assessment value to generate a personalized smoking recommendation strategy for the user.
9. The data visualization method for a smart Bluetooth electronic cigarette according to claim 1, characterized in that: The specific steps of step S6 are: Step S61: Real-time visualization rendering of the user's personalized smoking recommendation strategy to generate a user's personalized recommendation visualization view; Step S62: Mapping the current cartridge state to the user's personalized recommendation visualization view using the current cartridge state feature data to construct the current cartridge-personalized recommendation visualization view; Step S63: Upload the current cartridge-personalized recommendation visualization view to the APP for cloud storage based on Bluetooth communication to complete the data visualization operation of the smart Bluetooth electronic cigarette.
10. A data visualization device for a smart Bluetooth electronic cigarette, characterized in that: The method for performing data visualization for a smart Bluetooth electronic cigarette according to claim 1 comprises: The real-time status acquisition module of the cigarette cartridge is used to obtain the real-time status information of the current cigarette cartridge, estimate the remaining capacity of the cigarette cartridge and count the usage time; extract the ID information of the real-time status information of the current cigarette cartridge and identify the flavor of the cigarette cartridge; perform real-time status feature mining on the current cigarette cartridge usage time, the remaining capacity value of the cigarette cartridge and the current cigarette cartridge flavor information, so as to generate the current cigarette cartridge status feature data; The frequency statistics module is used to obtain the historical operation monitoring log of the smart Bluetooth electronic cigarette; perform user smoking frequency statistics and cigarette cartridge flavor classification on the historical operation monitoring log, and calculate the cigarette cartridge flavor frequency on the user smoking frequency data according to the user cigarette cartridge flavor classification data, thereby generating smoking frequency data of different cigarette cartridge flavors; The frequency distribution module is used to calculate the smoking frequency distribution of different cigarette cartridge flavors based on the smoking frequency data of different cigarette cartridge flavors, and to perform a smoking frequency trend analysis within a period on the smoking frequency trends of different cigarette cartridge flavors, and to construct smoking frequency trend curves of multiple cigarette cartridge flavors; The scenario trend module is used to perform user behavior scenario analysis based on the smoking frequency trend curves of multiple cartridge flavors, and then perform scenario frequency time series analysis to obtain the smoking frequency trend characteristics of the cartridges in multiple scenarios; The smoking frequency prediction module is used to perform time-series smoking frequency prediction based on the smoking frequency trend characteristics of cigarette cartridges in multiple scenarios to generate smoking frequency prediction data within the user cycle; and to make personalized smoking frequency recommendation decisions based on the smoking frequency prediction data within the user cycle to generate a personalized smoking recommendation strategy for the user; The visualization rendering module is used to visualize the user's personalized smoking recommendation strategy and the current cigarette cartridge status feature data, and build a current cigarette cartridge-personalized recommendation visualization view.
Citation Information
Patent Citations
Clinical interface
CN105407949A
Systems and methods for assisting in smoking cessation
US20240081647A1