CN115904279A - Printer connection method, identifier generation method, user terminal and storage medium - Google Patents

Printer connection method, identifier generation method, user terminal and storage medium Download PDF

Info

Publication number
CN115904279A
CN115904279A CN202211501053.2A CN202211501053A CN115904279A CN 115904279 A CN115904279 A CN 115904279A CN 202211501053 A CN202211501053 A CN 202211501053A CN 115904279 A CN115904279 A CN 115904279A
Authority
CN
China
Prior art keywords
printer
connection
network
address data
packet loss
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.)
Pending
Application number
CN202211501053.2A
Other languages
Chinese (zh)
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.)
SHENZHEN CULTRAVIEW DIGITAL TECHNOLOGY CO LTD
Original Assignee
SHENZHEN CULTRAVIEW DIGITAL 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 SHENZHEN CULTRAVIEW DIGITAL TECHNOLOGY CO LTD filed Critical SHENZHEN CULTRAVIEW DIGITAL TECHNOLOGY CO LTD
Priority to CN202211501053.2A priority Critical patent/CN115904279A/en
Publication of CN115904279A publication Critical patent/CN115904279A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention is suitable for the technical field of printers and provides a printer connection method, an identifier generation method, a user terminal and a storage medium, wherein the printer connection method comprises the following steps: acquiring connection data of a printer, wherein the connection data comprises at least two kinds of network address data of the printer; establishing corresponding network connection with the printer according to each kind of network address data; testing the packet loss rate of each network connection; and establishing a network connection with the printer with the lowest packet loss rate. The printer searching method and the printer searching system can save time for searching the printer, can select a more stable mode to establish network connection with the printer, effectively reduce frequency of secondary printer selection when unstable connection and other conditions occur, are simple and easy to execute, do not need to carry out excessive training on workers, and can effectively reduce training cost when an enterprise trains the workers.

Description

