A blockchain-based resource allocation method, applied to a blockchain network that comprises a target user client terminal of a target user and a first node device, wherein the method is a computer-implemented method executed on the first node device, the first node device including a storage and a processor, wherein the storage stores a computer program that when run by the processor performs operations comprising: obtaining, by the first node device in the blockchain network, a target transaction from a distributed database of the blockchain network, wherein the target transaction comprises service behavior data of the target user generated at the target user client terminal, and the service behavior data of the target user is generated by the target user client terminal by using a target service provided by the first node device in the blockchain network; and invoking, by the first node device, a smart contract corresponding to a resource allocation of a resource, wherein the smart contract is deployed on the blockchain network through consensus and verification performed by node devices of the blockchain network, wherein the consensus on the smart contract includes a consensus on resource allocation logic that is declared in the smart contract, wherein the invoking of the smart contract comprises: executing the resource allocation logic that is stored in the smart contract and that is related to the service behavior data of the target user, verifying an execution result of the invoking the smart contract for the resource allocation, wherein the verifying is based on a consensus between the nodes of the blockchain network, in response to verifying the execution result, recording the execution result in the distributed database of the blockchain network, recording the service behavior data of the target user in the distributed database of the blockchain network, and transferring the resource to the target user, wherein an amount of the resource corresponds to the service behavior data. obtaining, by the first node device in the blockchain network, a target transaction from a distributed database of the blockchain network, wherein the target transaction comprises service behavior data of the target user generated at the target user client terminal, and the service behavior data of the target user is generated by the target user client terminal by using a target service provided by the first node device in the blockchain network; and invoking, by the first node device, a smart contract corresponding to a resource allocation of a resource, wherein the smart contract is deployed on the blockchain network through consensus and verification performed by node devices of the blockchain network, wherein the consensus on the smart contract includes a consensus on resource allocation logic that is declared in the smart contract, wherein the invoking of the smart contract comprises: executing the resource allocation logic that is stored in the smart contract and that is related to the service behavior data of the target user, verifying an execution result of the invoking the smart contract for the resource allocation, wherein the verifying is based on a consensus between the nodes of the blockchain network, in response to verifying the execution result, recording the execution result in the distributed database of the blockchain network, recording the service behavior data of the target user in the distributed database of the blockchain network, and transferring the resource to the target user, wherein an amount of the resource corresponds to the service behavior data. executing the resource allocation logic that is stored in the smart contract and that is related to the service behavior data of the target user, verifying an execution result of the invoking the smart contract for the resource allocation, wherein the verifying is based on a consensus between the nodes of the blockchain network, in response to verifying the execution result, recording the execution result in the distributed database of the blockchain network, recording the service behavior data of the target user in the distributed database of the blockchain network, and transferring the resource to the target user, wherein an amount of the resource corresponds to the service behavior data.