Fault diagnosis method and device for Linux desktop operating system printer

By integrating troubleshooting tools in the Linux desktop operating system, automatic detection and repair of printer failures, printer compatibility and troubleshooting problems are solved, system stability and user experience are improved, troubleshooting process is simplified, and operation and maintenance costs are reduced.

CN120353416APending Publication Date: 2025-07-22KYLIN CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510516678.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing Linux desktop operating system has shortcomings in printer compatibility, troubleshooting, service stability and user experience, lacks unified diagnostic tools, complex troubleshooting processes, frequent service interruptions, and indetailed log information, resulting in time-consuming troubleshooting and poor user experience.

Method used

Provides a method for troubleshooting printers in Linux desktop operating system. Through the general printer troubleshooting tool, it automatically or responds to user operations, performs printing service inspection, configuration file inspection, port inspection, permission inspection and device inspection, obtains user feedback results, and reports the error log to the network server, integrates troubleshooting tools to achieve automated detection and repair.

Benefits of technology

It improves the stability and user experience of printing services, simplifies the troubleshooting process, improves the stability and usage efficiency of the system, reduces operation and maintenance costs, and provides an efficient printing failure solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353416A_ABST
    Figure CN120353416A_ABST
Patent Text Reader

Abstract

The invention discloses a Linux desktop operating system printer fault diagnosis method and device, and the method comprises the steps: responding to the opening operation of a user, opening a general printer fault checking tool installed in an operating system, and carrying out the printer fault diagnosis through the general printer fault checking tool automatically or responding to the operation of the user. Comprising the steps of executing printing service checking, executing configuration file checking of a printing manager, executing printing port checking, executing printing permission checking, executing printing equipment checking, executing a printing test task of printing equipment and feeding logs back to a specified network server through one key. The invention aims to improve the stability and usability of the printing function of the Linux desktop operating system, provide a more efficient printing fault troubleshooting solution for a user, simplify the configuration and fault diagnosis process of a printer, and enable the user to rapidly troubleshoot and solve the printing problem, thereby improving the stability and use efficiency of the system and reducing the operation and maintenance cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of operating systems, and particularly to a method and device for diagnosing printer faults in a Linux desktop operating system. Background Art

[0002] Currently, the operating systems widely used in printers on the market are usually commercial operating systems, such as Windows and MacOS. However, with the increasing demand for information security and the requirement of self-control, more and more enterprises have started to use Linux desktop operating systems, especially in the intranet environments of government, military, and some enterprises. However, the current Linux desktop operating systems still have certain deficiencies in printer compatibility, especially the lack of complete driver support and efficient fault troubleshooting tools.

[0003] The main disadvantages of the existing technology in the compatibility and fault troubleshooting of printers and domestic operating systems include the following points: 1. Limited fault troubleshooting means, including: (1) Lack of unified diagnostic tools: Many domestic systems lack integrated printer fault troubleshooting tools. When users encounter printing problems, it is difficult to directly identify the cause of the fault through the system, and they often need to rely on third-party software or manual troubleshooting. (2) Complex troubleshooting process: Troubleshooting printing problems usually involves multiple levels (such as drivers, networks, printing services). It is difficult for users to determine the specific source of the fault, resulting in time-consuming and complex fault troubleshooting, increasing the burden of technical support. 2. Insufficient stability of printing services, including the following problems: (1) Service interruption problems: On some domestic operating systems, the stability of the printing service may be poor, and problems such as printing task interruption and unexpected stop of the printing service are likely to occur, affecting the continuity and reliability of printing tasks. (2) Defects in task management: The printing task management function of some domestic systems is weak. When the printing queue is stuck or tasks conflict, it is difficult to effectively clean up and resume printing tasks, resulting in a poor user experience. 3. Poor user experience, manifested as the lack of self-update and maintenance functions: Many domestic operating systems lack the functions of automatically updating drivers and troubleshooting faults, and users need to perform maintenance manually. This is particularly inconvenient in enterprise environments with a large number of printer models and users. 4. Insufficient system log recording, manifested as incomplete log information: When a printing fault occurs, the log information generated by the system is usually not detailed enough to locate the specific problem, resulting in more complex debugging and detection for technicians during troubleshooting, increasing the maintenance difficulty. These defects indicate that the existing technology still has obvious deficiencies in printer compatibility, fault diagnosis, and user experience. Improving these problems will effectively improve the stability and usability of the printing function of the Linux desktop operating system and provide a more efficient printing solution for users. Summary of the Invention

