CN105427098A - Method and device for realizing information sharing among different applications - Google Patents
Method and device for realizing information sharing among different applications Download PDFInfo
- Publication number
- CN105427098A CN105427098A CN201510733498.7A CN201510733498A CN105427098A CN 105427098 A CN105427098 A CN 105427098A CN 201510733498 A CN201510733498 A CN 201510733498A CN 105427098 A CN105427098 A CN 105427098A
- Authority
- CN
- China
- Prior art keywords
- instruction
- electronic cash
- data
- card
- electronic
- 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/30—Payment architectures, schemes or protocols characterised by the use of specific devices or networks
- G06Q20/36—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
- G06Q20/367—Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
-
- 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
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Computer Networks & Wireless Communication (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Finance (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses a method and a device for realizing information sharing among different applications. The method comprises steps that when a card determines a selection-needing application when receiving an application selection instruction issued by a host computer, if the selection-needing application is an electronic wallet application, the card utilizes the present electronic cash information of an electronic cash application to synchronize the present electronic wallet data of the electronic wallet application, when the card determines that conditions of the electronic wallet access data satisfy requirements, the present electronic wallet data is processed according to a received electronic wallet data access instruction, and the processing result is returned to the host computer; if the selection-needing application is an electronic cash application, the card utilizes the electronic wallet balance in the present electronic wallet data of the electronic cash application to synchronize the electronic cash balance of the present electronic cash information of the electronic cash application, when the card determines that conditions of the electronic cash access data satisfy requirements, the present electronic cash information is processed according to a received electronic cash access data instruction, and the processing result is returned to the host computer.
Description
Technical field
The present invention relates to information security field, particularly relate to implementation method and the device of information sharing between a kind of different application.
Background technology
Showing in the art, e-commerce initiative is generally all realized by stored value card, but due to the factor such as difference of disposal environment, local requirements, settlement system, sometimes need to be used by electronic cash, but because the feature of stored value card and electronic cash makes both cannot use in a card simultaneously, as want card can compatible old system, be suitable for old transaction, also want compatible new system simultaneously, the card of new environment, shares the information in stored value card and electronic cash with regard to needing.How prior art problem demanding prompt solution by the stored value card in card and the information sharing in electronic cash.
Summary of the invention
The object of the invention is to overcome the deficiencies in the prior art, implementation method and the device of information sharing between a kind of different application are provided.
The invention provides the implementation method of information sharing between a kind of different application, comprising: 1, the implementation method of information sharing between a kind of different application, is characterized in that, comprising:
Step S1: card is waited for and received the selective gist instruction that host computer issues, when receiving selective gist instruction, described card judges the application needing to select, as then performed step S2 for electronic wallet application, as applied then execution step S3 for electronic cash;
Step S2: the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information under described card electronic cash application, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and result is returned to described host computer;
Step S3: the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under described card electronic wallet application, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and result is returned to described host computer.
Further, the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information under described card electronic cash application, comprising:
Steps A 1: according to electronic cash information change mark, described card judges whether electronic cash information there occurs change, is, perform steps A 2, otherwise continues;
Steps A 2: described card obtains electronic cash balances in described electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes described electronic cash information change mark, continues.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives be circle deposit instruction time, described card judges that circle is deposited operating conditions and whether met first requirement, that the circle that described card is preserved is deposited the amount of money and upgraded electronic purse balance amount, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
Further, described card judges that circle is deposited operating conditions and whether met first requirement, comprising:
Whether described card judges that instruction deposited by described circle correct, described card judges whether current safe state is the first safe condition, described card judges that whether the MAC value that described circle is deposited in the data field of instruction is correct, described card judges whether transaction authentication code key exists, judged result as above-mentioned four is and is, then circle is deposited operating conditions and is met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is consumption order, described card judges whether consume operations condition meets the second requirement, that then described card upgrades electronic purse balance amount according to the spending amount preserved, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
Further, described card judges whether consume operations condition meets the second requirement, comprising:
Described card judges that whether described consumption order is correct, described card judges whether current safe state is the second safe condition or the 3rd safe condition, described card judges that whether the MAC value in the data field of described consumption order is correct, described card judges whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
Further, describedly electronic purse balance amount change mark is set and returns between success response comprise to described host computer:
Step B1: described card judges whether current safe state is described 3rd safe condition, is perform step B2, otherwise the instruction that host computer described in wait-receiving mode issues;
Step B2: described card judges whether there is corresponding expanded application log file in electronic cash application, is perform step B3, otherwise performs step B4;
Step B3: the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash, continues by described card;
Step B4: the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card, continues by described card.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives be circle deposit initialization directive time, described card judges that circle is deposited initialization operation condition and whether met the 5th requirement, that described card is preserved the described circle that described circle deposits in the data field of initialization directive and deposited the amount of money, first safe condition is set, and return success response to described host computer, the instruction that host computer described in wait-receiving mode issues, otherwise report an error, terminate.
Further, described card judges that circle is deposited initialization operation condition and whether met the 5th requirement, comprising:
Whether described card judges that initialization directive deposited by described circle correct, described card is deposited cipher key index according to the circle that described circle is deposited in the data field of initialization directive and is judged that corresponding circle is deposited key and whether existed, described card judges that the described circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise satisfied 5th requirement of initialization operation condition deposited by circle.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is for consumption initialization directive, described card judges whether consumption initialization operation condition meets the 6th requirement, that described card arranges the second safe condition, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
Further, described card judges whether consumption initialization operation condition meets the 6th requirement, comprising:
Described card judges that whether described consumption initialization directive is correct, according to the consumption cipher key index in the data field of described consumption initialization directive, described card judges whether corresponding consumption key exists, described card judges whether the spending amount in the data field of described consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is compound consumption initialization directive, described card judges whether compound consumption initialization operation condition meets the 7th requirement, that described card arranges described 3rd safe condition, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
Further, described card judges whether compound consumption initialization operation condition meets the 7th requirement, comprising:
Described card judges that whether described compound consumption initialization directive is correct, according to the compound consumption cipher key index in the data field of described compound consumption initialization directive, described card judges whether corresponding compound consumption key exists, described card judges whether the spending amount in the data field of described compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
Further, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is compound consumption file update instruction, perform step F 1;
Step F 1: described card judges whether described compound consumption file update operating conditions meets the 8th requirement, is perform step F 2, otherwise report an error, terminates;
Step F 2: described card judges whether according to the instruction of described compound consumption file update the expanded application file that there is corresponding electronic cash, is perform step F 3, otherwise performs step F 4;
Step F 3: the record content update electronic cash information of described card in the data field of described compound consumption file update instruction, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step F 4: the record content update electronic purse balance amount of described card in the data field of described compound consumption file update instruction, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer.
Further, described card judges whether described compound consumption file update operating conditions meets the 8th requirement, comprising:
Described card judges whether according to the short file identifier in the instruction of described compound consumption file update the multiple exchange log file that there is preset stored value card, according to the record identifier in the instruction of compound consumption file update, described card judges whether the corresponding record in the multiple exchange file of described stored value card exists, described card judges that whether the record length in the instruction of described compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
Further, the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under described card electronic wallet application, comprising:
Step P1: according to electronic purse balance amount change mark, described card judges whether electronic purse balance amount there occurs change, is, performs step P2, otherwise continue;
Step P2: the described electronic purse balance amount of described card upgrades electronic cash balances, removes described electronic purse balance amount change mark.
Further, electronic cash balances in Current electronic cash information, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and comprising:
When the access electronic purse data instruction that described card receives is read record instruction, described card judges whether read record operating conditions meets the 3rd requirement, that then described card upgrades electronic cash balances information according to the available electronic cash balances of current reality and dealing money, electronic cash information change mark is set, success response is returned to described host computer, the instruction that host computer described in wait-receiving mode issues, otherwise report an error, terminate.
Further, described card judges whether read record operating conditions meets the 3rd requirement, comprising:
Step X1: described card judges whether there is respective file in electronic cash application according to the data on the nybble of described read record instruction, is perform step X2, otherwise reports an error, terminate;
Step X2: according to the data in the 3rd byte of described read record instruction, described card judges whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, perform step X3, otherwise to report an error, terminate;
Step X3: described card judges whether current safe state satisfies condition, and is, performs step X4, otherwise return current data, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step X4: described card judges whether current data is the non-read data of the last item that document alignment accords with, is that then read record operating conditions meets the 3rd requirement, otherwise performs step X5;
Step X5: described card returns current data, the instruction that host computer described in wait-receiving mode issues to described host computer.
Further, describedly electronic cash information change mark is set and returns between success response also comprise to described host computer:
Step W1: described card judges whether to receive the instruction of renewal expanded application record buffer memory, is perform step W3, otherwise perform step W2;
Step W2: the inner zone bit arranged of electronic cash application removed by described card, returns current data, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step W3: the data in the instruction of described renewal expanded application record buffer memory are saved in the multiple exchange log file of electronic cash by described card, remove the inner zone bit arranged of electronic cash application, current data is returned, the instruction that host computer described in wait-receiving mode issues to described host computer.
Further, electronic cash balances in Current electronic cash information, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and comprising:
When the access electronic purse data instruction that described card receives is Update Table instruction, described card judges whether Update Table operating conditions meets the 4th requirement, that described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, electronic cash information change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
Further, described card judges whether Update Table operating conditions meets the 4th requirement, comprising:
Described card judges that whether described Update Table instruction is correct, described card judges that whether the label coding in described Update Table instruction is legal, described card judges that whether the length of the label value in described Update Table instruction is correct, described card judges that whether the MAC value in the data field of described Update Table instruction is correct, judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
Further, described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, arranges electronic cash information change mark, returns success response to described host computer, the instruction that host computer described in wait-receiving mode issues, comprising:
Step D1: described card judges whether the label in described Update Table instruction is preset data, is perform step D2, otherwise the instruction that host computer described in wait-receiving mode issues;
Step D2: described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark, returns success response, the instruction that host computer described in wait-receiving mode issues to described host computer.
Invention further provides the implement device of information sharing between a kind of different application, comprising:
Receiver module, for waiting for and receiving the instruction that host computer issues;
First judge module, for judging the application needing to select when described receiver module receives selective gist instruction, as then triggered the first synchronization module work for electronic wallet application, as then triggered the second synchronization module work for electronic cash application;
Described first synchronization module, for electronic cash application under the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information;
First processing module, during for meeting the demands when the condition of accessing electronic purse data, the access electronic purse data instruction according to receiving processes Current electronic purse data;
Described second synchronization module, for the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under electronic wallet application;
Second processing module, during for meeting the demands when the condition of accessing electronic cash data, the access electronic cash data command according to receiving processes Current electronic cash information;
Return module, for the result of described first processing module or the second processing module is returned to described host computer.
Further, described first synchronization module comprises:
First judging unit, for judging whether electronic cash information there occurs change, is according to electronic cash information change mark, triggering the first renewal clearing cell work, otherwise triggering described first processing module work;
Described first upgrades clearing cell, to overdraw the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money for obtaining electronic cash balances in described electronic cash information and electronic cash, remove described electronic cash information change mark, trigger described first processing module work.
Further, described first processing module, comprising:
Second judging unit, for receive when described receiver module circle deposit instruction time, judge that circle is deposited operating conditions and whether met first requirement, be, trigger the first renewal setting unit work, otherwise trigger and to report an error cell operation;
Described first upgrades setting unit, upgrades electronic purse balance amount for depositing the amount of money with the circle preserved, and upgrades electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
Further, whether described second judging unit is correct specifically for judging that instruction deposited by described circle, judge whether current safe state is the first safe condition, judge that whether the MAC value that described circle is deposited in the data field of instruction is correct, judge whether transaction authentication code key exists, judged result as above-mentioned four is and is, then circle is deposited operating conditions and met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
Further, described first processing module, comprising:
3rd judging unit, for when described receiver module receives consumption order, judges whether consume operations condition meets the second requirement, is trigger the second renewal setting unit work, otherwise triggers the cell operation that reports an error;
Described second upgrades setting unit, for upgrading electronic purse balance amount according to the spending amount preserved, upgrading electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
Further, described 3rd judging unit is specifically for judging that whether described consumption order is correct, judge whether current safe state is the second safe condition or the 3rd safe condition, judge that whether the MAC value in the data field of described consumption order is correct, judge whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
Further, described first processing module also comprises:
4th judging unit, for judging whether current safe state is described 3rd safe condition, is trigger the 5th judging unit work, otherwise triggers described receiver module work;
Described 5th judging unit, for judging whether there is corresponding expanded application log file in electronic cash application, is trigger the first updating block work, otherwise the second updating block work of triggering;
Described first updating block, for by the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash;
Described second updating block, for by the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card.
Further, described first processing module, comprising:
6th judging unit, for receive when described receiver module circle deposit initialization directive time, judge that circle is deposited initialization operation condition and whether met the 5th requirement, be trigger the first preservation setting unit work, otherwise trigger the cell operation that reports an error;
Described first preserves setting unit, and the amount of money deposited by the described circle deposited in the data field of initialization directive for preserving described circle, arranges the first safe condition;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
Further, whether described 6th judging unit is correct specifically for judging that initialization directive deposited by described circle, the circle deposited in the data field of initialization directive according to described circle is deposited cipher key index and is judged that corresponding circle is deposited key and whether existed, judge that the described circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise satisfied 5th requirement of initialization operation condition deposited by circle.
Further, described first processing module, comprising:
7th judging unit, during for receiving consumption initialization directive when described receiver module, judges whether consumption initialization operation condition meets the 6th requirement, is trigger the first setting unit work, otherwise triggers the cell operation that reports an error;
Described first setting unit, for arranging the second safe condition;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
Further, whether described 7th judging unit is correct specifically for judging described consumption initialization directive, judge whether corresponding consumption key exists according to the consumption cipher key index in the data field of described consumption initialization directive, judge whether the spending amount in the data field of described consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
Further, described first processing module, comprising:
8th judging unit, during for receiving compound consumption initialization directive when described receiver module, judges whether compound consumption initialization operation condition meets the 7th requirement, is trigger the second setting unit work, otherwise triggers the cell operation that reports an error;
Described second setting unit, for arranging described 3rd safe condition;
Described return module also for give described host computer return success response;
Describedly report an error unit also for reporting an error.
Further, whether described 8th judging unit is correct specifically for judging described compound consumption initialization directive, judge whether corresponding compound consumption key exists according to the compound consumption cipher key index in the data field of described compound consumption initialization directive, judge whether the spending amount in the data field of described compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
Further, described first processing module, comprising:
9th judging unit, during for receiving compound consumption file update instruction when described receiver module, judges whether described compound consumption file update operating conditions meets the 8th requirement, is trigger the tenth judging unit work, otherwise triggers the cell operation that reports an error;
The described unit that reports an error, for reporting an error;
Described tenth judging unit, for judging whether according to the instruction of described compound consumption file update the expanded application file that there is corresponding electronic cash, is trigger the 3rd and upgrade cell operation, otherwise the 4th updating block work of triggering;
Described 3rd updating block, for the record content update electronic cash information in the data field with the instruction of described compound consumption file update;
Described 4th updating block, for the record content update electronic purse balance amount in the data field with the instruction of described compound consumption file update;
Described return module also for give described host computer return success response.
Further, described 9th judging unit, specifically for judging whether according to the short file identifier in the instruction of described compound consumption file update the multiple exchange log file that there is preset stored value card, judge whether the corresponding record in the multiple exchange file of described stored value card exists according to the record identifier in the instruction of compound consumption file update, judge that whether the record length in the instruction of described compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
Further, described second synchronization module comprises:
11 judging unit, for judging whether electronic purse balance amount there occurs change, is according to electronic purse balance amount change mark, triggering the second renewal clearing cell work, otherwise triggering described second processing module work;
Described second upgrades clearing cell, for upgrading electronic cash balances with described electronic purse balance amount, removing described electronic purse balance amount change mark, triggering described second processing module work.
Further, described second processing module comprises:
12 judging unit, for when described receiver module receives read record instruction, judges whether read record operating conditions meets the 3rd requirement, is, triggers the 3rd and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
Described 3rd upgrades setting unit, for upgrading electronic cash balances information according to the available electronic cash balances of current reality and dealing money, arranges electronic cash information change mark;
Described return module also for give described host computer return success response;
The described unit that reports an error is for reporting an error.
Further, described 12 judging unit, comprising:
First judgment sub-unit, for judging whether there is respective file in electronic cash application according to the data on the nybble of described read record instruction, is trigger the second judgment sub-unit work, otherwise triggers the cell operation that reports an error;
Described second judgment sub-unit, for judging according to the data in the 3rd byte of described read record instruction whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, trigger the 3rd judgment sub-unit work, otherwise trigger the cell operation that reports an error;
Described 3rd judgment sub-unit, for judging whether current safe state satisfies condition, and is, triggers the 4th judgment sub-unit work, otherwise triggering returns module work;
The described module that returns is for returning current data to described host computer;
Described 4th judgment sub-unit, for judging whether current data is the non-read data of the last item that document alignment accords with, and is, triggering the described 3rd and upgrading setting unit work, otherwise returning module work described in triggering.
Further, described second processing module also comprises:
13 judging unit, receiving the instruction of renewal expanded application record buffer memory for judging whether, and being, trigger the 3rd and upgrade clearing cell work, otherwise first removes modular unit;
Described first clearing cell, for removing the inner zone bit arranged of electronic cash application;
Described return module also for give described host computer return current data;
Described 3rd upgrades clearing cell, for being saved in the multiple exchange log file of electronic cash by the data in the instruction of described renewal expanded application record buffer memory, removes the inner zone bit arranged of electronic cash application.
Further, the second processing module, comprising:
14 judging unit, for when described receiver module receives Update Table instruction, judges whether Update Table operating conditions meets the 4th requirement, is, triggers the 4th and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
4th upgrades setting unit, for using the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, arranging electronic cash information change mark, triggering and return module work;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
Further, whether described 14 judging unit is correct specifically for judging described Update Table instruction, judge that whether the label coding in described Update Table instruction is legal, judge that whether the length of the label value in described Update Table instruction is correct, judge that whether the MAC value in the data field of described Update Table instruction is correct, judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
Further, described 4th renewal setting unit comprises:
15 judgment sub-unit, for judging whether the label in described Update Table instruction is preset data, is, triggering new setting unit work just before dawn, otherwise triggering described receiver module work;
Described the newly arranges subelement just before dawn, for using the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark.
The present invention compared with prior art, has the following advantages:
Technical solution of the present invention compatible electronic Wallet System and electronic cash system, reduce the improvement cost of electronic purse system; Achieve single account, multi-user, minimizing fund is hoarded too much; By the information needing to share, independent as shared content, each application visits data by shared interface, reaches the effect that an account uses multiple system, is user-friendly to.
Accompanying drawing explanation
The implementation method process flow diagram of information sharing between a kind of different application that Fig. 1 provides for the embodiment of the present invention one;
A kind of electronic wallet application that Fig. 2, Fig. 3 and Fig. 4 provide for the embodiment of the present invention two and electronic cash apply between the implementation method process flow diagram of information sharing;
The implementation method process flow diagram of information sharing between a kind of different application that Fig. 5, Fig. 6 and Fig. 7 provide for the embodiment of the present invention three;
The implement device block scheme of information sharing between a kind of different application that Fig. 8 provides for the embodiment of the present invention four.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those skilled in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
In the present embodiment, the order that card receives all meets APDU form, is specially: CLAINSP1P2LcDataLe, and the length that wherein CLA is classes of instructions, INS is order code, P1, P2 are parameter, Lc is Data, Le are the length of return data.
Embodiment one
The embodiment of the present invention one provides the implementation method of information sharing between a kind of different application, as shown in Figure 1, comprising:
Step S1: card is waited for and received the selective gist instruction that host computer issues, when receiving selective gist instruction, card judges the application needing to select, as then performed step S2 for electronic wallet application, as applied then execution step S3 for electronic cash;
Step S2: the Current electronic cash information synchronous electronic wallet application Current electronic purse data under the application of card electronic cash, when card judges that the condition of access electronic purse data meets the demands, card processes Current electronic purse data according to the access electronic purse data instruction received, and result is returned to host computer;
Concrete, in the present embodiment, the Current electronic cash information synchronous electronic wallet application Current electronic purse data under the application of card electronic cash, comprising:
Steps A 1: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, perform steps A 2, otherwise continues;
Steps A 2: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark.
In the present embodiment, synchronous operation can be carried out before reception instruction, also synchronous operation is carried out before can processing instruction after instruction is received, as carried out before reception instruction, need to the control information of host computer backspace file after then synchronous, the then instruction that issues of wait-receiving mode host computer;
In the present embodiment, the instruction of access electronic purse data comprises: circle deposits instruction, consumption order, circle deposits initialization directive, consumption initialization directive, compound consumes initialization directive, compound consumes file update instruction, when card judges that the condition of access electronic purse data meets the demands, card processes Current electronic purse data according to the access electronic purse data instruction received, and result is returned to host computer, comprising:
(1) when the access electronic purse data instruction that card receives be circle deposit instruction time, card judges that circle is deposited operating conditions and whether met first requirement, that the circle that card is preserved is deposited the amount of money and upgraded electronic purse balance amount, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that wait-receiving mode host computer issues to host computer; Otherwise report an error, terminate.
Wherein, card judges that circle is deposited operating conditions and whether met first requirement, comprise: whether card judges that instruction deposited by circle correct, card judges whether current safe state is the first safe condition, card judges that whether the MAC value that circle is deposited in the data field of instruction is correct, and card judges whether transaction authentication code key exists, and the judged result as above-mentioned four is and is, then circle is deposited operating conditions and is met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
(2) when the access electronic purse data instruction that card receives is consumption order, card judges whether consume operations condition meets the second requirement, that then card upgrades electronic purse balance amount according to the spending amount preserved, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that wait-receiving mode host computer issues to host computer; Otherwise report an error, terminate.
Wherein, card judges whether consume operations condition meets the second requirement, comprise: card judges that whether consumption order is correct, card judges whether current safe state is the second safe condition or the 3rd safe condition, card judges that whether the MAC value in the data field of consumption order is correct, and card judges whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
After the access electronic purse data instruction received when card is consumption order, electronic purse balance amount change mark is set and returns between success response can comprise to host computer:
Step B1: card judges whether current safe state is the 3rd safe condition, is perform step B2, otherwise the instruction that wait-receiving mode host computer issues;
Step B2: card judges whether there is corresponding expanded application log file in electronic cash application, is perform step B3, otherwise performs step B4;
Step B3: the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash, continues by card;
Step B4: the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card, continues by card.
(3) when the access electronic purse data instruction that card receives be circle deposit initialization directive time, card judges that circle is deposited initialization operation condition and whether met the 5th requirement, that card is preserved the circle circle deposited in the data field of initialization directive and deposited the amount of money, first safe condition is set, and return success response to host computer, the instruction that wait-receiving mode host computer issues, otherwise report an error, terminate.
Wherein, card judges that circle is deposited initialization operation condition and whether met the 5th requirement, comprising:
Whether card judges that initialization directive deposited by circle correct, card is deposited cipher key index according to the circle circle deposited in the data field of initialization directive and is judged that corresponding circle is deposited key and whether existed, card judges that the circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise satisfied 5th requirement of initialization operation condition deposited by circle.
(4) when the access electronic purse data instruction that card receives is for consumption initialization directive, card judges whether consumption initialization operation condition meets the 6th requirement, that card arranges the second safe condition, and returns success response to host computer, the instruction that wait-receiving mode host computer issues; Otherwise report an error, terminate.
Wherein, card judges whether consumption initialization operation condition meets the 6th requirement, comprising:
Card judges that whether consumption initialization directive is correct, according to the consumption cipher key index in the data field of consumption initialization directive, card judges whether corresponding consumption key exists, card judges whether the spending amount consumed in the data field of initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
(5) when the access electronic purse data instruction that card receives is compound consumption initialization directive, card judges whether compound consumption initialization operation condition meets the 7th requirement, that card arranges the 3rd safe condition, and return success response to host computer, the instruction that wait-receiving mode host computer issues; Otherwise report an error, terminate.
Wherein, card judges whether compound consumption initialization operation condition meets the 7th requirement, comprising:
Card judges that whether compound consumption initialization directive is correct, according to the compound consumption cipher key index in the data field of compound consumption initialization directive, card judges whether corresponding compound consumption key exists, card judges whether the spending amount in the data field of compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
(6) when the access electronic purse data instruction that card receives is compound consumption file update instruction, step F 1 is performed;
Step F 1: card judges whether compound consumption file update operating conditions meets the 8th requirement, is perform step F 2, otherwise report an error, terminates;
In the present embodiment, step F 1 is specially: card judges whether according to the short file identifier in the instruction of compound consumption file update the multiple exchange log file that there is preset stored value card, according to the record identifier in the instruction of compound consumption file update, card judges whether the corresponding record in the multiple exchange file of stored value card exists, card judges that whether the record length in the instruction of compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
Step F 2: card judges whether according to the instruction of compound consumption file update the expanded application file that there is corresponding electronic cash, is perform step F 3, otherwise performs step F 4;
Step F 3: the record content update electronic cash information of card in the data field of compound consumption file update instruction, and return success response to host computer, the instruction that wait-receiving mode host computer issues;
Step F 4: the record content update electronic purse balance amount of card in the data field of compound consumption file update instruction, and return success response to host computer, the instruction that wait-receiving mode host computer issues.
Step S3: the electronic cash balances in the Current electronic cash information under the synchronous electronic cash application of the electronic purse balance amount in the Current electronic purse data under card electronic wallet application, when card judges that the condition of access electronic cash data meets the demands, card processes Current electronic cash information according to the access electronic cash data command received, and result is returned to host computer.
Concrete, in the present embodiment, the electronic cash balances in the Current electronic cash information under the synchronous electronic cash application of the electronic purse balance amount in the Current electronic purse data under card electronic wallet application, comprising:
Step P1: according to electronic purse balance amount change mark, card judges whether electronic purse balance amount there occurs change, is, performs step P2, otherwise continue;
Step P2: card electronic purse balance amount upgrades electronic cash balances, removes electronic purse balance amount change mark.
In the present embodiment, synchronizing process can be carried out before reception instruction, also can carry out after instruction is received, as carried out before reception instruction, need to the control information of host computer backspace file after then synchronous, the then instruction that issues of wait-receiving mode host computer;
In the present embodiment, access electronic cash data command to comprise: read record instruction and Update Table instruction; Electronic cash balances in Current electronic cash information under the synchronous electronic cash application of electronic purse balance amount in Current electronic purse data under card electronic wallet application, comprising:
(1) when the access electronic purse data instruction that card receives is read record instruction, card judges whether read record operating conditions meets the 3rd requirement, that then card upgrades electronic cash balances information according to the available electronic cash balances of current reality and dealing money, electronic cash information change mark is set, success response is returned to host computer, the instruction that wait-receiving mode host computer issues, otherwise report an error, terminate.
Wherein, card judges whether read record operating conditions meets the 3rd requirement, comprising:
Step X1: card judges whether there is respective file in electronic cash application according to the data on the nybble of read record instruction, is perform step X2, otherwise reports an error, terminate;
Step X2: according to the data in the 3rd byte of read record instruction, card judges whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, perform step X3, otherwise to report an error, terminate;
Step X3: card judges whether current safe state satisfies condition, and is, performs step X4, otherwise returns current data to host computer, the instruction that wait-receiving mode host computer issues;
Step X4: card judges whether current data is the non-read data of the last item that document alignment accords with, is that then read record operating conditions meets the 3rd requirement, otherwise performs step X5;
Step X5: card returns current data to host computer, the instruction that wait-receiving mode host computer issues.
In the present embodiment, card, in the process operated read record instruction, arranges electronic cash information change mark and returns between success response to host computer and also comprise:
Step W1: card judges whether to receive the instruction of renewal expanded application record buffer memory, is perform step W3, otherwise perform step W2;
Step W2: the inner zone bit arranged of electronic cash application removed by card, returns current data, the instruction that wait-receiving mode host computer issues to host computer;
Step W3: the data upgraded in the instruction of expanded application record buffer memory are saved in the multiple exchange log file of electronic cash by card, remove the inner zone bit arranged of electronic cash application, current data is returned, the instruction that wait-receiving mode host computer issues to host computer.
(2) when the access electronic purse data instruction that card receives is Update Table instruction, card judges whether Update Table operating conditions meets the 4th requirement, that then card uses the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, electronic cash information change mark is set, success response is returned, the instruction that wait-receiving mode host computer issues to host computer; Otherwise report an error, terminate.
Wherein, card judges whether Update Table operating conditions meets the 4th requirement, comprising:
Card judges that whether Update Table instruction is correct, card judges that whether the label coding in Update Table instruction is legal, card judges that whether the length of the label value in Update Table instruction is correct, card judges that whether the MAC value in the data field of Update Table instruction is correct, judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
Card judge Update Table operating conditions meet the 4th require after concrete operations be:
Step D1: card judges whether the label in Update Table instruction is preset data, is perform step D2, otherwise the instruction that wait-receiving mode host computer issues;
Step D2: card uses the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark, returns success response, the instruction that wait-receiving mode host computer issues to host computer.
Embodiment two
The embodiment of the present invention two provide a kind of electronic wallet application and electronic cash apply between the implementation method of information sharing, as Fig. 2, Fig. 3 and Fig. 4, comprising:
Step 200: card is waited for and received the selective gist instruction that host computer issues, when receiving selective gist instruction, card judges the application needing to select, as then performed step 201 for electronic wallet application, as applied then execution step 301 for electronic cash;
Concrete, in the present embodiment, selective gist instruction meets APDU form, wherein CLA=0x00, INS=0xa4; Card judges the application needing to select by the application identities symbol of data field in selective gist instruction, as consistent with electronic wallet application identifier in application identities symbol, what need selection is applied as electronic wallet application, as application identities symbol accords with consistent with electronic cash application identities, needs the electronic cash that is applied as selected to apply;
Step 201: card judges whether electronic cash information there occurs change, is, performs step 202, otherwise perform step 203;
Concrete, in the present embodiment, card calls first and shares interface, read electronic cash information change mark, and by rreturn value, electronic cash information change mark is sent to card, card judges that electronic cash information change identifies whether set, be that electronic cash information there occurs change, otherwise electronic cash information does not change;
In the present embodiment, electronic cash information comprises: electronic cash balances, to overdraw electronic cash, electronic cash balances higher limit, the electronic cash limit of overdrawn account etc.;
Step 202: card obtains electronic cash balances and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money from electronic cash information, removes electronic cash information change mark, performs step 203;
Concrete, in the present embodiment, APDU object is shared interface as parameter call second by card, obtain electronic cash balances and electronic cash to have overdrawed the amount of money place it in the buffer area of APDU object, after the called end of second shared interface, card obtains electronic cash balances and the amount of money of having overdrawed from the buffer area of APDU object, and upgrades electronic purse balance amount and stored value card to have overdrawed the amount of money with the electronic cash balances got and the electronic cash amount of money of having overdrawed; Card calls the 3rd and shares interface, removes electronic cash information change mark, and whether successful for operation result is returned to card by rreturn value;
APDU to as if java card virtual machine receive APDU instruction after a java object encapsulating, the inside has the space of 260 bytes can temporary storaging data;
Step 203: card, to the control information of host computer backspace file, performs step 204;
Step 204: card is waited for and received the operational order that host computer issues, and judging the type of this operational order, then performing step 205 as deposited initialization directive for circle, then performing step 209 as deposited instruction for circle when receiving operational order; As then performed step 214, as then performed step 218 for consumption order for consumption initialization directive; As then performed step 227 for compound consumption initialization directive; As then performed step 231 for the instruction of compound consumption file update;
Concrete, in the present embodiment, circle is deposited initialization directive and is met APDU order format, and if INS=0x50, P1=0x00, the P2=0x02 in instruction is then for initialization directive deposited by circle, data field comprises circle and deposits cipher key index, encloses and deposit the amount of money, host computer numbering; If the INS=0x52 in instruction is then for instruction deposited by circle, data field comprises circle and deposits the date, encloses and deposit time and MAC value; If INS=0x50, P1=0x01, the P2=0x02 in instruction is then consumption initialization directive, data field comprises consumption cipher key index, dealing money, host computer numbering; If the INS=0x54 in instruction is then consumption order, data field comprises transaction sequence number, trade date, exchange hour and MAC value; If INS=0x50, P1=0x03, the P2=0x02 in instruction is then compound consumption initialization directive, consumption cipher key index, dealing money, host computer numbering are closed in data field cladding; If CLA=0x80, the INS=0xdc in instruction is then the instruction of compound consumption file update, data field comprises record value;
Step 205: card judges whether correctly circle deposits initialization directive, is perform step 206, otherwise reports an error, terminate;
In the present embodiment, step 205 comprises: card specifically judges whether P1, P2 and Le that this circle is deposited in initialization directive meet the first setting value, are, encloses that to deposit initialization directive correct, otherwise circle to deposit initialization directive incorrect; Preferably, the first setting value in the present embodiment is 0x000210;
Step 206: card is deposited cipher key index according to the circle circle deposited in the data field of initialization directive and judged that corresponding circle is deposited key and whether existed, and is perform step 207, otherwise reports an error, terminate;
Concrete, in the present embodiment, enclose the host computer numbering that the data field depositing initialization directive comprises 6 bytes, cipher key index deposited by the circle of 1 byte, and the amount of money deposited by the circle of 4 bytes;
Step 207: card judges that the circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of electronic purse balance amount exceedes electronic cash balances higher limit, is report an error, and terminates, otherwise performs step 208;
Step 208: card is preserved the circle circle deposited in the data field of initialization directive and deposited the amount of money, arranges the first safe condition, and returns the success response of 16 bytes to host computer, return step 204;
Concrete, in the present embodiment, the first safe condition is set and comprises: safe condition is set to the first numerical value by card;
Step 209: card judges whether correctly circle deposits instruction, is perform step 210, otherwise reports an error, terminate;
In the present embodiment, step 209 comprises: card specifically judges whether CLA, P1, P2, Lc and Le that this circle is deposited in instruction meet the second setting value, are, encloses that to deposit instruction correct, otherwise circle to deposit instruction incorrect; Preferably, the second setting value in the present embodiment is 0x8000000b04;
Step 210: card judges whether current safe state is the first numerical value, is perform step 211, otherwise reports an error, terminates;
Step 211: card judges that whether the MAC value that circle is deposited in the data field of instruction is correct, is perform step 212, otherwise reports an error, terminate;
Step 212: card judges whether transaction authentication code key exists, and is perform step 213, otherwise reports an error, terminates;
In the present embodiment, transaction authentication code key is card write when carrying out individualized place's operation;
Step 213: the circle that card is preserved is deposited the amount of money and upgraded electronic purse balance amount, arranges electronic purse balance amount change mark, upgrades electronic cash and to have overdrawed the amount of money, return success response, return step 204 to host computer with the stored value card amount of money of having overdrawed;
Concrete, in the present embodiment, electronic purse balance amount is shared interface as parameter call the 4th by card, add that the result renewal electronic purse balance amount of the amount of money deposited by circle with electronic purse balance amount, and electronic purse balance amount change mark (electronic purse balance amount change mark is used for notifying that electronic cash Application share remaining sum changes) is set, the rreturn value sharing interface by the 4th returns operating result to card, and operating result is successful operation or operation failure; The card amount of money of having been overdrawed by stored value card is put in APDU target cache district and shares interface as parameter call the 5th, obtains stored value card and overdrawed the amount of money upgrade electronic cash with it and to have overdrawed the amount of money from parameter;
Step 214: card judges that whether consumption initialization directive is correct, is perform step 215, otherwise reports an error, terminate;
Concrete, in the present embodiment, card specifically judges whether the length of CLA, the Lc in this consumption initialization directive and the data in data field meets the 3rd setting value, is, consume initialization directive correctly, otherwise consumption initialization directive is incorrect; Preferably, the 3rd setting value is 0x800b0f;
Step 215: according to the consumption cipher key index in the data field of consumption initialization directive, card judges whether corresponding consumption key exists, and is perform step 216, otherwise reports an error, terminate;
Concrete, in the present embodiment, the data field of consumption initialization directive comprises the host computer numbering of 6 bytes, the consumption cipher key index of 1 byte, the spending amount of 4 bytes;
Step 216: card judges that whether the spending amount consumed in the data field of initialization directive exceedes electronic purse balance amount, is report an error, terminates, otherwise perform step 217;
Step 217: card arranges the second safe condition, and return the success response of 15 bytes to host computer, return step 204;
Concrete, in the present embodiment, card arranges the second safe condition and comprises: current safe state is set to second value by card; Concrete, the data that card returns to host computer in this step comprise: self remaining sum, offline transaction sequence number, pseudo random number etc. of preservation;
Step 218: card judges that whether consumption order is correct, is perform step 219, otherwise reports an error, terminate;
In the present embodiment, step 218 comprises: card specifically judges whether CLA, P1, P2, Lc and the Le in this consumption order meets the 4th setting value, be that then consumption order is correct, otherwise consumption order is incorrect; Preferably, the 4th setting value in the present embodiment is 0x8001000f08;
Step 219: card judges whether current safe state is the second safe condition or the 3rd safe condition, is perform step 220, otherwise reports an error, terminates;
Concrete, step 219 comprises: card judges whether current safe state is second value or third value;
Step 220: card judges that whether the MAC value in the data field of consumption order is correct, is perform step 221, otherwise reports an error, terminate;
Step 221: card judges whether transaction authentication code key exists, and is perform step 222, otherwise reports an error, terminates;
In the present embodiment, transaction authentication code key is card write when carrying out individualized operation;
Step 222: card upgrades the electronic purse balance amount preserved according to the spending amount preserved, arranges electronic purse balance amount change mark, upgrades electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed;
Concrete, in the present embodiment, spending amount is shared interface as parameter call the 4th by card, the result deducting spending amount with electronic purse balance amount upgrades electronic purse balance amount, and electronic purse balance amount change mark (electronic purse balance amount change mark is used for notifying that electronic cash Application share remaining sum changes) is set, the rreturn value sharing interface by the 4th returns operating result to card, and operating result is successful operation or operation failure; The card amount of money of having been overdrawed by stored value card is put in APDU target cache district and shares interface as parameter call the 5th, obtains stored value card and overdrawed the amount of money upgrade electronic cash with it and to have overdrawed the amount of money from parameter;
Step 223: card judges whether current safe state is the 3rd safe condition, is perform step 224, otherwise returns success response to host computer, return step 204;
Concrete, in the present embodiment, card judges whether current safe state is third value, is perform step 224, otherwise returns success response to host computer, return step 204;
Step 224: card judges whether there is corresponding expanded application file in electronic cash application, is perform step 225, otherwise performs step 226;
Concrete, in the present embodiment, card judges whether there is corresponding expanded application file in electronic cash application by the first variable that the 6th shares interface;
Step 225: the Data Update in Application of composite record buffer memory in the log file of the expanded application of electronic cash, is returned success response to host computer, returns step 204 by card;
Concrete, in the present embodiment, data in Application of composite record buffer memory are put into APDU target cache district with card and as parameter one, short file identifier calls the 7th as parameter two and shares interface, parameter one is put in the log file of the expanded application of electronic cash according to parameter two;
Step 226: the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card, is returned success response to host computer, returns step 204 by card;
Step 227: card judges that whether compound consumption initialization directive is correct, is perform step 228, otherwise reports an error, terminate;
Concrete, in the present embodiment, compound consumption initialization directive meets APDU order format, and card specifically judges whether P1, P2 and the Le in this APDU instruction meets the 5th setting value, be that then compound consumption initialization directive is correct, otherwise compound consumption initialization directive is incorrect; Preferably, the 5th setting value is 0x80b0f;
Step 228: according to the compound consumption cipher key index in the data field of compound consumption initialization directive, card judges whether corresponding compound consumption key exists, and is perform step 229, otherwise reports an error, terminate;
Concrete, in the present embodiment, the data field of compound consumption initialization directive comprises the host computer numbering of 6 bytes, the compound consumption cipher key index of 1 byte, the spending amount of 4 bytes;
Step 229: card judges whether the spending amount in the data field of compound consumption initialization directive exceedes electronic purse balance amount, is report an error, and terminates, otherwise performs step 230;
Step 230: card arranges the 3rd safe condition, and returns the success response of 15 bytes to host computer, returns step 204;
Concrete, in the present embodiment, card arranges the 3rd safe condition and comprises: current safe state is set to third value by card; The data returned to host computer comprise: electronic purse balance amount, offline transaction sequence number, pseudo random number etc.;
Step 231: card judges whether according to the short file identifier in the instruction of compound consumption file update the multiple exchange log file that there is preset stored value card, is perform step 232, otherwise reports an error, terminate;
Concrete, in the present embodiment, the value in the instruction of compound consumption file update on P2 comprises short file identifier;
Step 232: card judges to judge whether the corresponding record in the multiple exchange file of stored value card exists, and is perform step 233, otherwise reports an error according to the record identifier in the instruction of compound consumption file update, terminates;
Concrete, in the present embodiment, the value in the instruction of compound consumption file update on P1 is record identifier;
Step 233: card judges that whether the record length in the instruction of compound consumption file update is correct, is perform step 234, otherwise reports an error, terminate;
Concrete, in the present embodiment, the value of the Lc in the instruction of compound consumption file update represents record length;
Step 234: card judges the expanded application file whether having corresponding electronic cash in electronic cash application, is perform step 235, otherwise performs step 236;
Concrete, in the present embodiment, card shares by the 8th the expanded application file that interface judges whether to have in electronic cash application corresponding electronic cash;
Step 235: the record content update electronic cash information of card in the data field of compound consumption file update instruction, returns success response to host computer, return step 204;
Step 236: the record content update electronic purse balance amount of card in the data field of compound consumption file update instruction, returns success response to host computer, return step 204;
Step 301: card judges whether electronic purse balance amount there occurs change, is, performs step 302, otherwise perform step 303;
Concrete, in the present embodiment, card obtains the electronic purse balance amount change mark in electronic wallet application by shared interface, then represent that stored value card have modified remaining sum, then represent the unmodified remaining sum of stored value card as wallet balances change identifies non-set as wallet balances change identifies set;
Step 302: card electronic purse balance amount upgrades electronic cash balances, and remove electronic purse balance amount change mark, perform step 303;
Step 303: card, to the control information of host computer backspace file, performs step 304;
In the present embodiment, step 303 also comprises: card is removed transaction and started mark; It is GPO instruction (obtaining Treatment Options instruction) inner setting that transaction starts mark, represents in a transaction flow and can only send a GPO instruction, removes this mark and restart a transaction flow during choosing application;
Step 304: card is waited for and received the operational order that host computer issues, and judges the type of this operational order, as then performed step 305 for read record instruction, as then performed step 314 for Update Table instruction when receiving operational order;
Concrete, in the present embodiment, the value as CLAINS is the type of 0x00b2 then this instruction is read record instruction, and the value as INS is the type of 0xda then this instruction is Update Table instruction;
Step 305: card judges whether there is respective file in electronic cash application according to the data on the nybble of read record instruction, is perform step 306, otherwise reports an error, terminate;
In the present embodiment, read record instruction meets APDU order format;
Step 306: according to the data in the 3rd byte of read record instruction, card judges whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, perform step 307, otherwise to report an error, terminate;
Step 307: card judges whether current safe state satisfies condition, and is, performs step 308, otherwise returns current data to host computer, returns step 304;
Concrete, the condition met in the present embodiment is: card executed is crossed the instruction of acquisition Treatment Options and returned off line approval in-formation;
Step 308: card judges whether current data is the non-read data of the last item that document alignment accords with, and is perform step 310, otherwise performs step 309;
In the present embodiment, document alignment symbol (AFL) is card write when carrying out individualized;
Step 309: card returns current data to host computer, returns step 304;
In the present embodiment, also comprise in step 309: card arranges read record mark, for representing that current data read;
Step 310: card upgrades electronic cash balances information according to the available electronic cash balances of current reality and dealing money, arranges electronic cash information change mark;
Concrete, in the present embodiment, if electronic cash balances is not less than dealing money, then step 310 comprises: the electronic cash balances-dealing money of new electronic cash balances=old; If electronic cash balances is less than dealing money, then step 310 comprises: as electronic cash balances equals 0, then the amount of money of deduction+(dealing money-electronic cash balances) of the new amount of money that deducts=old;
Step 311: card judges whether to receive the instruction of renewal expanded application record buffer memory, is perform step 313, otherwise perform step 312;
Concrete, in the present embodiment, card arranges expanded application transaction ID after operating when receiving and upgrading expanded application record buffer memory instruction, and in step 311, card judges whether to be provided with expanded application transaction mark, be receive and be, otherwise do not receive;
Step 312: the inner zone bit arranged of electronic cash application removed by card, returns current data, return step 304 to host computer;
Step 313: the data upgraded in the instruction of expanded application record buffer memory are saved in the multiple exchange log file of electronic cash by card, removes the inner zone bit arranged of electronic cash application, returns current data, return step 304 to host computer;
Step 314: card judges that whether Update Table instruction is correct, is perform step 315, otherwise reports an error, terminate;
Concrete, in the present embodiment, whether the CLA in the instruction of card checking Update Table meets the first preset value, is perform step 315, otherwise reports an error, and terminates; Preferably, the first preset value is 0x04;
Step 315: card judges that whether the label coding in Update Table instruction is legal, is perform step 316, otherwise reports an error, terminates;
Concrete, at the present embodiment, step 315 is specially: card judges whether the coding of the label in Update Table instruction meets preset rules, be that then label is legal, otherwise label is illegal;
Step 316: card judges that whether the length of the label value in Update Table instruction is correct, is perform step 317, otherwise reports an error, terminate;
Concrete, in the present embodiment, card judges that whether the Lc value in Update Table instruction is identical with the value of default setting, is perform step 317, otherwise reports an error, and terminates; Preferably, the value pre-set is 0x06;
Step 317: card judges that whether the MAC in the data field of Update Table instruction is correct, is perform step 318, otherwise reports an error, terminate;
Step 318: card judges whether label is preset data, is perform step 319, otherwise returns step 304;
Concrete, in the present embodiment, preset data is 9F79 (representing the electronic cash amount of money) or DF62 (represents electronic cash segmentation deduct fees deduction limit);
Step 319: card uses the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark, returns success response, return step 304 to host computer.
In the present embodiment, electronic wallet application, smart card virtual machine, electronic cash is had to apply in card; Before calling shared interface, shared interface need be obtained, obtain the implementation procedure sharing interface and comprise:
Steps A 1: electronic wallet application obtains the shared object application AID and service application parameter that preserve;
In the present embodiment, service application parameter is preset, the shared object that each parameter is corresponding different; If service application has particular/special requirement to this service application parameter, then specify satisfactory data, for example: service application appointment 3 represents the shared object that A serve, write direct when calling the shared object that A serves so herein 3 just passable;
Steps A 2: the API that electronic wallet application calls card according to the shared object application AID obtained and service application parameter obtains the shared object of serving application;
Steps A 3: smart card virtual machine searches corresponding service application references according to the shared object application AID obtained in card in list of application;
Steps A 4: according to service application references, smart card virtual machine judges whether corresponding service application exists, and be perform steps A 5, otherwise tissue returns results, performs steps A 9;
Steps A 5: smart card virtual machine obtains corresponding context application AID according to current context, obtains the object reference of service application according to application references;
Steps A 6: smart card virtual machine based on context applies AID and service application parameter calls acquisition shared object function;
Steps A 7: based on context electronic cash application applies the authority that AID checks corresponding application, returns corresponding shared object according to service application parameter to smart card virtual machine;
Concrete, in the present embodiment, the authority of corresponding application comprises: service application may have particular/special requirement to its Client application, and for example A service can only be the application rights of using of B to application AID, just needs this time to check whether the AID of Client application is B;
Steps A 8: smart card virtual machine returns results according to the shared object tissue received;
Steps A 9: smart card virtual machine will return results and return to electronic wallet application;
Steps A 10: electronic wallet application receives and returns results, and whether judgement has shared object in returning results, and is obtain shared object, otherwise terminate.
Embodiment three
The embodiment of the present invention three provides the implementation method of information sharing between a kind of different application, as shown in Fig. 5, Fig. 6 and Fig. 7, comprising:
Step 501: card is waited for and received the selective gist instruction that host computer issues, when receiving selective gist instruction, card judges the application needing to select, as then performed step 502 for electronic wallet application, as applied then execution step 529 for electronic cash;
Step 502: card is waited for and received the operational order that host computer issues, and judging the type of operational order, then performing step 503 as deposited instruction for circle when receiving operational order; As then performed step 507 for consumption order; Then step 511 is performed, as then performed step 515 for consumption initialization directive, as then performed step 519 for compound consumption initialization directive, as then performed step 523 for the instruction of compound consumption file update as deposited initialization directive for circle;
Step 503: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 504, otherwise perform step 505;
Step 504: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 505;
Step 505: card judges that circle is deposited operating conditions and whether met first requirement, is perform step 506, otherwise reports an error, terminates;
In the present embodiment, step 505 comprises: whether card judges that instruction deposited by circle correct, card judges whether current safe state is the first safe condition, whether card judges to enclose the MAC value of depositing in the data field of instruction correct, card judges whether transaction authentication code key exists, and above-mentioned four judge without sequencing, as four judged results are are, then circle is deposited operating conditions and is met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
Step 506: the circle that card is preserved is deposited the amount of money and upgraded electronic purse balance amount, upgrades electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, arrange electronic purse balance amount change mark, return success response, return step 502 to host computer;
Step 507: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 508, otherwise perform step 509;
Step 508: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 509;
Step 509: card judges whether consume operations condition meets the second requirement, is perform step 510, otherwise reports an error, and terminates;
In the present embodiment, step 509 comprises: card judges that whether consumption order is correct, card judges whether current safe state is the second safe condition or the 3rd safe condition, card judges that whether the MAC value in the data field of consumption order is correct, card judges whether transaction authentication code key exists, and above-mentioned four judge without sequencing, as four judged results are are, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
Step 510: card upgrades electronic purse balance amount according to the spending amount preserved, upgrades electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, arrange electronic purse balance amount change mark, return success response, return step 502 to host computer;
Concrete, in the present embodiment, also comprise before returning success response in step 510:
Step H1: card judges whether current safe state is the 3rd safe condition, is perform step H2, otherwise returns step 502;
Step H2: card judges whether there is corresponding expanded application log file in electronic cash application, is perform step H3, otherwise performs step H4;
Step H3: the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash, then continues to return success response to host computer, returns step 502 by card;
Step H4: the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card, then continues to return success response to host computer, returns step 502 by card.
Step 511: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 512, otherwise perform step 513;
Step 512: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 513;
Step 513: card judges that circle is deposited initialization operation condition and whether met the 5th requirement, is perform step 514, otherwise reports an error, terminate;
Concrete, in the present embodiment, step 513 comprises: whether card judges that initialization directive deposited by circle correct, card is deposited cipher key index according to the circle circle deposited in the data field of initialization directive and is judged that corresponding circle is deposited key and whether existed, card judges that the circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, above-mentioned three judge without three rear orders, as three judged results are be, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise circle is deposited initialization operation condition and is not met the 5th requirement.
Step 514: card is preserved the circle circle deposited in the data field of initialization directive and deposited the amount of money, arranges the first safe condition, and returns success response to host computer, return step 502.
Step 515: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 516, otherwise perform step 517;
Step 516: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 517;
Step 517: card judges whether consumption initialization operation condition meets the 6th requirement, is perform step 518, otherwise reports an error, terminate;
Concrete, in the present embodiment, step 517 comprises: card judges that whether consumption initialization directive is correct, according to the consumption cipher key index in the data field of consumption initialization directive, card judges whether corresponding consumption key exists, card judges whether the spending amount consumed in the data field of initialization directive exceedes electronic purse balance amount, above-mentioned three judge without sequencing, as three judged results are be, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
Step 518: card arranges the second safe condition, and returns success response to host computer, returns step 502.
Step 519: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 520, otherwise perform step 521;
Step 520: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 521;
Step 521: card judges whether compound consumption initialization operation condition meets the 7th requirement, is perform step 522, otherwise reports an error, terminate;
Concrete, in the present embodiment, step 521 comprises: card judges that whether compound consumption initialization directive is correct, according to the compound consumption cipher key index in the data field of compound consumption initialization directive, card judges whether corresponding compound consumption key exists, card judges whether the spending amount in the data field of compound consumption initialization directive exceedes electronic purse balance amount, above-mentioned three judge without sequencing, as three judged results are be, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
Step 522: card arranges the 3rd safe condition, and returns success response to host computer, returns step 502.
Step 523: according to electronic cash information change mark, card judges whether electronic cash information there occurs change, is, performs step 524, otherwise perform step 525;
Step 524: card obtains electronic cash balances in electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes electronic cash information change mark, performs step 525;
Step 525: card judges whether compound consumption file update operating conditions meets the 8th requirement, is perform step 526, otherwise reports an error, terminate;
Concrete, in the present embodiment, step 525 comprises: card judges whether according to the short file identifier in the instruction of compound consumption file update the multiple exchange log file that there is preset stored value card, according to the record identifier in the instruction of compound consumption file update, card judges whether the corresponding record in the multiple exchange file of stored value card exists, card judges that whether the record length in the instruction of compound consumption file update is correct, judged result as three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
Step 526: card judges whether according to the instruction of compound consumption file update the expanded application file that there is corresponding electronic cash, is perform step 527, otherwise performs step 528;
Step 527: the record content update electronic cash information of card in the data field of compound consumption file update instruction, and return success response to host computer, return step 502;
Step 528: the record content update electronic purse balance amount of card in the data field of compound consumption file update instruction, and return success response to host computer, return step 502.
Step 529: card is waited for and received the operational order that host computer issues, and judges the type of operational order, as then performed step 530 for read record instruction, as then performed step 534 for Update Table instruction when receiving operational order;
Step 530: according to electronic purse balance amount change mark, card judges whether electronic purse balance amount there occurs change, is, performs step 531, otherwise perform step 532;
Step 531: card electronic purse balance amount upgrades electronic cash balances, removes electronic purse balance amount change mark, performs step 532;
Step 532: card judges whether read record operating conditions meets the 3rd requirement, is perform step 533, otherwise reports an error, and terminates;
Concrete, in the present embodiment, step 532 comprises:
Step 532-1: card judges whether there is respective file in electronic cash application according to the data on the nybble of read record instruction, is perform step 532-2, otherwise reports an error, terminate;
Step 532-2: according to the data in the 3rd byte of read record instruction, card judges whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, perform step 532-3, otherwise to report an error, terminate;
Step 532-3: card judges whether current safe state satisfies condition, and is, performs step 532-4, otherwise returns current data to host computer, returns step 529;
Step 532-4: card judges whether current data is the non-read data of the last item that document alignment accords with, and is perform step 533, otherwise performs step 532-5;
Step 532-5: card returns current data to host computer, returns step 529.
Wherein, the judgement of above-mentioned steps 532-1, step 532-2, step 532-3, step 532-4, without sequencing, can be exchanged arbitrarily;
Step 533: card upgrades electronic cash balances information according to the available electronic cash balances of current reality and dealing money, arranges electronic cash information change mark, returns success response, return step 529 to host computer;
In the present embodiment, in step 533, return success response to host computer before also comprise:
Step L1: card judges whether to receive the instruction of renewal expanded application record buffer memory, is perform step L3, otherwise perform step L2;
Step L2: the inner zone bit arranged of electronic cash application removed by card, returns current data, return step 529 to host computer;
Step L3: the data upgraded in the instruction of expanded application record buffer memory are saved in the multiple exchange log file of electronic cash by card, removes the inner zone bit arranged of electronic cash application, then continues to return current data to host computer, return step 529.
Step 534: according to electronic purse balance amount change mark, card judges whether electronic purse balance amount there occurs change, is, performs step 535, otherwise perform step 536;
Step 535: card electronic purse balance amount upgrades electronic cash balances, removes electronic purse balance amount change mark, performs step 536;
Step 536: card judges whether Update Table operating conditions meets the 4th requirement, is perform step 537, otherwise reports an error, and terminates;
In the present embodiment, step 537 comprises: card judges that whether Update Table instruction is correct, card judges that whether the label coding in Update Table instruction is legal, card judges that whether the length of the label value in Update Table instruction is correct, card judges that whether the MAC value in the data field of Update Table instruction is correct, and above-mentioned four judge without sequencing, as four judged results are are, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
Step 537: card uses the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, arranges electronic cash information change mark, returns success response, return step 529 to host computer.
Concrete, in the present embodiment, step 537 comprises:
Step 537-1: card judges whether the label in Update Table instruction is preset data, is perform step 537-2, otherwise returns step 529;
Step 537-2: card uses the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark, returns success response, return step P29 to host computer.
In the present embodiment, after card receives every bar instruction, carry out judging that the operation whether electronic cash information changes can be carried out upgrading the arbitrary steps before electronic purse balance amount, in like manner carrying out judging that the operation whether the stored value card amount of money changes can be carried out upgrading the arbitrary steps before electronic cash balances, not repeating them here.
Embodiment four
The embodiment of the present invention four provides the implement device of information sharing between a kind of different application, as shown in Figure 8, comprising:
Receiver module 801, for waiting for and receiving the instruction that host computer issues;
First judge module 802, judges the application needing to select, works as then triggered the first synchronization module 803 for electronic wallet application during for receiving selective gist instruction when receiver module, as worked for electronic cash application then triggers the second synchronization module 805;
First synchronization module 803, for electronic cash application under Current electronic cash information synchronous electronic wallet application Current electronic purse data;
In the present embodiment, the first synchronization module 803 comprises:
First judging unit, for judging whether electronic cash information there occurs change, is according to electronic cash information change mark, triggers the first renewal clearing cell work, otherwise triggering the first processing module 804 works;
First upgrades clearing cell, to overdraw the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money for obtaining electronic cash balances in electronic cash information and electronic cash, remove electronic cash information change mark, trigger the first processing module 804 and work.
First processing module 804, during for meeting the demands when the condition of accessing electronic purse data, the access electronic purse data instruction according to receiving processes Current electronic purse data;
Second synchronization module 805, for the electronic cash balances in the Current electronic cash information under the application of the synchronous electronic cash of the electronic purse balance amount in the Current electronic purse data under electronic wallet application;
Concrete, in the present embodiment, the second synchronization module 805 comprises:
11 judging unit, for judging whether electronic purse balance amount there occurs change, is according to electronic purse balance amount change mark, trigger the second renewal clearing cell work, otherwise triggering the second processing module 806 works;
Second upgrades clearing cell, for upgrading electronic cash balances with electronic purse balance amount, removing electronic purse balance amount change mark, triggering the second processing module 806 and work.
Second processing module 806, during for meeting the demands when the condition of accessing electronic cash data, the access electronic cash data command according to receiving processes Current electronic cash information;
Return module 807, for the result of the first processing module 804 or the second processing module 806 is returned to host computer.
In the present embodiment, the instruction of access electronic purse data comprises: circle deposits instruction, consumption order, circle deposits initialization directive, consumption initialization directive, compound consumes initialization directive, compound consumes file update instruction, then corresponding first processing module 804 includes different unit and goes to process, specific as follows:
(1) first processing module 804, comprising:
Second judging unit, for receive when receiver module circle deposit instruction time, judge that circle is deposited operating conditions and whether met first requirement, be, trigger the first renewal setting unit work, otherwise trigger and to report an error cell operation;
In the present embodiment, whether the second judging unit is correct specifically for judging that instruction deposited by circle, judge whether current safe state is the first safe condition, whether correctly judge to enclose the MAC value of depositing in the data field of instruction, judge whether transaction authentication code key exists, judged result as above-mentioned four is and is, then circle is deposited operating conditions and met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
First upgrades setting unit, upgrades electronic purse balance amount for depositing the amount of money with the circle preserved, and upgrades electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Return module 807 also for returning success response to host computer;
Report an error unit, for reporting an error.
(2) first processing modules 804, comprising:
3rd judging unit, for when receiver module receives consumption order, judges whether consume operations condition meets the second requirement, is trigger the second renewal setting unit work, otherwise triggers the cell operation that reports an error;
In the present embodiment, 3rd judging unit is specifically for judging that whether consumption order is correct, judge whether current safe state is the second safe condition or the 3rd safe condition, judge that whether the MAC value in the data field of consumption order is correct, judge whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
Second upgrades setting unit, for upgrading electronic purse balance amount according to the spending amount preserved, upgrading electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Return module 807 also for returning success response to host computer;
Report an error unit, for reporting an error.
In the present embodiment, the first processing module 804 also comprises:
4th judging unit, for judging whether current safe state is the 3rd safe condition, is, triggers the 5th judging unit work, otherwise triggering receiver module 801 works;
5th judging unit, for judging whether there is corresponding expanded application log file in electronic cash application, is trigger the first updating block work, otherwise the second updating block work of triggering;
First updating block, for by the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash;
Second updating block, for by the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card.
(3) first processing modules 804, comprising:
6th judging unit, for receive when receiver module circle deposit initialization directive time, judge that circle is deposited initialization operation condition and whether met the 5th requirement, be trigger the first preservation setting unit work, otherwise trigger the cell operation that reports an error;
In the present embodiment, whether the 6th judging unit is correct specifically for judging that initialization directive deposited by circle, deposit cipher key index according to the circle circle deposited in the data field of initialization directive and judge that corresponding circle is deposited key and whether existed, judge that the circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise satisfied 5th requirement of initialization operation condition deposited by circle.
First preserves setting unit, depositing the amount of money, arranging the first safe condition for preserving the circle circle deposited in the data field of initialization directive;
Return module 807 also for returning success response to host computer;
Report an error unit, for reporting an error.
(4) first processing modules 804, comprising:
7th judging unit, during for receiving consumption initialization directive when receiver module, judges whether consumption initialization operation condition meets the 6th requirement, is trigger the first setting unit work, otherwise triggers the cell operation that reports an error;
In the present embodiment, whether the 7th judging unit is correct specifically for judging consumption initialization directive, judge whether corresponding consumption key exists according to the consumption cipher key index in the data field of consumption initialization directive, judge whether the spending amount consumed in the data field of initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
First setting unit, for arranging the second safe condition;
Return module 807 also for returning success response to host computer;
Report an error unit, for reporting an error.
(5) first processing modules 804, comprising:
8th judging unit, during for receiving compound consumption initialization directive when receiver module, judges whether compound consumption initialization operation condition meets the 7th requirement, is trigger the second setting unit work, otherwise triggers the cell operation that reports an error;
In the present embodiment, whether the 8th judging unit is correct specifically for judging compound consumption initialization directive, judge whether corresponding compound consumption key exists according to the compound consumption cipher key index in the data field of compound consumption initialization directive, judge whether the spending amount in the data field of compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
Second setting unit, for arranging the 3rd safe condition;
Return module 807 also for returning success response to host computer;
Report an error unit also for reporting an error.
(6) first processing modules 804, comprising:
9th judging unit, during for receiving compound consumption file update instruction when receiver module, judges whether compound consumption file update operating conditions meets the 8th requirement, is trigger the tenth judging unit work, otherwise triggers the cell operation that reports an error;
In the present embodiment, 9th judging unit, specifically for judging whether according to the short file identifier in the instruction of compound consumption file update the multiple exchange log file that there is preset stored value card, judge whether the corresponding record in the multiple exchange file of stored value card exists according to the record identifier in the instruction of compound consumption file update, judge that whether the record length in the instruction of compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
Report an error unit, for reporting an error;
Tenth judging unit, for judging whether according to the instruction of compound consumption file update the expanded application file that there is corresponding electronic cash, is trigger the 3rd and upgrade cell operation, otherwise the 4th updating block work of triggering;
3rd updating block, for the record content update electronic cash information in the data field with the instruction of compound consumption file update;
4th updating block, for the record content update electronic purse balance amount in the data field with the instruction of compound consumption file update;
Return module 807 also for returning success response to host computer.
In the present embodiment, access electronic cash data command comprises: read record instruction and Update Table instruction, then corresponding second processing module 806 includes different unit and goes to process, specific as follows:
(1) second processing module 806 comprises:
12 judging unit, during for receiving read record instruction when receiver module, judges whether read record operating conditions meets the 3rd requirement, is, triggers the 3rd and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
Concrete, in the present embodiment, the 12 judging unit, comprising:
First judgment sub-unit, for judging whether there is respective file in electronic cash application according to the data on the nybble of read record instruction, is trigger the second judgment sub-unit work, otherwise triggers the cell operation that reports an error;
Second judgment sub-unit, for judging according to the data in the 3rd byte of read record instruction whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, trigger the 3rd judgment sub-unit work, otherwise trigger and to report an error cell operation;
3rd judgment sub-unit, for judging whether current safe state satisfies condition, and is, triggers the 4th judgment sub-unit work, otherwise triggers and return module 807 and work;
Return module 807 for returning current data to host computer;
4th judgment sub-unit, for judging that whether current data is the non-read data of the last item of document alignment symbol, is, triggers the 3rd and upgrades setting unit work, otherwise triggers and return module 807 and work.
3rd upgrades setting unit, for upgrading electronic cash balances information according to the available electronic cash balances of current reality and dealing money, arranges electronic cash information change mark;
Return module also for returning success response to host computer;
Report an error unit for reporting an error.
In the present embodiment, the second processing module 806 also comprises:
13 judging unit, receiving the instruction of renewal expanded application record buffer memory for judging whether, and being, trigger the 3rd and upgrade clearing cell work, otherwise first removes modular unit;
First clearing cell, for removing the inner zone bit arranged of electronic cash application;
Return module 807 also for returning current data to host computer;
3rd upgrades clearing cell, for being saved in the multiple exchange log file of electronic cash by the data upgraded in the instruction of expanded application record buffer memory, removes the inner zone bit arranged of electronic cash application.
(2) second processing modules 806, comprising:
14 judging unit, during for receiving Update Table instruction when receiver module, judges whether Update Table operating conditions meets the 4th requirement, is, triggers the 4th and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
Concrete, in the present embodiment, 14 judging unit is specifically for judging that whether Update Table instruction is correct, judge that whether the label coding in Update Table instruction is legal, judge that whether the length of the label value in Update Table instruction is correct, judge that whether the MAC value in the data field of Update Table instruction is correct, the judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
4th upgrades setting unit, and for using the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, arrange electronic cash information change mark, triggering returns module 807 and works;
In the present embodiment, the 4th renewal setting unit comprises:
15 judgment sub-unit, for judging whether the label in Update Table instruction is preset data, is, triggers new setting unit work just before dawn, otherwise triggering receiver module 801 works;
The newly arranges subelement just before dawn, for using the amount of money in the data field of Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark.
Return module 807 also for returning success response to host computer;
Report an error unit, for reporting an error.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in technical scope disclosed by the invention; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of claim.
Claims (44)
1. an implementation method for information sharing between different application, is characterized in that, comprising:
Step S1: card is waited for and received the selective gist instruction that host computer issues, when receiving selective gist instruction, described card judges the application needing to select, as then performed step S2 for electronic wallet application, as applied then execution step S3 for electronic cash;
Step S2: the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information under described card electronic cash application, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and result is returned to described host computer;
Step S3: the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under described card electronic wallet application, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and result is returned to described host computer.
2. the method for claim 1, is characterized in that, the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information under described card electronic cash application, comprising:
Steps A 1: according to electronic cash information change mark, described card judges whether electronic cash information there occurs change, is, perform steps A 2, otherwise continues;
Steps A 2: described card obtains electronic cash balances in described electronic cash information and electronic cash and to have overdrawed the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money, removes described electronic cash information change mark, continues.
3. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives be circle deposit instruction time, described card judges that circle is deposited operating conditions and whether met first requirement, that the circle that described card is preserved is deposited the amount of money and upgraded electronic purse balance amount, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
4. method as claimed in claim 3, it is characterized in that, described card judges that circle is deposited operating conditions and whether met first requirement, comprising:
Whether described card judges that instruction deposited by described circle correct, described card judges whether current safe state is the first safe condition, described card judges that whether the MAC value that described circle is deposited in the data field of instruction is correct, described card judges whether transaction authentication code key exists, judged result as above-mentioned four is and is, then circle is deposited operating conditions and is met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
5. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is consumption order, described card judges whether consume operations condition meets the second requirement, that then described card upgrades electronic purse balance amount according to the spending amount preserved, upgrade electronic cash to have overdrawed the amount of money with the stored value card amount of money of having overdrawed, electronic purse balance amount change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
6. method as claimed in claim 5, is characterized in that, described card judges whether consume operations condition meets the second requirement, comprising:
Described card judges that whether described consumption order is correct, described card judges whether current safe state is the second safe condition or the 3rd safe condition, described card judges that whether the MAC value in the data field of described consumption order is correct, described card judges whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
7. method as claimed in claim 5, is characterized in that, described electronic purse balance amount change mark is set and returns between success response to described host computer comprise:
Step B1: described card judges whether current safe state is described 3rd safe condition, is perform step B2, otherwise the instruction that host computer described in wait-receiving mode issues;
Step B2: described card judges whether there is corresponding expanded application log file in electronic cash application, is perform step B3, otherwise performs step B4;
Step B3: the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash, continues by described card;
Step B4: the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card, continues by described card.
8. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives be circle deposit initialization directive time, described card judges that circle is deposited initialization operation condition and whether met the 5th requirement, that described card is preserved the described circle that described circle deposits in the data field of initialization directive and deposited the amount of money, first safe condition is set, and return success response to described host computer, the instruction that host computer described in wait-receiving mode issues, otherwise report an error, terminate.
9. method as claimed in claim 8, is characterized in that, described card judges that circle is deposited initialization operation condition and whether met the 5th requirement, comprising:
Whether described card judges that initialization directive deposited by described circle correct, described card is deposited cipher key index according to the circle that described circle is deposited in the data field of initialization directive and is judged that corresponding circle is deposited key and whether existed, described card judges that the described circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise satisfied 5th requirement of initialization operation condition deposited by circle.
10. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is for consumption initialization directive, described card judges whether consumption initialization operation condition meets the 6th requirement, that described card arranges the second safe condition, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
11. methods as claimed in claim 10, is characterized in that, described card judges whether consumption initialization operation condition meets the 6th requirement, comprising:
Described card judges that whether described consumption initialization directive is correct, according to the consumption cipher key index in the data field of described consumption initialization directive, described card judges whether corresponding consumption key exists, described card judges whether the spending amount in the data field of described consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
12. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is compound consumption initialization directive, described card judges whether compound consumption initialization operation condition meets the 7th requirement, that described card arranges described 3rd safe condition, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
13. methods as claimed in claim 12, is characterized in that, described card judges whether compound consumption initialization operation condition meets the 7th requirement, comprising:
Described card judges that whether described compound consumption initialization directive is correct, according to the compound consumption cipher key index in the data field of described compound consumption initialization directive, described card judges whether corresponding compound consumption key exists, described card judges whether the spending amount in the data field of described compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
14. the method for claim 1, is characterized in that, when described card judges that the condition of access electronic purse data meets the demands, described card processes Current electronic purse data according to the access electronic purse data instruction received, and comprising:
When the access electronic purse data instruction that described card receives is compound consumption file update instruction, perform step F 1;
Step F 1: described card judges whether described compound consumption file update operating conditions meets the 8th requirement, is perform step F 2, otherwise report an error, terminates;
Step F 2: described card judges whether according to the instruction of described compound consumption file update the expanded application file that there is corresponding electronic cash, is perform step F 3, otherwise performs step F 4;
Step F 3: the record content update electronic cash information of described card in the data field of described compound consumption file update instruction, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step F 4: the record content update electronic purse balance amount of described card in the data field of described compound consumption file update instruction, and return success response, the instruction that host computer described in wait-receiving mode issues to described host computer.
15. methods as claimed in claim 14, is characterized in that, described card judges whether described compound consumption file update operating conditions meets the 8th requirement, comprising:
Described card judges whether according to the short file identifier in the instruction of described compound consumption file update the multiple exchange log file that there is preset stored value card, according to the record identifier in the instruction of compound consumption file update, described card judges whether the corresponding record in the multiple exchange file of described stored value card exists, described card judges that whether the record length in the instruction of described compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
16. the method for claim 1, is characterized in that, the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under described card electronic wallet application, comprising:
Step P1: according to electronic purse balance amount change mark, described card judges whether electronic purse balance amount there occurs change, is, performs step P2, otherwise continue;
Step P2: the described electronic purse balance amount of described card upgrades electronic cash balances, removes described electronic purse balance amount change mark.
17. the method for claim 1, it is characterized in that, electronic cash balances in Current electronic cash information, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and comprising:
When the access electronic purse data instruction that described card receives is read record instruction, described card judges whether read record operating conditions meets the 3rd requirement, that then described card upgrades electronic cash balances information according to the available electronic cash balances of current reality and dealing money, electronic cash information change mark is set, success response is returned to described host computer, the instruction that host computer described in wait-receiving mode issues, otherwise report an error, terminate.
18. methods as claimed in claim 17, is characterized in that, described card judges whether read record operating conditions meets the 3rd requirement, comprising:
Step X1: described card judges whether there is respective file in electronic cash application according to the data on the nybble of described read record instruction, is perform step X2, otherwise reports an error, terminate;
Step X2: according to the data in the 3rd byte of described read record instruction, described card judges whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, perform step X3, otherwise to report an error, terminate;
Step X3: described card judges whether current safe state satisfies condition, and is, performs step X4, otherwise return current data, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step X4: described card judges whether current data is the non-read data of the last item that document alignment accords with, is that then read record operating conditions meets the 3rd requirement, otherwise performs step X5;
Step X5: described card returns current data, the instruction that host computer described in wait-receiving mode issues to described host computer.
19. methods as claimed in claim 17, is characterized in that, describedly arrange electronic cash information change mark and return between success response also comprise to described host computer:
Step W1: described card judges whether to receive the instruction of renewal expanded application record buffer memory, is perform step W3, otherwise perform step W2;
Step W2: the inner zone bit arranged of electronic cash application removed by described card, returns current data, the instruction that host computer described in wait-receiving mode issues to described host computer;
Step W3: the data in the instruction of described renewal expanded application record buffer memory are saved in the multiple exchange log file of electronic cash by described card, remove the inner zone bit arranged of electronic cash application, current data is returned, the instruction that host computer described in wait-receiving mode issues to described host computer.
20. the method for claim 1, it is characterized in that, electronic cash balances in Current electronic cash information, when described card judges that the condition of access electronic cash data meets the demands, described card processes Current electronic cash information according to the access electronic cash data command received, and comprising:
When the access electronic purse data instruction that described card receives is Update Table instruction, described card judges whether Update Table operating conditions meets the 4th requirement, that described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, electronic cash information change mark is set, success response is returned, the instruction that host computer described in wait-receiving mode issues to described host computer; Otherwise report an error, terminate.
21. methods as claimed in claim 20, is characterized in that, described card judges whether Update Table operating conditions meets the 4th requirement, comprising:
Described card judges that whether described Update Table instruction is correct, described card judges that whether the label coding in described Update Table instruction is legal, described card judges that whether the length of the label value in described Update Table instruction is correct, described card judges that whether the MAC value in the data field of described Update Table instruction is correct, judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
22. methods as claimed in claim 20, it is characterized in that, described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, electronic cash information change mark is set, success response is returned to described host computer, the instruction that host computer described in wait-receiving mode issues, comprising:
Step D1: described card judges whether the label in described Update Table instruction is preset data, is perform step D2, otherwise the instruction that host computer described in wait-receiving mode issues;
Step D2: described card uses the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark, returns success response, the instruction that host computer described in wait-receiving mode issues to described host computer.
The implement device of information sharing between 23. 1 kinds of different application, is characterized in that, comprising:
Receiver module, for waiting for and receiving the instruction that host computer issues;
First judge module, for judging the application needing to select when described receiver module receives selective gist instruction, as then triggered the first synchronization module work for electronic wallet application, as then triggered the second synchronization module work for electronic cash application;
Described first synchronization module, for electronic cash application under the synchronous described electronic wallet application Current electronic purse data of Current electronic cash information;
First processing module, during for meeting the demands when the condition of accessing electronic purse data, the access electronic purse data instruction according to receiving processes Current electronic purse data;
Described second synchronization module, for the electronic cash balances in the Current electronic cash information under the synchronous described electronic cash application of the electronic purse balance amount in the Current electronic purse data under electronic wallet application;
Second processing module, during for meeting the demands when the condition of accessing electronic cash data, the access electronic cash data command according to receiving processes Current electronic cash information;
Return module, for the result of described first processing module or the second processing module is returned to described host computer.
24. devices as claimed in claim 23, it is characterized in that, described first synchronization module comprises:
First judging unit, for judging whether electronic cash information there occurs change, is according to electronic cash information change mark, triggering the first renewal clearing cell work, otherwise triggering described first processing module work;
Described first upgrades clearing cell, to overdraw the amount of money upgrade electronic purse balance amount and stored value card and to have overdrawed the amount of money for obtaining electronic cash balances in described electronic cash information and electronic cash, remove described electronic cash information change mark, trigger described first processing module work.
25. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
Second judging unit, for receive when described receiver module circle deposit instruction time, judge that circle is deposited operating conditions and whether met first requirement, be, trigger the first renewal setting unit work, otherwise trigger and to report an error cell operation;
Described first upgrades setting unit, upgrades electronic purse balance amount for depositing the amount of money with the circle preserved, and upgrades electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
26. devices as claimed in claim 25, it is characterized in that, whether described second judging unit is correct specifically for judging that instruction deposited by described circle, judge whether current safe state is the first safe condition, judge that whether the MAC value that described circle is deposited in the data field of instruction is correct, judge whether transaction authentication code key exists, and the judged result as above-mentioned four is and is, then circle is deposited operating conditions and is met first requirement, otherwise circle is deposited operating conditions and do not met first requirement.
27. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
3rd judging unit, for when described receiver module receives consumption order, judges whether consume operations condition meets the second requirement, is trigger the second renewal setting unit work, otherwise triggers the cell operation that reports an error;
Described second upgrades setting unit, for upgrading electronic purse balance amount according to the spending amount preserved, upgrading electronic cash and to have overdrawed the amount of money, arrange electronic purse balance amount change mark with the stored value card amount of money of having overdrawed;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
28. devices as claimed in claim 27, it is characterized in that, described 3rd judging unit is specifically for judging that whether described consumption order is correct, judge whether current safe state is the second safe condition or the 3rd safe condition, judge that whether the MAC value in the data field of described consumption order is correct, judge whether transaction authentication code key exists, as above-mentioned four are all judged as YES, then consume operations condition meets the second requirement, otherwise consume operations condition does not meet the second requirement.
29. devices as claimed in claim 27, it is characterized in that, described first processing module also comprises:
4th judging unit, for judging whether current safe state is described 3rd safe condition, is trigger the 5th judging unit work, otherwise triggers described receiver module work;
Described 5th judging unit, for judging whether there is corresponding expanded application log file in electronic cash application, is trigger the first updating block work, otherwise the second updating block work of triggering;
Described first updating block, for by the Data Update in Application of composite record buffer memory in the expanded application log file of electronic cash;
Described second updating block, for by the Data Update in Application of composite record buffer memory in the multiple exchange log file of stored value card.
30. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
6th judging unit, for receive when described receiver module circle deposit initialization directive time, judge that circle is deposited initialization operation condition and whether met the 5th requirement, be trigger the first preservation setting unit work, otherwise trigger the cell operation that reports an error;
Described first preserves setting unit, and the amount of money deposited by the described circle deposited in the data field of initialization directive for preserving described circle, arranges the first safe condition;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
31. devices as claimed in claim 30, it is characterized in that, whether described 6th judging unit is correct specifically for judging that initialization directive deposited by described circle, the circle deposited in the data field of initialization directive according to described circle is deposited cipher key index and is judged that corresponding circle is deposited key and whether existed, judge that the described circle circle deposited in the data field of initialization directive is deposited the amount of money and added whether the result of Current electronic wallet balances exceedes electronic cash balances higher limit, judged result as above-mentioned three is and is, then satisfied 5th requirement of initialization operation condition deposited by circle, otherwise circle is deposited initialization operation condition and is not met the 5th requirement.
32. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
7th judging unit, during for receiving consumption initialization directive when described receiver module, judges whether consumption initialization operation condition meets the 6th requirement, is trigger the first setting unit work, otherwise triggers the cell operation that reports an error;
Described first setting unit, for arranging the second safe condition;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
33. devices as claimed in claim 32, it is characterized in that, whether described 7th judging unit is correct specifically for judging described consumption initialization directive, judge whether corresponding consumption key exists according to the consumption cipher key index in the data field of described consumption initialization directive, judge whether the spending amount in the data field of described consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then consume initialization operation condition and meet the 6th requirement, otherwise consumption initialization operation condition does not meet the 6th requirement.
34. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
8th judging unit, during for receiving compound consumption initialization directive when described receiver module, judges whether compound consumption initialization operation condition meets the 7th requirement, is trigger the second setting unit work, otherwise triggers the cell operation that reports an error;
Described second setting unit, for arranging described 3rd safe condition;
Described return module also for give described host computer return success response;
Describedly report an error unit also for reporting an error.
35. devices as claimed in claim 34, it is characterized in that, whether described 8th judging unit is correct specifically for judging described compound consumption initialization directive, judge whether corresponding compound consumption key exists according to the compound consumption cipher key index in the data field of described compound consumption initialization directive, judge whether the spending amount in the data field of described compound consumption initialization directive exceedes electronic purse balance amount, judged result as above-mentioned three is and is, then compound consumption initialization operation condition meets the 7th requirement, otherwise compound consumption initialization operation condition does not meet the 7th requirement.
36. devices as claimed in claim 23, it is characterized in that, described first processing module, comprising:
9th judging unit, during for receiving compound consumption file update instruction when described receiver module, judges whether described compound consumption file update operating conditions meets the 8th requirement, is trigger the tenth judging unit work, otherwise triggers the cell operation that reports an error;
The described unit that reports an error, for reporting an error;
Described tenth judging unit, for judging whether according to the instruction of described compound consumption file update the expanded application file that there is corresponding electronic cash, is trigger the 3rd and upgrade cell operation, otherwise the 4th updating block work of triggering;
Described 3rd updating block, for the record content update electronic cash information in the data field with the instruction of described compound consumption file update;
Described 4th updating block, for the record content update electronic purse balance amount in the data field with the instruction of described compound consumption file update;
Described return module also for give described host computer return success response.
37. devices as claimed in claim 36, it is characterized in that, described 9th judging unit, specifically for judging whether according to the short file identifier in the instruction of described compound consumption file update the multiple exchange log file that there is preset stored value card, judge whether the corresponding record in the multiple exchange file of described stored value card exists according to the record identifier in the instruction of compound consumption file update, judge that whether the record length in the instruction of described compound consumption file update is correct, judged result as above-mentioned three is and is, then compound consumption file update operating conditions meets the 8th requirement, otherwise compound consumption file update operating conditions does not meet the 8th requirement.
38. devices as claimed in claim 23, it is characterized in that, described second synchronization module comprises:
11 judging unit, for judging whether electronic purse balance amount there occurs change, is according to electronic purse balance amount change mark, triggering the second renewal clearing cell work, otherwise triggering described second processing module work;
Described second upgrades clearing cell, for upgrading electronic cash balances with described electronic purse balance amount, removing described electronic purse balance amount change mark, triggering described second processing module work.
39. devices as claimed in claim 23, it is characterized in that, described second processing module comprises:
12 judging unit, for when described receiver module receives read record instruction, judges whether read record operating conditions meets the 3rd requirement, is, triggers the 3rd and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
Described 3rd upgrades setting unit, for upgrading electronic cash balances information according to the available electronic cash balances of current reality and dealing money, arranges electronic cash information change mark;
Described return module also for give described host computer return success response;
The described unit that reports an error is for reporting an error.
40. devices as claimed in claim 39, it is characterized in that, described 12 judging unit, comprising:
First judgment sub-unit, for judging whether there is respective file in electronic cash application according to the data on the nybble of described read record instruction, is trigger the second judgment sub-unit work, otherwise triggers the cell operation that reports an error;
Described second judgment sub-unit, for judging according to the data in the 3rd byte of described read record instruction whether the corresponding data in the respective file in electronic cash application exists, be then using corresponding data as current data, trigger the 3rd judgment sub-unit work, otherwise trigger the cell operation that reports an error;
Described 3rd judgment sub-unit, for judging whether current safe state satisfies condition, and is, triggers the 4th judgment sub-unit work, otherwise triggering returns module work;
The described module that returns is for returning current data to described host computer;
Described 4th judgment sub-unit, for judging whether current data is the non-read data of the last item that document alignment accords with, and is, triggering the described 3rd and upgrading setting unit work, otherwise returning module work described in triggering.
41. devices as claimed in claim 39, it is characterized in that, described second processing module also comprises:
13 judging unit, receiving the instruction of renewal expanded application record buffer memory for judging whether, and being, trigger the 3rd and upgrade clearing cell work, otherwise first removes modular unit;
Described first clearing cell, for removing the inner zone bit arranged of electronic cash application;
Described return module also for give described host computer return current data;
Described 3rd upgrades clearing cell, for being saved in the multiple exchange log file of electronic cash by the data in the instruction of described renewal expanded application record buffer memory, removes the inner zone bit arranged of electronic cash application.
42. devices as claimed in claim 23, it is characterized in that, the second processing module, comprising:
14 judging unit, for when described receiver module receives Update Table instruction, judges whether Update Table operating conditions meets the 4th requirement, is, triggers the 4th and upgrade setting unit work, otherwise trigger the cell operation that reports an error;
4th upgrades setting unit, for using the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, arranging electronic cash information change mark, triggering and return module work;
Described return module also for give described host computer return success response;
The described unit that reports an error, for reporting an error.
43. devices as claimed in claim 42, it is characterized in that, whether described 14 judging unit is correct specifically for judging described Update Table instruction, judge that whether the label coding in described Update Table instruction is legal, judge that whether the length of the label value in described Update Table instruction is correct, judge that whether the MAC value in the data field of described Update Table instruction is correct, judged result as above-mentioned four is and is, then Update Table operating conditions meets the 4th requirement, otherwise Update Table operating conditions does not meet the 4th requirement.
44. devices as claimed in claim 42, is characterized in that, the described 4th upgrades setting unit comprises:
15 judgment sub-unit, for judging whether the label in described Update Table instruction is preset data, is, triggering new setting unit work just before dawn, otherwise triggering described receiver module work;
Described the newly arranges subelement just before dawn, for using the amount of money in the data field of described Update Table instruction to upgrade electronic cash balances, and arranges electronic cash information change mark.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510733498.7A CN105427098B (en) | 2015-11-02 | 2015-11-02 | Method and device for realizing information sharing among different applications |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510733498.7A CN105427098B (en) | 2015-11-02 | 2015-11-02 | Method and device for realizing information sharing among different applications |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105427098A true CN105427098A (en) | 2016-03-23 |
CN105427098B CN105427098B (en) | 2020-02-11 |
Family
ID=55505288
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510733498.7A Active CN105427098B (en) | 2015-11-02 | 2015-11-02 | Method and device for realizing information sharing among different applications |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105427098B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779635A (en) * | 2016-11-22 | 2017-05-31 | 飞天诚信科技股份有限公司 | Many account balance sharing methods in a kind of smart card and its card |
CN106779694A (en) * | 2016-12-19 | 2017-05-31 | 飞天诚信科技股份有限公司 | A kind of method and visual intelligent card for inquiring about visible intelligent card inside information |
CN107315944A (en) * | 2017-06-20 | 2017-11-03 | 飞天诚信科技股份有限公司 | A kind of intelligent cipher key equipment and its method of work |
CN110166452A (en) * | 2019-05-21 | 2019-08-23 | 东信和平科技股份有限公司 | A kind of access control method and system based on JavaCard shared interface |
CN113191765A (en) * | 2021-04-22 | 2021-07-30 | 武汉天喻信息产业股份有限公司 | Method, device and equipment for sharing balance of multiple wallets and readable storage medium |
US11354662B2 (en) * | 2020-02-10 | 2022-06-07 | Izzi, Inc. | System and method for implementing a payment architecture that provides instant, risk-free payment in digital cash |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN104572721A (en) * | 2013-10-21 | 2015-04-29 | 上海华虹集成电路有限责任公司 | Shared module of E-wallet |
US20150339660A1 (en) * | 2012-06-06 | 2015-11-26 | China Unionpay Co., Ltd. | Method and system for off-line credit for load |
-
2015
- 2015-11-02 CN CN201510733498.7A patent/CN105427098B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101799954A (en) * | 2009-11-20 | 2010-08-11 | 北京飞天诚信科技有限公司 | Method for loading double electronic purses |
US20150339660A1 (en) * | 2012-06-06 | 2015-11-26 | China Unionpay Co., Ltd. | Method and system for off-line credit for load |
CN103236003A (en) * | 2013-04-09 | 2013-08-07 | 深圳市雄帝科技股份有限公司 | E-wallet payment method and device |
CN104572721A (en) * | 2013-10-21 | 2015-04-29 | 上海华虹集成电路有限责任公司 | Shared module of E-wallet |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106779635A (en) * | 2016-11-22 | 2017-05-31 | 飞天诚信科技股份有限公司 | Many account balance sharing methods in a kind of smart card and its card |
CN106779635B (en) * | 2016-11-22 | 2020-10-13 | 飞天诚信科技股份有限公司 | Smart card and method for sharing balance of multiple accounts in smart card |
CN106779694A (en) * | 2016-12-19 | 2017-05-31 | 飞天诚信科技股份有限公司 | A kind of method and visual intelligent card for inquiring about visible intelligent card inside information |
CN106779694B (en) * | 2016-12-19 | 2023-02-28 | 飞天诚信科技股份有限公司 | Method for inquiring information in visual smart card and visual smart card |
CN107315944A (en) * | 2017-06-20 | 2017-11-03 | 飞天诚信科技股份有限公司 | A kind of intelligent cipher key equipment and its method of work |
CN107315944B (en) * | 2017-06-20 | 2019-10-08 | 飞天诚信科技股份有限公司 | A kind of intelligent cipher key equipment and its working method |
CN110166452A (en) * | 2019-05-21 | 2019-08-23 | 东信和平科技股份有限公司 | A kind of access control method and system based on JavaCard shared interface |
US11354662B2 (en) * | 2020-02-10 | 2022-06-07 | Izzi, Inc. | System and method for implementing a payment architecture that provides instant, risk-free payment in digital cash |
CN113191765A (en) * | 2021-04-22 | 2021-07-30 | 武汉天喻信息产业股份有限公司 | Method, device and equipment for sharing balance of multiple wallets and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN105427098B (en) | 2020-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105427098A (en) | Method and device for realizing information sharing among different applications | |
US6488211B1 (en) | System and method for flexibly loading in IC card | |
US8180741B2 (en) | Methods and systems for providing data objects on a token | |
US8811971B2 (en) | Mobile communication device and method for disabling applications | |
US20070143616A1 (en) | Flexibly loading a tamper resistant module | |
WO1998030958A1 (en) | Secure multiple application ic card system | |
CN106031050A (en) | Information processing method and NFC terminal | |
CN101635071A (en) | Method, system and device for installing/updating e-wallet | |
EP3366050B1 (en) | Method for updating a package | |
US9449453B2 (en) | Portable electronic entity and method for personalization of such an electronic entity | |
EP2174481B1 (en) | Method, server and mobile communication device for managing unique memory device identifications | |
CN113518341A (en) | eSIM code number management method and device | |
CN105515811A (en) | USB wireless network card configuration method, host, USB wireless network card and communication system | |
EP3286682B1 (en) | Method of managing applications in a secure element when updating the operating system | |
SI9720049A (en) | Portable, secure transaction system for programable, inteligent devices | |
CN102541639B (en) | CPU (Central Processing Unit) card data processing method, CPU card data processing system and CPU card | |
CN103677933A (en) | Patching method and system for smart card | |
EP3507690B1 (en) | Java card application memory footprint optimization | |
CN112698912A (en) | Java Card virtual machine operating environment and memory management method | |
CN101425120B (en) | Card reader and executing method thereof | |
CN108153564B (en) | Interface management method, device and system and computer readable storage medium | |
EP1639455A2 (en) | Embedded device with software registry | |
KR20160134419A (en) | Method for changing the subscriber identification information of terminal using smart card including multiple subscriber identification information, terminal and computer program thereof | |
EP3926504B1 (en) | Hiding and unhiding java card applet instances | |
CN114710284B (en) | Method, apparatus and storage medium for updating version of communication security element |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |