Resource processing method and apparatus, computer device, and storage medium
By storing resources in blockchain smart contracts and performing identity authentication and status comparison, the cumbersome auditing of transaction funds by intermediaries is solved, thereby improving the security and efficiency of resource transactions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHAOLIAN CONSUMER FINANCE CO LTD
- Filing Date
- 2022-11-11
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, the review process for transaction funds by intermediary institutions is cumbersome, resulting in low product transaction efficiency and a lack of effective security guarantees.
By storing the original resources in smart contracts on the blockchain, and using smart contracts for identity authentication and status information comparison, the security and legality of resource transfer are ensured, reducing the intervention of third-party regulatory authorities.
It has improved the security and efficiency of resource transactions, simplified the review process, and enhanced the overall efficiency of product transactions.
Smart Images

Figure CN115936701B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular to a resource processing method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With rapid economic development, a wide variety of products are emerging, and transactions between these products are becoming more frequent. To facilitate these transactions, save time for both parties, and improve efficiency, intermediary agencies have emerged. To enhance transaction security, prevent intermediaries from defrauding buyers, and protect the interests of both parties, these intermediary agencies need to be regulated.
[0003] In related technologies, third-party regulatory bodies require intermediaries to deposit transaction funds in banks. When an intermediary needs access to these funds, it applies to the bank for verification of its information. However, this verification process is overly cumbersome, reducing transaction efficiency.
[0004] Therefore, how to improve the trading efficiency of products while ensuring the security of transaction funds has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] Therefore, it is necessary to provide a resource processing method, apparatus, computer equipment, and storage medium that can improve transaction security and efficiency in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a blockchain-based resource processing method. The method includes:
[0007] The preset original attribute information is stored in the smart contract. The original resources requested by the product demand direction from the resource provider are extracted from the original attribute information, and the original resources are transferred from the resource provider's corresponding resource provider account to the smart contract for storage.
[0008] Obtain the first status information of the intermediary provided by the product demander;
[0009] In response to a resource transfer request from the resource transfer initiator, the initiator is authenticated, and the current timestamp is recorded.
[0010] If the identity authentication is successful, and the resource transfer initiator is the intermediary, the target attribute information of the intermediary is obtained;
[0011] The comparison results are obtained by comparing the target attribute information, the current timestamp, and the original attribute information.
[0012] When the comparison result indicates that resource transfer is allowed, and the first state information of the intermediary is in a normal state, the first target resource is transferred from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information, and the original resource and the target attribute information are updated.
[0013] In one embodiment, the method further includes:
[0014] When the first state information is an abnormal state, the actual state of the intermediate party is determined to obtain the second state information;
[0015] If the second status information is the normal status, it is determined that the product demander has engaged in improper behavior, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary account according to the original attribute information;
[0016] The original resources after the transfer of the second target resource will be transferred to the resource provider's account.
[0017] In one embodiment, the method further includes:
[0018] If the second status information is the abnormal status, it is determined that the intermediary has engaged in improper behavior, and the original resources stored in the smart contract are transferred to the resource provider's account.
[0019] In one embodiment, the method further includes:
[0020] If the identity authentication fails, the resource transfer request from the initiator of the resource transfer is rejected.
[0021] In one embodiment, the method further includes:
[0022] If the resource transfer initiator is the product demander, the start timestamp is extracted from the original attribute information;
[0023] If the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, then the second target resource is transferred from the original resource stored in the smart contract to the intermediary account.
[0024] If the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold, then the second target resource is transferred from the original resource stored in the smart contract to the resource provider's account.
[0025] In one embodiment, the comparison result includes a first comparison result indicating that the resource transfer is permitted and a second comparison result indicating that the resource transfer is rejected;
[0026] The step of comparing the target attribute information, the current timestamp, and the original attribute information to obtain a comparison result includes:
[0027] The number of resource transfers is extracted from the target attribute information;
[0028] The transfer timestamp and preset number of transfers are extracted from the original attribute information;
[0029] If the current timestamp is greater than or equal to the transfer timestamp, and the number of resource transfers is less than the preset number of transfers, the first comparison result is obtained;
[0030] If the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, the second comparison result is obtained.
[0031] In one embodiment, the target attribute information includes the number of resource transfers;
[0032] The updating of the original resource and the target attribute information includes:
[0033] Obtain the resource difference between the original resource and the first target resource, and use the resource difference as the updated original resource;
[0034] Modify the number of resource transfers.
[0035] Secondly, this application also provides a blockchain-based resource processing device. The device includes:
[0036] The information storage module is used to store preset original attribute information in a smart contract, extract the original resources requested by the product demand direction from the resource provider from the original attribute information, and transfer the original resources from the resource provider's corresponding resource provider account to the smart contract for storage.
[0037] The status information acquisition module is used to acquire the status information of the intermediary sent by the product demander;
[0038] The identity authentication module is used to respond to the resource transfer request from the resource transfer initiator, authenticate the identity of the resource transfer initiator, and record the current timestamp;
[0039] The attribute information acquisition module is used to acquire the target attribute information of the intermediary when the resource transfer initiator is the intermediary, provided that the identity authentication is successful.
[0040] The comparison module is used to compare the target attribute information, the current timestamp, and the original attribute information to obtain a comparison result.
[0041] The resource transfer module is used to transfer the first target resource from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information when the comparison result indicates that resource transfer is allowed and the status information is normal, and to update the original resource and the target attribute information.
[0042] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the blockchain-based resource processing method described in the first aspect embodiment.
[0043] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the blockchain-based resource processing method described in the first aspect embodiment.
[0044] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the blockchain-based resource processing method described in the first aspect embodiment.
[0045] The aforementioned resource processing method, apparatus, computer equipment, and storage medium ensure the security of the original resources by storing them in a blockchain smart contract. Furthermore, by acquiring the status information of the intermediary sent by the product demander, it determines whether the intermediary is fraudulently obtaining resources. Only when the intermediary's status is normal and resource transfer is permitted, is the first target resource transferred from the original resources stored in the smart contract to the corresponding intermediary account based on the original attribute information. This further enhances resource security. Moreover, it ensures transaction security without the need for additional third-party regulatory intervention, reduces cumbersome review processes, improves review efficiency, and ultimately enhances product transaction efficiency. Attached Figure Description
[0046] Figure 1 This is a schematic diagram of the first process of a blockchain-based resource processing method in one embodiment;
[0047] Figure 2 This is a schematic diagram of the second process of a blockchain-based resource processing method in one embodiment;
[0048] Figure 3This is a schematic diagram of the third process of a blockchain-based resource processing method in one embodiment;
[0049] Figure 4 This is a flowchart illustrating the steps and methods for determining a comparison result in one embodiment;
[0050] Figure 5 This is a flowchart illustrating the steps of updating original resource and target attribute information in one embodiment;
[0051] Figure 6 This is a structural block diagram of a blockchain-based resource processing device in one embodiment;
[0052] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] In one embodiment, such as Figure 1 As shown, a blockchain-based resource processing method is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. The terminal can be, but is not limited to, a personal computer, laptop, or smartphone. The server can be a standalone server or a server cluster consisting of multiple servers.
[0055] In this embodiment, the method includes the following steps:
[0056] Step 102: Store the preset original attribute information in the smart contract, extract the original resources requested by the resource provider from the product demand direction from the original attribute information, and transfer the original resources from the resource provider's corresponding resource provider account to the smart contract for storage.
[0057] The original attribute information can refer to pre-defined attribute information. This original attribute information may include, but is not limited to, the product's start and end dates for borrowing, the collateral resources for borrowing the product, the time of each resource transfer, the number of resource transfers, the amount of resources transferred each time, and the original resources that the product requester needs to borrow from the resource provider.
[0058] The product demander can refer to the entity that needs to borrow the product.
[0059] A resource provider can refer to an entity possessing sufficient resources. This resource provider can lend resources to product demanders, enabling them to utilize these resources for product procurement. This resource provider can be, but is not limited to, banks, financial companies, and other financial institutions.
[0060] An intermediary can refer to an entity that helps a product provider to lend out its products.
[0061] It should be noted that the product demanders, resource providers, and intermediaries are all nodes that have completed node registration on the blockchain.
[0062] A smart contract can be defined as a computer protocol that transmits, verifies, or executes contracts in an informational manner. A smart contract is a special protocol used when creating contracts within a blockchain, containing built-in functions. This smart contract can interact with other contracts, make decisions, store data, and complete transactions. The smart contract is provided by a resource provider and deployed on the blockchain.
[0063] In one embodiment, the original resources are the product of the amount of resources transferred each time and the number of resource transfers, plus the total collateral resources of the borrowed products.
[0064] For example, the original attribute information agreed upon by the product demander and the intermediary is first stored in a smart contract. Then, the original resources requested by the product demander from the resource provider are extracted from the original attribute information, and the original resources are transferred from the resource provider's corresponding resource provider account to the smart contract for storage.
[0065] Prior to step 102, the blockchain-based resource processing method also includes, but is not limited to, the following steps: obtaining resource borrowing requests initiated by product demanders, and extracting original attribute information and the address information of the intermediary in the smart contract from the resource borrowing requests; determining the corresponding intermediary based on the intermediary address information.
[0066] A resource borrowing request refers to an information initiated by a product requester to a resource provider, indicating a request for resource borrowing. When a product requester needs to borrow a product from an intermediary but its current resources are insufficient, it can initiate a resource borrowing request to the resource provider, so that the resource provider can lend resources to the product requester, thereby realizing the borrowing of the product.
[0067] For example, when the demand side of a product is a tenant and the intermediary is a rental agency, if the tenant needs to rent long-term (e.g., for a year) to reduce monthly rent, the tenant needs to pay the rent to the rental agency in one lump sum. However, if the tenant does not have sufficient funds, they can request a loan from a bank, lending company, or other financial institution to make the long-term rental possible. In this case, the tenant initiates a resource borrowing request to the financial institution so that the institution can lend the rent (including monthly rent and security deposit) to the tenant. However, for the security of the rent, the financial institution will not directly give the entire rent to the tenant or the rental agency, but will store the rent in a smart contract.
[0068] Address information can refer to the node address information of the intermediary in the blockchain.
[0069] For example, a server or terminal that deploys a smart contract can obtain a resource borrowing request initiated by the product demander, extract the original attribute information and the address information of the intermediary in the smart contract from the resource borrowing request, and then determine the corresponding intermediary based on the intermediary address information.
[0070] Step 104: Obtain the first status information of the intermediary provided by the product demander.
[0071] The first state information refers to the information input into the smart contract by the product requester. By obtaining the first state information of the intermediary provided by the product requester, the interests of the product requester can be protected when the intermediary engages in improper behavior.
[0072] For example, the product requester sets the state of the intermediary in the relevant functions of the smart contract, so that the smart contract can maintain the state of the intermediary or change the state of the intermediary. The terminal obtains the first state information of the intermediary from the smart contract.
[0073] Step 106: In response to the resource transfer request from the resource transfer initiator, authenticate the resource transfer initiator and record the current timestamp.
[0074] In this context, the resource transfer initiator can refer to the party that initiates the resource transfer. This initiator can be either the product requester or an intermediary. When the product requester needs to terminate the product's borrowing, the resource transfer initiator can be the product requester. Similarly, when an intermediary wants to extract resources from a smart contract, the corresponding resource transfer initiator can be the intermediary.
[0075] The current timestamp can refer to the time when the resource transfer initiator initiated the resource transfer request.
[0076] For example, when a resource transfer request is received from the resource initiator, the initiator is authenticated based on the resource transfer request, and the current timestamp is recorded.
[0077] In one embodiment, the smart contract encrypts and stores the identity information of the product requester and the intermediary. When the resource initiator initiates a resource transfer request, the smart contract authenticates the resource initiator based on the stored identity information (the product requester's identity information and the intermediary's identity information), obtaining an authentication result. This authentication result includes the resource initiator's identity (whether the resource initiator is the product requester, the intermediary, or another third party), and whether the authentication passed.
[0078] Step 108: If the identity authentication is successful, and the resource transfer initiator is an intermediary, obtain the target attribute information of the intermediary.
[0079] The target attribute information can refer to pre-defined information related to the intermediary. This target attribute information is stored in a smart contract.
[0080] For example, if the identity of the resource transfer initiator is successfully authenticated, when the resource transfer initiator is identified as an intermediary, the target attribute information of the intermediary is obtained from the smart contract.
[0081] Step 110: Compare the target attribute information, the current timestamp, and the original attribute information to obtain the comparison result.
[0082] For example, the smart contract's target attribute information, current timestamp, and original attribute information are compared to obtain a comparison result, in order to determine whether to transfer resources to the intermediary.
[0083] Step 112: When the comparison result indicates that resource transfer is allowed, and the first state information of the intermediary is in a normal state, the first target resource is transferred from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information, and the original resource and target attribute information are updated.
[0084] Among them, the first status information is the normal status, which can be used to indicate that the product demander recognizes that the intermediary has not engaged in any improper behavior.
[0085] The primary target resource can refer to the amount of resources transferred from the original resource to the intermediary when resource transfer to the intermediary is permitted. This primary target resource can be the product rental fee payable each time. For example, the primary target resource can be the monthly rental fee or the quarterly rental fee.
[0086] For example, when the comparison result indicates that resource transfer is allowed and the first state information is in a normal state, the smart contract transfers the first target resource from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information, and updates it based on the original resource and the target attribute information.
[0087] Let's take the application of blockchain-based resource processing methods in the rental housing scenario as an example. When a rental agency lowers the average monthly rent but requires tenants to pay a large sum of money upfront for six months or a year, the tenant may not have enough available funds. However, because this method is very profitable, the tenant can borrow from financial institutions such as lending companies to pay the long-term rent and security deposit. However, to prevent rental agencies from absconding or engaging in other improper practices and to protect the tenant's interests, the aforementioned blockchain-based resource processing method can be used for rent payment.
[0088] In this application scenario, the product demander can be a tenant, the intermediary can be a rental agency, and the resource provider can be a financial institution such as a bank or lending company. The smart contract is provided and deployed by the financial institution. Tenants, rental agencies, etc., all complete node registration on the smart contract and possess their own identity information, address information, and account information. Original attribute information can refer to pre-agreed information, which may include, but is not limited to, the start and end dates of the rental, the monthly rent (or quarterly rent), the security deposit, the date of monthly rent payment (or quarterly rent payment), the number of rent payments, and the amount borrowed by the tenant from the financial institution (original resources, which can be the sum of the security deposit and rent, with the rent being the total rental cost), etc.
[0089] The system stores pre-agreed original attribute information in a smart contract deployed by the financial institution. Then, it extracts the original resources requested by the tenant from the financial institution from this information and transfers these resources from the financial institution's corresponding resource provider account to the smart contract for storage. It also obtains the first-state information of the rental agency provided by the tenant to determine if the tenant believes the agency is engaging in fraudulent activities such as absconding with funds. Upon receiving a resource transfer request from the initiator, the system responds by authenticating the initiator and recording the current timestamp. If the initiator's authentication is successful, and the initiator is indeed a rental agency, it obtains the intermediary's target attribute information, which may include, but is not limited to, the number of completed resource transfers. Then, the target attribute information, the current timestamp, and the original attribute information are compared to obtain the comparison result. When the comparison result indicates that the resource transfer is allowed, it means that the time for the rental agency to collect rent each month may have arrived. At this time, it is determined whether the rental agency's first state information is in a normal state. If the rental agency's first state information is in a normal state, the rent is transferred from the original resources stored in the smart contract to the rental agency's corresponding intermediary account according to the original attribute information, and the remaining original resources and target attribute information are updated.
[0090] The blockchain-based resource processing method in this application ensures the security of original resources by storing them in a smart contract on the blockchain. It also obtains the status information of the intermediary sent by the product demander to determine if the intermediary is fraudulently obtaining resources. Only when the intermediary's status is normal and resource transfer is permitted, is the first target resource transferred from the original resources stored in the smart contract to the corresponding intermediary account based on the original attribute information. This further enhances resource security. Furthermore, it ensures transaction security without the need for additional third-party regulatory intervention, reduces cumbersome review processes, improves review efficiency, and ultimately increases product transaction efficiency.
[0091] Please see Figure 2 In some embodiments, the blockchain-based resource processing method further includes, but is not limited to, the following steps:
[0092] Step 202: When the first state information is an abnormal state, determine the actual state of the intermediate party to obtain the second state information.
[0093] The second status information is the actual status of the intermediary determined by the smart contract based on other information. This other information is unrelated to the product demander. For example, this other information may be at least one of the following: status information of the intermediary provided by other product demanders, complaint information proactively submitted by the intermediary, or information determined by the smart contract based on actual investigation.
[0094] For example, when the first status information about the intermediary provided by the product demander is an abnormal state, that is, the product demander believes that the intermediary has engaged in improper behavior, the actual state of the intermediary is determined based on other information to obtain the second status information, so as to determine whether the intermediary has actually engaged in improper behavior.
[0095] Step 204: If the second status information is normal, it is determined that the product demander has engaged in improper behavior, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary account based on the original attribute information.
[0096] Step 206: Transfer the original resources after transferring the second target resource to the resource provider's account.
[0097] For example, when the second status information of the intermediary is determined to be normal, it indicates that the product demander is acting maliciously, that is, the product demander has engaged in improper behavior. At this time, the cooperation relationship between the product demander and the intermediary is terminated, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary's account according to the original attribute information. The original resource after the transfer of the second target resource is then transferred to the resource provider's account.
[0098] The technical solution of this application embodiment determines the actual state of the intermediary to obtain the second state information when the first state information is an abnormal state, which can prevent the product demander from acting maliciously and thus protect the interests of the intermediary.
[0099] For example, in a real-world rental scenario, when a tenant believes that a rental agent has engaged in improper conduct, the smart contract determines the actual state of the rental agent and obtains second state information. If the second state information indicates a normal state, it means that the rental agent has not engaged in improper conduct, but the tenant has engaged in improper conduct (such as attempting to rent a short-term apartment at a low rent that would normally be required for a one-year lease). In this case, based on the original attribute information, the second target resource (deposit) is transferred from the original resources stored in the smart contract to the intermediary account corresponding to the rental agent, and the remaining original resources are transferred to the resource provider's account.
[0100] In some embodiments, the blockchain-based resource processing method further includes the following steps: if the second state information is an abnormal state, it is determined that the intermediary has engaged in improper behavior, and the original resources stored in the smart contract are transferred to the resource party's account.
[0101] Specifically, when the second status information is in an abnormal state, it indicates that the product demander has not engaged in any improper behavior, but the intermediary has. In this case, the cooperation relationship between the intermediary and the product demander is terminated, the original resources stored in the smart contract are transferred to the resource provider's account, and the intermediary's resource transfer request is rejected to protect the interests of the product demander.
[0102] For example, in real-world rental scenarios, when the second state information is in an abnormal state, it indicates that the rental agent has indeed engaged in improper behavior. In this case, the original resources stored in the smart contract are transferred to the resource provider's account, and the rental agent's resource transfer request is rejected to protect the tenant's interests.
[0103] In some embodiments, a blockchain-based resource processing method includes, but is not limited to, the following steps: if identity authentication fails, reject the resource transfer request from the resource transfer initiator.
[0104] Specifically, if the authentication of the resource transfer initiator fails based on the pre-stored identity information, it indicates that the resource transfer initiator does not have the authority to transfer resources. In this case, the resource transfer request from the resource transfer initiator is rejected.
[0105] like Figure 3 As shown, in some embodiments, the blockchain-based resource processing method further includes, but is not limited to, the following steps:
[0106] Step 302: If the resource transfer initiator is the product demander, extract the start timestamp from the original attribute information.
[0107] The start timestamp can refer to the time when the product begins to be seconded. For example, in a rental scenario, the start timestamp can refer to the start date of the rental.
[0108] For example, when the resource transfer initiator is the product demander, the product demander may want to retrieve a second target resource from the original resource. In this case, the start timestamp is extracted from the original attribute information.
[0109] Step 304: If the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, then transfer the second target resource from the original resource stored in the smart contract to the intermediary account.
[0110] The preset timestamp threshold can refer to a pre-set timestamp threshold. This preset timestamp threshold can refer to the time interval of product borrowing, or it can refer to the duration agreed upon by the product requester and the intermediary for returning the second target resource. For example, in a rental application scenario, this preset timestamp threshold can refer to the lease term of the house, or it can refer to the lease term agreed upon by the tenant and the intermediary for the return of the deposit.
[0111] For example, if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, it means that the agreed time for returning the second target resource has not yet arrived. At this time, it can be determined that the product demander has breached the contract, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary's account to protect the interests of the intermediary.
[0112] Step 306: If the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold, then transfer the second target resource from the original resource stored in the smart contract to the resource provider's account.
[0113] For example, when the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold, it indicates that the time for returning the second target resource has arrived. At this time, the second target resource is transferred from the original resource to the resource provider's account.
[0114] Please see Figure 4 In some embodiments, the comparison result includes a first comparison result indicating that the resource transfer is permitted and a second comparison result indicating that the resource transfer is rejected. Step 110 includes, but is not limited to, the following steps:
[0115] Step 402: Extract the number of resource transfers from the target attribute information.
[0116] The number of resource transfers can refer to the number of times the primary target resource has been transferred. For example, in a rental application scenario, the number of resource transfers can refer to the number of times rent has been paid.
[0117] For example, target attribute information is stored as a state variable related to the intermediary in the smart contract, and this state variable carries the number of resource transfers. The target attribute information is extracted to obtain the number of resource transfers.
[0118] Step 404: Extract the transfer timestamp and preset number of transfers from the original attribute information.
[0119] The preset number of transfers can refer to the pre-defined number of times the primary target resource will be transferred. This preset number of transfers can be the number of times the primary target resource is transferred as agreed upon by the product demander and the intermediary. For example, in a rental application scenario, the preset number of transfers can refer to the pre-defined number of times rent will be paid.
[0120] A transfer timestamp can refer to the time when the first target resource is transferred each time. For example, in a rental application scenario, the transfer timestamp can refer to the time when rent is paid each time, such as the 1st of each month.
[0121] Step 406: If the current timestamp is greater than or equal to the transfer timestamp, and the number of resource transfers is less than the preset number of transfers, the first comparison result is obtained.
[0122] For example, if the current timestamp is greater than or equal to the transfer timestamp, it means that the time when the intermediary initiated the resource transfer request was before the agreed transfer timestamp. If the number of resource transfers is less than the preset number of transfers, it means that the intermediary has the authority to request resource transfer. In this case, the comparison result is the first comparison result that allows resource transfer.
[0123] Step 408: If the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, a second comparison result is obtained.
[0124] For example, if the current timestamp is less than the preset timestamp, it means that the time when the intermediary initiated the resource transfer request has not yet reached the agreed timestamp. When the number of resource transfers is greater than or equal to the preset number of transfers, it means that the first target resource has been completely transferred, and the intermediary no longer has the authority to request resource transfer. Therefore, if the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, the comparison result is the second comparison result of rejecting the resource transfer.
[0125] Please see Figure 5 In some embodiments, the target attribute information includes the number of resource transfers, and step 112 includes, but is not limited to, the following steps:
[0126] Step 502: Obtain the resource difference between the original resource and the first target resource, and use the resource difference as the updated original resource.
[0127] Step 504: Modify the number of resource transfers.
[0128] Specifically, in this embodiment, after the first target resource is transferred, the resource difference between the original resource and the first target resource is obtained to calculate the remaining original resource. The resource difference is used as the updated original resource to update the original resource. The resource transfer count is then incremented by 1 to update the resource transfer count.
[0129] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0130] Based on the same inventive concept, this application also provides a blockchain-based resource processing apparatus for implementing the aforementioned blockchain-based resource processing method. The solution provided by this apparatus is similar to the implementation scheme described in the above-described method.
[0131] In one embodiment, such as Figure 6 As shown, a blockchain-based resource processing device is provided, comprising: an information storage module 602, a status information acquisition module 604, an identity authentication module 606, an attribute information acquisition module 608, a comparison module 610, and a resource transfer module 612, wherein:
[0132] The information storage module 602 is used to store preset original attribute information in a smart contract, extract the original resources requested by the resource provider from the product demand direction from the original attribute information, and transfer the original resources from the resource provider's corresponding resource provider account to the smart contract for storage.
[0133] The status information acquisition module 604 is used to acquire the status information sent by the product demander to the intermediary.
[0134] The identity authentication module 606 is used to respond to the resource transfer request from the resource transfer initiator, authenticate the identity of the resource transfer initiator, and record the current timestamp.
[0135] The attribute information acquisition module 608 is used to acquire the target attribute information of the intermediary when the resource transfer initiator is an intermediary, provided that the identity authentication is successful.
[0136] The comparison module 610 is used to compare the target attribute information, the current timestamp, and the original attribute information to obtain the comparison result.
[0137] The resource transfer module 612 is used to transfer the first target resource from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information when the comparison result indicates that resource transfer is allowed and the status information is normal, and to update the original resource and target attribute information.
[0138] In some embodiments, the blockchain-based resource transfer method further includes, but is not limited to:
[0139] The second state information determination module is used to determine the actual state of the intermediate party and obtain the second state information when the first state information is an abnormal state.
[0140] The second target resource transfer module is used to determine that the product demander has engaged in improper behavior if the second status information is normal, and to transfer the second target resource from the original resource stored in the smart contract to the intermediary account based on the original attribute information.
[0141] The first original resource transfer module is used to transfer the original resources after transferring the second target resource to the resource party's account.
[0142] In some embodiments, the blockchain-based resource processing apparatus further includes:
[0143] The second original resource transfer module is used to determine that the intermediary has engaged in improper behavior if the second status information is an abnormal state, and to transfer the original resources stored in the smart contract to the resource party's account.
[0144] In some embodiments, the blockchain-based resource processing apparatus further includes:
[0145] The rejection module is used to reject the resource transfer request from the initiator if the identity authentication fails.
[0146] In some embodiments, the blockchain-based resource processing apparatus further includes:
[0147] The Start Timestamp Extraction Module is used to extract the start timestamp from the original attribute information when the resource transfer initiator is the product demander.
[0148] The first judgment module is used to transfer the second target resource from the original resource stored in the smart contract to the intermediary account if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold.
[0149] The second judgment module is used to transfer the second target resource from the original resource stored in the smart contract to the resource party's account if the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold.
[0150] In some embodiments, the comparison module 610 includes:
[0151] The resource transfer count extraction module is used to extract the resource transfer count from the target attribute information.
[0152] The original attribute extraction module is used to extract the transfer timestamp and preset number of transfers from the original attribute information.
[0153] The first comparison module is used to obtain the first comparison result if the current timestamp is greater than or equal to the transfer timestamp and the number of resource transfers is less than the preset number of transfers.
[0154] The second comparison module is used to obtain a second comparison result if the current timestamp is less than the preset timestamp or the number of resource transfers is greater than or equal to the preset number of transfers.
[0155] In some embodiments, the resource transfer module 612 includes:
[0156] The original resource update module is used to obtain the resource difference between the original resource and the first target resource, and use the resource difference as the updated original resource.
[0157] The resource transfer count modification module is used to modify the resource transfer count.
[0158] The modules in the aforementioned blockchain-based resource processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can invoke and execute the operations corresponding to each module.
[0159] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores information such as raw attribute information, target attribute information, product demander identity information, and intermediary identity information. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a blockchain-based resource processing method.
[0160] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: storing preset original attribute information in a smart contract; extracting the original resources requested by the product demander from the resource provider from the original attribute information, and transferring the original resources from the resource provider's corresponding resource account to the smart contract for storage; obtaining the first status information of the intermediary provided by the product demander; in response to the resource transfer request from the resource transfer initiator, authenticating the resource transfer initiator and recording the current timestamp; if the authentication is successful, when the resource transfer initiator is an intermediary, obtaining the intermediary's target attribute information; comparing the target attribute information, the current timestamp, and the original attribute information to obtain a comparison result; when the comparison result indicates that the resource transfer is allowed, and the intermediary's first status information is in a normal state, transferring the first target resource from the original resources stored in the smart contract to the intermediary's corresponding intermediary account according to the original attribute information, and updating the original resources and target attribute information.
[0162] In one embodiment, when the processor executes the computer program, it further performs the following steps: when the first state information is an abnormal state, it determines the actual state of the intermediary to obtain the second state information; if the second state information is a normal state, it determines that the product demander has engaged in improper behavior, and transfers the second target resource from the original resource stored in the smart contract to the intermediary's account based on the original attribute information; and transfers the original resource after transferring the second target resource to the resource provider's account.
[0163] In one embodiment, when the processor executes the computer program, it further performs the following steps: if the second state information is an abnormal state, it determines that the intermediary has engaged in improper behavior and transfers the original resources stored in the smart contract to the resource party's account.
[0164] In one embodiment, when the processor executes the computer program, it further performs the following steps: if authentication fails, reject the resource transfer request from the resource transfer initiator.
[0165] In one embodiment, when the processor executes the computer program, it further performs the following steps: if the resource transfer initiator is the product demander, extract the start timestamp from the original attribute information; if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the intermediary account; if the difference between the current timestamp and the start timestamp is greater than or equal to the preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the resource provider account.
[0166] In one embodiment, when the processor executes the computer program, it further performs the following steps: extracting the number of resource transfers from the target attribute information; extracting the transfer timestamp and the preset number of transfers from the original attribute information; if the current timestamp is greater than or equal to the transfer timestamp and the number of resource transfers is less than the preset number of transfers, obtaining a first comparison result; if the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, obtaining a second comparison result.
[0167] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the resource difference between the original resource and the first target resource, and using the resource difference as the updated original resource; modifying the number of resource transfers.
[0168] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: storing preset original attribute information in a smart contract; extracting the original resources requested by the product demander from the resource provider from the original attribute information, and transferring the original resources from the resource provider's corresponding resource account to the smart contract for storage; obtaining the first status information of the intermediary provided by the product demander; in response to the resource transfer request from the resource transfer initiator, authenticating the resource transfer initiator and recording the current timestamp; if the authentication is successful, when the resource transfer initiator is an intermediary, obtaining the intermediary's target attribute information; comparing the target attribute information, the current timestamp, and the original attribute information to obtain a comparison result; when the comparison result indicates that the resource transfer is allowed, and the intermediary's first status information is in a normal state, transferring the first target resource from the original resources stored in the smart contract to the intermediary's corresponding intermediary account according to the original attribute information, and updating the original resources and target attribute information.
[0169] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the first state information is an abnormal state, the actual state of the intermediary is determined to obtain the second state information; if the second state information is a normal state, it is determined that the product demander has engaged in improper behavior, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary's account based on the original attribute information; the original resource after the transfer of the second target resource is transferred to the resource provider's account.
[0170] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the second state information is an abnormal state, it is determined that the intermediary has engaged in improper behavior, and the original resources stored in the smart contract are transferred to the resource party's account.
[0171] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if authentication fails, reject the resource transfer request from the resource transfer initiator.
[0172] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the resource transfer initiator is the product demander, extract the start timestamp from the original attribute information; if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the intermediary account; if the difference between the current timestamp and the start timestamp is greater than or equal to the preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the resource provider account.
[0173] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: extracting the number of resource transfers from the target attribute information; extracting the transfer timestamp and the preset number of transfers from the original attribute information; if the current timestamp is greater than or equal to the transfer timestamp and the number of resource transfers is less than the preset number of transfers, obtaining a first comparison result; if the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, obtaining a second comparison result.
[0174] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the resource difference between the original resource and the first target resource, and using the resource difference as the updated original resource; modifying the number of resource transfers.
[0175] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: storing preset original attribute information in a smart contract; extracting the original resources requested by the product demander from the resource provider from the original attribute information, and transferring the original resources from the resource provider's corresponding resource account to the smart contract for storage; obtaining the first status information of the intermediary provided by the product demander; in response to the resource transfer request from the resource transfer initiator, authenticating the resource transfer initiator and recording the current timestamp; if the authentication is successful, when the resource transfer initiator is an intermediary, obtaining the intermediary's target attribute information; comparing the target attribute information, the current timestamp, and the original attribute information to obtain a comparison result; when the comparison result indicates that resource transfer is allowed, and the intermediary's first status information is in a normal state, transferring the first target resource from the original resources stored in the smart contract to the intermediary's corresponding intermediary account according to the original attribute information, and updating the original resources and target attribute information.
[0176] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the first state information is an abnormal state, the actual state of the intermediary is determined to obtain the second state information; if the second state information is a normal state, it is determined that the product demander has engaged in improper behavior, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary's account based on the original attribute information; the original resource after the transfer of the second target resource is transferred to the resource provider's account.
[0177] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the second state information is an abnormal state, it is determined that the intermediary has engaged in improper behavior, and the original resources stored in the smart contract are transferred to the resource party's account.
[0178] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if authentication fails, reject the resource transfer request from the resource transfer initiator.
[0179] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: if the resource transfer initiator is the product demander, extract the start timestamp from the original attribute information; if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the intermediary account; if the difference between the current timestamp and the start timestamp is greater than or equal to the preset timestamp threshold, transfer the second target resource from the original resource stored in the smart contract to the resource provider account.
[0180] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: extracting the number of resource transfers from the target attribute information; extracting the transfer timestamp and the preset number of transfers from the original attribute information; if the current timestamp is greater than or equal to the transfer timestamp and the number of resource transfers is less than the preset number of transfers, obtaining a first comparison result; if the current timestamp is less than the preset timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, obtaining a second comparison result.
[0181] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the resource difference between the original resource and the first target resource, and using the resource difference as the updated original resource; modifying the number of resource transfers.
[0182] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0183] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A resource processing method based on blockchain, characterized in that, The method includes: The preset original attribute information is stored in a smart contract. The original resources requested by the product demander from the resource provider are extracted from the original attribute information, and the original resources are transferred from the resource provider's corresponding resource provider account to the smart contract for storage. The original attribute information includes the product's start borrowing time, the product's end borrowing time, the collateral resources for borrowing the product, the time of each resource transfer, the number of resource transfers, the amount of resources transferred each time, and the original resources that the product demander needs to borrow from the resource provider. Obtain the first status information of the intermediary provided by the product demander; In response to a resource transfer request from the resource transfer initiator, the initiator is authenticated, and the current timestamp is recorded. If the identity authentication is successful, and the resource transfer initiator is the intermediary, the target attribute information of the intermediary is obtained; The number of resource transfers is extracted from the target attribute information; The transfer timestamp and preset number of transfers are extracted from the original attribute information; If the current timestamp is greater than or equal to the transfer timestamp, and the number of resource transfers is less than the preset number of transfers, then a first comparison result indicating that resource transfer is allowed is obtained; If the current timestamp is less than the transfer timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers, then a second comparison result indicating rejection of the resource transfer is obtained; When the first comparison result is obtained and the first status information of the intermediary is in a normal state, the first target resource is transferred from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary according to the original attribute information, and the original resource and the target attribute information are updated. When the first state information is an abnormal state, the actual state of the intermediate party is determined to obtain the second state information; If the second status information is the abnormal status, it is determined that the intermediary has engaged in improper behavior, and the original resources stored in the smart contract are transferred to the resource provider's account; If the second status information is the normal status, it is determined that the product demander has engaged in improper behavior, and the second target resource is transferred from the original resource stored in the smart contract to the intermediary account according to the original attribute information; The original resources after the transfer of the second target resource will be transferred to the resource provider's account.
2. The method according to claim 1, characterized in that, The method further includes: If the identity authentication fails, the resource transfer request from the initiator of the resource transfer is rejected.
3. The method according to claim 1, characterized in that, The method further includes: If the resource transfer initiator is the product demander, the start timestamp is extracted from the original attribute information; If the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold, then the second target resource is transferred from the original resource stored in the smart contract to the intermediary account. If the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold, then the second target resource is transferred from the original resource stored in the smart contract to the resource provider's account.
4. The method according to any one of claims 1 to 3, characterized in that, The updating of the original resource and the target attribute information includes: Obtain the resource difference between the original resource and the first target resource, and use the resource difference as the updated original resource; Modify the number of resource transfers.
5. A blockchain-based resource processing device, characterized in that, The device includes: An information storage module is used to store preset original attribute information in a smart contract, extract the original resources requested by the product demander from the resource provider from the original attribute information, and transfer the original resources from the resource provider's corresponding resource provider account to the smart contract for storage; the original attribute information includes the product's start borrowing time, the product's end borrowing time, the collateral resources for borrowing the product, the time of each resource transfer, the number of resource transfers, the amount of resources transferred each time, and the original resources that the product demander needs to borrow from the resource provider; The status information acquisition module is used to acquire the first status information of the intermediary sent by the product demander; The identity authentication module is used to respond to the resource transfer request from the resource transfer initiator, authenticate the identity of the resource transfer initiator, and record the current timestamp; The attribute information acquisition module is used to acquire the target attribute information of the intermediary when the resource transfer initiator is the intermediary, provided that the identity authentication is successful. The resource transfer count extraction module is used to extract the resource transfer count from the target attribute information; The original attribute extraction module is used to extract the transfer timestamp and preset number of transfers from the original attribute information; The first comparison module is used to obtain a first comparison result indicating that resource transfer is allowed if the current timestamp is greater than or equal to the transfer timestamp and the number of resource transfers is less than the preset number of transfers. The second comparison module is used to obtain a second comparison result indicating rejection of resource transfer if the current timestamp is less than the transfer timestamp, or the number of resource transfers is greater than or equal to the preset number of transfers. The resource transfer module is used to transfer the first target resource from the original resource stored in the smart contract to the intermediary account corresponding to the intermediary based on the original attribute information when the first comparison result is obtained and the first status information is in a normal state, and to update the original resource and the target attribute information. The second state information determination module is used to determine the actual state of the intermediate party to obtain the second state information when the first state information is an abnormal state. The second original resource transfer module is used to determine that the intermediary has engaged in improper behavior if the second status information is the abnormal status, and to transfer the original resources stored in the smart contract to the resource party's account. The second target resource transfer module is used to determine that the product demander has engaged in improper behavior if the second status information is the normal status, and to transfer the second target resource from the original resource stored in the smart contract to the intermediary account according to the original attribute information. The first original resource transfer module is used to transfer the original resources after transferring the second target resource to the resource party's account.
6. The apparatus according to claim 5, characterized in that, The device further includes: The rejection module is used to reject the resource transfer request from the resource transfer initiator if the identity authentication fails.
7. The apparatus according to claim 5, characterized in that, The device further includes: The start timestamp extraction module is used to extract the start timestamp from the original attribute information when the resource transfer initiator is the product demander. The first judgment module is used to transfer the second target resource from the original resource stored in the smart contract to the intermediary account if the difference between the current timestamp and the start timestamp is less than a preset timestamp threshold. The second judgment module is used to transfer the second target resource from the original resource stored in the smart contract to the resource party account if the difference between the current timestamp and the start timestamp is greater than or equal to a preset timestamp threshold.
8. The apparatus according to any one of claims 5 to 7, characterized in that, The resource transfer module includes: The original resource update module is used to obtain the resource difference between the original resource and the first target resource, and use the resource difference as the updated original resource; The resource transfer count modification module is used to modify the resource transfer count.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.