[0004] Technical problems to be solved by the present invention: Aiming at the above problems of the prior art, a method and device for diagnosing printer faults in a Linux desktop operating system are provided. The present invention aims to improve the stability and usability of the printing function of the Linux desktop operating system, provide a more efficient printing fault troubleshooting solution for users, simplify the configuration and fault diagnosis process of printers, enable users to quickly troubleshoot and solve printing problems, thereby improving the stability and usage efficiency of the system and reducing the operation and maintenance costs.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is as follows: A method for diagnosing printer faults in a Linux desktop operating system, including the following steps: Responding to the user's opening operation, opening a general printer fault troubleshooting tool installed in the operating system, and performing printer fault diagnosis through the general printer fault troubleshooting tool automatically or in response to the user's operation after opening, including: S101, perform a print service check to determine whether the print service is running. If it is not running, check whether the log of the print service contains a specified error. If a specified error exists, report the error information; otherwise, restart the print service; S102, perform a configuration file check of the print manager to determine whether the configuration file is in error. If it is in error, report an error; S103, perform a print port check to determine whether the print port is blocked. If it is blocked, open the print port; S104, perform a print permission check to determine whether the current user has the print service administrator permission. If not, report an error; S105, perform a print device check to determine the status of the printer; S106, perform a print test task on the print device and obtain the feedback result of the print test task fed back by the user. If the feedback result is successful, end and exit; otherwise, obtain the error log of the print manager, and feedback and report the error log of the print manager and the environment information of the Linux desktop operating system to a specified network server in one key.

[0006] Optionally, when checking whether the log of the print service contains a specified error in step S101, it includes: detecting the error pattern code in the log of the print service by means of regular expressions or character matching. If the error pattern code is detected, match it with a preset error pattern code library to obtain the corresponding error information; detecting the fault records and the time of the fault records in the log of the print service by means of regular expressions or character matching. If the number of fault records of the same type includes multiple records, use the time difference between adjacent fault records of the same type as the period of the fault record, and use the fault record and its period as the obtained error information.

[0007] Optionally, when detecting whether there is a specified error in the log of the printing service in step S101, it includes: S201, extracting the file descriptor records in the log of the printing service; S202, extracting the fields of the file descriptor records from the record information of the file descriptors, including the process ID, operation type, file descriptor, and file name; S203, extracting the file descriptor change characteristics according to the field information of the file descriptor records, where the file descriptor change characteristics include the opening and closing frequencies of the file descriptors, the usage duration of the file descriptors, and the operation modes of the same process on different file descriptors, and the usage duration of the file descriptor refers to the time interval from the opening to the closing of the file descriptor; S204, normalizing the file descriptor change characteristics and inputting them into a pre-trained machine learning model to obtain a prediction result of whether there is a memory leak risk, and generating an error message indicating the existence of a memory leak risk if there is a memory leak risk.

[0008] Optionally, when performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing an integrity verification of the configuration file of the print manager, where the integrity verification refers to generating a check value of the configuration file of the print manager using a preset verification algorithm, comparing the generated check value with the given check value, and determining that the integrity verification passes if the two are consistent, otherwise determining that the integrity verification is in error.

[0009] Optionally, when performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing an interface matching degree verification of the configuration file of the print manager, where the interface matching degree verification refers to obtaining the interface type and required power configured in the configuration file of the print manager, querying a preset interface power table with the interface type to obtain the power supply of the interface, and comparing the power supply of the interface with the configured required power, and determining that the interface matching degree verification passes if the power supply of the interface is greater than or equal to the configured required power, otherwise determining that the interface matching degree verification is in error.

[0010] Optionally, when performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing a topology relationship verification of the configuration file of the print manager, where the topology relationship verification refers to obtaining the name and IP address of the network printer configured in the configuration file of the print manager, scanning the names and IP addresses of the devices in the local area network, and matching the IP address of the network printer with the IP addresses of the devices in the local area network, and determining that the topology relationship verification passes if there are no devices in the local area network with the same IP address but different names, otherwise determining that the topology relationship verification is in error.

