Equipment anomaly detection method, electronic equipment, storage medium and program product

By comparing the target rule content of the device with the preset rule content, determining the cause of the udev rule file exception and repairing it, the problem of the inability to accurately determine the cause of the device exception in the prior art is solved, and the system stability and user experience are improved.

CN119311455APending Publication Date: 2025-01-14BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411373673.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art cannot accurately determine whether Linux system device abnormalities are caused by udev rule files, resulting in device management difficulties and system failures.

Method used

By obtaining the device's target rule name and content, comparing with preset rule content, determining the cause of the exception, and automatically or semi-automatically repairing the rule file when it does not match, improving the accuracy of abnormal detection and system stability.

Benefits of technology

It realizes accurate detection and repair of udev rule file exceptions, reduces system failures caused by improper rule configuration, and improves the accuracy and user experience of device management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311455A_ABST
    Figure CN119311455A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment anomaly detection method, electronic equipment, a storage medium and a program product, and the method comprises the steps: obtaining target detection data of to-be-detected equipment, the target detection data at least comprising a target rule name of the to-be-detected equipment and target rule content corresponding to the target rule name; determining preset rule content corresponding to the target rule name according to a pre-stored rule base; the pre-stored rule base comprises a rule name and preset rule content corresponding to the rule name; according to the target rule content and the preset rule content, the anomaly detection result of the to-be-detected device is determined, the anomaly detection result is used for determining the anomaly reason of the to-be-detected device, whether the anomaly reason of the device is caused by the udev rule file or not is determined according to the comparison result, and the anomaly detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a device anomaly detection method, electronic equipment, storage medium, and program product. Background Art

[0002] With the rapid development of computer technology, the Linux operating system has been widely used in many fields such as servers, embedded systems and personal computers due to its open source, stable and secure features. Device management in the Linux system is crucial to ensure the normal operation of hardware devices, and udev is the key component used for device management in the Linux system, which dynamically manages device nodes through udev. In the actual use of the device, device abnormalities may occur. Currently, there is no technical means to accurately determine whether the device abnormality is caused by a problem with the udev rule file. Therefore, how to accurately determine whether the device abnormality is caused by an abnormal udev rule file is an urgent problem to be solved. Summary of the invention

[0003] The purpose of some embodiments of the present application is to provide a device abnormality detection method, electronic device, storage medium and program product. Through the technical solution of the embodiments of the present application, by obtaining target detection data of the device to be detected, wherein the target detection data at least includes the target rule name of the device to be detected and the target rule content corresponding to the target rule name; according to a pre-stored rule library, determining the preset rule content corresponding to the target rule name; the pre-stored rule library includes a rule name and a preset rule content corresponding to the rule name; according to the target rule content and the preset rule content, determining the abnormality detection result of the device to be detected, the abnormality detection result is used to determine the abnormality cause of the device to be detected. The embodiment of the present application obtains the target rule content of the device in real time, and according to the target rule name corresponding to the target rule content, according to the pre-stored rule library, determines the preset rule content corresponding to the target rule name, and then compares the target rule content with the preset rule content, and determines the cause of the device abnormality according to the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0004] In a first aspect, some embodiments of the present application provide a device abnormality detection method, including:

[0005] Acquire target detection data of the device to be detected, wherein the target detection data at least includes a target rule name of the device to be detected and a target rule content corresponding to the target rule name;

[0006] Determine, according to a pre-stored rule base, a preset rule content corresponding to the target rule name; the pre-stored rule base includes a rule name and a preset rule content corresponding to the rule name;

[0007] According to the target rule content and the preset rule content, an abnormality detection result of the device to be detected is determined, and the abnormality detection result is used to determine the abnormality cause of the device to be detected.

[0008] Some embodiments of the present application obtain the target rule content of the device in real time, and determine the preset rule content corresponding to the target rule name according to the target rule name corresponding to the target rule content and according to a pre-stored rule library, and then compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, to improve the accuracy of abnormality detection.

