CN104462197A - Method for obtaining information from print data - Google Patents

Method for obtaining information from print data Download PDF

Info

Publication number
CN104462197A
CN104462197A CN201410599780.6A CN201410599780A CN104462197A CN 104462197 A CN104462197 A CN 104462197A CN 201410599780 A CN201410599780 A CN 201410599780A CN 104462197 A CN104462197 A CN 104462197A
Authority
CN
China
Prior art keywords
print data
data
mcu
print
preset information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410599780.6A
Other languages
Chinese (zh)
Inventor
王辉堂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN201410599780.6A priority Critical patent/CN104462197A/en
Publication of CN104462197A publication Critical patent/CN104462197A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/1285Remote printer device, e.g. being remote from client or server
    • G06F3/129Remote printer device, e.g. being remote from client or server in server-printer device-client configuration, e.g. print flow goes from server to printer and then bidirectional from printer to client, i.e. the client does not communicate with the server

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Cash Registers Or Receiving Machines (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a method for obtaining information from print data. An MCU, a random access memory and a nonvolatile storage device need to be provided for the method. The method comprises the following steps that (1) the MCU receives and stores preset information; (2) the MCU monitors a printing peripheral interface of an upper computer in real time; (3) when the upper computer issues the print data and the MCU monitors the print data, the MCU stores the print data into a cache region of the random access memory; (4) when the print data reach a complete data package, the MCU obtains the print data and the preset information from the cache region and the nonvolatile storage device respectively, keyword matching is conducted through a keyword matching algorithm, and after matching succeeds, the digits or text after or before keywords in the print data is target data; (5) the MCU obtains the target data from the print data package and sends the target data to a data receiver. By means of the method, the compatibility is improved, and the data needed by a user are quickly obtained from the print data.

Description

A kind of method of obtaining information from print data
Technical field
The present invention relates to a kind of Design of Digital Circuit, embedded system technology field, particularly relate to a kind of method of obtaining information from print data.
Background technology
The method of current acquisition consumption data, is mainly obtained by the mode that software program controls.First need to provide software interface by POS, then third party software obtains consumption data by this interface.Its shortcoming is as follows: the POS of different manufacturers exploitation is incompatible, so must develop corresponding version respectively for each POS; Because the workload of software development causes greatly with high costs, after installation, may system instability be caused, the more time need be spent to debug; Because needs install third party software in POS, add the risk (as virus etc.) of leaking data; In addition, existing technology is difficult to realize the quick data only obtained from print data required for user.
Summary of the invention
The technical problem to be solved in the present invention, be a kind of method that obtaining information from print data is provided, the present invention is with micro-control unit, namely MCU is as process core, reduce cost of development and the security risk of software, simultaneously can the cashier's machine of compatible different size and cash register software, from print data, target data can be used for the commercial activities such as advertisement, and can realize collection and the application of the large data of solid shop/brick and mortar store in conjunction with mobile phone application and cloud storage.
The present invention is achieved in that
Scheme one:
A method for obtaining information from print data, described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory and a nonvolatile memory, and described method comprises the steps:
Step 1, MCU receive preset information by wireless data communication interface and are stored in nonvolatile memory by preset information, and described preset information is that user carries out artificial sets itself according to the form of the characteristic sum cash register receipt of target data;
Step 2, the MCU printing Peripheral Interface to a host computer is monitored in real time;
Step 3, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area in random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 4, after the print data in buffer area reaches a complete packet, MCU obtains print data and preset information respectively from buffer area and nonvolatile memory, by Keyword-method-arit hmetic, print data and preset information are carried out keyword match, when matching preset information from print data, in print data after key word or front numeral or text be target data;
Step 5, MCU receive target data from print data bag, and after target data is sent to data sink by wireless data communication interface, then start the reception of next complete packet.
Further, described host computer is PC machine or cashier's machine.
Further; the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold; after MCU has monitored print data, start data to be saved in buffer zone; after monitoring host computer stopping transmission data, begin through a timer carry out timing; after the timing time of timer reaches described time threshold; buffer memory is suspended in the buffer zone of random access memory, then all print datas received in this time threshold are a complete packet.
Further, the target data in described step 1 comprises: total charge, trade name, commodity code, commodity amount or cargo price.
Further, described data sink is server or mobile phone.
Scheme two:
A method for obtaining information from print data, described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory, and described method comprises the steps:
Step 10, be stored in data sink by preset information, described preset information is that user carries out artificial sets itself according to the form of the characteristic sum cash register receipt of target data;
Step 20, the MCU printing Peripheral Interface to a host computer is monitored in real time;
Step 30, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area in random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 40, after the print data in buffer area reaches a complete packet, MCU obtains print data from buffer area, and print data is sent to data sink by wireless data communication interface by MCU;
Print data and preset information are carried out keyword match by Keyword-method-arit hmetic by step 50, data sink, when matching preset information from print data, in print data after key word or front numeral or text be target data, then data sink receives the target data obtained from print data bag, and then MCU starts the reception of next complete packet again.
Further, described host computer is PC machine or cashier's machine.
Further; the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold; after MCU has monitored print data, start data to be saved in buffer zone; after monitoring host computer stopping transmission data, begin through a timer carry out timing; after the timing time of timer reaches described time threshold; buffer memory is suspended in the buffer zone of random access memory, then all print datas received in this time threshold are a complete packet.
Further, in described step 10, target data comprises: total charge, trade name, commodity code, commodity amount or cargo price.
Further, described data sink is server or mobile phone.
The present invention is using micro-control unit as process core, and adopt and connect bottom monitoring technique to printing interface direct, the mode combined by soft or hard obtains consumption data.Its advantage is as follows: adopt and monitor with the technology obtaining consumption data printing interface bottom, all irrelevant with POS, operating system, can be applicable to the cashier's machine of existing all size on a large scale; Plug and play, makes software development, installation cost reduction; Only extracting data from printing interface, without the need to installing third party software in POS, reducing security risk; The data only obtained from print data fast required for user are realized by the preset information of user's sets itself.
Accompanying drawing explanation
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is theory diagram of the present invention.
Fig. 2 is the process flow diagram downloading preset information in method of the present invention.
Fig. 3 is the method flow diagram of the present invention program one.
Fig. 4 is the method flow diagram of the present invention program two.
Embodiment
Scheme one
Refer to shown in Fig. 1 to Fig. 3, be a preferred version of the inventive method, this preferred version is: described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory and a nonvolatile memory, and described method comprises the steps:
After step 1, operating personnel set preset information on data sink, preset information is handed down to MCU by network by data sink, MCU receives preset information by wireless data communication interface and is stored in nonvolatile memory by preset information, to obtain " total charge ", preset information is set for " receivable " or " total ";
Step 2, each hardware of first initialization, monitored the printing Peripheral Interface of a host computer in real time by MCU, whether issues print data in order to detect host computer; Described host computer is PC machine or cashier's machine;
Step 3, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area in random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 4, after the print data in buffer area reaches a complete packet, MCU obtains print data and preset information respectively from buffer area and nonvolatile memory, by Keyword-method-arit hmetic, print data and preset information are carried out keyword match, namely program is retrieved print data bag, when matching preset information from print data, the numeral in print data after " receivable " is the numerical value of " total charge " that will obtain;
Step 5, MCU receive target data from print data bag, described target data is the numerical value of total charge, then after target data is sent to data sink by wireless data communication interface by MCU, start the reception of next complete packet again, described data sink is server or mobile phone.
If target data is: trade name, commodity code, commodity amount or cargo price, the preset information of its correspondence is then set, this preset information comprises key word " name of an article ", " coding ", " quantity ", the sequencing of " unit price " and these four kinds of data, as being from left to right followed successively by " name of an article ", " coding ", " quantity ", " unit price ", by Keyword-method-arit hmetic, print data and preset information are carried out keyword match, when matching key word from print data, according to the numeric string that sequencing acquires successively from the print data of often going, be " trade name ", " commodity code ", the numerical value of " commodity amount " or " cargo price ".
In the present invention; the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold; after MCU has monitored print data, start data to be saved in buffer zone; after monitoring host computer stopping transmission data, begin through a timer carry out timing; after the timing time of timer reaches described time threshold; buffer memory is suspended in the buffer zone of random access memory, then all print datas received in this time threshold are a complete packet.
Above-mentioned printing Peripheral Interface comprises: the wave points such as parallel port, serial ports, USB, Ethernet interface and bluetooth; Wireless data communication interface comprises: the wave point such as bluetooth, Wifi, GPRS, 3G, 4G; This print data is in the present invention based on the print data of bill.
Scheme two
As described in Fig. 2 and Fig. 4, another program of the present invention: a kind of method of obtaining information from print data, described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory, and described method comprises the steps:
Step 10, operating personnel set preset information on data sink, to obtain " total charge ", arrange preset information for " receivable " and " total ";
Step 20, each hardware of first initialization, monitored the printing Peripheral Interface of a host computer in real time by MCU, whether issues print data in order to detect host computer; Described host computer is PC machine or cashier's machine;
Step 30, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area in random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 40, after the print data in buffer area reaches a complete packet, MCU obtains print data from buffer area, and print data is sent to data sink by wireless data communication interface by MCU;
Print data and preset information are carried out keyword match by Keyword-method-arit hmetic by step 50, data sink, namely program is retrieved print data bag, when matching preset information from print data, the numeral in print data after " receivable " is the numerical value of " total charge " that will obtain; Then data sink obtains target data from print data bag, and described target data is the numerical value of total charge, and then MCU starts the reception of next complete packet again, and described data sink is server or mobile phone.
If target data is: trade name, commodity code, commodity amount or cargo price, the preset information of its correspondence is then set, this preset information comprises key word " name of an article ", " coding ", " quantity ", the sequencing of " unit price " and these four kinds of data, as being from left to right followed successively by " name of an article ", " coding ", " quantity ", " unit price ", by Keyword-method-arit hmetic, print data and preset information are carried out keyword match, when matching key word from print data, according to the numeric string that sequencing acquires successively from the print data of often going, be " trade name ", " commodity code ", the numerical value of " commodity amount " or " cargo price ".
In the present invention; the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold; after MCU has monitored print data, start data to be saved in buffer zone; after monitoring host computer stopping transmission data, begin through a timer carry out timing; after the timing time of timer reaches described time threshold; buffer memory is suspended in the buffer zone of random access memory, then all print datas received in this time threshold are a complete packet.
Above-mentioned printing Peripheral Interface comprises: the wave points such as parallel port, serial ports, USB, Ethernet interface and bluetooth; Wireless data communication interface comprises: the wave point such as bluetooth, Wifi, GPRS, 3G, 4G; This print data is in the present invention based on the print data of bill.
Specific works principle of the present invention is as follows:
First preset information has been downloaded, then carry out of MCU to the printing Peripheral Interface of host computer is monitored in real time, when having monitored data, buffer memory is carried out to data, after receiving complete packet, pass through Keyword-method-arit hmetic, and in conjunction with preset information, from print data, obtain the information such as " total charge ", " trade name ", " commodity amount ", " cargo price ".Again by wireless communication interface, as bluetooth, WIFI etc., send to mobile phone or server.The execution of Algorithm Analysis can have two kinds of modes: after Fig. 3, MCU receive data, by MCU execution analysis, analysis result issues mobile phone or server by wireless communication interface; After Fig. 4, MCU receive data, be all uploaded to mobile phone or server, obtain information needed by mobile phone or server oneself execution analysis.
In addition, data source is printing interface, and data content is shopping list, and the computing main body of data analysis is plug-in embedded device or data sink (scheme two), the mode that analytical approach adopts keyword match to combine with receipt format information; Preset information is that user carries out artificial sets itself according to the form of the characteristic sum cash register receipt needing target data, wherein
The feature of data comprises: the key word of data
The form of cash register receipt comprises: the content on receipt and arrangement thereof.
Although the foregoing describe the specific embodiment of the present invention; but be familiar with those skilled in the art to be to be understood that; specific embodiment described by us is illustrative; instead of for the restriction to scope of the present invention; those of ordinary skill in the art, in the modification of the equivalence done according to spirit of the present invention and change, should be encompassed in scope that claim of the present invention protects.

Claims (10)

1. the method for obtaining information from print data, described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory and a nonvolatile memory, it is characterized in that: described method comprises the steps:
Step 1, MCU receive preset information by wireless data communication interface and are stored into by preset information in MCU, random access memory and nonvolatile memory nonvolatile memory, and described preset information is that user carries out artificial sets itself according to the form of the characteristic sum cash register receipt of target data;
Step 2, the MCU printing Peripheral Interface to a host computer is monitored in real time;
Step 3, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area of random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 4, after the print data in buffer area reaches a complete packet, MCU obtains print data and preset information respectively from buffer area and nonvolatile memory, by Keyword-method-arit hmetic, print data and preset information are carried out keyword match, when matching preset information from print data, in print data after key word or front numeral or text be target data;
Step 5, MCU obtain target data from print data bag, and after target data is sent to data sink by wireless data communication interface, then start the reception of next complete packet.
2. the method for a kind of obtaining information from print data according to claim 1, is characterized in that: described host computer is PC machine or cashier's machine.
3. the method for a kind of obtaining information from print data according to claim 1, it is characterized in that: the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold, after MCU has monitored print data, start data to be saved in buffer zone, after monitoring host computer stopping transmission data, begin through a timer carry out timing, after the timing time of timer reaches described time threshold, buffer memory is suspended in the buffer zone of random access memory, the all print datas then received in this time threshold are a complete packet.
4. the method for a kind of obtaining information from print data according to claim 1, is characterized in that: the target data in described step 1 comprises: total charge, trade name, commodity code, commodity amount or cargo price.
5. the method for a kind of obtaining information from print data according to claim 1, is characterized in that: described data sink is server or mobile phone.
6. the method for obtaining information from print data, described method need provide a kind of data terminal equipment, and this equipment comprises a MCU, a random access memory, it is characterized in that: described method comprises the steps:
Step 10, be stored in data sink by preset information, described preset information is that user carries out artificial sets itself according to the form of the characteristic sum cash register receipt of target data;
Step 20, the MCU printing Peripheral Interface to a host computer is monitored in real time;
Step 30, when host computer issues print data, when MCU has monitored print data, print data is stored in the buffer area in random access memory by MCU, until the print data in buffer area reaches a complete packet;
Step 40, after the print data in buffer area reaches a complete packet, MCU obtains print data from buffer area, and print data is sent to data sink by wireless data communication interface by MCU;
Print data and preset information are carried out keyword match by Keyword-method-arit hmetic by step 50, data sink, when matching preset information from print data, in print data after key word or front numeral or text be target data, then data sink obtains target data from print data bag, and then MCU starts the reception of next complete packet again.
7. the method for a kind of obtaining information from print data according to claim 6, is characterized in that: described host computer is PC machine or cashier's machine.
8. the method for a kind of obtaining information from print data according to claim 6, it is characterized in that: the judgment mode that described print data reaches a complete packet is: in MCU, arrange a time threshold, after MCU has monitored print data, start data to be saved in buffer zone, after monitoring host computer stopping transmission data, begin through a timer carry out timing, after the timing time of timer reaches described time threshold, buffer memory is suspended in the buffer zone of random access memory, the all print datas then received in this time threshold are a complete packet.
9. the method for a kind of obtaining information from print data according to claim 6, is characterized in that: in described step 10, target data comprises: total charge, trade name, commodity code, commodity amount or cargo price.
10. the method for a kind of obtaining information from print data according to claim 6, is characterized in that: described data sink is server or mobile phone.
CN201410599780.6A 2014-10-31 2014-10-31 Method for obtaining information from print data Pending CN104462197A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410599780.6A CN104462197A (en) 2014-10-31 2014-10-31 Method for obtaining information from print data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410599780.6A CN104462197A (en) 2014-10-31 2014-10-31 Method for obtaining information from print data

Publications (1)

Publication Number Publication Date
CN104462197A true CN104462197A (en) 2015-03-25

Family

ID=52908233

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410599780.6A Pending CN104462197A (en) 2014-10-31 2014-10-31 Method for obtaining information from print data

Country Status (1)

Country Link
CN (1) CN104462197A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105005889A (en) * 2015-07-03 2015-10-28 杭州玄日网络科技有限公司 Method for acquiring cashing data in rapid and low-cost way
CN105321271A (en) * 2015-05-11 2016-02-10 北京互帮国际技术有限公司 Hub framework for acquiring printing data of internet access printer
CN106095350A (en) * 2016-07-21 2016-11-09 江苏沁恒股份有限公司 A kind of USB printer data monitoring analyzes system and method
CN110533848A (en) * 2019-08-07 2019-12-03 北京数衍科技有限公司 Interception parallel port cash register print data and the method and system for pursuing and attacking additional information

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750895A (en) * 2012-06-28 2012-10-24 宇龙计算机通信科技(深圳)有限公司 Intelligent building information terminal and system as well as communication method
CN103062986A (en) * 2012-10-11 2013-04-24 惠州Tcl家电集团有限公司 Refrigerator food information input method and system
CN103279312A (en) * 2013-06-09 2013-09-04 王辉堂 Method for implanting information into printing data
CN103544329A (en) * 2013-10-30 2014-01-29 江苏众瀛联合数据科技有限公司 Collecting method of consumption information

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102750895A (en) * 2012-06-28 2012-10-24 宇龙计算机通信科技(深圳)有限公司 Intelligent building information terminal and system as well as communication method
CN103062986A (en) * 2012-10-11 2013-04-24 惠州Tcl家电集团有限公司 Refrigerator food information input method and system
CN103279312A (en) * 2013-06-09 2013-09-04 王辉堂 Method for implanting information into printing data
CN103544329A (en) * 2013-10-30 2014-01-29 江苏众瀛联合数据科技有限公司 Collecting method of consumption information

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105321271A (en) * 2015-05-11 2016-02-10 北京互帮国际技术有限公司 Hub framework for acquiring printing data of internet access printer
CN105005889A (en) * 2015-07-03 2015-10-28 杭州玄日网络科技有限公司 Method for acquiring cashing data in rapid and low-cost way
CN106095350A (en) * 2016-07-21 2016-11-09 江苏沁恒股份有限公司 A kind of USB printer data monitoring analyzes system and method
CN110533848A (en) * 2019-08-07 2019-12-03 北京数衍科技有限公司 Interception parallel port cash register print data and the method and system for pursuing and attacking additional information
CN110533848B (en) * 2019-08-07 2022-08-02 北京数衍科技有限公司 Method and system for intercepting parallel cash register printing data and tracing additional information

Similar Documents

Publication Publication Date Title
CN105900466B (en) Message processing method and device
KR102105636B1 (en) Installing application remotely
US11765557B2 (en) Short message processing method and apparatus, and electronic device
CN108701038B (en) Method for displaying advertisement by terminal, terminal and advertisement delivery system
CN106126256B (en) A kind of driven management method, apparatus and system
CN107908952B (en) Method and device for identifying real machine and simulator and terminal
CN104462197A (en) Method for obtaining information from print data
CN105357204B (en) Method and device for generating terminal identification information
CN104572564A (en) Method for realizing communication of Android mobile equipment and USB OTG (On-The-Go) host computer
CN202364280U (en) Cloud mobile phone and individual cloud server communication system
CN104021018A (en) Terminal, upgrade patch generation method and upgrade patch recognition method
Tuset et al. Openmote+: a range-agile multi-radio mote
CN107003907A (en) A kind of data processing method and data processing equipment
CN105592479A (en) Method for performing wireless upgrading on monitoring terminal device through mobile phone
MY172783A (en) Application popularization method, device and system
CN103685515A (en) Method and system for downloading application
CN204904449U (en) A half automatic checkout device for detecting bimodulus takes accuse electric energy meter expense accuse function
CN103577281A (en) Method and system for recovering data
CN116541865A (en) Password input method, device, equipment and storage medium based on data security
CN106657254B (en) A kind of synchronous method of contact information, apparatus and system
CN104978222A (en) System update detection method and apparatus
US20170168796A1 (en) Method and electronic apparatus for transferring application program from pc to mobile apparatus
CN104361505A (en) Method for automatically matching electronic bills from electronic bill card bag
CN204989453U (en) A full automatic checkout device for detecting bimodulus takes accuse electric energy meter expense accuse function
CN102769663A (en) Server, method and system for transmitting information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150325

WD01 Invention patent application deemed withdrawn after publication