CN117290222A - Printer-based testing method and device, terminal equipment and storage medium - Google Patents

Printer-based testing method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN117290222A
CN117290222A CN202311252769.8A CN202311252769A CN117290222A CN 117290222 A CN117290222 A CN 117290222A CN 202311252769 A CN202311252769 A CN 202311252769A CN 117290222 A CN117290222 A CN 117290222A
Authority
CN
China
Prior art keywords
printer
result
query
data
test
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
CN202311252769.8A
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.)
Zhuhai Seal Interest Technology Co Ltd
Original Assignee
Zhuhai Seal Interest 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 Zhuhai Seal Interest Technology Co Ltd filed Critical Zhuhai Seal Interest Technology Co Ltd
Priority to CN202311252769.8A priority Critical patent/CN117290222A/en
Publication of CN117290222A publication Critical patent/CN117290222A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The embodiment of the invention provides a testing method and device based on a printer, terminal equipment and a storage medium, and belongs to the technical field of printers. The method comprises the following steps: establishing a data communication connection with a printer; sending a communication instruction to a printer according to the data communication connection to obtain a corresponding communication result; determining a communication state with the printer according to the communication result; when the communication state meets the preset state, sending query data to the printer according to the data communication connection to obtain a query result corresponding to the query data; and determining the test result of the printer according to the query result. The problem that in the prior art, the whole testing process is relatively complicated and is not beneficial to an assembler to quickly find problems, locate the problems and quickly trace the after-sale problems according to a manual testing mode and according to a testing flow, so that the delivery speed of the printer is reduced and the user experience is influenced is solved. The test efficiency is improved.

Description