[0011] Optionally, the execution of the printing device check in step S105 to determine the status of the printer includes: S301, obtaining printing device information and generating a printing device list; S302, traversing and obtaining a printing device from the printing device list as the current printing device. If the traversal is successful, jump to step S303; otherwise, jump to step S106; S303, determining the driver installation status of the current printing device. If the driver has not been installed, query a preset server according to the manufacturer ID information and device ID information of the current printing device to download the corresponding driver program, and install the driver program of the current printing device after the driver program is downloaded; S304, determining the type of the current printing device. If it is a local printer, jump to step S305; if it is a network printer, jump to step S306; S305, reading the device file of the current printing device to determine whether the current printing device is normally connected, and jump to step S307; S306, using a network tool to detect whether the IP address of the current printing device is reachable, and jump to step S307; S307, checking the printer queue status of the current printing device to determine whether there is a situation where the printing task is stuck. If the printing task is stuck, use the command line to clean the printer queue of the current printing device; jump to step S302.

[0012] In addition, the present invention further provides a printer fault diagnosis device for a Linux desktop operating system, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the printer fault diagnosis method for the Linux desktop operating system.

[0013] In addition, the present invention further provides a computer-readable storage medium, in which a computer program or instruction is stored, and the computer program or instruction is programmed or configured to execute the printer fault diagnosis method for the Linux desktop operating system through a processor.

[0014] In addition, the present invention further provides a computer program product, including a computer program or instruction, and the computer program or instruction is programmed or configured to execute the printer fault diagnosis method for the Linux desktop operating system through a processor.

[0015] Compared with the prior art, the present invention can mainly achieve the following beneficial effects: The present invention includes responding to a user's opening operation to open a general printer troubleshooting tool installed in an operating system. After the general printer troubleshooting tool is opened, it automatically or responds to the user's operation to perform printer fault diagnosis, including performing a print service check, performing a configuration file check of a print manager, performing a print port check, performing a print permission check, performing a print device check, performing a print test task of a print device, and obtaining a feedback result of the print test task fed back by the user. If the feedback result is successful, it ends and exits; otherwise, it obtains the error log of the print manager and reports the error log of the print manager and the environment information of the Linux desktop operating system to a specified network server in one key. The present invention can improve driver compatibility, introduce an integrated fault diagnosis tool, optimize service stability and user experience, and create an efficient, stable and convenient print management solution applicable to the Linux operating system, thereby solving the existing technical problems such as poor print compatibility and difficult troubleshooting. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic diagram of the basic process of the method according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] The present invention aims to solve the following technical problems to improve the deficiencies of domestic desktop operating systems in printer compatibility and troubleshooting, and to enhance user experience and system stability. (1) Provide an integrated troubleshooting tool, including the following integrated functions: Integrated fault diagnosis: Provide a unified troubleshooting tool for users, enabling them to directly diagnose printing faults in the operating system, reducing reliance on third-party tools, and significantly shortening the troubleshooting time. Automatic fault detection and repair: The system can automatically detect common printing problems (such as driver faults, service interruptions, network connection problems, etc.) and provide an automatic repair function, reducing the workload of technical support and improving user experience. (2) Enhance the stability of the printing service: Printing service monitoring and restart mechanism: The present invention will implement a real-time monitoring and automatic restart mechanism for the printing service to ensure that the service can quickly recover after an abnormal interruption, reducing the impact on users' printing tasks and ensuring the continuity of the printing service. Task management optimization: By improving the management method of printing tasks, prevent task jams or conflicts and improve printing efficiency. (3) Improve system log recording and feedback: Detailed log recording, increase the detail level of system log recording, especially for printing-related operations, to help users and technical support personnel quickly locate problems. (4) User feedback mechanism: Provide a feedback mechanism to record the troubleshooting history of users for future reference and improvement, improving the overall maintainability of the system. To enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention will be further described in detail below with reference to the accompanying drawings in the embodiments of the present invention.

