A consumption processing method and related device
Managing consumption permissions through blockchain smart contracts solves the problem of users easily forgetting to check plans and losing memos during fund management, and achieves safe and reliable management of fund uses.
Patent Information
- Application Number
- CN201910829813.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-30
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-03-01
AI Technical Summary
In the existing technology, users tend to forget to check the plan when managing fund use through memos, and the physical memos are easily lost, resulting in unreliable and unsafe management.
The consumption permissions of the account are limited by the blockchain smart contract. Users must meet the consumption permissions set by the smart contract before they can transfer and consume, ensuring the planning and safety of fund use.
It achieves safe and reliable management of fund usage, avoids the unreliability and loss problems of memo management, and ensures that users follow the preset plan when transferring money.
Smart Images

Figure CN110533403B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a consumption processing method and related devices. Background Art
[0002] With the development of Internet technology, electronic payment is widely used in people's daily life. Consumers can conveniently pay for their favorite services or items through electronic payment according to the associated bank card or third-party payment account.
[0003] In current shopping consumption, if user A likes an item sold by user B, user A can purchase the item from user B by transferring funds from his account to user B's account. If user A expects to manage the use of funds in his account, user A can record the remaining funds in the account and the planned use of funds through a memo.
[0004] The inventor of the present application has found that the prior art has at least the following disadvantages: users use memos to manage their fund usage, and are prone to forget to check the memos when shopping and spending, thereby forgetting the set fund plan. At the same time, when using physical memos, users are prone to lose the memos.
[0005] From the above analysis, it can be seen that in the prior art, users use memos to manage the use of funds, which is unreliable and easy to lose. Summary of the invention
[0006] The embodiment of the present application provides a consumption processing method and related devices for limiting the consumption authority of funds from the transaction process, thereby solving the problem that the memo method is unreliable and the memo is easily lost.
[0007] In view of this, a first aspect of an embodiment of the present application provides a consumption processing method, including:
[0008] Obtaining an account transfer request, the account transfer request including an account identifier, the account transfer request also including at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0009] According to the account transfer request, determining the consumption authority through a smart contract, wherein the consumption authority has a corresponding relationship with the account identifier;
[0010] If the account transfer request satisfies the consumption authority, the account transfer request is synchronized through the blockchain.
[0011] A second aspect of an embodiment of the present application provides a consumption processing device, including:
[0012] an acquiring unit, configured to acquire an account transfer request, wherein the account transfer request includes an account identifier, and the account transfer request also includes at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0013] A processing unit, configured to determine consumption authority through a smart contract according to the account transfer request, wherein the consumption authority has a corresponding relationship with the account identifier;
[0014] The processing unit is further configured to synchronize the account transfer request through the blockchain if the account transfer request satisfies the consumption authority.
[0015] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0016] Obtaining the consumption amount corresponding to the consumption type according to the account transfer request;
[0017] If the consumption amount corresponding to the consumption type is less than or equal to the consumption limit corresponding to the consumption type, determining that the account transfer request satisfies the consumption authority, wherein the consumption limit corresponding to the consumption type is determined by the smart contract;
[0018] If the consumption amount corresponding to the consumption type is greater than the consumption limit corresponding to the consumption type, it is determined that the account transfer request does not meet the consumption authority.
[0019] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0020] Acquire the consumption type according to the account transfer request;
[0021] If the consumption type satisfies the consumption type restriction condition corresponding to the account identifier, determining that the account transfer request satisfies the consumption authority, wherein the consumption type restriction condition corresponding to the account identifier is determined by the smart contract;
[0022] If the consumption type does not satisfy the consumption type restriction condition corresponding to the account identifier, it is determined that the account transfer request does not satisfy the consumption authority.
[0023] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0024] acquiring the location information according to the account transfer request;
[0025] If the location information satisfies the location information restriction condition corresponding to the account identifier, determining that the account transfer request satisfies the consumption authority, wherein the location information restriction condition corresponding to the account identifier is determined by the smart contract;
[0026] If the location information does not satisfy the location information restriction condition corresponding to the account identifier, it is determined that the account transfer request does not satisfy the consumption authority.
[0027] In a possible design, in an implementation of the second aspect of the embodiment of the present application, a deposit unit is further included, and the deposit unit is used to:
[0028] Obtaining a deposit request, the deposit request including the account identifier, the consumption type, and the deposit amount;
[0029] Determining the smart contract according to the account identifier, the consumption type, and the deposit amount;
[0030] The deposit request and the smart contract are synchronized to the blockchain.
[0031] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the deposit unit is further used for:
[0032] Synchronizing the deposit request to the blockchain;
[0033] Synchronizing the smart contract to the blockchain;
[0034] Wherein, synchronizing the smart contract to the blockchain includes:
[0035] Encrypt the smart contract using a private key to obtain the encrypted smart contract;
[0036] The encrypted smart contract is synchronized to the blockchain.
[0037] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0038] If the consumption amount is greater than the consumption limit, a prompt message is generated, and the prompt message is used to prompt that the transfer fails.
[0039] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0040] The updated consumption limit is determined according to the consumption limit and the consumption amount.
[0041] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0042] A reminder message is generated according to the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0043] In a possible design, in an implementation of the second aspect of the embodiment of the present application, the processing unit is further configured to:
[0044] Acquire historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0045] According to the account identifier in the account transfer request, the consumption type and the historical consumption record, the consumption limit corresponding to the consumption type is determined through the smart contract.
[0046] A third aspect of an embodiment of the present application provides a node device, which may be a terminal device or a server, including: a memory, a transceiver, a processor, and a bus system;
[0047] Wherein, the memory is used to store programs;
[0048] The processor is used to execute the program in the memory, comprising the following steps:
[0049] Obtaining an account transfer request, the account transfer request including an account identifier, the account transfer request also including at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0050] According to the account transfer request, determining the consumption authority through a smart contract, wherein the consumption authority has a corresponding relationship with the account identifier;
[0051] If the account transfer request satisfies the consumption authority, the account transfer request is synchronized through the blockchain; the bus system is used to connect the memory and the processor so that the memory and the processor communicate with each other.
[0052] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0053] Acquire the consumption amount corresponding to the consumption type according to the account transfer request;
[0054] If the consumption amount corresponding to the consumption type is less than or equal to the consumption limit corresponding to the consumption type, determining that the account transfer request satisfies the consumption authority, wherein the consumption limit corresponding to the consumption type is determined by the smart contract;
[0055] If the consumption amount corresponding to the consumption type is greater than the consumption limit corresponding to the consumption type, it is determined that the account transfer request does not meet the consumption authority.
[0056] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0057] Acquire the consumption type according to the account transfer request;
[0058] If the consumption type satisfies the consumption type restriction condition corresponding to the account identifier, determining that the account transfer request satisfies the consumption authority, wherein the consumption type restriction condition corresponding to the account identifier is determined by the smart contract;
[0059] If the consumption type does not satisfy the consumption type restriction condition corresponding to the account identifier, it is determined that the account transfer request does not satisfy the consumption authority.
[0060] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0061] acquiring the location information according to the account transfer request;
[0062] If the location information satisfies the location information restriction condition corresponding to the account identifier, determining that the account transfer request satisfies the consumption authority, wherein the location information restriction condition corresponding to the account identifier is determined by the smart contract;
[0063] If the location information does not satisfy the location information restriction condition corresponding to the account identifier, it is determined that the account transfer request does not satisfy the consumption authority.
[0064] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0065] Obtaining a deposit request, the deposit request including the account identifier, the consumption type, and the deposit amount;
[0066] Determining the smart contract according to the account identifier, the consumption type, and the deposit amount;
[0067] The deposit request and the smart contract are synchronized to the blockchain.
[0068] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0069] Synchronizing the deposit request to the blockchain;
[0070] Synchronizing the smart contract to the blockchain;
[0071] Wherein, synchronizing the smart contract to the blockchain includes:
[0072] Encrypt the smart contract using a private key to obtain the encrypted smart contract;
[0073] The encrypted smart contract is synchronized to the blockchain.
[0074] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0075] If the consumption amount is greater than the consumption limit, a prompt message is generated, and the prompt message is used to prompt that the transfer fails.
[0076] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0077] The updated consumption limit is determined according to the consumption limit and the consumption amount.
[0078] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0079] A reminder message is generated according to the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0080] In a possible design, in an implementation of the third aspect of the embodiment of the present application, the processor is used to execute the program in the memory, further comprising the following steps:
[0081] Acquire historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0082] According to the account identifier in the account transfer request, the consumption type and the historical consumption record, the consumption limit corresponding to the consumption type is determined through the smart contract.
[0083] A fourth aspect of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute the method of the first aspect.
[0084] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0085] The embodiment of the present application provides a method for consumption processing and a related device. The method specifies the consumption authority of an account through a smart contract of a blockchain, so that when a user transfers money for consumption on the blockchain, the user must comply with the consumption authority of the smart contract to realize the transfer consumption. According to the embodiment of the present application, the user plans and arranges the use of funds through a smart contract, which is safe and reliable, and solves the problem that planning and arranging through a memo is unreliable and the memo is easy to lose. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 This is a system architecture diagram of an embodiment of the present application;
[0087] Figure 2 A flowchart of a consumption processing method provided in an embodiment of the present application;
[0088] Figure 3 This is a schematic diagram of an account transfer request in an embodiment of the present application;
[0089] Figure 4 This is an interface diagram of an embodiment of the present application in which a user transfers money to a merchant by scanning the merchant's QR code;
[0090] Figure 5 This is an interface diagram of a user's client when a merchant scans a barcode on a user's client to transfer money in an embodiment of the present application;
[0091] Figure 6 This is a schematic diagram of an interface for a user to pay directly to a merchant account in an embodiment of the present application;
[0092] Figure 7 A schematic diagram of a smart contract in an embodiment of the present application;
[0093] Figure 8 A network topology diagram of a distributed blockchain ledger in an embodiment of the present application;
[0094] Fig. 9 A schematic diagram of a user, a merchant, and a blockchain in an embodiment of the present application;
[0095] Fig.10 This is a schematic diagram of a blockchain ledger according to an embodiment of the present application;
[0096] Fig.11 This is a schematic diagram of the consumption record of account identification 1 in the embodiment of the present application;
[0097] Fig.12 This is a schematic diagram of the user deposit interface in the embodiment of the present application;
[0098] Fig.13 This is a schematic diagram of a parent depositing money into a child's account in an embodiment of the present application;
[0099] Fig.14 This is a schematic diagram of a terminal device prompting a transfer failure in an embodiment of the present application;
[0100] Fig.15 This is a schematic diagram of the updated smart contract in the embodiment of the present application;
[0101] Fig.16 This is an interface diagram of a terminal device displaying a consumption plan in an embodiment of the present application;
[0102] Fig.17 A flowchart of a consumption processing method provided in an embodiment of the present application;
[0103] Fig.18 This is a schematic diagram of a payment interface of a terminal device in an embodiment of the present application;
[0104] Fig.19 A schematic diagram of an application example of a consumption processing method;
[0105] Fig. 20 A schematic diagram of a consumption processing device provided in an embodiment of the present application;
[0106] Fig.21 Another schematic diagram of a consumption processing device provided in an embodiment of the present application;
[0107] Fig. 22 A block diagram of a partial structure of a mobile phone related to the terminal provided in an embodiment of the present application
[0108] Fig.23 It is a schematic diagram of a server structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0109] The embodiment of the present application provides a consumption processing method and related devices for limiting the consumption authority of funds from the transaction process, thereby solving the problem that the memo method is unreliable and the memo is easily lost.
[0110] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0111] It should be understood that electronic payment is widely used in people's daily lives and has greatly improved people's lives. People can complete the payment and transfer process through terminal devices such as mobile phones or computers. However, some consumers with poor self-control are prone to impulse consumption. For example, a consumer plans to use 900 yuan as food expenses per month. However, faced with the temptation of delicious food, the consumer finally used 2,000 yuan for meals and snacks, which completely exceeded the consumer's plan and made the consumer miserable. In addition, many parents open electronic payment accounts specifically for their children to facilitate their children's lives. For example, they can use electronic payment to get food in the canteen, buy stationery, take public transportation, etc. These children may not be able to withstand the temptation and use the money originally used for meals to buy toys. Therefore, it is necessary for consumers to manage the use of funds in their electronic payment accounts.
[0112] Currently, consumers generally write down their financial plans on a memo and then check the financial plans in their memo before making electronic payments to determine whether they should make the electronic payment. However, many consumers often forget to check the memo, which results in forgetting their financial plans and making erroneous payments. In addition, consumers may lose their mobile phones and thus lose the electronic memos in their mobile phones, or consumers may use paper memos, which are more likely to be lost.
[0113] In order to solve the above problems, the embodiments of the present application provide a consumption processing method and related devices, which can restrict electronic payments from the process of electronic payment. Consumers can only realize electronic payment consumption when the set rules are met.
[0114] Figure 1This is a system architecture diagram of an embodiment of the present application. It can be seen that the user conducts a transfer transaction with the merchant through a terminal device. The type of terminal device used by the user is the same as the type of terminal device used by the merchant. These terminal devices may include but are not limited to mobile phones, desktop computers, tablet computers, laptop computers, and PDAs. These terminal devices are interconnected through servers on the network to complete electronic transactions between users and merchants. Users can transfer money with merchants to purchase the required items or services from merchants, for example, user 1 transfers money with merchant 1, and user 1 transfers money with merchant 2. Users can also transfer money between each other, for example, user 1 transfers money with user 2, and user 1 transfers money with user 3.
[0115] Understandably, Figure 1 The terminal devices in the system are generally installed with clients for electronic payment. These clients can be computer software, mobile phone software, applets, etc. Computer software can be computer plug-ins, browsers, stock trading software, etc. Mobile phone software can be shopping applications (Application, APP), bank APP, third-party payment software APP, etc. Applets can be functional programs embedded in mobile phone software. In actual applications, other clients that can realize electronic payment can also be used, which are not limited here.
[0116] Based on Figure 1 The architecture shown in the figure, the embodiment of the present application provides a method for consumption processing, such as Figure 2 As shown, Figure 2 A flowchart of a consumption processing method provided in an embodiment of the present application, which is suitable for implementation in a scenario where a user and a merchant conduct face-to-face transactions, and the method includes:
[0117] 201. Obtain an account transfer request, where the account transfer request includes an account identifier and at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0118] In an embodiment of the present application, the account identifier can be an identity document (ID) of the account, or a nickname of the account. In actual applications, it can also be other situations, which are not specifically limited here. The account identifier is specifically an account identifier used by the user for transfer consumption. The consumption type can be food expenses, transportation consumption, store consumption, etc., which can be set by the user or the administrator of the account system or other users. The location information can be based on mobile location service (location based service, LBS) information, which is obtained through the radio communication network of the telecommunications mobile operator (such as the global mobile communication system network, the code division multiple access communication system network) or the external positioning method (such as the global positioning system) to obtain the location information (geographic coordinates, or geodetic coordinates) of the mobile terminal user.
[0119] In some embodiments, the client or server obtains an account transfer request including an account identifier and a consumption type, as described below:
[0120] Figure 3 This is a schematic diagram of an account transfer request in an embodiment of the present application. It can be seen that the account transfer request includes an account identifier, a consumption type, and a consumption amount corresponding to the consumption type. The consumption amount is associated with the account identifier in the consumption and is associated with the consumption type of the consumption. For example, the consumption type of account A in the transfer consumption is food expenses, and the consumption amount is 10 yuan.
[0121] In the embodiment of the present application, a user arrives at a merchant's store, takes a fancy to a product and decides to buy it. The user can transfer money to the merchant through electronic payment to purchase the product. Alternatively, the user comes to the merchant's restaurant, eats and consumes, and transfers money to the merchant. When the user transfers money to the merchant, he can transfer money to the merchant by scanning the merchant's QR code, or the merchant can scan the barcode on the user's client to transfer money, or the user can pay directly to the merchant's account. The following will describe these three scenarios in detail:
[0122] Figure 4 This is an interface diagram of a user transferring money to a merchant by scanning the merchant's QR code in the embodiment of the present application. After the user scans the merchant's QR code through the client, the client can obtain information such as the merchant identification, merchant nickname, consumption type, etc. from the QR code, and then the client displays the merchant nickname on the client's interface, for example, "transfer to merchant (XXX)" is displayed on the client's interface, and the client automatically fills in the consumption type into the corresponding input area. The user can check whether the consumption type is correct. If not, the user can click on the input area and then modify it through the virtual keyboard. Then, the user can also fill in the transfer amount, payment password and other information. At the same time, the client can also display the account identification of the user for transfer, for example, "account for payment: xxx" is displayed on the client's interface. After the user confirms that the information is correct, click the "OK" virtual button so that the client obtains the account transfer request, which may include the account identification of the user for transfer, the consumption type displayed on the client interface, the consumption amount, and generally also includes the merchant identification, payment password, etc.
[0123] In a possible embodiment, the client does not obtain the consumption type from the QR code, but obtains the consumption type corresponding to the merchant ID through the association relationship between the merchant ID and the consumption type stored in the server according to the merchant ID, and then automatically fills the consumption type into the corresponding area. The user can check whether the consumption type is correct. If it is not correct, the user can click on the input area and modify it through the virtual keyboard.
[0124] Table 1 shows the association between merchant IDs and consumption types. It can be seen that the client can query the corresponding consumption type through the merchant ID. The consumption type may include but is not limited to food expenses, store consumption, etc., and may also be transportation consumption, asset trading, etc., which are not specifically limited here. The consumption type can be set by the user himself or by the administrator of the account system, and then uploaded to the server for the user to choose.
[0125] Table 1
[0126]
[0127]
[0128] In a possible embodiment, the client does not obtain the consumption type from the QR code, nor does it obtain the consumption type from the server, but rather Figure 4 As shown, the user is allowed to fill in the consumption type by himself. When the user clicks the input area corresponding to the consumption type, the consumption type can be entered through the virtual keyboard.
[0129] In the embodiment of the present application, the input area can be as follows Figure 4 The area above the underline shown may also be an input area surrounded by a box, or may be in other ways, which are not specifically limited here.
[0130] Figure 5 This is a diagram of the user client interface when the merchant scans the barcode on the user's client to transfer money. It can be seen that the user client displays a barcode or QR code and the account for payment: xxx. The user can click "Account for payment: xxx" to pop up the user's other account selection interface for the user to choose. The merchant scans the barcode on the terminal device. Figure 3 After the interface shown, the account ID and other information for payment can be obtained from the user's client. Then the merchant's terminal device generates an account transfer request, which can include the user's account ID, consumption type, consumption amount, etc., as well as the merchant's ID. It is understandable that after the merchant's terminal device generates the account transfer request, it can send the account transfer request to the user's client to display its content.
[0131] In a possible embodiment, the merchant's terminal device only uploads the user's account ID, consumption amount, merchant ID, etc. to the server, and then the server obtains the consumption type corresponding to the merchant ID through the association relationship between the merchant ID and the consumption type stored in the server according to the merchant ID. Finally, the server generates an account transfer request, which may include the user's account ID, consumption type, consumption amount, etc., and the merchant ID. It is understandable that after the server generates the account transfer request, it can send the account transfer request to the user's client to display its content.
[0132] In a possible embodiment, the merchant's terminal device sends the user's account ID, consumption type, consumption amount, merchant ID, etc. to the user's client through the server, and after the user enters the payment password and confirms, the user's client obtains the account transfer request. The account transfer request may include the user's account ID, consumption type, consumption amount, payment password, etc., and the merchant ID.
[0133] Figure 6 This is a schematic diagram of the interface for users to pay directly to the merchant account in the embodiment of the present application. The merchant only provides the merchant's own account ID to the user. The merchant does not have a QR code or a terminal device for scanning. The user needs to enter the merchant's account, consumption type, consumption amount, payment password, etc. into the client. After the user clicks the "OK" virtual button, the client obtains an account transfer request, which may include the user's account ID, consumption type, consumption amount, payment password, etc., as well as the merchant account ID.
[0134] In actual applications, the client can also obtain the account transfer request through other methods, which will not be described in detail here.
[0135] In other embodiments, the client or server may obtain an account transfer request including an account identifier and a consumption type, which is similar to the aforementioned embodiment and will not be described in detail here.
[0136] In other embodiments, the client or server may obtain an account transfer request including an account identifier and location information, wherein the method for obtaining the account identifier is similar to the aforementioned embodiment and will not be repeated here.
[0137] In the embodiment of the present application, the client or server can obtain the location information based on the radio communication network (such as the global system for mobile communications network, the code division multiple access digital cellular system network) or the external positioning method (such as the global positioning system), wherein the global system for mobile communications (global system for mobile communications, GSM) can be called the second generation (2G) mobile phone system, the code division multiple access (code division multiple access, CDMA) communication system network is a mobile phone system, and the global positioning system (global positioning system, GPS) is a system that provides positioning services. In actual applications, the client or server can also obtain the location information of the client through other methods, which are not specifically limited here.
[0138] 202. According to the account transfer request, the consumption authority is determined through the smart contract, and the consumption authority has a corresponding relationship with the account identifier;
[0139] In the embodiment of the present application, the consumption authority includes but is not limited to at least one of a consumption limit corresponding to a consumption type, a consumption type restriction condition corresponding to an account identifier, and a location information restriction condition corresponding to an account identifier;
[0140] In some embodiments, the client or server determines the consumption limit corresponding to the consumption type through a smart contract, as described below:
[0141] In the embodiment of the present application, the smart contract is pre-set by the user in the blockchain, such as Figure 7 As shown, smart contracts generally include account identification, consumption type, and consumption limit. Figure 7 This is a schematic diagram of a smart contract in an embodiment of the present application. It can be seen that a smart contract may include multiple consumption types, such as consumption type 1 and consumption type 2, which correspond to different consumption limits. For example, the consumption limit for food expenses in account A may be 100, and the consumption limit for transportation expenses in account A may be 200.
[0142] After the terminal device receives the account transfer request, it can find the corresponding consumption limit from the smart contract according to the account transfer request. For example, if the account identifier in the account transfer request is account A and the consumption type is transportation consumption, it can be found from the smart contract that the consumption limit for transportation consumption in account A is 200 according to the account identifier and the consumption type.
[0143] In other embodiments, the client or server determines the consumption type restriction condition corresponding to the account identifier through a smart contract, as described below:
[0144] In the embodiment of the present application, the smart contract is set by the user in advance in the blockchain, and the smart contract may include the consumption type restriction condition corresponding to the account identifier. In some embodiments, parents can set the consumption type restriction condition corresponding to their children's accounts in the smart contract as the allowed consumption types including food expenses, school supplies or snacks. Then when the children use their accounts to consume, the consumption type restriction condition corresponding to the account can be determined by the smart contract, and compared with the current consumption type. If the current consumption type meets the consumption type restriction condition, the consumption can be completed. For example, the current consumption type of the account is food expenses, and the client or server determines that the food expenses belong to one of the consumption type restrictions (including food expenses, school supplies or snacks), then the consumption can be completed. For another example, the current consumption type of the account is live broadcast reward, and the client or server determines that the food expenses do not belong to one of the consumption type restrictions (including food expenses, school supplies or snacks), then the consumption is not completed. In other embodiments, parents can set the consumption type restriction condition corresponding to their children's accounts in the smart contract as prohibited consumption types including watching pornographic films, live broadcast rewards, etc. When the child uses his account to make a purchase, if the current consumption type of the account is food expenses, which does not belong to the prohibited consumption types of the consumption type restriction conditions, the consumption can be completed; if the current consumption type of the account is live broadcast rewards, which belongs to the prohibited consumption types of the consumption type restriction conditions, the consumption will not be completed. In other embodiments, the consumption type restriction conditions include both permitted consumption types and prohibited consumption types, and the consumption process is similar to the above embodiments, which will not be repeated here.
[0145] In other embodiments, the client or server determines the location information restriction condition corresponding to the account identifier through a smart contract, as described below:
[0146] In the embodiment of the present application, the smart contract is pre-set by the user in the blockchain, and the smart contract may include the location information restriction condition corresponding to the account identifier. In some embodiments, the user sets the location information restriction condition including the allowed location information. For example, the allowed location information may include but is not limited to department stores, restaurants, etc. When the user consumes, the user's current location information may be compared with the allowed location information. If the current location information belongs to the allowed location information, consumption can be performed. For example, if the current location information is a restaurant, and the allowed location information includes a restaurant, consumption can be performed. In other embodiments, the user sets the location information restriction condition including prohibited location information. For example, the prohibited location information may include but is not limited to casino areas, pornographic places, etc. When the user consumes, the user's current location information may be compared with the prohibited location information. If the current location information belongs to the prohibited location information, consumption cannot be performed. For example, if the current location information is a casino area, and the prohibited location information includes a casino area, consumption cannot be performed. In other embodiments, the user sets the location information restriction condition including both allowed location information and prohibited location information. The consumption process is similar to the aforementioned embodiment and will not be repeated here. 203. If the account transfer request satisfies the consumption authority, the account transfer request is synchronized through the blockchain.
[0147] In the embodiment of the present application, the account transfer request meeting the consumption authority may include but is not limited to the consumption amount corresponding to the consumption type being less than or equal to the consumption limit corresponding to the consumption type, the consumption type meeting the consumption type restriction condition corresponding to the account identifier, and the location information meeting the location information restriction condition corresponding to the account identifier. In actual applications, other judgment conditions may also be included, which are not specifically limited here.
[0148] In some embodiments, after the terminal device determines the consumption limit, the consumption amount in the account transfer request can be compared with the consumption limit. If the consumption amount is less than or equal to the consumption limit, the account transfer request is synchronized through the blockchain.
[0149] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. With the development of blockchain technology, blockchain technology has been widely used in various fields, such as finance, information security, computing resource sharing, entertainment games, social networking, supply chain management or medical fields.
[0150] In the blockchain, each organization jointly maintains a blockchain ledger. For ease of introduction, please refer to Figure 8 , Figure 8 is a network topology diagram of a distributed blockchain ledger in an embodiment of the present application, such as Figure 8As shown, a distributed ledger is a database that is shared, replicated, and synchronized among network members. Distributed ledgers record transactions between network participants, such as the exchange of assets or data. This shared ledger reduces the time and expense costs of mediating different ledgers. The network members involved in this application include but are not limited to producers, consumers, suppliers, partners, market makers, promoters, and other project stakeholders. The assets traded can be tangible physical assets (such as cars, houses, or strawberries) or intangible virtual assets (such as contracts, patents, and securities). The ownership and transfer of assets create value in the business network, and this process is called a transaction.
[0151] A distributed ledger is a database that is independently held and updated by each participant in a large network. The distribution is unique in that records are not communicated to individual node devices by a central authority, but are independently constructed and saved by each node device. That is, every node device on the network processes every transaction, draws its own conclusions, and then votes on these conclusions to determine that the majority of node devices agree with them. Once consensus is reached, the distributed blockchain ledger has been updated, and all node devices maintain the same copy of their own ledger. Figure 2 As shown, node device 1 shares the local ledger of node device 1 with other node devices (such as node device 2, node device 3, node device 4, node device 5 and node device 6), node device 2 shares the local ledger of node device 2 with other node devices (such as node device 1, node device 3, node device 4, node device 5 and node device 6), node device 3 shares the local ledger of node device 3 with other node devices (such as node device 1, node device 2, node device 4, node device 5 and node device 6), node device 5 shares the local ledger of node device 5 with other node devices (such as node device 1, node device 2, node device 3, node device 4 and node device 6), and node device 6 shares the local ledger of node device 6 with other node devices (such as node device 1, node device 2, node device 3, node device 4 and node device 5). At this point, node device 1, node device 2, node device 3, node device 4, node device 5 and node device 6 all maintain the same blockchain ledger, which includes data recorded by all node devices.
[0152] Based on Figure 8 The distributed blockchain ledger shown in the figure, users and merchants in this embodiment of the application can Figure 8The distributed blockchain ledger shown in the figure is used for transactions. Users and merchants have their own accounts, and users and merchants can write their accounts and the amounts in their accounts on the blockchain ledger.
[0153] Fig. 9 Schematic diagram of users, merchants and blockchain in the embodiment of this application. It can be seen that user 1, user 2, merchant 1, merchant 2, merchant 3, and merchant 4 are all connected to the blockchain, and they can synchronize the account transfer request to the blockchain. For example, user 1 transfers money with merchant 1, and the content of the account transfer request is that user 1 transfers 10 yuan of food expenses to merchant 1. Then user 1 and merchant 1 upload the account transfer request to the blockchain through the client. After the blockchain reaches a consensus through the consensus mechanism, the account transfer request is written to the blockchain account book, that is, the transfer of 10 yuan of food expenses from user 1 to merchant 1 is written on the blockchain account book, then the result can be obtained that user 1's account is reduced by 10 yuan, and merchant 1's account is increased by 10 yuan.
[0154] After the terminal device synchronizes the account transfer request through the blockchain, the account transfer record corresponding to the account transfer request is added to the blockchain ledger, such as Fig.10 shown. Fig.10 This is a schematic diagram of a blockchain ledger in an embodiment of the present application. The blockchain ledger includes records corresponding to several account identifiers. Fig.10 Only some of the parameters are shown, from Fig.10 It can be seen that the user deposited 100 yuan into account ID 1, and the corresponding consumption type is food expenses, indicating that the 100 yuan deposit is used for food expenses. Account ID 1 transferred 100 yuan to merchant ID 1 in the consumption type of food expenses, and account ID 1 transferred 5 yuan to merchant ID 2 in the consumption type of transportation. The terminal device can read blockchain ledger records similar to the above from the blockchain ledger, and then count the consumption records of account ID 1's outward transfers based on these blockchain ledger records. Fig.11 This is a consumption record diagram of account ID 1 in the embodiment of the present application. It can be seen that the terminal device obtains that account ID 1 has spent 100 yuan on the consumption type of food expenses according to the blockchain account book, and account ID 1 has spent 5 yuan on the consumption type of transportation. Similarly, the terminal device can also count other situations of the account according to the blockchain account book, which will not be described in detail here. Optionally, in the embodiment of the present application, Figure 2 In an optional embodiment of a corresponding consumption processing method, before obtaining an account transfer request, the method also includes: obtaining a deposit request, the deposit request including an account identifier, a consumption type, and a deposit amount; determining a smart contract based on the account identifier, the consumption type, and the deposit amount; and synchronizing the deposit request and the smart contract to the blockchain.
[0155] In the embodiment of the present application, the terminal device first deposits money into the account and then makes consumption. The deposit method can be that the user inputs a deposit request, such as Fig.12 As shown, Fig.12 This is a schematic diagram of the user deposit interface in the embodiment of the present application. The user fills in the account ID and deposit amount on the interface of the terminal device, and can also fill in the consumption type to limit the purpose of the deposit amount. For example, if the consumption type filled in is food expenses and the deposit amount is 100 yuan, then the 100 yuan deposited in this deposit can be limited to food expenses. Then, the user selects the bank card for payment and enters the bank password, and clicks the "OK" virtual button to generate a deposit request. After the terminal device obtains the deposit request, it can determine the smart contract based on the account ID, consumption type and deposit amount in the deposit request, where the deposit amount and the consumption limit are associated. For example, the deposit amount of account ID 1 in the deposit request is 100 yuan, and the consumption type is specified as food expenses, then the consumption limit of food expenses for account ID 1 added in the smart contract is increased by 100 yuan.
[0156] In a possible embodiment, the user may use a third-party payment software to make a deposit instead of a bank card. The deposit method is similar and will not be described in detail here.
[0157] In a possible embodiment, a user can use account A to deposit money into account B. For example, a parent uses his or her own account to deposit money into a child's account to limit the consumption type and consumption limit of the child's account. Fig.13 This is a schematic diagram of a parent depositing money into a child's account in an embodiment of the present application. It can be seen that the parent first fills in the child's account ID in the account ID, then fills in the consumption type and deposit amount, and finally selects their own account for payment, enters the payment password, and clicks the "OK" virtual button, then the terminal device can obtain the corresponding deposit request. After the terminal device obtains the deposit request, it can determine the smart contract based on the account ID, consumption type, and deposit amount in the deposit request.
[0158] After the terminal device receives the deposit request and the smart contract, it synchronizes the deposit request and the smart contract to the blockchain. The synchronization method is similar to the synchronization of account transfer requests in other embodiments of the present application, and will not be repeated here.
[0159] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, synchronizing a deposit request and a smart contract to a blockchain includes: synchronizing a deposit request to a blockchain; synchronizing a smart contract to a blockchain; wherein synchronizing a smart contract to a blockchain includes: encrypting the smart contract by a private key to obtain an encrypted smart contract; and synchronizing the encrypted smart contract to a blockchain.
[0160] In the embodiment of the present application, the terminal device first encrypts the smart contract with a private key, and then synchronizes the encrypted smart contract to the blockchain. It is understandable that the encrypted smart contract is more secure and not easy to be stolen. When the terminal device needs to use the smart contract in the blockchain, it can be decrypted by a private key or a public key, which is not limited here.
[0161] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, after determining the consumption limit through a smart contract according to the account identifier and the consumption type in the account transfer request, the method further includes:
[0162] If the consumption amount is greater than the consumption limit, a prompt message is generated to indicate that the transfer has failed.
[0163] In the embodiment of the present application, if the user exceeds the limit when spending, the transfer cannot be made, and the terminal device will prompt that the transfer has failed. Fig.14 This is a schematic diagram of the terminal device prompting a transfer failure in the embodiment of the present application. It can be seen that the user inputs the account transfer information to the terminal device. After the terminal device obtains the account transfer request, the corresponding consumption limit is determined through the smart contract. When the terminal device detects that the consumption amount is greater than the consumption limit, a prompt message is generated, so that the terminal device displays "transfer failed" on the interface. For example, the user is preparing to transfer 200 yuan to the restaurant, and the corresponding consumption type is food expenses. In the smart contract, the consumption limit of the account under food expenses is only 100 yuan. The consumption amount is greater than the consumption limit, so that the terminal device cannot complete the transfer and prompts that the transfer failed. The user can click the "OK" virtual button on the terminal device interface to close the prompt message.
[0164] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, after requesting a transfer to a blockchain synchronization account, the method further includes:
[0165] The updated consumption limit is determined based on the consumption limit and the consumption amount.
[0166] In the embodiment of the present application, after the user transfers money for consumption, the terminal device can update the consumption limit in the smart contract according to the transfer consumption. Specifically, the consumption limit can be subtracted from the consumption amount to obtain the updated consumption limit. Figure 7 and Fig.15 As shown, Fig.15This is a schematic diagram of the updated smart contract in the embodiment of the present application. It can be seen that the original account's consumption limit in consumption type 1 is X. After the user spends Y yuan in consumption type 1, the terminal device determines that the updated consumption limit of consumption type 1 is XY based on the consumption limit and the consumption amount. As the user continues to consume on this consumption type, the consumption limit continues to decrease until the consumption limit is used up or the user makes another deposit. For example, if a user deposits money into his or her account every other month for food expenses, when the user eats every day, the consumption limit in the smart contract decreases every day according to the amount of food consumption by the user.
[0167] Similarly, when a user deposits money for himself, if there is a consumption limit in the corresponding consumption type, the terminal device adds the amount specified when the deposit is made to the consumption limit. For example, the original consumption limit of the account in consumption type 1 is X. The user deposits Y yuan into the account and specifies that the consumption type corresponding to the amount is consumption type 1. The terminal device determines the updated consumption limit of consumption type 1 as X+Y based on the consumption limit and the consumption amount.
[0168] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, the method further includes:
[0169] A reminder message is generated based on the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0170] In an embodiment of the present application, if a user needs to view the consumption limit that he or she plans to use for a certain consumption type, the terminal device can display the consumption type and the consumption limit. Fig.16 This is an interface diagram of a terminal device displaying a consumption plan in an embodiment of the present application. It can be seen that the terminal device can display the user's account identification and consumption type, and display the consumption limit corresponding to the consumption type. The user can intuitively see his or her consumption plan. For example, if the user plans to use 1,000 yuan of food expenses per month, he or she can use Fig.16 interface to view.
[0171] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, determining the consumption limit through a smart contract according to the account identifier and the consumption type in the account transfer request includes:
[0172] Obtain historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0173] The consumption limit is determined through a smart contract based on the account ID, consumption type, and historical consumption records in the account transfer request.
[0174] In the embodiment of the present application, the terminal device can first obtain the historical consumption record corresponding to the account identifier in the process of determining the smart contract, and then determine the consumption limit through the smart contract according to the account identifier in the account transfer request, the consumption type and the historical consumption record obtained by the terminal device. For example, all historical consumption records in account identifier 1 are that the user deposits 100 yuan to account identifier 1, and the corresponding consumption type is food expenses, indicating that the 100 yuan deposit is used for food expenses, account identifier 1 transfers 20 yuan to merchant identifier 1 in the consumption type of food expenses, and account identifier 1 transfers 30 yuan to merchant identifier 2 in the consumption type of food expenses. Then, based on these historical consumption records, the terminal device can determine that the account identifier 1 first deposited 100 yuan in the consumption type of food expenses, then consumed 20 yuan, and then consumed 30 yuan. It can be determined that the consumption limit of account identifier 1 in the consumption type of food expenses is 100-20-30=50 yuan.
[0175] Based on Figure 1 The architecture shown in the figure, the embodiment of the present application also provides a method for consumption processing, such as Fig.17 As shown, Fig.17 A flowchart of a consumption processing method provided in an embodiment of the present application, which is suitable for implementation in a scenario where a user shops online, includes:
[0176] 1701. Obtain an account transfer request, where the account transfer request includes an account identifier, a consumption type, and a consumption amount corresponding to the consumption type;
[0177] In the embodiment of the present application, when a user is shopping online, if he / she is ready to purchase the goods in the shopping cart, he / she can enter the corresponding payment interface, such as Fig.18 As shown, Fig.18 This is a schematic diagram of the payment interface of the terminal device in the embodiment of the present application. It can be seen that the consumption type of commodity 1 and the corresponding consumption amount are displayed on the terminal device. The consumption amount is the price of commodity 1 / the discounted price, which is used to indicate how much money is used to purchase commodity 1 in this consumption. If there are other commodities in the shopping cart, such as commodity 2 and commodity 3, they are all displayed one by one on the payment interface. After the user selects the payment account and enters the payment password, he can click the "OK" virtual button so that the terminal device obtains the account transfer request. In a possible embodiment, the user can purchase directly without putting the commodity into the shopping cart and enter the payment interface. The payment interface then only displays the consumption type and consumption amount of commodity 1.
[0178] In a possible embodiment, the user does not need to manually input the consumption type of the product. Instead, the terminal device automatically finds the consumption type corresponding to the product based on the product identification of the product. Specifically, the consumption type corresponding to the product is found based on the association between the consumption type of the product and the product identification. Table 2 is a table of associations between product identifications and consumption types in the embodiment of the present application. As shown in Table 2, the consumption type corresponding to the cake is meal expenses, and the consumption type corresponding to the toothbrush is daily necessities consumption. In actual applications, several associations can also be set. These associations can be pre-set and stored in the terminal device or the server of the e-commerce platform.
[0179] Table 2
[0180] Product identification Consumption Type cake Meal expenses toothbrush Daily necessities consumption … …
[0181] In the embodiment of the present application, the terminal device for online shopping can be a mobile phone or a computer. In actual applications, it can also be a tablet or other device, which is not limited here.
[0182] 1702. According to the account identifier and the consumption type in the account transfer request, the consumption limit is determined through the smart contract, and the consumption limit is associated with the account identifier, and the consumption limit is associated with the consumption type;
[0183] In the embodiment of the present application, step 1702 is the same as the above Figure 2 Step 202 in each corresponding embodiment is similar and will not be described again here.
[0184] 1703. If the consumption amount is less than or equal to the consumption limit, the account transfer request is synchronized through the blockchain.
[0185] In an embodiment of the present application, the account transfer request includes the transfer of multiple commodities, wherein the consumption types of the multiple commodities may be the same. For example, the consumption type of commodity 1 is the same as the consumption type of commodity 2, and the terminal device adds the consumption amount of commodity 1 to the consumption amount of commodity 2 as the consumption amount of the consumption type. For example, if a user buys cake and ice cream, both of which belong to the consumption type of food expenses, the terminal device can determine the consumption amount corresponding to the consumption type as the consumption amount of cake plus the consumption amount of ice cream according to the commodity. Then, the terminal device compares the consumption amount corresponding to the consumption type after statistics with the consumption limit. If the consumption amount is less than or equal to the consumption limit, the terminal device synchronizes the account transfer request through the blockchain.
[0186] The details of the terminal device's synchronization of account transfer requests through the blockchain are the same as above. Figure 2 Step 203 in each corresponding embodiment is similar and will not be described again here.
[0187] Optionally, in the embodiment of the present application Fig.17 In an optional embodiment of a corresponding consumption processing method, before obtaining an account transfer request, the method also includes: obtaining a deposit request, the deposit request including an account identifier, a consumption type, and a deposit amount; determining a smart contract based on the account identifier, the consumption type, and the deposit amount; and synchronizing the deposit request and the smart contract to the blockchain.
[0188] Optionally, in the embodiment of the present application Fig.17 In an optional embodiment of a corresponding consumption processing method, synchronizing a deposit request and a smart contract to a blockchain includes: synchronizing a deposit request to a blockchain; synchronizing a smart contract to a blockchain; wherein synchronizing a smart contract to a blockchain includes: encrypting the smart contract by a private key to obtain an encrypted smart contract; and synchronizing the encrypted smart contract to a blockchain.
[0189] In the embodiment of the present application, the steps of the terminal device performing deposit and private key encryption are the same as those described above. Figure 2 The corresponding embodiments are similar and will not be described again here.
[0190] Optionally, in the embodiment of the present application Fig.17 In an optional embodiment of a corresponding consumption processing method, after determining the consumption limit through a smart contract according to the account identifier and the consumption type in the account transfer request, the method further includes:
[0191] If the consumption amount is greater than the consumption limit, a prompt message is generated to indicate that the transfer has failed.
[0192] In the embodiment of the present application, the terminal device prompts that the transfer failed. Figure 2 The corresponding embodiments are similar and will not be described again here.
[0193] Optionally, in the embodiment of the present application Fig.17 In an optional embodiment of a corresponding consumption processing method, after requesting a transfer to a blockchain synchronization account, the method further includes:
[0194] The updated consumption limit is determined based on the consumption limit and the consumption amount.
[0195] In the embodiment of the present application, the situation where the terminal device updates the consumption limit is the same as the above Figure 2 The corresponding embodiments are similar and will not be described again here.
[0196] Optionally, in the embodiment of the present application Fig.17 In an optional embodiment of a corresponding consumption processing method, the method further includes:
[0197] A reminder message is generated based on the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0198] In the embodiment of the present application, the terminal device displays the consumption limit in the same manner as described above. Figure 2 The corresponding embodiments are similar and will not be described again here.
[0199] Optionally, in the embodiment of the present application Figure 2 In an optional embodiment of a corresponding consumption processing method, determining the consumption limit through a smart contract according to the account identifier and the consumption type in the account transfer request includes:
[0200] Obtain historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0201] The consumption limit is determined through a smart contract based on the account ID, consumption type, and historical consumption records in the account transfer request.
[0202] In the embodiment of the present application, the situation where the terminal device determines the consumption limit is the same as the above Figure 2 The corresponding embodiments are similar and will not be described again here.
[0203] In a possible embodiment, the user connects to the server through a terminal device. After the terminal device generates an account transfer request, it sends the account transfer request to the server. After receiving the account transfer request, the server executes the following steps: Figure 2 or Fig.17 The corresponding methods of various embodiments: The user's terminal device only needs to generate and send an account transfer request, which reduces the burden on the user's terminal device, and the server can manage the account transfer status of each terminal device.
[0204] Fig.19 FIG. 1 is a schematic diagram of an application example of a consumption processing method. It can be seen that in this application example, the terminal device signs a smart contract in advance. The smart contract and Figure 7 The corresponding descriptions are similar and will not be repeated here. After the terminal device signs the smart contract, it will synchronize the smart contract to the blockchain.
[0205] When a user needs to consume, the user consumes. The terminal device generates an account transfer request and obtains the smart contract and historical consumption of the account from the network. The terminal device then determines the consumption limit based on the smart contract and historical consumption, and further determines whether the current payment behavior satisfies the smart contract, that is, whether the account transfer request satisfies the smart contract. If so, the payment is successful and the data is synchronized to the blockchain. If not, the payment fails. The terminal device can prompt the payment failure information on the interface, such as Fig.14 shown.
[0206] Fig. 20This is a schematic diagram of a consumption processing device provided in an embodiment of the present application. It can be seen that a consumption processing device 2000 provided in an embodiment of the present application includes:
[0207] An acquisition unit 2001 is used to acquire an account transfer request, where the account transfer request includes an account identifier, and the account transfer request also includes at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0208] The processing unit 2002 is used to determine the consumption authority through the smart contract according to the account transfer request, and the consumption authority has a corresponding relationship with the account identifier;
[0209] The processing unit 2002 is also used to synchronize the account transfer request through the blockchain if the account transfer request meets the consumption authority.
[0210] Optionally, in the embodiment of the present application Fig. 20 In an optional embodiment of a corresponding consumption processing device, a deposit unit 2003 is also included, such as Fig.21 As shown, Fig.21 Another schematic diagram of a consumption processing device provided in an embodiment of the present application, wherein the deposit unit 2003 is used for:
[0211] Get a deposit request, which includes account ID, consumption type, and deposit amount;
[0212] Determine the smart contract based on the account ID, consumption type and deposit amount;
[0213] Sync deposit request and smart contract to blockchain.
[0214] Optionally, in the embodiment of the present application Fig.21 In an optional embodiment of a corresponding consumption processing device, the deposit unit 2003 is further used for:
[0215] Synchronize deposit request to blockchain;
[0216] Synchronize smart contracts to the blockchain;
[0217] Among them, synchronizing smart contracts to the blockchain includes:
[0218] Encrypt the smart contract with the private key to obtain the encrypted smart contract;
[0219] Synchronize the encrypted smart contract to the blockchain.
[0220] Optionally, in the embodiment of the present application Fig. 20 In an optional embodiment of a corresponding consumption processing device, the processing unit 2002 is further used for:
[0221] If the consumption amount is greater than the consumption limit, a prompt message is generated to indicate that the transfer has failed.
[0222] Optionally, in the embodiment of the present application Fig. 20 In an optional embodiment of a corresponding consumption processing device, the processing unit 2002 is further used for:
[0223] The updated consumption limit is determined based on the consumption limit and the consumption amount.
[0224] Optionally, in the embodiment of the present application Fig. 20 In an optional embodiment of a corresponding consumption processing device, the processing unit 2002 is further used for:
[0225] A reminder message is generated based on the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0226] Optionally, in the embodiment of the present application Fig. 20 In an optional embodiment of a corresponding consumption processing device, the processing unit 2002 is further used for:
[0227] Obtain historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0228] The consumption limit is determined through a smart contract based on the account ID, consumption type, and historical consumption records in the account transfer request.
[0229] The embodiment of the present application further provides a node device, which may be a terminal device or a server. The following is a detailed description of the case where the node device is a terminal device:
[0230] The present application embodiment also provides another consumption processing device, such as Fig. 22 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a car computer, etc., taking the mobile phone as an example:
[0231] Fig. 22 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal provided in an embodiment of the present application. Fig. 22The mobile phone includes: a radio frequency (RF) circuit 2210, a memory 2220, an input unit 2230, a display unit 2240, a sensor 2250, an audio circuit 2260, a wireless fidelity (WiFi) module 2270, a processor 2280, and a power supply 2290. Those skilled in the art will appreciate that Fig. 22 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0232] Combine the following Fig. 22 A detailed introduction to the various components of the mobile phone:
[0233] The RF circuit 2210 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 2280 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 2210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 2210 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
[0234] The memory 2220 can be used to store software programs and modules. The processor 2280 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 2220. The memory 2220 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 2220 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0235] The input unit 2230 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 2230 may include a touch panel 2231 and other input devices 2232. The touch panel 2231, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 2231 or near the touch panel 2231 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 2231 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 2280, and can receive and execute commands sent by the processor 2280. In addition, the touch panel 2231 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 2231, the input unit 2230 may also include other input devices 2232. Specifically, the other input devices 2232 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0236] The display unit 2240 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 2240 may include a display panel 2241. Optionally, the display panel 2241 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 2231 may cover the display panel 2241. When the touch panel 2231 detects a touch operation on or near it, it is transmitted to the processor 2280 to determine the type of touch event. Subsequently, the processor 2280 provides a corresponding visual output on the display panel 2241 according to the type of touch event. Although in Fig. 22 In the embodiment, the touch panel 2231 and the display panel 2241 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 2231 and the display panel 2241 can be integrated to realize the input and output functions of the mobile phone.
[0237] The mobile phone may also include at least one sensor 2250, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 2241 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 2241 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0238] The audio circuit 2260, the speaker 2261, and the microphone 2262 can provide an audio interface between the user and the mobile phone. The audio circuit 2260 can transmit the received audio data to the speaker 2261 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 2262 converts the collected sound signal into an electrical signal, which is received by the audio circuit 2260 and converted into audio data, and then the audio data is output to the processor 2280 for processing, and then sent to another mobile phone through the RF circuit 2210, or the audio data is output to the memory 2220 for further processing.
[0239] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 2270. It provides users with wireless broadband Internet access. Fig. 22 A WiFi module 2270 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0240] The processor 2280 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 2220 and calling data stored in the memory 2220. Optionally, the processor 2280 may include one or more processing units; optionally, the processor 2280 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 2280.
[0241] The mobile phone also includes a power supply 2290 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 2280 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0242] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0243] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0244] Obtaining an account transfer request, the account transfer request including an account identifier, and the account transfer request also including at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0245] According to the account transfer request, the consumption authority is determined through the smart contract, and the consumption authority has a corresponding relationship with the account identification;
[0246] If the account transfer request meets the consumption authority, the account transfer request is synchronized through the blockchain;
[0247] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0248] Get a deposit request, which includes account ID, consumption type, and deposit amount;
[0249] Determine the smart contract based on the account ID, consumption type and deposit amount;
[0250] Sync deposit request and smart contract to blockchain.
[0251] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0252] Synchronize deposit request to blockchain;
[0253] Synchronize smart contracts to the blockchain;
[0254] Among them, synchronizing smart contracts to the blockchain includes:
[0255] Encrypt the smart contract with the private key to obtain the encrypted smart contract;
[0256] Synchronize the encrypted smart contract to the blockchain.
[0257] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0258] If the consumption amount is greater than the consumption limit, a prompt message is generated to indicate that the transfer has failed.
[0259] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0260] The updated consumption limit is determined based on the consumption limit and the consumption amount.
[0261] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0262] A reminder message is generated based on the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0263] In the embodiment of the present application, the processor 2280 included in the terminal also has the following functions:
[0264] Obtain historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0265] The consumption limit is determined through a smart contract based on the account ID, consumption type, and historical consumption records in the account transfer request.
[0266] The following describes in detail the case where the node device is a server:
[0267] Fig.2323 is a schematic diagram of a server structure provided in an embodiment of the present application. The server 2300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 2322 (for example, one or more processors) and memory 2332, and one or more storage media 2330 (for example, one or more mass storage devices) storing application programs 2342 or data 2344. Among them, the memory 2332 and the storage medium 2330 may be temporary storage or permanent storage. The program stored in the storage medium 2330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 2322 may be configured to communicate with the storage medium 2330 to execute a series of instruction operations in the storage medium 2330 on the server 2300.
[0268] The server 2300 may also include one or more power supplies 2326, one or more wired or wireless network interfaces 2350, one or more input and output interfaces 2358, and / or one or more operating systems 2341, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM etc.
[0269] The steps performed by the server in the above embodiment can be based on the Fig.23 The server structure shown.
[0270] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0271] Obtaining an account transfer request, the account transfer request including an account identifier, and the account transfer request also including at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information;
[0272] According to the account transfer request, the consumption authority is determined through the smart contract, and the consumption authority has a corresponding relationship with the account identification;
[0273] If the account transfer request meets the consumption authority, the account transfer request is synchronized through the blockchain;
[0274] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0275] Get a deposit request, which includes account ID, consumption type, and deposit amount;
[0276] Determine the smart contract based on the account ID, consumption type and deposit amount;
[0277] Sync deposit request and smart contract to blockchain.
[0278] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0279] Synchronize deposit request to blockchain;
[0280] Synchronize smart contracts to the blockchain;
[0281] Among them, synchronizing smart contracts to the blockchain includes:
[0282] Encrypt the smart contract with the private key to obtain the encrypted smart contract;
[0283] Synchronize the encrypted smart contract to the blockchain.
[0284] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0285] If the consumption amount is greater than the consumption limit, a prompt message is generated to indicate that the transfer has failed.
[0286] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0287] The updated consumption limit is determined based on the consumption limit and the consumption amount.
[0288] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0289] A reminder message is generated based on the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
[0290] In the embodiment of the present application, the central processor 2322 may further perform the following steps:
[0291] Obtain historical consumption records according to the account identifier in the account transfer request, where the historical consumption records are associated with the account identifier;
[0292] The consumption limit is determined through a smart contract based on the account ID, consumption type, and historical consumption records in the account transfer request.
[0293] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0294] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0295] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0296] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0297] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable 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 method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
Claims
1. A method of consumption processing, characterized in that: include: Obtaining a deposit request, wherein the deposit request includes an account identifier, a consumption type, and a deposit amount; Determine a smart contract according to the account identifier, consumption type and deposit amount in the deposit request; the consumption type in the smart contract is used to limit the purpose of the deposit amount; the deposit amount is used to increase the consumption limit of the account identifier in the smart contract under the consumption type; Synchronizing the deposit request and the smart contract to the blockchain; Both the user terminal and the merchant terminal are connected to the blockchain and conduct transactions based on the blockchain; Obtaining an account transfer request, the account transfer request including the account identifier and the merchant identifier, the account transfer request also including at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information; the consumption type in the account transfer request is determined according to an association between the merchant identifier and the consumption type; According to the account transfer request, the consumption authority is determined through a smart contract, specifically including: obtaining historical consumption records according to the account identifier in the account transfer request, and the historical consumption records are associated with the account identifier; according to the account identifier, consumption type and historical consumption records in the account transfer request, determining the consumption limit corresponding to the consumption type in the account transfer request through a smart contract, and the consumption authority is in a corresponding relationship with the account identifier; the consumption authority includes at least one of the consumption limit corresponding to the consumption type, the consumption type restriction condition corresponding to the account identifier and the location information restriction condition corresponding to the account identifier; the smart contract includes multiple consumption types, and the multiple consumption types correspond to different consumption limits; the consumption type restriction condition includes allowed consumption types; the location information restriction condition includes allowed location information for consumption; Acquire the consumption type, the consumption amount corresponding to the consumption type, and the location information in the account transfer request according to the account transfer request; If the consumption type in the account transfer request satisfies the consumption type restriction condition corresponding to the account identifier, the consumption amount corresponding to the consumption type in the account transfer request is less than or equal to the consumption limit corresponding to the consumption type in the account transfer request, and the location information in the account transfer request satisfies the location information restriction condition corresponding to the account identifier, then it is determined that the account transfer request satisfies the consumption authority; otherwise, it is determined that the account transfer request does not satisfy the consumption authority, wherein the consumption type restriction condition corresponding to the account identifier, the consumption limit corresponding to the consumption type, and the location information restriction condition corresponding to the account identifier are all determined by the smart contract; If the account transfer request satisfies the consumption authority, the account transfer request uploaded by the user terminal and the merchant terminal is obtained through the blockchain, and after the blockchain reaches a consensus through a consensus mechanism, the account transfer request is synchronized on the blockchain, and the consumption limit in the updated smart contract is determined according to the consumption limit and the consumption amount.
2. The method according to claim 1, characterized in that The synchronizing the deposit request and the smart contract to the blockchain includes: Synchronizing the deposit request to the blockchain; Synchronizing the smart contract to the blockchain; Wherein, synchronizing the smart contract to the blockchain includes: Encrypt the smart contract using a private key to obtain the encrypted smart contract; The encrypted smart contract is synchronized to the blockchain.
3. The method according to claim 1, characterized in that: After determining the consumption authority through a smart contract according to the account transfer request, the method further includes: If the consumption amount is greater than the consumption limit, a prompt message is generated, and the prompt message is used to prompt that the transfer fails.
4. The method according to claim 1, characterized in that: The method further comprises: A reminder message is generated according to the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
5. A consumption processing device, characterized in that: include: A deposit unit, used to obtain a deposit request, wherein the deposit request includes an account identifier, a consumption type, and a deposit amount; Determine a smart contract according to the account identifier, consumption type and deposit amount in the deposit request; the consumption type in the smart contract is used to limit the purpose of the deposit amount; the deposit amount is used to increase the consumption limit of the account identifier in the smart contract under the consumption type; synchronize the deposit request and the smart contract to the blockchain; both the user terminal and the merchant terminal are connected to the blockchain, and transactions are conducted based on the blockchain; an acquisition unit, configured to acquire an account transfer request, wherein the account transfer request includes the account identifier and the merchant identifier, and the account transfer request also includes at least one of a consumption type, a consumption amount corresponding to the consumption type, and location information; the consumption type in the account transfer request is determined according to an association between the merchant identifier and the consumption type; A processing unit, configured to determine consumption authority through a smart contract according to the account transfer request, specifically comprising: obtaining historical consumption records according to the account identifier in the account transfer request, wherein the historical consumption records are associated with the account identifier; determining a consumption limit corresponding to the consumption type in the account transfer request through a smart contract according to the account identifier, the consumption type and the historical consumption records in the account transfer request, wherein the consumption authority is associated with the account identifier; the consumption authority comprises at least one of a consumption limit corresponding to the consumption type, a consumption type restriction condition corresponding to the account identifier and a location information restriction condition corresponding to the account identifier; the smart contract comprises a plurality of consumption types, and the plurality of consumption types correspond to different consumption limits; the consumption type restriction condition comprises permitted consumption types; and the location information restriction condition comprises permitted location information for consumption; The processing unit is further configured to obtain, according to the account transfer request, a consumption type, a consumption amount corresponding to the consumption type, and location information in the account transfer request; if the consumption type in the account transfer request satisfies the consumption type restriction condition corresponding to the account identifier, the consumption amount corresponding to the consumption type in the account transfer request is less than or equal to the consumption limit corresponding to the consumption type, and the location information in the account transfer request satisfies the location information restriction condition corresponding to the account identifier, then it is determined that the account transfer request satisfies the consumption authority; otherwise, it is determined that the account transfer request does not satisfy the consumption authority, wherein the consumption type restriction condition corresponding to the account identifier, the consumption limit corresponding to the consumption type, and the location information restriction condition corresponding to the account identifier are all determined by the smart contract; The processing unit is further configured to obtain, through the blockchain, the account transfer request uploaded by the user terminal and the merchant terminal if the account transfer request satisfies the consumption authority, and synchronize the account transfer request on the blockchain after the blockchain reaches a consensus through a consensus mechanism, and determine the consumption limit in the updated smart contract according to the consumption limit and the consumption amount.
6. The device according to claim 5, characterized in that The deposit unit is also used for: Synchronizing the deposit request to the blockchain; Synchronizing the smart contract to the blockchain; Wherein, synchronizing the smart contract to the blockchain includes: Encrypt the smart contract using a private key to obtain the encrypted smart contract; The encrypted smart contract is synchronized to the blockchain.
7. The device according to claim 5, characterized in that The processing unit is further used for: If the consumption amount is greater than the consumption limit, a prompt message is generated, and the prompt message is used to prompt that the transfer fails.
8. The device according to claim 5, characterized in that The processing unit is further used for: A reminder message is generated according to the consumption limit in the smart contract, and the reminder message is used to display the consumption limit.
9. A node device, characterized in that: include: memories, transceivers, processors, and bus systems; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory to perform the method according to any one of claims 1 to 4; The bus system is used to connect the memory and the processor so that the memory and the processor can communicate with each other.
10. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computer, cause the computer to perform the method according to any one of claims 1 to 4.
