Device identification processing method and apparatus, storage medium, and computer device

By managing the system service program through rule files, the problem of abnormal device recognition caused by the modification of interface configuration by the operating system configuration program was resolved, ensuring that the computer equipment correctly recognizes the image forming device.

CN116027993BActive Publication Date: 2026-05-08ZHUHAI PANTUM ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHUHAI PANTUM ELECTRONICS CO LTD
Filing Date
2022-12-28
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

In the prior art, because the configuration program pre-installed on the operating system modifies the interface configuration of the image forming apparatus to the IPP-over-USB protocol, the computer device cannot recognize the image forming apparatus.

Method used

By creating and managing rule files, the behavior of system service programs can be controlled to skip or execute specific configuration procedures, ensuring that interface configurations are not modified incorrectly.

Benefits of technology

This effectively prevents device recognition anomalies caused by changes in interface configurations during configuration, ensuring that computer equipment can correctly identify the image forming device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116027993B_ABST
    Figure CN116027993B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a device identification processing method and device, a storage medium and a computer device. The method is used to prevent device identification abnormalities caused by a first configuration program modifying interface configurations. The first configuration program is used to modify the interface configurations of a device to interface configurations corresponding to a preset protocol when the device accesses the preset protocol. The first configuration program can be started by a first rule file when the device accesses and exited when the device is removed. The method comprises: in response to a first instruction, creating a second rule file, the second rule file can be read by a system service program instead of the first rule file; after the system service program reads the second rule file, the system service program can skip the execution of the first configuration program when a device with preset characteristic information accesses, so that the interface configurations are not modified by the first configuration program. Thus, the accessed device is normally identified as a USB device by the printing system.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The embodiments of the present invention relate to the field of device identification technology, specifically to a device identification processing method, apparatus, storage medium, and computer device. [Background Technology]

[0002] The Internet Printing Protocol (IPP) is a standard network protocol for printing over the Internet. It allows users to perform remote printing and manage print jobs via the Internet. Users can control various parameters such as paper type and resolution through a user interface.

[0003] The IPP-over-USB protocol enables Universal Serial Bus (USB) devices to be treated as network devices, thereby extending the range of devices that can use Internet printing protocols to include image forming apparatuses with USB connectivity.

[0004] Bidirectional protocols are used to search for and use USB printers. Currently, some image forming apparatuses use the bidirectional protocol as the default interface setting and the IPP-over-USB protocol as an alternative, with both protocols reusing the same interface. However, some operating systems come pre-installed with configuration programs that, upon recognizing the interface corresponding to the IPP-over-USB protocol, activate the alternative setting protocol, modifying the device's interface configuration to match the default setting, rendering the default protocol unusable and causing the computer to fail to recognize the image forming apparatus. [Summary of the Invention]

[0005] In view of this, embodiments of the present invention provide a device identification processing method, apparatus, storage medium, and computer device to solve the problem in the prior art that computer devices cannot identify image forming apparatuses.

[0006] In a first aspect, embodiments of the present invention provide a device identification processing method to prevent device identification anomalies caused by a first configuration program modifying interface configuration; the first configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to an interface configuration corresponding to the preset protocol when the device is accessed; the first configuration program can be invoked by a first rule file when the device is accessed and exit when the device is removed; the method includes:

[0007] In response to the first instruction, a second rule file is created, which can be read by the system service program in place of the first rule file;

[0008] After reading the second rule file, the system service program can skip the execution of the first identification program when a device that meets the preset feature information is connected, so that the interface configuration is not modified by the first identification program.

[0009] One possible implementation also includes:

[0010] In response to the second instruction, the second rule file is deleted, causing the system service program to execute in the manner it would have done if the second rule file had not been created.

[0011] In one possible implementation, the first instruction is used to create the second rule file in a file directory with a higher reading priority than the first rule file, so that the second rule file can be read in place of the first rule file.

[0012] In one possible implementation, after the system service program reads the second rule file, it can execute the first configuration program normally when a device that does not conform to the preset characteristic information is accessed.

[0013] In one possible implementation, the preset feature information includes at least one of the following: manufacturer identification number (ID), device ID, and serial number.

[0014] Secondly, embodiments of the present invention provide a device identification processing method to prevent device identification anomalies caused by a second configuration program modifying interface configuration. The second configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to an interface configuration corresponding to the preset protocol when the device is accessed. The second configuration program can be invoked by a third rule file when the first device that meets the matching conditions of the third rule file is accessed, and exit when all devices are removed. The method includes:

[0015] In response to the third instruction, a fourth rule file is created, which can be read by the system service program in place of the third rule file;

[0016] After reading the fourth rule file, the system service program can execute an alternative configuration program instead of the second configuration program when a device that does not meet the preset characteristics is connected; and can skip the execution of the second configuration program and the alternative configuration program when a device that meets the preset characteristic information is connected; when the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information and only performs interface configuration on devices that do not meet the preset characteristic information.

[0017] One possible implementation also includes:

[0018] In response to the fourth instruction, the fourth rule file is deleted, causing the system service program to execute in the manner it would have done if the fourth rule file had not been created.