[0018] As Figure 1 shown, this embodiment provides a method for diagnosing printer faults in a Linux desktop operating system, including the following steps: In response to the user's open operation, open the general printer troubleshooting tool installed in the operating system, and perform printer fault diagnosis through the general printer troubleshooting tool automatically or in response to the user's operation after it is opened, including: S101, Execute a print service check to determine whether the print service is running. If it is not running, check whether the log of the print service has a specified error. If there is a specified error, report the error information; otherwise, restart the print service; S102, Execute a configuration file check of the print manager to determine whether the configuration file is in error. If it is in error, report an error; S103, Execute a print port check to determine whether the print port is blocked. If it is blocked, open the print port; S104, Execute a print permission check to determine whether the current user has the print service administrator permission. If not, report an error; S105, Execute a print device check to determine the status of the printer; S106, execute the print test task of the printing device, and obtain the feedback result of the print test task fed back by the user. If the feedback result is successful, end and exit; otherwise, obtain the error log of the print manager, and report the error log of the print manager and the environment information of the Linux desktop operating system to the designated network server with one click.

[0019] In step S101, it is determined whether the print service runs an executable command: systemctl status cups, If the service is not running, check the print service log to troubleshoot the problem: tail -f / var / log / cups / error_log By analyzing the contents in the log, potential problems in the printer service can be analyzed and resolved in a timely manner.

[0020] In step S101 of this embodiment, when detecting whether the log of the printing service has a specified error, it includes: detecting the error pattern code in the log of the printing service by means of regular expression or character matching, and if the error pattern code is detected, matching it with a preset error pattern code library to obtain the corresponding error information. For example, if the error pattern specific to the built-in domestic printers such as Pantum / Deli (such as "selenium drum chip authentication failure-Err 0x5F21") is detected by means of regular expression or character matching, "selenium drum chip authentication failure-Err 0x5F21" can be determined as the error information of selenium drum chip authentication failure.

[0021] In step S101 of this embodiment, when detecting whether the log of the printing service contains a specified error, the method includes: detecting the fault record and the time of the fault record in the log of the printing service by means of regular expressions or character matching; if there are multiple fault records of the same type, the time difference between adjacent fault records of the same type is used as the period of the fault record; the fault record and its period are used as the obtained error information; the method above can realize the analysis of the timing pattern of the error, and can identify periodic faults such as "USB handshake timeout occurring every 5 minutes".

[0022] In addition, considering that memory leaks are often difficult to detect, the universal printer troubleshooting tool of this embodiment also provides memory resource leak prediction, and predicts the risk of memory leak through the file descriptor changes in the log. Specifically, when detecting whether the log of the printing service contains a specified error in step S101 of this embodiment, it includes: S201, extracting file descriptor records in the log of the printing service; S202. Extract the fields recorded by the file descriptor from the recorded information of the file descriptor, including the process ID, operation type, file descriptor, and file name. S203. Extract the file descriptor change characteristics according to the field information of the file descriptor record. The file descriptor change characteristics include the opening and closing frequencies of the file descriptor, the usage duration of the file descriptor, and the operation modes of different file descriptors by the same process. The usage duration of the file descriptor refers to the time interval from the opening to the closing of the file descriptor. S204. Normalize the file descriptor change characteristics and input them into a pre-trained machine learning model to obtain a prediction result of whether there is a memory leak risk. If there is a memory leak risk, generate an error message indicating the existence of a memory leak risk. Among them, the machine learning model can use a support vector machine. When training the machine learning model, a simulated operation of the file descriptor causing a memory leak can be artificially created, and a training data set of the file descriptor change characteristics is generated through the above simulated operation to train the machine learning model, so that it learns to establish a mapping relationship between the file descriptor change characteristics and the prediction result of whether there is a memory leak risk.

[0023] When performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, the configuration file of the print manager can be read through the following command: cat / etc / cups / printers.conf Among them, printers.conf is the configuration file of the print manager. After obtaining the configuration file of the print manager, a preset check policy can be adopted as needed to determine whether the configuration file is in error.

