A CUPS printing management and control system based on machine learning
The CUPS print management and control system based on machine learning solves the problems of unpredictable equipment status and insufficient user behavior analysis in existing technologies. It realizes multi-dimensional real-time monitoring of equipment status and fault prediction, improves equipment utilization and user satisfaction, supports personalized optimization and resource allocation, and reduces maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-05-12
AI Technical Summary
Existing CUPS printing systems have shortcomings in areas such as unpredictable equipment status, difficulty in real-time diagnosis of printing anomalies, unquantifiable lifespan of key components, lack of user behavior analysis and adaptive optimization control, resulting in high maintenance costs, low equipment utilization, and difficulty in achieving personalized optimization.
The CUPS print management and control system, based on machine learning, achieves real-time equipment status assessment, fault prediction, component life estimation, and personalized optimization through multi-source data acquisition, feature construction and fusion, machine learning predictive analysis, and adaptive control.
It enables multi-dimensional, accurate, real-time monitoring and prediction of printer status, reducing downtime, lowering maintenance costs, improving equipment utilization and user satisfaction, supporting personalized optimization and resource allocation, and improving overall printing efficiency.
Smart Images

Figure CN121807238B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing and print management technology, specifically to a CUPS print management and control system based on machine learning. In particular, it relates to the efficient management of print-related data using machine learning algorithms, big data resource services, databases, and cloud database services, and is suitable for collaborative management and intelligent maintenance of multiple printers under UNIX-like systems such as Linux and macOS. Background Technology
[0002] In UNIX-like systems such as Linux and macOS, CUPS is a widely used print service framework that provides print job management, driver interfaces, and logging functions. Traditional printing systems mainly rely on logging, manual observation, or single threshold rules to manage device status, such as triggering maintenance through events like low consumable alarms or excessive temperature warnings.
[0003] The existing technology has the following drawbacks:
[0004] 1. Unpredictable equipment status: Existing CUPS systems record printing tasks and error information through text logs, lacking structured analysis and real-time processing capabilities. Faults (such as paper jams and abnormal temperatures) are only discovered after they occur, resulting in long downtime and high maintenance costs.
[0005] 2. Printing anomalies cannot be diagnosed in real time: Relying on manual observation or single threshold rules (such as insufficient consumable alarms), there is a lack of predictive ability for abnormal trends and potential risks, making it difficult to handle frequent printing anomalies, abnormal consumption of consumables, and module load problems in a timely manner.
[0006] 3. Component lifespan cannot be monitored: The wear and performance degradation of critical components (such as fuser assembly and paper feed assembly) cannot be quantified in terms of remaining service life (RUL). Maintenance cycles rely on experience, which may lead to premature replacement, wasting costs, or delayed maintenance, causing failures.
[0007] 4. Lack of user behavior analysis and personalized optimization: Printing behavior varies significantly in a multi-user environment, but existing systems struggle to model user printing frequency, job type, and peak usage periods, making it impossible to generate personalized optimization parameters and scheduling strategies.
[0008] 5. Lack of self-repair and module capability assessment mechanisms: The existing system lacks automated troubleshooting functions, requiring manual intervention when anomalies occur, which reduces equipment utilization and cannot provide reference data for hardware optimization. Summary of the Invention
[0009] To address the problems of unpredictable equipment status, difficulty in real-time diagnosis of printing anomalies, unquantifiable lifespan of key components, lack of user behavior analysis and adaptive optimization control in existing CUPS printing systems, this invention provides a CUPS printing management and control system based on machine learning, which can achieve real-time equipment status assessment, early fault prediction, component lifespan estimation, and adaptive optimization control.
[0010] The present invention achieves the above objectives through the following technical solutions:
[0011] A machine learning-based CUPS print management and control system, applied in computer terminals, print servers, or centralized management nodes, includes:
[0012] The data acquisition and status monitoring layer collects at least one of the following types of data in real time through multi-source heterogeneous data interfaces: CUPS log data, driver layer events, printer internal sensor data, and user operation behavior data.
[0013] The feature construction and data fusion layer is used to preprocess the collected data, extract features, and construct a feature vector space containing multi-dimensional related features through a feature weighted fusion algorithm.
[0014] The machine learning predictive analytics layer is configured to use an integrated learning framework to implement the following functions: printing anomaly identification, consumable anomaly detection, potential fault prediction, critical component remaining life assessment, and user behavior analysis. Specifically, the anomaly detection model module is used to identify printing anomalies and consumable anomalies in real time; the fault prediction model module is used to predict potential faults; the remaining life prediction model module is used to assess the remaining lifespan of critical components; and the user behavior clustering model module uses KMeans or GMM algorithms to analyze user printing habits and generate personalized printing parameters and scheduling strategies.
[0015] The strategy generation and adaptive control layer is configured to dynamically execute at least one of the following operations based on the prediction results: risk level mapping, self-healing instruction generation, load regulation, and parameter optimization.
[0016] According to the present invention, a machine learning-based CUPS print management and control system includes a data acquisition and status monitoring layer comprising:
[0017] The CUPS log acquisition module is used to collect CUPS log data, including at least print job information, error logs, and queue status.
[0018] The driver-layer event monitoring module is used to monitor print job events and printing status.
[0019] The printer sensor data acquisition module is used to collect data from the printer's internal sensors, including at least temperature, motor speed, paper feed / output status, and consumable information.
[0020] The user operation behavior collection module is used to collect user operation sequences, parameter setting habits, and user usage time patterns.
[0021] According to the present invention, a CUPS print management and control system based on machine learning, the CUPS log acquisition module is configured as follows:
[0022] The CUPS service provides the ippGetJobAttributes() interface to obtain print job information in real time, including job ID, submission time, completion status, error code, and consumable consumption. A regular expression rule base is built to parse the / var / log / cups / error_log file and extract the error type, occurrence timestamp, associated job ID, and device identifier.
[0023] A dual-thread polling mechanism is used to monitor the CUPS-LPD queue status. In the main thread, a standard queue query is performed at intervals to obtain the queue length, the number of blocked jobs, and the priority distribution. In the auxiliary thread, when the queue length change rate is detected to be greater than a preset threshold, an emergency polling is triggered and the queue mutation event is recorded.
[0024] According to the CUPS print management and control system based on machine learning provided by the present invention, the driver layer event monitoring module is configured as follows:
[0025] Deploy dynamically loadable kernel modules in the PPD driver layer of the Linux kernel and register the following driver hook functions.
[0026] ppd_command_hook: Intercepts the PJL instruction stream sent by the PPD driver layer and parses the event type of the printing task;
[0027] io_control_hook: Monitors device I / O operations and captures data transmission events.
[0028] Capture and print status change signals in real time by subscribing to the following signal interfaces of the org.cups.cupsd service via the D-Bus communication protocol:
[0029] JobCreated: Captures the new task creation event and extracts the task ID, submitting user, and job size;
[0030] JobStateChanged: Monitors task state changes and records state transition timestamps;
[0031] PrinterStateChanged: Responds to changes in printer state and associates the affected print jobs;
[0032] Establish a state machine model to track the lifecycle of the printing task and record the state transition time of each stage from "receive" to "complete".
[0033] Establish a mapping table linking kernel events, user events, and state machine data to achieve the following fusion analysis:
[0034] Associate the @PJL SET MEDIA=A4 command intercepted by ppd_command_hook with the job size in the JobCreated event to verify paper type matching.
[0035] When the state machine detects the PROCESSING→FAILED transition, it traces the PJL instruction stream and D-Bus error events within the last 10 seconds to generate a fault root cause chain.
[0036] According to the CUPS print management and control system based on machine learning provided by the present invention, the printer sensor data acquisition module is configured as follows:
[0037] Supports multiple protocol adapters simultaneously:
[0038] The SNMP protocol periodically polls and reads the printer MIB library, reading the following object identifiers: HRDeviceStatus - device status, prtMarkerSuppliesLevel - remaining consumables, and prtInputMediaDimUnits - paper size.
[0039] The vendor's proprietary protocol parses the temperature sensor in the 0x08 command group, extracts real-time motor speed data from the ESC i instruction set, and supports dynamically loading the .dll / .so library provided by the vendor through the configuration file to achieve non-standard protocol extensions;
[0040] The paper feeding / output status is detected by photoelectric encoder, and the position of paper jam is located by Hall sensor array. The output is three-dimensional coordinates, where X = sensor number, Y = distance in paper feeding direction, and Z = paper layer thickness.
[0041] Deploy consumable identification chips and use Time Division Multiple Access (TDMA) technology to read multiple tags simultaneously, including at least reading RFID tags to obtain ink / toner cartridge model, remaining quantity, and production batch information.
[0042] According to the CUPS print management and control system based on machine learning provided by the present invention, the user operation behavior acquisition module is configured as follows:
[0043] Inject JavaScript code into the CUPS web interface to record user operation sequences and parameter modification behaviors;
[0044] The mouse click coordinates are parsed from the Xorg server logs and mapped to the control elements in the print settings panel;
[0045] Time series analysis algorithms are used to identify user usage time patterns, including: high-frequency usage periods, parameter setting preferences, and abnormal operation sequences.
[0046] According to the present invention, a machine learning-based CUPS print management and control system includes a feature construction and data fusion layer comprising:
[0047] The log data preprocessing module performs word segmentation, cleaning, and structuring on CUPS log data;
[0048] The sensor data preprocessing module performs normalization, time alignment, and anomaly removal on the sensor data.
[0049] The user behavior sequence analysis module models, analyzes the frequency and patterns of user operation sequences;
[0050] The feature extraction module is used to extract abnormal features, consumable features, load features, and user behavior features.
[0051] The multi-dimensional feature fusion module fuses the extracted features to construct a unified feature vector space.
[0052] According to the CUPS print management and control system based on machine learning provided by the present invention, the log data preprocessing module is configured as follows:
[0053] Regular expression matching algorithms were used to segment CUPS log data and extract key fields containing ERROR_CODE, JOB_ID, and TIMESTAMP.
[0054] The sliding window statistical method is used to clean up abnormal log entries. The window size is set to H log entries, and redundant data with a duplication rate of more than 80% is removed.
[0055] The cleaned logs are converted into structured data through a JSON Schema validation mechanism, and a standardized template containing 12 core fields is defined.
[0056] According to the CUPS print management and control system based on machine learning provided by the present invention, the sensor data preprocessing module is configured as follows:
[0057] Perform Min-Max normalization on the sensor data to map the values to the [0,1] interval;
[0058] A dynamic time warping algorithm is used to achieve time alignment of multi-sensor data;
[0059] Outlier data points are detected based on the 3σ principle, and values exceeding the mean ± 3 times the standard deviation are corrected using median interpolation.
[0060] According to the CUPS print management and control system based on machine learning provided by the present invention, the user behavior sequence parsing module is configured as follows:
[0061] A finite state automaton model is constructed to perform grammatical parsing on user operation sequences, and transition rules containing multiple operation states are defined, including basic operation states, compound operation states, and abnormal states.
[0062] The TF-IDF algorithm is used to calculate the frequency weights of user parameter setting behaviors, generating a 16-dimensional behavior feature vector. This includes: term dictionary construction: extracting high-frequency parameter items from historical operation logs to form a dictionary containing 128 terms; term frequency (TF) calculation: counting the occurrence frequency of each parameter in the current user operation sequence and normalizing it to the [0,1] interval; inverse document frequency (IDF) calculation: calculating the rarity weights of parameters based on the global user dataset; and TF-IDF feature vector generation: calculating the TF×IDF value for each parameter and selecting the top 16 parameters with the highest weights to form the behavior feature vector.
[0063] The operation patterns are analyzed using a Markov chain model, the state transition probability matrix is calculated, and high-frequency operation paths are identified.
[0064] According to the present invention, a CUPS printing management and control system based on machine learning includes a feature extraction module that uses multimodal data fusion technology to achieve feature engineering of equipment status and user behavior, specifically including:
[0065] Anomaly feature extraction submodule:
[0066] Perform a sliding window scan on the processed CUPS log data to extract N-gram features and construct an error code co-occurrence network;
[0067] The Isolation Forest algorithm is used to detect abnormal patterns in the sensor data stream for each data point. x Calculate its average path length across all trees. h ( x Normalization yields outlier scores. s ( x );
[0068] Consumables Feature Extraction Submodule:
[0069] The LSTM network is used to predict the remaining consumables trend. The input window size is the consumption data of the previous 10 time points. Each time point contains 3-dimensional features: number of printed pages, ink coverage, and device working time. The fully connected layer outputs the predicted value of the remaining consumables for the next 3 time points.
[0070] The standard deviation of the consumable replacement cycle is calculated as a characteristic of usage stability.
[0071] Load feature extraction submodule:
[0072] Perform a short-time Fourier transform on the motor speed data to extract the energy proportion characteristics in the 10Hz~100Hz frequency band;
[0073] Calculate the peak load ratio of the print queue status data;
[0074] User behavior feature extraction submodule:
[0075] The K-means++ algorithm was used to cluster user operation sequences, with the number of clusters K=5 and the silhouette coefficient calculated to optimize the clustering effect.
[0076] Extract the entropy value of the user usage time period distribution as a behavioral regularity feature.
[0077] According to the CUPS print management and control system based on machine learning provided by the present invention, the multi-dimensional feature fusion module is configured as follows:
[0078] The weight coefficients of various features are calculated through an attention mechanism, where the weight of log features is set as a, the weight of sensor features is set as b, and the weight of user behavior features is set as c.
[0079] The weighted feature vectors are concatenated into a 32-dimensional unified feature vector according to a preset dimensional structure. The specific dimensional allocation is as follows:
[0080] The first 8 dimensions: anomaly feature sub-vectors, which are formed by concatenating log features and sensor features according to their weights;
[0081] The middle 12 dimensions: load feature sub-vectors, which are formed by concatenating the motor operating parameter features and queue status features according to their weights;
[0082] The last 12 dimensions: user behavior feature sub-vectors, which are composed of user operation sequence features and usage time period features weighted and concatenated;
[0083] PCA dimensionality reduction is performed on the 32-dimensional unified feature vector, and principal components are automatically selected based on a cumulative contribution rate of ≥95% to generate a dimensionality-reduced low-dimensional feature vector.
[0084] According to the CUPS print management and control system based on machine learning provided by the present invention, in the machine learning predictive analysis layer, the anomaly detection model module adopts a combination strategy of rule constraints + unsupervised anomaly detection model + dynamic threshold to identify printing anomalies and consumable anomalies in real time; the fault prediction model module adopts a fault prediction strategy of anomaly trend analysis + time series prediction model + multi-source feature fusion to predict potential faults; and the remaining life prediction model module adopts a remaining life prediction strategy of degradation feature modeling + life regression prediction + dynamic update to assess the remaining life of key components.
[0085] According to the present invention, a machine learning-based CUPS print management and control system includes an anomaly detection model module configured to employ a three-level fusion detection architecture.
[0086] The rule constraint layer includes:
[0087] Build a rule base based on expert knowledge, containing at least 127 explicit rules;
[0088] It uses the Drools rule engine to achieve millisecond-level rule matching and supports hot-loading of new / modified rules via RESTful interface or configuration file;
[0089] Unsupervised detection layers include:
[0090] Deploy the improved Isolation Forest model and optimize it in the following ways:
[0091] Feature correlation weighting: Calculate the Pearson correlation coefficient between input features. For feature pairs with a correlation coefficient > 0.7, multiply their weight by 1.5 before inputting them into the model.
[0092] Dynamic sample sampling: The number of training samples in each batch is dynamically determined according to the formula N=R×1000, where R is the historical anomaly rate;
[0093] Perform real-time detection on the sensor data stream and output a normalized anomaly score. S∈[0,1] ,in S=1 Indicates the highest probability of an anomaly;
[0094] Dynamic thresholding layer, including:
[0095] The threshold is dynamically adjusted based on the EWMA algorithm, and the calculation formula is as follows: T t = α·X t + (1-α)·T t-1 , in X t The mean of the outlier scores for the current batch is given, and α is the smoothing factor. Tt-1 The threshold value for the previous batch;
[0096] Construct an adaptive threshold function by combining historical anomaly distributions: T t = μ t + k·σ t , in μ t This represents the average of the abnormal scores for the current batch. σ t Standard deviation k The value will be adjusted in stages;
[0097] When the abnormal score exceeds S>T t At that time, a three-level alarm mechanism is triggered.
[0098] According to the present invention, a fault prediction model module of a CUPS print management and control system based on machine learning is configured to adopt a multimodal fusion prediction architecture.
[0099] The abnormal trend analysis submodule includes:
[0100] Perform STL decomposition on the sensor data to extract the trend term, seasonal term, and residual term;
[0101] The trend term is smoothed using a Hodrick-Prescott filter, and the objective function is optimized as follows: min{Σ (T t - Y t ) 2 + λΣ[(T t+1 - T t ) - (T t - T t-1 )] 2 } ,in T t 'The trend term obtained after STL decomposition and Hodrick-Prescott filter processing at time...' t The value, Y t Let be the raw data value collected by the sensor at time t, and λ be the smoothing parameter. T t+1 '、 T t-1 'These represent the trend term at time t+1 and time t, respectively. The value of 1;
[0102] The core submodule of time series prediction includes:
[0103] Building a dual-channel LSTM network:
[0104] Channel 1: Input normalized sensor data, hidden layer dimension 64, output dimension 32;
[0105] Channel 2: One-hot encoding of input log error codes, hidden layer dimension 32, output dimension 16;
[0106] The two-channel outputs are fused through an attention mechanism, where the attention weights are optimized using KL divergence, with the optimization objective being to minimize the difference in the distribution of the two-channel outputs.
[0107] The multi-source feature fusion submodule includes:
[0108] Access user behavior characteristics and consumable characteristics, and then combine them with trend analysis results and time series prediction outputs;
[0109] XGBoost was used to sort the features by importance, and the top 15 features were retained based on their F1 scores.
[0110] The prediction output submodule includes:
[0111] Based on the fused feature vectors, the probability of failure in the next 24 hours is output. P∈[0%,100%] and fault type classification;
[0112] When the probability is greater than 75%, a maintenance work order is automatically generated and pushed to the operation and maintenance system.
[0113] According to the present invention, a machine learning-based CUPS print management and control system, including a remaining life prediction model module, comprises:
[0114] The degradation feature modeling submodule is configured as follows:
[0115] Multi-domain feature extraction is performed on the time-series data of motor speed, including:
[0116] Time domain: root mean square value, peak factor;
[0117] Frequency domain: band energy ratio, spectral entropy;
[0118] A sliding window is used to calculate the feature trend, where the window size is set to 100 sampling points, the overlap rate is 50%, the sliding step size is 50 sampling points, and an equally spaced feature time series is generated.
[0119] The lifetime regression prediction submodule is configured as follows:
[0120] Construct a Wiener process degradation model and define the state-space equation as follows:
[0121] X ( t )= X (0)+ μt + σB ( t )
[0122] Where X(t) is the degenerate state variable at time t; X(0) is the initial degenerate state, which follows the order N(μ0, σ0). 2 ) distribution, μ is the drift coefficient, σ is the diffusion coefficient; μ0 is the mean of the initial degenerate state X(0), σ0 is the standard deviation of the initial degenerate state X(0); B(t) is the standard Brownian motion;
[0123] The particle filter algorithm is used to estimate the posterior distribution of the remaining lifetime (RUL), including: initialization: generating N=1000 particles, sampled from the prior distribution N(X(0), σ0). 2 Prediction step: Update particle state according to state equation; Update step: Calculate particle weight based on new observation data and avoid degradation through resampling; RUL estimation: RUL = inf{t | X(t) ≥ Θ}, where Θ is the failure threshold;
[0124] The dynamic update mechanism submodule is configured as follows:
[0125] Every 10 hours of new running data triggers a re-estimation of model parameters, recalculating the maximum likelihood estimate of the drift coefficient μ.
[0126] When the predicted remaining lifetime (RUL) is less than 72 hours, the spare component preheating procedure is initiated, and an early warning message is pushed to the maintenance terminal via the MQTT protocol.
[0127] According to the present invention, a machine learning-based CUPS print management and control system includes a strategy generation and adaptive control layer comprising:
[0128] The risk level assessment module determines the risk level based on the prediction results, classifying it into low risk, medium risk, and high risk.
[0129] The exception type mapping strategy module maps exception types to a preset strategy mapping table;
[0130] The adaptive parameter optimization generation module generates printing parameter optimization strategies based on user behavior and device status.
[0131] The maintenance strategy generation module generates recommended strategies for preventative maintenance and component replacement.
[0132] The self-repair command generation module generates self-repair commands that include at least calibration, reset, and soft reboot.
[0133] The closed-loop monitoring module verifies and provides feedback on the execution results, forming a closed-loop intelligent control system.
[0134] Therefore, compared with the existing technology, the CUPS print management and control system based on machine learning proposed in this invention has the following beneficial effects:
[0135] 1. This invention comprehensively collects CUPS logs, drive events, printer internal sensor data, and user operation behavior to form a structured, multidimensional dataset. This allows printer status monitoring to move beyond a single data source and integrate multi-dimensional information for a more comprehensive and accurate status assessment. For example, during print job execution, the system can capture not only the printer's hardware status (such as temperature and motor speed) but also combine software logs (such as error codes and job failure rates) and user operating habits to provide a rich and accurate data foundation for intelligent analysis.
[0136] 2. The system of this invention supports printer status management across operating systems and multi-user environments. At the same time, concurrent management in a multi-user environment is realized, and the printing needs and behavior patterns of different users can be analyzed independently, providing the possibility for personalized optimization.
[0137] 3. This invention, by utilizing anomaly detection models, fault prediction models, and remaining life prediction models, can identify printing anomalies and consumable anomalies in real time and predict potential faults in advance, significantly improving printer availability and reducing downtime caused by sudden failures. For example, in the early stages of an abnormal rise in the temperature of the heating component, the system can issue an early warning and automatically adjust printing parameters or trigger maintenance procedures, avoiding printing failures and equipment damage caused by excessive temperature.
[0138] 4. By predicting malfunctions in advance, this invention guides users to perform preventative maintenance, avoiding unplanned emergency repairs, reducing maintenance costs, and extending equipment lifespan. Simultaneously, the system's real-time detection and alarm function for abnormal consumable consumption effectively prevents printing interruptions due to consumable depletion, further reducing operating costs.
[0139] 5. This invention utilizes a user behavior clustering model, enabling the system to analyze the printing habits of different users and generate personalized printing parameters and scheduling strategies. This allows users to adjust printing settings according to their needs, improving printing efficiency and satisfaction. For example, for high-frequency printing users, the system can optimize print queue management and reduce waiting time; for users with special requirements for print quality, the system can automatically adjust printing precision and color settings.
[0140] 6. Through in-depth analysis of user behavior, the system can achieve optimized resource allocation. For example, during peak printing periods, the system can intelligently schedule printer resources based on the user's printing frequency and job type to avoid idle or overused resources. At the same time, the improved resource utilization efficiency not only reduces energy consumption and consumable consumption but also improves overall printing efficiency.
[0141] 7. This invention can automatically generate maintenance strategies and self-repair operations based on prediction results, including calibration, reset, load limiting operation, and task scheduling optimization, significantly reducing the need for manual intervention and improving the automation level of equipment management. For example, when printer component wear or performance degradation is detected, the system can automatically trigger the maintenance process, completing component replacement or parameter adjustment without manual intervention.
[0142] 8. Through automatic maintenance and adaptive optimization control, this invention can effectively extend the lifespan of the printer. For example, the system can dynamically adjust printing parameters and load distribution according to the actual usage of the printer, avoiding accelerated wear of components due to overuse. At the same time, the system's real-time monitoring and early warning functions for equipment status can also promptly detect and address potential problems, preventing minor faults from escalating into major ones.
[0143] 9. This invention supports collaborative management of multiple printers. By centrally managing multiple printers, the system can achieve unified allocation and optimized configuration of resources, improving overall printing efficiency. Simultaneously, the system can monitor and issue early warnings for the status of multiple printers in real time, ensuring the stable operation of the entire printing environment. The system design considers the needs of large-scale user environments, supporting concurrent access and printing needs of a large number of users. This allows the system to be widely used in scenarios such as schools, libraries, and corporate office areas, meeting the printing management needs of users of different sizes.
[0144] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Attached Figure Description
[0145] Figure 1 This is a schematic diagram of an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0146] Figure 2 This is a schematic diagram of the feature extraction module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0147] Figure 3 This is a schematic diagram of the anomaly detection model module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0148] Figure 4This is a schematic diagram of the fault prediction model module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0149] Figure 5 This is a schematic diagram of the remaining life prediction model module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0150] Figure 6 This is an execution flowchart of the CUPS log collection module in an embodiment of a machine learning-based CUPS print management and control system of the present invention.
[0151] Figure 7 This is an execution flowchart of the event monitoring module in the driver layer of an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0152] Figure 8 This is an execution flowchart of the printer sensor data acquisition module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0153] Figure 9 This is an execution flowchart of the user operation behavior collection module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0154] Figure 10 This is an execution flowchart of the log data preprocessing module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0155] Figure 11 This is an execution flowchart of the sensor data preprocessing module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0156] Figure 12 This is an execution flowchart of the user behavior sequence parsing module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention.
[0157] Figure 13 This is an execution flowchart of the multi-dimensional feature fusion module in an embodiment of a CUPS print management and control system based on machine learning according to the present invention. Detailed Implementation
[0158] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0159] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0160] See Figures 2 to 4 This embodiment provides a CUPS print management and control system based on machine learning, which is applied to computer terminals, print servers, or centralized management nodes. The system includes:
[0161] The data acquisition and status monitoring layer collects at least one of the following types of data in real time through multi-source heterogeneous data interfaces: CUPS log data, driver layer events, printer internal sensor data, and user operation behavior data.
[0162] The feature construction and data fusion layer is used to preprocess the collected data, extract features, and construct a feature vector space containing multi-dimensional related features through a feature weighted fusion algorithm.
[0163] The machine learning predictive analytics layer is configured to use an integrated learning framework to achieve the following functions: print anomaly identification, consumable anomaly detection, potential failure prediction, critical component remaining life assessment, and user behavior analysis.
[0164] The strategy generation and adaptive control layer is configured to dynamically execute at least one of the following operations based on the prediction results: risk level mapping, self-healing instruction generation, load regulation, and parameter optimization.
[0165] In this embodiment, the data acquisition and status monitoring layer includes:
[0166] The CUPS log acquisition module is used to collect CUPS log data, including at least print job information, error logs, and queue status.
[0167] The driver-layer event monitoring module is used to monitor print job events and printing status.
[0168] The printer sensor data acquisition module is used to collect data from the printer's internal sensors, including at least temperature, motor speed, paper feed / output status, and consumable information.
[0169] The user operation behavior collection module is used to collect user operation sequences, parameter setting habits, and user usage time patterns.
[0170] Among them, such as Figure 6 As shown, the CUPS log collection module is configured as follows:
[0171] Real-time print job information is obtained by calling the ippGetJobAttributes() interface provided by the CUPS service, including job ID, submission time, completion status, error code, and consumable consumption. A regular expression rule base is built to parse the / var / log / cups / error_log log file and extract the following structured information:
[0172] Error types: categorized by CUPS error codes (e.g., CLIENT-ERROR-BAD-REQUEST, SERVER-ERROR-INTERNAL).
[0173] The occurrence timestamp is accurate to the millisecond level and aligned with the job status acquisition timestamp.
[0174] Associate job ID: Associate the job status data with the job-id field in the error log;
[0175] Device identification: Parse the device-uri field to obtain the printer model and port information;
[0176] Generate alarm events and label the severity (Warning / Critical) for high-frequency errors (such as FILTER-FAILED occurring more than 3 times consecutively).
[0177] A dual-thread polling mechanism is used to monitor the CUPS-LPD queue status. In the main thread, a standard queue query is performed at intervals (every 2 seconds) to obtain the queue length, the number of blocked jobs, and the priority distribution. In the auxiliary thread, when the queue length change rate is detected to be greater than a preset threshold (30% / second), an emergency polling is triggered (the cycle is shortened to 500ms) and the queue mutation event is recorded.
[0178] Establish a mapping table linking job status, error logs, and queue status to enable the following cross-dimensional analysis:
[0179] By associating the device identifier in the error log with the consumable consumption in the job status, the consumable failure rate of a specific device model can be analyzed.
[0180] When a queue danger threshold is detected, trace the distribution of error codes for related jobs over the past 10 minutes.
[0181] For jobs with an aborted completion status, automatically match their associated error logs to generate a fault chain (e.g., "Job 123 → FILTER-FAILED → Nozzle clogging").
[0182] When outputting fused data, label the data quality score.
[0183] Among them, such as Figure 7 As shown, the driver-layer event monitoring module is configured as follows:
[0184] Deploy a dynamically loadable kernel module (LKM) at the PPD driver layer of the Linux kernel and register the following driver hook functions:
[0185] ppd_command_hook: Intercepts the PJL (Printer Job Language) instruction stream sent by the PPD driver layer, parses the printing task event type, and extracts task control instructions (such as @PJL ENTER LANGUAGE= PCL, @PJL SET JOBNAME = "Test") through regular expression matching.
[0186] io_control_hook: Monitors device I / O operations and captures printed data transmission events (such as PCL control codes like \x1B%-12345X in the write() system call parameters).
[0187] Capture and print status change signals in real time by subscribing to the following signal interfaces of the org.cups.cupsd service via the D-Bus communication protocol:
[0188] JobCreated: Captures the new task creation event and extracts the task ID, submitting user, and job size;
[0189] JobStateChanged: Monitors task status changes (such as pending→processing→completed) and records the status transition timestamp;
[0190] PrinterStateChanged: Responds to printer state changes (such as idle→busy→offline) and the associated print jobs.
[0191] Define the event priority weight table:
[0192] High priority: JobStateChanged (weight 0.5), PrinterStateChanged (weight 0.3);
[0193] Low priority: JobCreated (weight 0.2).
[0194] Establish a state machine model to track the lifecycle of the printing task and record the state transition time of each stage from "receive" to "complete".
[0195] Construct a state finite state machine (FSM) model and define the state transition rules as shown in Table 1:
[0196] Table 1: State Machine Model and State Transition Rules
[0197]
[0198] Establish a mapping table linking kernel events, user events, and state machine data to achieve the following fusion analysis:
[0199] Associate the @PJL SET MEDIA=A4 command intercepted by ppd_command_hook with the job size in the JobCreated event to verify paper type matching.
[0200] When the state machine detects the PROCESSING→FAILED transition, it traces the PJL instruction stream and D-Bus error events within the last 10 seconds to generate a fault root cause chain (such as "PJL instruction error → printer paper rejection → task failure").
[0201] Among them, such as Figure 8 As shown, the printer sensor data acquisition module is configured as follows:
[0202] Supports multiple protocol adapters simultaneously:
[0203] The SNMP protocol periodically polls the printer MIB database to read the following object identifiers (OIDs):
[0204] 1.3.6.1.2.1.43.18.1.1.8 (hrDeviceStatus, device status);
[0205] 1.3.6.1.2.1.43.11.1.1.9.1 (prtMarkerSuppliesLevel, remaining consumables).
[0206] 1.3.6.1.2.1.43.16.5.1.2.1 (prtInputMediaDimUnits, paper size);
[0207] The vendor's proprietary protocol parses the temperature sensor in the 0x08 command group, extracts real-time motor speed data from the ESC i instruction set, and supports dynamically loading the .dll / .so library provided by the vendor through the configuration file to achieve non-standard protocol extensions;
[0208] The paper feeding / output status is detected by an optical encoder. When a sudden speed change (Δv>20% / 100ms) is detected, a paper jam prediction is triggered. Combined with a Hall sensor array, the paper jam position is located and three-dimensional coordinates are output: X=sensor number, Y=distance in the paper feeding direction, and Z=paper layer thickness.
[0209] The pressure sensor monitors the ink cartridge installation force, and generates an incorrect installation alarm when the pressure value is consistently <0.5N for more than 3 seconds.
[0210] The remaining amount of toner cartridge is detected by an infrared beam tube, and the remaining amount is calculated by fitting the light intensity attenuation curve.
[0211] Deploy consumable identification chips and use Time Division Multiple Access (TDMA) technology to read multiple tags simultaneously, including at least reading RFID tags to obtain ink / toner cartridge model, remaining quantity, and production batch information.
[0212] Among them, such as Figure 9 As shown, the user operation behavior collection module is configured as follows:
[0213] Inject JavaScript code into the CUPS web interface to record user operation sequences and parameter modification behaviors;
[0214] The mouse click coordinates are parsed from the Xorg server logs and mapped to the control elements in the print settings panel;
[0215] Time series analysis algorithms are used to identify user usage time patterns, including:
[0216] High-frequency usage periods (based on Fourier transform analysis of hourly statistics);
[0217] Parameter setting preferences (frequency selection of resolution / paper type through K-means cluster analysis);
[0218] Abnormal operation sequence (deviation detection based on LSTM neural network prediction of normal operation flow);
[0219] The data collected by each module is aligned to nanosecond precision through a time synchronization mechanism and then transmitted to the feature construction layer after being appended with a unique device identifier.
[0220] In this embodiment, the feature construction and data fusion layer includes:
[0221] The log data preprocessing module performs word segmentation, cleaning, and structuring on CUPS log data;
[0222] The sensor data preprocessing module performs normalization, time alignment, and anomaly removal on the sensor data.
[0223] The user behavior sequence analysis module models, analyzes the frequency and patterns of user operation sequences;
[0224] The feature extraction module is used to extract abnormal features, consumable features, load features, and user behavior features.
[0225] The multi-dimensional feature fusion module fuses the extracted features to construct a unified feature vector space.
[0226] Among them, such as Figure 10 As shown, the log data preprocessing module is configured as follows:
[0227] Regular expression matching algorithms were used to segment CUPS log data and extract key fields containing ERROR_CODE, JOB_ID, and TIMESTAMP.
[0228] The sliding window statistical method was used to clean up abnormal log entries. The window size was set to 50 log entries, and redundant data with a duplication rate of more than 80% was removed.
[0229] The cleaned logs are converted into structured data through a JSON Schema validation mechanism, and a standardized template containing 12 core fields is defined.
[0230] Among them, such as Figure 11 As shown, the sensor data preprocessing module is configured as follows:
[0231] Min-Max normalization is performed on time-series sensor data such as temperature and motor speed, mapping the values to the [0,1] interval and retaining 3 decimal places of precision;
[0232] The Dynamic Time Warping (DTW) algorithm is used to achieve time alignment of multi-sensor data, and the alignment error is controlled within ±10ms.
[0233] Outlier data points are detected based on the 3σ principle, and values exceeding the mean ± 3 times the standard deviation are corrected using median interpolation.
[0234] Among them, such as Figure 12 As shown, the user behavior sequence parsing module is configured as follows:
[0235] A finite state automaton (FSM) model is constructed to perform syntactic parsing of user operation sequences, defining transition rules that include multiple operation states, such as 23 operation states, including:
[0236] Basic operation status (8 types): device startup, parameter configuration, task submission, pause / continue, task cancellation, consumable replacement, maintenance mode, device shutdown;
[0237] Composite operation states (10 types): Batch printing (including sub-states: file loading → parameter verification → queue queuing → execute printing), fault recovery (error detection → diagnostic prompt → user confirmation → automatic restart), permission switching (administrator login → ordinary user switching → operation permission verification);
[0238] Abnormal states (5 types): parameter out of bounds (e.g., resolution > 1200dpi), resource conflict (e.g., multiple tasks preempting the print queue), hardware failure (e.g., paper jam / ink shortage), communication interruption (network / USB disconnection), operation timeout;
[0239] Define a state transition rule base, including the following constraints:
[0240] Explicit transition: A state transition triggered by a button in the user interface, such as "Task Submission" → "Queueing";
[0241] Implicit transition: A state change driven by a system event, such as "printing" → "paper jam" triggered by a Hall sensor;
[0242] Conditional transition: Dynamic transition based on parameter thresholds. For example, when "Print Speed" > 80 pages / minute and "Temperature" > 45°C, the system will force a transition from "High-speed Printing" to "Cooling Down Waiting".
[0243] The TF-IDF algorithm is used to calculate the frequency weights of user parameter setting behaviors, generating a 16-dimensional behavioral feature vector, including:
[0244] Terminology dictionary construction: High-frequency parameter items (such as resolution, paper type, duplex printing, number of copies) are extracted from historical operation logs to form a dictionary containing 128 terms;
[0245] Term frequency (TF) calculation: Count the number of occurrences of each parameter in the current user operation sequence and normalize it to the interval [0,1].
[0246] Inverse Document Frequency (IDF) Calculation: Based on the global user dataset, calculate the rarity weight of the parameter (IDF = log(total number of users / number of users containing the parameter)).
[0247] TF-IDF feature vector generation: Calculate the TF×IDF value for each parameter, and select the top 16 highest weighted parameters to form the behavior feature vector;
[0248] The operation patterns are analyzed using a Markov chain model, the state transition probability matrix is calculated, and high-frequency operation paths (probability of occurrence > 0.75) are identified.
[0249] Furthermore, a state transition probability matrix (23×23 dimensions) is constructed, and the state transition probabilities are calculated using the maximum likelihood estimation method to identify high-frequency operation paths. The following screening rules are defined:
[0250] Path length constraint: Only analyze continuous state sequences with a length ≥ 3, such as "task submission" → "queue queuing" → "execute printing";
[0251] Probability threshold: Retain strongly associated paths with a transition probability > 0.75;
[0252] Business relevance: Filter out meaningless loop paths, such as "standby" and "standby".
[0253] Among them, such as Figure 2 As shown, the feature extraction module uses multimodal data fusion technology to perform feature engineering on device status and user behavior, specifically including:
[0254] Anomaly feature extraction submodule:
[0255] A sliding window scan is performed on the processed CUPS log data to extract N-gram features (N=2~4), and an error code co-occurrence network is constructed, including: constructing a weighted directed graph. G =( V , E ), where nodes V For error codes (such as E001_Paper Jam, E005_Ink Shortage), edge weights w ij Error code i and j Calculate the frequency of consecutive occurrences in the log; calculate node centrality metrics (degree centrality, betweenness centrality), and filter for centrality values higher than a threshold. θ degree Error codes >5) are considered high-frequency exception characteristics;
[0256] An isolated forest algorithm was used to detect abnormal patterns in the sensor data stream, with a contamination rate of 0.05, meaning an expected percentage of abnormal samples was 5%. One hundred isolation trees (iTrees) were constructed, with a maximum depth of [missing information]. log2( n ) ( n (sample size)
[0257] For each data point x Calculate its average path length across all trees. h ( x Normalization yields outlier scores. s (x );
[0258] Consumables Feature Extraction Submodule:
[0259] The system uses an LSTM network to predict the remaining consumable quantity trend. The input window size is the consumption data of the previous 10 time points. Each time point contains 3-dimensional features: number of printed pages, ink coverage, and device working time. The LSTM layer consists of 2 hidden units (64 neurons per layer) with ReLU activation function. A Dropout layer (rate=0.2) is added to prevent overfitting. The fully connected layer outputs the predicted consumable quantity remaining value for the next 3 time points.
[0260] The standard deviation of the consumable replacement cycle is calculated as a characteristic of usage stability; the specific steps are as follows:
[0261] Extract the timestamp of each ink cartridge replacement from the equipment maintenance log. T 1, T 2,..., Tn ;
[0262] Calculate the adjacent replacement cycle Δ Ti = Ti +1 Ti ;
[0263] Calculate the standard deviation σcycle ,mark σcycle Equipment that has been used for more than 7 days is considered to have unstable consumable usage (based on a 95% confidence interval of historical data).
[0264] Load feature extraction submodule:
[0265] A short-time Fourier transform is performed on the motor speed data to extract the energy proportion characteristics in the 10Hz~100Hz frequency band. Three key frequency bands are defined: low frequency (10Hz~30Hz), mid frequency (30Hz~60Hz), and high frequency (60Hz~100Hz). The energy proportion in the high-frequency band... E 60 100 When the value is greater than 0.4, a motor overload warning is triggered (based on a threshold calculated from fault case statistics).
[0266] Calculate the peak load ratio (peak length / total observation period) of the printed queue status data.
[0267] User behavior feature extraction submodule:
[0268] The K-means++ algorithm was used to cluster user operation sequences, and five-dimensional operation features were extracted for each user: average number of daily operations, task type diversity (Shannon entropy), parameter modification frequency, number of abnormal interruptions, and device usage time.
[0269] The clustering effect is optimized by setting the number of clusters K=5 and calculating the silhouette coefficient. The target value is achieved through silhouette coefficient optimization. S >0.5; When initializing the center point, a distance-weighted probability distribution is used. P ( x )∝ D ( x ) 2 ,in D ( x ) represents the distance from the sample to the nearest center point; users are divided into 5 behavioral patterns (such as efficient, exploratory, abnormal, etc.) and associated with the equipment maintenance strategy library;
[0270] Extract the entropy value of the user usage time period distribution as a behavioral regularity feature.
[0271] Establish a feature association mapping table to achieve the following fusion analysis:
[0272] When the anomaly feature extraction submodule detects error code E001 (paper jam), it associates the remaining ink cartridge quantity in the consumables feature (if the remaining quantity is <10%, it is upgraded to a consumables shortage warning).
[0273] When the peak load ratio Rpeak in the load characteristics > 0.3, combined with the user behavior entropy value H:
[0274] If H < 2.0 (regular users), delay triggering congestion warning; if H > 3.5 (random users), immediately trigger and restrict new task submissions.
[0275] Output a uniform feature vector F∈R 28 It includes the following dimensions:
[0276] Anomaly characteristics (8 dimensions): error code centrality, isolated forest score, high-frequency energy ratio, etc.;
[0277] Consumable characteristics (4 dimensions): LSTM prediction of remaining quantity, standard deviation of replacement cycle, etc.;
[0278] Load characteristics (3-dimensional): peak load ratio, frequency band energy share, etc.;
[0279] User behavior characteristics (13 dimensions): clustering labels, time period entropy values, operation frequency, etc.
[0280] Among them, such as Figure 13 As shown, the multi-dimensional feature fusion module is configured as follows:
[0281] The weight coefficients of various features are calculated through an attention mechanism. The weight of log features is set to a, the weight of sensor features is set to b, and the weight of user behavior features is set to c. For example, the weight of log features is preset to 0.4, the weight of sensor features is preset to 0.3, and the weight of user behavior features is preset to 0.3. The weight coefficients are normalized by the Softmax function to ensure that the sum of the weights of various features is 1.
[0282] The weighted feature vectors are concatenated into a 32-dimensional unified feature vector according to a preset dimensional structure. The specific dimensional allocation is as follows:
[0283] The first 8 dimensions: anomaly feature sub-vectors, which are formed by concatenating log features and sensor features according to their weights;
[0284] The middle 12 dimensions: load feature sub-vectors, which are formed by concatenating the motor operating parameter features and queue status features according to their weights;
[0285] The last 12 dimensions: user behavior feature sub-vectors, which are composed of user operation sequence features and usage time period features weighted and concatenated;
[0286] PCA dimensionality reduction is performed on the 32-dimensional unified feature vector, and principal components are automatically selected based on a cumulative contribution rate of ≥95% to generate a dimensionality-reduced low-dimensional feature vector.
[0287] In this embodiment, the machine learning predictive analytics layer includes:
[0288] The anomaly detection model module adopts a combined strategy of rule constraints, unsupervised anomaly detection model, and dynamic threshold to identify printing anomalies and consumable anomalies in real time.
[0289] The fault prediction model module employs a fault prediction strategy that combines anomaly trend analysis, time-series prediction model, and multi-source feature fusion to predict potential faults.
[0290] The remaining useful life prediction model module adopts a remaining useful life prediction strategy of degradation feature modeling + life regression prediction + dynamic update to assess the remaining useful life of key components.
[0291] The user behavior clustering model module uses KMeans or GMM algorithms to analyze user printing habits and generate personalized printing parameters and scheduling strategies.
[0292] Among them, the anomaly detection model module, such as Figure 3 As shown, the configuration uses a three-level fusion detection architecture:
[0293] The rule constraint layer includes:
[0294] Construct a rule base based on expert knowledge, containing at least 127 explicit rules, including but not limited to: threshold rules: triggering an overheat alarm when the equipment temperature exceeds 85℃; frequency rules: determining mechanical failure based on ≥3 consecutive paper jams;
[0295] It uses the Drools rule engine to achieve millisecond-level rule matching and supports hot-loading of new / modified rules via RESTful interface or configuration file;
[0296] Unsupervised detection layers include:
[0297] Deploy the improved Isolation Forest model and optimize it in the following ways:
[0298] Feature correlation weighting: Calculate the Pearson correlation coefficient between input features. For feature pairs with a correlation coefficient > 0.7, multiply their weight by 1.5 before inputting them into the model.
[0299] Dynamic sample sampling: The number of training samples in each batch is dynamically determined according to the formula N=R×1000, where R is the historical anomalous rate (0≤R≤1).
[0300] Perform real-time detection on the sensor data stream and output a normalized anomaly score. S∈[0,1] ,in S=1 Indicates the highest probability of an anomaly;
[0301] Dynamic thresholding layer, including:
[0302] The threshold is dynamically adjusted based on the EWMA (Exponentially Weighted Moving Average) algorithm, with a smoothing factor α = 0.3. The calculation formula is as follows: T t = α·X t + (1-α)·T t-1 , in X t This represents the average of the abnormal scores for the current batch. T t-1 The threshold value for the previous batch;
[0303] Construct an adaptive threshold function by combining historical anomaly distributions: T t = μ t + k·σ t , in μ t This represents the average of the abnormal scores for the current batch. σ t Standard deviation k Values will be adjusted in stages:
[0304] Initial phase (first 100 batches): k=1.5;
[0305] Stable phase (after 100 batches): k=Q 0.95 The 95th percentile of the distribution of historical outlier scores;
[0306] When the abnormal score exceeds S>T t When this occurs, a three-level alarm mechanism is triggered, including but not limited to:
[0307] Level 1 Alarm: System pop-up notification;
[0308] Level 2 alert: Email notification to operations and maintenance personnel;
[0309] Level 3 Alarm: Send an SMS notification to the responsible administrator.
[0310] Among them, such as Figure 4 As shown, the fault prediction model module is configured to use a multimodal fusion prediction architecture:
[0311] The abnormal trend analysis submodule includes:
[0312] Perform STL decomposition (seasonal-trend-residual decomposition) on the sensor data to extract the trend term, seasonal term, and residual term; the period of the seasonal term is automatically identified and set through Fourier transform; the formula for extracting the trend term is: Y t = T t + S t + R t (Y) t For the original data, T t S is the trend term. t For seasonal terms, R t (residual term);
[0313] The trend term is smoothed using a Hodrick-Prescott filter, and the objective function is: min{Σ(T)} t - Y t ) 2 + λΣ[(T t+1 - T t ) - (T t - T t-1 )] 2},in T t 'The trend term obtained after STL decomposition and Hodrick-Prescott filter processing at time...' t The value, Y t Let be the raw data value collected by the sensor at time t, and λ=10000 be the smoothing parameter.T t+1 '、 T t-1 'These represent the trend term at time t+1 and time t, respectively. The value of 1;
[0314] The core submodule of time series prediction includes:
[0315] Building a dual-channel LSTM network:
[0316] Channel 1: Input normalized sensor data (temperature / speed / load), hidden layer dimension 64, output dimension 32;
[0317] Channel 2: One-hot encoding of input log error codes, hidden layer dimension 32, output dimension 16;
[0318] The two-channel outputs are fused using an attention mechanism, where the attention weights are optimized using Kullback-Leibler divergence, with the optimization objective being to minimize the difference in the distributions of the two channel outputs. The fusion formula is: O t =α1·O t 1 + α2·O t 2 (O) t 1 O t 2 The outputs are for channels 1 and 2, respectively, and α1 and α2 are the attention weights, where α1 + α2 = 1).
[0319] The multi-source feature fusion submodule includes:
[0320] Access user behavior characteristics (printing frequency / parameter preferences) and consumable characteristics (remaining quantity / replacement cycle), and combine them with trend analysis results and time series prediction output;
[0321] XGBoost was used to rank features by importance, sorting them by F1 score and retaining the top 15 features. The maximum depth of the tree model was set to 6, and the learning rate was set to 0.1. The formula for calculating feature importance is: Importancei = Σ(wj·Iij) (where wj is the weight of the j-th tree, and Iij is the number of splits of feature i in the j-th tree).
[0322] The prediction output submodule includes:
[0323] Based on the fused feature vectors, the probability of failure in the next 24 hours is output. P∈[0%,100%] And fault type classification (mechanical / electrical / software), among which:
[0324] The failure probability is output after normalization using the Sigmoid function;
[0325] Fault type classification uses the Softmax activation function and outputs a three-dimensional probability vector;
[0326] When the probability is greater than 75%, a maintenance work order is automatically generated and pushed to the operation and maintenance system;
[0327] Among them, such as Figure 5 As shown, the remaining lifetime prediction model module includes:
[0328] The degradation feature modeling submodule is configured as follows:
[0329] Multi-domain feature extraction is performed on the time-series data of motor speed, including:
[0330] Time domain: Root mean square (RMS), Crest factor;
[0331] Frequency domain: band energy ratio (50-100Hz percentage), spectral entropy;
[0332] The feature trend is calculated using a sliding window (window size = 100 sampling points), where the window size is set to 100 sampling points, the overlap rate is 50%, the sliding step size is 50 sampling points, and an equally spaced feature time series is generated.
[0333] The lifetime regression prediction submodule is configured as follows:
[0334] Construct a Wiener process degradation model and define the state-space equation as follows:
[0335] X ( t )= X (0)+ μt + σB ( t )
[0336] Where X(t) is the degenerate state variable at time t; X(0) is the initial degenerate state, which follows the order N(μ0, σ0). 2 ) distribution; μ=0.02 / day is the drift coefficient (fitted by maximum likelihood estimation of historical data); σ=0.005 is the diffusion coefficient; μ0 is the mean of the initial degraded state X(0), σ0 is the standard deviation of the initial degraded state X(0); B(t) is the standard Brownian motion;
[0337] The particle filter algorithm is used to estimate the posterior distribution of the remaining lifetime (RUL), including: initialization: generating N=1000 particles, sampled from the prior distribution N(X(0), σ0) 2Prediction step: Update particle state according to state equation; Update step: Calculate particle weight based on new observation data and avoid degradation through resampling; RUL estimation: RUL = inf{t | X(t) ≥ Θ} (Θ is the failure threshold, calibrated through accelerated life test);
[0338] The dynamic update mechanism submodule is configured as follows:
[0339] Every 10 hours of new running data triggers a re-estimation of model parameters, recalculating the maximum likelihood estimate of the drift coefficient μ.
[0340] When predicting remaining lifespan RUL If the time is less than 72 hours, start the backup component preheating program and push the warning message to the operation and maintenance terminal via MQTT protocol;
[0341] The user behavior clustering model module is configured to use a hybrid clustering optimization architecture.
[0342] Extract the following features from the user action sequence:
[0343] Statistical characteristics: average daily print volume, color / black and white ratio;
[0344] Temporal characteristics: using time-period entropy values and standard deviation of operation intervals;
[0345] Preference characteristics: frequency of using common paper types and resolution settings;
[0346] The initialization phase uses K-means++ (K=4-8, determined by the elbow rule); the stabilization phase switches to Gaussian mixture model (GMM), and the covariance matrix type is set to full; print parameter templates are generated for each cluster (such as "high-efficiency mode": double-sided printing + draft quality).
[0347] Predict future printing needs based on users' historical behavior and preheat the corresponding printers in advance; all models are configured with:
[0348] Model interpretation module: Uses SHAP values to interpret prediction results;
[0349] Performance monitoring module: tracks F1-score (anomaly detection) and MAPE (lifetime prediction), and triggers model rollback when the index drops by more than 15%.
[0350] In this embodiment, the policy generation and adaptive control layer includes:
[0351] The risk level assessment module determines the risk level based on the prediction results, classifying it into low risk, medium risk, and high risk.
[0352] The exception type mapping strategy module maps exception types to a preset strategy mapping table;
[0353] The adaptive parameter optimization generation module generates printing parameter optimization strategies based on user behavior and device status.
[0354] The maintenance strategy generation module generates recommended strategies for preventative maintenance and component replacement.
[0355] The self-healing command generation module generates self-healing commands such as calibration, reset, and soft reboot.
[0356] The closed-loop monitoring module verifies and provides feedback on the execution results, forming a closed-loop intelligent control system.
[0357] The risk level assessment module is configured as follows:
[0358] A risk assessment model is constructed using the fuzzy comprehensive evaluation method. The input consists of a five-dimensional feature vector containing prediction error rate (weight 0.3), abnormal duration (weight 0.25), equipment load rate (weight 0.2), remaining consumables (weight 0.15), and user operation frequency (weight 0.1).
[0359] Define the risk level classification threshold:
[0360] Low risk: Overall score ≤ 0.4 and no abnormalities in critical components;
[0361] Medium risk: 0.4 < score ≤ 0.7 or a single critical component anomaly;
[0362] High risk: Score > 0.7 and multiple component coordination anomalies exist;
[0363] When outputting risk level labels, a confidence interval (e.g., high risk [0.85, 0.95]) is generated simultaneously.
[0364] The exception type mapping strategy module is configured as follows:
[0365] Construct a three-tier policy mapping table:
[0366] The first layer is divided into hardware failures (40%), software failures (30%), consumable issues (20%), and environmental interference (10%) according to the source of the anomaly.
[0367] The second level: Define 5 severity levels (S1-S5) for each type of anomaly;
[0368] The third layer: Configure standard handling strategies for each (source of the anomaly, severity) combination (e.g., S3 level printhead clogging → perform high-pressure flushing + ink path cleaning);
[0369] The nearest neighbor algorithm (K=3) is used to dynamically match abnormal features to the policy table, and the matching similarity threshold is set to 0.85.
[0370] The adaptive parameter optimization generation module is configured as follows:
[0371] Short-term optimization: Generate an instant adjustment strategy based on the current user operation sequence (operation frequency, parameter modification frequency), update parameter values using the Q-learning algorithm, and define the reward function as the print quality score improvement rate;
[0372] Long-term optimization: Based on historical equipment status data (temperature fluctuation range, motor speed stability), an LSTM prediction model is trained to generate periodic parameter adjustment schemes, such as automatically reducing inkjet pressure by 5% every 24 hours;
[0373] When outputting optimization strategies, indicate the effective time window, such as this strategy is applicable to operations within the next 4 hours;
[0374] The maintenance strategy generation module is configured as follows:
[0375] Preventive maintenance: Maintenance tasks are triggered based on the cumulative operating time of the equipment (MTBF statistics). When the operating time reaches 80% of the theoretical lifespan, a component replacement warning is generated.
[0376] Predictive maintenance: The remaining lifespan of components is predicted using the Prophet time series model. When the predicted value is lower than the safety threshold (e.g., the remaining lifespan of the nozzle is <150 hours), an emergency replacement instruction is generated.
[0377] The maintenance strategy includes priority markers (P1-P3) and spare parts list codes;
[0378] The self-repair instruction generation module is configured as follows:
[0379] Define a five-level self-healing instruction set:
[0380] L1: Software-level repair (reset parameters, clear cache);
[0381] L2: Communication-level repair (rebooting the device bus, recalibrating the sensors);
[0382] L3: Mechanical-level repair (performs automatic printhead cleaning and ink path venting);
[0383] L4: Power-level repair (soft reboot of the device, switching to backup power).
[0384] L5: System-level repair (factory reset, firmware reinstallation);
[0385] The instruction level is automatically selected based on the risk level; in high-risk scenarios, L4 / L5 instructions are triggered directly.
[0386] The closed-loop monitoring module is configured as follows:
[0387] Inner loop: Real-time monitoring of command execution status (obtaining execution result codes via the device's CAN bus), automatic retry of failed commands (up to 3 times) and recording the reason for failure;
[0388] Outer loop: Collect print quality data within 12 hours after command execution (obtain color gamut coverage through built-in spectrometer), and trigger policy rollback when the quality score drops by more than 15%;
[0389] Maintain a strategy execution log database to record the timestamp, parameter change value, and effect evaluation for each strategy adjustment (using A / B testing to compare and print the pass rate).
[0390] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0391] The above embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of protection of the present invention. Any non-substantial changes and substitutions made by those skilled in the art based on the present invention shall fall within the scope of protection claimed by the present invention.
Claims
1. A machine learning-based CUPS print management and control system, applied in a computer terminal, print server, or centralized management node, characterized in that the system... include: The data acquisition and status monitoring layer collects at least one of the following types of data in real time through multi-source heterogeneous data interfaces: CUPS log data, driver layer events, printer internal sensor data, and user operation behavior data. The feature construction and data fusion layer is used to preprocess the collected data, extract features, and construct a feature vector space containing multi-dimensional related features through a feature weighted fusion algorithm. The machine learning predictive analytics layer includes: an anomaly detection model module for real-time identification of printing anomalies and consumable anomalies; a fault prediction model module for predicting potential faults; a remaining life prediction model module for assessing the remaining lifespan of critical components; and a user behavior clustering model module that uses KMeans or GMM algorithms to analyze user printing habits and generate personalized printing parameters and scheduling strategies. The strategy generation and adaptive control layer is configured to dynamically execute at least one of the following operations based on the prediction results: risk level mapping, self-healing instruction generation, load regulation, and parameter optimization. The feature construction and data fusion layer includes: The log data preprocessing module performs word segmentation, cleaning, and structuring on CUPS log data; The sensor data preprocessing module performs normalization, time alignment, and anomaly removal on the sensor data. The user behavior sequence analysis module models, analyzes the frequency and patterns of user operation sequences; The feature extraction module is used to extract abnormal features, consumable features, load features, and user behavior features. The multi-dimensional feature fusion module fuses the extracted features to construct a unified feature vector space; The feature extraction module utilizes multimodal data fusion technology to perform feature engineering on device status and user behavior, specifically including: Anomaly feature extraction submodule: Perform a sliding window scan on the processed CUPS log data to extract N-gram features and construct an error code co-occurrence network; The Isolation Forest algorithm is used to detect abnormal patterns in the sensor data stream for each data point. x Calculate its average path length across all trees. h ( x Normalization yields outlier scores. s ( x ); Consumables Feature Extraction Submodule: The LSTM network is used to predict the remaining consumables trend. The input window size is the consumption data of the previous 10 time points. Each time point contains 3-dimensional features: number of printed pages, ink coverage, and device working time. The fully connected layer outputs the predicted value of the remaining consumables for the next 3 time points. The standard deviation of the consumable replacement cycle is calculated as a characteristic of usage stability. Load feature extraction submodule: Perform a short-time Fourier transform on the motor speed data to extract the energy proportion characteristics in the 10Hz~100Hz frequency band; Calculate the peak load ratio of the print queue status data; User behavior feature extraction submodule: The K-means++ algorithm was used to cluster user operation sequences, with the number of clusters K=5 and the silhouette coefficient calculated to optimize the clustering effect. Extract the entropy values of user usage time period distribution as behavioral regularity features; The multi-dimensional feature fusion module is configured as follows: The weight coefficients of various features are calculated through an attention mechanism, where the weight of log features is set as a, the weight of sensor features is set as b, and the weight of user behavior features is set as c. The weighted feature vectors are concatenated into a 32-dimensional unified feature vector according to a preset dimensional structure. The specific dimensional allocation is as follows: The first 8 dimensions: anomaly feature sub-vectors, which are formed by concatenating log features and sensor features according to their weights; The middle 12 dimensions: load feature sub-vectors, which are formed by concatenating the motor operating parameter features and queue status features according to their weights; The last 12 dimensions: user behavior feature sub-vectors, which are composed of user operation sequence features and usage time period features weighted and concatenated; PCA dimensionality reduction is performed on the 32-dimensional unified feature vector, and principal components are automatically selected based on a cumulative contribution rate of ≥95% to generate a dimensionality-reduced low-dimensional feature vector.
2. The system according to claim 1, characterized in that, The data acquisition and status monitoring layer includes: The CUPS log acquisition module is used to collect CUPS log data, including at least print job information, error logs, and queue status. The driver-layer event monitoring module is used to monitor print job events and printing status. The printer sensor data acquisition module is used to collect data from the printer's internal sensors, including at least temperature, motor speed, paper feed / output status, and consumable information. The user operation behavior collection module is used to collect user operation sequences, parameter setting habits, and user usage time patterns.
3. The system according to claim 2, characterized in that, The CUPS log collection module is configured as follows: The CUPS service provides the ippGetJobAttributes() interface to obtain print job information in real time, including job ID, submission time, completion status, error code, and consumable consumption. A regular expression rule base is built to parse the / var / log / cups / error_log file and extract the error type, occurrence timestamp, associated job ID, and device identifier. A dual-thread polling mechanism is used to monitor the CUPS-LPD queue status. In the main thread, a standard queue query is performed at intervals to obtain the queue length, the number of blocked jobs, and the priority distribution. In the auxiliary thread, when the queue length change rate is detected to be greater than a preset threshold, an emergency polling is triggered and the queue mutation event is recorded.
4. The system according to claim 2, characterized in that, The driver-layer event monitoring module is configured as follows: Deploy dynamically loadable kernel modules in the PPD driver layer of the Linux kernel and register the following driver hook functions. ppd_command_hook: Intercepts the PJL instruction stream sent by the PPD driver layer and parses the event type of the printing task; io_control_hook: Monitors device I / O operations and captures data transmission events. Capture and print status change signals in real time by subscribing to the following signal interfaces of the org.cups.cupsd service via the D-Bus communication protocol: JobCreated: Captures the new task creation event and extracts the task ID, submitting user, and job size; JobStateChanged: Monitors task state changes and records state transition timestamps; PrinterStateChanged: Responds to changes in printer state and associates the affected print jobs; Establish a state machine model to track the lifecycle of printing tasks and record the state transition time from receiving to completion of each stage; Establish a mapping table linking kernel events, user events, and state machine data to achieve the following fusion analysis: Associate the @PJL SET MEDIA=A4 command intercepted by ppd_command_hook with the job size in the JobCreated event to verify paper type matching. When the state machine detects the PROCESSING→FAILED transition, it traces the PJL instruction stream and D-Bus error events within the last 10 seconds to generate a fault root cause chain.
5. The system according to claim 2, characterized in that, The printer sensor data acquisition module is configured as follows: Supports multiple protocol adapters simultaneously: The SNMP protocol periodically polls and reads the printer MIB library, reading the following object identifiers: HRDeviceStatus - device status, prtMarkerSuppliesLevel - remaining consumables, and prtInputMediaDimUnits - paper size. The vendor's proprietary protocol parses the temperature sensor in the 0x08 command group, extracts real-time motor speed data from the ESC i instruction set, and supports dynamically loading the .dll / .so library provided by the vendor through the configuration file to achieve non-standard protocol extensions; The paper feeding / output status is detected by photoelectric encoder, and the position of paper jam is located by Hall sensor array. The output is three-dimensional coordinates, where X = sensor number, Y = distance in paper feeding direction, and Z = paper layer thickness. Deploy consumable identification chips and use Time Division Multiple Access (TDMA) technology to read multiple tags simultaneously, including at least reading RFID tags to obtain ink / toner cartridge model, remaining quantity, and production batch information.
6. The system according to claim 2, characterized in that, The user action behavior collection module is configured as follows: Inject JavaScript code into the CUPS web interface to record user operation sequences and parameter modification behaviors; The mouse click coordinates are parsed from the Xorg server logs and mapped to the control elements in the print settings panel. Time series analysis algorithms are used to identify user usage time patterns, including: high-frequency usage periods, parameter setting preferences, and abnormal operation sequences.
7. The system according to claim 1, characterized in that, The log data preprocessing module is configured as follows: Regular expression matching algorithms were used to segment CUPS log data and extract key fields containing ERROR_CODE, JOB_ID, and TIMESTAMP. The sliding window statistical method is used to clean up abnormal log entries. The window size is set to H log entries, and redundant data with a duplication rate of more than 80% is removed. The cleaned logs are converted into structured data through a JSON Schema validation mechanism, and a standardized template containing 12 core fields is defined.
8. The system according to claim 1, characterized in that, The sensor data preprocessing module is configured as follows: Perform Min-Max normalization on the sensor data to map the values to the [0,1] interval; A dynamic time warping algorithm is used to achieve time alignment of multi-sensor data; Outlier data points are detected based on the 3σ principle, and values exceeding the mean ± 3 times the standard deviation are corrected using median interpolation.
9. The system according to claim 1, characterized in that, The user behavior sequence parsing module is configured as follows: A finite state automaton model is constructed to perform grammatical parsing on user operation sequences, and transition rules containing multiple operation states are defined, including basic operation states, compound operation states, and abnormal states. The TF-IDF algorithm is used to calculate the frequency weight of user parameter setting behavior and generate a 16-dimensional behavior feature vector, including term dictionary construction: extracting high-frequency parameter items from historical operation logs to form a dictionary containing 128 terms; word frequency (TF) calculation: counting the number of occurrences of each parameter in the current user operation sequence and normalizing it to the [0,1] interval; Inverse Document Frequency (IDF) Calculation: Based on a global user dataset, calculate the rarity weights of the parameters; TF-IDF feature vector generation: Calculate the TF×IDF value for each parameter, and select the top 16 highest weighted parameters to form the behavior feature vector; The operation patterns are analyzed using a Markov chain model, the state transition probability matrix is calculated, and high-frequency operation paths are identified.
10. The system according to claim 1, characterized in that, In the machine learning predictive analysis layer, the anomaly detection model module adopts a combination strategy of rule constraints, unsupervised anomaly detection model and dynamic threshold to identify printing anomalies and consumable anomalies in real time; the fault prediction model module adopts a fault prediction strategy of anomaly trend analysis, time series prediction model and multi-source feature fusion to predict potential faults; the remaining life prediction model module adopts a remaining life prediction strategy of degradation feature modeling, life regression prediction and dynamic update to assess the remaining life of key components.
11. The system according to claim 10, characterized in that, The anomaly detection model module is configured to use a three-level fusion detection architecture: The rule constraint layer includes: Build a rule base based on expert knowledge, containing at least 127 explicit rules; It uses the Drools rule engine to achieve millisecond-level rule matching and supports hot-loading of new / modified rules via RESTful interface or configuration file; Unsupervised detection layers include: Deploy the improved Isolation Forest model and optimize it in the following ways: Feature correlation weighting: Calculate the Pearson correlation coefficient between input features. For feature pairs with a correlation coefficient > 0.7, multiply their weight by 1.5 before inputting them into the model. Dynamic sample sampling: The number of training samples in each batch is dynamically determined according to the formula N=R×1000, where R is the historical anomaly rate; Perform real-time detection on the sensor data stream and output a normalized anomaly score. S∈[0,1] ,in S=1 Indicates the highest probability of an anomaly; Dynamic threshold layer, including: The threshold is dynamically adjusted based on the EWMA algorithm, and the calculation formula is as follows: T t = α·X t + (1-α)·T t-1 , in X t The mean of the outlier scores for the current batch is given, and α is the smoothing factor. T t-1 The threshold value for the previous batch; Construct an adaptive threshold function by combining historical anomaly distributions: T t = μ t + k·σ t , μ t This represents the average of the abnormal scores for the current batch. σ t Standard deviation k The value will be adjusted in stages; When the abnormal score exceeds S>T t At that time, a three-level alarm mechanism is triggered.
12. The system according to claim 10, characterized in that, The fault prediction model module is configured to use a multimodal fusion prediction architecture: The abnormal trend analysis submodule includes: Perform STL decomposition on the sensor data to extract the trend term, seasonal term, and residual term; The trend term is smoothed using a Hodrick-Prescott filter, and the objective function is optimized as follows: min{Σ(T t ' - Y t ) 2 + λΣ[(T t+1 ' - T t ' ) - (T t ' - T t-1 ' )] 2 } ,in T t 'The trend term obtained after STL decomposition and Hodrick-Prescott filter processing at time...' t The value, Y t Let be the raw data value collected by the sensor at time t, and λ be the smoothing parameter. T t+1 '、 T t-1 'These represent the trend term at time t+1 and time t, respectively. The value of 1; The core submodule of time series prediction includes: Building a dual-channel LSTM network: Channel 1: Input normalized sensor data, hidden layer dimension 64, output dimension 32; Channel 2: One-hot encoding of input log error codes, hidden layer dimension 32, output dimension 16; The two-channel outputs are fused through an attention mechanism, where the attention weights are optimized using KL divergence, with the optimization objective being to minimize the difference in the distribution of the two-channel outputs. The multi-source feature fusion submodule includes: Access user behavior characteristics and consumable characteristics, and then combine them with trend analysis results and time series prediction outputs; XGBoost was used to sort the features by importance, and the top 15 features were retained based on their F1 scores. The prediction output submodule includes: Based on the fused feature vectors, the probability of failure in the next 24 hours is output. P∈[0%,100%] and fault type classification; When the probability is greater than 75%, a maintenance work order is automatically generated and pushed to the operation and maintenance system.
13. The system according to claim 10, characterized in that, The remaining lifetime prediction model module includes: The degradation feature modeling submodule is configured as follows: Multi-domain feature extraction is performed on the time-series data of motor speed, including: Time domain: root mean square value, peak factor; Frequency domain: band energy ratio, spectral entropy; A sliding window is used to calculate the feature trend, where the window size is set to 100 sampling points, the overlap rate is 50%, the sliding step size is 50 sampling points, and an equally spaced feature time series is generated. The lifetime regression prediction submodule is configured as follows: Construct a Wiener process degradation model and define the state-space equation as follows: X ( t )= X (0)+ μt + σB ( t ) Where X(t) is the degenerate state variable at time t; X(0) is the initial degenerate state, which follows the order N(μ0, σ0). 2 ) distribution, μ is the drift coefficient, σ is the diffusion coefficient; μ0 is the mean of the initial degenerate state X(0), σ0 is the standard deviation of the initial degenerate state X(0); B(t) is the standard Brownian motion; The particle filter algorithm is used to estimate the posterior distribution of the remaining lifetime (RUL), including: initialization: generating N=1000 particles, sampled from the prior distribution N(X(0), σ0). 2 Prediction step: Update particle state according to state equation; Update step: Calculate particle weight based on new observation data and avoid degradation through resampling; RUL estimation: RUL = inf{t | X(t) ≥ Θ}, where Θ is the failure threshold; The dynamic update mechanism submodule is configured as follows: Every 10 hours of new running data triggers a re-estimation of model parameters, recalculating the maximum likelihood estimate of the drift coefficient μ. When the predicted remaining lifetime (RUL) is less than 72 hours, the spare component preheating procedure is initiated, and an early warning message is pushed to the maintenance terminal via the MQTT protocol.
14. The system according to claim 1, characterized in that, The policy generation and adaptive control layer includes: The risk level assessment module determines the risk level based on the prediction results, classifying it into low risk, medium risk, and high risk. The exception type mapping strategy module maps exception types to a preset strategy mapping table; The adaptive parameter optimization generation module generates printing parameter optimization strategies based on user behavior and device status. The maintenance strategy generation module generates recommended strategies for preventative maintenance and component replacement. The self-repair command generation module generates self-repair commands that include at least calibration, reset, and soft reboot. The closed-loop monitoring module verifies and provides feedback on the execution results, forming a closed-loop intelligent control system.