[0009] Optionally, determining the abnormality detection result of the device to be detected according to the target rule content and the preset rule content includes:

[0010] If the target rule content matches the preset rule content, it is determined that the abnormal detection reason of the device to be detected does not come from the udev rule;

[0011] If the target rule content does not match the preset rule content, it is determined that the abnormal detection reason of the device to be detected comes from the udev rule.

[0012] Some embodiments of the present application compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0013] Optionally, the method further comprises:

[0014] In the case that the target rule content does not match the preset rule content, the target rule content is modified according to the preset rule content.

[0015] In some embodiments of the present application, when it is determined that the target rule content does not match the preset rule content, the target rule content of the device is updated and modified according to the preset rule content, and the problematic rule is automatically or semi-automatically repaired according to the diagnosis result.

[0016] Optionally, the modifying the target rule content according to the preset rule content includes:

[0017] Modify the target rule content according to the preset rule content by manual modification;

[0018] Or in response to a one-key modification instruction input by a user, the target rule content is modified according to the preset rule content.

[0019] Some embodiments of the present application develop an automated repair function that allows the tool to automatically or semi-automatically repair problematic rules based on diagnostic results, thereby reducing system failures caused by improper rule configuration by automatically detecting and repairing udev rule problems.

[0020] Optionally, the method further comprises:

[0021] The grammatical rules and rule integrity of the target rule content are checked.

[0022] Some embodiments of the present application will detect whether its syntax is correct and whether the rules are complete; then the system will compare it with the rule base to determine information such as device matching accuracy and rule logic accuracy; then it will check symbolic links and device node conflict detection, as well as rule dependencies, to improve the accuracy and comprehensiveness of detection.

[0023] Optionally, the method further comprises:

[0024] The target rule content, the preset rule content and the anomaly detection result are displayed.

[0025] In some embodiments of the present application, by displaying the target rule content, the preset rule content and the anomaly detection result on a user graphical interface, non-technical users can also easily manage and modify udev rules.

[0026] Optionally, the pre-stored rule base includes a rule basic information table, the rule basic information table includes a rule name, preset rule content, rule description information, function classification information and device type, the preset rule content, the rule description information, the function classification information and the device type respectively correspond to the rule name;

[0027] The pre-stored rule base also includes a function classification information sub-table and a device type information sub-table. The function classification information sub-table is determined according to the function classification information in the rule basic information table, and the device type information sub-table is determined according to the device type in the rule basic information table.

[0028] Some embodiments of the present application set up a comprehensive and standardized rule base, including verified udev rules, for comparison with device rule files acquired in real time, and can identify and classify diagnostic logic of potential problems of udev rules, including syntax errors, logic conflicts, etc.

[0029] In a second aspect, some embodiments of the present application provide a device for detecting anomalies of a device, including:

[0030] An acquisition module, used for acquiring target detection data of a device to be detected, wherein the target detection data at least includes a target rule name of the device to be detected and target rule content corresponding to the target rule name;

[0031] A determination module, configured to determine a preset rule content corresponding to the target rule name according to a pre-stored rule base; the pre-stored rule base includes a rule name and a preset rule content corresponding to the rule name;

[0032] The detection module is used to determine the abnormal detection result of the device to be detected according to the target rule content and the preset rule content, and the abnormal detection result is used to determine the abnormal cause of the device to be detected.

[0033] Some embodiments of the present application obtain the target rule content of the device in real time, and determine the preset rule content corresponding to the target rule name according to the target rule name corresponding to the target rule content and according to a pre-stored rule library, and then compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, to improve the accuracy of abnormality detection.

[0034] Optionally, the detection module is used to:

[0035] If the target rule content matches the preset rule content, it is determined that the abnormal detection reason of the device to be detected does not come from the udev rule;

[0036] If the target rule content does not match the preset rule content, it is determined that the abnormal detection reason of the device to be detected comes from the udev rule.

[0037] Some embodiments of the present application compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0038] Optionally, the detection module is used to:

[0039] In the case that the target rule content does not match the preset rule content, the target rule content is modified according to the preset rule content.

[0040] In some embodiments of the present application, when it is determined that the target rule content does not match the preset rule content, the target rule content of the device is updated and modified according to the preset rule content, and the problematic rule is automatically or semi-automatically repaired according to the diagnosis result.

[0041] Optionally, the detection module is used to:

[0042] Modify the target rule content according to the preset rule content by manual modification;

[0043] Or in response to a one-key modification instruction input by a user, the target rule content is modified according to the preset rule content.

[0044] Some embodiments of the present application develop an automated repair function, allowing the tool to automatically or semi-automatically repair problem rules based on the diagnosis results. 通过自动检测和修复 u d ev 规则问题 , 减少因规则配置不 When the system fails.

[0045] Optionally, the detection module is used to:

[0046] The grammatical rules and rule integrity of the target rule content are checked.

[0047] Some embodiments of the present application will detect whether its syntax is correct and whether the rules are complete; then the system will compare it with the rule base to determine information such as device matching accuracy and rule logic accuracy; then it will check symbolic links and device node conflict detection, as well as rule dependencies, to improve the accuracy and comprehensiveness of detection.

[0048] Optionally, the detection module is used to:

[0049] The target rule content, the preset rule content and the anomaly detection result are displayed.

[0050] In some embodiments of the present application, by displaying the target rule content, the preset rule content and the anomaly detection result on a user graphical interface, non-technical users can also easily manage and modify udev rules.

[0051] Optionally, the pre-stored rule base includes a rule basic information table, the rule basic information table includes a rule name, preset rule content, rule description information, function classification information and device type, the preset rule content, the rule description information, the function classification information and the device type respectively correspond to the rule name;

[0052] The pre-stored rule base also includes a function classification information sub-table and a device type information sub-table. The function classification information sub-table is determined according to the function classification information in the rule basic information table, and the device type information sub-table is determined according to the device type in the rule basic information table.

[0053] Some embodiments of the present application set up a comprehensive and standardized rule base, including verified udev rules, for comparison with device rule files acquired in real time, and can identify and classify diagnostic logic of potential problems of udev rules, including syntax errors, logic conflicts, etc.

[0054] In a third aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the device abnormality detection method as described in any embodiment of the first aspect can be implemented.

[0055] In a fourth aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the device anomaly detection method as described in any embodiment of the first aspect.

[0056] In a fifth aspect, some embodiments of the present application provide a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the device anomaly detection method as described in any embodiment of the first aspect can be implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 A schematic diagram of a process flow of a device abnormality detection method provided in an embodiment of the present application;

[0059] Figure 2 A schematic diagram of constructing a rule base provided in an embodiment of the present application;

[0060] Figure 3 A flowchart of another device abnormality detection method provided in an embodiment of the present application;

[0061] Figure 4 A schematic diagram of the structure of a device abnormality detection device provided in an embodiment of the present application;

[0062] Figure 5 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0063] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.

[0064] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0065] With the rapid development of computer technology, the Linux operating system has been widely used in many fields such as servers, embedded systems and personal computers due to its open source, stable and secure features. Device management in the Linux system is crucial to ensure the normal operation of hardware devices, and udev is the key component for device management in the Linux system, which dynamically manages device nodes through udev. udev, the user-space device manager, is responsible for dynamically managing device nodes during system startup and operation. It determines the permissions and attributes of the device by reading the udev rule file, thereby affecting the access and operation of the device. The udev rule file is usually located in the / etc / udev / rules.d directory and is edited and managed by the system administrator or automatic configuration tools. However, the complexity and flexibility of udev rules also bring certain risks. Improper rule configuration may cause the device to be unable to be correctly identified or accessed by the system, thus affecting the normal use of the device. Especially for basic input devices such as mice and keyboards, if the udev rules are not set properly, the device may not move or respond, seriously affecting the user experience and the operating efficiency of the system.

