CN111913672B - Communication establishment method, printer, storage medium, and electronic device - Google Patents

Communication establishment method, printer, storage medium, and electronic device Download PDF

Info

Publication number
CN111913672B
CN111913672B CN202010687574.6A CN202010687574A CN111913672B CN 111913672 B CN111913672 B CN 111913672B CN 202010687574 A CN202010687574 A CN 202010687574A CN 111913672 B CN111913672 B CN 111913672B
Authority
CN
China
Prior art keywords
printer
service
address
printing
request message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010687574.6A
Other languages
Chinese (zh)
Other versions
CN111913672A (en
Inventor
方春国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Passion Technology Co ltd
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Passion Technology Co ltd
Beijing Sankuai Online Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Passion Technology Co ltd, Beijing Sankuai Online Technology Co Ltd filed Critical Beijing Passion Technology Co ltd
Priority to CN202010687574.6A priority Critical patent/CN111913672B/en
Publication of CN111913672A publication Critical patent/CN111913672A/en
Application granted granted Critical
Publication of CN111913672B publication Critical patent/CN111913672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1209Improving or facilitating administration, e.g. print management resulting in adapted or bridged legacy communication protocols, e.g. emulation, protocol extension
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1236Connection management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1285Remote printer device, e.g. being remote from client or server
    • G06F3/1286Remote printer device, e.g. being remote from client or server via local network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/20Point-of-sale [POS] network systems
    • G06Q20/202Interconnection or interaction of plural electronic cash registers [ECR] or to host computer, e.g. network details, transfer of information from host to ECR or from ECR to ECR

Abstract

The present disclosure relates to a communication establishment method, a printer, a storage medium, and an electronic apparatus to solve the problems in the related art. The communication establishment method is applied to a printer, and comprises the following steps: registering a printing service through a network service discovery function of the printer; multicasting the print service; and responding to a received connection request message sent by a destination terminal, and establishing communication connection with the destination terminal according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination terminal analyzes the printing service of the printer multicast to obtain the Internet protocol address and the port number of the printer. By adopting the method, the efficiency of establishing communication connection between the destination terminal and the printer is improved.

Description

Communication establishment method, printer, storage medium, and electronic device
Technical Field
The present disclosure relates to the field of communication technologies, and in particular, to a communication establishment method, a printer, a storage medium, and an electronic device.
Background
As a common device, printers play an important auxiliary role in people's daily life. For example, a job file is printed using a printer. For another example, shopping list tickets are printed using a printer, and so forth. In a shopping scenario, a merchant needs to provide a shopping receipt to a shopper. The merchant sends the shopping list to the connected printer through the cash register, and the printer prints the shopping list, so that shopping receipt credentials are provided for the shopper.
In the related art, after purchasing a thermal network printer, a merchant needs to configure an internet protocol address (Internet Protocol Address, abbreviated as an IP address) of the printer before using the printer, and after configuring a correct IP address, the printer can be accessed into a local area network for use. There are two ways to establish a communication connection with the printer, one is that in the case where the printer closes DHCP (Dynamic Host Configuration Protocol ), the merchant configures the IP address of the printer to a static IP address through software on the cash register, thereby establishing a communication connection with the printer. Another is that in the case where the printer opens DHCP, the merchant binds the IP address of the printer to the cash register, thereby establishing a communication connection between the cash register and the printer. However, in the case of DHCP being turned on, the IP address of the printer may change dynamically, which makes it necessary for the user to re-bind the IP address of the printer to the cash register each time the printer IP address changes. It can be seen that these two ways of establishing a communication connection with a printer are quite complex to operate, resulting in inefficiency in establishing a communication connection with a printer.
Disclosure of Invention
An object of the present disclosure is to provide a communication establishment method, a printer, a storage medium, and an electronic apparatus to solve the problems existing in the related art.
In order to achieve the above object, according to a first aspect of the embodiments of the present disclosure, there is provided a communication establishing method, applied to a printer, including:
registering a printing service through a network service discovery function of the printer;
multicasting the print service;
and responding to a received connection request message sent by a destination terminal, and establishing communication connection with the destination terminal according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination terminal analyzes the printing service of the printer multicast to obtain the Internet protocol address and the port number of the printer.
Optionally, the registering the printing service through the network service discovery function of the printer includes:
and registering a printing service through a network service discovery function of the printer every time the printer is powered on.
Optionally, the method further includes starting a dynamic host configuration protocol function of the printer when the printer is powered on, so that the printer is connected to a local area network;
the multicasting the print service includes:
and multicasting the printing service to other terminal equipment in the local area network.
According to a second aspect of the embodiments of the present disclosure, there is provided a communication establishment method, applied to a destination, including:
scanning, by a network service discovery function, a print service within a local area network, the print service being multicast by a printer into the local area network;
analyzing the scanned printing service to obtain an Internet protocol address and a port number of the printer;
and sending a connection request message to the printer through the Internet protocol address and the port number, wherein the connection request message is used for establishing connection communication with the printer.
Optionally, the analyzing the scanned print service to obtain an internet protocol address and a port number of the printer includes:
when a plurality of printing services are scanned, the printing services are analyzed in parallel, and the Internet protocol addresses and port numbers of the printers are obtained.
Optionally, storing the parsing request in a client information structure of a network service discovery protocol layer supporting a network service discovery function through a sparse array, and the parsing the plurality of printing services in parallel includes:
and analyzing the plurality of printing services in parallel according to the plurality of analysis requests stored in the sparse array.
Optionally, each parsing request corresponds to a preset duration, and parsing the plurality of printing services in parallel according to the plurality of parsing requests stored in the sparse array includes:
and stopping analyzing each analysis request when the analysis duration of the analysis request exceeds the corresponding preset duration.
According to a third aspect of embodiments of the present disclosure, there is provided a printer comprising:
a registration module configured to register a print service through a network service discovery function of the printer;
a multicast module configured to multicast the print service;
and the execution module is configured to respond to receiving a connection request message sent by a destination end, and establish communication connection with the destination end according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination end analyzes the printing service of the printer multicast to obtain an internet protocol address and a port number of the printer.
Optionally, the registration module is specifically configured to register the printing service through a network service discovery function of the printer each time the printer is powered on.
Optionally, the printer further comprises:
and the starting module is configured to start the dynamic host configuration protocol function of the printer when the printer is powered on so as to enable the printer to be connected to a local area network.
The multicast module is specifically configured to multicast the print service to other terminal devices in the local area network.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the second aspects described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the second aspects above.
By adopting the technical scheme, at least the following technical effects can be achieved:
in the case where a printer is connected to a local area network, a print service is registered through an NSD (Network Service Discovery ) function of the printer, and the print service is multicast, so that all terminal devices within the local area network can scan the print service of the printer. When the printer receives the connection request message sent by the destination end, the printer establishes communication connection with the destination end according to the connection request message. The connection request message is sent to the printer under the condition that the destination end analyzes the print service multicast by the printer to obtain the internet protocol address and the port number of the printer. Compared with the related art, the method has the advantages that the printer is not required to poll all terminal equipment in the local area network, and through multicast printing service, all terminal equipment in the local area network can directly establish communication connection with the printer according to the analysis result of the scanned printing service, so that the efficiency of establishing communication connection between the destination terminal and the printer is improved. In addition, the printer uses NSD mode, the user does not need to bind the Internet protocol address of the printer at the destination end, so that no matter whether the Internet protocol address of the printer changes or not in the process of establishing communication connection between the destination end and the printer, the user does not need to participate in configuration, and manual operation of configuring the printer and binding the printer by the user is avoided.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
fig. 1 is a flow chart illustrating a communication setup method according to an exemplary embodiment of the present disclosure.
Fig. 2 is a flow chart illustrating another communication establishment method according to an exemplary embodiment of the present disclosure.
Fig. 3 is an overall schematic diagram illustrating a method for establishing a communication connection between a printer and a destination according to an exemplary embodiment of the present disclosure.
Fig. 4 is a block diagram of a printer according to an exemplary embodiment of the present disclosure.
Fig. 5 is a block diagram of an electronic device, according to an exemplary embodiment of the present disclosure.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
As a common device, printers play an important auxiliary role in people's daily life. For example, a job file is printed using a printer. For another example, shopping list tickets are printed using a printer, and so forth. In a shopping scenario, a merchant needs to provide a shopping receipt to a shopper. The merchant sends the shopping list to the connected printer through the cash register, and the printer prints the shopping list, so that shopping receipt credentials are provided for the shopper.
In the related art, after purchasing a thermal network printer, a merchant needs to configure the IP address of the printer before using, and after configuring the correct IP address, the printer can be accessed into the local area network for use. There are two ways to establish a communication connection with the printer, one is that in the case where the printer closes DHCP (Dynamic Host Configuration Protocol ), the merchant configures the IP address of the printer to a static IP address through software on the cash register, thereby establishing a communication connection with the printer. In the case of configuring the printer as a static IP address, the printer manual network entry configuration operation is very complicated and requires a certain knowledge reserve by the user. In addition, after the printer is configured as a static IP address, there is still a problem of IP conflict, resulting in failure to establish a connection with the printer.
Another is that in the case where the printer opens DHCP, the merchant binds the IP address of the printer to the cash register, thereby establishing a communication connection between the cash register and the printer. However, when DHCP is turned on, the IP address of the printer changes dynamically, which makes it necessary for the user to re-bind the IP address of the printer to the cash register each time the printer IP address changes. The cash register sends out inquiry at regular time, and the mode of sequentially inquiring whether each terminal device in the local area network needs the service of the terminal device can also cause the inefficiency of establishing communication connection between the terminal device and the printer.
It can be seen that these two ways of establishing a communication connection with the printer are complex to operate and are inefficient.
In view of the above, embodiments of the present disclosure provide a communication establishment method, a printer, a storage medium, and an electronic device, so as to solve the problems in the related art.
In order to make it easier for those skilled in the art to understand the technical solutions of the present disclosure, the related terms related to the embodiments of the present disclosure will be briefly explained below.
The network service discovery NSD function is used to discover application devices within the local area network that are also registered using NSD.
Multicasting refers to the implementation of a point-to-multipoint network connection between a sender and each receiver. It is understood that a special broadcasting scheme is used. In particular, it is understood that one device within a local area network broadcasts to other devices within the local area network that are in the same group as the device.
Powering up refers to powering on the electronic device.
The dynamic host configuration protocol DHCP function is a network protocol for a local area network. For automatically assigning IP addresses to internal networks or network service providers, as a means of centrally managing all computers to users or internal network administrators.
Polling (Polling), which is a way for the CPU to decide how to provide services to peripheral devices, is also known as Programmed I/O. The CPU sends out inquiry at regular time, and inquires whether each peripheral device needs the service or not in sequence, if yes, the service is given, and then the next peripheral device is inquired after the service is finished, so that the process is repeated.
The technical scheme of the present disclosure is described in detail below.
Fig. 1 is a flowchart illustrating a communication establishment method according to an exemplary embodiment of the present disclosure, which is applied to a printer, and may include the steps of:
s11, registering the printing service through the network service discovery function of the printer.
It should be noted that printers include thermal portal printers. The NSD function can be supported by the printer by performing a software upgrade on the printer, so that the printing service can be registered by the network service discovery NSD function of the printer.
When a printer registers a print service, the name and port number of the printer are registered.
An implementation manner, the registering the printing service through the NSD function of the printer may include: and registering a printing service through an NSD function of the printer every time the printer is powered on.
In another implementation manner, when the printer is powered on, a DHCP function of the printer is started to enable the printer to be connected to a lan.
Specifically, after the printer turns on DHCP, the router of the local area network dynamically assigns an IP address to the printer. When the router dynamically allocates the IP to the printer, the router is equivalent to leasing an IP address to the router, and after the lease period of the IP address is up, the router can re-allocate the IP address to the printer. It is possible that the newly allocated IP address is the same as the previously allocated IP address or may be different.
S12, multicasting the printing service.
Specifically, the print service is multicast to other terminal devices in the local area network to which the printer is connected, which are grouped together with the printer.
One implementation may multicast to network nodes within a local area network to which the printer is connected.
And S13, responding to a received connection request message sent by a destination end, and establishing communication connection with the destination end according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination end analyzes the printing service of the printer multicast to obtain the IP address and the port number of the printer.
The destination end analyzes the print service of the printer multicast, and can obtain the registered name and port number of the printer and obtain the IP address allocated to the printer by the router of the local area network connected with the printer. The destination terminal can request communication connection from the printer according to the IP address of the printer and the port number of the printer, and after the socket connection is established between the printer and the destination terminal, communication is performed. For example, the printer may receive a file to be printed sent by the destination, and the printer may execute a print instruction sent by the destination.
In this way, in the case where the printer is connected to the local area network, the printing service is registered through the NSD function of the printer, and the printing service is multicast, so that all terminal devices in the local area network can scan the printing service of the printer. When the printer receives the connection request message sent by the destination end, the printer establishes communication connection with the destination end according to the connection request message. The connection request message is sent to the printer under the condition that the destination end analyzes the print service of the printer multicast to obtain the IP address and the port number of the printer. Compared with the related art, the method has the advantages that the printer is not required to poll all terminal equipment in the local area network, and through multicast printing service, all terminal equipment in the local area network can directly establish communication connection with the printer according to the analysis result of the scanned printing service, so that the efficiency of establishing communication connection between the destination terminal and the printer is improved. In addition, the printer uses NSD mode, the user does not need to bind the IP address of the printer at the destination end, so that no matter whether the IP address of the printer changes or not in the process of establishing communication connection between the destination end and the printer, the user does not need to participate in configuration, and manual operation of configuring and binding the printer by the user is avoided.
Based on the same inventive concept, the embodiments of the present disclosure also provide another communication establishment method, applied to a destination, see fig. 2, which may include the following steps:
s21, scanning a printing service in a local area network through an NSD function, wherein the printing service is multicast to the local area network by a printer.
It should be noted that the destination terminal may be a cash register, a computer, a mobile terminal, or the like, and the disclosure is not particularly limited thereto.
S22, analyzing the scanned printing service to obtain the IP address and the port number of the printer.
Specifically, the destination end analyzes the name of the printer according to the scanned printing service, and further obtains the IP address and the port number corresponding to the name of the printer according to the name of the printer.
In a possible case, after the printing service information recorded on the destination terminal expires, the destination terminal sends a query packet to the local area network to determine whether the printing service exists, if the printing service exists, a reply packet including the printer service information is returned to the destination terminal, and the destination terminal re-analyzes to obtain the IP address and the port number of the printer. Therefore, the mode does not need to bind the IP address of the printer at the destination end again when the IP address of the printer changes, and manual operation of configuring the printer and binding the printer by a user is avoided.
S23, sending a connection request message to the printer through the IP address and the port number, wherein the connection request message is used for establishing connection communication with the printer.
After the destination end analyzes the IP address and the port number of the printer, a connection request message is sent to the printer according to the IP address and the port number so as to establish socket connection with the printer, thereby carrying out communication. After the destination end establishes communication connection with the printer, the file to be printed and the operation instruction can be sent to the printer. Such as printing shopping tickets, printing photo documents, and the like.
In this way, the destination end scans the printing service in the local area network connected by the built-in NSD function, and when the printing service is scanned, the scanned printing service is analyzed to obtain the IP address and port number of the printer providing the service. And sending a connection request message to the printer through the IP address and the port number so as to establish socket connection with the printer, thereby carrying out communication. In this way, the user does not need to bind the IP address of the printer at the destination end, so that no matter whether the IP address of the printer changes or not in the process of establishing communication connection between the destination end and the printer, the user does not need to participate in configuration, and manual operation of configuring the printer and binding the printer by the user is avoided. The efficiency of establishing communication connection between the destination end and the printer is improved.
In a possible case, when the destination end scans the printing services in the local area network through the NSD function, a plurality of printing services may be scanned. In the related art, when a destination scans a plurality of services, the plurality of services are sequentially parsed. Specifically, in the NSD protocol framework of the Android framework layer, the protocol layer framework can only execute one analysis request when analyzing services, and can only sequentially analyze the services in series when a plurality of service analysis requests are concurrent. And the next parsing request can be executed after the execution of the previous parsing request is completed. If the previous resolution request has not been executed, the previous resolution request is blocked all the time, and all the subsequent resolution requests are returned with resolution failure.
In view of this, an embodiment of the present disclosure provides an implementation manner, where the parsing the scanned print service to obtain an IP address and a port number of a printer may include: when a plurality of printing services are scanned, the printing services are analyzed in parallel, and the IP addresses and port numbers of the printers are obtained.
Optionally, the parsing request is stored in the client information structure body ClientInfo of the NSD protocol layer supporting the NSD function through a sparse array, so that the plurality of printing services are parsed in parallel according to the plurality of parsing requests stored in the sparse array.
Specifically, by modifying the NSD protocol layer, the nsdserviceeinfomresolvedservice variable in the client information structure ClientInfo is changed to a sparse array < nsdserviceeinfo > mrresolvedservice, so that when a plurality of print services are scanned, the plurality of print services are parsed in parallel according to a plurality of parsing requests stored in the sparse array.
In this way, compared with the serial analysis service, the parallel analysis method not only improves the analysis efficiency, but also can avoid the blocking problem in the serial analysis process. Specifically, a parallel print service analysis mode is adopted, and when any print service fails to analyze, analysis results of other print services are not affected. Therefore, the method can enable the destination terminal to analyze a plurality of printing services in parallel to obtain the IP addresses and port numbers of a plurality of printers when scanning the plurality of printing services on the basis of solving the NSD protocol defects. The efficiency of the destination end in analyzing the printing service is improved, and the efficiency of establishing communication connection with the printer can be improved.
Optionally, each parsing request corresponds to a preset duration, and parsing the plurality of printing services according to the plurality of parsing requests stored in the sparse array in parallel may include:
and stopping analyzing each analysis request when the analysis duration of the analysis request exceeds the corresponding preset duration.
For example, the preset duration corresponding to each parsing request may be 16 seconds. And stopping analysis when the analysis process duration corresponding to each analysis request exceeds 16 seconds for each analysis request, and returning analysis failure information to the destination terminal.
Fig. 3 is an overall schematic diagram of a method for establishing a communication connection between a printer and a destination according to an exemplary embodiment of the disclosure, where the method may further include the following steps, as shown in fig. 3:
s31, when the printer is powered on, starting a Dynamic Host Configuration Protocol (DHCP) function of the printer so as to enable the printer to be connected to a local area network;
s32, registering a printing service through a network service discovery NSD function of the printer;
s33, multicasting the printing service to other terminal equipment in the local area network;
and S34, responding to a received connection request message sent by a destination end, and establishing communication connection with the destination end according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination end analyzes the printing service of the printer multicast to obtain the IP address and the port number of the printer.
The above steps are steps executed by the printer, and the steps executed by the destination will be described below.
S35, scanning a printing service in a local area network through an NSD function, wherein the printing service is multicast to the local area network by a printer;
s36, analyzing the scanned printing service to obtain the IP address and port number of the printer;
s37, sending a connection request message to the printer through the IP address and the port number, wherein the connection request message is used for establishing connection communication with the printer.
With respect to the steps in the above embodiments, the specific implementation of each step has been described in detail in the embodiments related to the method, and will not be described in detail herein.
In this way, in the case where the printer connects to the local area network using the DHCP function, the printing service is registered through the NSD function of the printer, and the printer sets the printing service, so that all terminal devices in the local area network can scan the printing service of the printer. Compared with the related art, the method has the advantages that the printer is not required to poll all terminal equipment in the local area network, and through multicast printing service, all terminal equipment in the local area network can directly establish communication connection with the printer according to the analysis result of the scanned printing service, so that the efficiency of establishing communication connection between the destination terminal and the printer is improved. The destination terminal scans the printing service in the local area network connected by the built-in NSD function, and when the printing service is scanned, the scanned printing service is analyzed to obtain the IP address and port number of the printer providing the service. The destination terminal sends a connection request message to the printer through the IP address and the port number, and when the printer receives the connection request message sent by the destination terminal, the printer establishes communication connection with the destination terminal according to the connection request message. The printer uses NSD mode, the user does not need to bind the IP address of the printer at the destination end, so the user does not need to bind the IP address of the printer again at the destination end when the IP address of the printer changes, and the manual operation of configuring the printer and binding the printer by the user is avoided. Therefore, by adopting the technical scheme of the disclosure, the user does not need to participate in printer configuration, and zero configuration communication connection between the printer and the destination terminal is realized.
Based on the same inventive concept, the disclosed embodiments also provide a printer, referring to fig. 4, the printer 400 includes:
a registration module 401 configured to register a print service through a network service discovery NSD function of the printer;
a multicast module 402 configured to multicast the print service;
and the execution module 403 is configured to respond to receiving a connection request message sent by a destination end, and establish a communication connection with the destination end according to the connection request message, wherein the connection request message is sent to the printer under the condition that the destination end analyzes the print service of the printer multicast to obtain the IP address and the port number of the printer.
With this printer, in the case where the printer is connected to the local area network, the printing service is registered by the NSD function of the printer, and the printing service is multicast, so that all terminal devices in the local area network can scan the printing service of the printer. When the printer receives the connection request message sent by the destination end, the printer establishes communication connection with the destination end according to the connection request message. The connection request message is sent to the printer under the condition that the destination end analyzes the print service of the printer multicast to obtain the IP address and the port number of the printer. Compared with the related art, the method has the advantages that the printer is not required to poll all terminal equipment in the local area network, and through multicast printing service, all terminal equipment in the local area network can directly establish communication connection with the printer according to the analysis result of the scanned printing service, so that the efficiency of establishing communication connection between the destination terminal and the printer is improved. In addition, the printer uses NSD mode, the user does not need to bind the IP address of the printer at the destination end, so that no matter whether the IP address of the printer changes or not in the process of establishing communication connection between the destination end and the printer, the user does not need to participate in configuration, and manual operation of configuring and binding the printer by the user is avoided.
Optionally, the registration module 401 is specifically configured to register the printing service through the NSD function of the printer each time the printer is powered on.
Optionally, the printer 400 further includes:
and the starting module is configured to start a Dynamic Host Configuration Protocol (DHCP) function of the printer when the printer is powered on so as to enable the printer to be connected to a local area network.
The multicast module 402 is specifically configured to multicast the print service to other terminal devices within the local area network.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The presently disclosed embodiments also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of any of the communication establishment methods described above.
Fig. 5 is a block diagram of an electronic device 700, according to an example embodiment. As shown in fig. 5, the electronic device 700 may include: a processor 701, a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input/output (I/O) interface 704, and a communication component 705.
The processor 701 is configured to control the overall operation of the electronic device 700, so as to complete all or part of the steps in the communication establishment method of the destination. The memory 702 is used to store various types of data to support operation on the electronic device 700, which may include, for example, instructions for any application or method operating on the electronic device 700, as well as application-related data, such as contact data, messages sent and received, pictures, audio, video, and so forth. The Memory 702 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia component 703 can include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 702 or transmitted through the communication component 705. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 704 provides an interface between the processor 701 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, bluetooth, near field communication (Near Field Communication, NFC for short), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination of more of them, is not limited herein. The corresponding communication component 705 may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic device 700 may be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASIC), digital signal processor (Digital Signal Processor, abbreviated as DSP), digital signal processing device (Digital Signal Processing Device, abbreviated as DSPD), programmable logic device (Programmable Logic Device, abbreviated as PLD), field programmable gate array (Field Programmable Gate Array, abbreviated as FPGA), controller, microcontroller, microprocessor, or other electronic component for performing the above-described method of establishing communication at a destination.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the communication establishment method of the destination terminal described above. For example, the computer readable storage medium may be the memory 702 including program instructions described above, which are executable by the processor 701 of the electronic device 700 to perform the communication establishment method of the destination terminal described above.
The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the above embodiments may be combined in any suitable manner without contradiction. The various possible combinations are not described further in this disclosure in order to avoid unnecessary repetition.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.