Printer-based testing method and device, terminal equipment and storage medium
Technical Field
The present invention relates to the field of printers, and in particular, to a testing method, device, terminal device, and storage medium based on a printer.
Background
The printer is used as a direct output device of a computer, has very wide application, and is a powerful tool for people to work by using the computer from common office documents to professional graphic and image output.
After the printer is produced and assembled in a workshop, various parts of the printer need to be tested, such as whether the printer is assembled qualified, whether the Bluetooth of the printer can be normally connected, whether the printing effect reaches the inspection standard, and the like. Therefore, after systematic testing is carried out on the printer, whether the printer meets the factory requirement is judged according to the test result.
In the prior art, the printer is mainly tested according to a manual testing mode and a testing flow, the whole testing process is relatively complicated, the problem can be quickly found by an assembler, the problem can be positioned, the after-sale problem can be quickly traced, the delivery speed of the printer can be reduced, and the user experience can be influenced.
Disclosure of Invention
The invention mainly aims to provide a testing method, a device, a terminal device and a storage medium based on a printer, and aims to solve the problems that in the prior art, the testing is mainly carried out according to a manual testing mode and a testing flow, the whole testing process is relatively complicated, assembly staff can not easily find problems and locate problems and quickly trace after-sale problems, the delivery speed of the printer is reduced, and the user experience is affected.
In a first aspect, an embodiment of the present invention provides a method for testing a printer, including:
establishing a data communication connection with a printer;
sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result;
determining a communication state with the printer according to the communication result;
when the communication state meets a preset state, sending query data to the printer according to the data communication connection to obtain a query result corresponding to the query data;
and determining the test result of the printer according to the query result.
In a second aspect, an embodiment of the present invention provides a test apparatus based on a printer, including:
the communication connection module is used for establishing data communication connection with the printer;
the communication test module is used for sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result;
the state judging module is used for determining the communication state with the printer according to the communication result;
the data testing module is used for sending query data to the printer according to the data communication connection when the communication state meets a preset state, and obtaining a query result corresponding to the query data;
and the test analysis module is used for determining the test result of the printer according to the query result.
In a third aspect, embodiments of the present invention further provide a terminal device, the terminal device comprising a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for enabling a connection communication between the processor and the memory, wherein the computer program, when executed by the processor, implements the steps of any of the printer-based test methods as provided in the present specification.
In a fourth aspect, embodiments of the present invention further provide a storage medium for computer readable storage, wherein the storage medium stores one or more programs executable by one or more processors to implement steps of any of the printer-based testing methods as provided in the present specification.
The embodiment of the invention provides a testing method, a testing device, terminal equipment and a storage medium based on a printer, wherein the method comprises the steps of establishing data communication connection with the printer; sending a communication instruction to a printer according to the data communication connection to obtain a corresponding communication result; determining a communication state with the printer according to the communication result; when the communication state meets the preset state, sending query data to the printer according to the data communication connection to obtain a query result corresponding to the query data; and determining the test result of the printer according to the query result. The problem that the whole testing process is relatively complicated, so that an assembler is not beneficial to quickly finding and positioning problems and tracing after-sale problems, the delivery speed of a printer is reduced, and the user experience is influenced is solved. And the testing efficiency is improved, and the problem can be quickly positioned, so that the production efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a testing method based on a printer according to an embodiment of the present invention;
FIG. 2 is a flow chart of sub-step S105 of the printer-based test method of FIG. 1;
FIG. 3 is a schematic diagram of a scenario in which the printer-based testing method according to the present embodiment is implemented;
fig. 4 is a schematic block diagram of a testing device based on a printer according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The embodiment of the invention provides a testing method and device based on a printer, terminal equipment and a storage medium. The printer-based testing method can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as tablet computers, notebook computers, desktop computers, personal digital assistants, wearable equipment and the like. The terminal device may be a server or a server cluster.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flow chart of a testing method based on a printer according to an embodiment of the invention.
As shown in fig. 1, the printer-based test method includes steps S101 to S105.
Step S101, establishing a data communication connection with the printer.
Illustratively, a data communication connection is established with the printer via the printer data line, whereby the test instructions are sent to the printer via the data communication connection.
In some embodiments, the establishing a data communication connection with a printer includes: judging whether a printer is accessed, if so, acquiring the equipment standard value of the accessed printer; judging whether the acquired device standard value is consistent with a pre-stored device standard value, if so, traversing USB device information in the set through the retrieved management object set, acquiring an ID of a printer, and acquiring a corresponding usbpath according to the ID of the printer; and automatically identifying information of the printer according to the usb path, and creating data communication connection with the printer.
The printer connection information can be obtained if the printer data line is normal after the printer data line is connected with the printer, and the printer cannot be connected with the printer if the printer data line is abnormal, namely the printer cannot be accessed.
Illustratively, when the printer is accessed, the device standard value ClassGUID of the accessed printer is obtained, and the device standard value refers to the unique identification corresponding to the USB device. Judging whether the obtained ClassGUID is consistent with the pre-stored ClassGUID. When the obtained ClassGUID is consistent with the pre-stored ClassGUID, traversing the USB device information in the collection through the ManagementObjectcollection collection of the management object retrieved by the WMI, obtaining the USB device ID, and obtaining a corresponding USB path according to the USB device ID. And the program automatically identifies printer information according to the USB path, creates data communication connection and realizes data communication connection with a printer in a USB mode.
Step S102, sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result.
The communication command is sent to the printer through the communication channel corresponding to the data communication connection, so as to obtain a corresponding communication result, and whether the data communication connection can normally communicate is judged according to the communication result.
In some embodiments, before the sending query data to the printer according to the data communication connection and obtaining the query result corresponding to the query data, the method further includes: and sending an inquiry identification instruction to the printer according to the data communication connection to obtain a target identification code corresponding to the printer, wherein the target identification code is used for representing unique identity information of the printer.
The data communication connection is exemplified as USB communication, and further, a query identification instruction is sent to the printer by utilizing the USB communication, and a target identification code SN code corresponding to the printer is obtained according to the query identification instruction to distinguish machine types. Wherein the target identification code is used to characterize the unique identity information of the printer, i.e. the target identification code is the unique identity of the printer.
And step 103, determining the communication state with the printer according to the communication result.
The method includes the steps of determining whether a communication state with the printer is normal or not, namely, whether information interaction with the printer can be performed in a data communication connection mode according to a communication result, so that support is provided for subsequent printer tests.
Step S104, when the communication state meets a preset state, query data are sent to the printer according to the data communication connection, and a query result corresponding to the query data is obtained.
When the communication state is a normal communication state, query data is sent to the printer according to the data communication connection, and a query result corresponding to the query data fed back by the printer is received.
For example, the current paper state of the printer is sent to the printer through the data communication connection, and then the query result of the paper state of the printer is obtained.
For example, the query data is sent to the printer according to the data communication connection to return a result for the high temperature state of the printer, so that whether the temperature resistance of the printer is normal is judged according to the query result.
In some embodiments, the query data includes at least one or more of a wireless communication address, a power, a firmware version, a paper status, an uncapped status.
Illustratively, the query data includes at least one or more of a wireless communication address, an amount of power, a firmware version, a paper status, an uncapped status.
For example, the query data may be sent to the printer multiple times, and then a query result corresponding to the query data is obtained. And the printer can also be inquired with a plurality of pieces of data at one time, so that the inquiry result corresponding to each inquiry data is obtained.
Step S105, determining the test result of the printer according to the query result.
Illustratively, query data of the printer is determined according to the query result, so that a test result of the printer is obtained according to the query result.
In some embodiments, the determining the test result of the printer according to the query result, specifically referring to fig. 2, step S105 includes: substep S1051 to substep S1054.
And step S1051, determining a first test result corresponding to the paper sensor corresponding to the printer according to the first query result corresponding to the paper state.
When the query data is in the paper state, a first test result corresponding to the paper sensor corresponding to the printer is determined according to a first query result corresponding to the paper state, and whether the paper sensor of the printer is normal is further determined according to the paper state.
And step S1052, determining a second test result corresponding to the cover opening sensor corresponding to the printer according to the second query result corresponding to the cover opening state.
When the query data is in the uncapping state, a second test result corresponding to the uncapping sensor corresponding to the printer is determined according to the second query result corresponding to the uncapping state, and whether the uncapping sensor of the printer is normal is further determined according to the uncapping state.
And step S1053, determining a third test result corresponding to the wireless communication module corresponding to the printer according to the third query result corresponding to the wireless communication address.
When the query data is a wireless communication address, whether the wireless communication module corresponding to the printer can work normally is determined by whether the wireless communication address can be connected with the printer, so that a third test result is obtained.
For example, if the inquiry data is a bluetooth address, whether bluetooth connection with the printer can be established through the bluetooth address is determined, so that whether the bluetooth module corresponding to the printer can work normally is determined, and a third test result is obtained.
In some embodiments, the determining, according to the third query result corresponding to the wireless communication address, a third test result corresponding to the wireless communication module corresponding to the printer includes: establishing wireless communication connection with the printer according to the wireless communication address; sending a test command to the printer through the wireless communication connection, and receiving a third query result corresponding to the test command; and comparing the third query result with a preset query result to determine a third test result corresponding to the wireless communication module corresponding to the printer.
Illustratively, a wireless communication connection is established with a wireless communication module corresponding to the printer according to the wireless communication address, and a test command is sent to the printer through the wireless communication connection. If the printer can normally receive the test command and execute the command, determining that the wireless communication module of the printer is normal; if the printer cannot normally receive the test command or cannot execute the corresponding command, determining that the wireless communication module of the printer is abnormal, and further determining a third test result corresponding to the wireless communication module corresponding to the printer.
For example, the bluetooth address of the printer is obtained, a data communication connection is established between the bluetooth address and the bluetooth module of the printer, and a test command is issued through the data communication connection, so that whether the bluetooth module of the printer is normal or not is tested.
The wireless communication module of the printer is indicated to be normal when the comparison result is consistent. And when the comparison results are inconsistent, indicating that the wireless communication module of the printer is abnormal.
Substep S1054, determining a test result of the printer according to the first test result, the second test result, and the third test result.
Illustratively, the test result of the printer is determined from the first test result, the second test result, and the third test result.
For example, when the first test result is normal, the paper sensor of the printer is indicated to be normal, the test is passed, otherwise, the paper sensor of the printer is indicated to be abnormal, and maintenance is needed. And when the second test result is normal, the cover opening sensor of the printer is normal, the test is passed, and otherwise, the cover opening sensor of the printer is abnormal and maintenance is needed. And when the third test result is normal, the wireless communication module of the printer is normal, and the test is passed, otherwise, the wireless communication module of the printer is abnormal, and maintenance is needed.
For example, the first test result, the second test result and the third test result are output according to the form of the table, so that a worker can clearly obtain the condition of the printer, and further, the component to be overhauled can be rapidly positioned.
In some embodiments, before the determining the test result of the printer according to the query result, the method further includes: determining a target model corresponding to the printer according to the target identification code; determining corresponding test sample data according to the target model, and sending the test sample data to the printer for printing to obtain an output result; and determining the printing state of the printer according to the output result.
The target model corresponding to the printer is determined according to the target identification code, and test sample data corresponding to the target model is sent to the printer through the target model, so that the printer prints; and judging whether the printing head of the printer is normal or not and whether the printing head reaches the qualified delivery standard or not according to the output result of the printer, thereby determining the printing state of the printer.
For example, a target model corresponding to the printer is determined according to the model flag bit in the target identification code, and then test sample data matched with the target model is obtained from the mapping table, so that a command for printing the test sample data is issued to the printer.
Referring to fig. 3, fig. 3 is a schematic diagram of a scenario for implementing the testing method based on a printer provided in this embodiment, as shown in fig. 3, a data communication connection is established between the printer and the printer through the USB, a communication command is sent to the printer through the data communication connection, a corresponding communication result is obtained, whether the USB communication of the printer is normal is judged through the communication result, when the USB communication of the printer is normal, query data of a paper state is sent to the printer according to the data communication connection, a first testing result corresponding to the paper sensor corresponding to the printer is obtained according to the first query result, query data of a cover opening state is sent to the printer according to the data communication connection, and a second testing result corresponding to the cover opening sensor corresponding to the printer is obtained according to the second query result; according to the wireless communication address and the printer, wireless communication connection is established, a test command is sent to the printer through the wireless communication connection, a third query result corresponding to the test command is received, the third query result is compared with a preset query result, a third test result corresponding to the wireless communication module corresponding to the printer is determined, and then the test result of the printer is determined according to the first test result, the second test result and the third test result. In addition, a query identification instruction can be sent to the printer according to the data communication connection to obtain a target identification code corresponding to the printer, a target model corresponding to the printer is determined according to the target identification code, corresponding test sample data is determined according to the target model, and the test sample data is sent to the printer to be printed to obtain an output result; and then determining the printing state of the printer according to the output result, and taking the printing state as one of the test results of the printer. And then solved among the prior art mainly according to the mode of manual test, test according to the test procedure, whole test procedure is loaded down with trivial details relatively, is unfavorable for the assembler to discover problem, location problem fast and trace to the source to the problem after sale, has reduced the speed of leaving the factory of printer, influences user experience's problem. Through the display of test results, the operator can quickly and clearly know the information of the inspection condition of the used printer, so that the test efficiency is improved, the problem can be quickly positioned, and the production efficiency is further improved.
Referring to fig. 4, fig. 4 is a schematic diagram of a printer-based testing device 200 according to an embodiment of the present application, where the printer-based testing device 200 includes a communication connection module 201, a communication testing module 202, a status judging module 203, a data testing module 204, and a testing analysis module 205, where the communication connection module 201 is configured to establish a data communication connection with a printer; the communication test module 202 is configured to send a communication instruction to the printer according to the data communication connection, so as to obtain a corresponding communication result; a state judging module 203, configured to determine a communication state with the printer according to the communication result; the data testing module 204 is configured to send query data to the printer according to the data communication connection when the communication state meets a preset state, so as to obtain a query result corresponding to the query data; and the test analysis module 205 is configured to determine a test result of the printer according to the query result.
In some embodiments, the communication connection module 201 performs, in the process of establishing the data communication connection with the printer:
judging whether a printer is accessed, if so, acquiring the equipment standard value of the accessed printer;
judging whether the acquired device standard value is consistent with a pre-stored device standard value, if so, traversing USB device information in the set through the retrieved management object set, acquiring an ID of a printer, and acquiring a corresponding usbpath according to the ID of the printer;
and automatically identifying information of the printer according to the usb path, and creating data communication connection with the printer.
In some embodiments, the data testing module 205 further performs, in a process before sending query data to the printer according to the data communication connection and obtaining a query result corresponding to the query data:
and sending an inquiry identification instruction to the printer according to the data communication connection to obtain a target identification code corresponding to the printer, wherein the target identification code is used for representing unique identity information of the printer.
In some embodiments, the query data includes at least one or more of a wireless communication address, a power, a firmware version, a paper status, an uncapped status.
In some embodiments, the test analysis module 205 performs, in the determining the test result of the printer according to the query result:
determining a first test result corresponding to a paper sensor corresponding to the printer according to a first query result corresponding to the paper state;
determining a second test result corresponding to the cover opening sensor corresponding to the printer according to a second query result corresponding to the cover opening state;
determining a third test result corresponding to the wireless communication module corresponding to the printer according to a third query result corresponding to the wireless communication address;
and determining the test result of the printer according to the first test result, the second test result and the third test result.
In some embodiments, the test analysis module 205 performs, in determining, according to the third query result corresponding to the wireless communication address, a third test result corresponding to the wireless communication module corresponding to the printer:
establishing wireless communication connection with the printer according to the wireless communication address;
sending a test command to the printer through the wireless communication connection, and receiving a third query result corresponding to the test command;
and comparing the third query result with a preset query result to determine a third test result corresponding to the wireless communication module corresponding to the printer.
In some embodiments, the test analysis module 205 further performs, in the process before determining the test result of the printer from the query result:
determining a target model corresponding to the printer according to the target identification code;
determining corresponding test sample data according to the target model, and sending the test sample data to the printer for printing to obtain an output result;
and determining the printing state of the printer according to the output result.
In some embodiments, the printer-based test apparatus 200 is applied to a terminal device.
It should be noted that, for convenience and brevity of description, specific working procedures of the above-described testing device based on the printer may refer to corresponding procedures in the foregoing embodiment of the testing method based on the printer, which is not described herein again.
Referring to fig. 5, fig. 5 is a schematic block diagram of a structure of a terminal device according to an embodiment of the present invention.
As shown in fig. 5, the terminal device 300 includes a processor 301 and a memory 302, the processor 301 and the memory 302 being connected by a bus 303, such as an I2C (Inter-integrated Circuit) bus.
In particular, the processor 301 is used to provide computing and control capabilities, supporting the operation of the entire terminal device. The processor 301 may be a central processing unit (Central Processing Unit, CPU), the processor 301 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Specifically, the Memory 302 may be a Flash chip, a Read-Only Memory (ROM) disk, an optical disk, a U-disk, a removable hard disk, or the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 5 is merely a block diagram of a portion of the structure related to the embodiment of the present invention, and does not constitute a limitation of the terminal device to which the embodiment of the present invention is applied, and that a specific server may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The processor is used for running a computer program stored in the memory, and implementing any one of the printer-based testing methods provided by the embodiment of the invention when the computer program is executed.
In an embodiment, the processor is configured to run a computer program stored in a memory and to implement the following steps when executing the computer program:
establishing a data communication connection with a printer;
sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result;
determining a communication state with the printer according to the communication result;
when the communication state meets a preset state, sending query data to the printer according to the data communication connection to obtain a query result corresponding to the query data;
and determining the test result of the printer according to the query result.
In some embodiments, the processor 301 performs, during the establishing of the data communication connection with the printer:
judging whether a printer is accessed, if so, acquiring the equipment standard value of the accessed printer;
judging whether the acquired device standard value is consistent with a pre-stored device standard value, if so, traversing USB device information in the set through the retrieved management object set, acquiring an ID of a printer, and acquiring a corresponding usbpath according to the ID of the printer;
and automatically identifying information of the printer according to the usb path, and creating data communication connection with the printer.
In some embodiments, before sending query data to the printer according to the data communication connection and obtaining a query result corresponding to the query data, the processor 301 further performs:
and sending an inquiry identification instruction to the printer according to the data communication connection to obtain a target identification code corresponding to the printer, wherein the target identification code is used for representing unique identity information of the printer.
In some embodiments, the query data includes at least one or more of a wireless communication address, a power, a firmware version, a paper status, an uncapped status.
In some embodiments, the processor 301 performs, in determining the test result of the printer according to the query result:
determining a first test result corresponding to a paper sensor corresponding to the printer according to a first query result corresponding to the paper state;
determining a second test result corresponding to the cover opening sensor corresponding to the printer according to a second query result corresponding to the cover opening state;
determining a third test result corresponding to the wireless communication module corresponding to the printer according to a third query result corresponding to the wireless communication address;
and determining the test result of the printer according to the first test result, the second test result and the third test result.
In some embodiments, the processor 301 performs, in determining, according to the third query result corresponding to the wireless communication address, a third test result corresponding to the wireless communication module corresponding to the printer:
establishing wireless communication connection with the printer according to the wireless communication address;
sending a test command to the printer through the wireless communication connection, and receiving a third query result corresponding to the test command;
and comparing the third query result with a preset query result to determine a third test result corresponding to the wireless communication module corresponding to the printer.
In some implementations, the processor 301 further performs, before determining the test result of the printer from the query result:
determining a target model corresponding to the printer according to the target identification code;
determining corresponding test sample data according to the target model, and sending the test sample data to the printer for printing to obtain an output result;
and determining the printing state of the printer according to the output result.
It should be noted that, for convenience and brevity of description, specific working processes of the terminal device described above may refer to corresponding processes in the foregoing embodiment of the printer-based testing method, and will not be described in detail herein.
Embodiments of the present invention also provide a storage medium for computer-readable storage storing one or more programs executable by one or more processors to implement the steps of any of the printer-based testing methods provided in the embodiments of the present invention.
The storage medium may be an internal storage unit of the terminal device according to the foregoing embodiment, for example, a hard disk or a memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the terminal device.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, functional modules/units in the apparatus, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware embodiment, the division between the functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed cooperatively by several physical components. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
It should be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (10)

