SIM card payment authentication method and system based on smart contract
Through smart contract technology, whether the transaction party meets the conditions in SIM card non-receiving payments is solved, and the problem of low security when non-receiving payments is solved, achieving higher security and authentication accuracy.
Patent Information
- Application Number
- CN202211534678.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-02
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-12-02
AI Technical Summary
SIM cards based on SWP-SIM technology are difficult to adjust the security authentication or APP input capability of the mobile terminal when they are not paid, resulting in low security.
Using smart contract technology, through communication between mobile terminals and electronic payment machines, the smart contract parameters are determined using application identification parameters, the transaction data and contract parameters are compared, and whether the transaction meets the conditions. If it meets the conditions, the transaction is allowed to be executed, otherwise it will be rejected.
It improves the security of SIM cards in non-received payments, judges whether the transaction party meets the conditions through smart contract technology, and enhances the accuracy and security of authentication.
Smart Images

Figure CN115809878B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of SIM card payment, and in particular to a SIM card payment authentication method and system based on a smart contract. Background Art
[0002] With the popularity of mobile terminals that support NFC functions, the NFC contactless payment function based on SWP-SIM technology is becoming more and more popular among users. The user experience is similar to that of the mobile PAY product solution. Transactions can be completed by simply touching the POS machine. Supported contactless applications include digital RMB applications, bank card applications, transportation card applications, etc. However, compared with the mobile PAY product solution, in addition to the advantage of convenient payment, the SIM card solution based on SWP-SIM technology also has some technical disadvantages. In contactless payment, it is a contactless communication between the SIM card and the POS machine. For example, when it involves security authentication or confirmation operations that require user participation, it is difficult for the SIM card to call up the security authentication or APP input capabilities of the mobile terminal, such as: facial biometric confirmation, pulling up the APP to enter a password, etc. Therefore, contactless payment with SIM cards faces very serious security issues. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a SIM card payment authentication method and system based on a smart contract to improve the security of the SIM card in contactless payment.
[0004] The first aspect of the present invention provides a SIM card payment authentication method based on a smart contract, which is applied to a mobile terminal, comprising: responding to a selection instruction from an electronic payment machine, determining an application identification parameter according to the selection instruction, and determining a smart contract parameter through the application identification parameter, wherein the application identification parameter is used to identify the smart contract parameters of contactless applications in different industries; obtaining the real-time time and real-time location of the mobile terminal as first transaction data; comparing the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter; obtaining a first status word according to the first return result, and sending the first status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If the first status word is the same, Then send a first transaction instruction to the mobile terminal, wherein the first transaction instruction includes a terminal number and a transaction amount; receive the first transaction instruction from the electronic payment machine and parse it to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; determine the smart contract parameters according to the application identification parameters, and compare the second transaction data with the second transaction parameters in the smart contract parameters to obtain a second return result, wherein the second transaction parameters include a terminal number parameter and a transaction amount parameter; obtain a second status word based on the second return result, and send the second status word to the electronic payment machine, so that the electronic payment machine receives the second status word from the mobile terminal, which is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
[0005] According to some embodiments of the present invention, the mobile terminal further includes an industry contactless application module, a smart contract application module and a mobile terminal system module: the industry contactless application module responds to a selection instruction from the electronic payment machine, determines an application identification parameter according to the selection instruction, and sends the application identification parameter to the smart contract application module through a shared interface, wherein the application identification parameter is used to identify smart contract parameters of contactless applications in different industries; the smart contract application module receives the application identification parameter from the industry contactless application module, and determines the smart contract parameter according to the application identification parameter; the mobile terminal system module obtains the real-time time and real-time location of the mobile terminal as the first transaction data, and sends the first The first transaction data is sent to the smart contract application module; the smart contract application module receives the first transaction data sent from the mobile terminal system module, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and returns the first return result to the industry contactless application module, wherein the first transaction parameter includes a time parameter and a location parameter; the industry contactless application module receives the first return result from the smart contract application module, obtains a first status word based on the first return result, and sends the first status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the mobile terminal, and is used to determine whether the first status word is consistent with the target status word. The state characters are the same. If they are the same, a first transaction instruction is sent to the industry contactless application, wherein the first transaction instruction includes a terminal number and a transaction amount; the industry contactless application module receives the first transaction instruction from the electronic payment machine and parses it to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; the industry contactless application module sends an application identification parameter and the second transaction data to the smart contract application module through the shared interface; the smart contract application module receives the application identification parameter from the industry contactless application module, and determines the smart contract parameter according to the application identification parameter; the smart contract application module receives the application identification parameter from the industry contactless application module The second transaction data of the module is received, and the second transaction parameter in the smart contract parameter is compared with the second transaction data to obtain a second return result, and the second return result is returned to the industry contactless application module, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter; the industry contactless application module receives the second return result from the smart contract application module, obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
[0006] According to some embodiments of the present invention, the step of obtaining the first transaction data includes: the mobile terminal system module obtains the real-time time and real-time location of the mobile terminal as the first transaction data, and triggers a status event to be sent to the smart contract application module; after the industry contactless application module captures the status event from the mobile terminal system module, it sends an active command to the mobile terminal system module, wherein the active command is used to request the return of the first transaction data; the mobile terminal system module responds to the active command from the smart contract application module, and sends the first transaction data to the smart contract application module; the smart contract application module receives the first transaction data sent from the mobile terminal system module and stores it.
[0007] According to some embodiments of the present invention, the comparing the first transaction data with the first transaction parameter in the smart contract parameter to obtain the first return result includes: comparing the real-time time with the time parameter in the first transaction parameter, when the real-time time is within the time parameter, the first return result is correct; comparing the real-time position with the position parameter in the first transaction parameter, when the real-time position exists in the position parameter, the first return result is correct.
[0008] According to some embodiments of the present invention, the comparing the second transaction data with the second transaction parameter in the smart contract parameters to obtain a second return result includes: comparing the terminal number with a terminal number parameter in the second transaction parameters, when the terminal number is within the terminal number parameter, the second return result is correct; comparing the transaction amount with a transaction amount parameter in the second transaction parameters, when the transaction amount is less than the transaction amount parameter, the second return result is correct.
[0009] Another aspect of the present invention provides a SIM card payment authentication method based on a smart contract, which is applied to an electronic payment machine, including: sending a selection instruction to a mobile terminal so that the mobile terminal responds to the selection instruction from the electronic payment machine, determining an application identification parameter according to the selection instruction, determining a smart contract parameter through the application identification parameter, for comparing first transaction data with a first transaction parameter in the smart contract parameter to obtain a first return result, and obtaining a first status word according to the first return result, and sending the first status word to the electronic payment machine, wherein the first transaction data is the real-time time and real-time location of the mobile terminal; receiving the first status word from the mobile terminal, judging whether the first status word is the same as the target status word, and if so, the first transaction instruction includes a terminal number and a transaction amount, so that the mobile terminal receives the first transaction instruction from the electronic payment machine and parses it to obtain second transaction data, determines the smart contract parameters according to the application identification parameters, and compares the second transaction data with the second transaction parameters in the smart contract parameters to obtain a second return result, so that the mobile terminal obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine; receives the second status word from the mobile terminal, determines whether the second status word is the same as the target status word, and if so, allows the transaction to be executed, otherwise, refuses to execute the transaction.
[0010] Another aspect of the present invention provides a SIM card payment authentication system based on a smart contract, comprising: a mobile terminal, used to respond to a selection instruction from an electronic payment machine, determine an application identification parameter according to the selection instruction, and determine a smart contract parameter through the application identification parameter, wherein the application identification parameter is used to identify the smart contract parameter of contactless applications in different industries; obtain the real-time time and real-time location of the mobile terminal as first transaction data; compare the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter; obtain a first status word according to the first return result, and send the first status word to the electronic payment machine so that the electronic payment machine The cash machine receives a first status word from the mobile terminal to determine whether the first status word is the same as the target status word. If the first status word is the same as the target status word, a first transaction instruction is sent to the mobile terminal, wherein the first transaction instruction includes a terminal number and a transaction amount; the first transaction instruction from the electronic payment machine is received and parsed to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; the smart contract parameter is determined according to the application identification parameter, and the second transaction data is compared with the second transaction parameter in the smart contract parameter to obtain a second return result, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter; a second status word is obtained based on the second return result, and the second transaction word is sent. The second status word is sent to the electronic payment machine, so that the electronic payment machine receives the second status word from the mobile terminal, and is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed, and if they are not the same, the transaction is refused to be executed; the electronic payment machine is used to send a selection instruction to the mobile terminal, so that the mobile terminal responds to the selection instruction from the electronic payment machine, determines the application identification parameter according to the selection instruction, determines the smart contract parameter through the application identification parameter, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and obtains a first status word according to the first return result, and sends the first status word to the electronic payment machine, wherein the first status word A transaction data is the real-time time and real-time location of the mobile terminal; receiving a first status word from the mobile terminal, determining whether the first status word is the same as the target status word, and if the first status word is the same, sending a first transaction instruction to the mobile terminal, wherein the first transaction instruction includes a terminal number and a transaction amount, so that the mobile terminal receives and parses the first transaction instruction from the electronic payment machine to obtain second transaction data, determines the smart contract parameter according to the application identification parameter, and compares the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, so that the mobile terminal obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine;Receive a second status word from the mobile terminal, determine whether the second status word is the same as the target status word, if the two are the same, allow the transaction to be executed, and if they are not the same, refuse to execute the transaction. ;
[0011] Another aspect of the present invention provides an electronic device, including a processor and a memory; the memory is used to store a program; the processor executes the program to implement the SIM card payment authentication method based on the smart contract as described above.
[0012] The electronic device according to the embodiment of the present invention has at least the same beneficial effects as the above-mentioned SIM card payment authentication method based on smart contract.
[0013] Another aspect of the present invention provides a computer-readable storage medium storing a program, wherein the program is executed by a processor to implement the SIM card payment authentication method based on a smart contract as described above.
[0014] The computer-readable storage medium according to the embodiment of the present invention has at least the same beneficial effects as the above-mentioned SIM card payment authentication method based on smart contract.
[0015] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.
[0016] In the embodiment of the present invention, after the electronic payment machine sends a selection command to the mobile terminal, the mobile terminal determines the smart contract parameters based on the application identification parameters, compares the smart contract parameters with the first transaction data, uses the conditions set in the smart contract parameters, that is, the given parameters, to determine whether the first transaction data meets the conditions, and sends the corresponding status word to the electronic payment machine according to the determination result of whether the conditions are met, obtains another part of the transaction data, that is, the second transaction data, through the electronic payment machine and sends it to the mobile terminal, continues to use the application identification parameters to determine the smart contract parameters, compares the smart contract parameters with the second transaction data to obtain the result, and returns the status word based on the result to the electronic payment machine, and the electronic payment machine compares the received status word with the target status word to determine whether to execute the transaction. The electronic payment machine sends the transaction data to the mobile terminal, and the mobile terminal also obtains its own transaction data, compares them with the smart contract parameters respectively, authenticates the status of the electronic payment machine and the mobile terminal, and determines whether the conditions are met, thereby improving the security of the SIM card when making payments. In addition, by using the application identification parameters to determine the smart contract parameters each time, different smart contract parameters are used for different applications to make conditional judgments on transaction data, further improving the accuracy of authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A first flow chart of a SIM card payment authentication method based on a smart contract provided in an embodiment of the present invention;
[0019] Figure 2 A second flow chart of a SIM card payment authentication method based on a smart contract provided in an embodiment of the present invention;
[0020] Figure 3 A third flow chart of a SIM card payment authentication method based on a smart contract provided by an embodiment of the present invention;
[0021] Figure 4 A SIM card payment authentication system based on a smart contract is provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0023] The traditional method of using SIM cards, such as bank cards, for payment is contact payment, that is, the card needs to be inserted into the POS machine to complete the payment. With the popularization of mobile terminals that support NFC functions, not only contactless payment without insertion is completed, but payment is also combined with mobile terminals, and the transaction can be completed by simply touching the mobile terminal with the POS machine. However, when making contactless payments, contactless payments usually sacrifice signature or PIN verification to improve payment efficiency, which also means that the security of contactless payments with SIM cards is very worrying. The present application provides a SIM card payment authentication method and system based on smart contracts. By introducing smart contract technology, it is determined whether the parties to the transaction meet the conditions or rules, thereby improving the security of SIM cards in contactless payments, which can be widely used in SIM card-related payment fields.
[0024] refer to Figure 1 , Figure 1 The first flow chart of the SIM card payment authentication method based on smart contract provided in the embodiment of the present invention is applied to the mobile terminal 200, including steps S110 to S170:
[0025] Step S110, responding to the selection instruction from the electronic payment machine 300, determining the application identification parameter according to the selection instruction, and determining the smart contract parameter through the application identification parameter, wherein the application identification parameter is used to identify the smart contract parameters of contactless applications in different industries.
[0026] Specifically, in response to the selection instruction from the electronic payment machine 300, the smart contract parameters are determined by the application identification parameters. It should be noted that the application identification parameters are used to identify the smart contract parameters of contactless applications in different industries. The smart contract writing process requires the use of the mobile terminal 200, the smart contract platform, the industry application platform, and the SIM card in the mobile terminal 200. Specifically, (1) the mobile terminal 200, including but not limited to the current Android and IOS operating systems, supports the client APP to access the SIM card through the machine-card channel technology; the Android system includes but is not limited to the channel technology for accessing the SIM card such as OpenMobile API, OMAPI, Telephony Manager class library; the IOS system includes but is not limited to Bluetooth or other channel technologies for accessing the SIM card; (2) the smart contract platform provides the access capability of the mobile client and the management capability of the SIM card multi-application smart contract. A secure communication channel (such as HTTPS protocol) is established through a wireless network to request and obtain smart contract parameters from the industry application platform. The organization generates the smart contract security data and sends it to the SIM card through the client APP; (3) SIM card, COS (Card Operation System) can dispatch corresponding events to the smart contract application through the STK event trigger mechanism, and the smart contract application obtains the current time or location information of the mobile terminal 200 through active commands. The SIM card can load or pre-install smart contract applications in the air to save and manage the corresponding contactless application smart contract parameters, and provide corresponding shared interface API for contactless application calls. (4) Industry application platform, a business platform that supports industry contactless applications, realizes the function of generating smart contract parameters for contactless applications.
[0027] The specific process of writing a smart contract is as follows: First, a client APP and a smart contract application module are set in the mobile terminal 200. The client APP applies for a smart contract to the smart contract platform through the network. The application message contains a contactless application AID, that is, an application identification parameter, which is generally 5-16 bytes. After receiving the contactless application AID, the smart contract platform searches for the corresponding industry application platform, establishes secure communication with the industry application platform or calls the corresponding system interface, negotiates to obtain the smart contract parameters of the contactless application, and the industry application platform generates the corresponding smart contract parameters according to the security management requirements and returns them to the smart contract platform. The smart contract platform sends the smart contract parameters to the client APP of the mobile terminal 200 through the network. The client APP opens the channel to access the SIM card of the mobile terminal 200 through the machine-card channel technology, and organizes the corresponding APDU command to write the smart contract, wherein the APDU command field includes application identification parameters, basic condition parameters and business condition parameters, etc. The machine-card channel technology includes but is not limited to the channel technology for accessing the SIM card provided by the OpenMobile API, OMAPI, Telephony Manager class library or other mobile terminal operating systems. The smart contract application module in the SIM card receives and executes the command to write the smart contract and safely saves the smart contract parameters. Therefore, it can be seen that the application identification parameters correspond to the smart contract parameters. The machine-card channel technology and STK technology are used to write the smart contract parameters into the SIM card to achieve conditional payment control in NFC contactless scenarios.
[0028] Step S120, acquiring the real-time time and real-time location of the mobile terminal 200 as first transaction data.
[0029] Step S130, comparing the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter.
[0030] Specifically, the real-time time and real-time location in the mobile terminal 200 are obtained as the first transaction data, and the first transaction data is compared with the first transaction parameter in the smart contract parameter to obtain the first return result. It should be noted that the smart contract parameter includes an application identification parameter, a basic condition parameter, a business condition parameter, etc., wherein the basic condition parameter includes a time parameter and a location parameter. The time parameter represents the deadline allowed by the smart contract platform, and the format is YYYYMMDDHHNNSS (such as 20221129155203); the location parameter represents the location information string allowed by the smart contract platform, and the format is TAC, ECI concatenated byte string under the 4G network, etc. Further, the specific steps of comparison include: comparing the real-time time with the time parameter in the first transaction parameter, when the real-time time is in the time parameter, the first return result is correct; comparing the real-time location with the location parameter in the first transaction parameter, when the real-time location exists in the location parameter, the first return result is correct. Furthermore, after obtaining the first transaction data, the real-time time is compared with the time parameter in the first transaction parameter. When the real-time time is within the time parameter, the first return result is correct. The real-time location is compared with the location parameter in the first transaction parameter. When the real-time location exists in the location parameter, the first return result is correct. In some industries, contactless transaction applications may be limited to time or location. For example, the transaction of a transportation card is limited to use in a certain city. At this time, if it is used in other cities, the real-time location will not exist in the location parameter. Therefore, the first return result is incorrect, and the electronic payment machine 300 will refuse to conduct the transaction. Similarly, the transaction of a transportation card is limited to the time from 5 am to 11 pm. If you take the subway at 11:10 pm, the real-time time is not within the time parameter, and the first return result is incorrect, and the electronic payment machine 300 will refuse to conduct the transaction. It should be noted that comparing the real-time time with the time parameters and comparing the location with the location parameters is equivalent to having multiple guarantees. On this basis, more judgment conditions can be added according to different applications. At the same time, in addition to being used as judgment conditions for the mobile terminal 200 at the same time, only one of the real-time time and the real-time location can be selected. Such a security judgment condition is weaker than having both at the same time, but it also has the effect of improving security.
[0031] Step S140, obtain the first status word according to the first return result, and send the first status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the first status word from the mobile terminal 200, and is used to determine whether the first status word is the same as the target status word. If the first status word is the same, send the first transaction instruction to the mobile terminal 200, wherein the first transaction instruction includes the terminal number and the transaction amount.
[0032] Specifically, the first status word is obtained according to the first return result. When the first return result is correct, the first status word thrown out is 0x9000, and when the first return result is abnormal, the first status word thrown out is 0x6985. The first status word is sent to the electronic payment machine 300. The electronic payment machine 300 determines whether the first status word is the same as the target status word. If they are the same, the first transaction instruction is sent to the mobile terminal 200, wherein the first transaction instruction includes the terminal number and the transaction amount.
[0033] Step S150, receiving and parsing the first transaction instruction from the electronic payment machine 300 to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount.
[0034] Specifically, the first transaction instruction received from the electronic payment machine 300 is parsed to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount. It can be understood that the first transaction data is mainly used to determine whether the mobile terminal 200 meets the conditions, and the second transaction data comes from the electronic payment machine 300 and is mainly used to determine whether the electronic payment machine 300 meets the conditions.
[0035] Step S160, determine the smart contract parameters according to the application identification parameters, and compare the second transaction data with the second transaction parameters in the smart contract parameters to obtain a second return result, wherein the second transaction parameters include a terminal number parameter and a transaction amount parameter.
[0036] Specifically, the smart contract parameters are determined according to the application identification parameters. It should be noted that the smart contract parameters include application identification parameters, basic condition parameters and business condition parameters, etc. The implementation methods of the smart contract parameter list include but are not limited to the use of arrays, linked lists, HASH tables and other data structures to improve the access efficiency of the smart contract API. Therefore, when the smart contract parameters are determined by the application identification parameters, the business condition parameters, i.e., the second transaction parameters, are contained. Therefore, the second transaction data and the second transaction parameters are compared to obtain the second return result, wherein the second transaction parameters include the terminal number parameter and the transaction amount parameter. The terminal number parameter is the terminal number segment or terminal number string allowed by the smart contract platform, and the transaction amount parameter is the payment limit allowed by the smart contract platform. Furthermore, after obtaining the second transaction data, the terminal number is compared with the terminal number parameter in the second transaction parameter. When the terminal number is within the terminal number parameter, the first return result is correct; the transaction amount is compared with the transaction amount parameter in the second transaction parameter. When the transaction amount is less than the transaction amount parameter, the first return result is correct. At this time, it is necessary to determine whether the electronic payment machine 300 meets the conditions. For example, the transportation card limits the use of the electronic payment machine 300 on the bus, but not on the subway. Therefore, the terminal numbers on the bus and the subway are different. Suppose the mobile terminal 200 containing the transportation card touches the electronic payment machine 300 on the subway, and obtains the second transaction data sent by the electronic payment machine 300. The terminal number in it is different from the terminal number parameter in the mobile terminal 200, so the second return result is an error. The second status word returned by the industry contactless application parameter is 0x6985. After receiving the second status word, the electronic payment machine 300 compares it with the target status word and knows that it is abnormal, so it refuses to conduct the transaction. Similarly, suppose an error occurs in the bus system. The original trip is 1 yuan, but now it requires a payment of 10 yuan. After the mobile terminal 200 contacts the electronic payment machine 300 on the bus, the transaction amount in the smart contract parameter determined by the application identification parameter should be 1 yuan. Therefore, the second status word returned to the electronic payment machine 300 is abnormal. Therefore, the electronic payment machine 300 will refuse to conduct the transaction. It should be noted that, in addition to the second transaction data processing terminal number and transaction amount, other judgment conditions may be added according to actual requirements. In addition, the terminal number and transaction amount may be selected alone or simultaneously used as judgment conditions.
[0037] Step S170, obtain the second status word based on the second return result, and send the second status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the second status word from the mobile terminal 200, and is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed, and if they are not the same, the transaction is refused to be executed.
[0038] Specifically, when the second return result is correct, the second status word thrown is 0x9000, and when the second return result is abnormal, the second status word thrown is 0x6985. The second status word is sent to the electronic payment machine 300, so that the electronic payment machine 300 determines whether the second status word is the same as the target status word, and allows the transaction to be executed if they are the same.
[0039] In another embodiment, the following steps are also included:
[0040] The industry contactless application module responds to the selection instruction from the electronic payment machine 300, determines the application identification parameter according to the selection instruction, and sends the application identification parameter to the smart contract application module through the shared interface, wherein the application identification parameter is used to identify the smart contract parameters of the contactless applications of different industries;
[0041] The smart contract application module receives the application identification parameters from the industry contactless application module and determines the smart contract parameters according to the application identification parameters;
[0042] The mobile terminal system module obtains the real-time time and real-time location of the mobile terminal 200 as the first transaction data, and sends the first transaction data to the smart contract application module;
[0043] The smart contract application module receives the first transaction data sent from the mobile terminal system module, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and returns the first return result to the industry contactless application module, wherein the first transaction parameter includes a time parameter and a location parameter;
[0044] The industry contactless application module receives the first return result from the smart contract application module, obtains a first status word based on the first return result, and sends the first status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the first status word from the industry contactless application module in the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If they are the same, a first transaction instruction is sent to the industry contactless application, wherein the first transaction instruction includes a terminal number and a transaction amount;
[0045] The industry contactless application module receives and parses the first transaction instruction from the electronic payment machine 300 to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount;
[0046] The industry contactless application module sends the application identification parameter and the second transaction data to the smart contract application module through the shared interface;
[0047] The smart contract application module receives the application identification parameters from the industry contactless application module and determines the smart contract parameters according to the application identification parameters;
[0048] The smart contract application module receives the second transaction data from the industry contactless application module, compares the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, and returns the second return result to the industry contactless application module, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter;
[0049] The industry contactless application module receives the second return result from the smart contract application module, obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the second status word from the industry contactless application module in the mobile terminal, and is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
[0050] Specifically, the mobile terminal 200 includes a SIM card and a mobile terminal system module, wherein the SIM card further includes an industry contactless application module and a smart contract application module. Specifically, the smart contract application module exists in the SIM card of the embedded platform. Depending on whether the embedded platform is JavaCard or NativeCard, the smart contract application module can be an Applet application or a Native application. The smart contract application module can be downloaded to the SIM over the air through the TSM trusted service platform, while the Native application requires the SIM manufacturer to pre-install it in the SIM card. The smart contract application module is a Toolkit application that complies with the GSM11.11 and GSM11.14 standards. In the smart contract application module and the industry contactless application module, the core keys such as the maintenance key and the signature private key related to the transaction security are securely stored in the authentication application EEPROM and cannot be directly obtained externally. The core keys use symmetric and asymmetric algorithms, international algorithms (3DES, RSA, SHA-1) and national secret algorithms (SM4, SM2, SM3), etc. It should be noted that as long as the SIM card complies with the international communication standards (GSM11.11, GSM11.14), it supports this embodiment, regardless of the SIM card form (2FF, 3FF, 4FF, etc.) and other communication technologies (Bluetooth SIM card, SWP-SIM card, eSIM card).
[0051] Among them, the industry contactless application module receives the selection instruction sent from the electronic payment machine 300, and determines the application identification parameter according to the selection instruction. After that, the industry contactless application module calls the interface to the smart contract application module through the shared interface, and sends the application identification parameter of the industry contactless application to the smart contract application module through the shared interface. After the smart contract module receives the application identification parameter sent by the industry contactless application module through the shared interface, it finds the corresponding smart contract parameter according to the application identification parameter. The mobile terminal system module obtains the real-time time and real-time location of the mobile terminal 200 as the first transaction data, and sends the first transaction data to the smart contract application module. The smart contract application module saves and updates the first transaction data in real time to the application security RAM area. Therefore, the smart contract application module determines whether the real-time time and real-time location in the application security RAM area meet the conditions of the smart contract parameters, where the smart contract parameters include time parameters and location parameters, that is, the first transaction data and the first transaction data in the smart contract parameters are determined to obtain a first return result, and the smart contract application module sends the first return result to the industry contactless application module. For example, if the real-time time exceeds the time parameter or the real-time location is not in the location parameter, the smart contract application module returns false to the first return parameter; if the time parameter or the location parameter is met, true is returned to the industry contactless application parameter. After receiving the first return result, the industry contactless application module obtains the first status word according to the first return result. If the first return result is true, that is, normal, the first status word 0x9000 is thrown out. If it is abnormal, the first status word 0x6985 is thrown out. The industry contactless application module sends the first status word to the electronic payment machine 300, so that the electronic payment machine 300 determines whether the first status word is the same as the target status word. If they are the same, it means it is normal, and sends the second transaction instruction to the industry contactless application module, wherein the second transaction module includes the terminal number and the transaction amount. If they are not the same, it means it is abnormal, and the transaction is directly terminated at this time. The industry contactless application module receives the second transaction instruction from the electronic payment machine 300 and parses it to obtain the second transaction data, including the transaction amount and the terminal number, and calls the terminal number interface and / or the transaction amount interface to the smart contract application module through the shared interface. The smart contract application module obtains the application identification parameter in the industry contactless application module through the shared interface, and determines the smart contract parameters according to the application identification parameter, compares the second transaction data with the transaction amount parameter and the terminal number parameter in the smart contract parameters, and returns the second result to the industry contactless application module. Exemplarily, if the transaction amount is greater than the transaction amount parameter or the terminal number is not equal to the terminal number parameter, the second return result returned by the smart contract module to the industry contactless application module is false, otherwise it is true. The industry contactless application module throws out different status words according to the API return result, throwing 0x9000 for normal and 0x6985 for abnormal.The industry contactless application module sends the second status word to the electronic payment machine 300, so that the second payment machine determines whether the second status word is the same as the target status word, wherein the target status word usually refers to the status word at the correct time, such as 0x9000. If they are the same, it means that the conditions are met, so the transaction is executed normally. If they are not the same, the transaction is terminated. It can be understood that the purpose of comparing the first transaction data with the first transaction parameter is to determine whether the mobile terminal 200 meets the conditions, and the purpose of comparing the second transaction data with the second transaction parameter is to determine whether the electronic payment machine 300 meets the conditions. By making conditional judgments on both parties of the transaction, security is improved. In addition, the parameters included in the smart contract parameters can include other transaction conditions in addition to time, location, terminal number, and transaction amount. Determining the smart contract parameters based on the application identification parameters can ensure that different industry contactless applications use corresponding smart contract parameters, that is, different conditions are used for different industry contactless applications to determine whether they are legal. For example: in transaction A, the transaction amount parameter is 10000, and in transaction B, the transaction amount parameter is 100000. That is, the smart contract application module saves and manages the smart contract parameter list of the SIM card multi-industry contactless application module, and provides the corresponding shared interface smart contract API to the industry contactless application module. When the industry contactless application module swipes the NFC card, the return value of the smart contract API determines the subsequent business process of the contactless application - allow or reject. If allowed, the subsequent payment process will continue, and if rejected, an abnormal status word will be thrown and the transaction will end. The return value obtained by comparison is equivalent to setting a judgment condition. Only when both the mobile terminal 200 and the electronic payment machine 300 meet the conditions can the payment be made, which improves security.
[0052] In another embodiment, referring to Figure 2 , Figure 2 The second flow chart of the SIM card payment authentication method based on smart contract provided in an embodiment of the present invention, the step of obtaining the first transaction data includes steps S180 to S1110:
[0053] Step S180, the mobile terminal system module obtains the real-time time and real-time location of the mobile terminal 200 as the first transaction data, and triggers a status event to be sent to the smart contract application module;
[0054] Step S190, after the industry contactless application module captures the status event from the mobile terminal system module, it sends an active command to the mobile terminal system module, wherein the active command is used to request to return the first transaction data;
[0055] Step S1100, the mobile terminal system module responds to the active command from the smart contract application module and sends the first transaction data to the smart contract application module;
[0056] Step S1110, the smart contract application module receives and stores the first transaction data sent from the mobile terminal system module.
[0057] Specifically, the mobile terminal system module will periodically obtain the real-time time and real-time location of the mobile terminal 200 as the first transaction data. At the same time, the mobile terminal system module will send commands to the SIM card at intervals of several seconds, such as the STATUS command to the smart contract application module. When the smart contract application module complies with the command, it will return a signal or message to the mobile terminal system module. For example, the STATUS command is used to determine whether the status of the smart contract application module is connected and running. After receiving the command, the smart contract application module will return a message to the mobile terminal system module to inform it that it can currently operate normally. After receiving the message, the mobile terminal system module triggers a status event and sends it to the smart contract application module. For example, the status event can be named EVENT_STATUS_COMMAND event. After the smart contract application module captures the status event, Afterwards, an active command is sent to the mobile terminal system module, requiring the mobile terminal system module to return the real-time time and real-time location. The active command is safe, effective and accurate. It should be noted that the mobile terminal system module can use a heartbeat mechanism to periodically obtain the real-time time and real-time location of the mobile terminal 200. The heartbeat mechanism refers to the periodic sending of a custom structure (heartbeat packet). By way of example, the heartbeat acquisition mechanism can be implemented using other STK technologies, such as using the TimerManager command to set the time interval for terminal trigger events, etc.; the mobile terminal system module will return the corresponding information to the smart contract application module according to the parameter requirements of the active command, namely the real-time time and real-time location. The smart contract application module will save and update these parameters in real time to the application security RAM area as the parameter data of the real-time time and real-time location of the current mobile terminal 200.
[0058] refer to Figure 3 , Figure 3 The third flow chart of the SIM card payment authentication method based on smart contract provided by the embodiment of the present invention is applied to the electronic payment machine 300, including steps S210-S230:
[0059] Step S210, sending a selection instruction to the mobile terminal 200, so that the mobile terminal 200 responds to the selection instruction from the electronic payment machine 300, determines the smart contract parameter by applying the identification parameter, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, obtains a first status word according to the first return result, and sends the first status word to the electronic payment machine 300, wherein the first transaction data is the real-time time and real-time location of the mobile terminal 200;
[0060] Specifically, a selection instruction is sent to the mobile terminal 200. It should be noted that the selection instruction is used to inform the mobile terminal 200 what application it belongs to, that is, it is used to let the mobile terminal 200 determine which application identification parameter to select, and determine the smart contract parameters through the application identification parameters. The mobile terminal 200 compares the first transaction parameter in the smart contract parameters and the real-time time and real-time location obtained in real time to obtain a first return result, and obtains a first status word based on the first return result and sends it to the electronic payment machine 300.
[0061] Step S220, receiving the first status word from the mobile terminal 200, determining whether the first status word is the same as the target status word, and if they are the same, sending the first transaction instruction to the mobile terminal 200, wherein the first transaction instruction includes the terminal number and the transaction amount, so that the mobile terminal 200 receives the first transaction instruction from the electronic payment machine 300 and parses it to obtain the second transaction data, and determines the smart contract parameters according to the application identification parameters, and compares the second transaction data with the second transaction parameters in the smart contract parameters to obtain the second return result, so that the mobile terminal 200 obtains the second status word based on the second return result, and sends the second status word to the electronic payment machine 300.
[0062] Specifically, after receiving the first status word sent by the mobile terminal 200, the electronic payment machine 300 determines whether the first status word is the same as the target status word. For example, the target status word is 0x9000. When the first return result is normal, the first status word 0x9000 is thrown out. When the first return result is an error, the first status word 0x6985 is thrown out. Therefore, the electronic payment machine 300 compares the target status word with the first status word. That is, when it is normal, it means that the mobile terminal 200 meets the transaction conditions. The target status word is the same as the first status word, and the electronic payment machine 300 sends the second transaction data to the mobile terminal 200. When the target status word is different from the first status word, it means that the mobile terminal 200 does not meet the transaction conditions. Therefore, the electronic payment machine 300 directly refuses to conduct the transaction. It should be noted that the target status word can also be set to be the same as the status word when the exception is thrown. At this time, if the target status word is the same as the first status word, the electronic payment machine 300 refuses to conduct the transaction. When the target status word is different from the first status word, the electronic payment machine 300 sends the first transaction instruction to the mobile terminal 200. Among them, the first transaction instruction includes the terminal number and the transaction amount, so that the mobile terminal 200 can parse the first transaction instruction to obtain the second transaction data, and obtain the smart contract parameters according to the application identification parameters, and compare the second transaction data with the second transaction parameters in the smart contract parameters to obtain the second return result, and obtain the second status word based on the second return result and return it to the electronic payment machine 300.
[0063] Step S230, receiving the second status word from the mobile terminal 200, and determining whether the second status word is the same as the target status word, if they are the same, allowing the transaction to be executed, and if they are not the same, refusing to execute the transaction.
[0064] Specifically, the electronic payment machine 300 receives the second status word sent by the mobile terminal 200 and compares it with the target status word. For example, the target status word is 0x9000. When the first return result is normal, the first status word 0x9000 is thrown out. When the first return result is an error, the first status word 0x6985 is thrown out. Therefore, the electronic payment machine 300 compares the target status word with the second status word. That is, when it is normal, it means that the second transaction data included in the first transaction instruction sent by the electronic payment machine 300 meets the transaction conditions, so the electronic payment machine 300 runs the transaction. When the target status word is different from the second status word, it means that the second transaction data included in the electronic payment machine 300 does not meet the transaction conditions, so the electronic payment machine 300 refuses to conduct the transaction. It can be understood that the target status word can also be set to the same status word as the status word thrown out when it is abnormal. At this time, if the second status word is the same as the target status word, it means that the second transaction data is abnormal, so the electronic payment machine 300 refuses to conduct the transaction. When the second status word is different from the target status word, it means that the second transaction data meets the transaction conditions, so the electronic payment machine 300 allows the transaction. However, the target status word is usually set to the status word thrown out normally. This is because it is possible that in addition to the status word thrown out normally and the status word thrown out abnormally, other status words may be caused by other problems such as system problems. At this time, setting the target status word to the status word thrown out normally is the safest approach, because except for the status word thrown out correctly, other status words will cause the electronic payment machine 300 to refuse to conduct transactions.
[0065] The following provides specific embodiments:
[0066] When a mobile phone is swiped with a bus card to conduct an NFC transaction in city A, the bus payment machine will send a selection instruction to the mobile phone. After the industry contactless application module in the SIM card in the mobile phone receives the selection instruction, it determines the application identification parameters of the city A bus payment application based on the selection instruction. The industry contactless application module calls the interface acceptTime() or acceptLocation() to the smart contract parameters through the common interface between the smart contract parameters, and sends the application identification parameters to the smart contract application module. After receiving the application identification parameters, the corresponding smart contract parameters of the city A bus application are obtained according to the application identification parameters, including: transaction amount parameter, terminal number parameter, time parameter, and location parameter. In addition, the mobile terminal system module in the mobile phone obtains the real-time location and real-time time of the mobile phone through heartbeat, and sends the STATUS command to the SIM card at intervals of several seconds, thereby triggering the EVENT_STATUS_COMMAND event to the smart contract application module in the SIM card. The smart contract application module sends the Provide LocalInformation active command to the mobile terminal system module based on the EVENT_STATUS_COMMAND event, requiring the mobile terminal system module to return the current time or\ and location information. The mobile terminal system module returns the corresponding response information to the smart contract application according to the parameter requirements of the Provide Local Information active command. The smart contract application saves and updates these parameters in real time to the application security RAM area as reference data for the current time or location information of the mobile terminal.The smart contract application module compares the time parameter in the smart contract parameter with the real-time time in the application security RAM area. The real-time time is 20221129170203, and the time parameter is 20221129230000. The real-time time is within the time parameter. The smart contract application module compares the position parameter in the smart contract parameter with the real-time position in the smart contract application module. The real-time position is in city A (displayed as a byte string), and the byte string in the position parameter includes city A. This means that the real-time position is within the position parameter. Therefore, the smart contract application module returns through the interface. true to the industry contactless application module. After receiving true, the industry contactless application module throws out the 0x9000 status word and sends it to the electronic payment machine 300 of the bus. After receiving the status word, the electronic payment machine 300 compares it with the target status word 0x9000 to determine that the status word is the same, so it sends the first transaction instruction to the mobile phone. The industry contactless application module in the mobile phone receives the first transaction instruction, and after parsing, obtains the second transaction data of the bus electronic payment machine 300, that is, the terminal number and transaction amount. At this time, the industry contactless application module calls the smart contract application through the shared interface. acceptTerminal(tmnId) or acceptPaymentLimit(amount), where the tmnld parameter represents the terminal number, and the amount parameter represents the transaction amount. The smart contract application module obtains the application identification parameter through the shared interface with the industry contactless application module, and obtains the smart contract parameter of the A city bus transaction application according to the application identification parameter, and compares the transaction amount parameter in the smart contract parameter with the transaction amount, where the transaction amount parameter is 1, and the transaction amount is 1. The terminal number in the smart contract parameter is compared with the terminal number parameter, where the terminal number parameter includes the byte string of all the electronic payment machines 300 of the buses in City A, and the terminal number is included in it. Therefore, the smart contract application module returns true to the industry contactless application module through the interface. After receiving true, the industry contactless application module throws out the 0x9000 status word and sends it to the electronic payment machine 300 of the bus. The electronic payment machine 300 compares the received status word with the target status word 0x9000 and finds that they are the same, so it sends the second transaction instruction to the mobile phone. At this time, the second transaction instruction represents that the transaction is allowed.The following is a more detailed list of API interfaces: the API function for time conditions is booleanacceptTime(), with no API parameters. In the API return result, true means permission, indicating that the real-time time is within the time parameter, and false means rejection, indicating that the real-time time is not within the time parameter; the API function for location conditions is booleanacceptLocation(), with no API parameters. In the API return result, true means permission, indicating that the real-time location is within the location parameter, and false means rejection, indicating that the real-time location is not within the location parameter; the API function for terminal number conditions is booleanacceptTerminal(byte[]tmnId), with API parameters of tmnId and attribute in, which is the terminal number of the electronic payment for the current contactless transaction. In the API return result, true means permission, indicating that the terminal number tmnId is within the terminal number parameter, and false means rejection, indicating that the terminal number tmnId is not within the terminal number parameter; the API function for transaction amount conditions is booleanacceptTerminal(byte[]tmnId), with API parameters of tmnId and attribute in, which is the terminal number of the electronic payment for the current contactless transaction. acceptPaymentLimit(byte[]amount), the API parameter is amount, the attribute is in, which is the transaction amount of the current contactless transaction. In the API return result, true is allowed, indicating that the transaction amount is less than or equal to the payment limit, and false is rejected, indicating that the transaction amount is greater than the payment limit. The smart contract application module unifies the conditional payment management of SIM card contactless applications and improves the effective monitoring of SIM card contactless payments; a set of APIs are provided through a shared interface for other contactless applications to access, and other contactless applications do not need to pay attention to the implementation of conditional payments. By making corresponding conditional judgments for different applications, conditional payments include limited time, limited location or other directional terminals, payment limits, etc. Although it cannot use the security authentication of mobile terminals or the ability to launch APPs like mobile PAY products, from the perspective of contactless security management, this solution unifies the conditional payment management of SIM card contactless applications, reduces the security risks of SIM card contactless payments, and improves the effective monitoring of SIM card contactless payments. It should be noted that other solutions can also be used to achieve conditional judgment. For example: (1) SIM card COS can be used to maintain the smart contract parameters of each contactless application, that is, there is no need for industry contactless application modules and smart contract modules, but it will increase the cost of modifying the card COS, which is not conducive to product promotion; (2) Client software can be used to store smart contracts, but its security is questionable; (3) System platform can be used to store smart contracts, but it is not applicable to NFC contactless scenarios. Smart contracts on the system side are difficult to play a regulatory role in NFC card swiping scenarios.
[0067] refer to Figure 4 , Figure 4The SIM card payment authentication method system 100 based on smart contract provided by the embodiment of the present invention is used to execute the SIM card payment authentication method based on smart contract, wherein the SIM card payment authentication system 100 based on smart contract includes a mobile terminal 200 and an electronic payment machine 300:
[0068] The mobile terminal 200 is used to respond to the selection instruction from the electronic payment machine 300, determine the smart contract parameters through the application identification parameters, wherein the application identification parameters are used to identify the smart contract parameters of contactless applications in different industries; obtain the real-time time and real-time location of the mobile terminal 200 as the first transaction data; compare the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter; obtain a first status word according to the first return result, and send the first status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the first status word from the mobile terminal 200, and is used to determine whether the first status word is the same as the target status word. If the first status word is the same, the first transaction instruction is sent to the mobile terminal 200. , wherein the first transaction instruction includes a terminal number and a transaction amount; receiving the first transaction instruction from the electronic payment machine 300 and parsing it to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; determining the smart contract parameters according to the application identification parameters, and comparing the second transaction data with the second transaction parameters in the smart contract parameters to obtain a second return result, wherein the second transaction parameters include a terminal number parameter and a transaction amount parameter; obtaining a second status word based on the second return result, and sending the second status word to the electronic payment machine 300, so that the electronic payment machine 300 receives the second status word from the mobile terminal 200, which is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
[0069] The electronic payment machine 300 is used to send a selection instruction to the mobile terminal 200, so that the mobile terminal 200 responds to the selection instruction from the electronic payment machine 300, determines the smart contract parameter by applying the identification parameter, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and obtains a first status word according to the first return result, and sends the first status word to the electronic payment machine 300, wherein the first transaction data is the real-time time and real-time location of the mobile terminal 200; receives the first status word from the mobile terminal 200, determines whether the first status word is the same as the target status word, and if the first status word is the same, sends the first transaction instruction to the mobile terminal 20 0, wherein the first transaction instruction includes a terminal number and a transaction amount, so that the mobile terminal 200 receives the first transaction instruction from the electronic payment machine 300 and parses it to obtain the second transaction data, and determines the smart contract parameters according to the application identification parameters, and compares the second transaction data with the second transaction parameters in the smart contract parameters to obtain a second return result, so that the mobile terminal 200 obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine 300; receives the second status word from the mobile terminal 200, determines whether the second status word is the same as the target status word, and if so, allows the transaction to be executed, and if not, refuses to execute the transaction.
[0070] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes Figure 1-Figure 4 The method shown.
[0071] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0072] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features described may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0073] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0074] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0075] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0076] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0077] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0078] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0079] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A SIM card payment authentication method based on smart contract, characterized in that: Applied to mobile terminals, including: In response to a selection instruction from the electronic payment machine, an application identification parameter is determined according to the selection instruction, and a smart contract parameter is determined by the application identification parameter, wherein the application identification parameter is used to identify smart contract parameters of contactless applications in different industries; Acquire the real-time time and the real-time location of the mobile terminal as first transaction data; Comparing the first transaction data with a first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter; Obtaining a first status word according to the first returned result, and sending the first status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If they are the same, sending a first transaction instruction to the mobile terminal, wherein the first transaction instruction includes a terminal number and a transaction amount; receiving a first transaction instruction from the electronic payment machine and parsing the instruction to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; Determine the smart contract parameter according to the application identification parameter, and compare the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter; the first transaction data is used to determine whether the mobile terminal meets the conditions, and the second transaction data is used to determine whether the electronic payment machine meets the conditions; the terminal number parameter is the terminal number segment or terminal number string allowed by the smart contract platform, and the transaction amount parameter is the payment limit allowed by the smart contract platform; A second status word is obtained based on the second returned result, and the second status word is sent to the electronic payment machine, so that the electronic payment machine receives the second status word from the mobile terminal, and is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
2. The SIM card payment authentication method based on smart contract according to claim 1, characterized in that: The mobile terminal also includes an industry contactless application module, a smart contract application module and a mobile terminal system module: The industry contactless application module responds to the selection instruction from the electronic payment machine, determines the application identification parameter according to the selection instruction, and sends the application identification parameter to the smart contract application module through the shared interface, wherein the application identification parameter is used to identify the smart contract parameters of the contactless applications of different industries; The smart contract application module receives the application identification parameter from the industry contactless application module, and determines the smart contract parameter according to the application identification parameter; The mobile terminal system module obtains the real-time time and the real-time location of the mobile terminal as the first transaction data, and sends the first transaction data to the smart contract application module; The smart contract application module receives the first transaction data sent from the mobile terminal system module, compares the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and returns the first return result to the industry contactless application module, wherein the first transaction parameter includes a time parameter and a location parameter; The industry contactless application module receives the first return result from the smart contract application module, obtains a first status word based on the first return result, and sends the first status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the industry contactless application in the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If the first status word is the same as the target status word, a first transaction instruction is sent to the industry contactless application, wherein the first transaction instruction includes a terminal number and a transaction amount; The industry contactless application module receives and parses the first transaction instruction from the electronic payment machine to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; The industry contactless application module sends the application identification parameter and the second transaction data to the smart contract application module through the shared interface; The smart contract application module receives the application identification parameter from the industry contactless application module, and determines the smart contract parameter according to the application identification parameter; The smart contract application module receives the second transaction data from the industry contactless application module, compares the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, and returns the second return result to the industry contactless application module, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter; The industry contactless application module receives the second return result from the smart contract application module, obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine, so that the electronic payment machine receives the second status word from the industry contactless application, and is used to determine whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
3. The SIM card payment authentication method based on smart contract according to claim 2, characterized in that: The step of obtaining the first transaction data includes: The mobile terminal system module obtains the real-time time and real-time location of the mobile terminal as the first transaction data, and triggers a status event to be sent to the smart contract application module; After capturing the status event from the mobile terminal system module, the industry contactless application module sends an active command to the mobile terminal system module, wherein the active command is used to request the return of the first transaction data; The mobile terminal system module responds to the active command from the smart contract application module and sends the first transaction data to the smart contract application module; The smart contract application module receives and stores the first transaction data sent from the mobile terminal system module.
4. The SIM card payment authentication method based on smart contract according to claim 1, characterized in that: The comparing the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result includes: Comparing the real-time time with the time parameter in the first transaction parameter, when the real-time time is within the time parameter, the first returned result is correct; The real-time position is compared with the position parameter in the first transaction parameter. When the real-time position exists in the position parameter, the first returned result is correct.
5. The SIM card payment authentication method based on smart contract according to claim 1, characterized in that: The comparing the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result includes: comparing the terminal number with a terminal number parameter in the second transaction parameter, and when the terminal number is within the terminal number parameter, the second returned result is correct; The transaction amount is compared with a transaction amount parameter in the second transaction parameter. When the transaction amount is less than the transaction amount parameter, the second returned result is correct.
6. A SIM card payment authentication method based on smart contract, characterized in that: Applications in electronic payment machines, including: Sending a selection instruction to the mobile terminal so that the mobile terminal responds to the selection instruction from the electronic payment machine, determining an application identification parameter according to the selection instruction, determining a smart contract parameter by using the application identification parameter, for comparing the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, and obtaining a first status word according to the first return result, and sending the first status word to the electronic payment machine, wherein the first transaction data is the real-time time and real-time location of the mobile terminal; Receiving a first status word from the mobile terminal, determining whether the first status word is the same as the target status word, and if the first status word is the same, sending a first transaction instruction to the mobile terminal, wherein the first transaction instruction includes a terminal number and a transaction amount, so that the mobile terminal receives and parses the first transaction instruction from the electronic payment machine to obtain second transaction data, determines the smart contract parameter according to the application identification parameter, and compares the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, so that the mobile terminal obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine; A second status word is received from the mobile terminal, and it is determined whether the second status word is the same as the target status word. If they are the same, the transaction is allowed to be executed; if they are not the same, the transaction is refused to be executed.
7. A SIM card payment authentication system based on smart contracts, characterized in that: include: A mobile terminal, used to respond to a selection instruction from an electronic payment machine, determine an application identification parameter according to the selection instruction, and determine a smart contract parameter through the application identification parameter, wherein the application identification parameter is used to identify the smart contract parameters of contactless applications in different industries; obtain the real-time time and real-time location of the mobile terminal as first transaction data; compare the first transaction data with the first transaction parameter in the smart contract parameter to obtain a first return result, wherein the first transaction parameter includes a time parameter and a location parameter; obtain a first status word according to the first return result, and send the first status word to the electronic payment machine, so that the electronic payment machine receives the first status word from the mobile terminal, and is used to determine whether the first status word is the same as the target status word. If the first status word is the same, the first transaction instruction is sent to the mobile terminal. wherein the first transaction instruction includes a terminal number and a transaction amount; receiving the first transaction instruction from the electronic payment machine and parsing it to obtain second transaction data, wherein the second transaction data includes a terminal number and a transaction amount; determining the smart contract parameter according to the application identification parameter, and comparing the second transaction data with a second transaction parameter in the smart contract parameter to obtain a second return result, wherein the second transaction parameter includes a terminal number parameter and a transaction amount parameter; obtaining a second status word based on the second return result, and sending the second status word to the electronic payment machine, so that the electronic payment machine receives the second status word from the mobile terminal, and determines whether the second status word is the same as the target status word, and if they are the same, the transaction is allowed to be executed, and if they are not the same, the transaction is refused to be executed; An electronic payment machine, used to send a selection instruction to a mobile terminal, so that the mobile terminal responds to the selection instruction from the electronic payment machine, determines an application identification parameter according to the selection instruction, determines a smart contract parameter through the application identification parameter, compares first transaction data with a first transaction parameter in the smart contract parameter to obtain a first return result, and obtains a first status word according to the first return result, and sends the first status word to the electronic payment machine, wherein the first transaction data is the real-time time and real-time location of the mobile terminal; receives the first status word from the mobile terminal, determines whether the first status word is the same as the target status word, and if the first status word is the same, sends the first transaction instruction to the mobile terminal , wherein the first transaction instruction includes a terminal number and a transaction amount, so that the mobile terminal receives the first transaction instruction from the electronic payment machine and parses it to obtain second transaction data, and determines the smart contract parameter according to the application identification parameter, and compares the second transaction data with the second transaction parameter in the smart contract parameter to obtain a second return result, so that the mobile terminal obtains a second status word based on the second return result, and sends the second status word to the electronic payment machine; receives the second status word from the mobile terminal, determines whether the second status word is the same as the target status word, and if so, allows the transaction to be executed, and if not, refuses to execute the transaction.
8. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a program, and the program is executed by a processor to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