[0066] In existing technologies, solving udev rule problems usually requires users to have certain technical knowledge and manually check and modify rule files through the command line interface. This process is not only cumbersome and error-prone, but also particularly difficult for non-technical users. In addition, once a rule is misconfigured, it may require a system reboot or more complex troubleshooting steps to recover, which undoubtedly increases the user's usage cost and time cost.

[0067] In view of the above problems, although there are some udev rule management tools on the market, they often have single functions, unfriendly interfaces, and lack effective automatic diagnosis and repair functions. In the actual use of the device, device abnormalities may occur. At present, there is no technical means to accurately determine whether the device abnormality is caused by a problem in the udev rule file. In view of this, some embodiments of the present application provide a device abnormality detection method, which obtains target detection data of the device to be detected, wherein the target detection data at least includes the target rule name of the device to be detected and the target rule content corresponding to the target rule name; according to the pre-stored rule library, the preset rule content corresponding to the target rule name is determined; the pre-stored rule library includes the rule name and the preset rule content corresponding to the rule name; according to the target rule content and the preset rule content, the abnormal detection result of the device to be detected is determined, and the abnormal detection result is used to determine the cause of the abnormality of the device to be detected. The embodiment of the present application obtains the target rule content of the device in real time, and according to the target rule name corresponding to the target rule content, according to the pre-stored rule library, determines the preset rule content corresponding to the target rule name, and then compares the target rule content with the preset rule content, and determines the cause of the device abnormality according to the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0068] like Figure 1 As shown, an embodiment of the present application provides a device abnormality detection method, the method comprising:

[0069] S101, obtaining target detection data of a device to be detected, wherein the target detection data at least includes a target rule name of the device to be detected and target rule content corresponding to the target rule name;

[0070] Specifically, the device to be detected is installed on a computer with a Linux system installed on it. The Linux system obtains target detection data of the device to be detected. The target detection data at least includes a target rule file. The target rule file includes target rule content, and then the target rule name corresponding to the target rule content is obtained.

[0071] Among them, the devices to be tested include at least input devices, storage devices, network devices, multimedia devices, power management, interface devices, system hardware and other devices. Input devices also include keyboards, mice, touch screens and game controllers, etc. Storage devices also include hard disk drives, solid-state drives, USB drives and optical drives. Network devices also include Ethernet cards, wireless network cards, and Bluetooth adapters; power management devices also include batteries and UPS, interface devices also include USB controllers, PCI controllers and SCSI controllers, and system hardware also includes central processing units, motherboards and BIOS.

[0072] S102, determining a preset rule content corresponding to a target rule name according to a pre-stored rule base; the pre-stored rule base includes a rule name and preset rule content corresponding to the rule name;

[0073] Specifically, a rule base is stored in advance on a computer, the rule base includes udev rules for all different types of devices, and common udev rules and unique udev rules are set for each device, and a rule name is set for each rule, as well as preset rule content corresponding to each rule name.

[0074] The computer searches for preset rule content corresponding to the target rule name in a pre-stored rule library according to the acquired target rule name.

[0075] S103: Determine an abnormality detection result of the device to be detected according to the target rule content and the preset rule content, and the abnormality detection result is used to determine the abnormality cause of the device to be detected.

[0076] After obtaining the target rule content and the preset rule content, the computer judges the target rule content and the preset rule content to obtain an abnormality detection result of the device to be detected, and judges whether the cause of the abnormality of the device to be detected is caused by the udev rule according to the abnormality detection result.

[0077] Some embodiments of the present application obtain the target rule content of the device in real time, and determine the preset rule content corresponding to the target rule name according to the target rule name corresponding to the target rule content and according to a pre-stored rule library, and then compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, to improve the accuracy of abnormality detection.