1. A printer-based testing method, characterized by being applied to a terminal device, the method comprising:
establishing a data communication connection with a printer;
sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result;
determining a communication state with the printer according to the communication result;
when the communication state meets a preset state, sending query data to the printer according to the data communication connection to obtain a query result corresponding to the query data;
and determining the test result of the printer according to the query result.
2. The method of claim 1, wherein the establishing a data communication connection with the printer comprises:
judging whether a printer is accessed, if so, acquiring the equipment standard value of the accessed printer;
judging whether the acquired device standard value is consistent with a pre-stored device standard value, if so, traversing USB device information in the set through the retrieved management object set, acquiring an ID of a printer, and acquiring a corresponding usbpath according to the ID of the printer;
and automatically identifying information of the printer according to the usb path, and creating data communication connection with the printer.
3. The method of claim 1, wherein the sending query data to the printer according to the data communication connection, before obtaining the query result corresponding to the query data, further comprises:
and sending an inquiry identification instruction to the printer according to the data communication connection to obtain a target identification code corresponding to the printer, wherein the target identification code is used for representing unique identity information of the printer.
4. The method of claim 1, wherein the query data includes at least one or more of a wireless communication address, a power level, a firmware version, a paper status, an uncapped status.
5. The method of claim 4, wherein determining the test result of the printer based on the query result comprises:
determining a first test result corresponding to a paper sensor corresponding to the printer according to a first query result corresponding to the paper state;
determining a second test result corresponding to the cover opening sensor corresponding to the printer according to a second query result corresponding to the cover opening state;
determining a third test result corresponding to the wireless communication module corresponding to the printer according to a third query result corresponding to the wireless communication address;
and determining the test result of the printer according to the first test result, the second test result and the third test result.
6. The method of claim 5, wherein the determining a third test result corresponding to the wireless communication module corresponding to the printer according to the third query result corresponding to the wireless communication address comprises:
establishing wireless communication connection with the printer according to the wireless communication address;
sending a test command to the printer through the wireless communication connection, and receiving a third query result corresponding to the test command;
and comparing the third query result with a preset query result to determine a third test result corresponding to the wireless communication module corresponding to the printer.
7. A method according to claim 3, wherein prior to said determining the test results of the printer from the query results, the method further comprises:
determining a target model corresponding to the printer according to the target identification code;
determining corresponding test sample data according to the target model, and sending the test sample data to the printer for printing to obtain an output result;
and determining the printing state of the printer according to the output result.
8. A printer-based testing apparatus, comprising:
the communication connection module is used for establishing data communication connection with the printer;
the communication test module is used for sending a communication instruction to the printer according to the data communication connection to obtain a corresponding communication result;
the state judging module is used for determining the communication state with the printer according to the communication result;
the data testing module is used for sending query data to the printer according to the data communication connection when the communication state meets a preset state, and obtaining a query result corresponding to the query data;
and the test analysis module is used for determining the test result of the printer according to the query result.
9. A terminal device, characterized in that the terminal device comprises a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and to implement the printer-based test method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, which when executed by one or more processors causes the one or more processors to perform the printer-based test method steps of any of claims 1 to 7.
CN202311252769.8A 2023-09-26 2023-09-26 Printer-based testing method and device, terminal equipment and storage medium Pending CN117290222A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311252769.8A CN117290222A (en) 2023-09-26 2023-09-26 Printer-based testing method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311252769.8A CN117290222A (en) 2023-09-26 2023-09-26 Printer-based testing method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117290222A true CN117290222A (en) 2023-12-26