[0024] For example, as an optional implementation manner, when performing a configuration file check of the print manager in step S102 of this embodiment to determine whether the configuration file is in error, it includes performing an integrity verification of the configuration file of the print manager. The integrity verification refers to generating a check value of the configuration file of the print manager using a preset check algorithm, comparing the generated check value with a given check value. If the two are consistent, it is determined that the integrity verification passes; otherwise, it is determined that the integrity verification is in error. For example, for the InkCrypt parameter integrity verification of the Deli M2500 printer in this embodiment, printer failures caused by reasons such as the InkCrypt parameter of the Deli M2500 printer being damaged can be detected. In addition, the TrustedBoot configuration detection of a certain model of Lenovo printer can be performed to prevent printer failures caused by the failure of the printer to start.

[0025] For example, as another alternative embodiment, when performing a configuration file check of the print manager in step S102 of this embodiment to determine whether there is an error in the configuration file, it includes performing an interface matching degree verification of the configuration file of the print manager. The interface matching degree verification refers to obtaining the interface type and required power configured in the configuration file of the print manager, querying a preset interface power table by the interface type to obtain the power supply power of the interface, and comparing the power supply power of the interface with the configured required power. If the power supply power of the interface is greater than or equal to the configured required power, it is determined that the interface matching degree verification passes; otherwise, it is determined that the interface matching degree verification fails. For example, the maximum power supply of USB2.0 is 5V × 0.5A (500mA = 0.5A) = 2.5 watts, which cannot meet some USB portable printers that rely on a larger power supply.

[0026] For example, as another alternative embodiment, when performing a configuration file check of the print manager in step S102 of this embodiment to determine whether there is an error in the configuration file, it includes performing a topology relationship verification of the configuration file of the print manager. The topology relationship verification refers to obtaining the name and IP address of the network printer configured in the configuration file of the print manager, scanning the names and IP addresses of the devices in the local area network, and matching the IP address of the network printer with the IP addresses of the devices in the local area network. If there is no device in the local area network with the same IP address but different names, it is determined that the topology relationship verification passes; otherwise, it is determined that the topology relationship verification fails.

[0027] When performing a print port check in step S103 of this embodiment, if it is necessary to confirm whether the print service port (such as 9100) is blocked, the method of telnet [printer IP address] 9100 can be used to determine whether the print port is blocked. If it is blocked, the print port is opened.

[0028] When performing a print permission check in step S104 of this embodiment to determine whether the current user has the print service administrator permission (lpadmin), if not, an error is reported, and the user can be prompted that they do not have the permissions to add a printer, modify printer properties, etc., and can only perform print job tasks.

[0029] When performing a print device check in step S105 of this embodiment to determine the status of the printer, it includes: S301, obtaining print device information and generating a print device list; S302, traversing and obtaining a print device from the print device list as the current print device. If the traversal is successful, jump to step S303; otherwise, jump to step S106; S303. Determine the driver installation status of the current printing device. If the driver has not been installed, query a preset server based on the manufacturer ID information and device ID information of the current printing device to download the corresponding driver program, and install the driver program of the current printing device after the driver program is downloaded. S304. Determine the type of the current printing device. If it is a local printer, jump to step S305; if it is a network printer, jump to step S306. S305. Read the device file of the current printing device to determine whether the current printing device is normally connected, and jump to step S307. S306. Use a network tool to detect whether the IP address of the current printing device is reachable, and jump to step S307. S307. Check the printer queue status of the current printing device to determine whether there is a situation where the printing task is stuck. If the printing task is stuck, use the command line to clean the printer queue of the current printing device; jump to step S302. Among them, the command that can be used to check the printer queue status of the current printing device is: lpstat -p -d The output example obtained is as follows: printer hp-LaserJet-4050 now printing hp-LaserJet-4050-12. enabled since Oct 12 2023 system default destination: hp-LaserJet-4050 Among them, "printer": indicates the start of the basic information part of the printer. "hp-LaserJet-4050": This is the name of the printer, used to identify a specific printer device. "now printing": indicates that the printer is currently in the printing state. "hp-LaserJet-4050-12": This is the name or identifier of the printing task being printed. Usually, it can represent a number in the printing queue or a specific file identifier of the printing task, etc., to facilitate users and the system to track the printing task. "enabled": indicates that the printer has been enabled and can accept printing tasks. "since Oct 12 2023": indicates that the printer has been enabled since October 12, 2023. This helps to understand the service time and status history of the printer. "system default destination": This indicates the system default printing target device.