[0019] In one possible implementation, the third instruction is used to create the fourth rule file in a file directory with a higher reading priority than the third rule file, so that the fourth rule file can be read in place of the third rule file.

[0020] Thirdly, embodiments of the present invention provide a device identification processing apparatus for preventing device identification anomalies caused by a first configuration program modifying interface configuration. The first configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to an interface configuration corresponding to the preset protocol when the device is accessed. The first configuration program can be invoked by a first rule file when the device is accessed and exit when the device is removed. The apparatus includes:

[0021] The first creation module is used to create a second rule file in response to the first instruction. The second rule file can be read by the system service program in place of the first rule file.

[0022] After reading the second rule file, the system service program can skip the execution of the first configuration program when a device that meets the preset feature information is connected, so that the interface configuration is not modified by the first configuration program.

[0023] Fourthly, embodiments of the present invention provide a device identification processing apparatus for preventing device identification anomalies caused by a second configuration program modifying interface configuration. The second configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to an interface configuration corresponding to the preset protocol when the device is accessed. The second configuration program can be invoked by a third rule file when the first device that meets the matching conditions of the third rule file is accessed, and exit when all devices are removed. The apparatus includes:

[0024] The second creation module is used to create a fourth rule file in response to a third instruction, the fourth rule file being able to be read in place of the third rule file;

[0025] After reading the fourth rule file, the system service program can execute an alternative configuration program instead of the second configuration program when a device that does not meet the preset characteristics is connected; and can skip the execution of the second configuration program and the alternative configuration program when a device that meets the preset characteristic information is connected; when the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information and only performs interface configuration on devices that do not meet the preset characteristic information.

[0026] Fifthly, embodiments of the present invention provide a storage medium comprising a stored program, wherein, when the program is executed, the device on which the storage medium is located executes the device identification processing method in the first aspect or any possible implementation thereof, or executes the device identification processing method in the second aspect or any possible implementation thereof.

[0027] Fourthly, embodiments of the present invention provide a computer device, including a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, they implement the steps of the device identification processing method in the first aspect or any possible implementation of the first aspect, or execute the device identification processing method in the second aspect or any possible implementation of the second aspect.

[0028] This invention provides two device identification processing methods to prevent device identification anomalies. The first method involves creating a first identification program with a separate process for each device, preventing the first identification program from being invoked when a device with preset characteristic information connects. The second method involves a second identification program that shares a single process across all devices, preventing the second identification program from configuring interfaces for devices with preset characteristic information. These embodiments of the invention can reduce the occurrence of device identification anomalies. [Attached Image Description]

[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of a descriptor in the prior art;

[0031] Figure 2 A schematic diagram illustrating an interface setup in the prior art;

[0032] Figure 3 This is a schematic diagram of code for executing an identification file in the prior art;

[0033] Figure 4 A flowchart of a device identification processing method provided in an embodiment of the present invention;

[0034] Figure 5 A flowchart for running an identification file is provided as an embodiment of the present invention;

[0035] Figure 6A flowchart of another device identification processing method provided in an embodiment of the present invention;

[0036] Figure 7 A flowchart illustrating another method for identifying access devices provided in an embodiment of the present invention;

[0037] Figure 8 This is a schematic diagram of the structure of a device identification processing device provided in an embodiment of the present invention;

[0038] Figure 9 This is a schematic diagram of another device identification processing device provided in an embodiment of the present invention;

[0039] Figure 10 This is a schematic diagram of a computer device provided in an embodiment of the present invention.

Detailed Implementation Methods

[0040] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0041] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0042] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0043] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0044] It should be understood that although terms such as first, second, third, etc., may be used to describe numbers in embodiments of the present invention, these numbers should not be limited to these terms. These terms are only used to distinguish numbers from each other. For example, without departing from the scope of embodiments of the present invention, a first number may also be referred to as a second number, and similarly, a second number may also be referred to as a first number.

[0045] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0046] Figure 1 This is a schematic diagram of a descriptor in the prior art, such as... Figure 1 As shown, Figure 1 The diagram shows one device descriptor, two configuration descriptors, four interface descriptors, and eight endpoint descriptors. Figure 1 The bNumConfigurations shown in the figure represent the number of configurations supported by the device, the bNumInterfaces represent the number of interfaces supported by the device, and the bNumEndpoints represent the number of endpoints supported by the interfaces.

[0047] Each image forming apparatus corresponds to a device descriptor, and a device descriptor may include at least one configuration descriptor. Figure 1 The diagram shows that the device descriptor includes two configuration descriptors, but the image forming apparatus can only activate one configuration at a time; that is, only one configuration descriptor corresponds to an activated state. One configuration can correspond to multiple interfaces, and each interface has an interface descriptor. The image forming apparatus can activate multiple interfaces simultaneously. An interface descriptor can be viewed as a grouping of endpoints for a single function of the device. For example, if the image forming apparatus has functions such as faxing, scanning, and printing, interface descriptor 1 describes the endpoint for the faxing function, interface descriptor 2 describes the endpoint for the scanning function, and interface descriptor 3 describes the endpoint for the printing function.

