Blockchain-based resource scheduling method and device, electronic equipment and storage medium
By using a blockchain-based resource scheduling method, multi-dimensional feature evaluation and optimized matching of tasks and resource nodes are performed, which solves the problem of low resource utilization in centralized GPU resource scheduling and achieves efficient and reasonable allocation of resources and transparent and reliable scheduling.
Patent Information
- Application Number
- CN202411975737.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The centralized architecture used in existing GPU resource scheduling results in resource utilization rates below 40%, wasted computing power, and a lack of standardized performance measurement and service quality assurance mechanisms. This makes performance interference difficult to control when running multiple tasks in parallel.
A blockchain-based resource scheduling method is adopted, which evaluates the priority of tasks to be processed, the capabilities and trust levels of resource nodes, and uses blockchain smart contracts to perform multi-dimensional feature evaluation and matching optimization to determine the target resource node.
It achieves the rational allocation and maximum utilization of resources, improves resource utilization efficiency, ensures the reasonable execution of tasks, avoids resource waste, and guarantees the transparency and immutability of the scheduling process through blockchain technology.
Smart Images

Figure CN119902887B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, in particular to a resource scheduling method and device based on a blockchain, an electronic device and a storage medium. BACKGROUND
[0002] At present, with the rapid development of artificial intelligence technology, many artificial intelligence models have emerged. Before these artificial intelligence models go online, systematic testing and evaluation of the performance, effect and ability of large-scale artificial intelligence models (such as large language models) are needed, and therefore the demand for GPU (Graphics Processing Unit, graphics processing unit) computing resources is increasing.
[0003] In related technologies, current GPU resource scheduling mainly adopts a centralized architecture. However, due to the traditional static allocation method, the GPU resource utilization rate is generally lower than 40%, and a large amount of computing power is wasted. Moreover, the existing system lacks a standardized performance measurement and quality of service guarantee mechanism, and the performance interference during multi-task parallelism is difficult to control, thereby causing low resource utilization efficiency when scheduling computing power resources to process related test tasks. SUMMARY
[0004] To solve the above technical problems, embodiments of the present application provide a resource scheduling method and device based on a blockchain, an electronic device and a storage medium to improve resource utilization efficiency.
[0005] According to an aspect of an embodiment of the present application, a resource scheduling method based on a blockchain is provided. The method is applied to a resource scheduling system, the resource scheduling system includes a resource layer, a resource scheduling layer and a blockchain layer, the resource layer includes a plurality of resource nodes for providing computing power resources; the resource scheduling layer includes a blockchain smart contract, the blockchain smart contract is used to schedule the resource nodes in the resource layer to execute a to-be-processed task; the blockchain layer is used for data storage and data verification; the method includes: performing priority evaluation on the to-be-processed task to obtain a first evaluation result, performing resource capability evaluation on the plurality of resource nodes to obtain a second evaluation result, and performing trust degree evaluation on the plurality of resource nodes to obtain a third evaluation result; matching the to-be-processed task and the plurality of resource nodes respectively to obtain a candidate matching degree corresponding to each of the plurality of resource nodes; optimizing the candidate matching degree according to the first evaluation result, the second evaluation result and the third evaluation result to obtain a target matching degree corresponding to each of the plurality of resource nodes; and determining a target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degree.
[0006] In some embodiments, the priority evaluation on the to-be-processed task to obtain a first evaluation result comprises: obtaining a task attribute score corresponding to the to-be-processed task, and obtaining a priority evaluation weight parameter corresponding to the task attribute score; wherein the task attribute score comprises a task urgency score, a task waiting time length score, and a task resource demand proportion; and the first evaluation result is obtained by weighted summation of the task attribute scores according to the priority evaluation weight parameter.
[0007] In some embodiments, the resource capability evaluation on the plurality of resource nodes to obtain a second evaluation result comprises: obtaining a resource attribute score of the plurality of resource nodes, and obtaining a resource capability evaluation weight parameter corresponding to the resource attribute score; wherein the resource attribute score comprises a performance score, a load balancing score, and a reliability score; and the second evaluation result is obtained by weighted summation of the resource attribute scores according to the resource capability evaluation weight parameter.
[0008] In some embodiments, the trust degree evaluation on the plurality of resource nodes to obtain a third evaluation result comprises: obtaining a historical credit feature of the plurality of resource nodes, and obtaining a trust degree weight parameter corresponding to the historical credit feature; wherein the historical credit feature comprises a node historical performance, a node consensus credibility, and a node stability; and the third evaluation result is obtained by weighted summation of the historical credit features according to the trust degree weight parameter.
[0009] In some embodiments, the matching of the to-be-processed task and the plurality of resource nodes respectively to obtain a candidate matching degree corresponding to each of the plurality of resource nodes comprises: obtaining a resource matching degree and a load matching degree when the to-be-processed task runs on each of the plurality of resource nodes, and obtaining a matching degree weight parameter corresponding to the resource matching degree and the load matching degree respectively; and the candidate matching degree corresponding to each of the plurality of resource nodes is obtained by weighted calculation of the resource matching degree and the load matching degree according to the matching degree weight parameter.
[0010] In some embodiments, the determination of the target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degree comprises: determining the resource node corresponding to the maximum value in the plurality of target matching degrees as the target resource node for executing the to-be-processed task.
[0011] In some embodiments, after the target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degree, the method further includes adjusting a preset weight parameter through a preset gradient descent optimization algorithm, wherein the preset weight parameter includes at least one of the priority evaluation weight parameter, the resource capability evaluation weight parameter, the trust degree weight parameter, and the matching degree weight parameter.
[0012] In some embodiments, according to an aspect of an embodiment of the present application, a resource scheduling device based on a blockchain is provided, the device includes: an evaluation module configured to perform priority evaluation on a to-be-processed task, obtain a first evaluation result, perform resource capability evaluation on a plurality of resource nodes, obtain a second evaluation result, and perform trust degree evaluation on the plurality of resource nodes, and obtain a third evaluation result; a matching module configured to match the to-be-processed task and the plurality of resource nodes respectively, and obtain a candidate matching degree corresponding to the plurality of resource nodes respectively; an optimization module configured to optimize the candidate matching degree according to the first evaluation result, the second evaluation result, and the third evaluation result, and obtain a target matching degree corresponding to the plurality of resource nodes respectively; and a determination module configured to determine a target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degree.
[0013] According to an aspect of an embodiment of the present application, an electronic device is provided, which includes one or more processors, and a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the resource scheduling method based on a blockchain as described above.
[0014] According to an aspect of an embodiment of the present application, a computer readable storage medium is provided, which stores computer readable instructions, when the computer readable instructions are executed by a processor of a computer, the computer executes the resource scheduling method based on a blockchain as described above.
[0015] In the technical scheme provided in the embodiments of the present application, the priority evaluation on the to-be-processed task, the resource capability evaluation on the plurality of resource nodes, and the trust degree evaluation on the plurality of resource nodes are performed, and then the matching degree between the to-be-processed task and the plurality of resource nodes is optimized based on the evaluation results obtained by the multi-dimensional feature evaluation mechanism, and finally the target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degree obtained by the optimized matching degree, which can realize calling the resource node with the optimal performance to execute the to-be-processed task, thereby ensuring the reasonable task allocation and maximizing the resource utilization rate, and further improving the resource utilization efficiency.
[0016] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application, as claimed. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and serve to explain the principles of the application. It is readily apparent to one skilled in the art that the following figures are merely some embodiments of the present application, and other figures can be obtained by those of ordinary skill in the art without creative work, based on these figures. In the drawings:
[0018] Figure 1 is a structural schematic diagram of a blockchain network according to an exemplary embodiment of the present application;
[0019] Figure 2 is a schematic diagram of an implementation environment according to the present application;
[0020] Figure 3 is an application schematic diagram of a blockchain-based resource scheduling method according to an exemplary embodiment of the present application;
[0021] Figure 4 is a flowchart of a blockchain-based resource scheduling method according to an exemplary embodiment of the present application;
[0022] Figure 5 is Figure 4 is a flowchart of step S410 in the embodiment shown in the present application, which is a priority evaluation of a to-be-processed task according to an exemplary embodiment;
[0023] Figure 6 is Figure 4 is a flowchart of step S410 in the embodiment shown in the present application, which is a resource capability evaluation of a plurality of resource nodes according to an exemplary embodiment;
[0024] Figure 7 is Figure 4 is a flowchart of step S410 in the embodiment shown in the present application, which is a trust evaluation of a plurality of resource nodes according to an exemplary embodiment;
[0025] Figure 8 is Figure 4 is a flowchart of step S420 in the embodiment shown in the present application, which is an optimization of an alternative matching degree according to an exemplary embodiment;
[0026] Figure 9 is a flowchart of a blockchain-based resource scheduling method according to another exemplary embodiment of the present application;
[0027] Figure 10 is a structural schematic diagram of a blockchain-based resource scheduling device according to an exemplary embodiment of the present application;
[0028] Figure 11 It is a structural diagram of a computer system of an exemplary electronic device of the present application. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments applicable to the present application. Rather, they are merely examples of apparatus and methods applicable to certain aspects of the present application, as detailed in the appended claims.
[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in the form of an application program, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0031] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0032] It should be noted that the term "plurality" used in this application refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0033] First of all, it is pointed out that the embodiments of the present application relate to blockchain technology. The blockchain technology is a new distributed infrastructure and computing method that uses a block chain data structure to verify and store data, uses a distributed node consensus algorithm to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses a smart contract composed of automatic script code to program and operate data. Specifically, it is a data structure that arranges data blocks in time sequence in a chain table-like manner, can securely store data with a chronological relationship that can be verified within the system, and uses cryptography to ensure that the data is not tamperable and not counterfeit. Simply put, the blockchain is a decentralized distributed ledger, and each chain is equivalent to an independent ledger. In the embodiments of the present application, the evaluation data hash and the evaluation result are stored through the blockchain layer in the resource scheduling system, to ensure the transparency and tamper resistance of the evaluation process.
[0034] Please refer to Figure 1 , Figure 1 is a structural schematic diagram of a blockchain network shown by an exemplary embodiment of the present application. Figure 1 The blockchain network 100 shown can include a node device 10a, a node device 10b, a node device 10c, and a node device 10d. Among them, the node device 10a, the node device 10b, the node device 10c, and the node device 10d are all Figure 1 The blockchain nodes (referred to as nodes) in the blockchain network 100 shown can be any form of computing devices connected to the blockchain network 100, such as servers, user terminals, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Basic cloud computing services such as platform. The terminal device can be a smartphone, tablet computer, notebook computer, desktop computer, smart speaker, smart watch, etc., but is not limited thereto. Each node can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application. Figure 1 The node device 10a, the node device 10b, the node device 10c, and the node device 10d shown can also be connected to form a blockchain network 100 through network communication.
[0035] Each node in the blockchain network 100 can be used to maintain the same blockchain (i.e. Figure 1The illustrated blockchain 10e) can have a plurality of smart contracts pre-deployed thereon, such as an agent contract, a permission management contract, a data contract, an agent management contract, and other smart contracts with different data processing functions. In the embodiments of the present application, the blockchain smart contract is used to manage the evaluation process, verify the permission, and record the results.
[0036] In the related art, the current GPU resource scheduling mainly adopts a centralized architecture. However, due to the traditional static allocation mode, the GPU resource utilization rate is generally lower than 40%, a large amount of computing power is wasted, and the existing system lacks a standardized performance measurement and quality of service guarantee mechanism. The performance interference during multi-task parallelism is difficult to control, thereby causing a low resource utilization efficiency when scheduling the computing power resources to process the related test tasks.
[0037] Therefore, in order to improve the resource utilization efficiency, the embodiments of the present application provide a resource scheduling method and device based on a blockchain, an electronic device, and a computer readable storage medium.
[0038] The resource scheduling scheme based on the blockchain provided by the embodiments of the present application will be described in detail below.
[0039] Please refer to Figure 2 , Figure 2 is a schematic diagram of an implementation environment related to the present application, which is specifically a resource scheduling system based on a blockchain. The resource scheduling system includes a resource layer 210, a resource scheduling layer 220, and a blockchain layer 230. The resource layer 210 includes a plurality of resource nodes for providing computing power resources. The resource scheduling layer 220 includes a blockchain smart contract, which is used to schedule the resource nodes in the resource layer to execute the to-be-processed tasks. The blockchain layer 230 is used for data storage and data verification.
[0040] The resource layer 210 is responsible for managing GPU computing power resources, and the core role is to integrate and schedule the computing power resources of GPU providers to provide efficient support for to-be-processed tasks. The resource layer 210 monitors the running state of the resource nodes in real time to ensure the stability and high availability of the resources.
[0041] The resource scheduling layer 220 is responsible for virtualizing physical GPU resources into vGPUs to provide standardized computing power and video memory capacity for tasks to be processed. Through the resource scheduling method proposed in the embodiments of the present application, based on the multi-dimensional feature evaluation and matching mechanism, the core features (such as computing demand, computing power, load, etc.) of tasks and resources can be quantified into scoring indicators, and the target matching degree is obtained by optimizing the matching degree through a three-layer scoring system (task priority, resource capacity, historical reputation). Moreover, the resource management layer 220 is deployed with a blockchain smart contract, and the global optimization decision is executed through the blockchain smart contract to maximize the resource utilization rate while ensuring reasonable allocation of tasks, solve the cross-organizational GPU resource collaboration problem, and realize decentralized scheduling through blockchain technology, break the resource island, and improve the overall computing power utilization rate.
[0042] The blockchain layer 230 is responsible for resource node data collection, then aggregates data on the blockchain network 100, stores it into the IPFS (InterPlanetary File System), realizes storage and verification of data, and provides open and transparent verification information for the resource scheduling process through the smart contract. The blockchain layer 230 ensures the credibility and non-tamperability of all task allocation, execution records and result verification data. In addition, the blockchain layer 230 is provided with a consensus algorithm, which can record the reputation scores of participants; at the same time, by collecting the historical reputation features of the resource nodes after each resource mobilization, the reputation score of the resource node can be dynamically adjusted, which can encourage high-quality resource nodes, improve the overall reliability and fairness of the system, and also solve the problem of credibility of GPU computing results, through the smart contract and multi-party verification mechanism, to ensure the reliability of the computing process and results.
[0043] For example, in combination with the resource scheduling method based on the blockchain shown in FIG. 2, the resource scheduling method based on the blockchain can be applied to the GPU computing platform shown in FIG. 3. Figure 3 As shown in FIG. 3, Figure 3 is an application schematic diagram of the resource scheduling method based on the blockchain shown in an exemplary embodiment of the present application. Figure 3In the process of evaluating the large model, the large model is controlled to perform one or more of the to-be-processed tasks such as a training task, an inference task, and a scoring task. At this time, after the resource scheduling system receives the to-be-processed task, the to-be-processed task is identified by the smart contract in the blockchain layer 230, the task attribute features corresponding to the to-be-processed task are obtained, and all the dimension resource features of each resource node are obtained. The task attribute features can include the deadline of the to-be-processed task, the current time, the maximum time window for executing the to-be-processed task, the current waiting time length and the average waiting time length for executing the to-be-processed task, etc. All the dimension resource features of each resource node can include the GPU computing power size, the memory size, the bandwidth, the current load, and the reliability, etc. The task attribute features of the to-be-processed task are expressed as a task feature vector in a preset format, and all the dimension resource features are expressed as a resource feature vector in a preset format. Then, the task feature vector and the resource feature vector are analyzed and processed by the smart contract to realize the priority evaluation of the to-be-processed task, the resource capability evaluation of the plurality of resource nodes, and the trust degree evaluation of the plurality of resource nodes. Then, the matching degree between the to-be-processed task and the plurality of resource nodes is optimized based on the evaluation results obtained by the multi-dimensional feature evaluation mechanism. Finally, the target matching degree obtained by optimizing the matching degree is used to determine the target resource node from the plurality of resource nodes for executing the to-be-processed task. The performance of the resource node calling the to-be-processed task can be optimized, and the to-be-processed task can be allocated to the adaptive resource node for execution, thereby ensuring reasonable task allocation and maximizing resource utilization, and further improving resource utilization efficiency.
[0044] After the to-be-processed task is executed, the resource node information is updated, that is, the GPU information is updated. The GPU information includes the computing power size, the memory size, the bandwidth, the current load, and the reliability of the resource node, etc.
[0045] Please continue to refer to Figure 4 , Figure 4 is a flowchart of a blockchain-based resource scheduling method according to an example embodiment of the present application. The method can be applied to Figure 2 the implementation environment shown in the figure and is specifically executed by the smart contract in the resource management layer 220 of the implementation environment. It should be understood that the method can also be applied to other example implementation environments and specifically executed by the smart contract in other implementation environments, and the present embodiment does not limit the implementation environment to which the method is applied.
[0046] As shown in Figure 4 , in an example embodiment, the blockchain-based resource scheduling method at least includes steps S410 to S440, which are described in detail as follows:
[0047] Step S410 , performing priority evaluation on the task to be processed to obtain a first evaluation result, performing resource capability evaluation on multiple resource nodes to obtain a second evaluation result, and performing trust evaluation on multiple resource nodes to obtain a third evaluation result.
[0048] It should be understood that the evaluation results in the embodiments of this application include scores used to quantify corresponding features. By quantifying and scoring the multi-dimensional features of the resource scheduling process, it is possible to more accurately allocate pending tasks, achieve decentralized scheduling of computing resources, and improve resource utilization efficiency. Furthermore, in the embodiments of this application, the resource scheduling algorithm is automatically executed through blockchain smart contracts, which can reduce human intervention and improve scheduling fairness.
[0049] In some embodiments, when testing and evaluating a large model, there may be multiple tasks to be processed at the same time, such as training tasks, inference tasks, and scoring tasks. By performing priority evaluation on the tasks to be processed, the tasks that need to be executed first can be determined, and resources can be scheduled to execute high-priority tasks to be processed, thereby improving work efficiency. At the same time, when resources are limited, giving priority to high-priority tasks can also ensure the effective use of resources, avoid resource waste, and improve resource utilization efficiency.
[0050] Combine Figure 5 As shown, Figure 5 yes Figure 4 Step S410 in the illustrated embodiment is a flowchart of performing priority evaluation on pending tasks in an exemplary embodiment, which includes at least steps S510 to S520, which are described in detail as follows:
[0051] Step S510: Obtain the task attribute score corresponding to the task to be processed, and obtain the priority evaluation weight parameter corresponding to the task attribute score.
[0052] Among them, the task attribute score includes the task urgency score, the task waiting time score and the task resource requirement ratio.
[0053] For example, in the embodiments of the present application, a task urgency score can be obtained by obtaining task attribute characteristics of the pending task, and calculating the task attribute characteristics using a preset urgency function to obtain the task urgency score. The task attribute characteristics include the deadline of the pending task, the current time, and the maximum time window for executing the pending task.
[0054] In some embodiments, the task attribute characteristics are calculated by a preset urgency function to obtain the task urgency score, including: calculating Get the task urgency score. Among them, U(t i) is the task urgency score of the i-th pending task, λ is the preset time decay factor, Deadline is the deadline of the i-th pending task, CurrentTime is the current time, and MaxTimeWindow is the maximum time window for executing the pending task.
[0055] For example, in the embodiments of the present application, the task waiting time score can be obtained by: obtaining the task attribute characteristics of the pending task; and calculating the task attribute characteristics using a preset waiting time function to obtain the task waiting time score. The task attribute characteristics also include the current waiting time and the average waiting time for executing the pending task.
[0056] In some embodiments, the task attribute characteristics are calculated by a preset waiting time function to obtain the task waiting time score, including: Get the task waiting time score. Among them, W(t i ) is the task waiting time score of the i-th pending task, μ is the preset waiting time gain factor, WaitingTime is the current waiting time for executing the pending task, and AverageWaitTime is the average waiting time.
[0057] Exemplarily, the task resource requirement ratio in the embodiment of the present application can be obtained by the following methods, including: obtaining the task attribute characteristics of the task to be processed; calculating the task attribute characteristics through a preset resource requirement function to obtain the resource requirement ratio; wherein the task attribute characteristics include the resource requirement size of the task to be processed and the maximum resource requirement that the resource scheduling system can provide.
[0058] In some embodiments, the task attribute characteristics are calculated by a preset resource demand function to obtain the resource demand ratio, including: Get the resource demand ratio; where R(t i ) is the task resource demand ratio of the i-th task to be processed, ResourceDemand is the resource demand size of the task to be processed, and MaxResourceDemand is the maximum resource demand that the resource scheduling system can provide.
[0059] In some embodiments, obtaining the priority evaluation weight parameters corresponding to the task attribute score includes: matching the priority evaluation weight parameters corresponding to the task attributes of the task attribute score from a preset database; wherein the preset database stores the correspondence between the task attributes and the priority evaluation weight parameters.
[0060] Step S520 , performing weighted summation on the task attribute scores according to the priority evaluation weight parameter to obtain a first evaluation result.
[0061] It is understandable that the first evaluation result is a score for the task priority. In the embodiment of the present application, by obtaining the priority evaluation weight parameters corresponding to the task attributes to balance the scores of each task attribute, the sensitivity of the priority scoring algorithm can be adjusted. At the same time, different weight parameters are used to constrain the scores of different types of task attributes, which can optimize the priority score and thus more accurately obtain the task priority score.
[0062] In some embodiments, the first evaluation result can be obtained by weighting and summing the task attribute scores according to the priority evaluation weight parameter in the following manner, including: calculating P(t i )=α1U(t i )+α2W(t i )+α3R(t i ) obtain the first evaluation result; wherein, t i is the i-th task to be processed, P(t i ) is the first evaluation result corresponding to the i-th pending task, that is, the priority score of the i-th pending task. The value range of the first evaluation result is a positive real number; U(t i ) is the urgency score of the i-th pending task, W(t i ) is the task waiting time score of the i-th pending task, R(t i ) is the task resource requirement ratio of the i-th task to be processed. α1, α2, and α3 are priority evaluation weight parameters. In some embodiments, α1, α2, α3∈[0,1], and α1+α2+α3=1.
[0063] Combine Figure 6 As shown, Figure 6 yes Figure 4 Step S410 in the illustrated embodiment is a flowchart of performing resource capability evaluation on multiple resource nodes in an exemplary embodiment, which includes at least steps S610 to S620, which are described in detail as follows:
[0064] Step S610: Obtain resource attribute scores of multiple resource nodes, and obtain resource capability evaluation weight parameters corresponding to the resource attribute scores.
[0065] The resource attribute scores include performance scores, load balancing scores, and reliability scores. In some embodiments, the performance score ranges from [0, 1], the load balancing score ranges from [0, 1], and the reliability score ranges from [0, 1].
[0066] Exemplarily, the performance score of each resource node in the embodiment of the present application can be obtained by the following methods, including: obtaining the current available resource amount of each dimension of each resource node; wherein the resource amount of each dimension includes five dimensions, namely, GPU computing power size, video memory size, bandwidth, current load and reliability; calculating the current available resource amount of each dimension through a preset performance scoring function to obtain a performance score.
[0067] In some embodiments, the currently available resources in each dimension are calculated using a preset performance scoring function to obtain a performance score, including: Get performance score; where g j Used to characterize the jth resource node, P(g j ) is the performance score of the j-th resource node, g j .resource m is the current available resource amount of the mth dimension of the jth resource node, max_resource m is the maximum resource amount of the mth dimension, β m is the weight parameter corresponding to the resource amount in the mth dimension.
[0068] For example, each resource node includes five dimensions of resource features, namely GPU computing power, memory size, bandwidth, current load and reliability. For example, the first dimension of resource features is GPU computing power, the second dimension of resource features is memory size, the third dimension of resource features is bandwidth, the fourth dimension of resource features is current load, and the fifth dimension of resource features is reliability. Then g j .resource m The value of m ranges from 1 to 5. For example, if g1.resource2 is 8 GB, then g1.resource2 can be used to represent the current available resource amount of the second dimension of the first resource node as 8 GB, that is, the available video memory size in the first resource node is 8 GB. The resource characteristics of other dimensions are similar.
[0069] Exemplarily, the load balancing score of each resource node in the embodiment of the present application can be obtained by the following methods, including: obtaining the current load of each resource node; calculating the current load through a preset load balancing function to obtain the load balancing score.
[0070] In some embodiments, the current load is calculated by a preset load balancing function to obtain a load balancing score, including: Get the load balancing score; where L(g j ) is the load balancing score of the j-th resource node, g jCurrent_load is the current load of the jth resource node, g j .Max_load is the maximum load of the jth resource node.
[0071] Exemplarily, the reliability score of each resource node in the embodiment of the application can be obtained by the following method, comprising: obtaining the reliability features of each resource node; wherein the reliability features comprise the task execution success rate, the resource uptime rate and the response rate; and calculating the reliability features by a preset reliability function to obtain the reliability score.
[0072] In some embodiments, the reliability score is obtained by calculating the reliability features by a preset reliability function, comprising: obtaining the reliability score by calculating R(g j ) = λ1Success_Rate j + λ2Uptime_Rate j + λ3Response_Rate j ; wherein R(g j ) is the reliability score of the jth resource node, Success_Rate j is the task execution success rate of the jth resource node, Uptime_Rate j is the resource uptime rate of the jth resource node, and Response_Rate j is the response rate of the jth resource node. λ1, λ2 and λ3 are preset weight parameters, and in some embodiments, λ1+ λ2+ λ3= 1.
[0073] In some embodiments, the resource capability evaluation weight parameter corresponding to the resource attribute score is obtained, comprising: matching the resource capability evaluation weight parameter corresponding to the resource attribute of the resource attribute score from a preset database; wherein the preset database stores the corresponding relationship between the resource attribute and the resource capability evaluation weight parameter.
[0074] Step S620, the resource attribute scores are weighted and summed according to the resource capability evaluation weight parameter to obtain a second evaluation result.
[0075] It can be understood that the second evaluation result is the score of the resource capability. In the embodiment of the application, the resource capability scores are balanced by obtaining the resource capability evaluation weight parameter corresponding to the resource attribute, which can adjust the sensitivity of the resource capability score algorithm, and at the same time, different weight parameters are used to constrain the scores of different types of resource capabilities, which can optimize the resource capability score, so that the resource capability score can be obtained more accurately.
[0076] Exemplarily, performing weighted summation on the resource attribute scores according to the resource capability evaluation weight parameter to obtain the second evaluation result includes: calculating S(g j )=w1P(g j )+w2L(g j )+w3R(g j ) obtains the second evaluation result; wherein, S(g j ) is the second evaluation result of the j-th resource node, P(g j ) is the performance score of the j-th resource node, L(g j ) is the load balancing score of the j-th resource node, R(g j ) is the reliability score of the j-th resource node, w1, w2 and w3 are resource capability evaluation weight parameters, and in some embodiments, w1, w2, w3∈[0,1], and w1+w2+w3=1.
[0077] Combine Figure 7 As shown, Figure 7 yes Figure 4 Step S410 in the illustrated embodiment is a flowchart of performing trust evaluation on multiple resource nodes in an exemplary embodiment, which includes at least steps S710 to S720, which are described in detail as follows:
[0078] Step S710: Obtain historical reputation features of multiple resource nodes, and obtain trust weight parameters corresponding to the historical reputation features.
[0079] Among them, historical reputation features include node historical performance, node consensus credibility and node stability.
[0080] In some embodiments, the historical reputation features of each resource node in the embodiments of the present application can be obtained by the following methods, including: matching the historical reputation features corresponding to the resource nodes from a preset database; wherein the preset database stores the correspondence between the resource nodes and the historical reputation features.
[0081] In some embodiments, the trust weight parameters corresponding to the historical reputation features in the embodiments of the present application can be obtained by the following methods, including: matching the trust weight parameters corresponding to the historical reputation features in a preset database; wherein the preset database stores the correspondence between the historical reputation features and the trust weight parameters.
[0082] Step S720 , performing weighted summation on the historical reputation features according to the trust weight parameter to obtain a third evaluation result.
[0083] It is understandable that the third evaluation result is a trust score for each resource node. In the embodiment of the present application, the historical credit features are balanced by obtaining the trust weight parameters corresponding to the historical credit features, which can adjust the sensitivity of the trust scoring algorithm. At the same time, different weight parameters are used to constrain different types of historical credit features, which can optimize the trust score and obtain a more accurate trust score. In addition, by introducing a trust scoring mechanism, the historical performance and service quality of resource providers are scored, which helps the system evaluate the value of their resources and give priority to allocating resources to resource nodes with high trust scores, thereby improving task execution efficiency and effectively preventing malicious node behavior, thereby ensuring the overall security and fairness of the scheduling system.
[0084] Exemplarily, performing weighted summation of historical reputation features according to the trust weight parameter to obtain the third evaluation result includes: calculating Trust(g j ) = η1HistoricalPerf j +η2ConsensusValid j +η3Stability j Obtain the third evaluation result; wherein, Trust(g j ) is the third evaluation result of the j-th resource node, that is, the trust score of the j-th resource node, HistoricalPerf j is the historical performance of the j-th resource node, ConsensusValid j Stability is the node consensus credibility of the j-th resource node. j is the node stability of the jth resource node. η1, η2, and η3 are trust weight parameters. In some embodiments, η1+η2+η3=1.
[0085] Step S420 : Match the task to be processed with the multiple resource nodes respectively to obtain candidate matching degrees corresponding to the multiple resource nodes.
[0086] It is understandable that in the embodiment of the present application, the tasks to be processed and multiple resource nodes can be pre-allocated to obtain the alternative matching degree between each resource node and the tasks to be processed, thereby obtaining a preliminary matching result.
[0087] Combine Figure 8 As shown, Figure 8 yes Figure 4 The flowchart of step S420 in the illustrated embodiment for optimizing the candidate matching degree in an exemplary embodiment includes at least steps S810 to S820, which are described in detail as follows:
[0088] In step S810, the resource matching degree and the load matching degree when the to-be-processed task runs on the plurality of resource nodes are obtained, and the matching degree weight parameters corresponding to the resource matching degree and the load matching degree are obtained.
[0089] It can be understood that when the to-be-processed task is allocated to the resource node for processing, whether the current remaining available resource amount and the current responsible situation in the resource node are sufficient to execute the to-be-processed task needs to be considered, so as to avoid the situation that the resource node is overloaded and the task processing fails, and the load can be balanced and the task failure rate can be reduced; and by comprehensively considering the resource matching and the load matching, it can be ensured that the task is allocated to the most suitable resource node, so as to improve the processing efficiency and the response speed of the entire scheduling system.
[0090] Exemplarily, in the embodiment of the present application, the resource matching degree when the to-be-processed task runs on the plurality of resource nodes can be obtained in the following manner, which comprises: obtaining the resource matching degree; wherein F(t i ,g j ) is the resource matching degree when the i th to-be-processed task runs on the j th resource node; g j .resource m is the current available resource amount of the m th dimension of the j th resource node, t i .requirement m is the required resource amount of the m th dimension of the i th to-be-processed task. By taking the minimum value of the above resource matching degree, the reasonable allocation of the to-be-processed task can be realized, and the available resources can be used to the maximum extent and the resource waste can be avoided.
[0091] Exemplarily, in the embodiment of the present application, the load matching degree corresponding to the plurality of resource nodes can be obtained in the following manner, which comprises: obtaining the load matching degree; wherein E(t i ,g j ) is the load matching degree between the i th to-be-processed task and the j th resource node, g j .Current_load is the current load of the j th resource node, g j .Max_load is the maximum load of the j th resource node.
[0092] In some embodiments, the matching degree weight parameters corresponding to the resource matching degree and the load matching degree are obtained, which comprises: matching the matching degree weight parameters corresponding to the resource matching degree from a preset database, and matching the matching degree weight parameters corresponding to the load matching degree from the preset database. Wherein, the preset database stores the corresponding relationship between the resource matching degree and the matching degree weight parameter, and the corresponding relationship between the load matching degree and the matching degree weight parameter.
[0093] Step S820, the resource matching degree and the load matching degree are weighted according to the matching degree weight parameter, and the candidate matching degrees corresponding to the plurality of resource nodes are obtained.
[0094] In some embodiments, the resource matching degree and the load matching degree are weighted according to the matching degree weight parameter, and the candidate matching degrees corresponding to the plurality of resource nodes are obtained, including: calculating M(t i ,g j )=γ1F(t i ,g j )+γ2E(t i ,g j ) to obtain the candidate matching degree corresponding to the resource node; wherein M(t i ,g j ) is the candidate matching degree between the i th to-be-processed task and the j th resource node, F(t i ,g j ) is the resource matching degree between the i th to-be-processed task and the j th resource node, and E(t i ,g j ) is the load matching degree between the i th to-be-processed task and the j th resource node. γ1 and γ2 are matching degree weight parameters, and in some embodiments, γ1+γ2=1.
[0095] Step S430, the candidate matching degree is optimized according to the first evaluation result, the second evaluation result and the third evaluation result, and the target matching degrees corresponding to the plurality of resource nodes are obtained.
[0096] In the embodiments of the application, the first evaluation result is the priority score, the second evaluation result is the resource capability score, and the third evaluation result is the trust score; the candidate matching degree is optimized through the above-mentioned three-dimensional scoring mechanism, and more accurate target matching degrees can be obtained, so that the scheduling system can ensure reasonable task allocation when scheduling resources according to the target matching degrees, and at the same time, the resource utilization rate is maximized.
[0097] Exemplarily, the candidate matching degree is optimized according to the first evaluation result, the second evaluation result and the third evaluation result, and the target matching degrees corresponding to the plurality of resource nodes are obtained, including: calculating M'(t i ,g j )=M(t i ,g j )*P(t i )*S(g i )*Trust(g j ) to obtain the target matching degree; wherein M'(t i ,g j) is a target matching degree between the i th to-be-processed task and the j th resource node, M(t i ,g j ) is a candidate matching degree between the i th to-be-processed task and the j th resource node, P(t i ) is a first evaluation result corresponding to the i th to-be-processed task, that is, a priority score, S(g j ) is a second evaluation result of the j th resource node, that is, a resource capability score, Trust(g j ) is a third evaluation result of the j th resource node, that is, a trust score.
[0098] In step S440, a target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degrees.
[0099] It can be understood that, in the embodiments of the present application, the target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degrees, which can filter out a target resource node that is more suitable for the current to-be-processed task, thereby avoiding resource waste and improving resource utilization efficiency.
[0100] Exemplarily, in the embodiments of the present application, the target resource node for executing the to-be-processed task can be determined from the plurality of resource nodes according to the target matching degrees in the following manner: the resource node corresponding to the maximum value in the plurality of target matching degrees is determined as the target resource node for executing the to-be-processed task. In this way, by determining the resource node with the maximum target matching degree as the target resource node for executing the to-be-processed task, the task can be reasonably distributed while the resource utilization rate is maximized.
[0101] In some embodiments, the resource node corresponding to the maximum value in the plurality of target matching degrees can be determined as the target resource node for executing the to-be-processed task in the following manner: a global optimization function is used to calculate the target matching degrees respectively corresponding to the plurality of resource nodes, and the target resource node is obtained.
[0102] In some embodiments, the global optimization function is Maximize∑ i ∑ j X ij M'(t i ,g j ); wherein X ij is used to represent whether the i th to-be-processed task is allocated on the j th resource node, in some embodiments, if X ij = 1, it is considered that the i th to-be-processed task is allocated on the j th resource node; if X ij = 0, it is considered that the i th to-be-processed task is not allocated on the j th resource node; M'(t i ,gj ) is a target matching degree between the i-th to-be-processed task and the j-th resource node.
[0103] In another embodiment, the blockchain-based resource scheduling method provided by the embodiments of the present application further includes the following constraint conditions, which are specifically executed by the block chain smart contract, and the constraint conditions include:
[0104] Task unique allocation constraint C1: ∑ j X ij = 1, X ij ∈ {0, 1}; by setting the task unique allocation constraint C1, it can be ensured that only one to-be-processed task is executed on a resource node at the same time, thereby improving the task execution efficiency and stability.
[0105] Capacity constraint C2: ∑ j X ij L(t i ) ≤ C j , wherein L(t i ) is the load demand of the i-th task, and C j is the load upper limit of the j-th resource node; by setting the capacity constraint C2, the task loads allocated on the j-th resource node are added to ensure that the task load allocated on the resource node is lower than the load upper limit of the resource node, thereby ensuring that the resource node can be stably operated and improving the task execution success rate.
[0106] Load balancing constraint C3: wherein var(L) is the total load of the j-th resource node, L(t i ) is the load demand of the i-th task, L - is the average load of all resource nodes, σ 2 is a preset load parameter, and m is the total number of resource feature dimensions of the resource node. In this way, by setting the load balancing constraint C3, the resource node can be prevented from being overloaded, thereby improving the resource utilization efficiency.
[0107] In this way, by using the block chain smart contract to execute the above constraint conditions, global optimization decisions in the resource scheduling process can be realized, and the resource utilization rate is maximized while ensuring reasonable allocation of tasks.
[0108] Exemplarily, the target resource node for executing the to-be-processed task can also be determined from the plurality of resource nodes according to the target matching degree in the embodiments of the present application in the following manner: a preset number of target matching degrees with the largest values are determined from the plurality of target matching degrees, and a resource node that has not been used in a preset time period is selected as the target resource node from the resource nodes corresponding to the preset number of target matching degrees with the largest values. The preset time period is the last task processing period, for example, the past 2 hours. In this way, by selecting the resource node that has not been used in the last task processing period from the preset number of target matching degrees with the largest values as the target resource node, it is possible to avoid continuous use of the same resource node, prevent the node from being overloaded or becoming a bottleneck, and thus help achieve more uniform load distribution in the entire resource scheduling system and improve overall performance and efficiency.
[0109] Please continue to refer to Figure 9 , Figure 9 is a flowchart of a resource scheduling method based on a blockchain according to another exemplary embodiment of the present application. After determining the target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degree, the resource scheduling method based on the blockchain at least further includes step S910, which is described in detail as follows:
[0110] S910, adjusting the preset weight parameter by a preset gradient descent optimization algorithm.
[0111] It can be understood that, in the embodiments of the present application, the weight parameter is adjusted by the preset gradient descent optimization algorithm after each resource scheduling, which can realize dynamic adjustment of the weight parameter, thereby ensuring the reliability and efficiency in the resource scheduling process; at the same time, the resource allocation strategy is optimized through dynamic weight adjustment.
[0112] It can be understood that, in the embodiments of the present application, the weight parameter is adjusted by the preset gradient descent optimization algorithm after each resource scheduling, which can realize dynamic adjustment of the weight parameter, thereby ensuring the reliability and efficiency in the resource scheduling process; at the same time, the resource allocation strategy is optimized through dynamic weight adjustment.
[0113] In some embodiments, the priority evaluation weight parameter is adjusted by the preset gradient descent optimization algorithm, including: the priority evaluation weight parameter is adjusted by calculating to obtain the adjusted priority evaluation weight parameter. Wherein, J(α z )=-∑ i ∑ j X ij M'(t i ,g j )+τ1C1+τ2C2+τ3C3, X ij is used to represent whether the i-th to-be-processed task is allocated on the j-th resource node. In some embodiments, if X ijX ij = 1, it is considered that the i-th to-be-processed task is allocated on the j-th resource node; if X ij = 0, it is considered that the i-th to-be-processed task is not allocated on the j-th resource node, M'(t i ,g j ) is the target matching degree between the i-th to-be-processed task and the j-th resource node, J(a z ) is a loss function in the gradient descent optimization algorithm, τ1, τ2 and τ3 are preset parameters in the loss function; C1, C2 and C3 are preset constants in the loss function, a' z is the adjusted priority evaluation weight parameter, a z is the priority evaluation weight parameter before adjustment, and η is a preset learning rate.
[0114] In some embodiments, the resource capability evaluation weight parameter is adjusted by a preset gradient descent optimization algorithm, including: obtaining the adjusted resource capability evaluation weight parameter by calculating . Wherein, J(w z ) = -∑ i ∑ j X ij M'(t i ,g j ) + τ1C1 + τ2C2 + τ3C3, X ij is used to represent whether the i-th to-be-processed task is allocated on the j-th resource node, in some embodiments, if X ij = 1, it is considered that the i-th to-be-processed task is allocated on the j-th resource node; if X ij = 0, it is considered that the i-th to-be-processed task is not allocated on the j-th resource node, M'(t i ,g j ) is the target matching degree between the i-th to-be-processed task and the j-th resource node, J(w z ) is a loss function in the gradient descent optimization algorithm, τ1, τ2 and τ3 are preset parameters in the loss function; C1, C2 and C3 are preset constants in the loss function, w' z is the adjusted resource capability evaluation weight parameter, w z is the resource capability evaluation weight parameter before adjustment, and η is a preset learning rate.
[0115] In some embodiments, the trust degree weight parameter is adjusted by a preset gradient descent optimization algorithm, including: obtaining the adjusted trust degree weight parameter by calculating . Wherein, J(η z ) = -Σ i ∑ j X ijM'(t i ,g j )+τ1C1+τ2C2+τ3C3, X ij is used to represent whether the ith to-be-processed task is allocated on the jth resource node, in some embodiments, if X ij = 1, it is considered that the ith to-be-processed task is allocated on the jth resource node; if X ij = 0, it is considered that the ith to-be-processed task is not allocated on the jth resource node, M'(t i ,g j ) is the target matching degree between the ith to-be-processed task and the jth resource node, J(η z ) is a loss function in the gradient descent optimization algorithm, τ1, τ2 and τ3 are preset parameters in the loss function; C1, C2 and C3 are preset constants in the loss function, η' z is the adjusted trust weight parameter, η z is the unadjusted trust weight parameter, and η is a preset learning rate,
[0116] In some embodiments, the matching degree weight parameter is adjusted by a preset gradient descent optimization algorithm, including: obtaining the adjusted trust weight parameter by calculating . Wherein, J(γ e ) = -∑ i ∑ j X ij M'(t i ,g j )+τ1C1+τ2C2+τ3C3, X ij is used to represent whether the ith to-be-processed task is allocated on the jth resource node, in some embodiments, if X ij = 1, it is considered that the ith to-be-processed task is allocated on the jth resource node; if X ij = 0, it is considered that the ith to-be-processed task is not allocated on the jth resource node, M'(t i ,g j ) is the target matching degree between the ith to-be-processed task and the jth resource node, J(γ e ) is a loss function in the gradient descent optimization algorithm, τ1, τ2 and τ3 are preset parameters in the loss function; C1, C2 and C3 are preset constants in the loss function, γ' e is the adjusted trust weight parameter, γ e is the unadjusted trust weight parameter, and η is a preset learning rate,
[0117] In combination with FIG. 1, Figure 10 Figure 10 The device is a blockchain-based resource scheduling device shown in an example embodiment of the present application, and the device comprises an evaluation module 1010, a matching module 1020, an optimization module 1030, and a determination module 1040. The evaluation module 1010 is configured to perform priority evaluation on a to-be-processed task, obtain a first evaluation result, perform resource capability evaluation on a plurality of resource nodes, obtain a second evaluation result, and perform trust degree evaluation on the plurality of resource nodes, and obtain a third evaluation result; the matching module 1020 is configured to match the to-be-processed task and the plurality of resource nodes respectively, and obtain a plurality of candidate matching degrees respectively corresponding to the plurality of resource nodes; the optimization module 1030 is configured to optimize the candidate matching degrees according to the first evaluation result, the second evaluation result, and the third evaluation result, and obtain a plurality of target matching degrees respectively corresponding to the plurality of resource nodes; and the determination module 1040 is configured to determine a target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degrees.
[0118] In some embodiments, the evaluation module 1010 is configured to perform priority evaluation on the to-be-processed task to obtain the first evaluation result by: obtaining a task attribute score corresponding to the to-be-processed task, and obtaining a priority evaluation weight parameter corresponding to the task attribute score; wherein the task attribute score comprises a task urgency score, a task waiting time length score, and a task resource demand proportion; and performing weighted summation on the task attribute score according to the priority evaluation weight parameter to obtain the first evaluation result.
[0119] In some embodiments, the evaluation module 1010 is configured to perform resource capability evaluation on the plurality of resource nodes to obtain the second evaluation result by: obtaining a resource attribute score of the plurality of resource nodes, and obtaining a resource capability evaluation weight parameter corresponding to the resource attribute score; wherein the resource attribute score comprises a performance score, a load balancing score, and a reliability score; and performing weighted summation on the resource attribute score according to the resource capability evaluation weight parameter to obtain the second evaluation result.
[0120] In some embodiments, the evaluation module 1010 is configured to perform trust degree evaluation on the plurality of resource nodes to obtain the third evaluation result by: obtaining a historical credit feature of the plurality of resource nodes, and obtaining a trust degree weight parameter corresponding to the historical credit feature; wherein the historical credit feature comprises a node historical performance, a node consensus credibility, and a node stability; and performing weighted summation on the historical credit feature according to the trust degree weight parameter to obtain the third evaluation result.
[0121] In some embodiments, the matching module 1020 is configured to match the to-be-processed task and the plurality of resource nodes respectively, and obtain the candidate matching degrees respectively corresponding to the plurality of resource nodes, by: obtaining resource matching degrees and load matching degrees when the to-be-processed task respectively runs on the plurality of resource nodes, and obtaining matching degree weight parameters respectively corresponding to the resource matching degrees and the load matching degrees; and performing weighted calculation on the resource matching degrees and the load matching degrees according to the matching degree weight parameters, to obtain the candidate matching degrees respectively corresponding to the plurality of resource nodes.
[0122] In some embodiments, the determining module 1040 is configured to determine the target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degrees, by: determining, as the target resource node for executing the to-be-processed task, a resource node corresponding to a maximum value in the plurality of target matching degrees.
[0123] In some embodiments, the blockchain-based resource scheduling apparatus further includes an updating module configured to, after determining the target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degrees, adjust a preset weight parameter by using a preset gradient descent optimization algorithm; wherein the preset weight parameter includes at least one of a priority evaluation weight parameter, a resource capability evaluation weight parameter, a trust degree weight parameter, and a matching degree weight parameter.
[0124] The embodiments of the present disclosure further provide an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above-mentioned method.
[0125] Figure 11 The structure schematic diagram of the computer system of the electronic device suitable for implementing the embodiments of the present application is shown. It should be noted that, Figure 11 The computer system 1100 of the electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0126] As Figure 11As shown, the computer system 1100 includes a central processing unit (CPU) 1101 which can perform various appropriate actions and processes in accordance with a program stored in a read-only memory (ROM) 1102 or a program loaded from the storage section 1108 into a random access memory (RAM) 1103, such as executing the methods in the above-described embodiments. In the random access memory 1103, various programs and data required for the operation of the system are also stored. The central processing unit 1101, the read-only memory 1102, and the random access memory 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0127] Connected to the input / output interface 1105 are an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output interface 1105 as necessary. A removable recording medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1110 as necessary, so that a computer program read therefrom is installed into the storage section 1108 as necessary.
[0128] In particular, according to embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing computer programs for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 1109, and / or installed from the removable recording medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0129] The embodiments of the present disclosure also provide a computer readable storage medium, having stored thereon computer readable instructions, which when executed by a processor of a computer, cause the computer to perform the above-described blockchain-based resource scheduling method.
[0130] Note that the computer readable medium shown in the embodiments of the present application can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium may, for example, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer readable signal medium can include a data signal embodied in or transmitted by a carrier wave or a program medium, in which the computer readable program can be included. Such a program medium can take many forms, including but not limited to, a magnetic storage medium, an optical storage medium, or any suitable combination thereof. The computer readable program medium can also be any computer readable medium other than a storage medium that can transmit, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable program medium includes the computer readable program that can be transmitted or received over a network via a modem, or other suitable combination of hardware, software, or firmware.
[0131] The flowcharts and block diagrams in the drawings illustrate the possible architectures, functionality, and operations of systems, methods, and computer program products according to various embodiments of the present application. Each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks noted in succession can in fact be executed substantially concurrently or in the reverse order, depending on the functionality involved. It will also be noted that each block in the flowcharts or block diagrams and combinations of blocks in the flowcharts or block diagrams can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0132] The units described in the embodiments of the present application can be implemented in the form of software, or can be implemented in the form of hardware, and the described units can also be arranged in a processor. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0133] The present application also provides a computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the blockchain-based resource scheduling method as described above. The computer readable storage medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device.
[0134] The above is only a preferred exemplary embodiment of the present application, and is not intended to limit the implementation of the present application. Those skilled in the art can easily make corresponding modifications or changes according to the main concept and spirit of the present application, and therefore the protection scope of the present application should be subject to the protection scope required by the claims.
Claims
1. A blockchain-based resource scheduling method, characterized in that, The method is applied to a resource scheduling system, the resource scheduling system comprising a resource layer, a resource scheduling layer and a blockchain layer, the resource layer comprising a plurality of resource nodes for providing computing power resources; the resource scheduling layer comprising a blockchain smart contract, the blockchain smart contract being used for scheduling the resource nodes in the resource layer to execute a to-be-processed task; The blockchain layer is used for data storage and data verification; the method comprises: priority evaluation of the to-be-processed task to obtain a first evaluation result, resource capability evaluation of the plurality of resource nodes to obtain a second evaluation result, and trust degree evaluation of the plurality of resource nodes to obtain a third evaluation result; matching the to-be-processed task and the plurality of resource nodes respectively to obtain a plurality of candidate matching degrees respectively corresponding to the plurality of resource nodes; optimizing the candidate matching degrees according to the first evaluation result, the second evaluation result and the third evaluation result to obtain target matching degrees respectively corresponding to the plurality of resource nodes; determining a target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degrees. The optimization of the alternative matching degree according to the first evaluation result, the second evaluation result and the third evaluation result obtains the target matching degree corresponding to the plurality of resource nodes respectively, comprising: obtaining a target matching degree; wherein is the target matching degree between the i th to-be-processed task and the j th resource node, is the alternative matching degree between the i th to-be-processed task and the j th resource node, is the first evaluation result corresponding to the i th to-be-processed task, that is, the priority score, is the second evaluation result of the j th resource node, that is, the resource capability score, is the third evaluation result of the j th resource node, that is, the trust degree score.
2. The method of claim 1, wherein, The priority evaluation of the to-be-processed task to obtain a first evaluation result comprises: obtaining a task attribute score corresponding to the to-be-processed task and obtaining a priority evaluation weight parameter corresponding to the task attribute score; wherein the task attribute score comprises a task urgency score, a task waiting time length score and a task resource demand proportion; weighting and summing the task attribute scores according to the priority evaluation weight parameter to obtain the first evaluation result.
3. The method of claim 1, wherein, The resource capability evaluation of the plurality of resource nodes to obtain a second evaluation result comprises: obtaining a resource attribute score of the plurality of resource nodes and obtaining a resource capability evaluation weight parameter corresponding to the resource attribute score; wherein the resource attribute score comprises a performance score, a load balancing score and a reliability score; weighting and summing the resource attribute scores according to the resource capability evaluation weight parameter to obtain the second evaluation result.
4. The method of claim 1, wherein, The trust degree evaluation of the plurality of resource nodes to obtain a third evaluation result comprises: obtaining historical credit features of the plurality of resource nodes and obtaining a trust degree weight parameter corresponding to the historical credit features; wherein the historical credit features comprise node historical performance, node consensus credibility and node stability; weighting and summing the historical credit features according to the trust degree weight parameter to obtain the third evaluation result.
5. The method of claim 1, wherein, The matching the to-be-processed task and the plurality of resource nodes respectively to obtain a plurality of candidate matching degrees respectively corresponding to the plurality of resource nodes comprises: obtaining resource matching degrees and load matching degrees when the to-be-processed task respectively runs on the plurality of resource nodes, and obtaining matching degree weight parameters respectively corresponding to the resource matching degrees and the load matching degrees; weighting and calculating the resource matching degrees and the load matching degrees according to the matching degree weight parameters to obtain the plurality of candidate matching degrees respectively corresponding to the plurality of resource nodes.
6. The method of claim 1, wherein, The target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degrees, including: The resource node corresponding to the maximum value in the plurality of target matching degrees is determined as the target resource node for executing the to-be-processed task.
7. The method according to any one of claims 1 to 5, characterized in that, After the target resource node for executing the to-be-processed task is determined from the plurality of resource nodes according to the target matching degrees, the method further includes: The preset weight parameters are adjusted through a preset gradient descent optimization algorithm; wherein the preset weight parameters include at least one of the priority evaluation weight parameter, the resource capability evaluation weight parameter, the trust degree weight parameter and the matching degree weight parameter. 8.A blockchain-based resource scheduling apparatus, characterized by comprising: The device includes: The evaluation module is configured to perform priority evaluation on a to-be-processed task to obtain a first evaluation result, perform resource capability evaluation on a plurality of resource nodes to obtain a second evaluation result, and perform trust degree evaluation on the plurality of resource nodes to obtain a third evaluation result; wherein the plurality of resource nodes are provided by a resource layer included in a resource scheduling system, the resource scheduling system further includes a resource scheduling layer and a blockchain layer, the resource scheduling layer includes a blockchain smart contract, and the blockchain smart contract is used to schedule resource nodes in the resource layer to execute a to-be-processed task; the blockchain layer is used for data storage and data verification; The matching module is configured to match the to-be-processed task and the plurality of resource nodes respectively to obtain candidate matching degrees corresponding to the plurality of resource nodes respectively; The optimization module is configured to optimize the candidate matching degrees according to the first evaluation result, the second evaluation result and the third evaluation result to obtain target matching degrees corresponding to the plurality of resource nodes respectively; The determination module is configured to determine a target resource node for executing the to-be-processed task from the plurality of resource nodes according to the target matching degrees; The optimization of the alternative matching degree according to the first evaluation result, the second evaluation result and the third evaluation result obtains the target matching degree corresponding to the plurality of resource nodes respectively, comprising: obtaining a target matching degree; wherein is the target matching degree between the i th to-be-processed task and the j th resource node, is the alternative matching degree between the i th to-be-processed task and the j th resource node, is the first evaluation result corresponding to the i th to-be-processed task, that is, the priority score, is the second evaluation result of the j th resource node, that is, the resource capability score, is the third evaluation result of the j th resource node, that is, the trust degree score.
9. An electronic device, comprising: including: One or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the blockchain-based resource scheduling method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer readable instruction is stored thereon, when the computer readable instruction is executed by a processor of a computer, the computer executes the blockchain-based resource scheduling method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and system for processing computing power task of computing power network based on block chain
CN116909695A
Node selection method and device based on task collaboration, equipment and medium
CN117354310A