Family

ID=89258208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311252769.8A Pending CN117290222A (en) 2023-09-26 2023-09-26 Printer-based testing method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117290222A (en)

Similar Documents

Publication Publication Date Title
CN106406951B (en) Installation method and device of operating system
CN110764945A (en) Crash log processing method, device, equipment and storage medium
WO2019071891A1 (en) Code coverage analysis method and application server
US11222081B2 (en) Off-line electronic documentation solutions
CN104135520B (en) A kind of method and device for identifying android terminal
CN110297767B (en) Automatic execution method, device, equipment and storage medium for test cases
CN112769802B (en) Access verification method and device based on server, electronic equipment and storage medium
CN109558315B (en) Method, device and equipment for determining test range
WO2019200808A1 (en) Test case recommendation method, electronic device, and readable storage medium
CN117290222A (en) Printer-based testing method and device, terminal equipment and storage medium
CN110717131B (en) Page revising monitoring method and related system
CN110866492B (en) Baseline branch identification method and device and computer system
US11070716B2 (en) Image sensor system, image sensor, data generation method of image sensor in image sensor system, and non-transitory computer-readable recording medium
CN111400245B (en) Art resource migration method and device
CN114416442A (en) Hardware change detection method and device, electronic equipment and readable storage medium
CN110083540B (en) Interface testing method and device
CN112631929A (en) Test case generation method and device, storage medium and electronic equipment
CN114064387A (en) Log monitoring method, system, device and computer readable storage medium
CN111078574A (en) Method and device for generating influence analysis report
CN110618934A (en) Front-end automatic test debugging method and device and computer readable storage medium
CN110825795A (en) Method, device and equipment for accessing database and computer readable storage medium
CN114817078B (en) Automatic testing method and device and storage medium
CN114756440B (en) Data writing method, device and equipment of smart card and storage medium
US20210306470A1 (en) Information processing device and non-transitory computer readable medium
CN117251361A (en) Method, device, equipment and storage medium for testing system stability

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