[0048] Each interface can have multiple AlternateSettings, which can include AlternateSetting protocols. When a configuration is enabled, the default value of the AlternateSetting for the corresponding interface is 0. A computer device can send a configuration interface request to enable the interface's AlternateSetting, but only one setting can be enabled for each interface at a time.

[0049] Figure 2 A schematic diagram of an interface setup in the prior art, such as Figure 2 As shown, Figure 2The diagram shows one configuration descriptor containing two interface descriptors: Interface ZeroDescriptor and Interface One Descriptor. The Interface One Descriptor has several alternative settings, including Interrupt Pipes and Bulk Pipes. When the alternative setting for the Interface Zero Descriptor is set to 0, it indicates that the alternative setting is enabled. When the Interface One Descriptor's alternative is set to Interrupt Pipes, the setting value is 0, indicating that the alternative setting is enabled. When the Interface One Descriptor's alternative is set to Bulk Pipes, the setting value is 1, indicating that the alternative setting is disabled.

[0050] Currently, when a computer device connects to an image printing device via a Universal Serial Bus (USB), the computer device needs to run an identification file. When running the identification file, the computer device needs to invoke the IPP-over-USB protocol. Since the system has the Ippusbxd or IPP-USB program pre-installed, when the computer device runs the Ippusbxd or IPP-USB program, it switches the alternative setting protocol of the image forming device's interface to the IPP-over-USB protocol. After declaring this interface, it sends a Hypertext Transfer Protocol (HTTP) request to the image forming device via the USB, and the image forming device performs the relevant functions based on the HTTP request.

[0051] When searching for an image forming apparatus via a Universal Serial Bus, it is necessary to invoke the Bidirectional protocol to switch the interface's configuration protocol to the Bidirectional protocol. However, in some image forming apparatuses, the Bidirectional protocol and the IPP-over-USB protocol reuse the same interface. In this case, the Bidirectional protocol is the default configuration protocol for the interface, while the IPP-over-USB protocol is the alternative configuration protocol for the interface.

[0052] Figure 3 This is a schematic diagram of code for executing an identification file in the prior art, such as... Figure 3 As shown, Figure 3The diagram shows the names of three interfaces: 0, 1, and 2. Interface 0 corresponds to two settings: Alt0 and Alt1. Alt0 is "Class 7, Subclass 1, Protocol 2," and Alt1 is "Class 7, Subclass 1, Protocol 4." Alt0 and Alt1 can be used to represent the settings corresponding to the Bidirectional protocol and the IPP-over-USB protocol, respectively. The Bidirectional protocol is the default setting protocol for this interface, while the IPP-over-USB protocol is the alternative setting protocol. When a computer device executes the Ippusbxd or IPP-USB program, it will replace the setting protocol of this interface from the Bidirectional protocol to the IPP-over-USB protocol. Since the Bidirectional protocol cannot be enabled, the computer device cannot detect the image forming apparatus, resulting in the computer device being unable to recognize the image forming apparatus.

[0053] To enable computer devices to recognize image forming apparatus, this invention provides a device recognition processing method to prevent device recognition anomalies caused by a first configuration program modifying interface configuration. The first configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to an interface configuration corresponding to the preset protocol when the device is accessed. The first configuration program can be invoked by a first rule file when the device is accessed and exit when the device is removed. The accessed device includes an image forming apparatus. Figure 4 A flowchart of a device identification processing method provided in an embodiment of the present invention is shown below. Figure 4 As shown, the method includes:

[0054] Step 101: The computer device responds to the first instruction and creates a second rule file, which can be read by the system service program in place of the first rule file.

[0055] In this embodiment of the invention, the computer device includes, but is not limited to, mobile phones, tablets, portable PCs, desktop computers, wearable devices, etc. The operating system of the computer device can be Ubuntu.

[0056] In one possible implementation, the first instruction is used to create a second rule file in a file directory with a higher execution priority than the first rule file, so that the second rule file can be read in place of the first rule file.

[0057] In this embodiment of the invention, the computer device responds to a first instruction and creates a second rule file in a file directory with a higher priority than the first rule file, based on the first rule file, the obtained filtering rules, and the first running tag.

[0058] The first instruction can be a command line entered by the user into the computer device; or, the computer device can display an update instruction; the first instruction is generated in response to the user's confirmation of the update based on the update instruction. This embodiment of the invention does not limit the origin of the first instruction. Filtering rules are used to filter devices that meet preset characteristic information. The first filter tag is "LABEL=ippusbxd_end", indicating that the execution of the Ippusbxd program is skipped. The Ippusbxd program is the first configuration program in this embodiment. The content of the second rule file includes the rules of the first configuration program, filtering rules, and the first filter tag. The first rule file contains the invocation instruction of the Ippusbxd program, and the directory where the first rule file is located is the first file directory; for example, the name of the first rule file is 55-ippusbxd.rules. The second rule file includes filtering rules, the first filter tag, and the rules of the first configuration program. The directory where the second rule file is located is the second file directory, and the reading priority of the second file directory is higher than that of the first file directory; for example, the name of the second rule file is 55-ippusbxd.rules, and the second file directory is / etc / udev / rules.d. The computer device creates a second rule file with the same name as the first rule file in the / etc / udev / rules.d directory. Because the directory containing the second rule file has a higher read priority than the directory containing the first rule file, the computer device executes the second rule file instead of the first rule file, allowing the second rule file to be read in place of the first rule file.