[0078] Another embodiment of the present application further supplements the device anomaly detection method provided in the above embodiment.

[0079] Optionally, determining an abnormality detection result of the device to be detected according to the target rule content and the preset rule content includes:

[0080] If the target rule content matches the preset rule content, it is determined that the abnormal detection reason of the device to be detected does not come from the udev rule;

[0081] If the target rule content does not match the preset rule content, it is determined that the abnormal detection cause of the device to be detected comes from the udev rule.

[0082] Some embodiments of the present application compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0083] Optionally, the method further comprises:

[0084] In the case that the target rule content does not match the preset rule content, the target rule content is modified according to the preset rule content.

[0085] In some embodiments of the present application, when it is determined that the target rule content and the preset rule content do not match, the target rule content of the device is updated and modified according to the preset rule content, and the problematic rule is automatically or semi-automatically repaired according to the diagnosis result.

[0086] Optionally, modify the target rule content according to the preset rule content, including:

[0087] Modify the target rule content according to the preset rule content by manual modification;

[0088] Or in response to a one-key modification instruction input by the user, the target rule content is modified according to the preset rule content.

[0089] Some embodiments of the present application develop an automated repair function that allows the tool to automatically or semi-automatically repair problematic rules based on diagnostic results, thereby reducing system failures caused by improper rule configuration by automatically detecting and repairing udev rule problems.

[0090] Optionally, the method further comprises:

[0091] Check the grammatical rules and rule integrity of the target rule content.

[0092] Some embodiments of the present application will detect whether its syntax is correct and whether the rules are complete; then the system will compare it with the rule base to determine information such as device matching accuracy and rule logic accuracy; then it will check symbolic links and device node conflict detection, as well as rule dependencies, to improve the accuracy and comprehensiveness of detection.

[0093] Optionally, the method further comprises:

[0094] Displays target rule content, preset rule content, and anomaly detection results.

[0095] Some embodiments of the present application enable non-technical users to easily manage and modify udev rules by displaying target rule content, preset rule content and anomaly detection results on a user graphical interface.

[0096] Optionally, the pre-stored rule base includes a rule basic information table, the rule basic information table includes a rule name, preset rule content, rule description information, function classification information and device type, and the preset rule content, rule description information, function classification information and device type correspond to the rule name respectively;

[0097] The pre-stored rule base also includes a function classification information sub-table and a device type information sub-table. The function classification information sub-table is determined according to the function classification information in the rule basic information table, and the device type information sub-table is determined according to the device type in the rule basic information table.

[0098] Some embodiments of the present application set up a comprehensive and standardized rule base, including verified udev rules, for comparison with device rule files acquired in real time, and can identify and classify diagnostic logic of potential problems of udev rules, including syntax errors, logic conflicts, etc.

[0099] The embodiment of the present application provides a method for solving device usage abnormalities caused by udev rules, which mainly includes the following four modules:

[0100] (1) Device information collection and rule analysis module;

[0101] (2) Rule base construction module;

[0102] (3) Automatic diagnosis module;

[0103] (4) Automatic repair module.

[0104] Specifically, the device information collection and rule parsing module (1) mainly includes the following steps: the system obtains detailed information of the device by calling commands (lspci, etc.), including device type, vendor ID, product ID, etc. Then, all udev rule files of the current device are sequentially traversed, the content of each file is parsed, and the detected rules are recorded so as to find out the cause of abnormal use of the current device in combination with the rule base and the automatic diagnosis module.

[0105] The rule base construction module (2) is mainly implemented through the database. The specific steps are as follows: collect and organize the default rules in the Linux distribution, and record the function and application scenario of each rule, classify them according to function, and then classify them according to device type in each function class. Build a database based on the classification as the udev rule base. The specific classification is as follows: Figure 2 shown.

[0106] The specific steps of database design in the rule base construction module (2) are as follows: Use a relational database and use three tables to record the required information:

