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

Intelligent bill printer testing method and system Download PDF

Info

Publication number
CN114083912A
CN114083912A CN202111456231.XA CN202111456231A CN114083912A CN 114083912 A CN114083912 A CN 114083912A CN 202111456231 A CN202111456231 A CN 202111456231A CN 114083912 A CN114083912 A CN 114083912A
Authority
CN
China
Prior art keywords
printing
bill
intelligent
test
printer
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.)
Granted
Application number
CN202111456231.XA
Other languages
Chinese (zh)
Other versions
CN114083912B (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

Images

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 method and a system for testing an intelligent bill printer, wherein the method comprises the following steps: acquiring printing test data and an expected test result picture corresponding to the printing test data; controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill; controlling the camera equipment to monitor a printing process, controlling the camera equipment to photograph the printing bill under a light source when the camera equipment monitors the complete content of the printing bill, and outputting a corresponding printing bill picture, wherein the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed; 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 the test of the intelligent bill printer.

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 for an intelligent bill printer.
Background
Along with the development of intelligent control technology in recent years, the use of intelligent equipment permeates the aspect of our daily life, and the combination of traditional electronic products and intelligent control prompts intelligent equipment with continuously updated functions. For example, in the field of ticket printing, smart ticket printers have become widely used in recent years and are gradually replacing traditional POS machines.
Because intelligent bill printer function is abundant and by wide use, the test problem of intelligent bill printer also receives attention thereupon, if the error appears in the printing result of intelligent bill printer, can influence the use of bill, causes economic loss. At present, the test of the intelligent bill printer is mainly completed by manually clicking each test item through a test data provided by a developer by an artificial black box test method, then manually judging the printing effect by naked eyes, and summarizing 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, an intelligent bill printer testing method is needed at present, the technical problems that the traditional method consumes time and labor, and influences the testing result of the intelligent bill printer when the error occurs in the judgment of the printing effect are solved, and the testing efficiency and the testing 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 change of the brightness and the color of a light source can influence the judgment of the printing effect, the invention provides an 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 printing test data and an expected test result picture corresponding to the printing test data;
controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
controlling the camera equipment to monitor a printing process, controlling the camera equipment to photograph the printing bill under a light source when the camera equipment monitors the complete content of the printing bill, and outputting a corresponding printing bill picture, wherein the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
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 bill is photographed under the light source with the fixed relative position, the photographed result and the expected test result picture are compared through the PC end, labor cost is saved, errors caused by manual image comparison are avoided, and testing efficiency and accuracy of the intelligent bill printer are improved.
Further, the invention also provides a test method for the intelligent bill printer, wherein the acquiring of the print test data and the expected test result picture corresponding to the print test data specifically comprises the following steps:
acquiring the printing test data;
controlling the intelligent bill printer to output an expected printing bill according to the printing test data;
and controlling the camera equipment to photograph the expected printing bill under the light source, and outputting a corresponding expected test result picture.
The intelligent bill printer testing method provided by the invention generates the expected test result picture according to the expected printing bill, and improves the efficiency and accuracy of comparing the expected test result picture with the printing bill picture.
Further, the invention also provides a test method of the intelligent bill printer, wherein the control of the intelligent bill printer to print according to the printing test data specifically comprises the following steps:
adding identification data in the printing test data to generate identification version printing test data; the identification data comprises a starting identification and an end identification, the starting identification is marked at the starting position of the printing content of the printing bill, and the end identification is marked at the end position 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 starting mark, the printing test data and the ending mark.
According to the intelligent bill printer testing method, the intelligent bill printer is controlled to add the mark at the preset position of the printed bill, the camera device is controlled to photograph the printed bill according to the mark, the printed bill picture with complete content is obtained, and the testing accuracy of the intelligent bill printer is improved.
Further, the invention also provides a testing method of the intelligent bill printer, and after the printing bill is output, the method further comprises the following steps:
detecting a printing service interface return value of the intelligent bill printer;
if the printing service interface return value is detected, storing the execution record of the printing test data as normal;
and if the printing service interface return value is not detected within the preset time, storing the execution record of the printing test data as abnormal.
The testing method of the intelligent bill printer provided by the invention can be used for judging whether the printing test data is normally executed or not according to the return value of the printing service interface, so that the testing efficiency of the intelligent bill printer is improved.
Further, the present invention also provides a method for testing an intelligent bill printer, wherein after detecting a return value of a printing service interface of the intelligent bill printer, the method further comprises:
and if the return value of the printing service interface is not detected within the preset time, controlling the camera equipment not to photograph 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 device is controlled not to photograph the printing bill, and the testing efficiency of the intelligent bill printer is improved.
Further, in the testing method of the intelligent bill printer provided by the present invention, after the comparison result is obtained, the method further includes:
comparing the execution record with the comparison result;
if the execution record is the same as the comparison result, outputting the comparison result;
if the execution record is different from the comparison result, the comparison result is stored, and the printing bill pictures with different results and the corresponding expected test result pictures are manually judged.
According to the intelligent bill printer testing method, the printing test data results are collated by comparing each execution record with the corresponding printing test data results, manual secondary judgment is conducted when the collation results are different, and the testing accuracy of the intelligent bill printer is improved.
Further, in the testing method of the intelligent bill printer provided by the present invention, the comparing the printed bill picture with the expected test result picture specifically includes:
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, the similarity between 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 the intelligent bill printer testing are improved.
Further, the testing method for the intelligent bill printer provided by the invention further comprises the following steps after obtaining a plurality of comparison results:
when the comparison result obtained by the continuous preset times 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;
and 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.
The intelligent bill printer testing method provided by the invention can avoid the influence on the testing efficiency when the intelligent bill printer is out of paper or jammed, can timely alarm and remind people to change paper, and can send the testing result to people for judgment when the testing result is continuously abnormal without paper shortage or jammed, thereby improving the testing accuracy of the intelligent bill printer.
Further, the invention also provides a test method of the intelligent bill printer, which comprises the following steps:
after generating the corresponding expected test result picture according to the plurality of print test data, before controlling the intelligent bill printer to print according to each print test data in sequence, the method further comprises:
and controlling the intelligent bill printer to backup local logs.
The intelligent bill printer testing method provided by the invention backups the local log to the local machine when the printing test task starts, so that when the test process fails, the failure reason is positioned by analyzing the local log, and the testing efficiency of the intelligent bill printer is improved.
Further, in the intelligent bill printer testing method provided by the invention:
the printing bill is dragged through the tension motor barrel with preset force, and the preset force is smaller than the force required by the intelligent bill printer when the printing bill is dragged under the current posture.
According to the intelligent bill printer testing method, the preset force is set on the tension motor to drag the printed bills, so that the intelligent bill printer is prevented from being displaced due to excessive force, the tension end is controlled to stop when detecting all the contents of the printed bills until the shooting of the camera equipment is finished, the situation that all the contents of the printed bills are not displayed during shooting is avoided, the shooting effect is further influenced, errors are caused when the pictures of the expected testing results are compared, and the testing accuracy of the intelligent bill printer is improved.
Additionally, the invention also provides an intelligent bill printer test system, which comprises:
the system comprises an upper computer, an intelligent bill printer, camera equipment and a light source;
the intelligent bill printer and the camera equipment are both connected with the upper computer, and the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
the host computer includes:
the acquisition module is used for acquiring the printing test data and an expected test result picture corresponding to the printing 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 photograph the printing bill under a 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, comparing the printing bill picture with the expected test result picture and obtaining 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, which at least comprise the following technical effects:
(1) the printing bill is photographed under the light source with a fixed relative position, and the photographed result and the expected test result picture are compared through the PC end, so that the labor cost is saved, the error caused by manual comparison of the picture is avoided, and the testing efficiency and accuracy of the intelligent bill printer are improved;
(2) an expected test result picture is generated according to an expected printing bill, and the efficiency and accuracy of comparing the expected test result picture with the printing bill picture are improved;
(3) whether the printing test data is normally executed or not is judged according to the printing service interface return value, and the camera shooting equipment is controlled not to shoot 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 giving manual secondary judgment when the checking results are different, so that the test accuracy of the intelligent bill printer is improved;
(5) the method has the advantages that the test efficiency is prevented from being influenced when the intelligent bill printer is out of paper or jammed, the intelligent bill printer can be timely warned to remind people to change paper, and the test result is manually judged when the test result is continuously abnormal without the paper out or jammed, so that the test accuracy of the intelligent bill printer is improved;
(6) avoid exerting oneself too greatly to make intelligent bill printer take place the displacement, make and print the bill and not predetermineeing the position, and then influence the effect of shooing, lead to comparing the test result and appearing the error, improve the accuracy of intelligent bill printer test.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow chart of a method for testing an intelligent ticket printer according to the present invention;
FIG. 2 is a flow chart of a method of testing an intelligent ticket printer of the present invention;
FIG. 3 is another flow chart of the testing method of the intelligent bill printer of the present invention;
FIG. 4 is a flow chart of comparing a printed ticket image with an expected test result image in the testing method of the intelligent ticket printer according to the present invention;
FIG. 5 is another flow chart of the testing method of the intelligent ticket printer according to the invention;
FIG. 6 is a flow chart of the method for testing an intelligent bill printer according to the present invention, when the test result is continuously obtained and abnormal;
fig. 7 is a structural diagram of an intelligent bill printer test system according to the invention.
Reference numbers in the figures: the system 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 structures, 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 will 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, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically depicted, or only one of them is labeled. In this document, "one" means not only "only one" but also a case of "more than one".
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In addition, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to indicate or imply 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 be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
Example 1
An embodiment of the present invention, as shown in fig. 1, provides a method for testing an intelligent bill printer, which is applied to an upper computer connected to the intelligent bill printer and a camera device, and includes the steps of:
s100, expected test result pictures corresponding to the printing test data and the printing test data are obtained.
Specifically, the printing test data comprises samples printed in the testing process of the intelligent bill printer, each printing service interface is called by the printing test data, and different parameters are set according to the using scene, wherein the parameters comprise boundary values, illegal values, ultra-long texts, ultra-large pictures and the like.
The printing test data can be input after being manually selected and set in combination with the working scene of the intelligent bill printer, or can be automatically generated by a generation method or an intelligent generation model through matching the PC end with the working scene of the intelligent bill printer.
And according to the printing test data, acquiring a photographing result of the printing test data at a preset printing position as a printing test result picture.
S200, controlling the intelligent bill printer to print according to the printing test data and outputting the 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. The test process and the test result of the intelligent bill printer are not influenced no matter in any order represented by any order, and the intelligent bill printer is only controlled to print the test data one by one in sequence in the application and outputs the print bill.
S300, controlling the camera equipment to monitor the printing process, controlling the camera equipment to photograph 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.
Specifically, the relative positions of the camera device, the intelligent bill printer and the light source are fixed.
S400, receiving the printing bill picture, and comparing the printing 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 bill is photographed under the light source with the fixed relative position, the photographing result and the expected test result picture are compared through the PC end, labor cost is saved, errors caused by manual image comparison are avoided, and testing efficiency and accuracy of the intelligent bill printer are improved.
Example 2
Based on embodiment 1, as shown in fig. 2, in the testing method for an intelligent ticket printer provided by the present invention, step S100 obtains print test data and an expected test result picture corresponding to the print test data, and specifically includes:
s110 acquires print test data.
And S120, controlling the intelligent bill printer to output the expected printing bill according to the printing test data.
Specifically, the expected printing bill which meets the requirement is printed according to the printing test data. The judgment process can be judged by a human or a machine.
S130, controlling the camera equipment to shoot the expected printing bill under the light source, and outputting a corresponding expected test result picture.
Specifically, under the camera device, the intelligent bill printer and the light source with fixed relative positions, the camera device is controlled to photograph 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. Namely, objective environment elements such as light intensity, light color, light refraction and reflection condition and the like of the camera equipment when the expected printing bill is photographed and when the printing bill is photographed are the same.
And the PC end adopts a Pycharm tool to connect with an intelligent bill printer through a USB debugging line, and 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, so that preparation is made for matching of subsequent pictures, and the printed bill sample returned by the camera equipment is waited to be received.
The light source that the position that intelligent bill printer output end department set up is fixed can set up outside intelligent bill printer as independent equipment, 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 in the printing test data to generate identification printing test data.
Specifically, each marking data is used to add a mark at the beginning and end of the print content of the corresponding print ticket, respectively.
Illustratively, marking data is added at the beginning and end of each print test data according to the length of each print test data, so that the same line black block is added at the beginning and end of each order form.
Optionally, since all hatches of the intelligent bill printer are non-planar, it is recommended that 3 rows of blank lines are added at the beginning of each test bill and 5 rows of blank lines are added at the end of each test bill, so that the content of the print bill is pulled to a flat position, and the shooting by the camera equipment is facilitated.
And S220, controlling the intelligent bill printer to print according to the printing test data of the identification plate.
S230 outputs the print ticket.
Optionally, after the step S130 controls the image capturing apparatus to photograph the expected printing ticket under the light source and output the corresponding expected test result picture, before the step S210 adds the identification data to the printing test data and generates the identification printing test data, the method further includes the steps of:
s140, controlling the intelligent bill printer to backup the local log.
Specifically, when a printing test task starts, the intelligent bill printer stores a local log to the local machine through the adbshelllogcat, so that when a failure occurs in the test process, the failure reason is located by analyzing the local log.
Optionally, step S300 is to control the camera device to monitor the printing process, and when the camera device monitors the complete content of the printing ticket, the camera device is controlled to photograph the printing ticket under the light source, and output a corresponding printing ticket picture, which specifically includes:
s310 controls the image pickup apparatus to monitor the printing process.
And S320, when monitoring the complete content of the printing bill, controlling the camera to shoot the printing bill under the light source.
Specifically, monitoring the complete content of the print tickets includes the camera device detecting a mark at the beginning and a mark at the end of each print ticket simultaneously.
Through the mark that detects the place of starting simultaneously and the mark of end department, judge that the whole content of printing the bill is located camera equipment's the region of making a video recording, because the printing bill is all in the predetermined region of making a video recording by camera equipment at every turn, so the luminous environment that the printing bill was taken a picture at every turn is the same.
Alternatively, when the image pickup apparatus detects that the line black block at the end of the print ticket is located within the image pickup apparatus photographing area.
The printing bill begins to be printed from the starting position, printing is completed after the ending position is printed, and the printing area is sequentially entered from the starting position to the ending position, so that when a black block at the ending position of the printing bill is detected, all contents of the printing bill are judged to be located in the shooting area of the camera equipment, and meanwhile, the light environment for shooting the printing bill at each time is the same.
If print the bill from the printing of ending department, print after printing the starting department and accomplish, then only need detect the row black piece of the starting department of bill can.
S330, outputting the corresponding printing bill picture.
The intelligent bill printer testing method provided by the embodiment adds the mark at the preset position of the printing bill by controlling the intelligent bill printer, and controls the camera equipment to photograph the printing bill according to the mark, so that the content of each printing bill is complete when photographing, and the printing bills are all in the same light environment, thereby avoiding the influence on the judgment of the printing effect due to the change of the brightness and the color of the light source, saving the labor cost, and improving the accuracy and the efficiency between the comparison of the expected test result picture and the printing bill picture.
Example 3
Based on any one of embodiments 1 to 2, as shown in fig. 3 to 5, in the testing method for an intelligent ticket printer provided by the present invention, after the printed ticket is output in step S230, the method specifically includes:
s510 detects a print service interface return value of the smart ticket printer.
S520, if the return value of the printing service interface is detected, the execution record of the printing test data is stored to be normal.
Specifically, the intelligent bill printer receives a printing service interface return value each time printing is performed according to the printing test data.
Illustratively, at the end of each printing task, the intelligent bill printer needs to judge the return value of the printing service interface, if the return is successful, the execution result of each piece of printing test data of the intelligent bill printer is displayed to be normal at the test result of each piece of printing test data, and meanwhile, the number of normal use cases is increased by 1 at the test result counting position of the intelligent bill printer.
S531 if the print service interface return value is not detected within the preset time, storing the execution record of the print test data as abnormal.
Illustratively, at the end of each printing task, the intelligent bill printer needs to judge a printing service interface return value, if the return fails, the execution result exception of each piece of printing test data is displayed at the test result of each piece of printing test data of the intelligent bill printer, and meanwhile, the number of exception cases is increased by 1 at the test result statistics of the intelligent bill printer.
The preset time may be set to 1S, 3S, or 5S, etc.
By counting the execution records, the normal number and the abnormal number of the test cases can be more visually observed, and the test data fails to be printed.
Optionally, in step S531, if the print service interface return value is not detected within the preset time, after the execution record of the print test data is stored as an exception, the method further includes:
s532 controls the image pickup apparatus not to photograph the print ticket.
Specifically, after the printing bill is not photographed, the next printing test data is continuously tested.
Optionally, as shown in fig. 4, the step S400 receives the print ticket image, compares the print ticket image with the expected test result image, and obtains a comparison result, which specifically includes:
s410, comparing the printed bill picture with an expected test result picture through a preset test model to obtain the similarity.
Specifically, the printed test sample sheet and the correct bill sample sheet are compared through the script recorded in advance.
And S420, when the similarity is smaller than the preset threshold, judging that the comparison result is abnormal.
For example, if the similarity is less than 98%, the test result is determined to be abnormal. The value of the preset threshold can be set to 90%, 95%, 98%, or the like.
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 obtained 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 the print ticket image, compares the print ticket image with the expected test result image, and after obtaining the comparison result, further includes the steps of:
s610 compares the execution records with the comparison result.
S621 outputs the comparison result if the execution record is the same as the comparison result.
And S622, if the execution records are different from the comparison results, storing the comparison results, and manually judging the print bill pictures with different results and the corresponding expected test result pictures.
Specifically, after all the test data of printing are tested, comparing the test result stored by the PyCharm tool at the PC end with the test result counted by the intelligent bill printer, if the results at the two ends are the same, directly taking the result, and if the results at the two ends are not consistent, directly giving up the test result of the intelligent bill printer and carrying out manual judgment.
Optionally, after all the printing tasks are tested, the intelligent bill printer stores the counted test results to the local computer in a TXT format, so that the test results of the intelligent bill printer and the test results of the PC end PyCharm are compared, and a more complete test report summary is made.
According to the intelligent bill printer testing method provided by the embodiment, the similarity between 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, whether the printed test data are normally executed is judged according to the returned value of the printing service interface, the printed test data result is collated by comparing each execution record with the corresponding printed test data result, manual secondary judgment is carried out when the collation results are different, and the accuracy and the efficiency of intelligent bill printer testing are improved.
Example 4
Based on any one of embodiments 1 to 3, as shown in fig. 6, in the testing method for an intelligent ticket printer provided by the present invention, step S400 receives a printed ticket picture, compares the printed ticket picture with an expected test result picture, and after obtaining a comparison result, further includes the steps of:
and S430, when the obtained comparison result is abnormal for the preset times, comparing and testing the abnormal result picture.
Specifically, the test abnormality result picture is the print ticket picture when the comparison result is abnormal.
Because the interface return value of the intelligent bill printer only shows success or failure of interface execution and cannot represent success or failure of actual printing effect, when the interface return of the intelligent bill printer is successful but the intelligent bill printer is jammed and lacks paper, the camera shooting equipment continuously shoots and transmits the shot pictures back to PyCharm tool engineering specified catalog at the PC end.
Illustratively, if the Pycharm project end fails to determine 5 consecutive bills, the five bill sheets are compared and checked to see whether the contents are the same.
Optionally, the latest received 4 bill photos and the 5 th last bill photos are compared, and whether the printed bill contents are the same or not is checked.
And S441, when the test abnormal result pictures are the same, controlling the intelligent bill printer to stop printing and outputting an alarm instruction.
Specifically, if the two are the same, a phenomenon such as paper shortage or paper jam may occur, and if the phenomenon occurs, the smart ticket printer performs an alarm to indicate that the printer state is not ready. And meanwhile, the intelligent bill printer is controlled to stop executing the printing action, the connected camera equipment stops shooting, and the intelligent bill printer waits for the recovery of the intelligent bill printer. And after manually recovering the state of the printer, executing Pycharm engineering of the PC end again, 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 performing manual judgment on the test abnormal result picture.
Optionally, the printing bill is dragged by the tension motor barrel with a preset force in the printing test process, wherein the preset force is smaller than the force required by the printing bill to drag the intelligent bill printer in the current posture.
Illustratively, the pull end is configured as a pull motor spool, the print ticket is wound onto the spool, the spool is coupled to the motor, and the motor is configured to a predetermined force that pulls with motion and stops with no motion. This predetermine power can not be greater than and beat the power that printing paper dragged intelligent bill printer, otherwise can make intelligent bill printer take place the displacement, and the bill of printing out can not be in the central point of making a video recording and being equipped with focusing, and then influences the effect of shooing, just also influences the comparison test result of PC end Pycharm instrument simultaneously.
The printing bill picture that the contrast is unusual when obtaining the test result in succession avoids influencing efficiency of software testing when paper shortage or card paper appear in the intelligent bill printer to in time report to the police and remind the manual work to trade paper, and give the test result by artifical judgement when not appearing paper shortage or card paper but obtain the test result in succession unusually, improve the accuracy of intelligent bill printer test.
Example 5
In another embodiment of the present invention, as shown in fig. 7, the present invention provides an intelligent bill printer test system, which includes an upper computer 10, an intelligent bill printer 20, a camera device 30 and a light source 40, wherein the upper computer includes an obtaining module 11, a first control module 12, a second control module 13 and a comparison module 14.
The intelligent bill printer 20 and the camera device 30 are both 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 bill printer 20 is in communication connection with the upper 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 sending a print bill picture to the upper computer 10 after the print bill is photographed. The light source 40 is mounted at a fixed position at the bill exit of the intelligent bill printer 20.
And the acquisition module 11 in the upper computer 10 is used for acquiring the printing test data and an expected test result picture corresponding to the printing test data.
Specifically, the print test data includes samples printed during the test process of the intelligent bill printer 20, and the print test data calls each print service interface and sets different parameters according to the usage scenario, where the parameters include boundary values, illegal values, very long texts, very large pictures, and the like.
The printing test data can be input after being manually selected and set in combination with the working scene of the intelligent bill printer 20, or can be automatically generated by the upper computer 10 in combination with the working scene of the intelligent bill printer 20, correspondingly, a generation method or an intelligent generation model.
And according to the printing test data, acquiring a photographing result of the printing test data at a preset printing position as a printing test result picture.
The first control module 12 is connected with the obtaining module 11, and is used for controlling the intelligent bill printer 20 to print according to the printing test data and outputting the printing bill.
Optionally, after sequencing a plurality of print test data in an arbitrary order, the intelligent ticket printer 20 is controlled to print according to each print test data in sequence. Any sequence represents that the test process and the test result of the intelligent bill printer 20 are not affected by any sequence, and the method and the device only sequentially control the intelligent bill printer 20 to print the test data one by one and output the printing bill.
The second control module 13 is configured to control the camera device 30 to monitor a printing process, and when the camera device 30 monitors the complete content of a print ticket, control the camera device 30 to photograph the print ticket under the light source 40, and output a corresponding print ticket picture.
Illustratively, by the image pickup apparatus 30 recognizing the feature of the print ticket picture, 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 the camera device is controlled to photograph the actual printing test result under the irradiation of the fixed-position light source 40, a corresponding actual printing test result picture 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 that this embodiment provided is through shooing printing bill under the fixed light source in relative position to compare result of shooing and anticipated test result picture through the PC end, save the cost of labor, and avoid artifical contrast picture to produce the error, improve the efficiency and the accuracy of intelligent bill printer test.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or recited in detail in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed intelligent ticket printer testing method and system may be implemented in other ways. For example, the above-described embodiments of a method and system for testing a smart ticket printer are merely illustrative, and for example, the division of the modules or units is only a logical division, and in actual implementation, there may be other divisions, for example, multiple units or modules may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the communication links shown or discussed may be through interfaces, devices or units, or integrated circuits, and may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It should be noted that the above-mentioned embodiments are only preferred embodiments of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (11)

1. The intelligent bill printer testing method is applied to an upper computer connected with an intelligent bill printer and a camera device, and comprises the following steps:
acquiring printing test data and an expected test result picture corresponding to the printing test data;
controlling the intelligent bill printer to print according to the printing test data and outputting a printing bill;
controlling the camera equipment to monitor a printing process, controlling the camera equipment to photograph the printing bill under a light source when the camera equipment monitors the complete content of the printing bill, and outputting a corresponding printing bill picture, wherein the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
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.
2. The intelligent ticket printer testing method of claim 1, wherein the obtaining of the expected test result picture corresponding to the print test data and the print test data specifically comprises:
acquiring the printing test data;
controlling the intelligent bill printer to output an expected printing bill according to the printing test data;
and controlling the camera equipment to photograph the expected printing bill under the light source, and outputting a corresponding expected test result picture.
3. The method according to claim 1, wherein the controlling of the intelligent ticket printer to print according to the printing test data specifically comprises:
adding identification data in the printing test data to generate identification version printing test data; the identification data comprises a starting identification and an end identification, the starting identification is marked at the starting position of the printing content of the printing bill, and the end identification is marked at the end position 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 starting mark, the printing test data and the ending mark.
4. The method for testing an intelligent ticket printer of claim 1, wherein after the outputting of the print ticket, the method further comprises:
detecting a printing service interface return value of the intelligent bill printer;
if the printing service interface return value is detected, storing the execution record of the printing test data as normal;
and if the printing service interface return value is not detected within the preset time, storing the execution record of the printing test data as abnormal.
5. The method for testing the intelligent ticket printer of claim 4, wherein after detecting the print service interface return value of the intelligent ticket printer, the method further comprises:
and if the return value of the printing service interface is not detected within the preset time, controlling the camera equipment not to photograph the printing bill.
6. The intelligent ticket printer testing method of claim 4, after obtaining the comparison result, 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;
if the execution record is different from the comparison result, the comparison result is stored, and the printing bill pictures with different results and the corresponding expected test result pictures are manually judged.
7. The method according to claim 1, wherein the comparing the printed ticket image with the expected test result image specifically comprises:
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.
8. The method for testing an intelligent bill printer according to claim 7, wherein after obtaining the comparison result, the method further comprises:
when the obtained comparison result is abnormal for the 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;
and 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.
9. The method according to claim 1, wherein after the obtaining of the expected test result picture corresponding to the print test data and the print test data, before the controlling of the intelligent ticket printer to print according to the print test data, the method further comprises:
and controlling the intelligent bill printer to backup local logs.
10. The intelligent bill printer test method according to any one of claims 1 to 9, wherein:
the printing bill is dragged through the tension motor barrel with preset force, and the preset force is smaller than the force required by the intelligent bill printer when the printing bill is dragged under the current posture.
11. An intelligent ticket printer test system, comprising:
the system comprises an upper computer, an intelligent bill printer, camera equipment and a light source;
the intelligent bill printer and the camera equipment are both connected with the upper computer, and the relative positions of the camera equipment, the intelligent bill printer and the light source are fixed;
the host computer includes:
the acquisition module is used for acquiring the printing test data and an expected test result picture corresponding to the printing 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 photograph the printing bill under a 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, comparing the printing bill picture with the expected test result picture and obtaining a comparison result, wherein the comparison result is normal or abnormal.
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 true CN114083912A (en) 2022-02-25
CN114083912B 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
CN114083912B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN101579964B (en) Video-monitored printing machine
DE69131072T2 (en) Method and system for adapting a computer program command to a printer language
CN100381941C (en) Image forming apparatus, apparatus for supplying image data to image forming apparatus, and method of interfacing two apparatuses
US5786828A (en) Detachable print unit having updatable condition memory and printer using the same
CN112801976B (en) Detection system and method for correcting binding mispasting of books and periodicals and computer device
DE69615738T2 (en) Imaging apparatus and method therefor
EP3255871B1 (en) Recording of sound information and document annotations during a meeting.
CN108872265A (en) Detection method, device and system
US20070139703A1 (en) Print inspecting apparatus
CN108107226B (en) PPC software-based AOI multi-station system and method
US20090202134A1 (en) Print inspecting apparatus
US10331392B1 (en) Image forming operation monitoring systems and methods
JP2022029702A (en) Learning system, electronic device, control method thereof, and program
DE69233395T2 (en) Method and arrangement for data output
WO2000060480A1 (en) Automated document inspection system
CN114083912A (en) Intelligent bill printer testing method and system
CN107844516A (en) Digital online test method and system
CN108052895A (en) The method that remote handle aids in self-service lottery ticket terminal recognition minor
US10073654B1 (en) Image forming operation monitoring systems and methods
CN103984967A (en) Automatic detection system and automatic detection method applied to commodity label detection
CN111874768B (en) Method, device, equipment and system for detecting installation state of elevator component
CN115526859A (en) Method for identifying production defects, distributed processing platform, equipment and storage medium
US10241735B1 (en) Image forming operation monitoring systems and methods
CN114119121A (en) Method, device, storage medium and processor for issuing commodity material
CN219325660U (en) Identification and printing integrated machine

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