[0059] In another possible implementation, the first instruction is used to create a second rule file in the file directory where the first rule file is executed and to define the first rule file as an irrelevant file, so that the second rule file can be executed in place of the first rule file.

[0060] In this embodiment of the invention, for example, the directory where the first rule file is located is a first directory. The computer device in the first directory modifies the name of the first rule file from the first rule name to an irrelevant name; then, a second rule file is created, and the name of the second rule file is set to the first rule name, so that the computer device executes the second rule file instead of the first rule file. Alternatively, the first rule file can be defined as an irrelevant file in other ways, such as deleting the first rule file or modifying its contents, so that the first configuration program is not executed.

[0061] Step 102: After reading the second rule file, the system service program enables devices that meet the preset characteristic information to access the system, skipping the execution of the first configuration program to prevent the interface configuration from being modified by the first configuration program. The system service program can be the udev program in a Linux system.

[0062] In this embodiment of the invention, step 102 further includes: after the second rule file is read, when the computer device enables a device that does not conform to the preset feature information to access the network, the first identification program is executed normally. The preset feature information includes at least one of the following: manufacturer identification number (ID), device ID, and serial number.

[0063] Manufacturer ID refers to the Supplier ID (VID), and Device ID refers to the Product ID (PID). Serial number refers to the unique identification number of the device.

[0064] When the system service program reads the second rule file, it executes the filtering rules to determine whether the accessed device is a device that meets the preset characteristic information. If it determines that the accessed device is a device that meets the preset characteristic information, it jumps to the first filter tag to skip the execution of the first configuration program. If it determines that the accessed device is not a device that meets the preset characteristic information, it executes the first configuration program.

[0065] The filtering rules include at least one preset feature information, which is the identification feature information of a preset device. A preset device refers to a device that uses the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. A non-preset device is a device that does not use the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. Preset devices include image forming apparatuses that use the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. The computer device acquires the identification feature information of the accessed device; it determines whether at least one preset feature information includes the same preset feature information as the identification feature information; if so, the device is determined to be a device that conforms to the preset feature information and is a preset device; if not, the device is determined not to be a device that conforms to the preset feature information and is a non-preset device.

[0066] Figure 5 A flowchart for running an identification file is provided as an embodiment of the present invention, such as Figure 5 As shown, Figure 5Each step in the process is executed by the computer device. udev refers to the system service program of the computer device, and its default characteristic information is VID. The computer device detects the inserted device via USB; udev checks the ippusbxd rule file, that is, the system service program finds the second rule file named 55-ippusbxd.rules in the / etc / udev / rules.d directory and reads the second rule file; the system service program determines whether the VID of the connected device is the default VID; if so, it skips the rule configuration, that is, it does not call the Ippusbxd program and executes the first filter label to skip the call instruction of the first configuration program; if not, it passes the device parameters and calls the Ippusbxd program.

[0067] Therefore, when a device is connected to a computer via USB, the computer calls the Ippusbxd program to start a corresponding process for each connected image forming device. In each process, if a device that does not meet the preset characteristic information is detected, the computer can execute the Ippusbxd program normally. If a device that meets the preset characteristic information is detected, the USB corresponding to that device will not be configured. This avoids the situation where a device that meets the preset characteristic information cannot be recognized because the Bidirectional protocol and the IPP-over-USB protocol share a port. This ensures that the protocol corresponding to the interface will not be replaced by the IPP-over-USB protocol, allowing the computer to recognize the connected device.

[0068] According to the device identification processing method provided by the embodiments of the present invention, for devices that do not conform to the preset feature information, the computer device can normally execute the first configuration program; for devices that conform to the preset feature information, the computer device will skip the execution of the first configuration program, so that the protocol corresponding to the interface will not be replaced by the default setting protocol to the alternative setting protocol, so that the interface will not be modified by the first configuration program, and the computer device can identify the accessed device.

[0069] In this embodiment of the invention, in Figure 1 Following step 102, the process further includes step 103: the computer device responds to the second instruction by deleting the second rule file, causing the system service program to execute in the manner it would have done if the second rule file had not been created.

[0070] In this embodiment of the invention, the second instruction may be an instruction input by the user into the computer device. This embodiment of the invention does not limit the origin of the second instruction.

[0071] Installing a second rule file on a computer device does not modify existing files in the computer's operating system; similarly, deleting a second rule file on a computer device does not modify existing files in the operating system. For example, if a computer device deletes a second rule file in the ` / etc / udev / rules.d` directory, the computer device will continue to function normally afterward.

