CN-116723173-B - Printer configuration webpage access method based on USB (universal serial bus) internet access port
Abstract
The application discloses a printer configuration webpage access method and a printer device based on a USB (universal serial bus) internet access port, wherein the method comprises the following steps: the LINUX kernel is controlled to load a USB virtual network card drive, an IP address and a subnet mask are distributed to the USB port, and a virtual network port is generated according to the USB port; the method comprises the steps of performing domain name system configuration processing on a virtual network port, distributing a slave IP address to terminal equipment accessed by a USB port according to an IP address and a subnet mask, wherein the USB port of a printer is simulated into the virtual network port through a USB virtual network card driver, so that the terminal equipment obtains the slave IP address distributed by the virtual network port through connecting the USB port, accesses a network of a printer device through the slave IP address, accesses a configuration webpage of the printer device, simply and effectively realizes the configuration webpage access of the printer, does not need additional hardware equipment, further simplifies the configuration webpage access process, and improves the use experience of a user.
Inventors
- LI XIANG
- Li Xuanzhao
Assignees
- 江门市得实计算机外部设备有限公司
- 得实打印机(江门)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20230525
Claims (9)
- 1. The printer configuration webpage access method based on the USB port is characterized by being applied to a printer device, wherein the printer device comprises a LINUX kernel and a USB port, and the method comprises the following steps: controlling the USB port to execute a USB port closing command so that the USB port stops printing service; Controlling the LINUX kernel to load a USB virtual network card driver, and distributing an IP address and a subnet mask for the USB port so as to generate a virtual network port according to the USB port, wherein the USB virtual network card driver is a g_ether driver; And carrying out domain name system configuration processing on the virtual network port, and distributing a slave IP address to the terminal equipment accessed by the USB port according to the IP address and the subnet mask so that the terminal equipment accesses the network of the printer device through the slave IP address and accesses the configuration webpage of the printer device.
- 2. The method for accessing a printer configuration web page based on a USB port according to claim 1, wherein the performing domain name system configuration processing on the virtual network port, and allocating a slave IP address to a terminal device accessed by the USB port according to the IP address and the subnet mask, includes: performing domain name system configuration processing on the virtual network port, and acquiring domain name system configuration information; Controlling the virtual network port to start IP distribution service according to the domain name system configuration information and a preset network protocol; and controlling the virtual network port to distribute the IP address of the slave machine to the terminal equipment accessed by the USB port according to the IP address and the subnet mask.
- 3. The method for accessing a printer configuration web page based on a USB port according to claim 2, wherein the preset network protocol includes a domain name dynamic host configuration protocol and a domain name system configuration protocol, and the controlling the virtual network port to start the IP allocation service according to the domain name system configuration information and the preset network protocol includes: and controlling the virtual network port to start dynamic host configuration service and domain name system configuration service according to the domain name system configuration information.
- 4. The method for accessing a printer configuration web page based on a USB port according to claim 1, wherein after performing domain name system configuration processing on the virtual network port, the method further comprises: And distributing a slave IP address to the terminal equipment accessed by the USB port according to the IP address and the subnet mask, and generating a shared network of the printer device and the terminal equipment so as to realize information interaction between the printer device and the terminal equipment through the shared network.
- 5. The method for accessing a printer configuration web page based on a USB port according to claim 1, wherein the terminal device is connected to the USB port through a USB connection line.
- 6. The method is applied to terminal equipment, wherein an RNDIS (radio network display) driver is arranged on the terminal equipment, the terminal equipment is connected with a USB port on a printer device, the printer device comprises a LINUX core and the USB port, and the method comprises the following steps of; Running the RNDIS driver to identify a network of the printer device through a virtual network port; The slave IP address distributed by the virtual network port is obtained, the network of the printer device is accessed through the slave IP address, and the configuration webpage of the printer device is accessed; The printer device controls the USB port to execute a USB port closing command to enable the USB port to stop printing service, controls the LINUX kernel to load a USB virtual network card driver, distributes an IP address and a subnet mask for the USB port to generate the virtual network port according to the USB port, wherein the USB virtual network card driver is g_ether driver, and performs domain name system configuration processing on the virtual network port by the printer device, and distributes the slave IP address for the terminal equipment according to the IP address and the subnet mask.
- 7. A printer device, comprising a LINUX kernel and a USB port; The LINUX kernel is used for loading a USB virtual network card driver, distributing an IP address and a subnet mask for the USB port, generating a virtual network port according to the USB port, carrying out domain name system configuration processing on the virtual network port, distributing a slave IP address for terminal equipment accessed by the USB port according to the IP address and the subnet mask, enabling the terminal equipment to access a network of the printer device through the slave IP address, and accessing a configuration webpage of the printer device, wherein the USB virtual network card driver is g_ether driver.
- 8. A controller comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of configuring web page access for a USB port-based printer according to any one of claims 1 to 6 when the computer program is executed.
- 9. A computer-readable storage medium storing computer-executable instructions for performing the USB port-based printer configuration web page access method of any one of claims 1 to 6.
Description
Printer configuration webpage access method based on USB (universal serial bus) internet access port Technical Field The application relates to the technical field of printer configuration, in particular to a printer configuration webpage access method and a printer device based on a USB (universal serial bus) internet access port. Background The printer configuration webpage refers to a webpage interface for configuring and managing printer settings, through which a user can set parameters of the printer, view the state of the printer, manage print tasks and the like, and the operation modes and contents of the configuration webpage of printers of different brands or models can be different; generally, to access the printer configuration webpage, a user needs to install a configuration tool on a computer and perform complex network configuration, then the computer can be connected to the network where the printer is located, and further the printer configuration webpage is accessed. Disclosure of Invention The embodiment of the application provides a printer configuration webpage access method and a printer device based on a USB (universal serial bus) port, which at least can ensure that the printer device in the scheme of the application comprises a LINUX kernel and a USB port, wherein the LINUX kernel can generate a virtual network port according to the USB port, so that terminal equipment such as a computer and the like can be quickly connected with a network of the printer device through the virtual network port, further, the printer configuration webpage access is simply and effectively realized, the configuration webpage access process is simplified, and the configuration speed and the user experience are improved. In a first aspect, an embodiment of the present application provides a method for accessing a printer configuration web page based on a USB port, where the method is applied to a printer device, and the printer device includes a LINUX kernel and a USB port, and the method includes: Controlling the LINUX kernel to load a USB virtual network card driver, and distributing an IP address and a subnet mask for the USB port so as to generate a virtual network port according to the USB port; And carrying out domain name system configuration processing on the virtual network port, and distributing a slave IP address to the terminal equipment accessed by the USB port according to the IP address and the subnet mask so that the terminal equipment accesses the network of the printer device through the slave IP address and accesses the configuration webpage of the printer device. In some embodiments, the performing domain name system configuration processing on the virtual network port, allocating a slave IP address to a terminal device accessed by the USB port according to the IP address and the subnet mask, includes: performing domain name system configuration processing on the virtual network port, and acquiring domain name system configuration information; Controlling the virtual network port to start IP distribution service according to the domain name system configuration information and a preset network protocol; and controlling the virtual network port to distribute the IP address of the slave machine to the terminal equipment accessed by the USB port according to the IP address and the subnet mask. In some embodiments, the preset network protocol includes a domain name dynamic host configuration protocol and a domain name system configuration protocol, and the controlling the virtual network port to open an IP allocation service according to the domain name system configuration information and the preset network protocol includes: and controlling the virtual network port to start dynamic host configuration service and domain name system configuration service according to the domain name system configuration information. In some embodiments, after the performing domain name system configuration processing on the virtual network port, the method further includes: And distributing a slave IP address to the terminal equipment accessed by the USB port according to the IP address and the subnet mask, and generating a shared network of the printer device and the terminal equipment so as to realize information interaction between the printer device and the terminal equipment through the shared network. In some embodiments, before the controlling the LINUX kernel to load the USB virtual network card driver and allocate an IP address and a subnet mask to the USB port, the method further includes: And controlling the USB port to execute a USB port closing command so that the USB port stops printing service. In some embodiments, the terminal device is connected to the USB port through a USB connection. In a second aspect, an embodiment of the present application provides a method for accessing a printer configuration web page based on a USB port, where the method is applied to a terminal device, where an R