Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Fig. 2 shows the realization flow of the invoice generation method that the embodiment of the present invention one provides.
As shown in Figure 2, the realization flow of invoice generation method is in detail:
In step s 201, the denomination numerical value of invoice is obtained.
In the present embodiment, the denomination numerical value of described invoice is the denomination size needing the invoice printed.When invoice printed by needs, obtain the invoice denomination numerical value needing to print.
In step S202, convert the described invoice denomination numerical value got to binary number.
In the present embodiment, after getting the denomination numerical value of invoice, described numerical value is converted to binary number.The conversion regime of described binary number can pass through ten/bis-code translator conversions, mcu programming conversion etc.Concrete conversion regime will describe in detail in subsequent embodiment, repeat no more herein.
In step S203, draw except or choose according to the value of described binary number on each the position power that on invoice paper, institute's rheme is corresponding, obtain the invoice of required denomination numerical value.
In the present embodiment, described invoice paper is printed on unified admission fee value in full, described admission fee value in full is expressed as continuous n binary digit power sum from 1.As Fig. 3 shows the invoice that admission fee in full is expressed as continuous 7 binary digits power sum from 1.
After converting the described invoice denomination numerical value got to binary number, draw except position power corresponding to institute's rheme on invoice paper, to obtain the invoice of required denomination numerical value according to the value of described binary number on each;
Or
The position power that on invoice paper, institute's rheme is corresponding is chosen, to obtain the invoice of required denomination numerical value according to the value of described binary number on each.
As an exemplifying embodiment of the present invention, the invoice denomination numerical value got is " 76 ", and converting described numerical value " 76 " to 7 bits represents, is 1001100." 1 " of binary number on each represents the position weights choosing this, " 0 " represents the position weights not choosing this, then draw except position weights " 32 ", " 16 ", " 2 " " 1 ", and residue is not drawn the position weights removed and added up to 76, namely described invoice is " 76 yuan " invoice, as shown in Figure 4.
In the present invention, the physical dimension of invoice is unified, nominal value is printed on the amount of money weighed by binary digit and represent.When printing invoice, obtain the denomination numerical value of invoice, convert described numerical value to binary number representation, draw except or choose according to the value of described binary number on each the position power that on invoice paper, institute's rheme is corresponding, thus obtain the invoice of required denomination numerical value, to realize printing invoice.The present invention compared with prior art, the beneficial effect existed is: can unify existing invoice physical dimension, realize the occasion of settling accounts at the scene in real time as required automatic printing ticket with draw a bill, simplify original invoice and print operation, improve the printing speed of invoice, especially solve existing invoice and print the problem that scheme cannot meet the traffic capacity requirement of AFC system in speed.
embodiment two
The invoice generation method that Fig. 5 shows the embodiment of the present invention two to be provided is applied to the specific implementation flow process of AFC system.
As shown in Figure 5, described method comprises:
In step S501, when receiving enabling signal, enter the slave mode that invoice is printed.
In the present invention, described enabling signal is for controlling the slave mode whether entering invoice printing.When receiving enabling signal, indicating that passenger by bus, then enter the slave mode that invoice is printed, performing step S502; Otherwise keep original uncontrolled state.The slave mode that described invoice is printed will keep a period of time.In the slave mode time period that described invoice is printed, invoice can be printed according to instruction.
As an exemplifying embodiment of the present invention, in subway, described enabling signal is the gate opening signal at subway gateway place.When receiving gate and carrying out once normal " open/close " signal, enter the slave mode printing invoice.
As another exemplifying embodiment of the present invention, on bus, the signal inputted when described enabling signal is and swipes the card; Or during passenger's coin payment, by enabling signal described in driver's control inputs.When receiving enabling signal, enter the slave mode that invoice is printed.
During the uncontrolled state that invoice is printed, even if receive the instruction that invoice prints, not perform invoice yet and print, thus specification invoice get mode, prevent that passenger takes invoice.
In step S502, in the slave mode that invoice is printed, when receiving the instruction printing invoice, obtain the denomination numerical value of invoice according to the cost information of input, by described value storage in the register of specifying.
In the present embodiment, if when receiving the instruction of printing invoice of passenger's input, according to pre-enter or the swipe the card cost information of input of passenger obtain the denomination numerical value of invoice.Preferably, the instruction of described printing invoice is inputted by pressing " switch of drawing a bill " by user.In the present invention, the quantity of register is set according to the maximal value of invoice denomination numerical value in advance, makes each register store a position of described numerical value.Such as, when invoice denomination numerical value is two integers, two registers are set, store the ASC II yard of numeral on ten of described numerical value and a position respectively; Again such as, invoice denomination numerical value is integral part when being the decimal of two, arranges three registers, stores ten of described numerical value respectively, the ASC II yard of numeral in individual position and decimal place.
As an exemplifying embodiment of the present invention, bus is the form of fixed fee, pre-sets the numerical value that described cost information is unified standard.When slave mode receives the instruction printing invoice, directly obtain the denomination numerical value of invoice according to described cost information.Preferably, before being applied to bus, described cost information pre-sets, to adapt to the different expenses standard in different regions.
As another exemplifying embodiment of the present invention, the cost information of input when described cost information is user card punching paying.When slave mode receives the instruction printing invoice, the cost information of input when paying according to user card punching obtains the denomination numerical value of invoice.
In step S503, from register, read described numerical value, convert described numerical value to binary number.
In the present invention, describedly from register, read described numerical value, the concrete steps described numerical value being converted to binary number are:
Read the low 4 of the ASC II yard stored in each register, the input of composition code translator, code translator converts corresponding binary number to according to described input.
ASC II yard (AmericanStandardCodeforInformationInterchange) is a set of standard code set in order to computing machine carries out data input and output process, is made up of 7 or 8 bit binary number.ASC II code table as shown in Table 1 can find, with regard to the expression of numeral, low 4 in ASC II yard is the same with the digital numerical value be expressed.
Scale-of-two |
Scale-of-eight |
Sexadecimal |
The decimal system |
Character |
00110000 |
60 |
30 |
48 |
0 |
00110001 |
61 |
31 |
49 |
1 |
00110010 |
62 |
32 |
50 |
2 |
00110011 |
63 |
33 |
51 |
3 |
00110100 |
64 |
34 |
52 |
4 |
00110101 |
65 |
35 |
53 |
5 |
00110110 |
66 |
36 |
54 |
6 |
00110111 |
67 |
37 |
55 |
7 |
00111000 |
70 |
38 |
56 |
8 |
00111001 |
71 |
39 |
57 |
9 |
Table 1
In the present invention, convert the input of low 4 compositions of described ASC II yard to corresponding binary number by ten/bis-code translators to export.
Fig. 6 shows the transition diagram of the invoice denomination numerical value based on seven bits (denotable invoice denomination maximal value is 127 yuan).The input of ten/bis-code translators in Fig. 6 is from two storeies, and described register is eight bit register, stores the individual position of invoice denomination numerical value and the ASC II yard of ten upper numerals respectively.The ASC II yard of the numeral in Fig. 6 on a position is stored on register A, and the ASC II yard of the numeral on ten is stored on storer B.It should be noted that to only have two registers in figure, store the numeral on ten and a position respectively, therefore actual storable invoice denomination maximal value is " 99 yuan ".
As an exemplifying embodiment of the present invention, the invoice denomination numerical value got is " 33 yuan ", and the ASC II yard that the register B in Fig. 6 stores is 33(00110011), the ASC II yard that register A stores is 33(00110011).That reads in each register is low 4, composition code translator input 0110011.After decoder for decoding, 7 bit Y of output
7y
6y
5y
4y
3y
2y
1be 0100001.Table 2 shows the truth table of ten/bis-code translators, can obtain the transfer standard of decimal number input variable and 7 bit output variables from table.
In step S504, control corresponding stamp action according to the value of described binary number on each.
In the present embodiment, each of binary number is corresponding controls a stamp, controls corresponding stamp action according to the value of described binary number on each.Described stamp action refers to that stamp impact is in the position power that invoice paper is corresponding; Pattern can be printed off on invoice paper, to draw except position weights during described stamp impact invoice paper.
Described invoice paper is printed on unified admission fee value in full, described admission fee value in full is expressed as continuous n binary digit power sum from 1.As Fig. 3 shows the invoice paper that admission fee in full is expressed as continuous 7 binary digits power sum from 1, the valuation unit that described invoice paper represents is 1 yuan, and denotable invoice denomination scope is 1 to 127 yuan.
The mode why adopting binary digit to weigh, to represent denomination, is because described method for expressing can be connected with the taxi meter circuit of original AFC system easily.The display of all data in modern electronic technology, transmission, control are all based on binary number, and the process of data is all be a base unit with 8 scale-of-two, i.e. byte (Byte).Further, because this method is applied in AFC system, the numerical range represented by 7 bit binary number is adopted enough to use.
Table 2
As an exemplifying embodiment of the present invention, in the printing process of invoice, only the position weights not participating in adding up need be drawn and remove, denomination that is that do not draw the position weights addition removed and that be invoice.Such as, when represent that denomination is the invoice of " 3 yuan ", position weights " 4 " " 8 " " 16 " " 32 " " 64 " " 128 " are drawn and removes.The described stroke of method removed is in the process printing invoice, position power is marked with special symbol.
When printing invoice, the present invention adopts action paper printing technology, and described invoice paper is action paper.The one side that described stamp contacts with invoice paper is provided with the pattern by the number of marking.Invoice paper, when being subject to stamp impact, can print out pattern.The number of described stamp is identical with the figure place of binary number.Such as, when described binary number is seven bit, then the number of stamp is seven.Each corresponding control stamp of binary number.
Why adopt action paper printing technology, be, after being made into stamp because of use wear-resistant metal material, not needing in the process of use often to safeguard and replacing, the expense of plant maintenance can be saved, and be more suitable for the large subway station use of the volume of the flow of passengers.
As an exemplifying embodiment of the present invention, as shown in Figure 6, described code translator is input as 0110011, and the binary number of output is Y
7y
6y
5y
4y
3y
2y
1=0100001, the position weights 64,32,16,8,4,2,1 respectively on corresponding invoice paper.Described binary number becomes 1011110 after reverser.When output on each is " 1 ", stamp action will be driven, impact on invoice paper.The one side that described stamp contacts with invoice paper is printed on the pattern with marking, as shown in Figure 7, for drawing except position weights.After stamp release, the stamped patterns shown in Fig. 7 will be imprinted on position power " 64 ", " 16 ", " 8 ", " 4 ", " 2 ", obtain invoice as shown in Figure 8.Can obtain from Fig. 8, residue is not drawn the position weights removed and is added up to " 33 ".Therefore, Figure 8 shows that the invoice of admission fee " 33 yuan ".
In step S505, after stamp release, drive rubber roll to drive invoice paper to march to assigned address, drive cut-off knife cutting invoice paper.
In the present embodiment, the form that described invoice paper is rolled up with axle is installed, and is driven advance forward by rubber roll.Described invoice paper is printed on for determining that invoice paper marches to the locating spot of assigned address, as shown in Figure 9.The light reflection that photoelectric tube can emit by invoice paper is to photosensitive tube.In the traveling process of invoice paper, the light reflection that photoelectric tube is launched by invoice paper, to photosensitive tube, makes optoelectronic switch export as high level.When invoice paper marches to assigned address, when the locating spot on invoice paper faces photoelectricity/photosensitive tube pair, photosensitive tube does not receive the reflection ray that photoelectric tube is launched, and the output of optoelectronic switch is low level, stops advancing to control invoice paper.The position that invoice paper stops is the position that cut-off knife aligns with the dotted line on invoice paper, and the position weights that lower one page invoice paper is printed on and stamp one_to_one corresponding.After invoice paper marches to assigned address, drive cut-off knife along invoice paper dotted line cutting invoice, thus complete printing and the output of invoice, obtain the invoice of uniform specification.
Provide the embody rule scene adopting above-described embodiment below.
Invoice paper is action paper, and it is printed on continuous 5 binary digits power sum from 1, the valuation unit of described invoice paper is 1 yuan, and the expression scope of invoice denomination is 1 to 31 yuan.It is corresponding that number is weighed in number and the position of stamp, be also 5, and the one side that stamp contacts with invoice paper is provided with pattern as shown in Figure 7.Valuation unit of the present invention is " 1 yuan ", and when passenger goes out lock after taking subway, the step printing invoice is as follows:
When reception gate carries out the signal of one subnormal " open/close ", enter the slave mode printing invoice.
During the slave mode printing invoice, receive the instruction that passenger presses the printing invoice that " switch of drawing a bill " inputs.According to described instruction, obtain cost information by bus, obtain needing the denomination of the invoice printed for " 3 yuan ".Described cost information of riding is passenger's input when swiping the card or insert coins.By the individual position of described denomination numerical value, ten separately storages; Ten is 0, and corresponding ASC II yard is 00110000, is stored to by described ASC II yard in " ten " register of specifying; Individual position is 3, and corresponding ASC II yard is 00110011, is stored to by described ASC II yard in " individual position " register of specifying.
During conversion, that reads in each register is low four, namely reads 0011 in 0000 and " individual position " register in " ten " register, forms the input 00000011 of 8, be input to ten/bis-code translators.Ten/bis-code translators export Y
5y
4y
3y
2y
1be 00011, position power " 16 ", " 8 " respectively on corresponding invoice paper, " 4 ", " 2 ", " 1 ".
The output Y of described code translator
5y
4y
3y
2y
1again through reverser, export and become 11100.According to " 1 " in binary digit power by controlling corresponding stamp action, impact on invoice paper, to draw except position power " 16 ", " 8 " on invoice paper, " 4 ", as shown in Figure 10.The denomination of invoice shown in Figure 10 is not drawn the position power sum, i.e. " 3 yuan " that remove.
After stamp release, drive rubber roll to drive invoice paper to march to assigned address, drive cut-off knife along dotted line cutting invoice, thus obtain the invoice of uniform specification.
Method described in the present embodiment is based on digital automation process, original invoice can be simplified and print operation, by drawing the binary digit power except being printed on the invoice paper of admission fee value in full, achieve in real time as required automatic printing ticket with draw a bill, just can to take invoice by pressing switch of drawing a bill after gate to make passenger, on specification subway invoice get mode.
In sum, the present invention by using the unified invoice of physical dimension, and nominal value is printed on the amount of money weighed by binary digit and represent.Described each binary digit power is corresponding with a stamp.When printing invoice, the slave mode printing invoice is entered after obtaining enabling signal, when slave mode receives the instruction printing invoice, obtain the numerical value of invoice admission fee, described numerical value is converted to corresponding binary number, corresponding stamp action is driven, to realize drawing except position weights print invoice according to described binary number.Compared with prior art, the beneficial effect of existence is in the present invention: can unify existing invoice physical dimension; And improve the printing speed of invoice, speed meets the requirement of AFC system to the traffic capacity, to realize on motorbus, subway and taxi in real time as required automatic printing ticket with draw a bill, simplify original invoice and print operation.
In exemplifying embodiment provided in embodiments of the present invention, should be understood that, the denomination of described invoice represents and includes but not limited to described seven bits, also according to actual needs, can select the binary number representation of other figure places.The denomination of described invoice also can be other valuation units, Figure 11 shows valuation unit to be the decoding scheme of 0.2 yuan and valuation unit the be decoding scheme of 0.5 yuan, register C, register B, register A store the ASC II yard of the numeral in " ten " " individual position " " decimal place " respectively; When valuation unit is 0.2 yuan, decoding exports takes from integral part Y
6y
5y
4y
3y
2y
1with fraction part Z
3z
2z
1z
0, the fraction part of output draws the digit order number except 0.8,0.6,0.4 and 0.2 for controlling; When valuation unit is 0.5, code translator exports takes from integral part Y
6y
5y
4y
3y
2y
1with fraction part X, the X of output is used for drawing the digit order number except 0.5.Table 3 shows the decoding truth table of fraction part when valuation unit is 0.2 or 0.5.Described stamp includes but not limited to the above-mentioned stamp be made by high-abrasive material, the stamp also can made for atom print material.Another side, scheme as an alternative, also can obtain the denomination of invoice by choosing the position weights participating in statistics.Such as, use the stamped patterns impact invoice paper shown in Figure 12, choose the position weights on invoice paper, the denomination of invoice is selected position weights sum, as shown in figure 13.Also can make stamped patterns is position weights, and Figure 14 shows the stamp being provided with a weights, is directly impacted by described stamp to print position weights on the invoice paper of blank, and the denomination of invoice is printed position weights sum.Figure 15 shows the invoice that denomination that Figure 14 stamp prints is " 1 yuan " " 7 yuan " and " 19 yuan ".
embodiment three
Figure 16 shows the composition structure of the invoice generating apparatus that the embodiment of the present invention three provides.For convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
As shown in figure 16, described invoice generating apparatus comprises:
Acquisition module 161, for obtaining the denomination numerical value of invoice.
Modular converter 162, for converting the described invoice denomination numerical value got to binary number.
In the present embodiment, after getting the denomination numerical value of invoice, described numerical value is converted to binary number.The conversion regime of described binary number can pass through ten/bis-code translator conversions, mcu programming conversion etc.
Generation module 163, for drawing except or choose according to the value of described binary number on each the position power that on invoice paper, institute's rheme is corresponding, obtains the invoice of required denomination numerical value.
In the present embodiment, described invoice paper is printed on unified admission fee value in full, described admission fee value in full is expressed as continuous n binary digit power sum from 1.As Fig. 3 shows the invoice that admission fee in full is expressed as continuous 7 binary digits power sum from 1.
After converting the described invoice denomination numerical value got to binary number, draw except position power corresponding to institute's rheme on invoice paper, to obtain the invoice of required denomination numerical value according to the value of described binary number on each;
Or
The position power that on invoice paper, institute's rheme is corresponding is chosen, to obtain the invoice of required denomination numerical value according to the value of described binary number on each.
The invoice generating apparatus that Figure 17 shows the embodiment of the present invention three to be provided is applied to the composition structure of AFC system.For convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
As shown in figure 17, described invoice generating apparatus comprises:
Starting module 171, during for receiving enabling signal, entering the slave mode that invoice is printed.
In the present invention, described enabling signal is for controlling the slave mode whether entering invoice printing.When receiving enabling signal, enter the slave mode that invoice is printed; Otherwise keep original uncontrolled state.The slave mode that described invoice is printed will continue for some time.In the slave mode time period that described invoice is printed, invoice can be printed according to instruction.
Preferably, described enabling signal is that the gate at subway gateway place is opened.When receiving gate and carrying out once normal " open/close " signal, enter the duty printing invoice.
Acquisition module 172, in the slave mode printed at invoice, when receiving the instruction printing invoice, obtains the denomination numerical value of invoice, by described value storage in the register of specifying according to the cost information of input.
In the present embodiment, if when receiving the instruction of printing invoice of passenger's input, according to pre-enter or the swipe the card cost information of input of passenger obtain the denomination numerical value of invoice.Preferably, the instruction of described printing invoice is inputted by pressing " switch of drawing a bill " by user.In the present invention, the quantity of register is set according to the maximal value of invoice denomination numerical value in advance, makes each register store a position of described numerical value.Numeral on described numerical value is every is stored in the storer of specifying with ASC II yard.
Modular converter 173, for reading described numerical value from the register of specifying, converts described numerical value to binary number.
In the present embodiment, the code translator used when changing is ten/binary decoder of 8 inputs.From the register that each is specified, read the low four of stored ASC II yard, form one 8 inputs, described 8 inputs are converted to binary number and export by ten/bis-code translators.
Generation module comprises prints submodule and cutting submodule.
Print submodule 174, for controlling corresponding stamp action according to the value of described binary number on each.
In the present embodiment, the invoice paper used is printed on unified maximum admission fee value, described maximum admission fee value is expressed as continuous n binary digit power sum from 1.Each of the binary number be converted to is corresponding controls a stamp, controls corresponding stamp action according to the value of described binary number on each.Described stamp action refers to that stamp impact is in the position power that invoice paper is corresponding.Pattern can be printed off on invoice paper during described stamp impact invoice paper.As an exemplifying embodiment of the present invention, pattern can be printed off during described stamp impact invoice paper to reach the position weights drawn except not participating in adding up on invoice paper, and the remaining denomination not being invoice by stroke position weights sum removed.
Cutting submodule 175, after stamp release, drives rubber roll to drive invoice paper to march to assigned address, drives cut-off knife cutting invoice paper.
In the present embodiment, described invoice paper is printed on for determining that invoice paper marches to the locating spot of assigned address, the light reflection that photoelectric tube can emit by invoice paper is to photosensitive tube.In the traveling process of invoice paper, the light reflection that photoelectric tube is launched by invoice paper, to photosensitive tube, makes optoelectronic switch export as high level.When invoice paper marches to assigned address, when the locating spot on invoice paper faces photoelectricity/photosensitive tube pair, photosensitive tube does not receive the reflection ray that photoelectric tube is launched, and the output of optoelectronic switch is low level, stops advancing to control invoice paper.The position that invoice paper stops is the position that cut-off knife aligns with the dotted line on invoice paper, and the position weights that lower one page invoice paper is printed on and stamp one_to_one corresponding.After invoice paper marches to assigned address, drive cut-off knife along invoice paper dotted line cutting invoice, thus complete printing and the output of invoice, obtain the invoice of uniform specification.
In sum, the present invention by using the unified invoice of physical dimension, and nominal value is printed on the amount of money weighed by binary digit and represent.Described each binary digit power is corresponding with a stamp.When printing invoice, the slave mode printing invoice is entered after obtaining enabling signal, when slave mode receives the instruction printing invoice, obtain the numerical value of invoice, described numerical value is converted to corresponding binary number, corresponding stamp action is driven, to realize printing invoice according to described binary number.Compared with prior art, the beneficial effect of existence is in the present invention: can unify existing invoice physical dimension; And improve the printing speed of invoice, speed meets the requirement of AFC system to the traffic capacity, to realize on motorbus, subway and taxi in real time as required automatic printing ticket with draw a bill, simplify original invoice and print operation.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention.Such as, modules is carry out dividing according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; The title of each functional module, just for the ease of distinguishing, is not limited to the present invention.In addition, each assembly in each embodiment of the embodiment of the present invention can be integrated in a module, also can be that the independent physics of each assembly exists, also can two or more Components integration in an assembly.Above-mentioned integrated assembly both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.