Port configuration method, device, storage medium and computer equipment
By acquiring and setting the port protocol identifier of the target image forming device, the port configuration conflict problem is solved, the normal installation and functional use of the device driver are realized, and the firmware modification cost is reduced.
Patent Information
- Application Number
- CN202211722270.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, port configuration conflicts occur due to port protocol reuse of service devices, resulting in device drivers that cannot be installed normally.
By acquiring the port protocol identifier of the target image forming device, if it is determined to be a preset protocol, a command to set the preset protocol is sent, the port protocol is set to the preset protocol, and a child node is generated to install the device driver.
The port configuration conflict problem is solved, allowing computer equipment to install device drivers normally, use all the functions of the image forming device, and reduce the cost of modifying the firmware of the target image forming device.
Smart Images

Figure CN116155721B_ABST
Abstract
Description
[Technical field]
[0001] The embodiments of the present invention relate to the technical field of port configuration, and in particular to a port configuration method, device, storage medium and computer equipment. [Background technology]
[0002] The client device can couple operations to the service device, wherein the client device can be a desktop computer, a laptop computer, etc.; the service device can be other types of devices or peripherals such as a printer, a copier, a fax machine, a webcam, a television, a set-top box, a camera, etc. The service device can provide one or more services to the client device, and can be coupled to the client device via a Universal Serial Bus (USB) link, a wired or wireless network connection, a Bluetooth connection, a serial port connection, a parallel port connection, etc. In order to fully utilize the functions of the service device, it is usually necessary to load, configure, and install appropriate device drivers in the client device. For example, if the service device is a printer, it is necessary to configure and install the appropriate type of printer driver in the client device so that the client device can access and use the printer.
[0003] After the client device is connected to the service device via USB and the client device recognizes the service device, the client device installs the device driver. However, during the process of installing the device driver on the client device, port configuration conflicts may occur due to port protocol reuse of some service devices. [Summary of the invention]
[0004] In view of this, the embodiments of the present invention provide a port configuration method, apparatus, storage medium and computer equipment to solve the problem of port configuration conflict caused by port protocol multiplexing of some service devices in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a port configuration method, including:
[0006] Acquire a port protocol identifier of a target image forming device;
[0007] If it is determined according to the port protocol identifier that the port protocol is the first protocol, a set preset protocol command is sent to the target image forming apparatus, so that the target image forming apparatus sets the port protocol to the preset protocol according to the set preset protocol command.
[0008] In a possible implementation manner, after sending the command for setting the preset protocol to the target image forming device, the method further includes:
[0009] Sending a subnode add command to the target image forming device, so that the target image forming device generates a subnode corresponding to the preset protocol;
[0010] The device driver is installed according to the child node generated by the image forming apparatus.
[0011] In a possible implementation, the method further includes:
[0012] If it is determined according to the port protocol identifier that the port protocol is a preset protocol, the device driver is installed.
[0013] In a possible implementation manner, before obtaining the port protocol identifier of the target image forming device, the method further includes:
[0014] Acquire a device identification list, wherein the device identification list includes a device identification of at least one image forming device;
[0015] Determine whether each device identifier is a preset identifier;
[0016] If it is determined that the device identification is a preset identification, then the image forming device corresponding to the device identification is determined to be a target image forming device.
[0017] In a possible implementation, the step of obtaining the port protocol identifier of the target image forming device includes:
[0018] sending a query protocol command to the target image forming device;
[0019] The port protocol identifier returned by the target image forming device according to the query protocol command is received.
[0020] In a second aspect, an embodiment of the present invention provides a port configuration device, including:
[0021] A first acquisition module, used for acquiring a port protocol identifier of a target image forming device;
[0022] The sending module is used to send a set preset protocol command to the target image forming device if it is determined that the port protocol is the first protocol according to the port protocol identifier, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command.
[0023] In a possible implementation, the method further includes:
[0024] The sending module is further used to send a sub-node adding command to the target image forming device, so that the target image forming device generates a sub-node corresponding to the preset protocol;
[0025] The first installation module is used to install a device driver according to the sub-node generated by the image forming apparatus.
[0026] In a possible implementation, the method further includes:
[0027] The second installation module is used to install a device driver if it is determined according to the port protocol identifier that the port protocol is a preset protocol.
[0028] In a third aspect, an embodiment of the present invention provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the port configuration method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0029] In a fourth aspect, an embodiment of the present invention provides a computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the port configuration method in the above-mentioned first aspect or any possible implementation of the first aspect are implemented.
[0030] In a technical solution of a port configuration method, device, storage medium and computer equipment provided by an embodiment of the present invention, a port protocol identifier of a target image forming device is obtained; if the port protocol is determined to be a first protocol according to the port protocol identifier, a set preset protocol command is sent to the target image forming device, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command, thereby solving the problem of port configuration conflict before installing the device driver, and enabling the computer device to install the device driver normally after changing the port protocol of the image forming device.
Brief Description of the Drawings
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 is a schematic diagram of a descriptor in the prior art;
[0033] Figure 2 A schematic diagram of an interface arrangement in the prior art;
[0034] Figure 3 A flow chart of a port configuration method provided by an embodiment of the present invention;
[0035] Figure 4A flowchart of installing a device driver provided by an embodiment of the present invention;
[0036] Figure 5 A flow chart of determining a target image forming device provided by an embodiment of the present invention;
[0037] Figure 6 A flow chart for obtaining a port protocol identifier provided by an embodiment of the present invention;
[0038] Figure 7 A flowchart of installing a device driver provided by an embodiment of the present invention;
[0039] Figure 8 A schematic diagram of a port configuration provided by an embodiment of the present invention;
[0040] Fig. 9 A schematic diagram of a computer device provided by an embodiment of the present invention. [Specific implementation method]
[0041] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0042] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0044] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0045] It should be understood that, although the terms first, second, third, etc. may be used to describe numbers, etc. 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.
[0046] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0047] Figure 1 is a schematic diagram of a descriptor in the prior art, such as Figure 1 As shown, Figure 1 1 device descriptor, 2 configuration descriptors, 4 interface descriptors, and 8 endpoint descriptors are shown in FIG. Figure 1 The bNumConfigurations shown in FIG. 1 are used to indicate the number of configurations supported by the device, bNumInterfaces are used to indicate the number of interfaces supported by the device, and bNumEndpoints are used to indicate the number of endpoints supported by the interface.
[0048] Each image forming device corresponds to a device descriptor. One device descriptor may include at least one configuration descriptor. The configuration descriptor may configure the same service device into completely different types. For example, if the service device is a printer, the printer may also be configured as an optical drive. Figure 1 It is shown in that the device descriptor includes two configuration descriptors, but the image forming device can only enable one configuration at a time, that is, only one configuration descriptor corresponds to the enabled state. One configuration can correspond to multiple interfaces, each interface has an interface descriptor, and the image forming device can enable multiple interfaces at the same time. The interface descriptor can enable the same service device to have multiple functions at the same time. The interface descriptor can be regarded as a collection of endpoint descriptors. The endpoint is similar to the port number in the network. Different port numbers can realize different functions.
[0049] Figure 2 A schematic diagram of an interface configuration in the prior art is shown in FIG. Figure 2 As shown, Figure 2A configuration descriptor is shown in the figure, which includes two interface descriptors, namely Interface ZeroDescriptor and Interface One Descriptor. Interrupt Pipes and Bulk Pipes reuse the same interface, and the interface descriptor Interface One Descriptor can be used to distinguish Interrupt Pipes from Bulk Pipes through bAlternateSetting. The Endpoint Descriptors configured for Interrupt Pipes are Endpoint Descriptor one and Endpoint Descriptor two; the Endpoint Descriptors configured for BulkPipes are Endpoint Descriptor one and Endpoint Descriptortwo. When the service device is a printer, the ordinary USB protocol can correspond to the ordinary printing Interface, and the ordinary printing Interface is configured with Endpoint Descriptor 0 and Endpoint Descriptor 1; the IPP-over-USB protocol can correspond to the IPP printing Interface, and the IPP printing Interface is configured with Endpoint Descriptor 0 and EndpointDescriptor 3. It should be noted that the Internet Printing Protocol (IPP) is a standard network protocol for printing on the Internet, which allows users to do remote printing and manage printing through the Internet. Users can control various printing settings such as the type of paper used for printing and the resolution through the relevant interface. The IPP-over-USB protocol allows universal serial bus devices to be regarded as network devices, thereby expanding the devices that apply the Internet protocol to include USB-connected image forming devices.
[0050] The client device can usually retrieve the device driver by accessing an external storage device, or access the device driver from an external server and / or through a network, or access the device driver by accessing a service device. For example, the external storage device is a compact disc read-only memory (CD-ROM), a USB flash drive (UFD), etc.; when the service device is a printer, the external server is a print server; accessing the device driver through the network can be accessing the device driver from the website of the service device manufacturer or seller using the Internet or an intranet; when the device driver is installed in the internal memory of the service device, the client device can access the device driver by accessing the internal memory of the service device.
[0051] Although the client device can usually access the device driver through the above resources, the user is usually not sure which device driver to install on the client device, nor is he sure through which resource to access the device driver. In the prior art, the client device implements a driver-free installation method, in which the client device is connected to the service device via USB. After the client device recognizes the service device, the device driver is obtained from the service device or an external server for installation. However, in the process of the client device implementing the driver-free function, at least one of the following problems may occur: the USB cannot search for the printer, the wireless network (WIreless-Fidelity, Wi-Fi) configuration tool cannot be used, the USB status monitor fails, the sleep time setting fails, and after connecting to the service device via USB, the operating system automatically generates an Internet Printing Protocol (Internet Printing Protocol, IPP) driver but its functions are incomplete. The reason for the above situation is that in order to achieve the driver-free function, the client device supports the IPP-over-USB protocol by default, and adds the function of enumerating devices through the IPP Globally Unique Identifier (GUID). However, in some service devices, the IPP-over-USB protocol is multiplexed with the ordinary USB protocol. If the service device supports the IPP-over-USB protocol, the client device cannot enumerate the device through USB PRINT GUID.
[0052] For example, when the client device and the service device are connected via USB, the operating system of the client device will automatically send a SET_INTERFACE command to the USB port of the service device to configure the USB port as an IPP Interface to set the port protocol to the IPP-over-USB protocol. The client device obtains the functions supported by the service device through the IPP-over-USB protocol. For example, when the service device is a printer, the functions supported by the printer include setting the language, paper, paper box, etc. The client device automatically generates an IPP driver based on the obtained functions. If the service device supports the IPP-over-USB protocol, the service device starts with the IPP-over-USB protocol; if the client device matches the manufacturer's driver, the manufacturer's driver is used first. However, before installing the driver, the client device needs to interact with the service device. At this time, the Endpoint of the service device is wrong, resulting in abnormal interaction and the device driver cannot be installed normally.
[0053] In addition, when the service device is a printer, the "Normal Print USB Interface" and "IPP Print Interface" reuse the same port. At the same time, the port can only enable "Normal Print USB Interface" or "IPP Print Interface". Therefore, if the port protocol is IPP-over-USB protocol, the "Normal Print USB Interface" function cannot be used.
[0054] In summary, in the process of implementing the driver-free function in the client device, due to the multiplexing of the service device port protocol, the client device configures the port protocol to the IPP-over-USB protocol through SET_INTERFACE, resulting in a port configuration conflict and the device driver cannot be installed normally.
[0055] To resolve the port configuration conflict, Figure 3 A flow chart of a port configuration method provided by an embodiment of the present invention, such as Figure 3 As shown, the method includes:
[0056] Step 101: The computer device obtains a port protocol identifier of a target image forming device.
[0057] In the embodiment of the present invention, the computer device includes but is not limited to a mobile phone, a tablet computer, a portable PC, a desktop computer, a wearable device, etc. The operating system of the computer device is a Microsoft Windows operating system (Microsoft Windows). For example, the operating system of the computer device is Microsoft Windows 11. The computer device and the target image forming device are connected to each other through a USB. The target image forming device includes but is not limited to a printer, a copier, a fax machine, a scanner, etc. In the target image forming device, the IPP-over-USB protocol and the ordinary USB protocol reuse the same port.
[0058] Figure 4 A flowchart of installing a device driver provided by an embodiment of the present invention, such as Figure 4 As shown, the computer device is connected to the image forming device through USB communication. After detecting that at least one image forming device is connected through USB, the computer device runs a one-key installation driver; obtains the device identification of each image forming device, and the device identification is IPP_GUID; the image forming device can be a printer. The computer device enumerates IPP_GUID to determine whether there is a target printer currently connected to the computer device; if not, installs the device driver; if so, sends a query protocol command to query the port protocol of the target printer, and the query protocol command is IOCTL_USBPRINT_GET_PROTOCOL. The target printer returns the identification of the supported protocol according to the query protocol command. For example, when the port of the target printer supports the IPP-over-USB protocol, the identification is ipp, and the target printer sends "PROTOCOL=ipp" to the computer device; when the port of the target printer supports the ordinary USB protocol, the identification is usual-usb, and the target printer sends "PROTOCOL=usual-usb" to the computer device. The computer device distinguishes according to different port protocol identifiers to determine whether the port of the target printer supports the IPP-over-USB protocol or the ordinary USB protocol; if P=ipp, it means that the computer device determines that the port protocol identifier is ipp, then it is determined that the protocol supported by the port of the target printer is the IPP-over-USB protocol; send the "IOCTL_USBPRINT_SET_PROTOCOL" command to the target printer; send the add child node command to the target printer, and the add child node command is "IOCTL_USBPRINT_ADD_CHILD_DEVICE"; install the device driver; if P=usual-usb, it means that the computer device determines that the port protocol identifier is usual-usb, then it is determined that the protocol supported by the port of the target printer is the ordinary USB protocol; install the device driver.
[0059] Step 102, the computer device determines whether the port protocol is the preset protocol or the first protocol according to the port protocol identifier. If the port protocol is determined to be the preset protocol, step 104 is executed; if the port protocol is determined to be the first protocol, step 103 is executed.
[0060] In the embodiment of the present invention, the preset protocol is a common USB protocol, and the first protocol is a protocol other than the common USB protocol. In the embodiment of the present application, the first protocol may be an IPP-over-USB protocol.
[0061] When the port protocol of the image forming device is a common USB protocol, the image forming device sends a first port protocol identifier to the computer device; when the port protocol of the image forming device is an IPP-over-USB protocol, the image forming device sends a second port protocol identifier to the computer device. The first port protocol identifier is different from the second port protocol identifier. Figure 4 As shown, the first port protocol identifier is "usual-usb"; the second port protocol identifier is "ipp", and the computer device is distinguished according to different port protocol identifiers. If it is determined that the port protocol identifier is usual-usb, execute step 104; if it is determined that the port protocol identifier is ipp, execute step 103.
[0062] Step 103: The computer device sends a set preset protocol command to the target image forming apparatus, so that the target image forming apparatus sets the port protocol to the preset protocol according to the set preset protocol command.
[0063] In the embodiment of the present invention, the computer device determines that the port protocol is the first protocol according to the port protocol identifier being ipp. Figure 4 As shown, the computer device sends a set preset protocol command to the target printer, and the set preset protocol command is "IOCTL_USBPRINT_SET_PROTOCOL". The target printer switches the port protocol from the IPP-over-USB protocol to the ordinary USB protocol according to the set preset protocol command.
[0064] Step 104: The computer device installs a device driver.
[0065] In the embodiment of the present invention, Figure 4 As shown, the computer device determines that the port protocol is the preset protocol according to the port protocol identifier as usual-usb, and the computer device installs the device driver normally. Thus, the image forming device that uses the same port as the IPP-over-USB protocol and the ordinary USB protocol can be installed normally by the computer device, and after installing the device driver, the computer device can use all the functions of the image forming device.
[0066] A port configuration method provided by an embodiment of the present invention obtains a port protocol identifier of a target image forming device; if the port protocol is determined to be a first protocol according to the port protocol identifier, a set preset protocol command is sent to the target image forming device, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command, thereby solving the problem of port configuration conflict before installing a device driver, and enabling the computer device to normally install the device driver after changing the port protocol of the image forming device.
[0067] In one possible implementation, Figure 5 A flow chart of determining a target image forming device provided by an embodiment of the present invention is as follows: Figure 5 As shown, before step 101, the following steps are also included:
[0068] Step 100a: The computer device obtains a device identification list, where the device identification list includes a device identification of at least one image forming apparatus.
[0069] In the embodiment of the present invention, the device identification may include an identifier for indicating the uniqueness of a product, and each device corresponds to a unique device identification. The computer device creates a device identification list according to the device identification of at least one connected device. Figure 4As shown, the device identifier is IPP_GUID, and the device identifier list includes at least one IPP_GUID. When the computer device obtains the device identifier list, since the computer device supports the identification of two types of protocols, the computer device can support the identification of two types of identifiers, USB IPP GUID and USB BIDI GUID. For example, the device corresponding to the USB IPP GUID is defined as an IPP printing device; the device corresponding to the USB BIDI GUID is defined as a USB printing device. When the computer device identifies the GUID of the image forming device, the GUID can be identified as a USB IPP GUID; if the identification fails, the GUID is identified as a USB BIDI GUID; if the identification still fails, the identification of the GUID of the device ends. If the GUID is successfully identified as a USB IPP GUID or the GUID is successfully identified as a USB BIDI GUID, the GUID is saved in the device identification list; in another achievable implementation, the computer device accesses the image forming device through communication to obtain device information of the image forming device, the device information including the GUID of the image forming device, and the obtained device information of the image forming device, such as the GUID, is used as the device identification of the identified image forming device. As a achievable implementation, the computer device determines whether the image forming device belongs to the IPP-GUID based on the device identification of the image forming device obtained by identification, and saves the IPP-GUID of the determined image forming device in the device identification list.
[0070] Step 100b: The computer device determines whether each device identification is a preset identification. If so, execute step 100c; if not, execute step 100d.
[0071] In an embodiment of the present invention, a computer device may pre-create a preset identifier list, which may include at least one preset identifier, and the preset identifier refers to an identifier corresponding to a device that multiplexes a port between the IPP-over-USB protocol and the ordinary USB protocol. The computer device determines whether there is a preset identifier that is the same as the current device identifier in at least one preset identifier; if so, execute step 100c, and determine whether there is a preset identifier that is the same as the next device identifier in at least one preset identifier; if not, execute step 100d, and determine whether there is a preset identifier that is the same as the next device identifier in at least one preset identifier. The computer device ends executing step 100b until it is determined whether there is a preset identifier that is the same as the last device identifier in at least one preset identifier. For example, if Figure 4 As shown, the computer device enumerates IPP_GUID to determine whether there is a target printer currently connected to the computer device.
[0072] Step 100c: The computer device determines that the image forming device corresponding to the device identifier is the target image forming device.
[0073] In the embodiment of the present invention, the computer device determines that the device identifier is a preset identifier.
[0074] Step 100d: The computer device installs the device driver.
[0075] In the embodiment of the present invention, for an image forming device where the IPP-over-USB protocol and the ordinary USB protocol do not reuse the same port, the computer device can normally install the device driver, and after installing the device driver, the computer device can use all functions of the image forming device. Figure 4 As shown, if the computer device determines that the printer currently connected to the computer device is not the target printer, the device driver is installed.
[0076] In one possible implementation, Figure 6 A flowchart of obtaining a port protocol identifier is provided in an embodiment of the present invention, such as Figure 6 As shown, step 101 specifically includes:
[0077] Step 1011: The computer device sends a query protocol command to the target image forming apparatus.
[0078] In the embodiment of the present invention, Figure 4 As shown, the query protocol command is IOCTL_USBPRINT_GET_PROTOCOL.
[0079] Step 1012: The computer device receives the port protocol identifier returned by the target image forming apparatus according to the query protocol command.
[0080] In the embodiment of the present invention, Figure 4 As shown, when the port of the target printer supports the IPP-over-USB protocol, it is identified as ipp, and the target printer sends "PROTOCOL=ipp" to the computer device, and the port protocol is identified as "ipp"; when the port of the target printer supports the ordinary USB protocol, it is identified as usual-usb, and the target printer sends "PROTOCOL=usual-usb" to the computer device, and the port protocol is identified as "usual-usb".
[0081] In one possible implementation, Figure 7 A flowchart of installing a device driver provided by an embodiment of the present invention, such as Figure 7 As shown, after step 104, the following steps are also included:
[0082] Step 105: The computer device sends a command to add a child node to the target image forming apparatus, so that the target image forming apparatus generates a child node corresponding to a preset protocol.
[0083] In the embodiment of the present invention, the subnode is equivalent to an intermediate medium, which is used to associate devices, drivers, etc. When the port protocol of the target image forming device changes, the subnode supporting the installation of the driver disappears. Since the subnode disappears, the target image forming device cannot traverse the hardware information. Therefore, the computer device needs to send an add subnode command to the target image forming device; the target image forming device generates a subnode corresponding to the preset protocol according to the add subnode command.
[0084] like Figure 4 As shown, the command for adding a child node is IOCTL_USBPRINT_ADD_CHILD_DEVICE.
[0085] Step 106: The computer device installs a device driver according to the child node generated by the image forming apparatus.
[0086] In the embodiment of the present invention, Figure 4 As shown, the computer device can install the device driver normally, and the computer device ends the process after installing the device driver. This solves the problem of port configuration conflict caused by the IPP-over-USB protocol and the ordinary USB protocol in the image forming device sharing the same port during the device driver installation process. The computer device can also install the device driver normally for the image forming device in which the IPP-over-USB protocol and the ordinary USB protocol share the same port, and the computer device can use all the functions of the image forming device after installing the device driver. At the same time, there is no need to modify the firmware of the target image forming device, so the problem of being unable to install the device driver normally can be solved, saving the manpower, material resources and time required to modify the firmware of the target image forming device, and reducing costs.
[0087] Figure 8 A schematic diagram of a port configuration provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the device includes: a first acquisition module 11 and a sending module 12. The first acquisition module 11 is connected to the sending module 12.
[0088] The first acquisition module 11 is used to obtain the port protocol identifier of the target image forming device; the sending module 12 is used to send a set preset protocol command to the target image forming device if it is determined that the port protocol is the first protocol according to the port protocol identifier, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command.
[0089] In the embodiment of the present invention, the device further includes: a first installation module 13. The sending module 12 is connected to the first installation module 13.
[0090] The sending module 12 is further used to send a subnode add command to the target image forming device so that the target image forming device generates a subnode corresponding to the preset protocol; the first installation module 13 is used to install the device driver according to the subnode generated by the image forming device.
[0091] In the embodiment of the present invention, the device further includes: a second installation module 14. The second installation module 14 is connected to the first acquisition module 11.
[0092] The second installation module 14 is used for installing the device driver if it is determined according to the port protocol identifier that the port protocol is a preset protocol.
[0093] In the embodiment of the present invention, the device further includes: a second acquisition module 15, a judgment module 16 and a determination module 17. The second acquisition module 15 is connected to the judgment module 16, the judgment module 16 is connected to the determination module 17, and the determination module 17 is connected to the first acquisition module 11.
[0094] The second acquisition module 15 is used to obtain a device identification list, which includes the device identification of at least one image forming device; the judgment module 16 is used to judge whether each device identification is a preset identification; the determination module 17 is used to determine that the image forming device corresponding to the device identification is the target image forming device if the judgment module 16 judges that the device identification is a preset identification.
[0095] In the embodiment of the present invention, the device further includes: a receiving module 18. The receiving module 18 is connected to the sending module 12.
[0096] The sending module 12 is further used to send a query protocol command to the target image forming device; the receiving module 18 is used to receive the port protocol identifier returned by the target image forming device according to the query protocol command.
[0097] A port configuration method provided by an embodiment of the present invention obtains a port protocol identifier of a target image forming device; if the port protocol is determined to be a first protocol according to the port protocol identifier, a set preset protocol command is sent to the target image forming device, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command, thereby solving the problem of port configuration conflict before installing a device driver, and enabling the computer device to normally install the device driver after changing the port protocol of the image forming device.
[0098] An embodiment of the present invention provides a storage medium, which includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the steps of the embodiment of the above-mentioned port configuration method. For a specific description, please refer to the embodiment of the above-mentioned port configuration method.
[0099] An embodiment of the present invention provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the embodiment of the above-mentioned port configuration method are implemented. For a specific description, please refer to the embodiment of the above-mentioned port configuration method.
[0100] Fig. 9 A schematic diagram of a computer device provided by an embodiment of the present invention. Fig. 9 As shown, the computer device 30 of 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, the method for port configuration in the embodiment is implemented. To avoid repetition, it is not described one by one here. Alternatively, when the computer program is executed by the processor 31, the functions of each model / unit in the port configuration device in the embodiment are implemented. To avoid repetition, it is not described one by one here.
[0101] The computer device 30 includes, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will appreciate that Fig. 9 It is only an example of the computer device 30 and does not constitute a limitation of the computer device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, etc.
[0102] The processor 31 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), 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, etc.
[0103] The memory 32 may be an internal storage unit of the computer device 30, such as a hard disk or memory of the computer device 30. The memory 32 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 30. Further, the memory 32 may also include both an internal storage unit of the computer device 30 and an external storage device. The memory 32 is used to store computer programs and other programs and data required by the computer device 30. The memory 32 may also be used to temporarily store data that has been output or is to be output.
[0104] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0105] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0108] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (Processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0109] 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 in the scope of protection of the present invention.
Claims
1. A port configuration method, characterized in that: include: Acquire a device identification list, wherein the device identification list includes a device identification of at least one image forming device; Determining whether each of the device identifiers is a preset identifier; If it is determined that the device identification is a preset identification, determining that the image forming device corresponding to the device identification is a target image forming device; Sending a protocol query command to a target image forming device to obtain a port protocol identifier of the target image forming device; If it is determined according to the port protocol identifier that the port protocol is the first protocol, a set preset protocol command is sent to the target image forming device so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command, and the preset protocol and the first protocol reuse the same port.
2. The method according to claim 1, characterized in that After sending the command for setting the preset protocol to the target image forming device, the method further includes: Sending a subnode add command to the target image forming device, so that the target image forming device generates a subnode corresponding to the preset protocol; The device driver is installed according to the child node generated by the image forming apparatus.
3. The method according to claim 1, characterized in that Also includes: If it is determined according to the port protocol identifier that the port protocol is a preset protocol, the device driver is installed.
4. A port configuration device, characterized in that: include: A first acquisition module, used for acquiring a port protocol identifier of a target image forming device; a sending module, configured to send a set preset protocol command to the target image forming device if it is determined according to the port protocol identifier that the port protocol is the first protocol, so that the target image forming device sets the port protocol to the preset protocol according to the set preset protocol command, and the preset protocol and the first protocol reuse the same port; The device also includes: A second acquisition module is used to acquire a device identification list, where the device identification list includes a device identification of at least one image forming device; A judgment module, used to judge whether each device identification is a preset identification; a determination module, configured to determine that the image forming device corresponding to the device identification is a target image forming device if the determination module determines that the device identification is a preset identification; The sending module is further used to send a query protocol command to the target image forming device; The receiving module is used to receive the port protocol identifier returned by the target image forming device according to the query protocol command.
5. The device according to claim 4, characterized in that Also includes: The sending module is further used to send a sub-node adding command to the target image forming device, so that the target image forming device generates a sub-node corresponding to the preset protocol; The first installation module is used to install a device driver according to the sub-node generated by the image forming apparatus.
6. The device according to claim 4, characterized in that Also includes: The second installation module is used to install a device driver if it is determined according to the port protocol identifier that the port protocol is a preset protocol.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute a port configuration method according to any one of claims 1 to 3.
8. A computer device comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the steps of a port configuration method described in any one of claims 1 to 3 are implemented.