[0072] This invention provides a flowchart of a device identification processing method to prevent device identification anomalies caused by a second configuration program modifying the interface configuration. The second configuration program is used to modify the interface configuration of a device that conforms to a preset protocol to the interface configuration corresponding to the preset protocol when the device is accessed. The second configuration program can be invoked by the third rule file when the first device that meets the matching conditions of the third rule file is accessed, and exit when all devices are removed. Figure 6 A flowchart of another device identification processing method provided in an embodiment of the present invention is shown below. Figure 6 As shown, the method includes:

[0073] Step 201: In response to the third instruction, the computer device creates a fourth rule file, which can be read by the system service program in place of the third rule file.

[0074] In this embodiment of the invention, the computer device includes, but is not limited to, mobile phones, tablets, portable PCs, desktop computers, wearable devices, etc. The operating system of the computer device can be Ubuntu.

[0075] In one possible implementation, the third instruction is used to create a fourth rule file in a file directory with a higher read priority than the third rule file, so that the fourth rule file can be read in place of the third rule file.

[0076] In this embodiment of the invention, the computer device responds to a third instruction and creates a fourth rule file in a file directory with a higher reading priority than the third rule file, based on the third rule file, the obtained filtering rules, and the second filtering tag.

[0077] The third instruction can be a command line entered by the user into the computer device; or, after the computer device displays an update instruction, it generates the third instruction in response to the user's confirmation of the update based on the update instruction. This embodiment of the invention does not limit the origin of the third instruction. The third rule file contains the calling instructions for the IPP-USB program. The directory where the third rule file is located is the third file directory, and the directory where the fourth rule file is located is the fourth file directory. For example, the name of the third rule file is 71-ipp-usb.rules, the name of the fourth rule file is 71-ipp-usb.rules, the third file directory and the aforementioned first file directory can be the same directory, and the fourth file directory and the aforementioned second file directory can be the same directory. The fourth file directory is / etc / udev / rules.d. Because the reading priority of the fourth file directory is higher than that of the third file directory, the computer device will read the fourth rule file instead of the third rule file, allowing the fourth rule file to be read instead of the third rule file.

[0078] When a computer device creates a fourth rule file, it also creates an alternative configuration program. For example, the fourth rule file and the alternative configuration program can be set in the installation package, and when the user runs the installation package, the fourth rule file and the alternative configuration program are copied to the user's computer device.

[0079] The IPP-USB program is named ipp-usb.service. The computer device generates an alternative configuration program by placing the filtering rules before the third rule file, and the alternative configuration program is named pt-ipp-usb.service. The computer device then places the filtering rules before the calling code of the alternative configuration program and the second filter tag after the alternative configuration program, generating a fourth rule file. The fourth rule file includes the rules of the alternative configuration program, the second filter tag, and the filtering rules.

[0080] The filtering rules are used to filter devices that match preset characteristics. The second filter label is "LABEL=ipp-usb_end", which indicates that the IPP-USB program should be skipped.

[0081] In another possible implementation, the third instruction is used to create a fourth rule file in the file directory where the third rule file is executed and to define the third rule file as an irrelevant file so that the fourth rule file can be read in place of the third rule file.

[0082] In this embodiment of the invention, the directory where the third rule file is located is the first directory. The computer device in the first directory modifies the name of the third rule file from the third rule name to an irrelevant name; a fourth rule file is created, and the name of the fourth rule file is set to the third rule name, causing the computer device to execute the fourth rule file instead of the third rule file. Alternatively, the third rule file can be defined as an irrelevant file in other ways, such as deleting the third rule file or modifying its content, so that the second configuration program does not execute.

[0083] Step 202: After the fourth rule file is executed, when a device that does not meet the preset characteristics is connected, the computer device executes the alternative configuration program instead of the second configuration program; and when a device that meets the preset characteristic information is connected, the execution of the second configuration program and the alternative configuration program is skipped; when the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information, and only performs interface configuration on devices that do not meet the preset characteristic information.

[0084] In this embodiment of the invention, the preset feature information includes at least one of the following: manufacturer identification number (ID), device ID, and serial number.

[0085] When the system service program reads the fourth rule file, it first executes the filtering rules to determine whether the connected device matches the preset characteristic information. If it does, the alternative configuration program is not executed; otherwise, it is executed. Since the alternative configuration program runs continuously in the background and monitors connected devices until the last connected device is unplugged, it checks each connected device for the preset characteristic information when being read. If a device does not match the preset characteristic information, it performs interface configuration for that device; if a device matches the preset characteristic information, it skips the interface configuration step.

[0086] The filtering rules include at least one preset feature information, which is the identification feature information of a preset device. A preset device refers to a device that uses the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. A non-preset device is a device that does not use the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. Preset devices include image forming apparatuses that use the same interface for both the Bidirectional protocol and the IPP-over-USB protocol. The computer device acquires the identification feature information of the accessed device; it determines whether at least one preset feature information includes the same preset feature information as the identification feature information; if so, the device is determined to be a device that conforms to the preset feature information and is a preset device; if not, the device is determined not to be a device that conforms to the preset feature information and is a non-preset device.

