A business processing method, device and storage medium based on blockchain
Through smart contracts, the resources of blockchain node devices are controlled and resource availability information is adjusted according to actual operation, which solves the problem of unbalanced resource occupation when blockchain node devices process business information for multiple accounts, and improves business information processing controllability and flexibility.
Patent Information
- Application Number
- CN201911071473.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-05
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2039-11-05
AI Technical Summary
When blockchain node devices process business information of multiple accounts, it is easy for a single account to occupy too much resources, resulting in lagging in the processing of business information of other accounts, affecting controllability and flexibility.
Through smart contracts, the operation resources of block node devices in the blockchain are controlled, and the resource available information of different accounts is adjusted according to the actual operation situation, and business information processing is optimized.
It avoids the use of too many resources by a single account, optimizes the use of business information processing resources for different accounts, and improves the controllability and flexibility of business information processing.
Smart Images

Figure CN110806941B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a business processing method, device and storage medium based on blockchain. Background Art
[0002] With the continuous development and improvement of computer technology, blockchain can now be used to complete a variety of business scenarios, such as information record storage, transactions, information query, etc. Since blockchain is decentralized and has the characteristics of being tamper-proof and traceable, information security can be guaranteed. However, as blockchain technology continues to become popular, the business information that needs to be processed by the block node devices in the blockchain is gradually increasing. When the block node devices need to process multiple business information of multiple accounts within a certain period of time, it is often easy to occupy more operating resources in the device due to the large amount of business information of a certain account, resulting in a delay in the processing of business information of other accounts, affecting the controllability and flexibility of business information processing. Summary of the invention
[0003] The embodiments of the present invention provide a blockchain-based business processing method, device and storage medium, which can optimize the use of operating resources for business information of different accounts, adjust the resource availability information of different accounts according to actual operating conditions, and improve the controllability of business information processing and the flexibility of management and control.
[0004] An embodiment of the present invention provides a blockchain-based business processing method, including:
[0005] Obtaining business information for a target account in the current operation cycle, where the target account is account information in the business blockchain;
[0006] Acquire historical resource usage information of the target account's operating resources in the current operating cycle;
[0007] Matching the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, wherein the resource availability information is the availability information of the operating resources of the target account in a single operating cycle;
[0008] The business information is processed based on the matching result.
[0009] The step of obtaining the historical resource usage information of the target account's operating resources in the current operating cycle includes:
[0010] Obtain the historical resource usage duration of the operating resources of the target account in the current operating cycle;
[0011] The historical resource usage duration is the duration of the operation resource being occupied when the historical business information of the target account is processed in the current operation cycle.
[0012] Wherein, matching the historical resource usage information with the resource availability information in the smart contract to obtain a matching result includes:
[0013] Based on the cycle duration of the current operation cycle and the resource availability information of the target account in the smart contract, obtain the resource availability duration of the target account;
[0014] Matching the historical resource usage duration with the resource available duration;
[0015] When the historical resource usage duration is less than the resource available duration, determining the matching result as executing the business processing of the target account;
[0016] When the historical resource usage duration is equal to the resource available duration, a matching result is determined to stop the business processing of the target account.
[0017] Wherein, the processing of the business information based on the matching result includes:
[0018] When the matching result is to execute the business processing of the target account, processing the business information;
[0019] When the matching result is to stop the business processing of the target account, the processing of the business information is stopped.
[0020] Wherein, when the matching result is to execute the business processing of the target account, processing the business information includes:
[0021] When the matching result is to execute the business processing of the target account, obtaining the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time, and processing the business information;
[0022] When the processing time for processing the business information is equal to the remaining available time and the business information has not been processed, the processing of the business information is stopped until the next operation cycle of the current operation cycle, the processing of the business information is executed again.
[0023] Wherein, when the matching result is to stop the business processing of the target account, stopping the processing of the business information includes:
[0024] When the matching result is to stop the business processing of the target account, the processing of the business information is stopped until the next operation cycle of the current operation cycle executes the processing of the business information.
[0025] An embodiment of the present invention provides a service processing device, including:
[0026] A business information acquisition unit, used to acquire business information for a target account in a current operation cycle, where the target account is account information in a business blockchain;
[0027] A resource information acquisition unit, used to acquire historical resource usage information of the operating resources of the target account in the current operating cycle;
[0028] A resource information matching unit, configured to match the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, wherein the resource availability information is the availability information of the operating resources of the target account within a single operating cycle;
[0029] An information processing unit is used to process the business information based on the matching result.
[0030] The resource information acquisition unit is specifically used to acquire the historical resource usage duration of the operating resources of the target account in the current operating cycle;
[0031] The historical resource usage duration is the duration of the operation resource being occupied when the historical business information of the target account is processed in the current operation cycle.
[0032] Wherein, the resource information matching unit includes:
[0033] An available duration acquisition subunit, used to acquire the resource available duration of the target account based on the cycle duration of the current operation cycle and the resource available information of the target account in the smart contract;
[0034] A duration matching unit, used to match the historical resource usage duration with the resource available duration;
[0035] A result determination subunit, configured to determine, when the historical resource usage duration is less than the resource available duration, that the matching result is to execute the business processing of the target account;
[0036] The result determination subunit is further configured to determine, when the historical resource usage duration is equal to the resource available duration, that the matching result is to stop the business processing of the target account.
[0037] Wherein, the information processing unit includes:
[0038] A first information processing subunit, configured to process the business information when the matching result is to execute the business process of the target account;
[0039] The second information processing subunit is used to stop processing the business information when the matching result is to stop the business processing of the target account.
[0040] The first information processing subunit is specifically configured to obtain the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time when the matching result is to execute the business processing of the target account, and process the business information;
[0041] When the processing time for processing the business information is equal to the remaining available time and the business information has not been processed, the processing of the business information is stopped until the next operation cycle of the current operation cycle, the processing of the business information is executed again.
[0042] The second information processing subunit is specifically configured to stop processing the business information when the matching result is to stop business processing of the target account, until the next operation cycle of the current operation cycle executes processing of the business information.
[0043] On one hand, an embodiment of the present invention provides a computer storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the above method steps are executed.
[0044] An embodiment of the present invention provides a computer device, including a processor, a memory, and an input and output interface;
[0045] The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used for page interaction, the memory is used for storing program code, and the processor is used for calling the program code to execute the above method steps.
[0046] The embodiment of the present invention uses smart contracts to control the operating resources of block node devices in the blockchain, and processes business information of different accounts according to the allocated resource availability information within a single operating cycle, thereby avoiding a single account from occupying more operating resources within a certain period of time, optimizing the use of operating resources for business information of different accounts, and improving the controllability of business information processing. At the same time, through the management and control of smart contracts, the resource availability information of different accounts can be adjusted according to the actual operating conditions, thereby improving the flexibility of the management and control of business information processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 is a system architecture diagram of the business processing provided by an embodiment of the present invention;
[0049] Figure 2 It is a schematic diagram of the blockchain construction provided by an embodiment of the present invention;
[0050] Figure 3 It is a schematic diagram of a scenario of business processing provided by an embodiment of the present invention;
[0051] Figure 4 It is a flowchart of a business processing method based on blockchain provided by an embodiment of the present invention;
[0052] Figure 5 It is a flowchart of a business processing method based on blockchain provided by an embodiment of the present invention;
[0053] Figure 6 It is a structural diagram of a service processing device provided by an embodiment of the present invention;
[0054] Figure 7 is a schematic diagram of the structure of a resource information matching unit provided in an embodiment of the present invention;
[0055] Figure 8 is a schematic diagram of the structure of an information processing unit provided by an embodiment of the present invention;
[0056] Fig. 9 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] Please combine Figure 1-Figure 5 The embodiment shown provides a detailed introduction to the blockchain-based business processing method provided by an embodiment of the present invention.
[0059] See also Figure 1 , which provides a system architecture diagram for business processing in an embodiment of the present invention. Figure 1 As shown, for the same business processing based on blockchain, such as financial business, community access control business, hospital prescription business, etc., there are multiple user groups corresponding to them. That is to say, users of the same business (users 1, 2, ..., N) can process business information through their respective user terminals (user terminals 1, 2, ..., N). For example, for financial business, users can convert currencies; for hospital prescription business, users can store and circulate prescription information, etc. The user terminal may include but is not limited to mobile phones, e-readers, tablet computers, personal computers, vehicle-mounted devices and other terminal devices. It can be understood that different users of the same business are allocated corresponding personal business account information in the business blockchain to distinguish and process the business information of different users. The block node device (block node device 1, 2, ..., N) can obtain the business information for the target account sent by the user terminal in the current operation cycle, obtain the historical resource usage information of the operating resources of the target account in the current operation cycle, match the historical resource usage information with the resource availability information in the smart contract to obtain a matching result. The resource availability information is the available information of the operating resources for the target account in a single operation cycle, and finally process the business information based on the matching result.
[0060] See also Figure 2 , which provides a schematic diagram of blockchain construction for an embodiment of the present invention. Figure 2 As shown, in order to further ensure the controllability and flexibility of business processing, an embodiment of the present invention builds a blockchain for business processing scenarios, which may include a blockchain underlying platform, a platform product service layer, and an application service layer.
[0061] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation monitoring. Among them, the user management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and the maintenance of the correspondence between the user's real identity and the blockchain address (authority management), etc., and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests to storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management). The smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, the key or other events are called to trigger the execution and complete the contract logic. It also provides the function of contract upgrade and cancellation. The operation monitoring module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network monitoring, node equipment health monitoring, etc.
[0062] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can complete the blockchain implementation of business logic based on these basic capabilities. The application service layer provides application services based on blockchain solutions for business participants to use.
[0063] In the business processing scenario, the block node devices can be distributed within the scope corresponding to the entity, or can be arranged in the cloud service equipment. The entity can include but is not limited to the business processing store, the user concentration center, etc. By building the business processing scenario based on the blockchain, the operation resource usage of the business information of different accounts can be optimized, and the resource available information of different accounts can be adjusted according to the actual operation situation, so as to improve the controllability of business information processing and the flexibility of management and control.
[0064] See also Figure 3 , provides a schematic diagram of a business processing scenario for an embodiment of the present invention. Figure 3As shown, there are operation components and smart contracts in the block node device in the business blockchain, and all block node devices in the business blockchain have a consensus on the smart contract, which can be used to control the use of the operation resources of the operation components by the accounts managed by the block node devices. Specifically, when the block node device obtains the business information of the target account, the operation resources of the operation component can be allocated in the current operation cycle, and the business information for the target account can be obtained in the current operation cycle. The target account is the account information in the business blockchain, and the historical resource usage information of the operation resources of the target account in the current operation cycle is obtained. The block node device can match the historical resource usage information with the resource available information in the smart contract to obtain a matching result. The resource available information is the available information of the operation resources for the target account in a single operation cycle. The business information is processed based on the matching result, for example: when the matching result is to execute the business processing of the target account, the business information is processed; when the matching result is to stop the business processing of the target account, the processing of the business information is stopped, etc. By using smart contracts to control the operating resources of block node devices in the blockchain, business information of different accounts is processed according to the allocated resource availability information within a single operating cycle, which avoids a single account occupying more operating resources within a certain period of time, optimizes the use of operating resources for business information of different accounts, and improves the controllability of business information processing. At the same time, through the use of smart contract management, the resource availability information of different accounts can be adjusted according to the actual operating conditions, which improves the flexibility of the management and control of business information processing.
[0065] based on Figure 1-Figure 3 For the implementation framework, please refer to Figure 4 , which is a flowchart of a blockchain-based business processing method according to an embodiment of the present invention. The business processing device proposed in the embodiment of the present invention can be a block node device in the business blockchain of the above embodiment. Figure 4 As shown, the method of the embodiment of the present invention may include the following steps S101 to S104.
[0066] S101, obtaining business information for a target account in a current operation cycle;
[0067] Specifically, the business processing device can obtain business information for the target account within the current operating cycle. The business processing device can specifically be a block node device in the business blockchain for current business information processing. The target account can specifically be the account information in the business blockchain. Each business processing device can be responsible for processing business information for multiple different accounts in the business blockchain. The current operating cycle can specifically be the current control time period for business information processing for multiple accounts managed by the business processing device, for example: the one-hour time period from 15:00 to 16:00 in the afternoon, etc. It can be understood that the control time period specified in the operating cycle can be pre-written into the smart contract of the blockchain, and the operating cycle can be a specific time interval, for example: 1 hour is one operating cycle, etc.
[0068] S102, obtaining historical resource usage information of the target account's operating resources in the current operating cycle;
[0069] Specifically, after obtaining the business information for the target account, the business processing device can further obtain the historical resource usage information of the operating resources of the target account in the current operating cycle. The operating resources may include but are not limited to central processing unit usage resources, memory usage resources and other resources used to execute business information processing. The historical resource usage information can specifically be the historical business information processed for the target account in the current operating cycle, and the resource usage information of the operating resources that have been occupied. The resource usage information can specifically be the resource usage duration. Preferably, the business processing device can obtain the historical resource usage duration of the operating resources of the target account in the current operating cycle. The historical resource usage duration is the duration of occupying the operating resources when processing the historical business information of the target account in the current operating cycle.
[0070] S103, matching the historical resource usage information with the resource availability information in the smart contract to obtain a matching result;
[0071] Specifically, the business processing device may match the historical resource usage information with the resource availability information in the smart contract to obtain a matching result. The resource availability information may specifically be the available information of the operating resources for the target account in a single operating cycle. Preferably, the resource availability information corresponding to each account may be pre-written in the smart contract. The resource availability information is preferably the resource availability ratio. For example, the current business processing device manages two accounts, A and B. In each operating cycle, the resource availability information of account A may be limited to 30%, and the resource availability information of account B may be limited to 10%. The business processing device may match the historical resource usage information with the resource availability information to generate a matching result, and the matching result is used to determine whether the target account can continue to be processed for business at present.
[0072] S104, processing the business information based on the matching result;
[0073] Specifically, the business processing device can process the business information based on the matching result. It can be understood that if the matching result indicates that the business processing of the target account can continue to be executed, the business processing device processes the business information; if the matching result indicates that the business processing of the target account should be stopped, the business processing device stops processing the business information.
[0074] In an embodiment of the present invention, the operating resources of the block node devices in the blockchain are managed and controlled by using smart contracts, and the business information of different accounts is processed according to the allocated resource availability information within a single operating cycle, thereby avoiding a single account from occupying more operating resources within a certain period of time, optimizing the use of operating resources for business information of different accounts, and improving the controllability of business information processing. At the same time, through the management and control of smart contracts, the resource availability information of different accounts can be adjusted according to the actual operating conditions, thereby improving the flexibility of the management and control of business information processing.
[0075] based on Figure 1-Figure 3 For the implementation framework, please refer to Figure 5 , which is a flowchart of a blockchain-based business processing method according to an embodiment of the present invention. The business processing device proposed in the embodiment of the present invention can be a block node device in the business blockchain of the above embodiment. Figure 5 As shown, the method of the embodiment of the present invention may include the following steps S201 to S208.
[0076] S201, obtaining business information for a target account in a current operation cycle;
[0077] Specifically, the business processing device can obtain business information for the target account within the current operating cycle. The business processing device can specifically be a block node device in the business blockchain for current business information processing. The target account can specifically be the account information in the business blockchain. Each business processing device can be responsible for processing business information for multiple different accounts in the business blockchain. The current operating cycle can specifically be the current control time period for business information processing for multiple accounts managed by the business processing device, for example: the one-hour time period from 15:00 to 16:00 in the afternoon, etc. It can be understood that the control time period specified in the operating cycle can be pre-written into the smart contract of the blockchain, and the operating cycle can be a specific time interval, for example: 1 hour is one operating cycle, etc.
[0078] S202, obtaining historical resource usage information of the target account's operating resources in the current operating cycle;
[0079] Specifically, after obtaining the business information for the target account, the business processing device can further obtain the historical resource usage information of the operating resources of the target account in the current operating cycle. The operating resources may include but are not limited to central processing unit usage resources, memory usage resources and other resources used to execute business information processing. The historical resource usage information can specifically be the historical business information processed for the target account in the current operating cycle, and the resource usage information of the operating resources that have been occupied. The resource usage information can specifically be the resource usage duration. Preferably, the business processing device can obtain the historical resource usage duration of the operating resources of the target account in the current operating cycle. The historical resource usage duration is the duration of occupying the operating resources when processing the historical business information of the target account in the current operating cycle.
[0080] S203, based on the cycle duration of the current operation cycle and the resource availability information of the target account in the smart contract, obtaining the resource availability duration of the target account;
[0081] Specifically, the business processing device can obtain the resource availability duration of the target account based on the cycle duration of the current operation cycle and the resource availability information of the target account in the smart contract. The resource availability information can specifically be the available information of the operating resources for the target account in a single operation cycle. Preferably, the resource availability information corresponding to each account can be pre-written in the smart contract. The resource availability information is preferably a resource availability ratio. The resource availability duration can be used to limit the time that the business information processing of the target account in a single operation cycle can occupy the operating resources. For example: assuming that the current business processing device manages two accounts, A and B, in each operation cycle, the resource availability information of account A can be limited to 30%, the resource availability information of account B can be limited to 10%, etc., and the cycle duration of each operation cycle is 1 hour. In the current 1 hour, account A can occupy the resource availability time of the operating resources for 18 minutes, and account B can occupy the resource availability time of the operating resources for 6 minutes.
[0082] S204, matching the historical resource usage duration with the resource available duration;
[0083] S205, when the historical resource usage duration is less than the resource available duration, determining that the matching result is to execute the business processing of the target account;
[0084] Specifically, when the historical resource usage time is less than the resource available time, the business processing device can determine that the matching result is to execute the business processing of the target account. For example, assuming that the resource available time of account A is 18 minutes, and the historical resource usage time for processing the historical business information of account A during the current operation cycle is 12 minutes, it means that the business information of account A can still be processed. The business processing device can determine to execute the business processing of account A.
[0085] S206, when the historical resource usage duration is equal to the resource available duration, determining that the matching result is to stop the business processing of the target account;
[0086] Specifically, when the historical resource usage duration is equal to the resource available duration, the business processing device can determine that the matching result is to stop the business processing of the target account. For example, assuming that the resource available duration of account A is 18 minutes, and the historical resource usage duration for processing the historical business information of account A during the current operation cycle is 18 minutes, it means that the business information of account A cannot be processed any further. The business processing device can determine to stop the business processing of account A.
[0087] S207, when the matching result is to execute the business processing of the target account, process the business information;
[0088] Specifically, when the matching result is to execute the business processing of the target account, the business processing device can obtain the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time. The remaining available time is used to indicate the time during which the business information of the target account can continue to be processed. The business processing device can process the business information and record the processing time of the business information in real time. When the processing time of the business information is equal to the remaining available time and the business information has not been processed, the business processing device stops processing the business information until the next operation cycle of the current operation cycle re-executes the processing of the business information. When the processing time of the business information is less than or equal to the remaining available time and the business information has been processed, the business processing device updates the processing time to the historical resource usage information and continues to detect whether the business information for the target account is obtained in the current operation cycle. It is understandable that in order to ensure the integrity of business information processing, the business processing device can discard the processing progress of the business information and restart the processing of the business information when the next operation cycle comes. It is understandable that at the beginning of each operation cycle, the historical resource usage time and remaining available time of each account are recalculated.
[0089] S208, when the matching result is to stop the business processing of the target account, stop processing the business information;
[0090] Specifically, when the matching result is to stop the business processing of the target account, the business processing device can stop processing the business information until the next operation cycle of the current operation cycle executes the processing of the business information. It can be understood that at the beginning of each operation cycle, the historical resource usage time and the remaining available time of each account are recalculated.
[0091] Optionally, when the administrator of the business blockchain adjusts the resource availability information of the account in the smart contract, for example, when the business processing device receives the modification information of the resource availability information of the target account in the smart contract, the business processing device can use the modification information to update the resource availability information, and synchronize the updated resource availability information to other devices in the business blockchain except the business processing device.
[0092] In an embodiment of the present invention, by adopting smart contracts to control the operating resources of block node devices in the blockchain, business information of different accounts is processed according to the allocated resource availability information within a single operating cycle, thereby avoiding a single account from occupying more operating resources within a certain period of time, optimizing the use of operating resources for business information of different accounts, and improving the controllability of business information processing. At the same time, by adopting smart contract management and control, the resource availability information of different accounts can be adjusted according to the actual operating conditions, thereby improving the flexibility of the management and control of business information processing; by real-time monitoring of the processing time during the business information processing process, the rational use of operating resources is guaranteed, and the controllability of business information processing is further improved.
[0093] based on Figure 1-Figure 3 The implementation framework of Figure 6 -Attached Figure 8 , the service processing device provided by the embodiment of the present invention is introduced in detail. It should be noted that the attached Figure 6 -Attached Figure 8 The device shown can be specifically Figure 1 and Figure 2 The block node device in the embodiment shown is used to implement the present invention Figure 4 and Figure 5 For the convenience of explanation, only the part related to the embodiment of the present invention is shown. For the specific technical details not disclosed, please refer to the present invention 3 and Figure 5 The embodiment shown.
[0094] See also Figure 6 , which is a schematic diagram of the structure of a service processing device according to an embodiment of the present invention. Figure 6 As shown, the service processing device 1 of the embodiment of the present invention may include: a service information acquisition unit 11 , a resource information acquisition unit 12 , a resource information matching unit 13 and an information processing unit 14 .
[0095] A business information acquisition unit 11 is used to acquire business information for a target account in a current operation cycle, where the target account is account information in a business blockchain;
[0096] A resource information acquisition unit 12, configured to acquire historical resource usage information of the operating resources of the target account in the current operating cycle;
[0097] The resource information acquisition unit 12 is specifically used to acquire the historical resource usage duration of the operating resources of the target account in the current operating cycle;
[0098] The historical resource usage duration is the duration of the operation resource being occupied when the historical business information of the target account is processed in the current operation cycle.
[0099] A resource information matching unit 13, configured to match the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, wherein the resource availability information is the availability information of the operating resources of the target account in a single operating cycle;
[0100] For details, please refer to Figure 7 , provides a schematic diagram of the structure of a resource information matching unit in an embodiment of the present invention. Figure 7 As shown, the resource information matching unit 13 may include:
[0101] The available duration acquisition subunit 131 is used to acquire the resource available duration of the target account based on the cycle duration of the current operation cycle and the resource available information of the target account in the smart contract;
[0102] A duration matching unit 132, configured to match the historical resource usage duration with the resource available duration;
[0103] A result determination subunit 133, configured to determine that the matching result is to execute the business processing of the target account when the historical resource usage duration is less than the resource available duration;
[0104] The result determination subunit 133 is further configured to determine, when the historical resource usage duration is equal to the resource available duration, that the matching result is to stop the business processing of the target account.
[0105] An information processing unit 14, configured to process the business information based on the matching result;
[0106] For details, please refer to Figure 8 , provides a schematic diagram of the structure of an information processing unit in an embodiment of the present invention. Figure 8 As shown, the information processing unit 14 may include:
[0107] The first information processing subunit 141 is configured to process the business information when the matching result is to execute the business process of the target account;
[0108] The first information processing subunit 141 is specifically configured to obtain the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time when the matching result is to execute the business processing of the target account, and process the business information;
[0109] When the processing time for processing the business information is equal to the remaining available time and the business information has not been processed, the processing of the business information is stopped until the next operation cycle of the current operation cycle, the processing of the business information is executed again.
[0110] The second information processing subunit 142 is configured to stop processing the business information when the matching result is to stop the business processing of the target account;
[0111] The second information processing subunit 142 is specifically configured to stop processing the business information when the matching result is to stop business processing of the target account, until the next operation cycle of the current operation cycle executes processing of the business information.
[0112] In an embodiment of the present invention, by adopting smart contracts to control the operating resources of block node devices in the blockchain, business information of different accounts is processed according to the allocated resource availability information within a single operating cycle, thereby avoiding a single account from occupying more operating resources within a certain period of time, optimizing the use of operating resources for business information of different accounts, and improving the controllability of business information processing. At the same time, by adopting smart contract management and control, the resource availability information of different accounts can be adjusted according to the actual operating conditions, thereby improving the flexibility of the management and control of business information processing; by real-time monitoring of the processing time during the business information processing process, the rational use of operating resources is guaranteed, and the controllability of business information processing is further improved.
[0113] The embodiment of the present invention further provides a computer storage medium, wherein the computer storage medium can store a plurality of program instructions, wherein the program instructions are suitable for being loaded and executed by a processor as described above. Figure 4 and Figure 5 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 4 and Figure 5 The specific description of the illustrated embodiment will not be repeated here.
[0114] See also Fig. 9 , which is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. Fig. 9As shown, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, an input / output interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As shown in FIG. Fig. 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, an input and output interface module, and a business processing application.
[0115] exist Fig. 9 In the computer device 1000 shown, the input-output interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user.
[0116] In one embodiment, the processor 1001 may be used to call the business processing application stored in the memory 1005, and specifically perform the following operations:
[0117] Obtaining business information for a target account in the current operation cycle, where the target account is account information in the business blockchain;
[0118] Acquire historical resource usage information of the target account's operating resources in the current operating cycle;
[0119] Matching the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, wherein the resource availability information is the availability information of the operating resources of the target account in a single operating cycle;
[0120] The business information is processed based on the matching result.
[0121] Optionally, when the processor 1001 executes the acquisition of historical resource usage information of the operating resources of the target account in the current operating cycle, the processor 1001 specifically performs the following steps:
[0122] Obtain the historical resource usage duration of the operating resources of the target account in the current operating cycle;
[0123] The historical resource usage duration is the duration of the operation resource being occupied when the historical business information of the target account is processed in the current operation cycle.
[0124] Optionally, when the processor 1001 matches the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, the processor 1001 specifically performs the following steps:
[0125] Based on the cycle duration of the current operation cycle and the resource availability information of the target account in the smart contract, obtain the resource availability duration of the target account;
[0126] Matching the historical resource usage duration with the resource available duration;
[0127] When the historical resource usage duration is less than the resource available duration, determining the matching result as executing the business processing of the target account;
[0128] When the historical resource usage duration is equal to the resource available duration, a matching result is determined to stop the business processing of the target account.
[0129] Optionally, when the processor 1001 processes the business information based on the matching result, the processor 1001 specifically performs the following steps:
[0130] When the matching result is to execute the business processing of the target account, processing the business information;
[0131] When the matching result is to stop the business processing of the target account, the processing of the business information is stopped.
[0132] Optionally, when the matching result is to execute the business processing of the target account, the processor 1001 specifically performs the following steps when processing the business information:
[0133] When the matching result is to execute the business processing of the target account, obtaining the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time, and processing the business information;
[0134] When the processing time for processing the business information is equal to the remaining available time and the business information has not been processed, the processing of the business information is stopped until the next operation cycle of the current operation cycle, the processing of the business information is executed again.
[0135] Optionally, when the matching result is to stop the business processing of the target account, the processor 1001 stops processing the business information, and specifically performs the following steps:
[0136] When the matching result is to stop the business processing of the target account, the processing of the business information is stopped until the next operation cycle of the current operation cycle executes the processing of the business information.
[0137] In an embodiment of the present invention, by adopting smart contracts to control the operating resources of block node devices in the blockchain, business information of different accounts is processed according to the allocated resource availability information within a single operating cycle, thereby avoiding a single account from occupying more operating resources within a certain period of time, optimizing the use of operating resources for business information of different accounts, and improving the controllability of business information processing. At the same time, by adopting smart contract management and control, the resource availability information of different accounts can be adjusted according to the actual operating conditions, thereby improving the flexibility of the management and control of business information processing; by real-time monitoring of the processing time during the business information processing process, the rational use of operating resources is guaranteed, and the controllability of business information processing is further improved.
[0138] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0139] The above disclosure is only the preferred embodiment of the present invention, which certainly cannot be used to limit the scope of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope of the present invention.
Claims
1. A business processing method based on blockchain, characterized in that: include: Acquire business information for a target account in a current operation cycle, wherein the target account is account information in a business blockchain, and the target account is any one of a plurality of accounts managed by a business processing device; Acquire historical resource usage information of the target account's operating resources in the current operating cycle, where the historical resource usage information is the historical resource usage duration, and the historical resource usage duration is the duration of the operating resources occupied when processing the historical business information processed by the target account in the current operating cycle; Based on the cycle duration of the current operation cycle and the resource availability information of the operation resources of the target account in a single operation cycle in the smart contract, the resource availability duration of the target account is obtained, where the resource availability information is the resource availability ratio; Matching the historical resource usage duration with the resource available duration to obtain a matching result, wherein the matching result is used to determine whether to continue processing the business information of the target account in the current operation cycle; When the historical resource usage duration is less than the resource available duration, it is determined that the matching result is to execute the business processing of the target account, and the business information is processed; When the historical resource usage duration is equal to the resource available duration, it is determined that the matching result is to stop the business processing of the target account, and the processing of the business information is stopped.
2. The method according to claim 1, characterized in that When the matching result is to execute the business processing of the target account, the business information is processed, including: When the matching result is to execute the business processing of the target account, obtaining the remaining available time of the target account in the current operation cycle based on the historical resource usage time and the resource available time, and processing the business information; When the processing time for processing the business information is equal to the remaining available time and the business information has not been processed, the processing of the business information is stopped until the next operation cycle of the current operation cycle, the processing of the business information is executed again.
3. The method according to claim 1, characterized in that: When the matching result is to stop the business processing of the target account, stopping the processing of the business information includes: When the matching result is to stop the business processing of the target account, the processing of the business information is stopped until the next operation cycle of the current operation cycle executes the processing of the business information.
4. A service processing device, characterized in that: include: A business information acquisition unit, used to acquire business information for a target account in a current operation cycle, wherein the target account is account information in a business blockchain, and the target account is any one of a plurality of accounts managed by the business processing device; A resource information acquisition unit, used to acquire historical resource usage information of the operating resources of the target account in the current operating cycle, wherein the historical resource usage information is the historical resource usage duration, and the historical resource usage duration is the duration of occupying the operating resources when processing the historical business information processed by the target account in the current operating cycle; A resource information matching unit, used to match the historical resource usage information with the resource availability information in the smart contract to obtain a matching result, wherein the resource availability information is the available information of the operating resources of the target account in a single operating cycle, and the matching result is used to determine whether to continue to process the business information of the target account in the current operating cycle; The resource information matching unit includes: An available duration acquisition subunit, configured to acquire the resource available duration of the target account based on the duration of the current operation cycle and the resource available information of the operation resources of the target account in a single operation cycle in the smart contract, wherein the resource available information is the resource available ratio; A duration matching unit, used for matching the historical resource usage duration with the resource available duration to obtain the matching result; A result determination subunit is used to determine that the matching result is to execute the business processing of the target account when the historical resource usage time is less than the resource available time; and to determine that the matching result is to stop the business processing of the target account when the historical resource usage time is equal to the resource available time, and then stop processing the business information; An information processing unit, configured to process the business information based on the matching result; The information processing unit comprises: A first information processing subunit, configured to process the business information when the matching result is to execute the business process of the target account; The second information processing subunit is configured to stop processing the business information when the matching result is to stop business processing of the target account.
5. A computer device, characterized in that: Includes processor, memory, input and output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used for page interaction, the memory is used for storing program code, and the processor is used for calling the program code to execute the method according to any one of claims 1-3.
6. A computer storage medium, characterized in that: The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method according to any one of claims 1 to 3 is executed.
Citation Information
Patent Citations
A method for allocating time slot resources
CN102291825A
Online charging method, online charging system, and charging system
CN106888441A
Smart contract based RAM resource allocation method and device
CN110134510A