Claims (2)

1. A communication establishment method, applied to a destination, comprising:
scanning, by a network service discovery function, a print service within a local area network, the print service being multicast by a printer into the local area network;
analyzing the scanned printing service to obtain an Internet protocol address and a port number of the printer;
sending a connection request message to the printer through the internet protocol address and the port number, wherein the connection request message is used for establishing connection communication with the printer;
the analyzing the scanned printing service to obtain the internet protocol address and the port number of the printer comprises the following steps:
when a plurality of printing services are scanned, the printing services are analyzed in parallel, and the Internet protocol addresses and port numbers of the printers are obtained;
storing the parsing request through a sparse array in a client information structure of a network service discovery protocol layer supporting a network service discovery function, and parsing the plurality of printing services in parallel includes:
and analyzing the plurality of printing services in parallel according to the plurality of analysis requests stored in the sparse array.
2. The method of claim 1, wherein each of the parsing requests corresponds to a preset duration, and wherein parsing the plurality of print services in parallel according to the plurality of parsing requests stored in the sparse array comprises:
and stopping analyzing each analysis request when the analysis duration of the analysis request exceeds the corresponding preset duration.
CN202010687574.6A 2020-07-16 2020-07-16 Communication establishment method, printer, storage medium, and electronic device Active CN111913672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010687574.6A CN111913672B (en) 2020-07-16 2020-07-16 Communication establishment method, printer, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010687574.6A CN111913672B (en) 2020-07-16 2020-07-16 Communication establishment method, printer, storage medium, and electronic device