[0087] Figure 7 Another flowchart for identifying access devices provided in an embodiment of the present invention, such as... Figure 7 As shown, Figure 7 Each step in the process is executed by the computer device. udev refers to the computer device's device manager, which is also the system service program referred to in this embodiment. The default characteristic information is VID. The computer device detects the inserted device via USB; udev checks the IPP-USB rule file, that is, the computer device finds the fourth rule file named 71-ipp-usb.rules in the / etc / udev / rules.d directory and runs the fourth rule file; the computer device determines whether the VID of the connected device is the default VID; if so, it skips the rule configuration; if not, it passes the device parameters and calls the pt-ipp-usb program, that is, it calls the alternative configuration program. Because the alternative configuration program runs in the background and monitors connected devices in real time until the last connected device is unplugged, the computer device will not stop running the alternative configuration program after launching the pt-ipp-usb program. Therefore, after launching the pt-ipp-usb program, the computer device will iterate through the connected devices and check in real time whether the VID of each connected device is the preset VID. If it is, the configuration of that device is skipped; if not, the corresponding USB of the device is configured, meaning the computer device can run the IPP-USB program to realize the IPP-over-USB printer function. The corresponding USB is the USB that connects the connected device to the computer device.

[0088] Therefore, when a device is connected to a computer via USB, the computer can determine whether to invoke the alternative configuration program. If not, it skips the step of configuring the USB corresponding to that device and executes the second filtering tag. If so, it invokes the alternative configuration program to configure the USB corresponding to devices that do not conform to the preset characteristic information in real time, and skips the step of configuring the USB corresponding to devices that conform to the preset characteristic information. For devices that do not conform to the preset characteristic information, the computer can execute the IPP-USB program normally; while for devices that conform to the preset characteristic information, the computer can skip the step of configuring the USB corresponding to that device. This avoids the situation where devices that conform to the preset characteristic information cannot be recognized because the Bidirectional protocol and the IPP-over-USB protocol share a port. This ensures that the protocol corresponding to the interface is not replaced by the IPP-over-USB protocol, allowing the computer to recognize the connected device.

[0089] According to the device identification processing method provided by the embodiments of the present invention, for devices that do not conform to the preset feature information, the computer device can normally execute the alternative configuration program to identify the device; for devices that conform to the preset feature information, the computer device will skip the execution of the alternative configuration program and will not configure the interface of the device, so that the protocol corresponding to the interface will not be replaced by the default setting protocol, so that the interface will not be modified by the alternative configuration program, and the computer device can identify the accessed device.

[0090] In this embodiment of the invention, after step 202, the method further includes: step 203, in response to the fourth instruction, deleting the fourth rule file, so that the system service program executes in the manner that the fourth rule file was not created.

[0091] In one possible implementation, the fourth instruction can be a user-input instruction, and the origin of the fourth instruction is not limited in this embodiment of the invention.

[0092] Installing a fourth rule file on a computer device does not modify existing files in the computer's operating system; similarly, deleting a fourth rule file does not modify existing files in the operating system. For example, if a computer device deletes a fourth rule file in the ` / etc / udev / rules.d` directory, the computer device will continue to function normally afterward.

[0093] Figure 8This is a schematic diagram of a device identification processing apparatus provided in an embodiment of the present invention, used to prevent device identification anomalies caused by a first configuration program modifying the interface configuration. The first configuration program is used to modify the interface configuration of a device conforming to a preset protocol to the interface configuration corresponding to the preset protocol when the device is accessed. The first configuration program can be invoked by a first rule file when the device is accessed and exit when the device is removed. Figure 8 As shown, the device identification processing device 10 includes a first creation module 11. The first creation module 11 is used to create a second rule file in response to a first instruction. The second rule file can be read in place of the first rule file. After the system service program reads the second rule file, it can skip the execution of the first configuration program when a device that meets the preset feature information is connected, so that the interface configuration is not modified by the first configuration program.

[0094] In this embodiment of the invention, the device further includes a first deletion module 13. The first deletion module 13 is used to delete the second rule file in response to the second instruction, so that the system service program executes in the manner that the fourth rule file would not have been created.

[0095] In this embodiment of the invention, the first instruction is used to create a second rule file in a file directory with a higher reading priority than the first rule file, so that the second rule file can be read in place of the first rule file.

[0096] In this embodiment of the invention, the second rule file created by the first creation module 11 satisfies the following condition: after the system service program reads the second rule file, it can normally execute the first configuration program when a device that does not conform to the preset characteristic information is accessed.

[0097] In this embodiment of the invention, the preset feature information includes at least one of the following: manufacturer identification number (ID), device ID, and serial number.

[0098] With the device identification processing device provided in this embodiment of the invention, for devices that do not conform to preset feature information, the computer device can normally execute the first identification program; for devices that conform to preset feature information, the computer device will skip the execution of the first identification program, so that the protocol corresponding to the interface will not be replaced by the default setting protocol to the alternative setting protocol, so that the interface will not be modified by the first configuration program, and so that the computer device can identify the accessed device.