[0107] The basic information table of the storage rules includes id (primary key), i.e., serial number, name (rule name), description (rule description), category (function classification), device_type (device type), and rule_content (rule content);

[0108] The table storing function classification information includes id (primary key) and name (classification name);

[0109] The storage device type information table includes id (primary key), name (device type name), category_id (foreign key, associated with categories table);

[0110] Among them, the function classification information table and the device type information table are the next level sub-tables of the rule basic information table, and the next level sub-tables of the function classification information table and the device type information table may also be set.

[0111] The automatic diagnosis module (3) is mainly used to perform rule diagnosis on the rules detected by the device information collection and rule analysis module (1).

[0112] Diagnostic rule algorithm workflow diagram Figure 3 As shown, the specific steps are:

[0113] When parsing rules in the device information collection and rule parsing module (1), the system will traverse the rules one by one. For a single rule, the system will first check whether its syntax is correct and whether the rule is complete;

[0114] The system will then compare it with the rule base to determine the accuracy of device matching, whether the rule logic is accurate, and other information;

[0115] Then it checks symbolic link and device node conflict detection, as well as rule dependencies;

[0116] In addition, if environment variables and external programs are included, the validity of the above will also be checked.

[0117] When the detection is completed, the correct rules and the wrong rules are stored and displayed on the user interface, so that the user can view the current device udev rules and perform corresponding operations as needed.

[0118] The automatic repair module (4) is mainly based on the rule diagnosis results displayed on the interface. Users can choose to repair with one click or manually configure the rule file. If one-click repair is selected, the system will directly modify the incorrect rule file according to the rules corresponding to the rule library; if the rule file is manually configured, the user needs to edit the rule file himself, but in order to avoid users being unfamiliar with relevant knowledge, examples and options will be provided for user reference.

[0119] The embodiments of the present application can provide an efficient and accurate parsing mechanism for analyzing the structure and content of udev rule files, providing a comprehensive and standardized rule base containing verified udev rules for comparison with user rules, and capable of identifying and classifying diagnostic logic for potential problems of udev rules, including syntax errors, logical conflicts, etc. The intuitive and easy-to-use graphical user interface allows users to easily perform rule detection and problem solving, and provides feasible repair suggestions or automatic repair scripts based on the diagnostic results.

[0120] The embodiment of the present application can be applied to a Linux system that uses udev rules to configure and manage devices. The specific application process is as follows:

[0121] 1) Preparation: Ensure that the Linux system has the dependent libraries and environment required to run the tool.

[0122] 2) Deploy udev rule automatic detection and repair tool.

[0123] 3) Initial configuration: Run the tool's configuration program to set options such as rule base path, user permissions, and logging.

[0124] 4) Permission setting: Make sure the tool has permission to read the system udev rule file and device information.

[0125] 5) Run the tool: Execute the main program of the tool, and the system starts to automatically detect the udev rules of the devices connected to the computer.

[0126] 6) Check the diagnostic report generated by the tool to understand the status of current udev rules and potential problems.

[0127] 7) Rule Repair: Apply recommended rule changes manually or automatically based on the repair suggestions provided by the tool.

[0128] The embodiments of the present application enhance the user experience: the user-friendly graphical interface enables non-technical users to easily manage and modify udev rules, reducing human errors: automated detection and suggested repairs reduce the errors that users may make when manually editing rules; improving system stability: by automatically detecting and repairing udev rule problems, reducing system failures caused by improper rule configuration; simplifying troubleshooting: when devices such as the mouse and keyboard do not work properly, the tool can quickly locate the problem and provide a solution; improving work efficiency: system administrators can use the tool to quickly diagnose and solve udev rule problems, thereby improving work efficiency.

[0129] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.

[0130] Another embodiment of the present application provides a device anomaly detection apparatus, which is used to execute the device anomaly detection method provided in the above embodiment.