[0030] In step S106 of this embodiment, when performing the print test task of the printing device, it is necessary for the user to assist in judging whether the printed test page is normal, so as to obtain the feedback result of the print test task fed back by the user. If the feedback result is successful, it means that there is no problem with the system and the driver, and the process ends and exits. Otherwise, obtain the error log of the print manager, and feedback and report the error log of the print manager ( / var / log / cups / error_log) and the environment information of the Linux desktop operating system to the specified network server in one key. For example, it may indicate that there is no problem with the system and the driver, but the user document format or content is abnormal, etc. By providing a one-key feedback function, relevant logs and environment information are submitted to the network server for the technical support team to solve the problem.

[0031] In summary, the printer fault diagnosis method for the Linux desktop operating system in this embodiment provides a complete printer fault troubleshooting solution for the commercial version of the Linux desktop operating system. The key lies in the technical solution for solving printer faults, including: the detection and recovery mechanism of the print service, the detection and alarm of the printer status, and the detection and alarm of the printer queue. It can break through the detection blank of the traditional solution for the special processes such as the certification of domestic printer chips and secure communication, and handle the special problems that occur in domestic printers. The printer fault diagnosis method for the Linux desktop operating system in this embodiment creates an efficient, stable and convenient print management solution suitable for the Linux operating system by improving driver compatibility, introducing integrated fault diagnosis tools, optimizing service stability and user experience, thereby solving the existing technical problems such as poor print compatibility and difficult fault troubleshooting. The printer fault diagnosis method for the Linux desktop operating system in this embodiment can help users quickly locate and solve problems through the intelligent guidance of the system when the printer fails. The design of this solution focuses on enhancing the user's fault troubleshooting experience, enabling users to complete the self-troubleshooting and repair process step by step through detailed fault information and intuitive operation guidance without a professional technical background when encountering printer anomalies, thereby improving work efficiency and reducing business interruptions caused by print failures.

[0032] In addition, this embodiment also provides a printer fault diagnosis device for the Linux desktop operating system, including a microprocessor and a memory connected to each other, and the microprocessor is programmed or configured to execute the printer fault diagnosis method for the Linux desktop operating system.

[0033] In addition, this embodiment also provides a computer-readable storage medium, in which a computer program or instruction is stored, and the computer program or instruction is programmed or configured to execute the printer fault diagnosis method for the Linux desktop operating system through a processor.

[0034] In addition, this embodiment also provides a computer program product, including a computer program or instruction, which is programmed or configured to execute the printer fault diagnosis method of the Linux desktop operating system through a processor.

[0035] Those skilled in the art should understand that the technical solution provided by the present invention can be in the form of a method, a system, or a computer program product. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code. The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the processes and / or Figure 1 blocks. These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implements the functions specified in Figure 1 one or more of the processes and / or Figure 1 blocks. These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the processes and / or Figure 1 blocks.

[0036] The above is only the preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions within the idea of the present invention belong to the protection scope of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A method for diagnosing printer faults in a Linux desktop operating system, characterized in that, It includes the following steps: In response to the user's opening operation, open the general printer troubleshooting tool installed in the operating system, and perform printer fault diagnosis automatically or in response to the user's operation after the general printer troubleshooting tool is opened, including: S101, perform a print service check to determine whether the print service is running. If it is not running, check whether the log of the print service has a specified error. If there is a specified error, report the error message; otherwise, restart the print service; S102, perform a configuration file check of the print manager to determine whether the configuration file is in error. If there is an error, report the error; S103, perform a print port check to determine whether the print port is blocked. If it is blocked, open the print port; S104, perform a print permission check to determine whether the current user has print service administrator privileges. If not, report the error; S105, perform a print device check to determine the status of the printer; S106, perform a print test task on the print device and obtain the feedback result of the print test task fed back by the user. If the feedback result is successful, end and exit; otherwise, obtain the error log of the print manager, and feedback and report the error log of the print manager and the environment information of the Linux desktop operating system to a specified network server in one key.

2. The printer fault diagnosis method for the Linux desktop operating system according to claim 1, wherein When checking whether the log of the print service has a specified error in step S101, it includes: detecting the error mode code in the log of the print service by means of regular expression or character matching. If the error mode code is detected, match it with a preset error mode code library to obtain the corresponding error information; detecting the fault record and the time of the fault record in the log of the print service by means of regular expression or character matching. If the number of fault records of the same type includes multiple records, use the time difference between adjacent fault records in the fault records of the same type as the period of the fault record, and use the fault record and its period as the obtained error information.