Printer connection method, identifier generation method, user terminal and storage medium
Technical Field
The invention belongs to the technical field of printers, and particularly relates to a printer connection method, an identifier generation method, a user terminal and a storage medium.
Background
When working in places such as warehouses, workshop factories and the like, workers need to often print labels by connecting printers, the common mode of connecting the printers is mainly to search and obtain peripheral printer equipment list information through Bluetooth or Wi-Fi and then randomly select one printer from a plurality of pieces of equipment information to connect, but a plurality of printers with the same model and appearance or similar types usually exist in the places such as warehouses, workshop factories and the like, and the printers need to be reselected to connect if the connection is unstable or the printers cannot be printed and the like after being connected with the printers, so that the process is complicated, the connected printers cannot be rapidly distinguished from the printers with the same model and appearance or similar types, and the time of the workers is wasted.
Disclosure of Invention
In view of this, embodiments of the present invention provide a printer connection method, an identifier generation method, a user terminal, and a storage medium, so as to solve a problem that connected printers cannot be quickly distinguished among printers with consistent models and appearances or similar printers in the prior art.
A first aspect of an embodiment of the present invention provides a method, applied to a first user terminal, including:
acquiring connection data of a printer, wherein the connection data comprises at least two kinds of network address data of the printer;
establishing corresponding network connection with the printer according to each kind of network address data;
testing the packet loss rate of each network connection;
and establishing a network connection with the printer with the lowest packet loss rate.
A second aspect of an embodiment of the present invention provides a method for generating a printer identifier, where the method is applied to a second user terminal, and includes:
acquiring model data of a printer;
acquiring at least two kinds of network address data;
and combining the model data and the at least two kinds of network address data to generate a unique identification code of the printer.
A third aspect of the embodiments of the present invention provides a user terminal, including a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein the processor, when executing the computer program, implements the steps of the printer connection method according to the first aspect of the embodiments of the present invention or the printer identification generation method according to the second aspect of the embodiments of the present invention.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the printer connection method according to the first aspect of embodiments of the present invention or the printer identification generation method according to the second aspect of embodiments of the present invention.
In the printer connection method provided in the first aspect of the embodiments of the present invention, connection data of a printer is obtained, where the connection data includes at least two types of network address data of the printer, and then a corresponding network connection is established with the printer according to each type of network address data, a packet loss rate of each type of network connection is tested, and finally a network connection with a lowest packet loss rate is established with the printer. The printer searching method and the printer searching system can save time for searching the printer, can select a more stable mode to establish network connection with the printer, effectively reduce frequency of secondary printer selection when unstable connection and other conditions occur, are simple and easy to execute, do not need to carry out excessive training on workers, and can effectively reduce training cost when an enterprise trains the workers.
In the method for generating a printer identifier according to the second aspect of the embodiments of the present invention, model data of a printer is acquired, at least two types of network address data are acquired, and finally, the model data and the at least two types of network address data are combined to generate a unique identifier of the printer. The model data and the address data of the printer can be rapidly and comprehensively acquired by scanning the unique identification code of the printer, and the printer connection method provided by the first aspect of the embodiment of the invention can be used for rapidly and efficiently establishing the most stable network connection with the printer.
It is to be understood that, for the beneficial effects of the third aspect to the fourth aspect, reference may be made to the description of the first aspect and the second aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a printer connection method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a printer identifier generation method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a user terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Furthermore, in the description of the present invention and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present invention. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
A printer is one of the output devices of a computer for printing the results of a computer process on an associated medium. With the rapid development of the internet, printers are developing to be light, thin, short, small, low-power, high-speed and intelligent, and among numerous novel printers, portable printers are widely applied to the fields of generation, transportation and the like due to the advantages of low price, small volume, light weight, available battery driving, convenience in carrying and the like.
In a work place such as a warehouse or a workshop factory, a plurality of printers with the same or very similar models and appearances are usually present, and workers usually need to distinguish the connected printers from the printers in time. According to the printer connection method provided by the embodiment of the invention, the connection data of the printer is obtained, the connection data comprises at least two network address data of the printer, the corresponding network connection is respectively established with the printer according to each network address data, the packet loss rate of each network connection is tested, and finally the network connection with the lowest packet loss rate is established with the printer, so that the time for searching the printer is saved, meanwhile, a more stable mode can be selected to establish the network connection with the printer, the situations of unstable connection and the like are effectively reduced, the method is simple and easy to implement, excessive training of workers is not required, and the training cost of an enterprise for training the workers is effectively reduced.
In an application, the first user terminal and the second user terminal may be any mobile device capable of performing network communication with the printer, for example, a mobile phone, a tablet computer, a wearable device (e.g., a smart band), a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), and the like. The embodiment of the present application does not set any limit to the specific type of the first user terminal and the second user terminal.
As shown in fig. 1, the printer connection method provided in the embodiment of the present invention is applied to a first user terminal, and includes the following steps S101 to S104:
step S101, obtaining connection data of a printer, wherein the connection data comprises at least two kinds of network address data of the printer, and entering step S102.
The at least two types of network address data include MAC address data and IP address data.
In application, the connection data of the printer can be obtained by scanning the unique identification code of the printer, each printer has the respective unique identification code, and the unique identification code at least comprises two kinds of network address data, namely MAC address data and IP address data.
In application, when a user selects a printer, the connection data of the printer can be temporarily stored in the first user terminal after the connection data of the printer is acquired through the first user terminal, so that the corresponding network connection with the printer can be conveniently established subsequently.
Step S102, establishing corresponding network connection with the printer according to each kind of network address data, and entering step S103.
The establishing of the corresponding network connection with the printer according to each kind of network address data respectively comprises:
establishing Bluetooth connection with the printer according to the MAC address data;
and establishing Wi-Fi connection with the printer according to the IP address data.
Step S103, testing the packet loss rate of each network connection, and entering step S104.
In application, during data transmission, part of data packets are often lost due to transmission distance or equipment failure, especially more data packets are lost when a network is congested, so before a certain network connection with a printer is determined, the packet loss rate of each network connection needs to be tested, and a network connection mode with a lower packet loss rate is selected to be connected with the printer, or another printer is selected, so that unnecessary waste of time cost is reduced.
In an Application, when testing a packet loss rate of each network connection, a Software Development Kit (SDK) needs to be called, where the SDK is a set of Development tools used by a Software engineer to build Application Software for a specific Software package, a Software framework, a hardware platform, an operating system, and the like, and may simply provide some files of an Application Programming Interface (API) for a certain Programming language, may also include complex hardware capable of communicating with a certain embedded system, and may also include example codes, supporting technical annotations, or other supporting documents for clarifying doubt points of basic reference data. An API is a calling interface that the operating system leaves to an application program, which causes the operating system to execute commands of the application program by calling the API of the operating system.
Testing the packet loss rate of each network connection, comprising: calling the SDK of the printer based on each network connection, sending a preset number of printer detailed information acquisition instructions to the printer through an interface provided by the SDK, and counting failure times of acquiring the detailed information of the printer;
and determining the packet loss rate of each network connection according to the preset times and the failure times.
In application, calling an SDK (software development kit) of the printer based on the Bluetooth connection, sending a first preset number of printer detailed information acquisition instruction to the printer through an interface provided by the SDK, and counting a first failure number of acquiring the detailed information of the printer;
and determining the packet loss rate of the Bluetooth connection according to the first preset times and the first failure times.
And the packet loss rate Y of the Bluetooth connection = first failure times/first preset times.
In application, calling an SDK (software development kit) of the printer based on the Wi-Fi connection, sending a second preset number of printer detailed information acquisition instruction to the printer through an interface provided by the SDK, and counting second failure times for acquiring the detailed information of the printer;
and determining the packet loss rate of the Wi-Fi connection according to the second preset times and the second failure times.
And the packet loss rate y of the Wi-Fi connection = second failure times/second preset times.
In application, the first preset times and the second preset times can be the same or different, and if the first preset times and the second preset times are the same, the packet loss rate of the connection mode with few failure times for acquiring detailed information of the printer is lower, and connection is more stable; if the first preset times and the second preset times are different, the packet loss rate of each connection mode is judged according to the first preset times and the second preset times which correspond to the first failure times and the second failure times when the first failure times and the second failure times of the detailed printer information are the same.
And step S104, establishing a network connection with the printer with the lowest packet loss rate.
If the packet loss rate of the Bluetooth connection is different from the packet loss rate of the Wi-Fi connection, establishing a network connection with the printer, wherein the packet loss rate of the Bluetooth connection is low;
and if the packet loss rate of the Bluetooth connection is the same as the packet loss rate of the Wi-Fi connection, establishing the Bluetooth connection with the printer.
In application, besides judging the stability of connection through the packet loss rate of each network connection, the method can also establish two network connections with the printer through repeated times, respectively test the success rates of the two network connections, and select a mode with high success rate to establish connection with the printer. Optionally, the stability of the two network connections may also be determined according to the delay time of the two connection modes when receiving data, the stability with short delay time is higher, and one mode with short delay time is selected to establish connection with the printer.
In application, correspondingly, under the condition of consistent stability, a certain connection mode can be selected according to the size of the transmitted data volume, for example, the transmitted data volume is small when a label is printed, the transmission time difference of the two connection modes during data transmission can be ignored, and the network connection with the printer through the Bluetooth can be preferentially selected in consideration of the cruising ability of the printer.
In the application, step S104 is followed by: if the established network connection is abnormal, reestablishing the network connection with the lowest packet loss rate in the rest network connections with the printer;
if reestablishment of the network connection fails, continuing to attempt to establish each network connection with the printer in the background until all network connections time out or the user manually stops establishing the network connection.
In application, if the printer only supports any one of the two connection modes of bluetooth or Wi-Fi, the first user terminal only needs to acquire address data corresponding to a certain network connection supported by the printer, and the first user terminal is directly connected with the printer through the certain connection mode supported by the printer without testing the connection stability.
In application, when the first user terminal is supported by the printer, a wireless Infrared (IrDA) communication connection may be established with the printer, where the IrDA Infrared communication is a communication method that uses Infrared to transmit information, and may transmit information such as language, text, data, and images.
In application, the first user terminal may also establish an rf2.4g wireless connection with the printer or an RF433MHz wireless connection with the printer, with the support of the printer.
When the printer connection method provided by the embodiment of the invention is used for establishing connection with a printer, a connection mode with low packet loss rate and higher stability can be automatically selected for connection, and the situations that packet loss is serious or transmission cannot be performed in the data transmission process can be effectively avoided. When the situation that the connection is unstable or even disconnected after a certain network connection is established with the printer, the connection can be automatically tried in another mode without acquiring connection data again, and the operation is simple and convenient.
In application, when a plurality of printers with the same model, consistent appearance or similar appearance and difficult distinguishing are simultaneously arranged, when the printer connection method provided by the embodiment of the invention is used for establishing connection with the printers, the printers to be connected do not need to be distinguished, so that the time of workers is saved, and the working efficiency is improved.
As shown in fig. 2, the method for generating a printer identifier according to the embodiment of the present invention, applied to a second user terminal, includes the following steps S201 to S203:
in step S201, model data of the printer is acquired, and the process advances to step S202.
In application, when the model data of the printer is acquired, the model data can be acquired through a specification corresponding to the printer, or can be acquired directly on a printer body.
In application, when printers with different models are connected with a user terminal through a network, a corresponding SDK is selected according to the models of the printers, and the network connection is established with the printers through an interface method provided by the SDK; after the printers with different models are connected with the user terminal through the network, the SDKs called when the packet loss rate is tested may be the same or different, so that model data of the printers need to be obtained before the printers are connected with the network, and the SDKs corresponding to the printers with the models are called according to the model data.
Step S202, at least two kinds of network address data are acquired, and the process proceeds to step S203.
In application, at least two kinds of network address data are acquired, including: acquiring MAC address data required by Bluetooth connection;
and acquiring IP address data required by the Wi-Fi connection.
In an application, the acquiring MAC address data required for the bluetooth connection includes: connecting the printer through Bluetooth to acquire MAC address data of the printer;
the acquiring of the IP address data required by the Wi-Fi connection comprises the following steps: connecting the printer with Wi-Fi, distributing a fixed static IP address to the printer in a router, and acquiring IP address data of the printer.
And S203, combining the model data and the at least two kinds of network address data to generate the unique identification code of the printer.
In application, if the printer only supports any one of the two connection modes of bluetooth or Wi-Fi, the second user terminal only needs to acquire address data corresponding to a certain network connection supported by the printer and model data of the printer, combine the acquired printer model data and the address data corresponding to the certain network connection supported by the printer, and generate the unique identification code of the printer. After the unique identification code of the printer is obtained by the printer identification generation method provided by the embodiment of the invention, the unique identification code can be placed on the printer, and the unique identification code can be directly scanned for connection when the printer needs to be connected next time, so that the time for selecting the printer every time is saved, and the working efficiency of workers can be improved.
In application, if the printer further supports other connection modes except for the bluetooth connection and the Wi-Fi connection mode, such as an IrDA infrared communication connection, an rf2.4g wireless connection, or an RF433MHz wireless connection, the second user terminal may obtain connection data corresponding to the wireless connection supported by the printer and model data of the printer, combine the obtained printer model data and the connection data corresponding to the connection supported by the printer, and generate the unique identification code of the printer.
As shown in fig. 3, an embodiment of the present application further provides a user terminal 300, including: at least one processor 301 (only one processor is shown in fig. 3), a memory 302, and a computer program 303 stored in the memory 302 and executable on the at least one processor 301, the steps of the printer connection method or the printer identification generation method described above being implemented when the processor 301 executes the computer program 303.
In an application, the user terminal may include, but is not limited to, a memory, a processor. Those skilled in the art will appreciate that fig. 3 is merely an example of a user terminal and is not meant to be limiting, and may include more or less components than those shown, or some components in combination, or different components, for example, input/output devices, network access devices, etc. The input and output devices may include cameras, audio capture/playback devices, display devices, keyboards, keys, etc. The network access device may include a communication module for communicating with other devices. The processor is connected with the main optical detector, the standby optical detector, the plurality of uplink optical detection units and the plurality of downlink optical detection units in the fronthaul semi-active wavelength division system, so as to obtain the optical power of the corresponding optical path according to the electrical signals output by the components after the optical signals are subjected to photoelectric conversion.
In Application, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, a discrete hardware component, and the like. The general purpose processor may be a microprocessor or any conventional processor or the like.
In an application, the storage may be an internal storage unit of the user terminal in some embodiments, for example, a hard disk or a memory of the user terminal. The memory may also be an external storage device of the user terminal in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the user terminal. Further, the memory may also include both an internal storage unit of the user terminal and an external storage device. The memory is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of computer programs. The memory may also be used to temporarily store data that has been output or is to be output.
In an application, the user terminal may further include any Communication module capable of performing wired or Wireless Communication with other devices directly or indirectly, for example, the Communication module may provide a solution applied to the network device, including a Communication interface (e.g., universal Serial Bus (USB), a wired Local Area Network (LAN), a Wireless Local Area Network (WLAN) (e.g., wi-Fi network), bluetooth, zigbee, mobile Communication network, global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (Near Field Communication), infrared (Infrared, IR), and the like.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units is merely illustrated, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to perform all or part of the above described functions. Each functional unit in the embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the application. For the specific working process of the units in the system, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the printer connection method or the printer identifier generation method may be implemented.
The embodiment of the present application provides a computer program product, which when running on a user terminal, enables the user terminal to implement the steps of the printer connection method or the printer identifier generation method when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to an apparatus/terminal device, recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed user terminal and method may be implemented in other ways. For example, the above-described embodiments of the ue are merely illustrative, and for example, the division of a module or a unit is only one logical division, and there may be other divisions when the ue is actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A printer connection method applied to a first user terminal includes:
acquiring connection data of a printer, wherein the connection data comprises at least two kinds of network address data of the printer;
establishing corresponding network connection with the printer according to each kind of network address data;
testing the packet loss rate of each network connection;
and establishing a network connection with the printer with the lowest packet loss rate.
2. The printer connection method according to claim 1, wherein the at least two kinds of network address data include MAC address data and IP address data;
the establishing of the corresponding network connection with the printer according to each kind of network address data respectively comprises:
establishing Bluetooth connection with the printer according to the MAC address data;
and establishing Wi-Fi connection with the printer according to the IP address data.
3. The printer connection method of claim 2, wherein testing the packet loss rate of each network connection comprises:
calling an SDK (software development kit) of the printer based on each network connection, sending a printer detailed information acquisition instruction with preset times to the printer through an interface provided by the SDK, and counting failure times for acquiring the detailed information of the printer;
and determining the packet loss rate of each network connection according to the preset times and the failure times.
4. The printer connection method according to claim 2, wherein said establishing a network connection with the printer that selects the network connection with the lowest packet loss rate comprises:
if the packet loss rate of the Bluetooth connection is different from the packet loss rate of the Wi-Fi connection, establishing a network connection with the printer, wherein the packet loss rate of the Bluetooth connection is low;
and if the packet loss rate of the Bluetooth connection is the same as the packet loss rate of the Wi-Fi connection, establishing the Bluetooth connection with the printer.
5. The printer connection method according to claim 1, wherein after establishing a network connection with the printer having a lowest packet loss rate, the method comprises:
if the established network connection is abnormal, reestablishing the network connection with the lowest packet loss rate in the rest network connections with the printer;
if reestablishing the network connection fails, then continuing to attempt to establish each network connection with the printer in the background until all network connections time out or the user manually stops establishing network connections.
6. A printer identifier generation method applied to a second user terminal includes:
acquiring model data of a printer;
acquiring at least two kinds of network address data;
and combining the model data and the at least two kinds of network address data to generate a unique identification code of the printer.
7. The printer identification generation method of claim 6, wherein acquiring at least two types of network address data comprises:
acquiring MAC address data required by Bluetooth connection;
and acquiring IP address data required by the Wi-Fi connection.
8. The printer identification generation method according to claim 7, wherein said acquiring MAC address data required for bluetooth connection includes:
connecting the printer through Bluetooth to acquire MAC address data of the printer;
the acquiring of the IP address data required by the Wi-Fi connection comprises the following steps:
connecting the printer with Wi-Fi, distributing a fixed static IP address to the printer in a router, and acquiring IP address data of the printer.
9. A user terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the printer connection method of any one of claims 1 to 5 or the printer identification generation method of any one of claims 6 to 8 when executing the computer program.
10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the printer connection method of any one of claims 1 to 5 or the printer identification generation method of any one of claims 6 to 8.
CN202211501053.2A 2022-11-28 2022-11-28 Printer connection method, identifier generation method, user terminal and storage medium Pending CN115904279A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211501053.2A CN115904279A (en) 2022-11-28 2022-11-28 Printer connection method, identifier generation method, user terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211501053.2A CN115904279A (en) 2022-11-28 2022-11-28 Printer connection method, identifier generation method, user terminal and storage medium

Publications (1)

Publication Number Publication Date
CN115904279A true CN115904279A (en) 2023-04-04

Family

ID=86474396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211501053.2A Pending CN115904279A (en) 2022-11-28 2022-11-28 Printer connection method, identifier generation method, user terminal and storage medium

Country Status (1)

Country Link
CN (1) CN115904279A (en)

Similar Documents

Publication Publication Date Title
US8059032B2 (en) Positioning control device and positioning control method
US11845451B2 (en) Automobile diagnostic method, apparatus, device and system, and diagnostic connection device
CN103068070A (en) Negotiation method, mobile terminal, base station and communication system of protocol version
CN105139641A (en) WiFi relay station-based vehicle scheduling method and system
CN104955095A (en) Communication network detection method and communication network detection device
CN104517086A (en) Identity card information reading method
EP4216655A1 (en) Probe request method and apparatus for multi-link communication
US8023894B2 (en) Mobile communication station, base station apparatus, and dedicated-short-range-communications system
EP2905938B1 (en) Method for acquiring locating information, terminal and mobile broadband interface model (mbim) device
WO2017128538A1 (en) Network search control method and device
CN204791080U (en) Terminal and system of patrolling and examining patrol and examine
CN102340539A (en) Communication control device, communication control system, communication control method, and program
US20050157333A1 (en) Printing apparatus and method of outputting wireless network searching results
CN115904279A (en) Printer connection method, identifier generation method, user terminal and storage medium
CN210006026U (en) Cloud technology service system
US20200126147A1 (en) Order prompting method and device
CN103475670A (en) Data transmission method, device and system
CN111542033A (en) Near-field data transmission method and device and computer readable storage medium
WO2012043899A1 (en) Vehicle-specific application store service system and method thereof
CN1331036C (en) Method for data storage by a mobile terminal and mobile terminal storage device
JP2005045654A (en) System for searching for radio network path
CN111277982B (en) Face retrieval method and system for reducing IOT platform server consumption
CN115729585A (en) Software upgrading method, device, equipment and readable storage medium
CN113542360A (en) Information association method, association device, electronic equipment and readable storage medium
CN104618872A (en) Information processing method

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