[0131] like Figure 4 , which is a schematic diagram of the structure of the device abnormality detection device provided in the embodiment of the present application. The device abnormality detection device includes an acquisition module 401, a determination module 402 and a detection module 403, wherein:

[0132] The acquisition module 401 is used to acquire target detection data of the device to be detected, wherein the target detection data at least includes a target rule name of the device to be detected and a target rule content corresponding to the target rule name;

[0133] The determination module 402 is used to determine the preset rule content corresponding to the target rule name according to the pre-stored rule base; the pre-stored rule base includes the rule name and the preset rule content corresponding to the rule name;

[0134] The detection module 403 is used to determine the abnormal detection result of the device to be detected according to the target rule content and the preset rule content, and the abnormal detection result is used to determine the abnormal cause of the device to be detected.

[0135] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0136] Some embodiments of the present application obtain the target rule content of the device in real time, and determine the preset rule content corresponding to the target rule name according to the target rule name corresponding to the target rule content and according to a pre-stored rule library, and then compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, to improve the accuracy of abnormality detection.

[0137] Another embodiment of the present application further supplements the device abnormality detection device provided in the above embodiment.

[0138] Optionally, the detection module is used to:

[0139] If the target rule content matches the preset rule content, it is determined that the abnormal detection reason of the device to be detected does not come from the udev rule;

[0140] If the target rule content does not match the preset rule content, it is determined that the abnormal detection cause of the device to be detected comes from the udev rule.

[0141] Some embodiments of the present application compare the target rule content with the preset rule content, and determine the cause of the device abnormality based on the comparison result, whether it is caused by the udev rule file, thereby improving the accuracy of abnormality detection.

[0142] Optionally, the detection module is used to:

[0143] In the case that the target rule content does not match the preset rule content, the target rule content is modified according to the preset rule content.

[0144] In some embodiments of the present application, when it is determined that the target rule content and the preset rule content do not match, the target rule content of the device is updated and modified according to the preset rule content, and the problematic rule is automatically or semi-automatically repaired according to the diagnosis result.

[0145] Optionally, the detection module is used to:

[0146] Modify the target rule content according to the preset rule content by manual modification;

[0147] Or in response to a one-key modification instruction input by the user, the target rule content is modified according to the preset rule content.

[0148] Some embodiments of the present application develop an automated repair function that allows the tool to automatically or semi-automatically repair problematic rules based on diagnostic results, thereby reducing system failures caused by improper rule configuration by automatically detecting and repairing udev rule problems.

[0149] Optionally, the detection module is used to:

[0150] Check the grammatical rules and rule integrity of the target rule content.

[0151] Some embodiments of the present application will detect whether its syntax is correct and whether the rules are complete; then the system will compare it with the rule base to determine information such as device matching accuracy and rule logic accuracy; then it will check symbolic links and device node conflict detection, as well as rule dependencies, to improve the accuracy and comprehensiveness of detection.

[0152] Optionally, the detection module is used to:

[0153] Displays target rule content, preset rule content, and anomaly detection results.

[0154] Some embodiments of the present application enable non-technical users to easily manage and modify udev rules by displaying target rule content, preset rule content and anomaly detection results on a user graphical interface.

[0155] Optionally, the pre-stored rule base includes a rule basic information table, the rule basic information table includes a rule name, preset rule content, rule description information, function classification information and device type, and the preset rule content, rule description information, function classification information and device type correspond to the rule name respectively;

[0156] The pre-stored rule base also includes a function classification information sub-table and a device type information sub-table. The function classification information sub-table is determined according to the function classification information in the rule basic information table, and the device type information sub-table is determined according to the device type in the rule basic information table.

[0157] Some embodiments of the present application set up a comprehensive and standardized rule base, including verified udev rules, for comparison with device rule files acquired in real time, and can identify and classify diagnostic logic of potential problems of udev rules, including syntax errors, logic conflicts, etc.