3. The printer fault diagnosis method for the Linux desktop operating system according to claim 2, wherein When checking whether the log of the print service has a specified error in step S101, it includes: S201, extract the file descriptor record in the log of the print service; S202, extract the fields of the file descriptor record from the record information of the file descriptor, including the process ID, operation type, file descriptor, and file name; S203, extract the file descriptor change characteristics according to the field information of the file descriptor record. The file descriptor change characteristics include the opening and closing frequencies of the file descriptor, the usage duration of the file descriptor, and the operation mode of the same process for different file descriptors. The usage duration of the file descriptor refers to the time interval from the opening to the closing of the file descriptor; S204, normalize the file descriptor change characteristics and input them into a pre-trained machine learning model to obtain a prediction result of whether there is a risk of memory leakage. If there is a risk of memory leakage, generate an error message indicating the existence of a memory leakage risk.

4. The printer fault diagnosis method for the Linux desktop operating system according to claim 1, characterized in that, When performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing an integrity verification of the configuration file of the print manager. The integrity verification refers to generating a check value of the configuration file of the print manager using a preset verification algorithm, comparing the generated check value with the given check value. If the two are the same, it is determined that the integrity verification passes; otherwise, it is determined that the integrity verification is in error.

5. The printer fault diagnosis method for the Linux desktop operating system according to claim 4, characterized in that When performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing an interface matching degree verification of the configuration file of the print manager. The interface matching degree verification refers to obtaining the interface type and required power configured in the configuration file of the print manager, querying a preset interface power table based on the interface type to obtain the power supply of the interface, and comparing the power supply of the interface with the configured required power. If the power supply of the interface is greater than or equal to the configured required power, it is determined that the interface matching degree verification passes; otherwise, it is determined that the interface matching degree verification is in error.

6. The method for diagnosing printer faults in the Linux desktop operating system according to claim 5, wherein When performing a configuration file check of the print manager in step S102 to determine whether the configuration file is in error, it includes performing a topology relationship verification of the configuration file of the print manager. The topology relationship verification refers to obtaining the name and IP address of the network printer configured in the configuration file of the print manager, scanning the names and IP addresses of the devices in the local area network, and matching the IP address of the network printer with the IP addresses of the devices in the local area network. If there is no device in the local area network with the same IP address but different name, it is determined that the topology relationship verification passes; otherwise, it is determined that the topology relationship verification is in error.

7. The method for diagnosing printer faults in the Linux desktop operating system according to claim 1, wherein When performing a print device check in step S105 to determine the status of the printer, it includes: S301, obtaining print device information and generating a print device list; S302, traversing and obtaining a print device from the print device list as the current print device. If the traversal is successful, jump to step S303; otherwise, jump to step S106; S303, judging the driver installation status of the current print device. If the driver has not been installed, query a preset server based on the manufacturer ID information and device ID information of the current print device to download the corresponding driver program, and install the driver program of the current print device after the driver program is downloaded; S304, judging the type of the current print device. If it is a local printer, jump to step S305; if it is a network printer, jump to step S306; S305, reading the device file of the current print device to determine whether the current print device is normally connected, and jump to step S307; S306, using a network tool to detect whether the IP address of the current print device is reachable, and jump to step S307; S307, checking the printer queue status of the current print device to determine whether there is a stuck print task. If the print task is stuck, use the command line to clean the printer queue of the current print device; jump to step S302.

8. A printer fault diagnosis device for a Linux desktop operating system, comprising a microprocessor and a memory connected to each other, characterized in that, The microprocessor is programmed or configured to execute the Linux desktop operating system printer fault diagnosis method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program or instructions, characterized in that, The computer program or instruction is programmed or configured to execute the printer fault diagnosis method of the Linux desktop operating system according to any one of claims 1 to 7 through a processor.

10. A computer program product comprising a computer program or instructions, characterized in that, The computer program or instruction is programmed or configured to execute the printer fault diagnosis method of the Linux desktop operating system according to any one of claims 1 to 7 through a processor.