CN114083912B - Intelligent bill printer testing method and system - Google Patents

Intelligent bill printer testing method and system Download PDF

Info

Publication number
CN114083912B
CN114083912B CN202111456231.XA CN202111456231A CN114083912B CN 114083912 B CN114083912 B CN 114083912B CN 202111456231 A CN202111456231 A CN 202111456231A CN 114083912 B CN114083912 B CN 114083912B
Authority
CN
China
Prior art keywords
printing
bill
intelligent
test
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111456231.XA
Other languages
Chinese (zh)
Other versions
CN114083912A (en
Inventor
常晓露
林喆
朱天成
余凯
赵培培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Sunmi Technology Group Co Ltd
Citaq Co Ltd
Original Assignee
Shanghai Sunmi Technology Group Co Ltd
Citaq 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 Shanghai Sunmi Technology Group Co Ltd, Citaq Co Ltd filed Critical Shanghai Sunmi Technology Group Co Ltd
Priority to CN202111456231.XA priority Critical patent/CN114083912B/en
Publication of CN114083912A publication Critical patent/CN114083912A/en
Application granted granted Critical
Publication of CN114083912B publication Critical patent/CN114083912B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J29/00Details of, or accessories for, typewriters or selective printing mechanisms not otherwise provided for
    • B41J29/38Drives, motors, controls or automatic cut-off devices for the entire printing mechanism
    • B41J29/393Devices for controlling or analysing the entire machine ; Controlling or analysing mechanical parameters involving printing of test patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B41PRINTING; LINING MACHINES; TYPEWRITERS; STAMPS
    • B41JTYPEWRITERS; SELECTIVE PRINTING MECHANISMS, i.e. MECHANISMS PRINTING OTHERWISE THAN FROM A FORME; CORRECTION OF TYPOGRAPHICAL ERRORS
    • B41J29/00Details of, or accessories for, typewriters or selective printing mechanisms not otherwise provided for
    • B41J29/38Drives, motors, controls or automatic cut-off devices for the entire printing mechanism
    • B41J29/393Devices for controlling or analysing the entire machine ; Controlling or analysing mechanical parameters involving printing of test patterns
    • B41J2029/3935Devices for controlling or analysing the entire machine ; Controlling or analysing mechanical parameters involving printing of test patterns by means of printed test patterns
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

The invention discloses a testing method and a testing system for an intelligent bill printer, wherein the method comprises the following steps: acquiring print test data and expected test result pictures corresponding to the print test data; controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill; controlling the camera device to monitor the printing process, when the camera device monitors the complete content of the printing bill, controlling the camera device to shoot the printing bill under a light source, outputting a corresponding printing bill picture, and fixing the relative positions of the camera device, the intelligent bill printer and the light source; and receiving the printing bill picture, and comparing the printing bill picture with the expected test result picture to obtain a comparison result, wherein the comparison result is normal or abnormal. The invention can improve the efficiency and accuracy of intelligent bill printer test.

Description

Intelligent bill printer testing method and system
Technical Field
The invention relates to the technical field of digital data processing, in particular to a testing method and a testing system of an intelligent bill printer.
Background
Along with the development of intelligent control technology in recent years, the use of intelligent equipment permeates into aspects of our daily life, and the combination of traditional electronic products and intelligent control promotes intelligent equipment with continuously updated functions. For example, in the aspect of bill printing, intelligent bill printers have come into widespread use in recent years and gradually replace conventional POS machines.
Because intelligent bill printer function is abundant and widely used, intelligent bill printer's test problem also receives the attention thereupon, if intelligent bill printer's printing result appears the error, can influence the use of bill, causes economic loss. The current intelligent bill printer test is mainly to finish a round of intelligent bill printer test by manually clicking each test item according to test data provided by a developer through an artificial black box test method, then judge the printing effect by naked eyes and summarize the test result. The testing method consumes time and labor, and influences the testing result of the intelligent bill printer when errors occur in the judgment of the printing effect.
Therefore, the intelligent bill printer testing method is needed at present, the technical problems that the traditional method consumes time and labor, and the testing result of the intelligent bill printer is influenced when the judgment of the printing effect is in error are solved, and the testing efficiency and accuracy of the intelligent bill printer are improved.
Disclosure of Invention
In order to solve the technical problems that the traditional printer testing method consumes time and labor and the judgment of the printing effect is influenced due to the change of the brightness and the color of the light source, the invention provides the intelligent bill printer testing method and system, and the specific technical scheme is as follows:
the invention provides a testing method of an intelligent bill printer, which is applied to an upper computer connected with the intelligent bill printer and a camera device, and comprises the following steps:
acquiring print test data and expected test result pictures corresponding to the print test data;
controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
controlling the camera device to monitor the printing process, when the camera device monitors the complete content of the printing bill, controlling the camera device to shoot the printing bill under a light source, outputting a corresponding printing bill picture, and fixing the relative positions of the camera device, the intelligent bill printer and the light source;
and receiving the printing bill picture, and comparing the printing bill picture with the expected test result picture to obtain a comparison result, wherein the comparison result is normal or abnormal.
According to the intelligent bill printer testing method, the printed bills are photographed under the light source with fixed relative positions, and the photographing result and the expected test result picture are compared through the PC end, so that the labor cost is saved, errors caused by manual comparison of pictures are avoided, and the testing efficiency and accuracy of the intelligent bill printer are improved.
Further, the invention also provides a testing method of the intelligent bill printer, which comprises the steps of obtaining the print test data and the expected test result picture corresponding to the print test data, and specifically comprises the following steps:
acquiring the printing test data;
controlling the intelligent bill printer to output expected printing bills according to the printing test data;
and controlling the camera equipment to shoot the expected printing bill under the light source, and outputting a corresponding expected test result picture.
According to the intelligent bill printer testing method provided by the invention, the expected test result picture is generated according to the expected printing bill, so that the efficiency and accuracy of comparing the expected test result picture with the printing bill picture are improved.
Further, the invention also provides a testing method of the intelligent bill printer, which controls the intelligent bill printer to print according to the printing test data, and specifically comprises the following steps:
adding identification data into the printing test data to generate identification version printing test data; the identification data comprises a start identification and an end identification, the start identification is marked at the beginning of the printing content of the printing bill, and the end identification is marked at the end of the printing content of the printing bill;
controlling the intelligent bill printer to print according to the identification plate printing test data;
the complete content of the printing bill comprises the start identifier, the printing test data and the end identifier.
According to the intelligent bill printer testing method, the intelligent bill printer is controlled to add the mark at the preset position of the printing bill, the photographing equipment is controlled to photograph the printing bill according to the mark, the printing bill picture with complete content is obtained, and the accuracy of intelligent bill printer testing is improved.
Further, the invention also provides a testing method of the intelligent bill printer, which further comprises the following steps after outputting the printed bill:
detecting a printing service interface return value of the intelligent bill printer;
if the return value of the printing service interface is detected, storing the execution record of the printing test data as normal;
and if the return value of the printing service interface is not detected within the preset time, storing the execution record of the printing test data as abnormal.
According to the intelligent bill printer testing method provided by the invention, whether the printing test data are normally executed is judged according to the return value of the printing service interface, so that the efficiency of intelligent bill printer testing is improved.
Further, the invention also provides a testing method of the intelligent bill printer, after detecting the return value of the printing service interface of the intelligent bill printer, the testing method further comprises the following steps:
and if the return value of the printing service interface is not detected within the preset time, controlling the camera equipment not to take a picture of the printing bill.
According to the intelligent bill printer testing method, when the return value of the printing service interface is not detected, the camera equipment is controlled to not photograph the printing bill, so that the intelligent bill printer testing efficiency is improved.
Further, in the method for testing the intelligent bill printer provided by the invention, after the comparison result is obtained, the method further comprises the following steps:
comparing the execution record with the comparison result;
if the execution record is the same as the comparison result, outputting the comparison result;
and if the execution record is different from the comparison result, storing the comparison result, and manually judging the printing bill picture with different results and the corresponding expected test result picture.
According to the intelligent bill printer testing method, the printing test data results are checked by comparing the execution records with the corresponding printing test data results, and when the check results are different, the manual secondary judgment is carried out, so that the accuracy of intelligent bill printer testing is improved.
Further, in the method for testing an intelligent bill printer provided by the invention, the comparing the printed bill picture with the expected test result picture specifically comprises the following steps:
comparing the printed bill picture with the expected test result picture through a preset test model to obtain similarity;
and when the similarity is smaller than a preset threshold value, judging that the comparison result is abnormal.
According to the intelligent bill printer testing method provided by the invention, the similarity of the printed bill picture and the corresponding expected printed test result picture is compared through the preset test script, the test result is judged according to the similarity, and the accuracy and the efficiency of intelligent bill printer testing are improved.
Further, the method for testing the intelligent bill printer provided by the invention further comprises the following steps after a plurality of comparison results are obtained:
when the comparison result is abnormal, comparing each test abnormal result picture, wherein the test abnormal result picture is the printing bill picture when the comparison result is abnormal;
when the test abnormal result pictures are the same, controlling the intelligent bill printer to stop printing work, and outputting an alarm instruction;
when different test abnormal result pictures exist in the test abnormal result pictures, storing the test abnormal result pictures, and manually judging the test abnormal result pictures.
The intelligent bill printer testing method provided by the invention can avoid influencing the testing efficiency when the intelligent bill printer is in paper shortage or paper jam, timely alarm and prompt manual paper replacement, and send the testing result to manual judgment when the paper shortage or paper jam does not occur but the testing result is abnormal continuously, thereby improving the testing accuracy of the intelligent bill printer.
Further, the invention also provides a testing method of the intelligent bill printer, which comprises the following steps:
after the corresponding expected test result pictures are generated according to the plurality of printing test data, before the intelligent bill printer is controlled to print according to the printing test data in sequence, the intelligent bill printer further comprises:
and controlling the intelligent bill printer to backup the local log.
According to the intelligent bill printer testing method, when a printing test task starts, the local log is backed up to the local machine, so that when failure occurs in the testing process, the failure reason is located through analyzing the local log, and the intelligent bill printer testing efficiency is improved.
Further, the intelligent bill printer testing method provided by the invention comprises the following steps:
and dragging the printing bill with a preset force through a tension motor cylinder, wherein the preset force is smaller than the force required by dragging the intelligent bill printer by the printing bill under the current gesture.
According to the intelligent bill printer testing method, the preset force is arranged on the tension motor to drag the printed bills, so that the intelligent bill printer is prevented from being displaced due to overlarge force, the tension end is controlled to stop when all the contents of each printed bill are detected until photographing of the photographing equipment is finished, the situation that all the contents of the printed bills are not displayed when photographing is avoided, photographing effect is further affected, errors occur in comparison with expected test result pictures, and the intelligent bill printer testing accuracy is improved.
Additionally, the invention also provides an intelligent bill printer testing system, which comprises:
the intelligent bill printer comprises an upper computer, an intelligent bill printer, camera equipment and a light source;
the intelligent bill printer and the camera equipment are connected with the upper computer, and the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
the upper computer includes:
the acquisition module is used for acquiring the print test data and expected test result pictures corresponding to the print test data;
the first control module is connected with the acquisition module and used for controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
the second control module is used for controlling the camera equipment to monitor the printing process, controlling the camera equipment to shoot the printing bill under the light source when the camera equipment monitors the complete content of the printing bill, and outputting a corresponding printing bill picture;
and the comparison module is connected with the acquisition module and used for receiving the printing bill picture and comparing the printing bill picture with the expected test result picture to obtain a comparison result, wherein the comparison result is normal or abnormal.
The invention provides a testing method and a testing system for an intelligent bill printer, at least comprising the following technical effects:
(1) The printed bill is photographed under the light source with fixed relative positions, and the photographing result and the expected test result picture are compared through the PC end, so that the labor cost is saved, errors caused by manual comparison of the pictures are avoided, and the testing efficiency and accuracy of the intelligent bill printer are improved;
(2) Generating an expected test result picture according to the expected printing bill, and improving the efficiency and accuracy of comparing the expected test result picture with the printing bill picture;
(3) Judging whether the printing test data are normally executed or not according to the printing service interface return value, and controlling the camera equipment not to photograph the printing bill when the printing service interface return value is not detected, so that the testing efficiency of the intelligent bill printer is improved;
(4) Comparing each execution record with the corresponding printing test data result, checking the printing test data result, and communicating with the manual secondary judgment when the checking result is different, thereby improving the accuracy of the intelligent bill printer test;
(5) The method has the advantages that the influence on the testing efficiency when the intelligent bill printer is in paper shortage or paper jam is avoided, the alarm is timely given to remind the manual paper replacement, and the testing result is manually judged when the paper shortage or paper jam does not occur but the testing result is abnormal, so that the testing accuracy of the intelligent bill printer is improved;
(6) The intelligent bill printer is prevented from being displaced due to overlarge force, the printing bill is not at the preset position, the photographing effect is further affected, errors are caused in comparison of the test result, and the accuracy of the intelligent bill printer test is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for testing an intelligent bill printer according to the present invention;
FIG. 2 is a flow chart of a method of testing an intelligent ticket printer in accordance with the present invention;
FIG. 3 is another flow chart of a smart ticket printer testing method of the present invention;
FIG. 4 is a flow chart comparing printed ticket pictures with expected test result pictures in an intelligent ticket printer test method of the invention;
FIG. 5 is a further flowchart of a smart ticket printer testing method of the present invention;
FIG. 6 is a flowchart of a method for testing an intelligent bill printer according to the present invention when the test result is abnormal;
FIG. 7 is a block diagram of an intelligent ticket printer testing system of the present invention.
Reference numerals in the drawings: the intelligent bill printer comprises an upper computer-10, an acquisition module-11, a first control module-12, a second control module-13, a comparison module-14, an intelligent bill printer-20, a camera device-30 and a light source-40.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application 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 application 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.
For the sake of simplicity of the drawing, the parts relevant to the present invention are shown only schematically in the figures, which do not represent the actual structure thereof as a product. Additionally, in order to facilitate a concise understanding of the drawings, components having the same structure or function in some of the drawings are depicted schematically only one of them, or only one of them is labeled. Herein, "a" means not only "only this one" but also "more than one" case.
It should be further understood that the term "and/or" as used in this 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.
In addition, in the description of the present application, the terms "first," "second," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will explain the specific embodiments of the present invention with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
Example 1
In one embodiment of the present invention, as shown in fig. 1, the present invention provides a method for testing an intelligent bill printer, which is applied to an upper computer connected to an intelligent bill printer and a camera device, and includes the steps of:
s100, obtaining expected test result pictures of the printing test data and the printing test data.
Specifically, the print test data includes samples printed in the test process of the intelligent bill printer, and the print test data invokes each print service interface and sets different parameters according to the use scene, wherein the parameters include boundary values, illegal values, ultra-long texts, ultra-large pictures and the like.
The printing test data can be input after being selected and set by combining the working scene of the intelligent bill printer manually, or can be automatically generated by combining the working scene of the intelligent bill printer by the PC end and correspondingly generating a generating method or an intelligent generating model.
And acquiring a photographing result of the printing test data at a preset printing position according to the printing test data as a printing test result picture.
S200, controlling the intelligent bill printer to print according to the printing test data, and outputting a printing bill.
Optionally, after the plurality of printing test data are sequenced in any order, the intelligent bill printer is controlled to print according to each printing test data in sequence. Any order represents the test process and test result which do not affect the intelligent bill printer no matter what order, and the method only sequentially controls the intelligent bill printer to print the printing test data one by one and outputs the printing bill.
And S300, controlling the camera equipment to monitor the printing process, and when the camera equipment monitors the complete content of the printing bill, controlling the camera equipment to shoot the printing bill under the light source and outputting a corresponding printing bill picture.
Specifically, the relative positions of the camera device, the intelligent bill printer and the light source are fixed.
S400, receiving the printed bill picture, and comparing the printed bill picture with the expected test result picture to obtain a comparison result.
Specifically, the comparison result is normal or abnormal.
According to the intelligent bill printer testing method, the printed bills are photographed under the light source with the fixed relative positions, and the photographing result and the expected test result picture are compared through the PC end, so that the labor cost is saved, errors caused by manual comparison pictures are avoided, and the testing efficiency and accuracy of the intelligent bill printer are improved.
Example 2
Based on embodiment 1, as shown in fig. 2, in the method for testing an intelligent bill printer provided by the present invention, step S100 obtains print test data and expected test result pictures corresponding to the print test data, and specifically includes:
s110 acquires print test data.
S120, controlling the intelligent bill printer to output expected printing bills according to the printing test data.
Specifically, expected printing notes meeting the requirements are printed according to the printing test data. The determination may be made manually or by a machine.
S130, controlling the camera device to take a picture of the expected printing bill under the light source, and outputting a corresponding expected test result picture.
Specifically, under the camera equipment, the intelligent bill printer and the light source, which are fixed in relative positions, the camera equipment is controlled to shoot the expected printing bill under the light source, so that the light environment in the output expected test result picture is the same as the light environment in the printing bill picture. That is, the light intensity, light color, refraction and reflection of light, and the like of the image pickup apparatus are the same when photographing an intended print ticket and when photographing a print ticket.
And the PyCharm tool is connected with the intelligent bill printer through the USB debugging line at the PC end, the printed bill sample with correct content is prefabricated in advance to a path which can be captured by the PyCharm tool at the PC end, preparation is made for subsequent picture matching, and the printed bill sample returned by the camera equipment is waited to be received.
The fixed light source that the department of intelligent bill printer output set up can regard as independent equipment, sets up outside intelligent bill printer, also can set up on intelligent bill printer organism.
Optionally, step S200 controls the intelligent ticket printer to print according to the print test data and outputs a print ticket, which specifically includes:
s210, adding identification data into the printing test data to generate identification version printing test data.
Specifically, each of the mark data is used to add marks at the beginning and end of the print content of the corresponding print ticket, respectively.
Illustratively, the marking data is added at the beginning and end of each print test data according to the length of each print test data, with the same row black blocks added at the beginning and end of each order ticket.
Optionally, since the hatchcover of the intelligent bill printer is non-planar, it is recommended to add 3 blank rows at the beginning and 5 blank rows at the end of each test bill, so that the content of the printed bill is pulled to a flat position, and the photographing of the photographing device is facilitated.
S220, controlling the intelligent bill printer to print according to the identification plate printing test data.
S230 outputs the print ticket.
Optionally, after controlling the image capturing device to take a photograph of the expected print ticket under the light source and outputting the corresponding expected test result picture in step S130, step S210 adds identification data to the print test data, and before generating the identification version print test data, the method further includes the steps of:
s140, controlling the intelligent bill printer to backup the local log.
Specifically, when a print test task starts, the intelligent bill printer stores a local log to the intelligent bill printer through the adbshellogcat, so that when failure occurs in the test process, the reason of failure is positioned through analyzing the local log.
Optionally, step S300 controls the image capturing device to monitor the printing process, and when the image capturing device monitors the complete content of the printed bill, controls the image capturing device to take a picture of the printed bill under the light source, and outputs a corresponding printed bill picture, which specifically includes:
s310 controls the image pickup apparatus to monitor the printing process.
And S320, when the camera equipment monitors the complete content of the printing bill, controlling the camera equipment to take a picture of the printing bill under the light source.
Specifically, monitoring the complete content of the printed tickets includes the camera device detecting the mark at the beginning and the mark at the end in each printed ticket at the same time.
By detecting the mark at the starting position and the mark at the tail position at the same time, the whole content of the printing bill is judged to be positioned in the shooting area of the shooting equipment, and the photo environment of each printing bill is the same as the photo environment of each printing bill because the printing bill is shot by the shooting equipment each time and is positioned in the preset shooting area.
Alternatively, when the image pickup apparatus detects that a line black block at the end of the print ticket is located within the image pickup area of the image pickup apparatus.
The printing bill starts to be printed from the starting position, the printing is completed after the printing is completed at the ending position, and the printing bill sequentially enters the photographing area from the starting position to the ending position, so that when the black blocks at the ending position of the printing bill are detected, the whole content of the printing bill is judged to be positioned in the photographing area of the photographing equipment, and meanwhile, the photo environment of photographing the printing bill every time is the same.
If the printing of the bill is started from the tail part, the printing is finished after the printing of the bill is finished at the starting part, and only the black blocks of the bill at the starting part are detected.
S330, outputting the corresponding printing bill picture.
According to the intelligent bill printer testing method, the intelligent bill printer is controlled to add the mark at the preset position of the printing bill, the image pickup device is controlled to photograph the printing bill according to the mark, so that the content of each printing bill is complete when photographing, and the printing bill is in the same light environment, the influence on the judgment of the printing effect due to the change of the brightness and the color of the light source is avoided, the labor cost is saved, and the accuracy and the efficiency between the expected test result picture and the printing bill picture can be improved.
Example 3
Based on any one of embodiments 1 to 2, as shown in fig. 3 to 5, in the method for testing an intelligent bill printer provided by the present invention, after outputting a printed bill in step S230, the method specifically includes:
s510 detects a print service interface return value of the intelligent ticket printer.
If the print service interface return value is detected in S520, the execution record of the stored print test data is normal.
Specifically, the intelligent ticket printer receives a print service interface return value each time it prints according to print test data.
For example, when each print job is finished, the intelligent bill printer needs to determine the return value of the print service interface, if the return is successful, the execution result of each piece of print test data of the intelligent bill printer is displayed to be normal at the test result of the piece of print test data, and meanwhile, the number of normal cases is increased by 1 at the test result statistics of the intelligent bill printer.
And S531, if the return value of the printing service interface is not detected within the preset time, storing the execution record of the printing test data as abnormal.
When each print job is finished, the intelligent bill printer needs to judge the return value of the print service interface, if the return fails, the execution result of each piece of print test data of the intelligent bill printer is displayed to be abnormal, and meanwhile, the abnormal case number is increased by 1 at the test result statistics of the intelligent bill printer.
The preset time may be set to 1S, 3S, 5S, or the like.
By counting the execution records, the number of normal and abnormal test cases and which print test data fail can be more intuitively seen.
Optionally, if the return value of the print service interface is not detected within the preset time, step S531 further includes, after the execution record of the stored print test data is abnormal:
s532 controls the image pickup apparatus not to take a picture of the printed ticket.
Specifically, after the printed bill is not photographed, the next printed test data is continuously tested.
Optionally, as shown in fig. 4, step S400 receives a print ticket picture, compares the print ticket picture with an expected test result picture to obtain a comparison result, and specifically includes:
s410, comparing the printed bill picture with the expected test result picture through a preset test model to obtain the similarity.
Specifically, the printed test sample and the correct bill sample are compared through the pre-recorded script.
And S420, judging that the comparison result is abnormal when the similarity is smaller than a preset threshold value.
For example, if the similarity is less than 98%, the test result is determined to be abnormal. The preset threshold value may be set to 90%, 95% or 98%, etc.
Optionally, if the test script identifies that the similarity between the actual print test result picture and the corresponding expected print test result picture is greater than a preset threshold, the test result is normal.
For example, if the similarity is greater than 98%, the test result is determined to be normal.
Further, as shown in fig. 5, step S400 receives a print ticket picture, compares the print ticket picture with an expected test result picture, and further includes the steps of:
s610 compares the execution record with the comparison result.
S621, if the execution record and the comparison result are the same, outputting the comparison result.
And S622, if the execution record and the comparison result are different, storing the comparison result, and manually judging the print bill pictures with different results and the corresponding expected test result pictures.
Specifically, after all the printing test data are tested, comparing the test result stored by the PC end PyCharm tool with the test result counted by the intelligent bill printer, if the results at the two ends are the same, directly taking the result, if the results at the two ends are inconsistent, directly discarding the test result of the intelligent bill printer, and carrying out manual judgment.
Optionally, after all the print tasks are tested, the intelligent bill printer stores the counted test results to the intelligent bill printer in a TXT format so as to compare the test results of the intelligent bill printer with the test results of the PC end PyCharm and make more perfect test report summary.
According to the intelligent bill printer testing method, the similarity of the printed bill picture and the corresponding expected printing test result picture is compared through the preset test script, the test result is judged according to the similarity, whether the printing test data are normally executed is judged according to the printing service interface return value, the printing test data are checked through comparing each execution record with the corresponding printing test data, and when the check result is different, the manual secondary judgment is carried out, so that the accuracy and the efficiency of the intelligent bill printer testing are improved.
Example 4
Based on any one of embodiments 1 to 3, as shown in fig. 6, in the method for testing an intelligent bill printer provided by the present invention, step S400 receives a printed bill picture, compares the printed bill picture with an expected test result picture, and further includes the steps of:
s430, comparing the test abnormal result pictures when the obtained comparison result is abnormal continuously and preset times.
Specifically, the test abnormal result picture is the print bill picture when the comparison result is abnormal.
Because the interface return value of the intelligent bill printer only represents the success or failure of the execution of the interface and cannot represent the success or failure of the actual printing effect, when the interface return of the intelligent bill printer is successful, but the intelligent bill printer has paper jam and paper lack, the camera equipment continuously shoots and returns to the PyCharm tool engineering appointed directory at the PC end.
Illustratively, if the PyCharm engineering end fails to continuously determine 5 sheets, the five bill sheets are compared to check whether the contents are the same.
Optionally, the 4 last received bill photos and the 5 last bill photo are compared to check whether the printed bill content is the same.
S441, when the pictures of the abnormal test results are the same, controlling the intelligent bill printer to stop printing work, and outputting an alarm instruction.
Specifically, if the same, phenomena such as paper shortage or paper jam may occur, and if the phenomena occur, the intelligent bill printer performs an alarm to prompt that the printer state is not ready. Meanwhile, the intelligent bill printer is controlled to stop executing printing action, the connected camera equipment stops photographing, and the intelligent bill printer waits for recovery readiness. And after the printer state is manually restored, re-executing the PyCharm project of the PC end, and performing subsequent printing test.
S442, when different test abnormal result pictures exist in each test abnormal result picture, storing the test abnormal result picture, and manually judging the test abnormal result picture.
Optionally, the printed ticket is dragged with a preset force by a tension motor cylinder during the printing test, wherein the preset force is less than the force required by the printed ticket to drag the intelligent ticket printer in the current posture.
The tension end is illustratively provided as a tension motor spool, the print ticket is wound on the spool, the spool is connected to the motor, and the motor is provided with a preset force that pulls and stops. The preset force cannot be larger than the force of dragging the intelligent bill printer by the printing paper, otherwise, the intelligent bill printer is enabled to displace, the printed bill cannot be photographed at the center point of the prepared focusing, the photographing effect is further affected, and meanwhile, the comparison test result of the PC end PyCharm tool is also affected.
According to the embodiment, when the test result is abnormal, the abnormal printing bill pictures are compared, the influence on the test efficiency due to the fact that the intelligent bill printer is out of paper or jammed is avoided, the alarm is timely given to remind the manual paper replacement, and when the test result is abnormal, the test result is submitted to manual judgment when the paper is not out of paper or jammed, and the test accuracy of the intelligent bill printer is improved.
Example 5
In another embodiment of the present invention, as shown in fig. 7, the present invention provides a smart ticket printer testing system, which includes an upper computer 10, a smart ticket printer 20, a camera device 30, and a light source 40, wherein the upper computer includes an acquisition module 11, a first control module 12, a second control module 13, and a comparison module 14.
Wherein the intelligent bill printer 20 and the camera device 30 are connected with the upper computer 10, and the relative positions of the camera device 30, the intelligent bill printer 20 and the light source 40 are fixed.
Specifically, the intelligent ticket printer 20 is in communication connection with the host computer 10. The camera device 30 is in communication connection with the upper computer 10, is arranged at a fixed position at a bill outlet of the intelligent bill printer 20, and is used for printing a bill, photographing and then sending a printed bill picture to the upper computer 10. The light source 40 is mounted in a fixed position at the bill outlet of the intelligent bill printer 20.
The obtaining module 11 in the upper computer 10 is configured to obtain the print test data and an expected test result picture corresponding to the print test data.
Specifically, the print test data includes samples printed during the testing process of the intelligent ticket printer 20, and the print test data invokes each print service interface and sets different parameters according to the usage scenario, where the parameters include boundary values, illegal values, very long text, very large pictures, and so on.
The print test data can be input after being selected and set by combining the working scene of the intelligent bill printer 20 manually, or can be automatically generated by combining the working scene of the intelligent bill printer 20 by the upper computer 10 and matching with a corresponding generation method or an intelligent generation model.
And acquiring a photographing result of the printing test data at a preset printing position according to the printing test data as a printing test result picture.
The first control module 12 is connected with the acquisition module 11, and is used for controlling the intelligent bill printer 20 to print according to the printing test data and outputting a printing bill.
Optionally, after the plurality of print test data are ordered in any order, the intelligent ticket printer 20 is controlled to print according to each print test data in turn. Any order represents that no matter what order is used, the testing process and the testing result of the intelligent bill printer 20 are not affected, and in this application, the intelligent bill printer 20 is only controlled to print the printing test data one by one, and print bills are output.
The second control module 13 is configured to control the image capturing device 30 to monitor a printing process, and when the image capturing device 30 monitors the complete content of the printed ticket, control the image capturing device 30 to take a photograph of the printed ticket under the light source 40, and output a corresponding print ticket picture.
Illustratively, the feature of the print ticket picture is recognized by the image pickup apparatus 30, and it is determined whether the entire content of the print ticket is within the image pickup area of the image pickup apparatus 30.
Specifically, after photographing the actual print test result under irradiation of the light source 40 whose position is fixed by controlling the image pickup apparatus, a corresponding image of the actual print test result is output to the upper computer 10.
And the comparison module 14 is connected with the acquisition module 11 and is used for receiving the printing bill picture and comparing the printing bill picture with the expected test result picture to obtain a comparison result.
The intelligent bill printer test system provided by the embodiment photographs the printed bill under the light source with fixed relative positions, and compares the photographing result with the expected test result picture through the PC end, so that the labor cost is saved, errors caused by manual comparison pictures are avoided, and the efficiency and the accuracy of intelligent bill printer test are improved.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and the parts of a certain embodiment that are not described or depicted in detail may be referred to in the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the elements and steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination 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 solution. 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 method and system for testing a smart ticket printer may be implemented in other manners. For example, one intelligent ticket printer testing method and system embodiment described above is merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or modules may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the communications links shown or discussed may be through some interface, device or unit communications link or integrated circuit, whether electrical, mechanical or otherwise.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
It should be noted that the foregoing is only a preferred embodiment of the present invention, and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, and such modifications and adaptations are intended to be comprehended within the scope of the present invention.

Claims (9)

1. The intelligent bill printer testing method is characterized by being applied to an upper computer connected with an intelligent bill printer and a camera device, and comprises the following steps:
acquiring print test data and expected test result pictures corresponding to the print test data;
controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
controlling the camera device to monitor the printing process, when the camera device monitors the complete content of the printing bill, controlling the camera device to shoot the printing bill under a light source, outputting a corresponding printing bill picture, and fixing the relative positions of the camera device, the intelligent bill printer and the light source;
receiving the printing bill picture, and comparing the printing bill picture with the expected test result picture to obtain a comparison result, wherein the comparison result is normal or abnormal;
the comparing the print bill picture with the expected test result picture specifically comprises:
comparing the printed bill picture with the expected test result picture through a preset test model to obtain similarity;
when the similarity is smaller than a preset threshold, judging that the comparison result is abnormal;
after the comparison result is obtained, the method further comprises the following steps:
when the obtained comparison results are abnormal in continuous preset times, comparing each test abnormal result picture, wherein the test abnormal result picture is the printing bill picture when the comparison result is abnormal;
when the test abnormal result pictures are the same, controlling the intelligent bill printer to stop printing work, and outputting an alarm instruction;
when different test abnormal result pictures exist in the test abnormal result pictures, storing the test abnormal result pictures, and manually judging the test abnormal result pictures.
2. The intelligent bill printer testing method according to claim 1, wherein the obtaining the expected test result picture corresponding to the print test data specifically includes:
acquiring the printing test data;
controlling the intelligent bill printer to output expected printing bills according to the printing test data;
and controlling the camera equipment to shoot the expected printing bill under the light source, and outputting a corresponding expected test result picture.
3. The method for testing the intelligent bill printer according to claim 1, wherein the controlling the intelligent bill printer to print according to the print test data specifically comprises:
adding identification data into the printing test data to generate identification version printing test data; the identification data comprises a start identification and an end identification, the start identification is marked at the beginning of the printing content of the printing bill, and the end identification is marked at the end of the printing content of the printing bill;
controlling the intelligent bill printer to print according to the identification plate printing test data;
the complete content of the printing bill comprises the start identifier, the printing test data and the end identifier.
4. The intelligent ticket printer testing method as claimed in claim 1, wherein after outputting the printed ticket, further comprising:
detecting a printing service interface return value of the intelligent bill printer;
if the return value of the printing service interface is detected, storing the execution record of the printing test data as normal;
and if the return value of the printing service interface is not detected within the preset time, storing the execution record of the printing test data as abnormal.
5. The method for testing a smart ticket printer according to claim 4, further comprising, after said detecting a return value from a print service interface of said smart ticket printer:
and if the return value of the printing service interface is not detected within the preset time, controlling the camera equipment not to take a picture of the printing bill.
6. The intelligent bill printer testing method according to claim 4, wherein after the comparison result is obtained, further comprising:
comparing the execution record with the comparison result;
if the execution record is the same as the comparison result, outputting the comparison result;
and if the execution record is different from the comparison result, storing the comparison result, and manually judging the printing bill picture with different results and the corresponding expected test result picture.
7. The method for testing an intelligent ticket printer according to claim 1, wherein after the obtaining of the expected test result picture corresponding to the print test data, before the controlling the intelligent ticket printer to print according to the print test data, further comprises:
and controlling the intelligent bill printer to backup the local log.
8. The intelligent ticket printer testing method according to any one of claims 1 to 7, wherein:
and dragging the printing bill with a preset force through a tension motor cylinder, wherein the preset force is smaller than the force required by dragging the intelligent bill printer by the printing bill under the current gesture.
9. An intelligent ticket printer testing system, comprising:
the intelligent bill printer comprises an upper computer, an intelligent bill printer, camera equipment and a light source;
the intelligent bill printer and the camera equipment are connected with the upper computer, and the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
the upper computer includes:
the acquisition module is used for acquiring the print test data and expected test result pictures corresponding to the print test data;
the first control module is connected with the acquisition module and used for controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
the second control module is used for controlling the camera equipment to monitor the printing process, controlling the camera equipment to shoot the printing bill under the light source when the camera equipment monitors the complete content of the printing bill, and outputting a corresponding printing bill picture;
the comparison module is connected with the acquisition module and used for receiving the printing bill picture and comparing the printing bill picture with the expected test result picture to obtain a comparison result, wherein the comparison result is normal or abnormal;
the comparison module is also used for: comparing the printed bill picture with the expected test result picture through a preset test model to obtain similarity; when the similarity is smaller than a preset threshold, judging that the comparison result is abnormal; when the obtained comparison results are abnormal in continuous preset times, comparing each test abnormal result picture, wherein the test abnormal result picture is the printing bill picture when the comparison result is abnormal; when the test abnormal result pictures are the same, controlling the intelligent bill printer to stop printing work, and outputting an alarm instruction; when different test abnormal result pictures exist in the test abnormal result pictures, storing the test abnormal result pictures, and manually judging the test abnormal result pictures.
CN202111456231.XA 2021-12-01 2021-12-01 Intelligent bill printer testing method and system Active CN114083912B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111456231.XA CN114083912B (en) 2021-12-01 2021-12-01 Intelligent bill printer testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111456231.XA CN114083912B (en) 2021-12-01 2021-12-01 Intelligent bill printer testing method and system

Publications (2)

Publication Number Publication Date
CN114083912A CN114083912A (en) 2022-02-25
CN114083912B true CN114083912B (en) 2024-01-16

Family

ID=80306249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111456231.XA Active CN114083912B (en) 2021-12-01 2021-12-01 Intelligent bill printer testing method and system

Country Status (1)

Country Link
CN (1) CN114083912B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6106094A (en) * 1996-01-30 2000-08-22 Neopt Corporation Printer apparatus and printed matter inspecting apparatus
JP2007062940A (en) * 2005-08-31 2007-03-15 Fujitsu Ltd Paper jam detection method, device and program of journal printer
CN101807140A (en) * 2010-01-29 2010-08-18 山东新北洋信息技术股份有限公司 Printing control method and system
CN208568630U (en) * 2018-08-14 2019-03-01 凌云光技术集团有限责任公司 A kind of mixed version detection device of the printed matter based on image
CN111459426A (en) * 2020-04-21 2020-07-28 厦门汉印电子技术有限公司 Printing effect visual adjustment method, device, equipment and storage medium
CN112258460A (en) * 2020-10-12 2021-01-22 广州立信电子科技有限公司 Printed product quality real-time monitoring and quality inspection system based on image recognition
CN112829467A (en) * 2021-02-02 2021-05-25 北京亚美科软件有限公司 Continuous image-text splicing method for ink-jet printer

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6106094A (en) * 1996-01-30 2000-08-22 Neopt Corporation Printer apparatus and printed matter inspecting apparatus
JP2007062940A (en) * 2005-08-31 2007-03-15 Fujitsu Ltd Paper jam detection method, device and program of journal printer
CN101807140A (en) * 2010-01-29 2010-08-18 山东新北洋信息技术股份有限公司 Printing control method and system
CN101934646A (en) * 2010-01-29 2011-01-05 山东新北洋信息技术股份有限公司 Printing control method and printer
CN208568630U (en) * 2018-08-14 2019-03-01 凌云光技术集团有限责任公司 A kind of mixed version detection device of the printed matter based on image
CN111459426A (en) * 2020-04-21 2020-07-28 厦门汉印电子技术有限公司 Printing effect visual adjustment method, device, equipment and storage medium
CN112258460A (en) * 2020-10-12 2021-01-22 广州立信电子科技有限公司 Printed product quality real-time monitoring and quality inspection system based on image recognition
CN112829467A (en) * 2021-02-02 2021-05-25 北京亚美科软件有限公司 Continuous image-text splicing method for ink-jet printer

Also Published As

Publication number Publication date
CN114083912A (en) 2022-02-25

Similar Documents

Publication Publication Date Title
US6912674B2 (en) System and method for diagnosing printer problems and notarizing prints by evaluating embedded data
US10841436B2 (en) Image forming apparatus for controlling timing of recording a communication log, information processing apparatus, method of controlling image forming apparatus, method of controlling information processing apparatus, and storage medium
JP2007249975A (en) Method and system for assisting user to correct device problem, and method for preparing system
US7924446B2 (en) Method and device for handling errors in a printer or copier
US20080063424A1 (en) Image forming apparatus, print control apparatus, and print control method
EP3255871A1 (en) Recording of sound information and document annotations during a meeting.
US10331392B1 (en) Image forming operation monitoring systems and methods
CN113805820A (en) Inspection system, inspection apparatus, and control method of inspection apparatus
CN114083912B (en) Intelligent bill printer testing method and system
CN112801976B (en) Detection system and method for correcting binding mispasting of books and periodicals and computer device
WO2000060480A1 (en) Automated document inspection system
CN114091846A (en) Intelligent printing quality management method, system, device and storage medium
US10073654B1 (en) Image forming operation monitoring systems and methods
JP3762124B2 (en) Image processing apparatus, image processing method, and storage medium storing computer-readable program
CN115526859A (en) Method for identifying production defects, distributed processing platform, equipment and storage medium
JP4866377B2 (en) Image processing apparatus and image processing system
JP6443094B2 (en) Information processing apparatus and program
US10241735B1 (en) Image forming operation monitoring systems and methods
CN109828729B (en) Networking communication method for coordinating laser printer
WO2001014928A2 (en) Print inspection system
CN101839865A (en) Automatic distinguishing method of printing effect
CN207408972U (en) A kind of card maker with automatic detection device
JP5768596B2 (en) Page misalignment inspection system, printing system, printed matter, page misalignment inspection method
US7218769B2 (en) Image data management system and computer-readable recording medium
US11985272B2 (en) Information processing apparatus that provides operation guidance

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
GR01 Patent grant
GR01 Patent grant