Publications (2)

Publication Number Publication Date
CN111913672A CN111913672A (en) 2020-11-10
CN111913672B true CN111913672B (en) 2024-03-08

Family

ID=73281641

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010687574.6A Active CN111913672B (en) 2020-07-16 2020-07-16 Communication establishment method, printer, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN111913672B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014130588A (en) * 2012-12-29 2014-07-10 Ricoh Co Ltd Management of range of network service
CN104615388A (en) * 2013-11-01 2015-05-13 精工爱普生株式会社 Print control system
CN104980427A (en) * 2014-04-10 2015-10-14 帕洛阿尔托研究中心公司 System And Method For Simple Service Discovery In Content-centric Networks
CN107274597A (en) * 2017-06-16 2017-10-20 福州汇思博信息技术有限公司 POS Method of printing and its system based on LAN
CN109510912A (en) * 2017-09-14 2019-03-22 佳能株式会社 Information processing unit, its control method and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014130588A (en) * 2012-12-29 2014-07-10 Ricoh Co Ltd Management of range of network service
CN104615388A (en) * 2013-11-01 2015-05-13 精工爱普生株式会社 Print control system
CN104980427A (en) * 2014-04-10 2015-10-14 帕洛阿尔托研究中心公司 System And Method For Simple Service Discovery In Content-centric Networks
CN107274597A (en) * 2017-06-16 2017-10-20 福州汇思博信息技术有限公司 POS Method of printing and its system based on LAN
CN109510912A (en) * 2017-09-14 2019-03-22 佳能株式会社 Information processing unit, its control method and storage medium