[0099] Figure 9This is a schematic diagram of another device identification processing device provided in an embodiment of the present invention, used to prevent device identification anomalies caused by the modification of interface configuration by the second configuration program. The second configuration program is used to modify the interface configuration of the device to the interface configuration corresponding to the preset protocol when the device that conforms to the preset protocol is accessed. The second configuration program can be invoked by the third rule file when the first device that conforms to the matching conditions of the third rule file is accessed, and exit when all devices are removed. The device identification processing device 20 includes: a second creation module 21.

[0100] The second creation module 21 is used to create a fourth rule file in response to the third instruction. The fourth rule file can be read in place of the third rule file. The second execution module 22 is used to execute an alternative configuration program instead of the second configuration program when a device that does not meet the preset characteristics is connected after the fourth rule file is read. It can also skip the execution of the second configuration program and the alternative configuration program when a device that meets the preset characteristic information is connected. When the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information and performs interface configuration only on devices that do not meet the preset characteristic information.

[0101] In this embodiment of the invention, the device further includes a second deletion module 23. The second deletion module 23 is used to delete the fourth rule file in response to the fourth instruction, so that the system service program executes in the manner that the fourth rule file would not have been created.

[0102] In this embodiment of the invention, the third instruction is used to create a fourth rule file in a file directory with a higher reading priority than the third rule file, so that the fourth rule file can be read in place of the third rule file.

[0103] With the device identification processing device provided in this embodiment of the invention, for devices that meet the preset feature information, the computer device will skip the execution of the alternative identification program and will not configure the interface of the device, so that the protocol corresponding to the interface will not be replaced by the default setting protocol, so that the interface will not be modified by the alternative identification program, and the computer device can identify the accessed device.

[0104] This invention provides a computer device, including a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, they implement the steps of the above-described device identification method. For a detailed description, please refer to the embodiments of the above-described device identification method.

[0105] Figure 10 This is a schematic diagram of a computer device provided in an embodiment of the present invention. Figure 10As shown, the computer device 30 in this embodiment includes a processor 31, a memory 32, and a computer program 33 stored in the memory 32 and executable on the processor 31. When the computer program 33 is executed by the processor 31, it implements the identification method applied to the device in this embodiment. To avoid repetition, it will not be described in detail here. Alternatively, when the computer program is executed by the processor 31, it implements the functions of each model / unit in the identification device applied to the device in this embodiment. To avoid repetition, it will not be described in detail here.

[0106] Computer device 30 includes, but is not limited to, processor 31 and memory 32. Those skilled in the art will understand that... Figure 10 This is merely an example of computer device 30 and does not constitute a limitation on computer device 30. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device 30 may also include input / output devices, network access devices, buses, etc.

[0107] The processor 31 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0108] The memory 32 can be an internal storage unit of the computer device 30, such as a hard disk or RAM of the computer device 30. The memory 32 can also be an external storage device of the computer device 30, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device 30. Furthermore, the memory 32 can include both internal and external storage units of the computer device 30. The memory 32 is used to store computer programs and other programs and data required by the computer device 30. The memory 32 can also be used to temporarily store data that has been output or will be output.

[0109] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

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

[0111] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0112] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0113] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0114] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A device identification processing method, used to prevent device identification anomalies caused by a first configuration program modifying interface configuration, and to prevent the Bidirectional protocol and the IPP-over-USB protocol from reusing the same interface. When a computer device executes the Ippusbxd program or the IPP-USB program, the setting protocol of the interface is replaced from the Bidirectional protocol to the IPP-over-USB protocol, the Bidirectional protocol cannot be enabled, and the computer device cannot identify the image forming apparatus; the first configuration program is used to modify the interface configuration of the device to the interface configuration corresponding to the preset protocol when a device conforming to the preset protocol is connected; the first configuration program can be invoked by a first rule file when the device is connected and exit when the device is removed; characterized in that, The method includes: In response to the first instruction, a second rule file is created, which can be read by the system service program in place of the first rule file; After reading the second rule file, the system service program can skip the execution of the first configuration program when a device that meets the preset feature information is connected, so that the interface configuration is not modified by the first configuration program. The second rule file includes filtering rules, a first filtering label, and rules of the first configuration program. The directory where the second rule file is located is the second file directory, and the directory where the first rule file is located is the first file directory. The reading priority of the second file directory is higher than that of the first file directory. The computer device executes the second rule file and does not execute the first rule file, so that the second rule file is read instead of the first rule file. After reading the second rule file, the system service program can execute the first configuration program normally when a device that does not conform to the preset characteristic information is connected.

2. The device identification processing method according to claim 1, characterized in that, Also includes: In response to the second instruction, the second rule file is deleted, causing the system service program to execute in the manner it would have done if the second rule file had not been created.

3. The device identification processing method according to claim 1, characterized in that, The preset feature information includes at least one of the following: manufacturer identification number (ID), device ID, and serial number.