[0158] Regarding the device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0159] It should be noted that each implementable method in this embodiment may be implemented separately, or may be implemented in combination in any combination without conflict, and this application is not limited thereto.

[0160] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the operation of the method corresponding to any embodiment of the device abnormality detection method provided in the above embodiments can be implemented.

[0161] An embodiment of the present application further provides a computer program product, wherein the computer program product includes a computer program, wherein when the computer program is executed by a processor, the operation of the method corresponding to any embodiment of the device abnormality detection method provided in the above embodiment can be implemented.

[0162] like Figure 5 As shown, some embodiments of the present application provide an electronic device 500, which includes: a memory 510, a processor 520, and a computer program stored in the memory 510 and executable on the processor 520, wherein the processor 520 can implement a method of any embodiment of the device abnormality detection method as included in the above-mentioned device abnormality detection method when reading the program from the memory 510 through a bus 530 and executing the program.

[0163] Processor 520 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 520 can be a microprocessor.

[0164] The memory 510 may be used to store instructions executed by the processor 520 or data related to the execution of instructions. These instructions and / or data may include codes for implementing some or all functions of one or more modules described in the embodiments of the present application. The processor 520 of the disclosed embodiment may be used to execute instructions in the memory 510 to implement the method shown above. The memory 510 includes a dynamic random access memory, a static random access memory, a flash memory, an optical memory, or other memory known to those skilled in the art.

[0165] The above are only embodiments of the present application and are not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.

[0166] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0167] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A device anomaly detection method, characterized in that: The method comprises: Acquire target detection data of the device to be detected, wherein the target detection data at least includes a target rule name of the device to be detected and a target rule content corresponding to the target rule name; Determine, according to a pre-stored rule base, a preset rule content corresponding to the target rule name; the pre-stored rule base includes a rule name and a preset rule content corresponding to the rule name; According to the target rule content and the preset rule content, an abnormality detection result of the device to be detected is determined, and the abnormality detection result is used to determine the abnormality cause of the device to be detected.

2. The device abnormality detection method according to claim 1, characterized in that: The determining, according to the target rule content and the preset rule content, the abnormality detection result of the device to be detected includes: If the target rule content matches the preset rule content, it is determined that the abnormal detection reason of the device to be detected does not come from the udev rule; If the target rule content does not match the preset rule content, it is determined that the abnormal detection reason of the device to be detected comes from the udev rule.

3. The device abnormality detection method according to claim 2, characterized in that: The method further comprises: In the case that the target rule content does not match the preset rule content, the target rule content is modified according to the preset rule content.

4. The device abnormality detection method according to claim 3, characterized in that: The modifying the target rule content according to the preset rule content includes: Modify the target rule content according to the preset rule content by manual modification; Or in response to a one-key modification instruction input by a user, the target rule content is modified according to the preset rule content.

5. The device anomaly detection method according to claim 1, characterized in that: The method further comprises: The grammatical rules and rule integrity of the target rule content are checked.

6. The device anomaly detection method according to claim 2, characterized in that: The method further comprises: The target rule content, the preset rule content and the anomaly detection result are displayed.

7. The device abnormality detection method according to claim 5, characterized in that: The pre-stored rule base includes a rule basic information table, the rule basic information table includes a rule name, preset rule content, rule description information, function classification information and device type, the preset rule content, the rule description information, the function classification information and the device type respectively correspond to the rule name; The pre-stored rule base also includes a function classification information sub-table and a device type information sub-table. The function classification information sub-table is determined according to the function classification information in the rule basic information table, and the device type information sub-table is determined according to the device type in the rule basic information table.

8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the device abnormality detection method described in any one of claims 1 to 7 when executing the program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the program is executed by a processor, the device anomaly detection method described in any one of claims 1 to 7 can be implemented.

10. A computer program product, comprising a computer program, wherein: When the computer program is executed by a processor, the device abnormality detection method described in any one of claims 1 to 7 can be implemented.