Resource allocation method and apparatus, related device, and storage medium
By introducing a blockchain network to store transaction data between the cloud capability platform and the terminal, the problems of inaccurate settlement results and insufficient transparency in cloud capability call services are solved, thereby improving the credibility and transparency of transaction data and enhancing the user experience.
Patent Information
- Application Number
- CN202111284121.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-01
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2041-11-01
AI Technical Summary
In cloud capability invocation services, users cannot actively participate in the allocation and settlement of cloud resources, resulting in insufficient accuracy and transparency of settlement results, and difficulty in tracing abnormal data when disputes arise.
By introducing a blockchain network between the cloud capability platform and the terminal to store transaction data, including estimated fee confirmations and task execution receipts, credibility and transparency are improved.
It improves the credibility and transparency of transaction data, enabling users to trace and query transaction data, thereby enhancing the accuracy of settlement results and user experience.
Smart Images

Figure CN116095074B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of cloud computing, and particularly relates to a resource allocation method and device, related equipment and a storage medium. BACKGROUND
[0002] At present, deep learning research using artificial neural networks has achieved great success in the field of artificial intelligence (AI), and the application effect in picture detection and recognition has far exceeded previous related technologies. Both emerging enterprises in the field of artificial intelligence and traditional Internet technology companies are actively using artificial intelligence technology to expand new businesses, including cloud capability calling businesses.
[0003] The cloud capability calling business is a new type of business based on AI. When performing the cloud capability calling business, the cloud capability provider calls cloud resources from a cloud resource pool and uses the called cloud resources to process multi-type data such as voice, image, video, text, and face, and then shows the corresponding AI-based application capability to the user. In related technologies, the cloud capability provider allocates cloud resources to the user and charges and settles according to the number of cloud resource calls or the amount of calls. However, in actual scenarios, the transaction data of the cloud capability calling business is often mastered by the cloud capability provider and is not public, so that the user can only passively accept the settlement result, and when there is a dispute about the transaction result, it is difficult to locate and trace abnormal data. SUMMARY
[0004] To solve the problems in related technologies, the present application provides a resource allocation method, device, related equipment and storage medium.
[0005] The technical scheme of the present application embodiment is implemented as follows:
[0006] The present application embodiment provides a resource allocation method applied to a cloud capability platform, comprising:
[0007] receiving a first request sent by a terminal, the first request being used to request allocation of cloud resources for a first task;
[0008] based on the first request, generating first information and sending the first information to the terminal, the first information representing an estimated cost generated by using the cloud resources allocated for the first task;
[0009] receiving second information sent by the terminal, the second information representing confirmation of the estimated cost;
[0010] storing the second information to a blockchain network and executing the first task using the cloud resources allocated for the first task;
[0011] The third information is generated after the first task is executed, and the third information is stored in the blockchain network; the third information represents a receipt that the cloud resource allocated for the first task is used.
[0012] In the above scheme, the first request at least contains resource requirements corresponding to the first task; and the first information is generated based on the first request, including:
[0013] The first information is generated based on the resource requirements.
[0014] In the above scheme, the first information is generated based on the resource requirements, including:
[0015] The smart contract corresponding to the first task is obtained from the blockchain network.
[0016] The first information is generated based on the resource requirements and in combination with the smart contract.
[0017] In the above scheme, the method further includes:
[0018] The smart contract of the blockchain network is managed.
[0019] In the above scheme, the first request at least contains resource requirements corresponding to the first task; and the method further includes:
[0020] The cloud resource is allocated for the first task based on the resource requirements and in combination with fourth information; the fourth information at least represents the use of the cloud resource in the cloud resource pool.
[0021] In the above scheme, the method further includes:
[0022] The second request sent by the terminal is received; the second request is used to request to call the transaction data of the first task;
[0023] The transaction data of the first task is obtained from the blockchain network.
[0024] The obtained transaction data is sent to the terminal.
[0025] Embodiments of the present application also provide a resource allocation method applied to a terminal, including:
[0026] The first request is sent to a cloud capability platform; the first request is used to request to allocate a cloud resource for a first task;
[0027] The first information sent by the cloud capability platform is received; the first information represents an estimated cost generated by using the cloud resource allocated for the first task;
[0028] The first information is presented.
[0029] in response to the confirmation operation on the first information, sending second information to the cloud capability platform; the second information represents confirmation of the estimated cost.
[0030] In the above solution, the method further includes:
[0031] presenting a resource configuration function item for resource configuration in the configuration interface;
[0032] in response to a resource configuration operation on the resource configuration function item, generating a resource requirement of the first task;
[0033] based on the resource requirement, generating a first request; the first request contains the resource requirement.
[0034] In the above solution, the method further includes:
[0035] sending a second request to the cloud capability platform; the second request is used to request to call transaction data of the first task;
[0036] receiving transaction data sent by the cloud capability platform.
[0037] Embodiments of the present application also provide a resource allocation apparatus, comprising:
[0038] a first receiving unit configured to receive a first request sent by a terminal; the first request is used to request to allocate cloud resources for a first task; and receive second information sent by the terminal; the second information represents confirmation of an estimated cost;
[0039] a first processing unit configured to generate first information based on the first request, and send the first information to the terminal; the first information represents an estimated cost generated by using cloud resources allocated for the first task; store the second information to a blockchain network, and execute the first task using the cloud resources allocated for the first task; and generate third information after the execution of the first task is completed, and store the third information to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used.
[0040] Embodiments of the present application also provide a resource allocation apparatus, comprising:
[0041] a sending unit configured to send a first request to a cloud capability platform; the first request is used to request to allocate cloud resources for a first task;
[0042] a second receiving unit configured to receive first information sent by the cloud capability platform; the first information represents an estimated cost generated by using cloud resources allocated for the first task;
[0043] a second processing unit configured to present the first information, and in response to a confirmation operation on the first information, send second information to the cloud capability platform; the second information representing a confirmation on the estimated cost.
[0044] Embodiments of the present application further provide a cloud capability platform, comprising:
[0045] a first communication interface configured to receive a first request sent by a terminal; the first request being used to request allocation of cloud resources for a first task, and receive second information sent by the terminal; the second information representing a confirmation on an estimated cost;
[0046] a first processor configured to generate first information based on the first request, and send the first information to the terminal by using the first communication interface; the first information representing an estimated cost generated by using the cloud resources allocated for the first task, store the second information to a blockchain network by using the first communication interface, and execute the first task by using the cloud resources allocated for the first task, and generate third information after the execution of the first task is completed, and store the third information to the blockchain network by using the first communication interface; the third information representing a receipt of the use of the cloud resources allocated for the first task.
[0047] Embodiments of the present application further provide a terminal, comprising:
[0048] a second communication interface configured to send a first request to a cloud capability platform; the first request being used to request allocation of cloud resources for a first task, and receive first information sent by the cloud capability platform; the first information representing an estimated cost generated by using the cloud resources allocated for the first task;
[0049] a second processor configured to present the first information, and in response to a confirmation operation on the first information, send second information to the cloud capability platform by using the second communication interface; the second information representing a confirmation on the estimated cost.
[0050] Embodiments of the present application further provide a cloud capability platform, comprising: a first processor and a first memory configured to store a computer program capable of running on the processor; wherein,
[0051] the first processor is configured to execute steps of any method of the cloud capability platform side described above when running the computer program.
[0052] Embodiments of the present application further provide a terminal, comprising: a second processor and a second memory configured to store a computer program capable of running on the processor; wherein,
[0053] The second processor is configured to execute the computer program, and perform the steps of any of the methods described above at the terminal side.
[0054] The embodiments of the present application also provide a storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the steps of any of the methods described above at the cloud capability platform side, or implements the steps of any of the methods described above at the terminal side.
[0055] The resource allocation method, device, related equipment and storage medium provided by the embodiments of the present application, the terminal sends a first request to the cloud capability platform, the first request is used to request to allocate cloud resources for a first task; the cloud capability platform generates first information after receiving the first request, and sends the first information to the terminal, the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the terminal receives and presents the first information, and then in response to a confirmation operation on the first information, sends second information to the cloud capability platform, the second information represents a confirmation of the estimated cost; the cloud capability platform stores the second information to the blockchain network after receiving the second information, and executes the first task using the cloud resources allocated for the first task; the cloud capability platform generates third information after the first task is executed, and stores the third information to the blockchain network, the third information represents a receipt that the cloud resources allocated for the first task are used. The scheme provided by the embodiments of the present application stores the transaction data to the blockchain network, the transaction data at least includes the confirmation of the estimated cost and the receipt generated after the task is executed, thereby improving the credibility and transparency of the transaction data, so that the user can trace and query the transaction data. BRIEF DESCRIPTION OF DRAWINGS
[0056] Figure 1 The first resource allocation method flowchart of the embodiments of the present application;
[0057] Figure 2 The second resource allocation method flowchart of the embodiments of the present application;
[0058] Figure 3 The third resource allocation method flowchart of the embodiments of the present application;
[0059] Figure 4 The architecture diagram of the cloud service capability calling system based on the blockchain of the application embodiments;
[0060] Figure 5 The optional storage structure diagram of a block of the blockchain network of the application embodiments;
[0061] Figure 6 The account structure diagram of the blockchain network of the application embodiments;
[0062] Figure 7A method flowchart for applying an embodiment of the present application to resource allocation;
[0063] Figure 8 A blockchain network transaction body structure diagram for applying an embodiment of the present application;
[0064] Figure 9 A blockchain network receipt structure diagram for applying an embodiment of the present application;
[0065] Figure 10 A resource allocation device structure diagram for an embodiment of the present application;
[0066] Figure 11 Another resource allocation device structure diagram for an embodiment of the present application;
[0067] Figure 12 A cloud capability platform structure diagram for an embodiment of the present application;
[0068] Figure 13 A terminal structure diagram for an embodiment of the present application. DETAILED DESCRIPTION
[0069] The present application will be described in further detail below with reference to the accompanying drawings and embodiments.
[0070] With the continuous development of technologies such as the Internet and cloud computing, more and more users experience related services of cloud capabilities, such as image recognition using cloud capability calls. In related technologies, cloud capability providers provide limited numbers of capability calls to users, and when a cloud capability is called, the cloud capability provider determines the remaining number of calls available to the user according to a preset counting strategy. For this cloud computing service mode, the traditional settlement method is to use a centralized database system to manage and record the permissions and numbers of calls available to users, and to deduct the corresponding number of calls each time a call is made. However, during the cloud capability call process, there may be problems such as poor quality of pictures provided by users or training defects in inference models used by cloud computing, which can cause image recognition results to be abnormal, such as image recognition failure or incorrect image recognition. In this case, the image recognition task has not been successfully completed, but a cloud capability call action has occurred and a cloud computing process has been generated. Based on this, the cloud capability provider determines that the cloud computing service has been completed and settles the cloud computing service. Therefore, this settlement method will affect the accuracy of the settlement result, reduce the user experience, and may cause disputes of interest. When disputes of interest arise, users need to obtain transaction data of the cloud capability call process as a basis for rights protection, but various types of transaction data recorded by the centralized database system are usually controlled by the cloud capability provider and are not public, so the credibility of the transaction data is not high. Moreover, cloud capability call services are a new type of cloud service, and when users have objections to the processing results, it is difficult to locate and trace the problem data and abnormal results.
[0071] On the other hand, the blockchain network employs distributed nodes, peer-to-peer transmission, consensus mechanism and encryption algorithm, and can realize the trust propagation of data. On the blockchain network, each node will save a copy of the data backup, thereby greatly improving the difficulty of tampering with the data; the chain structure of the data on the blockchain can realize the traceability and query of all data, thereby improving the credibility of the data; and the smart contract deployed on the blockchain network can automatically perform the operation task according to the rules agreed by all parties.
[0072] Based on this, in various embodiments of the present application, the cloud capability platform stores transaction data to the blockchain network, and the transaction data at least includes confirmation of estimated cost and receipt generated after completion of task execution, thereby improving the credibility and transparency of the transaction data, and enabling the user to trace and query the transaction data.
[0073] The embodiments of the present application provide a resource allocation method applied to a cloud capability platform, as shown in the figure, the method comprises: Figure 1
[0074] Step 101: receiving a first request sent by a terminal, the first request being used to request to allocate cloud resources for a first task;
[0075] Step 102: generating first information based on the first request, and sending the first information to the terminal; the first information representing an estimated cost generated by using the cloud resources allocated for the first task;
[0076] Step 103: receiving second information sent by the terminal, the second information representing confirmation of the estimated cost;
[0077] Step 104: storing the second information to a blockchain network, and executing the first task using the cloud resources allocated for the first task;
[0078] Step 105: generating third information after completion of the first task, and storing the third information to the blockchain network; the third information representing a receipt of the cloud resources allocated for the first task being used.
[0079] Wherein, in actual application, the cloud capability platform can also be referred to as a cloud capability blockchain platform, and the name of the cloud capability platform is not limited in the embodiments of the present application, as long as the function thereof is realized.
[0080] When calling the cloud capability, the cloud resources consumed by different cloud capabilities are different, and thus the cloud resources actually consumed by different cloud capability calling services are also different, and the cost estimation can be performed based on the consumed cloud resources.
[0081] Based on this, in an embodiment, the first request can at least contain the resource requirement corresponding to the first task, accordingly, after the cloud capability platform receives the first request sent by the terminal in step 102, the first information is generated based on the resource requirement.
[0082] Compared with the traditional settlement mode of charging by times, the settlement mode of charging according to the cloud resource invocation quantity (i.e. according to the resource requirement corresponding to the task) is more accurate, which can improve the user experience.
[0083] In actual application, when calculating the estimated cost, the credibility and transparency of the calculation process need to be ensured, and the smart contract allows trusted transactions without a third party, which are traceable and irreversible. Therefore, the cost estimation can be based on the smart contract of the blockchain network.
[0084] Based on this, in an embodiment, in step 102, the cloud capability platform obtains the smart contract corresponding to the first task from the blockchain network, and generates the first information based on the resource requirement and the smart contract.
[0085] In an embodiment, the cloud capability platform can also manage the smart contract of the blockchain network. Specifically, the cloud capability platform is responsible for the functions of adding, updating, deploying, running and maintaining the smart contract on the blockchain network.
[0086] Exemplarily,
[0087] The smart contract is a billing script for charging according to the cloud resource invocation quantity, therefore, for the adding function of the smart contract, before the cloud capability invocation service is put into operation, the operator providing the cloud capability invocation service needs to first upload the smart contract corresponding to the cloud capability invocation service to the blockchain node, so as to be called by the cloud capability platform, so as to realize the adding of the smart contract.
[0088] For the updating function of the smart contract, when the hardware device corresponding to a certain type of cloud resource is changed (for example, a new graphics card is supplemented), the billing standard of the cloud resource called by the cloud capability invocation service also changes at the same time, based on this, the cloud capability platform needs to update the billing standard of the cloud resource in the smart contract.
[0089] For the deployment function of the smart contract, in actual application, the smart contract is the uppermost charging program, and when the smart contract is run, related library files and dependent software packages need to be called, therefore, the cloud capability platform needs to complete the configuration of these software; in addition, when the smart contract is run, the smart contract corresponding to the resource requirement needs to be obtained from the blockchain network first, and the resource requirement is cached as a message in a message queue for the smart contract to receive, in this process, hardware devices such as a forwarding server and a message queue server need to be used, therefore, the cloud capability platform needs to complete the configuration of these hardware; based on this, the cloud capability platform needs to configure the software and hardware used when the smart contract is executed;
[0090] The running function of the smart contract refers to that the cloud capability platform calls and executes the smart contract;
[0091] The maintenance function of the smart contract includes that the cloud capability platform saves the running log generated when the smart contract is run, so as to troubleshoot exceptions, that is, to maintain the smart contract.
[0092] In actual application, when cloud resources are allocated, the cloud capability platform can uniformly configure and call the cloud resources such as storage and computing power according to the resource state in the cloud resource pool, so as to improve the processing efficiency of the cloud capability calling task.
[0093] Based on this, in an embodiment, the first request at least contains the resource requirement corresponding to the first task, accordingly, the cloud capability platform allocates cloud resources for the first task based on the resource requirement and in combination with the fourth information; the fourth information at least represents the use of the cloud resources in the cloud resource pool.
[0094] In actual application, after the first task is executed, the cloud capability platform can also store the related data of the transaction process generated by executing the first task to the blockchain network, so as to be used for positioning and tracing in the future.
[0095] As mentioned above, in the capability calling process, there may be a situation that the identification result is abnormal, which further affects the settlement result of the cloud capability calling service and causes a benefit dispute. Therefore, when the user has objection to the processing result, the user can seek rights protection by positioning and tracing the transaction data stored in the blockchain network.
[0096] Based on this, in an embodiment, the method can further include:
[0097] The cloud capability platform receives the second request sent by the terminal; the second request is used to request to call the transaction data of the first task;
[0098] The cloud capability platform obtains the transaction data of the first task from the blockchain network, and sends the obtained transaction data to the terminal.
[0099] Here, in actual application, the transaction data can contain the second information and / or the third information.
[0100] When the identification result is abnormal, the user can also query the transaction process by calling the transaction data, but when the abnormal identification result is caused by the picture quality problem, the task corresponding to the to-be-processed data can be called for confirmation. At this time, the second request can also be used to call the to-be-processed data of the first task.
[0101] Based on this, in an embodiment, the cloud capability platform can also store the to-be-processed data corresponding to the first task to the cloud resource pool; when receiving the second request sent by the terminal, the cloud capability platform calls the to-be-processed data corresponding to the first task from the cloud resource pool; accordingly, the cloud capability platform can send the called to-be-processed data and the transaction data to the terminal.
[0102] Correspondingly, the embodiment of the application also provides a resource allocation method applied to a terminal, such as Figure 2 As shown in the figure, the method comprises:
[0103] Step 201: sending a first request to a cloud capability platform; the first request is used to request to allocate cloud resources for a first task;
[0104] Step 202: receiving first information sent by the cloud capability platform; the first information represents an estimated cost generated by using the cloud resources allocated for the first task;
[0105] Step 203: presenting the first information;
[0106] Step 204: in response to a confirmation operation on the first information, sending second information to the cloud capability platform; the second information represents a confirmation of the estimated cost.
[0107] As described previously, in order to improve the accuracy of the settlement result of the cloud computing service, a settlement mode of charging according to the cloud resource calling quantity, i.e. according to the cloud resource demand, can be used. When this settlement mode is used, the cloud resource information involved in the actual processing needs to be considered comprehensively, such as storage resources, computing power resources, etc. In the related art, the cloud capability provider configures resources for the user based on various types of cloud resource information, and the user can only passively accept the resources configured by the cloud capability provider. In actual application, different users have different service demands for the same type of cloud resources, for example, for the computing power resources, part of the users tend to select computing power resources with high processing efficiency, and part of the users tend to select computing power resources with low service cost. Therefore, calling cloud resources according to the resource demand configured by the user can meet the different service demands of the user, improve the flexibility of resource configuration, and improve the user experience.
[0108] Based on this, in one embodiment, before step 201, that is, before sending the first request to the cloud capability platform, the terminal presents a resource configuration function item for resource configuration in the configuration interface, and then, in response to the resource configuration operation for the resource configuration function item, generates the resource requirements of the first task, and then generates the first request based on the resource requirements; the first request includes the resource requirements.
[0109] In practical applications, resource configuration function items that match the terminal's permissions can be displayed in the configuration interface.
[0110] As mentioned earlier, when users disagree with the processing results, they can protect their rights by locating and tracing the transaction data stored in the blockchain network.
[0111] Based on this, in one embodiment, the terminal may also send a second request to the cloud capability platform; the second request is used to request the invocation of transaction data for the first task; the terminal receives the transaction data sent by the cloud capability platform.
[0112] Here, when the second request is also used to request the pending data of the first task, the terminal, while receiving the transaction data, also receives the pending data of the first task sent by the cloud capability platform.
[0113] In practical applications, when a user is dissatisfied with the estimated cost sent by the cloud capability platform, they can deny the first information. Correspondingly, the terminal responds to the denial operation of the first information by sending relevant information to the cloud capability platform; this relevant information represents a denial of the estimated cost. Upon receiving the relevant information, the cloud capability platform stops its current processing operation, i.e., it does not execute steps 104 and 105.
[0114] When a user denies the first information, they can reselect the resource configuration function items presented in the configuration interface of the terminal, thereby triggering a new request to allocate cloud resources for the first task.
[0115] This application also provides a resource allocation method, such as... Figure 3 As shown, the method includes:
[0116] Step 301: The terminal sends a first request to the cloud capability platform, the first request being used to request the allocation of cloud resources for the first task;
[0117] Step 302: After receiving the first request sent by the terminal, the cloud capability platform generates first information based on the first request; the first information represents the estimated cost of using the cloud resources allocated for the first task.
[0118] Step 303: the cloud capability platform sends the first information to the terminal;
[0119] Step 304: the terminal receives the first information and presents the first information;
[0120] Step 305: the terminal sends second information to the cloud capability platform in response to a confirmation operation on the first information; the second information represents confirmation of the estimated cost;
[0121] Step 306: after receiving the second information, the cloud capability platform stores the second information to the blockchain network and executes the first task using the cloud resources allocated for the first task;
[0122] Step 307: after the first task is executed, the cloud capability platform generates third information and stores the third information to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used.
[0123] Here, it should be noted that the specific processing procedures of the cloud capability platform and the terminal have been described above and will not be repeated here.
[0124] The resource allocation method provided by the embodiments of the present application is that the terminal sends a first request to the cloud capability platform, the cloud capability platform receives the first request sent by the terminal, and the first request is used to request allocation of cloud resources for a first task; the cloud capability generates first information based on the first request and sends the first information to the terminal, and the terminal receives the first information; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the terminal presents the first information and sends second information to the cloud capability platform in response to a confirmation operation on the first information, the cloud capability platform receives the second information sent by the terminal, and the second information represents confirmation of the estimated cost; and after receiving the second information, the cloud capability platform stores the second information to the blockchain network and executes the first task using the cloud resources allocated for the first task; after the first task is executed, the cloud capability platform generates third information and stores the third information to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used. The scheme provided by the embodiments of the present application stores transaction data to the blockchain network, and the transaction data at least includes confirmation of the estimated cost and the receipt generated after the task is executed, thereby improving the credibility and transparency of the transaction data, so that the user can trace and query the transaction data.
[0125] The present application will be further described in detail below in combination with application examples.
[0126] As Figure 4As shown, the architecture of the cloud service capability invocation system based on the blockchain in the application embodiment mainly comprises: a cloud capability platform 401, a terminal 402, a blockchain network 403 and a cloud resource pool 404; wherein the terminal 402 is in communication connection with the cloud capability platform 401, the cloud capability platform 401 is in communication connection with the blockchain network 403, and the cloud capability platform 401 is in communication connection with the cloud resource pool 404. Here, the terminal 402 and the cloud capability platform 401, the cloud capability platform 401 and the blockchain network 403, and the cloud capability platform 401 and the cloud resource pool 404 can be in communication connection through wired or wireless mode, which is not limited in the application embodiment.
[0127] The functions of the cloud capability platform 401, the terminal 402, the blockchain network 403 and the cloud resource pool 404 will be described in detail respectively as follows.
[0128] The cloud capability platform 401 is configured to receive the cloud capability invocation task sent by the terminal 402, calculate the estimated cost based on the resource requirement corresponding to the cloud capability invocation task and the smart contract invoked from the blockchain network 403, then send the estimated cost to the terminal 402 for confirmation, and after receiving the confirmation of the estimated cost sent by the terminal 402, upload the estimated cost to the blockchain network 403, and invoke the cloud resource from the cloud resource pool 404 based on the resource requirement to execute the cloud capability invocation task.
[0129] Exemplarily, the cloud capability platform 401 can comprise:
[0130] An identity and password module for managing user digital identity and account permission;
[0131] A transmission module for realizing the transmission protocol and function between the cloud capability platform 401 and the terminal 402, between the cloud capability platform 401 and the blockchain network 403, and between the cloud capability platform 401 and the cloud resource pool 404;
[0132] A resource management module for uniformly configuring and invoking the cloud resources such as storage and computing power in the cloud resource pool 404;
[0133] A retrieval module for realizing the retrieval of the to-be-processed data in the cloud resource pool 404 and the retrieval of the transaction data in the blockchain network 403 when tracing the transaction data;
[0134] A block management module for managing the information required for configuring each block in the blockchain network 403;
[0135] A network management module for managing the network between the cloud capability platform 401 and the terminal 402, between the cloud capability platform 401 and the cloud resource pool 404, and between the cloud capability platform 401 and the blockchain network 403;
[0136] a contract management module, configured to be responsible for functions such as addition, update, deployment, running and maintenance of smart contracts on the blockchain network 403;
[0137] a consensus mechanism module, configured to be responsible for functions such as deployment, running and maintenance of a consensus algorithm used when transaction data is uploaded to the blockchain network 403.
[0138] The terminal 402, which can also be referred to as a user equipment (UE) and a user, is configured to present a resource configuration function item, generate resource requirements after a user performs a resource configuration operation on the resource configuration function item, send the resource requirements to the cloud capability platform 401, receive an estimated cost sent by the cloud capability platform 401, and generate confirmation information of the estimated cost after the user confirms the estimated cost, and then send the confirmation information of the estimated cost to the cloud capability platform 401.
[0139] The blockchain network 403, which can also be referred to as a distributed ledger system (not limited in the embodiments of the present application), is configured to interact with the cloud capability platform 401 and store the interaction data in a trusted manner.
[0140] Based on features such as distributed nodes, point-to-point transmission, consensus mechanism and encryption algorithm, the blockchain network 403 can realize trust propagation of data on the chain. The blockchain network 403 has the following advantages: on the blockchain network 403, each node will save a data backup, thereby greatly improving the difficulty of tampering with data; the chain structure adopted by the blockchain data itself can realize traceability and query of all data, thereby improving the credibility of the data; the smart contract that can be deployed on the blockchain can automatically perform operation tasks according to rules agreed by all parties. Based on this, under the background that the cloud capability platform 401 deploys, adds and updates smart contracts on the blockchain network 403, and the cloud capability platform 401 stores transaction data to the blockchain network 403, when settling the cloud capability invocation service, the blockchain network 403 can provide the cloud capability platform 401 with a smart contract for settlement, and when a user requests to query transaction data of the settlement process, the blockchain network 403 can provide the cloud capability platform 401 with corresponding transaction data, and the credibility and transparency of the provided smart contract and transaction data are improved.
[0141] The functions of the blockchain network 403 in the embodiments of the present application will be described in detail below in combination with the block structure in the blockchain network 403.
[0142] Figure 5 An optional storage structure diagram of a block of the blockchain network 403 in the embodiments of the present application is shown in FIG. 3. As shown in FIG. 3, the block of the blockchain network 403 includes a block header and a block body. Figure 5As shown, a block includes a block header and a block body. The block header structure includes the fields of the block hash value, the previous block hash value, the block number, the timestamp, the state root, the transaction root, the receipt root, the total call number, and the called number. Among them,
[0143] The block hash value indicates the hash value calculated from all fields in the block header, which is the address of the block on the chain;
[0144] The previous block hash value indicates the hash value calculated from all fields in the previous block header, which points to the previous block through the hash pointer to realize the chain storage structure;
[0145] The block number indicates the serial number of the block on the chain;
[0146] The timestamp indicates the time when the block is mined;
[0147] The state root indicates the hash value of the account state tree; wherein the account state tree can be a Merkle Patricia Tree (MPT), which is an improved tree based on the Merkle Tree and the Patricia Tree, and is an ordered tree-shaped data structure composed of multiple MPT nodes; each MPT node includes a flag field, and flag.hash in the flag field saves the hash value of the MPT node; based on the hash values of the MPT nodes, the state root hash value can be obtained by performing hash calculation according to the MPT layer-by-layer structure;
[0148] The transaction root indicates the root hash of the transaction tree; wherein the transaction tree can be a Merkle Tree, which is an ordered tree-shaped data structure composed of multiple nodes, and the topmost node of the Merkle Tree is the Merkle tree root, i.e. the transaction tree root of the transaction tree; each node in the transaction tree saves the hash value of the node, and based on the hash values of the nodes in the transaction tree, the transaction tree root hash value can be obtained by performing hash calculation according to the transaction tree layer-by-layer structure;
[0149] The receipt root indicates the root hash of the receipt tree; the receipt tree can be a Merkle Tree, and the topmost node of the receipt tree is the receipt tree root; the end node of the receipt tree is the receipt in the block body, and the end node of the receipt tree corresponds to the end node of the transaction tree; each node of the receipt tree saves the hash value of the node, and based on the hash values of the nodes in the receipt tree, the receipt tree root hash value can be obtained by performing hash calculation according to the transaction tree layer-by-layer structure;
[0150] The total call number indicates the number of transactions allowed to be packaged into the block;
[0151] Invoked times: indicates the number of transactions that have been packed into the current block.
[0152] The block body stores transaction records within a certain time. When invoking cloud capabilities, the cloud capability platform 401 broadcasts the generated estimated fee confirmation and receipt as to-be-chained data to each node of the blockchain network 403. After each node verifies the to-be-chained data, the to-be-chained data is stored in the "unconfirmed transaction pool" of each respective receipt pool and waits to be extracted. After the node obtains the right to record according to the consensus algorithm, a certain number of "unconfirmed transactions" in the "unconfirmed transaction pool" are packed into a block, that is, a number of receipts are selected from the node's own receipt pool and packed into a block body, the transactions are calculated accordingly (that is, the state root, transaction root, receipt root, and other information are determined) to generate a block header, and then the packed block is broadcast to other nodes according to the set consensus mechanism. After the other nodes verify the legality of the block, the block is linked to the last block on the current chain.
[0153] The blockchain network 403 is an account-based distributed ledger system and is driven by transactions. Users apply for the calling of cloud resources such as storage and computing power by initiating transactions. Figure 6 The account structure of the blockchain network 403 applied in the embodiments of the present application is shown in FIG. 2. Figure 6 As shown in FIG. 2, the account includes four fields, namely, account balance, transaction count, contract code, and data record. The account type in the distributed ledger system can be divided into two types, namely, user account and contract account. The two types of accounts are specifically introduced below based on the account structure.
[0154] For the user account, the user account is an account allocated to the user when the user uses the cloud capability calling service. The main function of the user account is to initiate transactions and call the contract account, and to complete data operations through upload and download controls. The user has the control authority of the account through a private key. Among the four fields of the user account,
[0155] Account balance: indicates the available amount of the user;
[0156] Transaction count: indicates the count of transactions initiated by the user;
[0157] Contract code: indicates the hash value of the smart contract. For the user account, the contract code field is empty;
[0158] Data record: indicates transaction data in the settlement of the cloud capability calling service. The transaction data can include data in the transaction structure and the receipt structure submitted by the cloud capability platform 401, and can also include the path of the data submitted by the cloud capability platform 401 in the resource allocation system, the saving start time, and the like.
[0159] For the contract account, the contract account is generated when the smart contract is created and is assigned a public key, the public key assigned to the contract account as the access address of the contract account; the contract account cannot initiate a transaction, but can only be called by a user account. Among them, for the four fields of the contract account,
[0160] Account balance: available funds of the user, for the contract account, the account balance field is empty;
[0161] Transaction count: indicates the count of executing the smart contract;
[0162] Contract code: indicates the hash value of the smart contract;
[0163] Data record: indicates the data generated when the smart contract is executed, the data generated when the smart contract is executed at least contains receipts and log data.
[0164] In actual application, the user initiates a transaction process through the user account, the user can apply for corresponding capability requirements according to his own needs, the cloud capability platform 401 calculates the estimated cost, and after confirmation, the confirmation of the estimated cost is broadcast to each node of the block chain network 403. The operator providing the cloud capability calling service can use the user account allocated by the cloud capability platform 401 to the operator to initiate a transaction to the cloud capability platform 401 to create a contract account and deploy a contract code; specifically, the operator can use the user account to initiate a transaction to the 0 address to create a contract account.
[0165] The cloud resource pool 404 is the core of the cloud service, which is used to provide various cloud capabilities, i.e. various cloud resources, to the cloud capability platform 401; the cloud capability platform 401 sends the to-be-processed data and the corresponding resource requirement to the cloud resource pool 404, the cloud resource pool 404 calls the cloud resource corresponding to the resource requirement to process the to-be-processed data, and then sends the processed data to the cloud capability platform 401, correspondingly, the cloud capability platform 401 sends the processed data to the terminal 402.
[0166] In actual application, the cloud resource pool 404 can also store the received to-be-processed data in its own storage space, when the user requests to find historical to-be-processed data, the cloud capability platform 401 can find the required to-be-processed data by searching in the storage space of the cloud resource pool 404.
[0167] Based on the above architecture diagram, as Figure 7 shown, the resource allocation method of the application embodiment includes the following steps:
[0168] Step 701: the user logs in the account on the terminal;
[0169] Here, the user logs in the user account allocated by the cloud capability platform for the user.
[0170] Step 702: the terminal submits a cloud capability calling task request to the cloud capability platform;
[0171] Specifically, the user uploads the data to be processed, the user performs a configuration operation in the resource configuration function item presented by the terminal, the terminal generates a cloud capability calling task request based on the resource requirement configured by the user and the data to be processed, and sends the cloud capability calling task request to the cloud capability platform;
[0172] In the related art, when the user uses a cloud capability calling service such as image recognition, there is often a problem of data category limitation. For example, the user needs to use the cloud calling service to recognize a data set containing animal images and plant images, but the cloud capability provider only provides a single classification service or a plant classification service. Therefore, the user can only perform classification filtering on the data set to be processed, which reduces the image recognition efficiency and user experience. In the application embodiment, the user uploads the data to be processed, and the terminal presents the resource configuration function item related to the cloud capability calling task for the user to flexibly select, thereby solving the problem of data category limitation in the current capability calling service. For example, the terminal presents task category and data category options, and the classification model function item in the task category is correspondingly provided with multiple options such as an animal classification model and a plant classification model. The user selects according to the type of image to be recognized, so that the cloud capability platform can call the corresponding model according to the user selection.
[0173] In actual application, a general settlement mode can be used, and in this case, the data category, storage resource, computing resource, computing time and other information involved in actual processing need to be considered.
[0174] Specifically, when the terminal presents the resource configuration function item, it can be presented based on two categories of occupied storage resources and computing resources. In the function category corresponding to the computing resources, four function categories of data category, task category, resource requirement quantity and time requirement can be included. Among them,
[0175] The data category represents the type of data to be processed, such as picture, audio, video and the like;
[0176] The task category represents the type of task to be performed in the cloud capability calling task, such as detection, classification, clustering, recognition, rendering, transcoding and the like; among them,
[0177] Detection refers to detecting key elements such as people, objects and vehicles in the picture data to be processed;
[0178] Classification refers to classifying the data to be processed using a trained classification model. For example, using an animal and plant classification model to classify animals and plants in the data to be processed;
[0179] Clustering refers to aggregating the to-be-processed data according to certain rules; for example, aggregating the photos in an album according to the characters;
[0180] Recognition refers to detecting the recognition factors such as human faces and comparing the detected recognition factors with a database to finally obtain a comparison result, for example, face recognition;
[0181] Rendering refers to using centralized GPU resources to improve the picture quality of videos or images, such as 3D rendering, increasing the texture of objects in the picture, etc.
[0182] Transcoding refers to converting the format of to-be-processed data such as pictures and videos through coding and decoding technology.
[0183] The computing power resource includes a mathematical model required to execute a cloud capability calling task, and the data category and task category selected by the user determine the model category required to be called. In addition, a sub-option list can also be set under the same data category or task type function category, for example, the function category of image recognition includes two options A and B, and the corresponding model resources of the two options can realize the image recognition function. However, the model resource corresponding to the A option has high efficiency and high cost when executing a task, and the model resource corresponding to the B option has low efficiency and low cost when executing a task. The user can select according to the needs of the user;
[0184] The resource requirement quantity represents the quantity of computing power resources applied by the user according to the available computing power in a certain time period, that is, the quantity of mathematical models required to be used.
[0185] The time requirement represents the time length of using the cloud resource, and the time requirement is determined according to the starting time of applying the cloud resource or the starting time of task processing.
[0186] Specifically, the cloud capability platform can calculate the estimated cost by using the following formula:
[0187]
[0188] Wherein, Fee is the total cost, Fee disk is the cost generated by using the storage resource, Fee power is the cost generated by using the computing power resource; Size is the to-be-processed data quantity, Data unit is the size of the specified storage unit, Fee unit is the cost of occupying one specified storage unit size, Duration disk is the time length of storing the to-be-processed data in the cloud resource pool and processing the to-be-processed data by using the cloud resource when executing the cloud capability calling task, that is, the time length of using the cloud resource, which is determined according to the starting time of applying the cloud resource or the starting time of task processing; N powerFee for the number of mathematical models called, Duration model Fee for the mathematical models, Duration process Duration for the task processing.
[0189] Step 703: the cloud capability platform makes an estimation of settlement and sends the estimation of settlement to the terminal, and then performs step 704;
[0190] In this process, the cloud capability platform calls the smart contract through the contract account based on the resource demand sent by the terminal to make settlement for the cloud resources called to complete the resource demand.
[0191] Step 704: the cloud capability platform judges whether the confirmation of the estimation of settlement sent by the terminal is received, if yes, it means that the user approves the estimation of settlement, and then step 705 is performed, otherwise, it means that the user does not approve the estimation of settlement or does not confirm the estimation of settlement due to other reasons, and then step 702 is performed and the cloud capability calling task request is resubmitted by the terminal;
[0192] Step 705: the cloud capability platform calls the cloud resources to perform the cloud capability calling task;
[0193] In this process, the transmission module of the cloud capability platform broadcasts the confirmed estimation of settlement fee to each node of the blockchain network, and fills in the transaction structure body of each node of the blockchain network (i.e. puts it into the transaction pool of each node of the blockchain network), and then the resource management module of the cloud capability platform calls the cloud resources to start processing the task; wherein, as shown in the following table, the transaction structure body of the blockchain network of the application embodiment includes the following fields: Figure 8
[0194] Transaction Hash: indicates a transaction voucher generated according to the hash values of the timestamp, prepayment amount, receiving address, data category, task category, data volume, time demand, resource demand, and transaction signature;
[0195] Timestamp: indicates the time of generating the transaction;
[0196] Prepayment amount: indicates the estimation of settlement fee calculated according to the cloud capability calling task of the user;
[0197] Receiving address: indicates the user account address of the operator on the cloud capability platform;
[0198] Data category: indicates the type of data to be processed corresponding to the cloud capability calling task; the data category includes but is not limited to picture type, audio type, video type, etc.
[0199] Task category: indicates the type of the cloud capability invocation task; the task category includes but is not limited to detection, classification, clustering, recognition, rendering, transcoding and other application capability categories for basic audio and video data;
[0200] Data volume: indicates the size information of the data to be processed, that is, indicates the storage space required for storing the data to be processed;
[0201] Time requirement: indicates the starting time of cloud resource invocation or the processing duration, to record the duration of cloud resource invocation;
[0202] Resource requirement: indicates the computing resource information required for executing the cloud invocation task; wherein the computing resource information required for executing the cloud invocation task is different amounts of computing resources that a user applies according to available computing resources in a certain time period, for example, a certain number of graphics processing units (GPUs);
[0203] Transaction signature: indicates the result generated after digitally signing the information contained in the fields of timestamp, prepayment amount, receiving address, data category, task category, data volume, time requirement, and resource requirement with a private key; specifically, the transaction signature indicates the result generated after hash calculation of the hash values of the fields of timestamp, prepayment amount, receiving address, data category, task category, data volume, time requirement, and resource requirement with a private key.
[0204] Step 706: After the task processing is completed, the cloud capability platform settles according to the processing result, and generates a receipt;
[0205] Here, after the task processing is completed, the cloud capability platform transfers the estimated fee from the user account balance to the account balance of the operator (i.e. the cloud resource pool) according to the actual use of cloud resources, and generates a receipt; the receipt is a structure that stores transaction key information, and the most important one is the actual settlement fee and the task processing log; Figure 9 is a structural diagram of the blockchain network receipt structure of the application embodiment; as Figure 9 shown, the receipt structure can include receipt hash, timestamp, initiator address, receiving address, contract address, amount, computing resource usage, storage usage, processing duration, transaction hash, and processing log fields; wherein the receiving address represents the address of the transaction recipient, and when the receiving address field is empty, it indicates that the corresponding transaction belongs to the "contract creation" type transaction created by the operator through the operator's account on the cloud capability platform; if the transaction belongs to the "contract creation" type transaction, the address of the created smart contract is set in the contract address field of the receipt structure, and if it does not belong, the contract address field is empty.
[0206] Step 707: The cloud capability platform uploads the receipts and updates the account data; after the transmission module of the cloud capability platform broadcasts the receipts to each node of the blockchain network, each node updates the account data maintained by itself;
[0207] Step 708: Each node of the blockchain network selects a batch of receipts from its own receipt pool and calculates the receipt root hash value; after the cloud capability platform uploads the settlement estimated fee and the receipts to the blockchain network, the uploaded data will be broadcast to each node of the blockchain as to-be-chained data, each node verifies the to-be-chained data and stores the to-be-chained data in the "unconfirmed transaction pool" of its own receipt pool for extraction; after a node obtains the right to record according to the consensus algorithm, it will extract a certain number of "unconfirmed transactions" from its own "unconfirmed transaction pool" and pack them into a block, that is, select a number of receipts from the node's own receipt pool and pack them into a block body, and generate a receipt root hash value according to the selected receipts;
[0208] Step 709: The node calculates the transaction root hash value according to the transaction corresponding to the selected receipt; since the end node of the state tree corresponds to the end node of the receipt tree, the transaction root hash value is generated according to the transaction tree corresponding to the selected receipts;
[0209] Step 710: The node generates a block according to the consensus mechanism and broadcasts it to other nodes; according to the transaction information such as the receipt root hash value, the transaction root hash value, and the state root hash value, a block header is generated, the node packs the block header and the corresponding block body into a block and generates the block, and the generated block is broadcast to other nodes on the chain by the node;
[0210] Step 711: Each node on the blockchain verifies the legality of the generated block, and if it is legal, the block is chained, otherwise the block is discarded;
[0211] In actual application, the receipt root hash value of the generated block is recorded in the receipt root field of the block header and broadcasted, when other nodes receive the generated block, according to the transaction hash field in each receipt of the block body of the generated block, the corresponding transaction is taken out from its own transaction pool, and the transaction root hash value calculated according to the transaction in its own transaction pool is compared with the transaction root hash value in the block header of the received generated block, so as to confirm whether the generated block is legal and effective.
[0212] In the application embodiment, a user initiates a cloud capability calling task request through a terminal, a cloud capability platform calculates an estimated cost according to resource requirements of the user, and after receiving confirmation of the estimated cost by the user, the cloud capability platform calls a cloud resource to execute the cloud capability calling task, and generates a receipt and updates a user account after the task is completed. In this process, the cloud capability platform uploads transaction data including the estimated cost confirmed by the user and the generated receipt to a blockchain network. In this process, the resource allocation system of the application embodiment starts from the first initial block, and through a series of operations such as continuously receiving transactions, executing transactions, updating account data, generating receipts, block packaging, and block mining, realizes cloud capability calling and transaction data chaining.
[0213] The scheme provided by the application embodiment reforms the data management system of the cloud service capability calling business by using a blockchain, so that abnormal processing results such as detection failure or recognition error caused by quality problems of pictures provided by a user or defects in reasoning model training can be traced and checked, and the checking efficiency is improved.
[0214] In addition, the transaction pre-settlement mode gives the user the permission to actively configure the cloud resource calling amount, settles according to the user requirements and the actual use of resources, and improves the utilization rate of cloud resources.
[0215] In addition, in the pre-settlement process, task categories and data category options are provided, so that the cloud capability platform can call corresponding models (such as animal classification models and plant classification models, without the need for the user to distinguish animals and plants from the data set), which optimizes the data category limitation problem existing in the current capability calling service and improves the work efficiency.
[0216] In order to realize the method of the cloud capability platform side of the application embodiment, the application embodiment further provides a resource allocation device arranged on the cloud capability platform, as shown in Figure 10 The device comprises:
[0217] A first receiving unit 1001 is configured to receive a first request sent by a terminal; the first request is used to request to allocate cloud resources for a first task; and receive second information sent by the terminal; the second information represents confirmation of an estimated cost;
[0218] A first processing unit 1002 is configured to generate first information based on the first request, and send the first information to the terminal; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; store the second information to a blockchain network, and execute the first task using the cloud resources allocated for the first task; and generate third information after the execution of the first task is completed, and store the third information to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used.
[0219] In an embodiment, the first request at least includes resource requirements corresponding to the first task, and the first processing unit 1002 is configured to generate the first information based on the resource requirements.
[0220] In an embodiment, the first processing unit 1002 is specifically configured to:
[0221] obtain a smart contract corresponding to the first task from the blockchain network;
[0222] generate the first information based on the resource requirements and in combination with the smart contract.
[0223] In an embodiment, the first processing unit 1002 is further configured to manage a smart contract of the blockchain network; for example, the management includes adding, updating, deploying, running, maintaining, etc.
[0224] In an embodiment, the first request at least includes resource requirements corresponding to the first task, and the first processing unit 1002 is further configured to allocate cloud resources for the first task based on the resource requirements and in combination with fourth information; the fourth information at least represents usage of cloud resources in a cloud resource pool.
[0225] In an embodiment, the first receiving unit 1001 is further configured to receive a second request sent by the terminal; the second request is used to request to call transaction data of the first task.
[0226] The first processing unit 1002 is further configured to obtain the transaction data of the first task from the blockchain network and send the obtained transaction data to the terminal.
[0227] Here, the function of the first processing unit 1002 is equivalent to the function of the transmission module, the resource management module, the retrieval module, the contract management module, and the consensus mechanism module in the above application embodiments, and the function of the first receiving unit 1001 is equivalent to the function of the transmission module in the above application embodiments.
[0228] In actual application, the first receiving unit 1001 can be implemented by a communication interface in a resource allocation apparatus, and the first processing unit 1002 can be implemented by a processor in combination with the communication interface in the resource allocation apparatus.
[0229] In order to implement the method on the terminal side in the embodiments of the present application, the embodiments of the present application further provide a resource allocation apparatus arranged on a terminal, as shown in Figure 11 The apparatus includes:
[0230] The sending unit 1101 is configured to send a first request to a cloud capability platform; the first request is used to request allocation of cloud resources for a first task;
[0231] The second receiving unit 1102 is configured to receive first information sent by the cloud capability platform; the first information represents an estimated cost generated by using the cloud resources allocated for the first task;
[0232] The second processing unit 1103 is configured to present the first information; and in response to a confirmation operation on the first information, send second information to the cloud capability platform; the second information represents confirmation of the estimated cost.
[0233] In an embodiment, the second processing unit 1103 is further configured to:
[0234] present a resource configuration function item for resource configuration in a configuration interface;
[0235] generate a resource requirement of the first task in response to a resource configuration operation on the resource configuration function item;
[0236] generate a first request based on the resource requirement; the first request contains the resource requirement.
[0237] In an embodiment, the sending unit 1101 is further configured to send a second request to the cloud capability platform; the second request is used to request calling transaction data of the first task.
[0238] The second receiving unit 1102 is further configured to receive transaction data sent by the cloud capability platform.
[0239] In actual application, the sending unit 1101 and the second receiving unit 1102 can be implemented by a communication interface in a resource allocation apparatus; and the second processing unit 1103 can be implemented by a processor in the resource allocation apparatus in combination with the communication interface.
[0240] It should be noted that: the resource allocation apparatus provided in the above embodiments, when allocating resources, is only taken as an example for the division of the above program modules, and in actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the above processing. In addition, the resource allocation apparatus and the resource allocation method provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0241] Based on the hardware implementation of the above program modules, and in order to implement the method on the cloud capability platform side in the embodiments of the present application, the embodiments of the present application further provide a cloud capability platform, such as Figure 12As shown, the cloud capability platform 1200 comprises:
[0242] a first communication interface 1201, capable of information interaction with a terminal, a blockchain network and a cloud resource pool;
[0243] a first processor 1202 connected with the first communication interface 1201 to realize information interaction with a terminal, a cloud capability platform and a cloud resource pool, for running a computer program, executing the method provided by one or more technical solutions of the cloud capability platform side;
[0244] a first memory 1203, wherein the computer program is stored in the first memory 1203.
[0245] Specifically, the first communication interface 1201 is configured to receive a first request sent by a terminal; the first request is used to request allocation of cloud resources for a first task; and receive second information sent by the terminal; the second information represents confirmation of an estimated cost;
[0246] The first processor 1202 is configured to generate first information based on the first request, and send the first information to the terminal by using the first communication interface 1201; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; store the second information to a blockchain network by using the first communication interface 1201, and execute the first task by using the cloud resources allocated for the first task; and generate third information after the execution of the first task is completed, and store the third information to the blockchain network by using the first communication interface 1201; the third information represents a receipt that the cloud resources allocated for the first task are used.
[0247] In an embodiment, the first request at least contains resource requirements corresponding to the first task, and the first processor 1202 is further configured to generate the first information based on the resource requirements.
[0248] In an embodiment, the first processor 1202 is specifically configured to:
[0249] obtain a smart contract corresponding to the first task from the blockchain network by using the first communication interface 1201;
[0250] generate the first information based on the resource requirements and in combination with the smart contract.
[0251] In an embodiment, the first processor 1202 is further configured to manage the smart contract of the blockchain network.
[0252] In an embodiment, the first request comprises at least resource requirements corresponding to the first task, and the first processor 1202 is further configured to:
[0253] allocate cloud resources for the first task based on the resource requirements and in combination with fourth information, the fourth information at least representing usage of cloud resources in a cloud resource pool.
[0254] In an embodiment, the first communication interface 1201 is further configured to receive a second request sent by the terminal, the second request being used to request transaction data of the first task;
[0255] The first processor 1202 is further configured to acquire, by the first communication interface 1201, transaction data of the first task from the blockchain network, and send the acquired transaction data to the terminal by the first communication interface 1201.
[0256] It should be noted that the specific processing process of the first processor 1202 and the first communication interface 1201 can be understood with reference to the above method.
[0257] Of course, in actual application, various components in the cloud capability platform 1200 are coupled together through the bus system 1204, which can be understood as that the bus system 1204 is used to realize the connection and communication between the components. In addition to the data bus, the bus system 1204 can also include a power bus, a control bus and a status signal bus. However, in order to clearly illustrate the application, all kinds of buses are marked as the bus system 1204 in the Figure 12 .
[0258] The first memory 1203 in the embodiment of the application is used to store various types of data to support the operation of the cloud capability platform 1200. Examples of these data include any computer programs used to operate on the cloud capability platform 1200.
[0259] The method disclosed by the embodiments of the present application can be applied to the first processor 1202 or implemented by the first processor 1202. The first processor 1202 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by integrated logic circuits of hardware in the first processor 1202 or instructions in the form of software. The first processor 1202 described above can be a general processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 1202 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present application, the hardware decoding processor can be directly embodied to complete, or the combination of hardware and software modules in the decoding processor can be executed to complete. The software module can be located in a storage medium, which is located in the first memory 603, and the first processor 602 reads the information in the first memory 603 to complete the steps of the above method in combination with the hardware.
[0260] In exemplary embodiments, the cloud capability platform 600 can be implemented by one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors (Microprocessors), or other electronic elements for executing the foregoing methods.
[0261] Based on the hardware implementation of the above program module, and in order to implement the method on the terminal side of the embodiments of the present application, the embodiments of the present application further provide a terminal, as shown in the figure, the terminal 1300 includes: Figure 13
[0262] The second communication interface 1301 can interact with the cloud capability platform for information exchange;
[0263] The second processor 1302 is connected with the second communication interface 1301 to realize information interaction with the cloud capability platform, and is used for running a computer program to execute the method provided by one or more technical solutions on the terminal side.
[0264] The second memory 1303 stores the computer program.
[0265] Specifically, the second communication interface 1301 is configured to send a first request to the cloud capability platform, the first request is used to request to allocate cloud resources for a first task, and receive first information sent by the cloud capability platform, the first information represents an estimated cost generated by using the cloud resources allocated for the first task.
[0266] The second processor 1302 is configured to present the first information, and in response to a confirmation operation on the first information, send second information to the cloud capability platform by using the second communication interface, the second information represents a confirmation on the estimated cost.
[0267] In an embodiment, the second processor 1302 is further configured to:
[0268] present a resource configuration function item for resource configuration in a configuration interface;
[0269] generate a resource requirement of the first task in response to a resource configuration operation on the resource configuration function item;
[0270] generate a first request based on the resource requirement, and the first request contains the resource requirement.
[0271] In an embodiment, the processor 1302 is further configured to:
[0272] send a second request to the cloud capability platform by using the second communication interface 1301, the second request is used to request to call transaction data of the first task;
[0273] receive transaction data sent by the cloud capability platform by using the second communication interface 1301.
[0274] It should be noted that the specific processing process of the second processor 1302 can be understood with reference to the above method.
[0275] In actual application, various components in the terminal 1300 are coupled together through the bus system 1304. It can be understood that the bus system 1304 is used to realize the connection and communication between the components. In addition to the data bus, the bus system 1304 can also include a power bus, a control bus and a status signal bus. However, in order to clearly illustrate, all kinds of buses are marked as the bus system 1304 in the Figure 13 .
[0276] The second memory 1303 in the embodiments of the present application is configured to store various types of data to support the operation of the terminal 1300. Examples of the data include any computer programs for operating on the terminal 1300.
[0277] The method disclosed in the embodiments of the present application can be applied to the second processor 1302 or implemented by the second processor 1302. The second processor 1302 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware or the instruction in the form of software in the second processor 1302. The second processor 1302 disclosed above can be a general processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The second processor 1302 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present application, the hardware decoding processor can be directly embodied to complete, or the combination of hardware and software modules in the decoding processor can be executed to complete. The software module can be located in the storage medium, which is located in the second memory 1303, and the second processor 1302 reads the information in the second memory 1303 to complete the steps of the above method in combination with the hardware.
[0278] In the exemplary embodiments, the terminal 1300 can be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic elements, for executing the above method.
[0279] It can be understood that the memory (the first memory 1203 and the second memory 1303) of the embodiments of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM). The magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example but not limitation, many forms of RAM can be used, such as a static random access memory (SRAM), a synchronous static random access memory (SSRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a sync link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM).The memory described in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0280] In the example embodiments, the embodiments of the present application also provide a storage medium, specifically a computer readable storage medium, for example, a first memory 1203 storing a computer program executable by the first processor 1202 of the cloud capability platform 1200 to complete the steps of the foregoing cloud capability platform side method, and a second memory 1303 storing a computer program executable by the second processor 1302 of the terminal 1300 to complete the steps of the foregoing terminal side method. The computer readable storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM, etc.
[0281] It should be noted that "first", "second", etc. are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0282] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.
[0283] The above is only a preferred embodiment of the present application, and is not intended to limit the protection scope of the present application.
Claims
1. A resource allocation method characterized by, Applied to a cloud capability platform, comprising: receiving a first request sent by a terminal, the first request being used to request allocation of cloud resources for a first task; based on the first request, generating first information and sending the first information to the terminal; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing resource cost, the storage resource cost is calculated based on a to-be-processed data volume, a storage unit size and a cloud resource use duration, the calculation logic of the storage resource cost is: (to-be-processed data volume / storage unit size) × cloud resource use duration × unit storage unit size cost, the computing resource cost is calculated based on a number of called mathematical models, a mathematical model cost and a task processing duration; the first task is a cloud capability calling task, and the computing resource includes mathematical models that need to be called to execute the cloud capability calling task, the mathematical models are determined based on a data category and a task category selected by a user; receiving second information sent by the terminal, the second information representing confirmation of the estimated cost; storing the second information to a blockchain network and executing the first task using the cloud resources allocated for the first task; wherein the second information is stored to a transaction structure body in the blockchain network, the transaction structure body includes a transaction hash, a timestamp, a prepayment amount, a receiving address, a data category, a task category, a time requirement, a resource requirement, and a transaction signature; generating third information after the first task is executed and storing the third information to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used; wherein the third information is stored to a receipt structure body in the blockchain network, the receipt structure body includes a receipt hash, a timestamp, a sender address, a receiver address, a contract address, an amount, a computing resource usage, a storage usage, a processing duration, a transaction hash and a processing log.
2. The method of claim 1, wherein, The first request at least contains a resource requirement corresponding to the first task; the first information is generated based on the first request, comprising: generating the first information based on the resource requirement.
3. The method of claim 2, wherein, The first information is generated based on the resource requirement, comprising: obtaining a smart contract corresponding to the first task from the blockchain network; generating the first information based on the resource requirement in combination with the smart contract.
4. The method of claim 3, wherein, The method further comprises: managing the smart contract of the blockchain network.
5. The method of claim 1, wherein, The first request at least contains a resource requirement corresponding to the first task; the method further comprises: allocating cloud resources for the first task based on the resource requirement in combination with fourth information; the fourth information at least represents the usage of cloud resources in a cloud resource pool.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: receiving a second request sent by the terminal; the second request is used to request calling transaction data of the first task; obtaining transaction data of the first task from the blockchain network; sending the obtained transaction data to the terminal.
7. A resource allocation method characterized by, Applied to a terminal, comprising: sending a first request to a cloud capability platform; the first request is used to request allocation of cloud resources for a first task; receiving first information sent by the cloud capability platform; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing resource cost, the storage resource cost is calculated based on a to-be-processed data volume, a storage unit size and a cloud resource usage duration, the calculation logic of the storage resource cost is: (to-be-processed data volume / storage unit size) × cloud resource usage duration × unit storage unit size cost, the computing resource cost is calculated based on a number of called mathematical models, a mathematical model cost and a task processing duration; the first task is a cloud capability calling task, and the computing resource includes mathematical models that need to be called to execute the cloud capability calling task, the mathematical models are determined based on a data category and a task category selected by a user; presenting the first information; in response to a confirmation operation on the first information, sending second information to the cloud capability platform; the second information represents confirmation of the estimated cost; wherein the second information is stored by the cloud capability platform to a blockchain network, and the cloud resources allocated for the first task are used to execute the first task; after the execution of the first task is completed, third information is generated by the cloud capability platform, and the third information is stored by the cloud capability platform to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used; wherein the second information is stored by the cloud capability platform to a transaction structure body in the blockchain network, the transaction structure body includes a transaction hash, a timestamp, a prepayment amount, a receiving address, a data category, a task category, a time requirement, a resource requirement, and a transaction signature; the third information is stored by the cloud capability platform to a receipt structure body in the blockchain network, the receipt structure body includes a receipt hash, a timestamp, a sender address, a receiver address, a contract address, an amount, a computing resource usage, a storage usage, a processing duration, a transaction hash and a processing log.
8. The method of claim 7, wherein, The method further comprises: presenting a resource configuration function item for resource configuration in a configuration interface; in response to a resource configuration operation on the resource configuration function item, generating a resource requirement of the first task; based on the resource requirement, generating a first request; the first request contains the resource requirement.
9. The method according to claim 7 or 8, characterized in that, The method further comprises: sending a second request to the cloud capability platform; the second request is used to request transaction data of a first task; receiving transaction data sent by the cloud capability platform.
10. A resource allocation apparatus characterized by comprising: comprises: a first receiving unit, configured to receive a first request sent by a terminal; the first request is used to request allocation of cloud resources for a first task; and receiving second information sent by the terminal; the second information represents confirmation of an estimated cost; a first processing unit, configured to generate first information based on the first request, and send the first information to the terminal; a first processing unit, configured to generate first information based on the first request, and send the first information to the terminal; The first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing resource cost, the storage resource cost is calculated based on a to-be-processed data volume, a storage unit size and a cloud resource use duration, the calculation logic of the storage resource cost is: (to-be-processed data volume / storage unit size) × cloud resource use duration × cost of unit storage unit size, the computing resource cost is calculated based on a number of called mathematical models, a mathematical model cost and a task processing duration; the first task is a cloud capability calling task, the computing resource includes mathematical models that need to be called to execute the cloud capability calling task, the mathematical models are determined based on a data category and a task category selected by a user; the second information is stored to a blockchain network, and the first task is executed using the cloud resources allocated for the first task; wherein the second information is stored to a transaction structure body in the blockchain network, the transaction structure body includes a transaction hash, a timestamp, a prepayment amount, a receiving address, a data category, a task category, a time requirement, a resource requirement, a transaction signature; and a third information is generated after the execution of the first task is completed, and the third information is stored to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used; wherein the third information is stored to a receipt structure body in the blockchain network, the receipt structure body includes a receipt hash, a timestamp, a sender address, a receiver address, a contract address, an amount, a computing resource usage, a storage usage, a processing duration, a transaction hash and a processing log.
11. A resource allocation apparatus, characterized by comprising: Comprise: a sending unit configured to send a first request to a cloud capability platform; the first request is used to request to allocate cloud resources for a first task; a second receiving unit configured to receive first information sent by the cloud capability platform; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing resource cost, the storage resource cost is calculated based on a to-be-processed data volume, a storage unit size and a cloud resource use duration, the calculation logic of the storage resource cost is: (to-be-processed data volume / storage unit size) × cloud resource use duration × cost of unit storage unit size, the computing resource cost is calculated based on a number of called mathematical models, a mathematical model cost and a task processing duration; the first task is a cloud capability calling task, the computing resource includes mathematical models that need to be called to execute the cloud capability calling task, the mathematical models are determined based on a data category and a task category selected by a user; a second processing unit configured to present the first information; and in response to a confirmation operation on the first information, send second information to the cloud capability platform; the second information represents confirmation of the estimated cost; The second information is stored by the cloud capability platform to a blockchain network, and the first task is executed using the cloud resources allocated for the first task; the third information is generated by the cloud capability platform after the execution of the first task is completed, and the third information is stored by the cloud capability platform to the blockchain network; and the third information represents a receipt that the cloud resources allocated for the first task are used. The second information is stored by the cloud capability platform to a transaction structure in the blockchain network, and the transaction structure includes a transaction hash, a timestamp, a prepayment amount, a receiving address, a data category, a task category, a time requirement, a resource requirement, and a transaction signature; and the third information is stored by the cloud capability platform to a receipt structure in the blockchain network, and the receipt structure includes a receipt hash, a timestamp, an initiator address, a receiver address, a contract address, an amount, a computing power usage, a storage usage, a processing duration, a transaction hash, and a processing log.
12. A cloud capability platform, characterized by, The first communication interface is configured to receive a first request sent by a terminal. The first request is used to request allocation of cloud resources for a first task. The second information is received, and the second information represents confirmation of an estimated cost. The first processor is configured to generate first information based on the first request, and send the first information to the terminal by using the first communication interface. The first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing power resource cost, the storage resource cost is calculated based on a to-be-processed data amount, a storage unit size, and a cloud resource usage duration, and the calculation logic of the storage resource cost is (the to-be-processed data amount / the storage unit size)×the cloud resource usage duration×a unit storage unit size cost; the computing power resource cost is calculated based on a number of called mathematical models, a mathematical model cost, and a task processing duration; the first task is a cloud capability calling task, the computing power resource includes mathematical models that need to be called to execute the cloud capability calling task, and the mathematical models are determined based on a data category and a task category selected by a user; the second information is stored to a blockchain network by using the first communication interface, and the first task is executed using the cloud resources allocated for the first task; the third information is generated after the execution of the first task is completed, and the third information is stored to the blockchain network by using the first communication interface; and the third information represents a receipt that the cloud resources allocated for the first task are used. The first communication interface is configured to receive a first request sent by a terminal. The first request is used to request allocation of cloud resources for a first task.
13. A terminal, characterized by comprising: The second information is received, and the second information represents confirmation of an estimated cost. The first processor is configured to generate first information based on the first request, and send the first information to the terminal by using the first communication interface. The first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing power resource cost, the storage resource cost is calculated based on a to-be-processed data amount, a storage unit size, and a cloud resource usage duration, and the calculation logic of the storage resource cost is (the to-be-processed data amount / the storage unit size)×the cloud resource usage duration×a unit storage unit size cost; the computing power resource cost is calculated based on a number of called mathematical models, a mathematical model cost, and a task processing duration; the first task is a cloud capability calling task, the computing power resource includes mathematical models that need to be called to execute the cloud capability calling task, and the mathematical models are determined based on a data category and a task category selected by a user; the second information is stored to a blockchain network by using the first communication interface, and the first task is executed using the cloud resources allocated for the first task; the third information is generated after the execution of the first task is completed, and the third information is stored to the blockchain network by using the first communication interface; and the third information represents a receipt that the cloud resources allocated for the first task are used. The first communication interface is configured to receive a first request sent by a terminal. a second communication interface configured to send a first request to a cloud capability platform; the first request is configured to request allocation of cloud resources for a first task; receive first information sent by the cloud capability platform; the first information represents an estimated cost generated by using the cloud resources allocated for the first task; the estimated cost includes a storage resource cost and a computing resource cost, the storage resource cost is calculated based on an amount of data to be processed, a size of a storage unit and a duration of cloud resource usage, the calculation logic of the storage resource cost is: (amount of data to be processed / storage unit size) × duration of cloud resource usage × cost of unit storage unit size, the computing resource cost is calculated based on a number of mathematical models called, a mathematical model cost and a task processing duration; the first task is a cloud capability calling task, and the computing resource includes mathematical models called for executing the cloud capability calling task, the mathematical models are determined based on a data category and a task category selected by a user; a second processor configured to present the first information; and in response to a confirmation operation on the first information, send second information to the cloud capability platform using the second communication interface; the second information represents a confirmation of the estimated cost; wherein the second information is stored by the cloud capability platform to a blockchain network, and the first task is executed using the cloud resources allocated for the first task; after the execution of the first task is completed, third information is generated by the cloud capability platform, and the third information is stored by the cloud capability platform to the blockchain network; the third information represents a receipt that the cloud resources allocated for the first task are used; wherein the second information is stored by the cloud capability platform to a transaction structure body in the blockchain network, the transaction structure body includes transaction hash, timestamp, prepayment amount, receiving address, data category, task category, time requirement, resource requirement, transaction signature; the third information is stored by the cloud capability platform to a receipt structure body in the blockchain network, the receipt structure body includes receipt hash, timestamp, initiator address, recipient address, contract address, amount, computing resource usage, storage usage, processing duration, transaction hash, processing log.
14. A cloud capability platform, characterized by, comprising: a first processor and a first memory for storing a computer program capable of running on the processor; wherein the first processor is configured to execute the steps of the method of any one of claims 1 to 6 when running the computer program.
15. A terminal, characterized by comprising: a second processor and a second memory for storing a computer program capable of running on the processor; wherein the second processor is configured to execute the steps of the method of any one of claims 7 to 9 when running the computer program.
16. A storage medium having stored thereon a computer program, characterized in that the computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6, or implement the steps of the method of any one of claims 7 to 9.
Citation Information
Patent Citations
Data charging method and device
CN106817228A
Calculation resource scheduling method and device, computer equipment and storage medium
CN112035268A