4. A device identification processing method, used to prevent device identification anomalies caused by a second configuration program modifying the interface configuration, and to prevent the Bidirectional protocol and the IPP-over-USB protocol from reusing the same interface. When the computer device executes the Ippusbxd program or the IPP-USB program, the setting protocol of the interface is replaced from the Bidirectional protocol to the IPP-over-USB protocol, the Bidirectional protocol cannot be enabled, and the computer device cannot identify the image forming apparatus; wherein the second configuration program is used to modify the interface configuration of the device to the interface configuration corresponding to the preset protocol when a device conforming to the preset protocol is connected; the second configuration program can be invoked by the third rule file when the first device that meets the matching conditions of the third rule file is connected, and exit when all devices are removed; characterized in that, The method includes: In response to the third instruction, a fourth rule file is created, which can be read by the system service program in place of the third rule file; After reading the fourth rule file, the system service program can execute an alternative configuration program instead of the second configuration program when a device that does not meet the preset characteristics is connected; and can skip the execution of the second configuration program and the alternative configuration program when a device that meets the preset characteristic information is connected; when the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information and only performs interface configuration on devices that do not meet the preset characteristic information. The third rule file includes the calling instructions of the IPP-USB program. The directory where the third rule file is located is the third file directory. The directory where the fourth rule file is located is the fourth file directory. The reading priority of the fourth file directory is higher than that of the third file directory. The computer device reads the fourth rule file instead of the third rule file, so that the fourth rule file is read in place of the third rule file.

5. The device identification processing method according to claim 4, characterized in that, Also includes: In response to the fourth instruction, the fourth rule file is deleted, causing the system service program to execute in the manner it would have done if the fourth rule file had not been created.

6. A device identification processing apparatus for preventing device identification anomalies caused by a first configuration program modifying interface configuration, and for preventing the Bidirectional protocol and the IPP-over-USB protocol from reusing the same interface. When a computer device executes the Ippusbxd program or the IPP-USB program, the setting protocol of the interface is replaced from the Bidirectional protocol to the IPP-over-USB protocol, the Bidirectional protocol is disabled, and the computer device cannot identify the image forming apparatus; wherein the first configuration program is used to modify the interface configuration of the device to the interface configuration corresponding to the preset protocol when a device conforming to the preset protocol is connected; the first configuration program can be invoked by a first rule file when the device is connected and exit when the device is removed; characterized in that, The device includes: The first creation module is used to create a second rule file in response to the first instruction. The second rule file can be read by the system service program in place of the first rule file. After reading the second rule file, the system service program can skip the execution of the first configuration program when a device that meets the preset feature information is connected, so that the interface configuration is not modified by the first configuration program. The second rule file includes filtering rules, a first filtering label, and rules of the first configuration program. The directory where the second rule file is located is the second file directory, and the directory where the first rule file is located is the first file directory. The reading priority of the second file directory is higher than that of the first file directory. The computer device executes the second rule file and does not execute the first rule file, so that the second rule file is read instead of the first rule file. After reading the second rule file, the system service program can execute the first configuration program normally when a device that does not conform to the preset characteristic information is connected.

7. A device identification processing apparatus for preventing device identification anomalies caused by a second configuration program modifying interface configuration, and for preventing the Bidirectional protocol and the IPP-over-USB protocol from sharing the same interface. When a computer device executes the Ippusbxd program or the IPP-USB program, the setting protocol of the interface is replaced from the Bidirectional protocol to the IPP-over-USB protocol, the Bidirectional protocol is disabled, and the computer device cannot identify the image forming apparatus; wherein the second configuration program is used to modify the interface configuration of the device to the interface configuration corresponding to the preset protocol when a device conforming to the preset protocol is connected; the second configuration program can be invoked by the third rule file when the first device that meets the matching conditions of the third rule file is connected, and exit when all devices are removed; characterized in that, The device includes: The second creation module is used to create a fourth rule file in response to a third instruction, the fourth rule file being able to be read in place of the third rule file; After reading the fourth rule file, the system service program can execute an alternative configuration program instead of the second configuration program when a device that does not meet the preset characteristics is connected; and can skip the execution of the second configuration program and the alternative configuration program when a device that meets the preset characteristic information is connected; when the alternative configuration program is executed, it identifies whether each connected device meets the preset characteristic information and only performs interface configuration on devices that do not meet the preset characteristic information. The third rule file includes the calling instructions of the IPP-USB program. The directory where the third rule file is located is the third file directory. The directory where the fourth rule file is located is the fourth file directory. The reading priority of the fourth file directory is higher than that of the third file directory. The computer device reads the fourth rule file instead of the third rule file, so that the fourth rule file is read in place of the third rule file.

8. A storage medium, characterized in that, The storage medium includes a stored program, wherein when the program is executed, it controls the device where the storage medium is located to execute the device identification processing method according to any one of claims 1 to 3, or to execute the device identification processing method according to claim 4 or 5.

9. A computer device comprising a memory and a processor, the memory for storing information including program instructions, and the processor for controlling the execution of the program instructions, characterized in that, When the program instructions are loaded and executed by the processor, they implement the device identification processing method according to any one of claims 1 to 3, or execute the device identification processing method according to claim 4 or 5.

Citation Information

Patent Citations

  • Method of controlling network in wireless network and device

    CN102461050A

  • Method for realizing compatible browsing of medical pictures in PACS (picture archiving and communication system)

    CN103425652A