CN106779635A - Many account balance sharing methods in a kind of smart card and its card - Google Patents
Many account balance sharing methods in a kind of smart card and its card Download PDFInfo
- Publication number
- CN106779635A CN106779635A CN201611042232.9A CN201611042232A CN106779635A CN 106779635 A CN106779635 A CN 106779635A CN 201611042232 A CN201611042232 A CN 201611042232A CN 106779635 A CN106779635 A CN 106779635A
- Authority
- CN
- China
- Prior art keywords
- instruction
- application
- electronic
- smart card
- module
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/04—Payment circuits
- G06Q20/06—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
- G06Q20/065—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
- G06Q20/0655—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed centrally
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
- G06Q20/105—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems involving programming of a portable memory device, e.g. IC cards, "electronic purses"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/34—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using cards, e.g. integrated circuit [IC] cards or magnetic cards
- G06Q20/357—Cards having a plurality of specified features
- G06Q20/3572—Multiple accounts on card
Abstract
The invention discloses many account balance sharing methods in a kind of smart card and its card, methods described includes:Smart card receives instruction, after the instruction of the selection application from financial terminal is received, whether detection M1 transaction status mark is set, if it is not, then judge the magnitude relationship of M1 remaining sums, electronic purse balance amount and electronic cash balances, if M1 remaining sums are minimum, electronic purse balance amount and electronic cash balances are then updated to M1 remaining sums respectively, selection application, returns to selection application success response, continues to instruction;After the application trading instruction from financial terminal is received, the dealing money in application trading instruction calculates current account balance;Current account balance is Current electronic wallet balances or Current electronic closing balance;Set M1 transaction status marks, open affairs, and M1 remaining sums, electronic purse balance amount and electronic cash balances are updated into current account balance respectively, close affairs, and reset M1 transaction status marks return to transaction successful respond.
Description
Technical field
The present invention relates to field of intelligent cards, many account balance sharing methods in more particularly to a kind of smart card and its card.
Background technology
In the prior art, smart card species is various, there is encryption storage card (M1 cards), supports the row of electronic wallet application
Various smart cards such as industry application card and the fiscard of support electronic cash application, wherein, encryption storage card memory storage M1 accounts,
Sector application card memory storage e-wallet account, and fiscard memory storage electronic cash account, and due to various smart cards
Account balance in card is each independent, and every kind of smart card is only capable of being used in the terminal for supporting each self-application, it is impossible to it is compatible other
Terminal.Smart card industry is caused to there is maintenance cost therefrom high, the problems such as serious waste of resources.Therefore, a kind of energy is needed badly
Enough share the smart card of many account balances.
The content of the invention
The invention provides many account balance sharing methods in a kind of smart card and its card, above-mentioned technical problem is solved.
The invention provides many account balance sharing methods in a kind of intelligent card, including:
Step s1:Smart card receives instruction, after smart card receives the selection application from financial terminal to be instructed, performs step
Rapid s2;After smart card receives the application trading instruction from financial terminal, step s6 is performed;
Step s2:Whether the M1 transaction status mark of the smart card detection itself is set, if it is, performing step
s5;Otherwise, step s3 is performed;
Step s3:The smart card judges that the size of M1 remaining sums, electronic purse balance amount and the electronic cash balances of itself is closed
System, if the M1 remaining sums are minimum, performs step s4;If the M1 remaining sums, the electronic purse balance amount and the electronic cash
Remaining sum three is equal, then perform step s5;If the M1 remaining sums are more than the electronic purse balance amount or the electronic cash balances,
Then reported an error to the financial terminal, terminated;
Step s4:The electronic purse balance amount is updated to the M1 remaining sums by the smart card;More than the electronic cash
Volume is updated to the M1 remaining sums;
Step s5:The smart card is returned to the financial terminal and selected according to the selection application instruction selection application
Application success response, return to step s1;
Step s6:Dealing money of the smart card in the application trading instruction calculates current account balance;Institute
Current account balance is stated for Current electronic wallet balances or Current electronic closing balance;
Step s7:M1 transaction status marks described in the smart card set, open affairs;
Step s8:The smart card distinguishes the M1 remaining sums, the electronic purse balance amount and the electronic cash balances
It is updated to the current account balance;
Step s9:The smart card closes affairs;After closing affairs, reset the M1 transaction status mark, to the gold
Melt terminal and return to transaction successful respond, terminate.
Present invention also offers a kind of smart card, including:First receiver module, the second receiver module, first detection module,
First judge module, first report an error module, the first update module, the first application module, first return module, first calculate mould
Block, the first transaction module, the first setup module, the second update module, second return to module;
First receiver module, for receiving the selection application instruction from financial terminal;
Second receiver module, for receiving the application trading instruction from financial terminal;
The first detection module, for after first receiver module receives the selection application instruction, detecting
Whether the M1 transaction status mark of itself is set;
First judge module, for after the first detection module is detected as no, judging M1 remaining sums, the electricity of itself
The magnitude relationship of sub- wallet balances and electronic cash balances;
First update module, for when first judge module judges that the M1 remaining sums are minimum, by described in
Electronic purse balance amount is updated to the M1 remaining sums;The electronic cash balances are updated to the M1 remaining sums;
First application module, for judging the M1 remaining sums, the stored value card when first judge module
When remaining sum and the equal electronic cash balances three, and first update module updates the electronic purse balance amount and institute
After stating electronic cash balances, according to the selection application instruction selection application;
Described first reports an error module, for judging that the M1 remaining sums are more than the electronic money when first judge module
When bag remaining sum or the electronic cash balances, reported an error to the financial terminal;
Described first returns to module, for when first application module is according to the selection application instruction selection application
Afterwards, selection application success response is returned to the financial terminal;
First computing module, more than the dealing money calculating current account in the application trading instruction
Volume;The current account balance is Current electronic wallet balances or Current electronic closing balance;
First setup module, for when first computing module calculate current account balance after, M1 affairs described in set
Status Flag;After first transaction module closes affairs, reset the M1 transaction status mark;
First transaction module, for after first computing module calculates current account balance, opening affairs;When
Respectively be updated to for the M1 remaining sums, the electronic purse balance amount and the electronic cash balances described by second update module
After current account balance, affairs are closed;
Second update module, for after first transaction module opens affairs, by the M1 remaining sums, the electricity
Sub- wallet balances and the electronic cash balances are updated to the current account balance respectively;
Described second returns to module, for when second update module is by the M1 remaining sums, the electronic purse balance amount
After being updated to the current account balance respectively with the electronic cash balances, return to conclude the business to the financial terminal and successfully should
Answer.
Beneficial effects of the present invention:The invention provides many account balance sharing methods, institute in a kind of smart card and its card
State the M1 remaining sums in intelligent card, electronic purse balance amount and electronic cash balances to share, enable smart card supporting electronics to show
In the terminal of gold application, support to be used in the terminal of encryption storage card and the terminal of support electronic wallet application.
Brief description of the drawings
Fig. 1 is the flow chart of many account balance sharing methods in a kind of intelligent card of the offer of the embodiment of the present invention 1;
Fig. 2 is the flow chart of many account balance sharing methods in a kind of intelligent card of the offer of the embodiment of the present invention 2;
Fig. 3-Fig. 5 is the flow chart of many account balance sharing methods in a kind of intelligent card of the offer of the embodiment of the present invention 3;
Fig. 6 is a kind of structured flowchart of smart card that the embodiment of the present invention 4 is provided.
Specific implementation method
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
Embodiment 1
Many account balance sharing methods in a kind of intelligent card are present embodiments provided, as shown in figure 1, including:
Step s1:Smart card receives instruction, after smart card receives the selection application from financial terminal to be instructed, performs step
Rapid s2;After smart card receives the application trading instruction from financial terminal, step s6 is performed;
In the present embodiment, can also include in step s1:After the M1 consumption orders from M1 terminals are received, step is performed
Rapid r1;
Step r1:Whether the M1 transaction status mark of smart card detection itself is set, if it is, to M1 terminal reports
It is wrong;Otherwise, step r2 is performed;
Step r2:Smart card calculates current M1 remaining sums, is current M1 remaining sums by M1 balance updates, is returned to M1 terminals and consumed
Successful information.
Wherein, current M1 remaining sums are calculated, is current M1 remaining sums by M1 balance updates, specially:Smart card is from M1 memory blocks
Middle acquisition M1 remaining sums, obtain M1 dealing money from M1 consumption orders, the difference of M1 remaining sums and M1 dealing money are calculated, more than M1
As M1 remaining sums be written in M1 memory blocks current M1 remaining sums as current M1 remaining sums by the difference of volume and M1 dealing money.
Step s2:Whether the M1 transaction status mark of smart card detection itself is set, if it is, performing step s5;
Otherwise, step s3 is performed;
Step s3:Smart card judges the magnitude relationship of M1 remaining sums, electronic purse balance amount and the electronic cash balances of itself, if
M1 remaining sums are minimum, then perform step s4;If M1 remaining sums, electronic purse balance amount and electronic cash balances three are equal, step is performed
Rapid s5;If M1 remaining sums are more than electronic purse balance amount or electronic cash balances, reported an error to financial terminal, terminated;
Specifically, smart card obtains M1 remaining sums from M1 memory blocks;Electronic money is obtained from the first nonvolatile storage
Bag remaining sum;Electronic cash balances are obtained from the second nonvolatile storage;Judge M1 remaining sums whether more than electronic purse balance amount
Or electronic cash balances, if it is, being reported an error to financial terminal, terminate;Otherwise:If M1 remaining sums are less than electronic purse balance amount and M1
Remaining sum is less than electronic cash balances, then perform step s4;If M1 remaining sums are equal to electronic purse balance amount and M1 remaining sums are existing equal to electronics
Golden remaining sum, then perform step s5.
Wherein, M1 remaining sums are obtained from M1 memory blocks, is specifically included:
Step s31:Smart card obtains the M1 wallet copies address in M1 memory blocks, according to M1 wallet copy address acquisitions M1
Wallet copy;
Step s32:Smart card judges whether M1 wallets copy is legal, if it is, performing step s33;Otherwise, step is performed
Rapid t31;
Step s33:Smart card obtains M1 remaining sums from M1 wallet copies;
Step t31:Smart card obtains the M1 wallet originals address in M1 memory blocks;According to M1 wallet original address acquisitions M1
Wallet original;
Step t32:Smart card judges whether M1 wallets original is legal, if it is, performing step t33;Otherwise, step is performed
Rapid s5;
Step t33:Smart card obtains M1 remaining sums from M1 wallet originals.
Wherein, after judging that M1 wallet originals are legal in step t32, M1 remaining sums, the electronic purse balance amount of itself are judged
Before the magnitude relationship of electronic cash balances, can also include:Smart card is written to M1 wallets original as M1 wallet copies
M1 wallet copies address.
Step s4:Electronic purse balance amount is updated to M1 remaining sums by smart card;Electronic cash balances are updated to M1 remaining sums;
Specifically, smart card is written in the first nonvolatile storage using M1 remaining sums as electronic purse balance amount;By M1
Remaining sum is written in the second nonvolatile storage as electronic cash balances.
Step s5:Smart card returns to selection application success response according to selection application instruction selection application to financial terminal,
Return to step s1;
Step s6:Dealing money of the smart card in application trading instruction calculates current account balance;More than current account
Volume is Current electronic wallet balances or Current electronic closing balance;
Step s7:Smart card set M1 transaction status marks, open affairs;
Step s8:M1 remaining sums, electronic purse balance amount and electronic cash balances are updated to current account balance respectively;
Specifically, when current account balance is Current electronic wallet balances, smart card makees Current electronic wallet balances
For M1 remaining sums are written in M1 memory blocks;Using Current electronic wallet balances as electronic purse balance amount, first is written to non-volatile
In property memory block;It is written to Current electronic wallet balances as electronic cash balances in the second nonvolatile storage;
When current account balance is Current electronic closing balance, smart card is using Current electronic closing balance as M1 remaining sums
It is written in M1 memory blocks;Using Current electronic closing balance as electronic purse balance amount, the first nonvolatile storage is written to
In;It is written to Current electronic closing balance as electronic cash balances in the second nonvolatile storage.
Preferably, the first nonvolatile storage is the Flash memory blocks of electronic wallet application;Second non-volatile memories
Area is the Flash memory blocks of electronic cash application.
Step s9:Smart card closes affairs;After closing affairs, reset M1 transaction status marks are returned to financial terminal and handed over
Easy successful respond, terminates.
In the present embodiment, before step s6, can also include:Judge whether close using the dealing money in trading instruction
Method, if it is, performing step s6;Otherwise, reported an error to financial terminal, terminated.
Further, include using trading instruction:Stored value card consumption order or stored value card circle deposit instruction or electronics is existing
Golden consumption order or electronic cash circle deposit instruction;If smart card supports overdraw function,:
When application trading instruction is stored value card consumption order, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than electronic purse balance amount and subtracts the amount of money of having overdrawed again plus the limit of overdrawn account
Result, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for stored value card circle, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than the remaining sum upper limit and subtracts electronic purse balance amount and subtracts plus the amount of money of having overdrawed
The result of off line pre-authorization total amount is gone, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction is electronic cash consumption order, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than electronic cash balances and subtracts the amount of money of having overdrawed again plus the limit of overdrawn account
Result, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for electronic cash circle, judge whether close using the dealing money in trading instruction
Method is specially:Whether smart card judges to be not more than the remaining sum upper limit by dealing money that to subtract off line pre-authorization always golden plus the amount of money of having overdrawed
The result of volume, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal.
Further, include using trading instruction:Stored value card consumption order or stored value card circle deposit instruction or electronics is existing
Golden consumption order or electronic cash circle deposit instruction;If card does not support overdraw function,:
When application trading instruction is stored value card consumption order, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than electronic purse balance amount, if it is, judging that dealing money is legal;
Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for stored value card circle, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than the remaining sum upper limit and subtracts electronic purse balance amount and subtract off line pre-authorization again
The result of total amount, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction is electronic cash consumption order, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than electronic cash balances, if it is, judging that dealing money is legal;
Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for electronic cash circle, judge whether close using the dealing money in trading instruction
Method is specially:Smart card judges whether dealing money is not more than the result that the remaining sum upper limit subtracts off line pre-authorization total amount, if
It is then to judge that dealing money is legal;Otherwise, judge that dealing money is illegal.
In the present embodiment, can be specifically included using trading instruction:Stored value card consumption order or stored value card circle deposit finger
Order;
When application trading instruction is stored value card consumption order, the dealing money in application trading instruction is calculated works as
Preceding account balance, specially:Calculate the difference of electronic purse balance amount and dealing money, and as more than Current electronic wallet
Volume;
When application trading instruction is specially stored value card circle deposits instruction, the dealing money meter in application trading instruction
Current account balance is calculated, specially:Calculate the sum of electronic purse balance amount and dealing money, and as more than Current electronic wallet
Volume.
Further, stored value card consumption order includes:Consumption initialization directive and consumption order;Or specifically include multiple
Close consumption initialization directive, update the instruction of Application of composite data buffer storage and Application of composite consumption order;Stored value card circle deposits instruction
Specifically include:Circle deposits initialization directive and first lap deposits instruction;
Correspondingly:
Step s1 is specifically included:The instruction to be received such as smart card, when smart card receives the selection application from financial terminal
After instruction, step s2 is performed;When smart card receives consumption initialization directive, smart card is obtained from consumption initialization directive
Dealing money, judges whether dealing money is legal, if it is, returning to initialization successful respond, return to step to financial terminal
s1;Otherwise, reported an error to financial terminal, return to step s1;When smart card receives consumption order, step s6 is performed;Work as intelligence
When clamping receives compound consumption initialization directive, smart card obtains dealing money from compound consumption initialization directive, judges to hand over
Whether the easy amount of money is legal, if it is, returning to initialization successful respond, return to step s1 to financial terminal;Otherwise, to financial whole
End reports an error, return to step s1;When smart card receives Application of composite consumption order, step s6 is performed;When smart card is received
When circle deposits initialization directive, smart card is deposited from circle and dealing money is obtained in initialization directive, judges whether dealing money is legal, such as
Fruit is then to return to initialization successful respond, return to step s1 to financial terminal;Otherwise, reported an error to financial terminal, return to step
s1;When smart card receives first lap deposits instruction, step s6 is performed;
Step s6 is specially:When smart card receives consumption order or Application of composite consumption order, smart card calculates electricity
The difference of sub- wallet balances and dealing money, and as Current electronic wallet balances, perform step s7;When smart card is received
When depositing instruction to first lap, smart card calculates the sum of electronic purse balance amount and dealing money, and as Current electronic wallet
Remaining sum, performs step s7;
Also include in step s1:When smart card receives renewal Application of composite data buffer storage to be instructed, smart card updates multiple
Consumer record is closed, is returned to financial terminal and is updated successfully response, return to step s1.
In the present embodiment, can also be specifically included using trading instruction:Electronic cash consumption order or electronic cash circle are deposited
Instruction;
When application trading instruction is specially electronic cash consumption order, step s6 is specially:Smart card calculates electronics and shows
The difference of golden remaining sum and dealing money, and as Current electronic closing balance;
When application trading instruction is specially electronic cash circle deposits instruction, step s6 is specially:Smart card is by dealing money
As Current electronic closing balance.
Further, electronic cash consumption order is specifically included:Obtain Treatment Options instruction and read record instruction;Or tool
Body includes:Read expanded application recording instruction, obtain Treatment Options instruction, update expanded application recording instruction, read record instruction;Electricity
Sub- cash circle is deposited instruction and is specifically included:Obtain Treatment Options instruction, read record instruction, the first generation application cryptogram instruction, second
The instruction of generation application cryptogram and the second circle deposit instruction;
Correspondingly:
Step s1 is specifically included:The instruction to be received such as smart card, when smart card receives the selection application from financial terminal
After instruction, step s2 is performed;When smart card receives acquisition Treatment Options to be instructed, judge to hand over according to Treatment Options instruction is obtained
Easy type, when type of transaction is concluded the business for qPBOC, first kind mark is set to by type of transaction mark, and smart card is from acquisition
Dealing money is obtained in reason option instruction, judges whether dealing money is legal, if it is, performing step s6;Otherwise, to finance
Terminal reports an error, return to step s1;When type of transaction is that qPBOC extends transaction, type of transaction mark is set to Second Type mark
Know, smart card obtains dealing money from Treatment Options instruction is obtained, and judges whether dealing money is legal, if it is, performing
Step s6;Otherwise, reported an error to financial terminal, return to step s1;When type of transaction is by means of credit transaction, type of transaction is identified
The 3rd type identification is set to, application initialization response, return to step s1 are returned to financial terminal;When smart card receives the second circle
When depositing instruction, smart card obtains dealing money in depositing instruction from the second circle, judges whether dealing money is legal, if it is, holding
Row step s6;Otherwise, reported an error to financial terminal, return to step s1;When smart card receives read record to be instructed, detection transaction class
Type is identified, and when type of transaction is designated first kind mark or Second Type mark, performs step s7;When type of transaction is designated
During three type identifications, read record response, return to step s1 are returned to financial terminal;
Step s6 is specially:If type of transaction for when qPBOC concludes the business or qPBOC extension transaction when, when smart card is judged
After dealing money is legal, smart card calculates the difference of electronic cash balances and dealing money, and as Current electronic cash
Remaining sum, application initialization response, return to step s1 are returned to financial terminal;If type of transaction is by means of credit transaction, work as intelligence
After card judges that dealing money is legal, dealing money as Current electronic closing balance is performed step s7 by smart card;
Step s1 also includes:When smart card receives the reading expanded application recording instruction from financial terminal, then to gold
Melt terminal and return to reading expanded application record response, return to step s1;When smart card is received updates expanded application recording instruction, more
New expanded application record, returns to financial terminal and updates expanded application record response, return to step s1;When smart card receives
After one generation application cryptogram instruction, return to first to financial terminal and generate application cryptogram response, return to step s1;When intelligent clamping
After receiving the instruction of the second generation application cryptogram, return to second to financial terminal and generate application cryptogram response, return to step s1.
Present embodiments provide many account balance sharing methods, the M1 remaining sums in intelligent card, electricity in a kind of intelligent card
Sub- wallet balances and electronic cash balances are shared, enable smart card in the terminal for supporting electronic cash application, support encryption
Used in the terminal of storage card and the terminal of support electronic wallet application.
Embodiment 2
Many account balance sharing methods in a kind of intelligent card are present embodiments provided, as shown in Fig. 2 including:
Step 101:The instruction from terminal to be received such as smart card;When receiving the M1 consumption orders from M1 terminals
Afterwards, step 102 is performed;After the instruction of the selection application from financial terminal is received, step 104 is performed;Come from when receiving
After the electronic-purse transaction instruction of financial terminal, step 108 is performed;Refer to when the electronic cash transaction from financial terminal is received
After order, step 115 is performed;
Specifically, the instruction from terminal to be received such as smart card;Received from M1 ends when by the first communication channel
After the M1 consumption orders at end, step 102 is performed;Refer to when the selection application from financial terminal is received by the second communication channel
After order, step 104 is performed;After the instruction of the electronic-purse transaction from financial terminal is received by the second communication channel, hold
Row step 108;After the instruction of the electronic cash transaction from financial terminal is received by the second communication channel, step is performed
115;
In the present embodiment, electronic-purse transaction instruction includes:Stored value card consumption order or stored value card circle deposit instruction;Its
In, stored value card consumption order is specifically included:Consumption initialization directive and consumption order;Or specifically include compound consumption initially
Change instruction, update the instruction of Application of composite data buffer storage and Application of composite consumption order;Stored value card circle is deposited instruction and is specifically included:Circle
Deposit initialization directive and first lap deposits instruction.
Electronic cash transaction instruction includes:Electronic cash consumption order or electronic cash circle deposit instruction;Wherein, electronic cash
Consumption order is specifically included:Obtain Treatment Options instruction and read record instruction;Or specifically include:The instruction of acquisition Treatment Options,
Update expanded application recording instruction, read record instruction;Electronic cash circle is deposited instruction and is specifically included:Obtain Treatment Options instruction, read
Recording instruction, the first generation application cryptogram instruction, the second generation application cryptogram instruction and the second circle deposit instruction.
Step 102:Whether smart card detection M1 transaction status mark is set, if it is, being reported an error to M1 terminals, returns
Step 101;Otherwise, step 103 is performed;
Step 103:Smart card calculates current M1 remaining sums, is current M1 remaining sums by M1 balance updates;Returned to M1 terminals and disappeared
Take successful information, return to step 101;
Specifically, smart card obtains M1 remaining sums from M1 memory blocks, and M1 dealing money is obtained from M1 consumption orders, calculates
The difference of M1 remaining sums and M1 dealing money, and using the difference of M1 remaining sums and M1 dealing money as current M1 remaining sums, by current M1
Remaining sum is written in M1 memory blocks as M1 remaining sums.
More specifically, smart card obtains M1 wallet originals from the M1 wallet originals address in M1 memory blocks, from M1 money
M1 remaining sums are obtained in bag original, M1 dealing money are obtained from M1 consumption orders, calculate the difference of M1 remaining sums and M1 dealing money,
By and using M1 remaining sums and M1 dealing money difference as current M1 remaining sums, using current M1 remaining sums as M1 remaining sums, according to renewal
M1 balance updates M1 wallet originals afterwards, M1 wallet originals address is written to by the M1 wallet originals after renewal;Smart card is from M1
M1 wallet copies are obtained in M1 wallet copies address in memory block, M1 remaining sums are obtained from M1 wallet copies, referred to from M1 consumption
M1 dealing money is obtained in order, the difference of M1 remaining sums and M1 dealing money is calculated, and by M1 remaining sums and the difference of M1 dealing money
As current M1 remaining sums, current M1 remaining sums as M1 remaining sums, according to the M1 balance updates M1 wallet copies after renewal, will update
M1 wallet copies afterwards are written to M1 wallet copies address.
Step 104:Whether smart card detection M1 transaction status mark is set, if it is, performing step 107;Otherwise,
Perform step 105;
Step 105:Whether smart card judges M1 remaining sums more than electronic purse balance amount or electronic cash balances, if it is,
Reported an error to financial terminal, return to step 101;Otherwise, step 106 is performed;
Specifically, smart card obtains M1 remaining sums from M1 memory blocks;Electronic money is obtained from the first nonvolatile storage
Bag remaining sum;Electronic cash balances are obtained from the second nonvolatile storage;Judge M1 remaining sums whether more than electronic purse balance amount
Or electronic cash balances, if it is, reported an error to financial terminal, return to step 101;Otherwise, step 106 is performed;
Step 106:Electronic purse balance amount is updated to M1 remaining sums by smart card;Electronic cash balances are updated to M1 remaining sums;
Specifically, smart card is written in the first nonvolatile storage using M1 remaining sums as electronic purse balance amount;By M1
Remaining sum is written in the second nonvolatile storage as electronic cash balances.
Preferably, the first nonvolatile storage is the Flash memory blocks of electronic wallet application;Second non-volatile memories
Area is the Flash memory blocks of electronic cash application.
Step 107:Smart card is according to selection application instruction selection application;After electronic wallet application is selected, to financial whole
End returns to selection application success response, return to step 101;After electronic cash application is selected, returning to selection to financial terminal should
With successful respond, return to step 101;
Specifically, smart card obtains the data in the 5th byte in application instruction, as application type mark
Data length, since selection application instruction the 6th byte, obtain data length be application type mark data it is long
The data of degree, it is identified the data that will be got as application type, when application type is designated the first default mark, is judged
Selection application instruction type is electronic wallet application, selects electronic wallet application, and selection application success response is returned to terminal, is returned
Return step 101;When application type is designated the second default mark, judge that selection application instruction type is electronic cash application,
Selection electronic cash application, selection application success response, return to step 101 are returned to terminal;
In the present embodiment, first default is designated " 0x A000000632010105 ";Second default is designated " 0x
A000000632010106”。
For example, smart card obtains the data " 08 " in the 5th byte in application instruction, as application type mark
The data length of knowledge, since the 6th byte of selection application instruction " 0x 00A4040008A000000632010105 ", obtains
It is 8 data of byte length " A000000632010105 " to take data length, and as application type mark, using class
Type is designated the first default mark, judges that selection application instruction type is electronic wallet application, electronic wallet application is selected, to end
End returns to selection application success response, return to step 101.
Step 108:Smart card calculates Current electronic wallet balances;
When electronic-purse transaction instruction is specially stored value card consumption order, smart card calculates Current electronic wallet balances
Specially:Smart card obtains electronic purse balance amount from the first nonvolatile storage, is instructed according to electronic-purse transaction and obtained
Dealing money, calculates the difference of electronic purse balance amount and dealing money, and as Current electronic wallet balances.
When electronic-purse transaction instruction is specially stored value card circle deposits instruction, smart card calculates Current electronic wallet balances
Specially:Smart card obtains electronic purse balance amount from the first nonvolatile storage, is instructed according to electronic-purse transaction and obtained
Dealing money, calculates the sum of electronic purse balance amount and dealing money, and as Current electronic wallet balances.
Wherein, calculate the difference of electronic purse balance amount and dealing money, as Current electronic wallet balances before, also
Including:Judge whether dealing money is legal, if it is, the difference of electronic purse balance amount and dealing money is calculated, as
Current electronic wallet balances;Otherwise, reported an error to financial terminal;
When electronic-purse transaction instruction is specially stored value card consumption order, judge whether dealing money is legal, specifically
Including:When smart card supports overdraw function, smart card obtains the amount of money of having overdrawed, and judges whether dealing money is not more than electronic money
Bag remaining sum subtracts the result of the amount of money of having overdrawed again plus the default limit of overdrawn account, if it is, judging that the dealing money is legal;
Otherwise, judge that the dealing money is illegal;When smart card does not support overdraw function, whether not smart card judge dealing money
More than electronic purse balance amount, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal.
Calculate electronic purse balance amount and dealing money and before, also include:Judge whether dealing money is legal, if
It is the sum of electronic purse balance amount and dealing money then to be calculated, as Current electronic wallet balances;Otherwise, to financial terminal
Report an error;
When electronic-purse transaction instruction is specially stored value card circle deposits instruction, judge whether dealing money is legal, specifically
Including:When smart card supports overdraw function, smart card obtains the amount of money of having overdrawed, and whether not the smart card judge dealing money
The electronic purse balance amount is subtracted more than the default remaining sum upper limit add the knot that the amount of money of having overdrawed subtracts off line pre-authorization total amount
Really, if it is, judging that the dealing money is legal;Otherwise, judge that dealing money is illegal;When smart card does not support work(of overdrawing
Can when, judge whether no more than the default remaining sum upper limit subtracts electronic purse balance amount to subtract off line pre-authorization again always golden dealing money
The result of volume, if it is, judging that the dealing money is legal;Otherwise, judge that dealing money is illegal.
Step 109:Smart card set M1 transaction status marks;
Step 110:Smart card opens affairs;
Step 111:M1 balance updates are Current electronic wallet balances by smart card;Electronic cash balances are updated to currently
Electronic purse balance amount;Electronic purse balance amount is updated to Current electronic wallet balances;
Specifically, smart card is written to Current electronic wallet balances as M1 remaining sums in M1 memory blocks;By Current electronic
Wallet balances are written in the first nonvolatile storage as electronic purse balance amount;Using Current electronic wallet balances as electricity
Sub- closing balance is written in the second nonvolatile storage.
Step 112:Smart card closes affairs;
It should be noted that, after unlatching affairs, if there is power down failure, thing during step 111 is performed in smart card
Electronic purse balance amount and electronic cash balances can be rolled back to the state before affairs are opened for business.
Step 113:Smart card reset M1 transaction status marks;
Step 114:Smart card is to financial terminal return electron purse transaction successful respond, return to step 101;
Step 115:Smart card calculates Current electronic closing balance;
When electronic cash transaction instruction is specially electronic cash consumption order, smart card calculates Current electronic closing balance
Specially:Smart card obtains electronic cash balances from the second nonvolatile storage, is instructed according to electronic cash transaction and obtained
Dealing money, calculates the difference of electronic cash balances and dealing money, and as Current electronic closing balance.
When electronic cash transaction instruction is specially electronic cash circle deposits instruction, smart card calculates Current electronic closing balance
Specially:Smart card obtains dealing money according to electronic cash transaction instruction, and using dealing money as more than Current electronic cash
Volume.
Wherein, calculate the difference of electronic cash balances and dealing money, as Current electronic closing balance before, also
Including:Judge whether dealing money is legal, if it is, the difference of electronic cash balances and dealing money is calculated, as
Current electronic closing balance;Otherwise, reported an error to financial terminal.Correspondingly, when electronic cash transaction instruction is specially electronic cash
During consumption order, judge whether dealing money is legal, specifically includes:When smart card supports overdraw function, smart card is obtained
The overdraw amount of money, judges whether dealing money is not more than electronic cash balances and subtracts the amount of money of having overdrawed again plus the default limit of overdrawn account
Result, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;When smart card does not support work(of overdrawing
During energy, smart card judges whether dealing money is not more than electronic cash balances, if it is, judging that dealing money is legal;Otherwise,
Judge that dealing money is illegal.
Smart card as before Current electronic closing balance, also includes dealing money:Judge whether dealing money is legal,
If it is, using dealing money as Current electronic closing balance;Otherwise, reported an error to financial terminal.Correspondingly, electronic cash is worked as
Trading instruction is specially electronic cash circle when depositing instruction, judges whether dealing money is legal, specifically includes:When smart card supports saturating
During Zhi Gongneng, smart card obtains the amount of money of having overdrawed, and smart card judges whether dealing money is not more than the default remaining sum upper limit and adds
The amount of money of having overdrawed subtracts the result of off line pre-authorization total amount, if it is, judging that the dealing money is legal;Otherwise, judge
Dealing money is illegal;When smart card does not support overdraw function, judge whether dealing money is not more than the default remaining sum upper limit
The result of off line pre-authorization total amount is subtracted, if it is, judging that the dealing money is legal;Otherwise, judge dealing money not
It is legal.
Step 116:Smart card set M1 transaction status marks;
Step 117:Smart card opens affairs;
Step 118:M1 balance updates are Current electronic closing balance by smart card;Electronic cash balances are updated to currently
Electronic cash balances;Electronic purse balance amount is updated to Current electronic closing balance;
Specifically, smart card is written to Current electronic closing balance as M1 remaining sums in M1 memory blocks;By Current electronic
Closing balance is written in the first nonvolatile storage as electronic purse balance amount;Using Current electronic closing balance as electricity
Sub- closing balance is written in the second nonvolatile storage.
Step 119:Smart card closes affairs;
It should be noted that, after unlatching affairs, if there is power down failure, thing during step 118 is performed in smart card
Electronic purse balance amount and electronic cash balances can be rolled back to the state before affairs are opened for business.
Step 120:Smart card reset M1 transaction status marks;
Step 121:Smart card is to financial terminal return electron cash transaction successful respond, return to step 101.
In the present embodiment, stored value card consumption order includes:Consumption initialization directive and consumption order;Or specifically include
Compound consumption initialization directive, the instruction of renewal Application of composite data buffer storage and Application of composite consumption order;Stored value card circle deposits finger
Order is specifically included:Circle deposits initialization directive and first lap deposits instruction;
Correspondingly:
Step 101 is specifically included:The instruction to be received such as smart card, when smart card receives the selection application from financial terminal
After instruction, step 104 is performed;When smart card receives consumption initialization directive, smart card is obtained from consumption initialization directive
Dealing money is taken, judges whether dealing money is legal, if it is, returning to initialization successful respond to financial terminal, return to step
Rapid 101;Otherwise, reported an error to financial terminal, return to step 101;When smart card receives consumption order, step 108 is performed;When
When smart card receives compound consumption initialization directive, smart card obtains dealing money from compound consumption initialization directive, sentences
Whether disconnected dealing money is legal, if it is, returning to initialization successful respond, return to step 101 to financial terminal;Otherwise, to
Financial terminal reports an error, return to step 101;When smart card receives Application of composite consumption order, step 108 is performed;Work as intelligence
Clamping receives circle when depositing initialization directive, and smart card is deposited from circle and dealing money is obtained in initialization directive, judges that dealing money is
It is no legal, if it is, returning to initialization successful respond, return to step 101 to financial terminal;Otherwise, reported an error to financial terminal,
Return to step 101;When smart card receives first lap deposits instruction, step 108 is performed;
Step 108 is specially:When smart card receives consumption order or Application of composite consumption order, smart card calculates electricity
The difference of sub- wallet balances and dealing money, and as Current electronic wallet balances, perform step 109;When intelligent clamping
When receiving first lap and depositing instruction, smart card calculates the sum of electronic purse balance amount and dealing money, and as Current electronic money
Bag remaining sum, performs step 109;
Also include in step 101:When smart card receives renewal Application of composite data buffer storage to be instructed, smart card updates multiple
Consumer record is closed, is returned to financial terminal and is updated successfully response, return to step 101.
In the present embodiment, electronic cash consumption order is specifically included:Obtain Treatment Options instruction and read record instruction;Or
Specifically include:Read expanded application recording instruction, obtain Treatment Options instruction, update expanded application recording instruction, read record instruction;
Electronic cash circle is deposited instruction and is specifically included:Obtain Treatment Options instruction, read record instruction, the first generation application cryptogram instruction, the
Two generation application cryptogram instructions and the second circle deposit instruction;
Correspondingly:
Step 101 is specifically included:Smart card waits instruction, when smart card receives the selection application instruction from financial terminal
Afterwards, step 104 is performed;When smart card receives acquisition Treatment Options to be instructed, transaction is judged according to Treatment Options instruction is obtained
Type, when type of transaction is concluded the business for qPBOC, first kind mark is set to by type of transaction mark, and smart card is processed from acquisition
Dealing money is obtained in option instruction, judges whether dealing money is legal, if it is, performing step 115;Otherwise, to finance
Terminal reports an error, return to step 101;When type of transaction is that qPBOC extends transaction, type of transaction mark is set to Second Type mark
Know, smart card obtains dealing money from Treatment Options instruction is obtained, and judges whether dealing money is legal, if it is, performing
Step 115;Otherwise, reported an error to financial terminal, return to step 101;When type of transaction is by means of credit transaction, by type of transaction mark
Knowledge is set to the 3rd type identification, and application initialization response, return to step 101 are returned to financial terminal;When smart card receives
When two circles deposit instruction, smart card obtains dealing money in depositing instruction from circle, judges whether dealing money is legal, if it is, holding
Row step 115;Otherwise, reported an error to financial terminal, return to step 101;When smart card receives read record to be instructed, detection transaction
Type identification, when type of transaction is designated first kind mark or Second Type is identified, performs step 116;Work as type of transaction
When being designated three type identifications, read record response, return to step 101 are returned to financial terminal;
Step 115 is specially:If type of transaction for when qPBOC concludes the business or qPBOC extension transaction when, when smart card is judged
After dealing money is legal, smart card calculates the difference of electronic cash balances and dealing money, and as Current electronic cash
Remaining sum, response, return to step 101 are initialized to financial terminal application;If when type of transaction is by means of credit transaction, working as smart card
After judging that dealing money is legal, dealing money as Current electronic closing balance is performed step 116 by smart card;
Step 101 also includes:When smart card receives the reading expanded application recording instruction from financial terminal, then to gold
Melt terminal and return to reading expanded application record response, return to step 101;When smart card is received updates expanded application recording instruction,
Expanded application record is updated, is returned to financial terminal and is updated expanded application record response, return to step 101;When smart card is received
To after the first generation application cryptogram instruction, return to first to financial terminal and generate application cryptogram response, return to step 101;Work as intelligence
After energy clamping receives the instruction of the second generation application cryptogram, return to second to financial terminal and generate application cryptogram response, return to step
101。
Embodiment 3
Many account balance sharing methods in a kind of intelligent card are present embodiments provided, as shown in Figure 3-Figure 5, including:
Step 201:The instruction from terminal to be received such as smart card, when receive carry out self terminal selection application instruction
Afterwards, step 202 is performed;After the transaction initiation for carrying out self terminal instruction is received, step 301 is performed;Come from eventually when receiving
After the acquisition Treatment Options instruction at end, step 401 is performed;
In a kind of intelligent card that the present embodiment is provided in many account balance sharing methods, terminal is specially financial terminal.
Step 202:Whether smart card detection M1 transaction status mark is set, if it is, performing step 216;Otherwise,
Perform step 203;
Step 203:Smart card obtains the M1 wallet copies address in M1 memory blocks, root from the second memory block of virtual machine
According to M1 wallet copy address acquisition M1 wallet copies;
For example:Smart card obtains the M1 wallet copies address in M1 memory blocks from the second memory block of virtual machine, according to
M1 wallet copy address acquisition M1 wallet copies are:0xEC2C000013D3FFFFEC2C000000FF00FF.
Step 204:Smart card judges whether M1 wallets copy is legal, if it is, performing step 205;Otherwise, step is performed
Rapid 206;
Specifically, smart card obtains the data in last four bytes of stored value card copy, the data that judgement gets
Whether match with the first preset value, if it is, judging that stored value card copy is legal, then perform step 205;Otherwise, it is determined that
Stored value card copy is illegal, performs step 206.
In the present embodiment, it is preferable that the first preset value is " 00FF00FF ".
For example, smart card obtains the last of stored value card copy 0x EC2C000013D3FFFFEC2C000000FF00FF
Data " 0x 00FF00FF " in four bytes, the data and the first preset value " 0x00FF00FF " that judgement gets match,
Then judge that stored value card copy is legal, then perform step 205.
Step 205:Smart card obtains M1 remaining sums from M1 wallet copies;M1 is obtained from the first memory block of virtual machine former
Volume, performs step 209;
Specifically, smart card obtains the data in the 9th to the 12nd byte of M1 wallet copies, the data that will be got
Backward treatment is carried out, using the data after treatment as M1 remaining sums;M1 original volumes are obtained from the first memory block of virtual machine, step is performed
Rapid 209.
For example:The 9th of smart card acquisition M1 wallet copy 0x EC2C000013D3FFFFEC2C000000FF00FF arrives
Data 0x EC2C0000 in 12nd byte, the data that will be got " 0x EC2C0000 " carry out backward treatment, obtain everywhere
Data after reason are " 0x 00002CEC ", by " 0x 00002CEC " as M1 remaining sums;Obtained from the first memory block of virtual machine
M1 original volume 0x 00002CEC are taken, step 209 is performed.
Step 206:Smart card obtains the M1 wallet originals address in M1 memory blocks from the second memory block of virtual machine;Root
According to M1 wallet original address acquisition M1 wallet originals;
For example:Smart card obtains the M1 wallet originals address in M1 memory blocks from the second memory block of virtual machine, according to
M1 wallet original address acquisition M1 wallet originals are:0x EC2C000013D3FFFFEC2C000000FF00FF.
Step 207:Smart card judges whether M1 wallets original is legal, if it is, performing step 208;Otherwise, step is performed
Rapid 216;
Specifically, smart card obtains the data in last four bytes of stored value card original, the data that judgement gets
Whether match with the first preset value, if it is, judging that stored value card original is legal, then perform step 208;Otherwise, it is determined that
Stored value card original is illegal, performs step 216.
In the present embodiment, it is preferable that the first preset value is " 00FF00FF ".
For example, smart card obtains the last of stored value card original 0x EC2C000013D3FFFFEC2C000000FF00FF
Data " 0x 00FF00FF " in four bytes, the data and the first preset value " 0x00FF00FF " that judgement gets match,
Then judge that stored value card original is legal, then perform step 208.
Step 208:Smart card obtains M1 remaining sums from M1 wallet originals;M1 is obtained from the first memory block of virtual machine former
Volume, performs step 209;
Specifically, smart card obtains the data in the 9th to the 12nd byte of M1 wallet originals, the data that will be got
Backward treatment is carried out, using the data after treatment as M1 remaining sums;M1 original volumes are obtained from the first memory block of virtual machine, step is performed
Rapid 209.
For example:The 9th of smart card acquisition M1 wallet original 0x EC2C000013D3FFFFEC2C000000FF00FF arrives
Data 0x EC2C0000 in 12nd byte, the data that will be got " 0x EC2C0000 " carry out backward treatment, obtain everywhere
Data after reason are " 0x 00002CEC ", by " 0x 00002CEC " as M1 remaining sums;Obtained from the first memory block of virtual machine
M1 original volume 0x 00002CEC are taken, step 209 is performed.
Step 209:Whether smart card judges M1 remaining sums more than or equal to M1 original volumes, if it is, performing step 214;Otherwise,
Perform step 210;
Step 210:M1 original volumes are updated to M1 remaining sums by smart card;M1 original volumes after renewal are written to the first of virtual machine
In memory block;
Step 211:Smart card judges whether M1 wallets original and M1 wallets copy match, if it is, performing step
213;Otherwise, step 212 is performed;
Specifically, smart card judges whether stored value card original and stored value card copy are consistent, if it is, performing step
Rapid 213;Otherwise, step 212 is performed.
Step 212:Smart card copies to M1 wallet originals in M1 memory blocks corresponding with M1 wallet copies address;
Step 213:Smart card obtains electronic purse balance amount from the Flash memory blocks of electronic wallet application;It is existing from electronics
Electronic cash balances are obtained in the Flash memory blocks of gold application;
For example:Smart card obtains electronic purse balance amount from the Flash memory blocks of electronic wallet application
“0x0002EE0”;It is " 000000012000 " that electronic cash balances are obtained from the Flash memory blocks of electronic cash application.
Step 214:Whether smart card judges M1 remaining sums more than electronic purse balance amount or electronic cash balances;If it is,
Reported an error to terminal, terminated;Otherwise, step 215 is performed;
For example:Smart card judges that M1 remaining sums 0x00002CEC is not more than electronic purse balance amount 0x 0002EE0 or electronic cash
Remaining sum 000000012000, performs step 215.
Step 215:Electronic purse balance amount is updated to M1 remaining sums by smart card;Electronic cash balances are updated to M1 remaining sums;
Current electronic wallet balances are written in the Flash memory blocks of electronic wallet application;Current electronic closing balance is written to
In the Flash memory blocks of electronic cash application;
Step 216:Smart card obtains selection application instruction type from selection application instruction, when selection application instruction type
During for electronic wallet application, electronic wallet application is selected, selection application success response, return to step 201 are returned to terminal;It is elected
Select using instruction type be electronic cash application when, select electronic cash application, to terminal return selection application success response, return
Return step 201;
Specifically, smart card obtains selection using the data in the 6th to the 13rd byte in instruction, and as
Application type is identified, and when application type is designated the first default mark, judges that selection application instruction type should as stored value card
With, electronic wallet application is selected, return to selection application success response, return to step 201 to terminal;When application type is designated
During two default marks, judge that selection application instruction type is electronic cash application, select electronic cash application, returned to terminal and selected
Select application success response, return to step 201;
In the present embodiment, first default is designated " 0x A000000632010105 ";Second default is designated " 0x
A000000632010106”;
For example:Smart card obtains selection and is arrived using the 6th in instruction " 0x 00A4040008A000000632010105 "
Data " 0x A000000632010105 " in 13rd byte, and as application type mark, application type is designated
First default mark, judges that selection application instruction type is electronic wallet application, selects electronic wallet application, is returned to terminal and selected
Select application success response, return to step 201.
Step 301:Smart card judges the type of transaction initiation instruction, when transaction initiation instruction for consumption initialization refers to
When making, step 302 is performed;When transaction initiation instruction is for compound consumption initialization directive, step 315 is performed;When transaction is first
Beginningization instruction for circle deposit initialization directive when, perform step 329;
Specifically, smart card receives the transaction initiation instruction for carrying out self terminal, obtains the 3rd during transaction initiation is instructed
Data in byte and nybble, when the data in the 3rd byte and nybble are the first consumption mark, judge transaction
The type of initialization directive is, using consumption initialization directive, to perform step 302;Data in the 3rd byte and nybble
During for the second consumption mark, judge that the type of transaction initiation instruction is compound consumption initialization directive, perform step 315;When
Data in 3rd byte and nybble for circle deposit mark when, judge that the type of transaction initiation instruction is deposited initialization and referred to as circle
Order, performs step 329.
In the present embodiment, the first consumption is designated " 0x 01 02 ";Second consumption is designated " 0x 03 02 ";Circle deposits mark
It is " 0x 00 02 ".
For example:Smart card receives the transaction initiation instruction 0x 805001020b01 for carrying out self terminal
0000014f112233445566, obtains the data in the 3rd byte and nybble in transaction initiation instruction
01 02, judge the data on the 3rd byte and nybble be first consumption mark, judges transaction initiation instruct type as
Consumption initialization directive, performs step 302.
Step 302:Intelligent card initialization is consumed;Initialization successful respond is returned to terminal;
Step 303:Smart card receives the consumption order for carrying out self terminal;
Specifically, the instruction from terminal to be received such as smart card, after the consumption order for carrying out self terminal is received, performs
Step 304.
For example:The instruction from terminal to be received such as smart card, when receiving the consumption order of carrying out self terminal
After 0x805401000F 010203042001112315300369EC33E1, step 304 is performed.
Step 304:Smart card obtains electronic purse balance amount from the Flash memory blocks of electronic wallet application, from consumption just
Dealing money is obtained in beginningization instruction, the difference of electronic purse balance amount and dealing money is calculated, by electronic purse balance amount and transaction
The difference of the amount of money is used as Current electronic wallet balances;
Dealing money is obtained from consumption initialization directive in this step, specially:Smart card obtains consumption initialization and refers to
Data on the 7th to crossed joint in order, and as dealing money.For example, smart card obtains consumption initialization directive 0x
Data 02030420 on the 7th to crossed joint in the 69EC33E1 of 805401000F01020304 20011123153003, and
As dealing money.
Step 305:Be written to Current electronic wallet balances in random access switch memory by smart card;
Step 306:Smart card set M1 transaction status marks;
Step 307:Smart card opens affairs;
Step 308:Be written to Current electronic wallet balances in M1 memory blocks by smart card;
Step 309:Smart card obtains M1 original volumes from the first memory block of virtual machine;M1 original volumes are updated to Current electronic
Wallet balances;M1 original volumes after renewal are written in the first memory block of virtual machine;
Step 310:In the Flash memory blocks that be written to Current electronic wallet balances in electronic cash application by smart card;
Step 311:In the Flash memory blocks that be written to Current electronic wallet balances in electronic wallet application by smart card;
Step 312:Smart card closes affairs;
Step 313:Smart card reset M1 transaction status marks;
Step 314:Smart card returns to consumption and withholds successful respond to terminal, terminates.
Step 315:The compound consumption of intelligent card initialization;Initialization successful respond is returned to terminal;
Step 316:Smart card receives the renewal Application of composite data buffer storage instruction for carrying out self terminal, updates compound consumption note
Record, returns to terminal and is updated successfully response;
Specifically, the instruction from terminal to be received such as smart card, when receiving the renewal Application of composite number that carrys out self terminal
During according to cache instruction, compound consumer record is updated, returned to terminal and be updated successfully response.
Step 317:Smart card receives the Application of composite consumption order for carrying out self terminal;
Specifically, the instruction from terminal to be received such as smart card, when receive carry out self terminal Application of composite consumption refer to
After order, step 318 is performed.
For example:The instruction from terminal to be received such as smart card, carrys out the Application of composite of self terminal and disappears when smart card is received
After taking instruction 0x 805401000F01020304 20011123153003C5A1CEF4, step 318 is performed.
Step 318:Smart card obtains electronic purse balance amount from the Flash memory blocks of electronic wallet application, disappears from compound
Dealing money is obtained in expense initialization directive, the difference of electronic purse balance amount and dealing money is calculated, by electronic purse balance amount more
New is the difference of electronic purse balance amount and dealing money;
Dealing money is obtained from compound consumption initialization directive in this step, specially:Smart card obtains compound consumption
Data on the 7th to crossed joint in initialization directive, and as dealing money.
Step 319:Be written to Current electronic wallet balances in random access memory by smart card;
Step 320:Smart card set M1 transaction status marks;
Step 321:Smart card opens affairs;
Step 322:Be written to Current electronic wallet balances in M1 memory blocks by smart card;
Step 323:Smart card obtains M1 original volumes from the first memory block of virtual machine;M1 original volumes are updated to Current electronic
Wallet balances;M1 original volumes after renewal are written in the first memory block of virtual machine;
Step 324:In the Flash memory blocks that be written to electronic purse balance amount in electronic cash application by smart card;
Step 325:Be written to for electronic purse balance amount in the Flash memory blocks in electronic wallet application by smart card;
Step 326:Smart card closes affairs;
Step 327:Smart card reset M1 transaction status marks;
Step 328:Smart card returns to compound consumption and withholds successful respond to terminal;Terminate.
Step 329:Intelligent card initialization circle is deposited;Initialization successful respond is returned to terminal;
Step 330:The first lap that smart card reception carrys out self terminal deposits instruction;From electronic wallet application Flash memory blocks
Electronic purse balance amount is obtained, is deposited from circle and dealing money is obtained in initialization directive, calculate electronic purse balance amount and dealing money
With, using electronic purse balance amount and dealing money and as Current electronic wallet balances;
Specifically, the instruction from terminal to be received such as smart card, when receive the first lap for carrying out self terminal deposit instruction after,
Electronic purse balance amount is obtained from electronic wallet application Flash memory blocks, is deposited from circle and dealing money is obtained in initialization directive, counted
Calculate the sum of electronic purse balance amount and dealing money, using electronic purse balance amount and dealing money and as more than Current electronic wallet
Volume.
Deposited from circle in this step and dealing money is obtained in initialization directive, specially:Smart card acquisition circle is deposited initialization and is referred to
Data on the 7th to crossed joint in order, and as dealing money.
Step 331:Be written to Current electronic wallet balances in random access memory by smart card;
Step 332:Smart card set M1 transaction status marks;
Step 333:Smart card opens affairs;
Step 334:Be written to Current electronic wallet balances in M1 memory blocks by smart card;
Step 335:Smart card obtains M1 original volumes from the first memory block of virtual machine;M1 original volumes are updated to Current electronic
Wallet balances;M1 original volumes after renewal are written in the first memory block of virtual machine;
Step 336:In the Flash memory blocks that be written to Current electronic wallet balances in electronic cash application by smart card;
Step 337:In the Flash memory blocks that be written to Current electronic wallet balances in electronic wallet application by smart card;
Step 338:Smart card closes affairs;
Step 339:Smart card reset M1 transaction status marks;
Step 340:Smart card returns to circle and deposits successful respond to terminal, terminates.
Step 401:Smart card judges type of transaction according to Treatment Options instruction is obtained, when type of transaction for qPBOC concludes the business
When, perform step 402;When type of transaction is by means of credit transaction, step 416 is performed;
Specifically, smart card receive come self terminal acquisition Treatment Options instruction, obtain obtain Treatment Options instruction in
4th presets the corresponding data field of the corresponding Treatment Options data object list (PDOL) of mark, from Treatment Options data object row
Obtained in the corresponding data field of table (PDOL) the first valid data corresponding with the 5th default mark and being preset with the 6th identify it is right
The second valid data answered, judge whether type of transaction is qPBOC extension transaction, if it is, will according to the first valid data
Type of transaction mark is set to Second Type mark, performs step a1;Otherwise, according to effective with the 6th default mark corresponding second
Data, judge whether type of transaction is that qPBOC concludes the business or by means of credit transaction, when type of transaction is concluded the business for qPBOC, by class of concluding the business
Type mark is set to first kind mark, performs step 402;When type of transaction is by means of credit transaction, type of transaction mark is put
It is the 3rd type identification, performs step 416;
In the present embodiment, the 4th it is default be designated " 0x 9F38 ", the 5th it is default be designated " 0x DF60 ", the 6th pre- bidding
Know is " 0x 9F66 ".
Step 402:Intelligent card initialization electronic cash application, obtains electricity from the Flash memory blocks of electronic cash application
Sub- closing balance, dealing money is obtained from Treatment Options instruction is obtained, and calculates the difference of electronic cash balances and dealing money;
Using the difference of electronic cash balances and dealing money as Current electronic closing balance;
Step 403:Be written to Current electronic closing balance in random access switch memory by smart card;
Step 404:Smart card returns to initialization application response to terminal;
Step 405:Smart card receives the read record instruction for carrying out self terminal;
Specifically, the instruction from terminal to be received such as smart card, after the read record for carrying out self terminal instruction is received, inspection
The easy type identification of test cross, when type of transaction is designated the first kind to be identified, performs step 406.
Step 406:Smart card instructs read record according to read record, judges whether to read the last item record, if it is,
Perform step 407;Otherwise, step 406 is continued executing with;
Step 407:Smart card set M1 transaction status marks;
Step 408:Smart card opens affairs;
Step 409:Be written to Current electronic closing balance in M1 memory blocks by smart card;
Step 410:Smart card obtains M1 original volumes from the first memory block of virtual machine;M1 original volumes are updated to Current electronic
Closing balance;M1 original volumes after renewal are written in the first memory block of virtual machine;
Step 411:In the Flash memory blocks that be written to Current electronic closing balance in electronic wallet application by smart card;
Step 412:In the Flash memory blocks that be written to Current electronic closing balance in electronic cash application by smart card;
Step 413:Smart card closes affairs;
Step 414:Smart card reset M1 transaction status marks;
Step 415:Smart card returns to read record response to terminal;Terminate.
Step 416:Intelligent card initialization electronic cash application, application initialization response is returned to terminal;
Step 417:Smart card receives the read record instruction for carrying out self terminal, and back read data response is returned to terminal;
Specifically, the instruction from terminal to be received such as smart card, after the read record for carrying out self terminal instruction is received, inspection
The easy type identification of test cross, when type of transaction is designated three type identifications, performs step 418.
Step 418:Smart card receives the first generation application cryptogram instruction for carrying out self terminal, and returning to the first generation to terminal should
Use ciphertext response;
Specifically, the instruction from terminal to be received such as smart card, when receive come self terminal first generation application it is close
After text instruction, return to first to terminal and generate application cryptogram response;
Step 419:Smart card receives the second generation application cryptogram instruction for carrying out self terminal, and being returned to terminal includes agreeing to connection
Second generation application cryptogram response of machine Transaction Information;
Specifically, the instruction from terminal to be received such as smart card, when receive come self terminal second generation application it is close
Text instruction, being returned to terminal includes the second generation application cryptogram response for agreeing to on-line transaction information.
Step 420:The second circle that smart card reception carrys out self terminal deposits instruction;
Specifically, the instruction from terminal to be received such as smart card, after the instruction for carrying out self terminal is received, decision instruction
Whether it is that the second circle deposits instruction, if so, performing step 421;Otherwise, other corresponding operatings are performed.
More specifically, the instruction from terminal to be received such as smart card, after the instruction for carrying out self terminal is received, intelligence
Card judges whether the data in the third and fourth byte of the instruction for carrying out self terminal for receiving are the 3rd default mark, if
It is then to judge that the instruction for carrying out self terminal for receiving deposits instruction as the second circle, performs step 421;Otherwise, other corresponding behaviour are performed
Make.
Preferably, the 3rd default it is designated " 0x 9F79 ".
For example, the instruction from terminal to be received such as smart card, after the instruction for carrying out self terminal is received, decision instruction 0x
Data in third and fourth byte of 04DA9F790A00000005 0000D03766E4 are the 3rd default mark, then judge
The instruction for carrying out self terminal for receiving is that the second circle deposits instruction, performs step 421.
Step 421:Smart card obtains dealing money in depositing instruction from the second circle;
Specifically, the data that smart card acquisition second is enclosed in the 6th to the 11st byte deposited in instruction, and as
Dealing money.
For example:Smart card obtain the second circle deposit in instruction 0x04DA9F790A00000005000000D03766E4 the
Data 0x000000050000 in six to the 11st bytes, and as dealing money.
Step 422:Current electronic closing balance is write smart card dealing money as Current electronic closing balance
To in random access memory;
Step 423:Smart card set M1 transaction status marks;
Step 424:Smart card opens affairs;
Step 425:Be written to Current electronic closing balance in M1 memory blocks by smart card;
Step 426:Smart card obtains M1 original volumes from the first memory block of virtual machine;M1 original volumes are updated to Current electronic
Closing balance;M1 original volumes after renewal are written in the first memory block of virtual machine;
Step 427:In the Flash memory blocks that be written to Current electronic closing balance in electronic wallet application by smart card;
Step 428:In the Flash memory blocks that be written to Current electronic closing balance in electronic cash application by smart card;
Step 429:Smart card closes affairs;
Step 430:Smart card reset M1 transaction status marks;
Step 431:Smart card returns to circle and deposits response to terminal, terminates.
In the present embodiment, also include in step 401:When type of transaction is that qPBOC extends transaction, step a1 is performed;
Step a1:Intelligent card initialization electronic cash application, electronics is obtained from the Flash memory blocks of electronic cash application
Closing balance, dealing money is obtained from Treatment Options instruction is obtained, and calculates the difference of electronic cash balances and dealing money;Will
Electronic cash balances are updated to the difference of electronic cash balances and dealing money;
Step a2:Be written to Current electronic closing balance in random access memory by smart card;
Step a3:Smart card returns to initialization application response to terminal;
Step a4:Smart card receives the renewal expanded application recording instruction for carrying out self terminal;
Step a5:Smart card updates expanded application record, judges whether to update to the last item expanded application record, if
It is then to perform step a6;Otherwise, step a5 is continued executing with;
Step a6:Smart card is returned to terminal and updates expanded application record response, performs step 405.
Correspondingly, step 405 is specially:The instruction from terminal to be received such as smart card, self terminal is carried out when receiving
After read record instruction, detection type of transaction mark, when type of transaction is designated Second Type to be identified, performs step 406.
Necessarily, when type of transaction is that qPBOC extends transaction, before performing step 401, also include:
Step b1:Smart card receives the reading expanded application recording instruction for carrying out self terminal;
Step b2:Smart card judges whether to read the last item expanded application record, if it is, returned to terminal reading
Expanded application records response, performs step 401;Otherwise, step b2 is continued executing with.
In the present embodiment, step 205 may be replaced by:Smart card obtains M1 remaining sums from M1 wallet copies;Accordingly:
Step 208 may be replaced by:Smart card obtains M1 remaining sums from M1 wallet originals, performs step 211;Step 308 has been performed
Afterwards, step 310 is directly performed;After step 322, step 324 is directly performed;After step 334, step 336 is directly performed;
Step 411 is directly performed after step 409;Step 427 is directly performed after step 425.
Many account balance sharing methods, the M1 remaining sums in card, electronic purse balance amount in the intelligent card that the present embodiment is provided
Can be shared with electronic cash balances.For example:Smart card in the M1 terminals using consumption after, the M1 remaining sums in card, electronic money
Bag remaining sum and electronic cash balances also synchronously change, after smart card is consumed on the financial terminal, the M1 remaining sums in card, electronic money
Bag remaining sum and electronic cash balances also synchronously change, and smart card is being supported the terminal of electronic cash application, is being supported electronics
The terminal of purse application and support to be used in the terminal of encryption storage card, solve that trading card maintenance cost is high, the wasting of resources is tight
Weight and the easy technical problem such as be cracked of M1 cards.
Embodiment 4
A kind of smart card is present embodiments provided, as shown in Figure 6:Including the first receiver module 01, the second receiver module
02nd, first detection module 03, the first judge module 04, first report an error module 05, the first update module 06, the first application module
07th, first module 08, the first computing module 09, the first transaction module 10, the first setup module 11, the second update module are returned to
12nd, second module 13 is returned to;
First receiver module 01, for receiving the selection application instruction from financial terminal;
Second receiver module 02, for receiving the application trading instruction from financial terminal;
First detection module 03, for after the first receiver module 01 receives selection application instruction, detecting the M1 of itself
Whether transaction status mark is set;
First judge module 04, for after first detection module 03 is detected as no, judging M1 remaining sums, the electronic money of itself
The magnitude relationship of bag remaining sum and electronic cash balances;
First judge module 04 includes:First acquisition unit, second acquisition unit, the 3rd acquiring unit and first judge single
Unit;
First acquisition unit, for after first detection module 03 is detected as no, M1 remaining sums being obtained from M1 memory blocks;
Further, first acquisition unit includes:First obtains subelement, the first judgment sub-unit, the second acquisition son list
Unit, the 3rd obtain subelement, the second judgment sub-unit and the 4th and obtain subelement;
First obtains subelement, for after first detection module 03 is detected as no, obtaining the M1 wallets in M1 memory blocks
Copy address, according to M1 wallet copy address acquisition M1 wallet copies;
First judgment sub-unit, it is whether legal for judging M1 wallets copy;
Second obtains subelement, for after the first judgment sub-unit is judged as YES, being obtained more than M1 from M1 wallet copies
Volume;
3rd obtains subelement, for after the first judgment sub-unit is judged as NO, obtaining the M1 wallets in M1 memory blocks
Original address;According to M1 wallet original address acquisition M1 wallet originals;
Second judgment sub-unit, it is whether legal for judging M1 wallets original;
4th obtains subelement, for after the second judgment sub-unit is judged as YES, being obtained more than M1 from M1 wallet originals
Volume;
Correspondingly, the first application module 07, is additionally operable to after the second judgment sub-unit is judged as NO, be referred to according to selection application
Order selection application.
Yet further, smart card can also include:First recovery module;
First recovery module, for after the second judgment sub-unit is judged as YES, the first judge module 04 to judge itself
Before the magnitude relationship of M1 remaining sums, electronic purse balance amount and electronic cash balances, write M1 wallets original as M1 wallets copy
To M1 wallet copies address.
Second acquisition unit, for after first detection module 03 is detected as no, being obtained from the first nonvolatile storage
Take electronic purse balance amount;
3rd acquiring unit, for after first detection module 03 is detected as no, being obtained from the second nonvolatile storage
Take electronic cash balances;
First judging unit, for judging M1 remaining sums whether more than electronic purse balance amount or electronic cash balances.
First update module 06, for when the first judge module 04 judges that M1 remaining sums are minimum, by electronic purse balance amount
It is updated to M1 remaining sums;Electronic cash balances are updated to M1 remaining sums;
First update module 06, specifically for:When the first judge module 04 judges that M1 remaining sums are minimum, M1 remaining sums are made
It is electronic purse balance amount, is written in the first nonvolatile storage;M1 remaining sums are written to second as electronic cash balances
In nonvolatile storage.
First application module 07, for judging that M1 remaining sums, electronic purse balance amount and electronics show when the first judge module 04
When golden remaining sum three is equal, and after the first update module 06 updates electronic purse balance amount and electronic cash balances, according to selection
Using instruction selection application;
First reports an error module 05, for judging that M1 remaining sums are more than electronic purse balance amount or electronics when the first judge module 04
During closing balance, reported an error to financial terminal;
First returns to module 08, for after the first application module 07 is according to selection application instruction selection application, to finance
Terminal returns to selection application success response;
First computing module 09, current account balance is calculated for the dealing money in application trading instruction;Currently
Account balance is Current electronic wallet balances or Current electronic closing balance;
First setup module 11, for when the first computing module 09 calculate current account balance after, set M1 transaction status
Mark;After the first transaction module 10 closes affairs, reset M1 transaction status marks;
First transaction module 10, for after the first computing module 09 calculates current account balance, opening affairs;When second
After M1 remaining sums, electronic purse balance amount and electronic cash balances are updated to current account balance by update module 12 respectively, thing is closed
Business;
Second update module 12, for when the first transaction module 10 open affairs after, by M1 remaining sums, electronic purse balance amount and
Electronic cash balances are updated to current account balance respectively;
Second update module 12, specifically for:After the first transaction module 10 opens affairs, when current account balance is to work as
During preceding electronic purse balance amount, it is written to Current electronic wallet balances as M1 remaining sums in M1 memory blocks;By Current electronic wallet
Remaining sum is written in the first nonvolatile storage as electronic purse balance amount;Current electronic wallet balances are showed as electronics
Golden remaining sum is written in the second nonvolatile storage;When current account balance is Current electronic closing balance, will current electricity
Sub- closing balance is written in M1 memory blocks as M1 remaining sums;Using Current electronic closing balance as electronic purse balance amount, write-in
To in the first nonvolatile storage;Current electronic closing balance is written into second as electronic cash balances non-volatile to deposit
In storage area.
Second returns to module 13, for when the second update module 12 is by more than M1 remaining sums, electronic purse balance amount and electronic cash
After volume is updated to current account balance respectively, transaction successful respond is returned to financial terminal.
In the present embodiment, smart card can also include the 3rd receiver module, the second detection module, the second computing module, the
Three update modules, second report an error module and the 3rd return module;
3rd receiver module, for receiving the M1 consumption orders from M1 terminals;
Second detection module, for after the 3rd receiver module receives M1 consumption orders, detecting the M1 affairs shapes of itself
Whether state mark is set;
Second reports an error module, for after the second detection module is detected as being, being reported an error to M1 terminals;
Second computing module, for after the second detection module is detected as no, calculating current M1 remaining sums;
Second computing module, specifically for after the second detection module is detected as no, M1 remaining sums being obtained from M1 memory blocks,
M1 dealing money is obtained from M1 consumption orders, the difference of M1 remaining sums and M1 dealing money is calculated, by M1 remaining sums and M1 trade golds
The difference of volume is used as current M1 remaining sums;
3rd update module, for being current M1 remaining sums by M1 balance updates;
3rd update module, specifically for current M1 remaining sums are written in M1 memory blocks as M1 remaining sums.
3rd returns to module, for returning to consumption successful information to M1 terminals.
In the present embodiment, smart card can also include:Second judge module;
Second judge module, it is whether legal using the dealing money in trading instruction for judging;
First computing module 09, specifically for after the second judge module is judged as YES, according in application trading instruction
Dealing money calculates current account balance;
First reports an error module 05, is additionally operable to after the second judge module is judged as NO, be reported an error to financial terminal.
Further, include using trading instruction:Stored value card consumption order or stored value card circle deposit instruction or electronics is existing
Golden consumption order or electronic cash circle deposit instruction;When smart card supports overdraw function:
Second judge module, specifically for:When application trading instruction is stored value card consumption order, dealing money is judged
Whether it is not more than electronic purse balance amount and subtracts the result of the amount of money of having overdrawed again plus the limit of overdrawn account, if it is, judges trade gold
Volume is legal;Otherwise, judge that dealing money is illegal;When application trading instruction deposits instruction for stored value card circle, judgement is concluded the business
Whether the amount of money is not more than the remaining sum upper limit subtracts the knot that electronic purse balance amount subtracts off line pre-authorization total amount plus the amount of money of having overdrawed
Really, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction is electronic cash consumption order, judge whether dealing money is not more than electronic cash balances
The result of the amount of money of having overdrawed is subtracted again plus the limit of overdrawn account, if it is, judging that dealing money is legal;Otherwise, trade gold is judged
Volume is illegal;
When application trading instruction deposits instruction for electronic cash circle, judge whether dealing money is not more than the remaining sum upper limit and adds
The amount of money of having overdrawed subtracts the result of off line pre-authorization total amount, if it is, judging that dealing money is legal;Otherwise, transaction is judged
The amount of money is illegal.
Further, include using trading instruction:Stored value card consumption order or stored value card circle deposit instruction or electronics is existing
Golden consumption order or electronic cash circle deposit instruction;When smart card does not support overdraw function:
Second judge module, specifically for:When application trading instruction is stored value card consumption order, dealing money is judged
Whether electronic purse balance amount is not more than, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for stored value card circle, judge whether dealing money is not more than the remaining sum upper limit and subtracts
Electronic purse balance amount subtracts the result of off line pre-authorization total amount again, if it is, judging that dealing money is legal;Otherwise, judge
Dealing money is illegal;
When application trading instruction is electronic cash consumption order, judge whether dealing money is not more than more than electronic cash
Volume, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal;
When application trading instruction deposits instruction for electronic cash circle, judge whether dealing money is not more than the remaining sum upper limit and subtracts
The result of off line pre-authorization total amount, if it is, judging that dealing money is legal;Otherwise, judge that dealing money is illegal.
In the present embodiment, can be specifically included using trading instruction:Stored value card consumption order or stored value card circle deposit finger
Order;
First computing module 09, specifically for when application trading instruction is stored value card consumption order, calculating electronic money
The difference of bag remaining sum and dealing money, and as Current electronic wallet balances;
When application trading instruction is specially stored value card circle deposits instruction, electronic purse balance amount and dealing money are calculated
With, and as Current electronic wallet balances.
Further, smart card also includes:First acquisition module and the 3rd judge module;Accordingly:Stored value card is consumed
Instruction includes:Consumption initialization directive and consumption order;Or specifically include compound consumption initialization directive, update Application of composite
Data buffer storage is instructed and Application of composite consumption order;Stored value card circle is deposited instruction and is specifically included:Circle deposits initialization directive and first
Circle deposits instruction;
Second receiver module 02 includes:First receiving unit, the second receiving unit, the 3rd receiving unit, the 4th receive single
Unit, the 5th receiving unit, the 6th receiving unit and the 7th receiving unit;
Second return module 13 includes:First returning unit, the second returning unit and the 3rd returning unit;
First receiving unit, for receiving the consumption initialization directive from financial terminal;
Second receiving unit, for receiving the consumption order from financial terminal;
3rd receiving unit, for receiving the compound consumption initialization directive from financial terminal;
4th receiving unit, for receiving the Application of composite consumption order from financial terminal;
5th receiving unit, initialization directive is deposited for receiving the circle from financial terminal;
6th receiving unit, instruction is deposited for receiving the first lap from financial terminal;
First acquisition module, for after the first receiving unit receives consumption initialization directive, referring to from consumption initialization
Dealing money is obtained in order;After the 3rd receiving unit receives compound consumption initialization directive, refer to from compound consumption initialization
Dealing money is obtained in order;After the 5th receiving unit receives the circle from financial terminal deposits initialization directive, deposited initially from circle
Change in instructing and obtain dealing money;
3rd judge module, it is whether legal for judging the dealing money that the first acquisition module gets;
First returning unit, successfully should for after the 3rd judge module is judged to be, returning to initialize to financial terminal
Answer;
First reports an error module 05, is additionally operable to after the 3rd judge module is judged as NO, be reported an error to financial terminal;
First computing module 09, specifically for receiving consumption order or when the 4th receiving unit connects when the second receiving unit
After receiving Application of composite consumption order, the difference of electronic purse balance amount and dealing money is calculated, and as Current electronic money
Bag remaining sum;After the 6th receiving unit receives first lap deposits instruction, the sum of electronic purse balance amount and dealing money is calculated, and will
It is used as Current electronic wallet balances;
Second returning unit, successfully should for after the first transaction module 10 closes affairs, returning to conclude the business to financial terminal
Answer;
7th receiving unit, for receiving the renewal Application of composite data buffer storage instruction from financial terminal;
3rd returning unit, after updating compound consumer record, returns to financial terminal and is updated successfully response.
In the present embodiment, can also be specifically included using trading instruction:Electronic cash consumption order or electronic cash circle are deposited
Instruction;
First computing module 09, specifically for when application trading instruction is specially electronic cash consumption order, calculating electricity
The difference of sub- closing balance and dealing money, and as Current electronic closing balance;When application trading instruction is specially electricity
When sub- cash circle deposits instruction, using dealing money as Current electronic closing balance.
Further, smart card also includes:4th judge module, the second setup module, the second acquisition module, the 5th judge
Module and the 3rd detection module;Accordingly, electronic cash consumption order is specifically included:Obtain Treatment Options instruction and read record refers to
Order;Or specifically include:Read expanded application recording instruction, obtain Treatment Options instruction, update expanded application recording instruction, read note
Record instruction;Electronic cash circle is deposited instruction and is specifically included:Obtain Treatment Options instruction, read record instruction, the first generation application cryptogram
Instruction, the second generation application cryptogram instruction and the second circle deposit instruction;
Second receiver module 02 includes:8th receiving unit, the 9th receiving unit, the tenth receiving unit, the 11st receive
Unit, the 12nd receiving unit, the 13rd receiving unit and the 14th receiving unit;
Second returns to module 13:Returned including the 4th returning unit, the 5th returning unit, the 6th returning unit, the 7th single
Unit, the 8th returning unit, the 9th returning unit and the tenth returning unit;
8th receiving unit, for receiving the acquisition Treatment Options instruction from financial terminal;
9th receiving unit, for receiving the read record instruction from financial terminal;
Tenth receiving unit, instruction is deposited for receiving the second circle from financial terminal;
4th judge module, for judging type of transaction according to acquisition Treatment Options instruction;
Second setup module, for when the 4th judge module judges that type of transaction is concluded the business for qPBOC, by type of transaction
Mark is set to first kind mark;When the 4th judge module judges that type of transaction extends transaction for qPBOC, by type of transaction
Mark is set to Second Type mark;When type of transaction is by means of credit transaction, type of transaction mark is set to the 3rd type identification;
Second acquisition module, for judging type of transaction for qPBOC is concluded the business or qPBOC extensions are handed over when the 4th judge module
Yi Shi, dealing money is obtained from Treatment Options instruction is obtained;When the 4th judge module judges that type of transaction is handed over for debt-credit note
Yi Hou, dealing money is obtained in depositing instruction from the second circle;
5th judge module, it is whether legal for judging the dealing money that the second acquisition module gets;
First computing unit, if being that qPBOC concludes the business or qPBOC extension transaction specifically for type of transaction, when the 5th judgement
After module is judged to be, the difference of electronic cash balances and dealing money is calculated, and as Current electronic closing balance;If
Type of transaction is by means of credit transaction, after the 5th judge module is judged to be, using dealing money as Current electronic closing balance;
4th returning unit, for after it is by means of credit transaction that the 4th judge module judges type of transaction, to financial whole
End returns to application initialization response;When the 4th judge module judge type of transaction for qPBOC conclude the business or qPBOC extension transaction and
First computing unit calculates the difference of electronic cash balances and dealing money, and as Current electronic closing balance after, to
Financial terminal returns to application initialization response;
First reports an error module 05, is additionally operable to after the 5th judge module is judged to no, be reported an error to financial terminal;
3rd detection module, for after the 9th receiving unit receives read record and instructs, detection type of transaction to be identified;
Second update module 12, specifically for detecting that type of transaction is designated first kind mark when the 3rd detection module
Or after Second Type mark, M1 remaining sums, electronic purse balance amount and electronic cash balances are updated to more than Current electronic cash respectively
Volume;When the first computing unit using dealing money as Current electronic closing balance after, by M1 remaining sums, electronic purse balance amount and electronics
Closing balance is updated to Current electronic closing balance respectively;
5th returning unit, for after the 3rd detection module detects that type of transaction is designated three type identifications, to
Financial terminal returns to read record response;When the 3rd detection module detects that type of transaction is designated first kind mark or Equations of The Second Kind
After type mark, and after 11 reset M1 transaction status marks of the first setup module, read record response is returned to financial terminal;
6th returning unit, for after the tenth receiving unit receives the second circle and deposits instruction, being returned to financial terminal and being enclosed
Deposit response;
11st receiving unit, for receiving the reading expanded application recording instruction from financial terminal;
7th returning unit, expanded application record response is read for being returned to financial terminal;
12nd receiving unit, for receiving the renewal expanded application recording instruction from financial terminal;
8th returning unit, after updating expanded application record, returning to renewal expanded application record to financial terminal should
Answer;
13rd receiving unit, for receiving the first generation application cryptogram instruction from financial terminal;
9th returning unit, application cryptogram response is generated for returning to first to financial terminal;
14th receiving unit, for receiving the second generation application cryptogram instruction from financial terminal;
Tenth returning unit, application cryptogram response is generated for returning to second to financial terminal.
A kind of smart card is present embodiments provided, more than the M1 remaining sums, electronic purse balance amount and electronic cash in intelligent card
Volume is shared, and enables smart card in the terminal for supporting electronic cash application, supports the terminal of encryption storage card and support electronics
Used in the terminal of purse application.
The above, the only present invention preferably specific embodiment, but protection scope of the present invention is not limited thereto,
Any one skilled in the art in technical scope disclosed by the invention, the change or replacement that can be readily occurred in,
Should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims
It is defined.
Claims (28)
1. many account balance sharing methods in a kind of intelligent card, it is characterised in that including:
Step s1:Smart card receives instruction, after smart card receives the selection application from financial terminal to be instructed, performs step
s2;After smart card receives the application trading instruction from financial terminal, step s6 is performed;
Step s2:Whether the M1 transaction status mark of the smart card detection itself is set, if it is, performing step s5;
Otherwise, step s3 is performed;
Step s3:The smart card judges the magnitude relationship of M1 remaining sums, electronic purse balance amount and the electronic cash balances of itself, if
The M1 remaining sums are minimum, then perform step s4;If the M1 remaining sums, the electronic purse balance amount and the electronic cash balances three
Person is equal, then perform step s5;If the M1 remaining sums are more than the electronic purse balance amount or the electronic cash balances, to institute
State financial terminal to report an error, terminate;
Step s4:The electronic purse balance amount is updated to the M1 remaining sums by the smart card;By the electronic cash balances more
It is newly the M1 remaining sums;
Step s5:The smart card returns to selection application according to the selection application instruction selection application to the financial terminal
Successful respond, return to step s1;
Step s6:Dealing money of the smart card in the application trading instruction calculates current account balance;It is described to work as
Preceding account balance is Current electronic wallet balances or Current electronic closing balance;
Step s7:M1 transaction status marks described in the smart card set, open affairs;
Step s8:The smart card updates the M1 remaining sums, the electronic purse balance amount and the electronic cash balances respectively
It is the current account balance;
Step s9:The smart card closes affairs;After closing affairs, reset the M1 transaction status mark, to the finance eventually
End returns to transaction successful respond, terminates.
2. method according to claim 1, it is characterised in that also include in the step s1:When receiving from M1 ends
After the M1 consumption orders at end, step r1 is performed;
Step r1:Whether the M1 transaction status mark of the smart card detection itself is set, if it is, to the M1 terminals
Report an error;Otherwise, step r2 is performed;
Step r2:The smart card calculates current M1 remaining sums, is current M1 remaining sums by the M1 balance updates, to the M1 terminals
Return to consumption successful information.
3. method according to claim 2, it is characterised in that the current M1 remaining sums of calculating, by the M1 balance updates
It is current M1 remaining sums, specially:The smart card obtains M1 remaining sums from M1 memory blocks, and M1 transaction is obtained from M1 consumption orders
The amount of money, calculates the difference of the M1 remaining sums and the M1 dealing money, by the difference of the M1 remaining sums and the M1 dealing money
As current M1 remaining sums, the current M1 remaining sums are written in M1 memory blocks as M1 remaining sums.
4. method according to claim 1, it is characterised in that the step s3 is specially:
The smart card obtains the M1 remaining sums from M1 memory blocks;The electronic money is obtained from the first nonvolatile storage
Bag remaining sum;The electronic cash balances are obtained from the second nonvolatile storage;Judge M1 remaining sums whether more than stored value card
Remaining sum or electronic cash balances, if it is, being reported an error to the financial terminal;Otherwise:If the M1 remaining sums are less than the electronics
Wallet balances and the M1 remaining sums are less than the electronic cash balances, then perform step s4;If the M1 remaining sums are equal to the electricity
Sub- wallet balances and the M1 remaining sums are equal to the electronic cash balances, then perform step s5.
5. method according to claim 4, it is characterised in that the M1 remaining sums are obtained in the memory block from M1, specifically
Including:
Step s31:The smart card obtains the M1 wallet copies address in the M1 memory blocks, according to M1 wallets copy ground
Location obtains M1 wallet copies;
Step s32:The smart card judges whether the M1 wallets copy is legal, if it is, performing step s33;Otherwise, hold
Row step t31;
Step s33:The smart card obtains the M1 remaining sums from the M1 wallets copy;
Step t31:The smart card obtains the M1 wallet originals address in the M1 memory blocks;It is just local according to the M1 wallets
Location obtains M1 wallet originals;
Step t32:The smart card judges whether M1 wallets original is legal, if it is, performing step t33;Otherwise, step is performed
Rapid s5;
Step t33:Smart card obtains M1 remaining sums from the M1 wallets original.
6. method according to claim 5, it is characterised in that when judging that M1 wallet originals are legal in the step t32
Afterwards, before the magnitude relationship for judging the M1 remaining sums, electronic purse balance amount and electronic cash balances of itself, also include:The intelligence
Can block and the M1 wallets original is copied into the M1 wallets copy address.
7. method according to claim 1, it is characterised in that described that the electronic purse balance amount is updated to more than the M1
Volume;The electronic cash balances are updated to the M1 remaining sums, specially:The smart card is using the M1 remaining sums as electronic money
Bag remaining sum, is written in the first nonvolatile storage;Using the M1 remaining sums as electronic cash balances be written to second it is non-easily
In the property lost memory block;
The M1 remaining sums, the electronic purse balance amount and the electronic cash balances are updated to more than the current account respectively
Volume, specially:When the current account balance is the Current electronic wallet balances, the smart card is by the Current electronic
Wallet balances are written in M1 memory blocks as M1 remaining sums;Using the Current electronic wallet balances as electronic purse balance amount, write
Enter in the first nonvolatile storage;Using the Current electronic wallet balances as electronic cash balances be written to second it is non-easily
In the property lost memory block;
When the current account balance is the Current electronic closing balance, the smart card is by more than the Current electronic cash
Volume is written in M1 memory blocks as M1 remaining sums;Using the Current electronic closing balance as electronic purse balance amount, is written to
In one nonvolatile storage;The Current electronic closing balance is written into second as electronic cash balances non-volatile to deposit
In storage area.
8. method according to claim 1, it is characterised in that before the step s6, also include:Judge that the application is handed over
Whether the dealing money easily in instruction is legal, if it is, performing step s6;Otherwise, reported an error to the financial terminal, terminated.
9. method according to claim 8, it is characterised in that the application trading instruction includes:Stored value card consumption refers to
Order or the stored value card circle deposit instruction or electronic cash consumption order or the electronic cash circle deposits instruction;
When the application trading instruction is the stored value card consumption order, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than electronic purse balance amount and adds the limit of overdrawn account
The result of the amount of money of having overdrawed is subtracted again, if it is, judging that the dealing money is legal;Otherwise, the dealing money is judged not
It is legal;
When the application trading instruction deposits instruction for the stored value card circle, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than the remaining sum upper limit and subtracts the stored value card
Remaining sum subtracts the result of off line pre-authorization total amount plus the amount of money of having overdrawed, if it is, judging that the dealing money is legal;It is no
Then, judge that the dealing money is illegal;
When the application trading instruction is the electronic cash consumption order, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than electronic cash balances and adds the limit of overdrawn account
The result of the amount of money of having overdrawed is subtracted again, if it is, judging that the dealing money is legal;Otherwise, the dealing money is judged not
It is legal;
When the application trading instruction deposits instruction for the electronic cash circle, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than the remaining sum upper limit and subtracts plus the amount of money of having overdrawed
The result of off line pre-authorization total amount is gone, if it is, judging that the dealing money is legal;Otherwise, the dealing money is judged
It is illegal.
10. method according to claim 8, it is characterised in that the application trading instruction includes:Stored value card consumption refers to
Order or the stored value card circle deposit instruction or electronic cash consumption order or the electronic cash circle deposits instruction;
When the application trading instruction is the stored value card consumption order, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than electronic purse balance amount, if it is, sentencing
The dealing money that breaks is legal;Otherwise, judge that the dealing money is illegal;
When the application trading instruction deposits instruction for the stored value card circle, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than the remaining sum upper limit and subtracts the stored value card
Remaining sum subtracts the result of off line pre-authorization total amount again, if it is, judging that the dealing money is legal;Otherwise, judge described
Dealing money is illegal;
When the application trading instruction is the electronic cash consumption order, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:The smart card judges whether the dealing money is not more than electronic cash balances, if it is, sentencing
The dealing money that breaks is legal;Otherwise, judge that the dealing money is illegal;
When the application trading instruction deposits instruction for the electronic cash circle, the trade gold in the judgement application trading instruction
Whether volume is legal to be specially:Whether the smart card judges to be not more than the remaining sum upper limit by the dealing money that to subtract off line pre-authorization total
The result of the amount of money, if it is, judging that the dealing money is legal;Otherwise, judge that the dealing money is illegal.
11. methods according to claim 1, it is characterised in that the application trading instruction includes:Stored value card consumption refers to
Order or the stored value card circle deposit instruction;
When the application trading instruction is the stored value card consumption order, the friendship in the application trading instruction
The easy amount of money calculates current account balance, specially:Calculate the difference of the electronic purse balance amount and the dealing money, and by its
As Current electronic wallet balances;
It is described according in the application trading instruction when the application trading instruction is specially the stored value card circle deposits instruction
Dealing money calculate current account balance, specially:The sum of the electronic purse balance amount and the dealing money is calculated, and will
It is used as Current electronic wallet balances.
12. methods according to claim 11, it is characterised in that the stored value card consumption order includes:Consumption is initial
Change instruction and consumption order;Or specifically include compound consumption initialization directive, update the instruction of Application of composite data buffer storage and multiple
Conjunction application consumption order;The stored value card circle is deposited instruction and is specifically included:Circle deposits initialization directive and first lap deposits instruction;
The step s1 is specifically included:The instruction to be received such as the smart card, when smart card receives the selection from financial terminal
After instruction, step s2 is performed;When the smart card receives the consumption initialization directive, the smart card is from described
Dealing money is obtained in consumption initialization directive, judges whether the dealing money is legal, if it is, to the financial terminal
Return to initialization successful respond, return to step s1;Otherwise, reported an error to the financial terminal, return to step s1;When the smart card
When receiving the consumption order, step s6 is performed;When the smart card receives the compound consumption initialization directive, institute
State smart card and obtain dealing money from the compound consumption initialization directive, judge whether the dealing money is legal, if
It is then to return to initialization successful respond, return to step s1 to the financial terminal;Otherwise, reported an error to the financial terminal, returned
Step s1;When the smart card receives Application of composite consumption order, step s6 is performed;Described in being received when the smart card
Circle is when depositing initialization directive, the smart card from the circle deposit initialization directive in obtain dealing money, judge the trade gold
Whether volume is legal, if it is, returning to initialization successful respond, return to step s1 to the financial terminal;Otherwise, to the gold
Melt terminal to report an error, return to step s1;When the smart card receives first lap deposits instruction, step s6 is performed;
Step s6 is specially:It is described when the smart card receives the consumption order or the Application of composite consumption order
Smart card calculates the difference of the electronic purse balance amount and the dealing money, and as Current electronic wallet balances, holds
Row step s7;
When the smart card receives the first lap deposits instruction, the smart card calculates the electronic purse balance amount and described
The sum of dealing money, and as Current electronic wallet balances, perform step s7;
Also include in the step s1:It is described when the smart card receives the renewal Application of composite data buffer storage to be instructed
Smart card updates compound consumer record, is returned to the financial terminal and is updated successfully response, return to step s1.
13. methods according to claim 1, it is characterised in that the application trading instruction includes:Electronic cash consumption refers to
Order or the electronic cash circle deposit instruction;
When the application trading instruction is specially the electronic cash consumption order, the step s6 is specially:The intelligence
Calorimeter calculates the difference of the electronic cash balances and the dealing money, and as Current electronic closing balance;
When the application trading instruction is specially the electronic cash circle deposits instruction, the step s6 is specially:The intelligence
Block the dealing money as Current electronic closing balance.
14. methods according to claim 13, it is characterised in that the electronic cash consumption order is specifically included:Obtain
Treatment Options are instructed and read record instruction;Or specifically include:Read expanded application recording instruction, obtain Treatment Options instruction, more
New expanded application recording instruction, read record instruction;
The electronic cash circle is deposited instruction and is specifically included:Obtain Treatment Options instruction, read record instruction, the first generation application cryptogram
Instruction, the second generation application cryptogram instruction and the second circle deposit instruction;
The step s1 is specifically included:The instruction to be received such as the smart card, when smart card receives the selection from financial terminal
After instruction, step s2 is performed;When the smart card receives the acquisition Treatment Options to be instructed, at the acquisition
Reason option instruction judges type of transaction, when the type of transaction is concluded the business for qPBOC, type of transaction mark is set into the first kind
Mark, the smart card obtains dealing money from the acquisition Treatment Options instruction, judges whether the dealing money is legal,
If it is, performing step s6;Otherwise, reported an error to the financial terminal, return to step s1;When the type of transaction is qPBOC
During extension transaction, type of transaction mark is set to Second Type mark, the smart card is from the acquisition Treatment Options instruction
Dealing money is obtained, judges whether the dealing money is legal, if it is, performing step s6;Otherwise, to the financial terminal
Report an error, return to step s1;When the type of transaction is by means of credit transaction, type of transaction mark is set to the 3rd type identification,
Application initialization response, return to step s1 are returned to the financial terminal;When the smart card receives the second circle deposits instruction,
The smart card obtains dealing money in depositing instruction from the circle, judges whether the dealing money is legal, if it is, performing
Step s6;Otherwise, reported an error to the financial terminal, return to step s1;When the smart card receives the read record to be instructed,
Detection type of transaction mark, when the type of transaction is designated first kind mark or Second Type mark, performs step s7;When
When the type of transaction is designated three type identifications, read record response, return to step s1 are returned to the financial terminal;
The step s6 is specially:If the type of transaction for when qPBOC concludes the business or qPBOC extension transaction when, when the intelligence
After card judges whether the dealing money is legal, the smart card calculates the electronic cash balances and the dealing money
Difference, and as Current electronic closing balance, application initialization response, return to step s1 are returned to the financial terminal;
If the type of transaction is by means of credit transaction, after the smart card judges whether the dealing money is legal, the intelligence
Can block the dealing money as Current electronic closing balance, perform step s7;
The step s1 also includes:When the smart card receives the reading expanded application recording instruction from the financial terminal
When, then returned to the financial terminal and read expanded application record response, return to step s1;When the smart card receives the renewal
During expanded application recording instruction, expanded application record is updated, returned to the financial terminal and update expanded application record response, returned
Return step s1;After the smart card receives the first generation application cryptogram to be instructed, first is returned to the financial terminal
Generation application cryptogram response, return to step s1;After the smart card receives the second generation application cryptogram to be instructed, to institute
State financial terminal and return to the second generation application cryptogram response, return to step s1.
A kind of 15. smart cards, it is characterised in that including:First receiver module, the second receiver module, first detection module, first
Judge module, first report an error module, the first update module, the first application module, first return to module, the first computing module, the
One transaction module, the first setup module, the second update module, second return to module;
First receiver module, for receiving the selection application instruction from financial terminal;
Second receiver module, for receiving the application trading instruction from financial terminal;
The first detection module, for after first receiver module receives the selection application instruction, detecting itself
M1 transaction status mark whether be set;
First judge module, for after the first detection module is detected as no, judging M1 remaining sums, the electronic money of itself
The magnitude relationship of bag remaining sum and electronic cash balances;
First update module, for when first judge module judges that the M1 remaining sums are minimum, by the electronics
Wallet balances are updated to the M1 remaining sums;The electronic cash balances are updated to the M1 remaining sums;
First application module, for judging the M1 remaining sums, the electronic purse balance amount when first judge module
When equal with the electronic cash balances three, and first update module updates the electronic purse balance amount and the electricity
After sub- closing balance, according to the selection application instruction selection application;
Described first reports an error module, for judging the M1 remaining sums more than more than the stored value card when first judge module
When volume or the electronic cash balances, reported an error to the financial terminal;
It is described first return module, for when first application module according to it is described selection application instruction selection application after, to
The financial terminal returns to selection application success response;
First computing module, current account balance is calculated for the dealing money in the application trading instruction;Institute
Current account balance is stated for Current electronic wallet balances or Current electronic closing balance;
First setup module, for when first computing module calculate current account balance after, M1 transaction status described in set
Mark;After first transaction module closes affairs, reset the M1 transaction status mark;
First transaction module, for after first computing module calculates current account balance, opening affairs;When described
Respectively be updated to for the M1 remaining sums, the electronic purse balance amount and the electronic cash balances described current by the second update module
After account balance, affairs are closed;
Second update module, for after first transaction module opens affairs, by the M1 remaining sums, the electronic money
Bag remaining sum and the electronic cash balances are updated to the current account balance respectively;
Described second returns to module, for when second update module is by the M1 remaining sums, the electronic purse balance amount and institute
State after electronic cash balances are updated to the current account balance respectively, transaction successful respond is returned to the financial terminal.
16. smart cards according to claim 15, it is characterised in that the smart card also includes the 3rd receiver module, the
Two detection modules, the second computing module, the 3rd update module, second report an error module and the 3rd return module;
3rd receiver module, for receiving the M1 consumption orders from M1 terminals;
Second detection module, for after the 3rd receiver module receives the M1 consumption orders, detecting itself
Whether M1 transaction status mark is set;
Described second reports an error module, for after second detection module is detected as being, being reported an error to the M1 terminals;
Second computing module, for after second detection module is detected as no, calculating current M1 remaining sums;
3rd update module, for being current M1 remaining sums by the M1 balance updates;
Described 3rd returns to module, for returning to consumption successful information to the M1 terminals.
17. smart cards according to claim 16, it is characterised in that second computing module, specifically for when described
Second detection module be detected as it is no after, from M1 memory blocks obtain M1 remaining sums, from M1 consumption orders obtain M1 dealing money, meter
The difference of the M1 remaining sums and the M1 dealing money is calculated, using the difference of the M1 remaining sums and the M1 dealing money as current
M1 remaining sums;
3rd update module, specifically for the current M1 remaining sums are written in M1 memory blocks as M1 remaining sums.
18. smart cards according to claim 15, it is characterised in that first judge module includes:First obtains single
Unit, second acquisition unit, the 3rd acquiring unit and the first judging unit;
The first acquisition unit, for after the first detection module is detected as no, the M1 being obtained from M1 memory blocks
Remaining sum;
The second acquisition unit, for after the first detection module is detected as no, from the first nonvolatile storage
Obtain the electronic purse balance amount;
3rd acquiring unit, for after the first detection module is detected as no, from the second nonvolatile storage
Obtain the electronic cash balances;
First judging unit, for judging M1 remaining sums whether more than electronic purse balance amount or electronic cash balances.
19. smart cards according to claim 18, it is characterised in that the first acquisition unit includes:First obtains son
Unit, the first judgment sub-unit, second obtain subelement, the 3rd acquisition subelement, the second judgment sub-unit and the 4th and obtain son
Unit;
Described first obtains subelement, for after the first detection module is detected as no, in obtaining the M1 memory blocks
M1 wallet copies address, according to the M1 wallets copy address acquisition M1 wallet copies;
First judgment sub-unit, it is whether legal for judging the M1 wallets copy;
Described second obtains subelement, for after first judgment sub-unit is judged as YES, from the M1 wallets copy
Obtain the M1 remaining sums;
Described 3rd obtains subelement, for after first judgment sub-unit is judged as NO, in obtaining the M1 memory blocks
M1 wallet originals address;According to the M1 wallets original address acquisition M1 wallet originals;
Second judgment sub-unit, it is whether legal for judging the M1 wallets original;
Described 4th obtains subelement, for after second judgment sub-unit is judged as YES, from the M1 wallets original
Obtain M1 remaining sums;
First application module, is additionally operable to after second judgment sub-unit is judged as NO, be referred to according to the selection application
Order selection application.
20. smart cards according to claim 19, it is characterised in that also including the first recovery module;
First recovery module, for after second judgment sub-unit is judged as YES, first judge module to judge
Before the magnitude relationship of itself M1 remaining sums, electronic purse balance amount and electronic cash balances, using the M1 wallets original as M1 money
Bag copy is written to the M1 wallets copy address.
21. smart cards according to claim 15, it is characterised in that first update module, specifically for:When described
When first judge module judges that the M1 remaining sums are minimum, using the M1 remaining sums as electronic purse balance amount, first is written to non-
In volatile storage area;The M1 remaining sums are written in the second nonvolatile storage as electronic cash balances;
Second update module, specifically for after first transaction module opens affairs, when the current account balance
During for the Current electronic wallet balances, the Current electronic wallet balances are written in M1 memory blocks as M1 remaining sums;Will
The Current electronic wallet balances are written in the first nonvolatile storage as electronic purse balance amount;By the current electricity
Sub- wallet balances are written in the second nonvolatile storage as electronic cash balances;
When the current account balance is the Current electronic closing balance, using the Current electronic closing balance as more than M1
Volume is written in M1 memory blocks;Using the Current electronic closing balance as electronic purse balance amount, first is written to non-volatile
In memory block;The Current electronic closing balance is written in the second nonvolatile storage as electronic cash balances.
22. smart cards according to claim 15, it is characterised in that also include:Second judge module;
Second judge module, it is whether legal for judging the dealing money in the application trading instruction;
First computing module, specifically for after second judge module is judged as YES, being referred to according to application transaction
Dealing money in order calculates current account balance;
Described first reports an error module, is additionally operable to after second judge module is judged as NO, be reported an error to the financial terminal.
23. smart cards according to claim 22, it is characterised in that the application trading instruction includes:Stored value card disappears
Expense instruction or the stored value card circle deposit instruction or electronic cash consumption order or the electronic cash circle deposits instruction;
Second judge module, specifically for:When the application trading instruction is the stored value card consumption order, judge
Whether the dealing money is not more than the result that electronic purse balance amount subtracts the amount of money of having overdrawed plus the limit of overdrawn account again, if it is,
Then judge that the dealing money is legal;Otherwise, judge that the dealing money is illegal;When the application trading instruction is the electricity
When sub- wallet circle deposits instruction, judge whether the dealing money is not more than the remaining sum upper limit and subtracts the electronic purse balance amount plus
The overdraw amount of money subtracts the result of off line pre-authorization total amount, if it is, judging that the dealing money is legal;Otherwise, institute is judged
State dealing money illegal;
When the application trading instruction is the electronic cash consumption order, judge whether the dealing money is not more than electronics
Closing balance subtracts the result of the amount of money of having overdrawed again plus the limit of overdrawn account, if it is, judging that the dealing money is legal;It is no
Then, judge that the dealing money is illegal;
When the application trading instruction deposits instruction for the electronic cash circle, judge whether the dealing money is not more than remaining sum
The upper limit subtracts the result of off line pre-authorization total amount plus the amount of money of having overdrawed, if it is, judging that the dealing money is legal;It is no
Then, judge that the dealing money is illegal.
24. smart cards according to claim 22, it is characterised in that the application trading instruction includes:Stored value card disappears
Expense instruction or the stored value card circle deposit instruction or electronic cash consumption order or the electronic cash circle deposits instruction;
Second judge module, specifically for:When the application trading instruction is the stored value card consumption order, judge
Whether the dealing money is not more than electronic purse balance amount, if it is, judging that the dealing money is legal;Otherwise, institute is judged
State dealing money illegal;
When the application trading instruction deposits instruction for the stored value card circle, judge whether the dealing money is not more than remaining sum
The upper limit subtracts the electronic purse balance amount and subtracts the result of off line pre-authorization total amount again, if it is, judging the trade gold
Volume is legal;Otherwise, judge that the dealing money is illegal;
When the application trading instruction is the electronic cash consumption order, judge whether the dealing money is not more than electronics
Closing balance, if it is, judging that the dealing money is legal;Otherwise, judge that the dealing money is illegal;
When the application trading instruction deposits instruction for the electronic cash circle, judge whether the dealing money is not more than remaining sum
The upper limit subtracts the result of off line pre-authorization total amount, if it is, judging that the dealing money is legal;Otherwise, the friendship is judged
The easy amount of money is illegal.
25. smart cards according to claim 15, it is characterised in that the application trading instruction includes:Stored value card disappears
Expense instruction or the stored value card circle deposit instruction;
First computing module, specifically for when the application trading instruction is the stored value card consumption order, calculating
The difference of the electronic purse balance amount and the dealing money, and as Current electronic wallet balances;
When the application trading instruction is specially the stored value card circle deposits instruction, the electronic purse balance amount and described is calculated
The sum of dealing money, and as Current electronic wallet balances.
26. smart cards according to claim 25, it is characterised in that also include:First acquisition module and the 3rd judges mould
Block;
The stored value card consumption order includes:Consumption initialization directive and consumption order;Or specifically include compound consumption just
Beginningization instruction, the instruction of renewal Application of composite data buffer storage and Application of composite consumption order;It is specific that the stored value card circle deposits instruction
Including:Circle deposits initialization directive and first lap deposits instruction;
Second receiver module includes:First receiving unit, the second receiving unit, the 3rd receiving unit, the 4th receiving unit,
5th receiving unit, the 6th receiving unit and the 7th receiving unit;
The second return module includes:First returning unit, the second returning unit and the 3rd returning unit;
First receiving unit, for receiving the consumption initialization directive from the financial terminal;
Second receiving unit, for receiving the consumption order from the financial terminal;
3rd receiving unit, for receiving the described compound consumption initialization directive from the financial terminal;
4th receiving unit, for receiving the Application of composite consumption order from the financial terminal;
5th receiving unit, initialization directive is deposited for receiving the circle from the financial terminal;
6th receiving unit, instruction is deposited for receiving the first lap from the financial terminal;
First acquisition module, for after first receiving unit receives the consumption initialization directive, from described
Dealing money is obtained in consumption initialization directive;When the 3rd receiving unit receives the compound consumption initialization directive
Afterwards, dealing money is obtained from the compound consumption initialization directive;The finance is come from when the 5th receiving unit is received
After the circle of terminal deposits initialization directive, from it is described circle deposit initialization directive in obtain dealing money;
3rd judge module, it is whether legal for judging the dealing money that first acquisition module gets;
First returning unit, for after the 3rd judge module is judged to be, being returned to the financial terminal initial
Change successful respond;
Described first reports an error module, is additionally operable to after the 3rd judge module is judged as NO, be reported an error to the financial terminal;
First computing module, specifically for receiving the consumption order or when the described 4th when second receiving unit
After receiving unit receives the Application of composite consumption order, the difference of the electronic purse balance amount and the dealing money is calculated
Value, and as Current electronic wallet balances;After the 6th receiving unit receives the first lap deposits instruction, calculate
The sum of the electronic purse balance amount and the dealing money, and as Current electronic wallet balances;
Second returning unit, for after first transaction module closes affairs, being returned to the financial terminal and being concluded the business
Successful respond;
7th receiving unit, for receiving the renewal Application of composite data buffer storage instruction from the financial terminal;
3rd returning unit, after updating compound consumer record, returns to the financial terminal and is updated successfully response.
27. smart cards according to claim 15, it is characterised in that the application trading instruction includes:Electronic cash disappears
Expense instruction or the electronic cash circle deposit instruction;
First computing module, specifically for when the application trading instruction is specially the electronic cash consumption order,
The difference of the electronic cash balances and the dealing money is calculated, and as Current electronic closing balance;Answered when described
When being specially the electronic cash circle with trading instruction and depositing instruction, using the dealing money as Current electronic closing balance.
28. smart cards according to claim 27, it is characterised in that also include:4th judge module, second set mould
Block, the second acquisition module, the 5th judge module and the 3rd detection module;The electronic cash consumption order is specifically included:Obtain
Treatment Options are instructed and read record instruction;Or specifically include:Read expanded application recording instruction, obtain Treatment Options instruction, more
New expanded application recording instruction, read record instruction;The electronic cash circle is deposited instruction and is specifically included:The instruction of acquisition Treatment Options,
Read record instruction, the first generation application cryptogram instruction, the second generation application cryptogram instruction and the second circle deposit instruction;
Second receiver module includes:8th receiving unit, the 9th receiving unit, the tenth receiving unit, the 11st receive single
Unit, the 12nd receiving unit, the 13rd receiving unit and the 14th receiving unit;
Described second returns to module:Including the 4th returning unit, the 5th returning unit, the 6th returning unit, the 7th returning unit,
8th returning unit, the 9th returning unit and the tenth returning unit;
8th receiving unit, for receiving the acquisition Treatment Options instruction from the financial terminal;
9th receiving unit, for receiving the read record instruction from the financial terminal;
Tenth receiving unit, instruction is deposited for receiving the second circle from the financial terminal;
4th judge module, for judging type of transaction according to the acquisition Treatment Options instruction;
Second setup module, for when the 4th judge module judges that the type of transaction is concluded the business for qPBOC, inciting somebody to action
Type of transaction mark is set to first kind mark;When the 4th judge module judges that the type of transaction extends for qPBOC
During transaction, type of transaction mark is set to Second Type mark;When the type of transaction is by means of credit transaction, by type of transaction
Mark is set to the 3rd type identification;
Second acquisition module, for when the 4th judge module judge the type of transaction for qPBOC conclude the business or
During qPBOC extension transaction, dealing money is obtained from the acquisition Treatment Options instruction;When the 4th judge module is judged
The type of transaction be by means of credit transaction after, from described second circle deposit instruction in obtain dealing money;
5th judge module, it is whether legal for judging the dealing money that second acquisition module gets;
First computing unit, if being that qPBOC concludes the business or qPBOC extension transaction specifically for the type of transaction, when described
After 5th judge module is judged to be:Calculate the difference of the electronic cash balances and the dealing money, and as working as
Preceding electronic cash balances;If the type of transaction is by means of credit transaction, after the 5th judge module is judged to be, will be described
Dealing money is used as Current electronic closing balance;
4th returning unit, for after it is by means of credit transaction that the 4th judge module judges the type of transaction,
Application initialization response is returned to the financial terminal;When the 4th judge module judges that the type of transaction is qPBOC
Transaction or qPBOC extensions transaction and first computing unit calculate the difference of the electronic cash balances and the dealing money
Value, and as Current electronic closing balance after, to the financial terminal return application initialization response;
Described first reports an error module, is additionally operable to after the 5th judge module is judged to no, be reported an error to the financial terminal;
3rd detection module, for after the 9th receiving unit receives the read record and instructs, detecting transaction class
Type is identified;
Second update module, specifically for detecting that the type of transaction is designated the first kind when the 3rd detection module
After type is identified or Second Type is identified, by the M1 remaining sums, the electronic purse balance amount and the electronic cash balances difference more
It is newly the Current electronic closing balance;When first computing unit is using the dealing money as Current electronic closing balance
Afterwards, the M1 remaining sums, the electronic purse balance amount and the electronic cash balances are updated to the Current electronic cash respectively
Remaining sum;
5th returning unit, for detecting that the type of transaction is designated the 3rd type mark when the 3rd detection module
After knowledge, read record response is returned to the financial terminal;When the 3rd detection module detects that the type of transaction is designated
After the first kind is identified or Second Type is identified, and after first setup module resets the M1 transaction status mark, to
The financial terminal returns to read record response;
6th returning unit, for after the tenth receiving unit receives second circle and deposits instruction, to the gold
Melt terminal return circle and deposit response;
11st receiving unit, for receiving the reading expanded application recording instruction from the financial terminal;
7th returning unit, expanded application record response is read for being returned to the financial terminal;
12nd receiving unit, for receiving the renewal expanded application recording instruction from the financial terminal;
8th returning unit, after updating expanded application record, returns to the financial terminal and updates expanded application note
Record response;
13rd receiving unit, for receiving the first generation application cryptogram instruction from the financial terminal;
9th returning unit, application cryptogram response is generated for returning to first to the financial terminal;
14th receiving unit, for receiving the second generation application cryptogram instruction from the financial terminal;
Tenth returning unit, application cryptogram response is generated for returning to second to the financial terminal.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611042232.9A CN106779635B (en) | 2016-11-22 | 2016-11-22 | Smart card and method for sharing balance of multiple accounts in smart card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611042232.9A CN106779635B (en) | 2016-11-22 | 2016-11-22 | Smart card and method for sharing balance of multiple accounts in smart card |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106779635A true CN106779635A (en) | 2017-05-31 |
CN106779635B CN106779635B (en) | 2020-10-13 |
Family
ID=58974682
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611042232.9A Active CN106779635B (en) | 2016-11-22 | 2016-11-22 | Smart card and method for sharing balance of multiple accounts in smart card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106779635B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109064316A (en) * | 2018-08-06 | 2018-12-21 | 飞天诚信科技股份有限公司 | A kind of credit card restores the method and device of off-line consumption amount |
CN110310113A (en) * | 2019-05-20 | 2019-10-08 | 深圳市微付充科技有限公司 | A kind of virtual card matching process, server and mobile terminal based on geographical location |
CN111126986A (en) * | 2019-11-25 | 2020-05-08 | 泰康保险集团股份有限公司 | Data processing method and device based on electronic wallet |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101799954A (en) * | 2009-11-20 | 2010-08-11 | 北京飞天诚信科技有限公司 | Method for loading double electronic purses |
US20120209733A1 (en) * | 2007-10-19 | 2012-08-16 | Ebay Inc. | Unified identity verification |
CN103236003A (en) * | 2013-04-09 | 2013-08-07 | 深圳市雄帝科技股份有限公司 | E-wallet payment method and device |
CN105427098A (en) * | 2015-11-02 | 2016-03-23 | 飞天诚信科技股份有限公司 | Method and device for realizing information sharing among different applications |
-
2016
- 2016-11-22 CN CN201611042232.9A patent/CN106779635B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120209733A1 (en) * | 2007-10-19 | 2012-08-16 | Ebay Inc. | Unified identity verification |
CN101799954A (en) * | 2009-11-20 | 2010-08-11 | 北京飞天诚信科技有限公司 | Method for loading double electronic purses |
CN103236003A (en) * | 2013-04-09 | 2013-08-07 | 深圳市雄帝科技股份有限公司 | E-wallet payment method and device |
CN105427098A (en) * | 2015-11-02 | 2016-03-23 | 飞天诚信科技股份有限公司 | Method and device for realizing information sharing among different applications |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109064316A (en) * | 2018-08-06 | 2018-12-21 | 飞天诚信科技股份有限公司 | A kind of credit card restores the method and device of off-line consumption amount |
CN109064316B (en) * | 2018-08-06 | 2020-10-13 | 飞天诚信科技股份有限公司 | Method and device for recovering offline consumption limit by credit card |
CN110310113A (en) * | 2019-05-20 | 2019-10-08 | 深圳市微付充科技有限公司 | A kind of virtual card matching process, server and mobile terminal based on geographical location |
CN110310113B (en) * | 2019-05-20 | 2022-01-04 | 深圳市微付充科技有限公司 | Virtual card matching method based on geographic position, server and mobile terminal |
CN111126986A (en) * | 2019-11-25 | 2020-05-08 | 泰康保险集团股份有限公司 | Data processing method and device based on electronic wallet |
CN111126986B (en) * | 2019-11-25 | 2023-06-30 | 泰康保险集团股份有限公司 | Data processing method and device based on electronic wallet |
Also Published As
Publication number | Publication date |
---|---|
CN106779635B (en) | 2020-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106779635A (en) | Many account balance sharing methods in a kind of smart card and its card | |
CN104820641B (en) | The method for reducing FLASH erasing times | |
CN107194676A (en) | A kind of virtual coin store transaction system and its application method | |
CN107632758A (en) | A kind of quick payment method, apparatus, computer installation and computer-readable recording medium | |
CN105993037A (en) | Business processing method and system of self-service device | |
CN109344987A (en) | Foreign currency reserves enchashment method, client, server, the pre- Ark of the Covenant of foreign currency and system | |
US20080010195A1 (en) | Power failure compensation method of laundry room machine and machine therefor | |
CN100589083C (en) | Picture processing chip for self-adapting automatic dead point detection and method thereof | |
JP4851161B2 (en) | Automatic teller machine, transaction processing system, portable terminal, transaction processing method, and program | |
CN105741440A (en) | Method and device for running bank note currency exchange self-service equipment | |
CN106651514A (en) | Intelligent home shopping system | |
CN110097447A (en) | Loan collection method and system | |
CN206209867U (en) | Non-networked data processing equipment, non-networked data interaction system | |
CN105045725B (en) | A kind of mobile terminal multi-memory card Realization of Storing and system | |
CN109508994A (en) | Business risk control method, device, computer equipment and storage medium | |
CN106816175A (en) | The control method and device of memory | |
CN206711255U (en) | Public umbrella rent and sale cabinet and public umbrella rent and sale system | |
CN104376342A (en) | Self-service device and method capable of supporting issuing of multiple sorts of media | |
CN108109279A (en) | Smart home purchase system | |
CN105374111A (en) | Automatic banknote trading device | |
CN109064316B (en) | Method and device for recovering offline consumption limit by credit card | |
CN108229942A (en) | Recharge method, equipment and the system of stored value card | |
CN108196886A (en) | A kind of card reader service implementation method and card reader | |
CN106203127A (en) | A kind of method realizing the reading of M1 application data general-purposeization and Mobile phone card | |
CN104680672A (en) | Data processing method |
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 |