Also Published As

Publication number Publication date
CN111913672A (en) 2020-11-10

Similar Documents

Publication Publication Date Title
KR102478442B1 (en) Method for setting pdu type, method for setting ue policy, and related entities
US20220159104A1 (en) IPv4/IPv6 BRIDGE
US8812730B2 (en) Method and apparatus for network port and network address translation
KR101102663B1 (en) System and method for auto wireless connection between mobile terminal and digital device
US8886776B2 (en) Communication apparatus and storing medium
EP2302504A2 (en) Method for printing document of mobile terminal through printer, and mobile terminal therefor
US8543674B2 (en) Configuration of routers for DHCP service requests
US20050286478A1 (en) Method and apparatus for utilizing bluetooth for WLAN service authentication and discovery
US8924519B2 (en) Automated DNS configuration with local DNS server
CN103607290A (en) Method and device for setting network connection parameters
CN112448873A (en) Equipment binding method and device and computer readable storage medium
CN104469060A (en) Network system, code providing device, terminal, and computer-readable storage mediuim for computer program
CN113098722A (en) Multi-network card management method, device and computer readable storage medium
KR20190020624A (en) Information processing apparatus, control method and recording medium
JP2018174453A (en) Computer program for terminal, and communication device
CN111913672B (en) Communication establishment method, printer, storage medium, and electronic device
US20180278516A1 (en) Information processing apparatus, communication system, and method of controlling communication route
US8516141B2 (en) Method and system for modifying and/or changing a MAC ID utilizing an IPv6 network connection
US7633926B1 (en) Extending multicast applications available on data networks to cell-based wireless networks
CN110278558B (en) Message interaction method and WLAN system
WO2017166038A1 (en) Communication method and terminal
CN115174310B (en) PDN dialing and configuration method, system, device, equipment and storage medium
JP6627975B2 (en) Virtual network system, management device, virtual network management method, and computer program
JP5915314B2 (en) Communication device
JP2014230005A (en) Image forming apparatus and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240117

Address after: 22-01, 18th Floor, Building 38 Haidian Street, Haidian District, Beijing, 100080

Applicant after: BEIJING PASSION TECHNOLOGY Co.,Ltd.

Applicant after: BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd.

Address before: 2106-030, No.9, Beisihuan West Road, Haidian District, Beijing 100190

Applicant before: BEIJING SANKUAI ONLINE TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant