A resource pool scheduling strategy optimization method based on improved blockchain
By adopting the combination method of improved blockchain and ant colony algorithm in resource pool scheduling, the resource scheduling solution is optimized, and the problem of low resource pool scheduling efficiency in the existing technology is solved, achieving more efficient resource coordination and environmental adaptability.
Patent Information
- Application Number
- CN202411849404.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The existing resource pool scheduling technology has problems such as solidification of network relationships between units, poor collaborative work efficiency, and weak ability to adapt to environmental changes, resulting in poor resource scheduling results.
The resource pool scheduling strategy optimization method based on improved blockchain is adopted. By obtaining new status information of each unit of the resource pool and publishing it to the blockchain network, the resource scheduling scheme is optimized using smart contracts and ant colony algorithms, a fully trusted information interaction environment is established, and resource scheduling efficiency is improved.
The resource scheduling effect has been improved, and a fully trusted information interaction environment has been established through blockchain technology, and the resource scheduling scheme has been optimized in combination with the ant colony algorithm, which has improved the collaborative work efficiency of resource units and the ability to adapt to environmental changes.
Smart Images

Figure CN119313115B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to resource scheduling, and in particular to a resource pool scheduling strategy optimization method based on an improved blockchain. Background Art
[0002] Dynamic scheduling of resource pools across domains and platforms has become the norm, which has put forward higher requirements for the overall collaborative efficiency of resource scheduling. However, the actual resource pool still has problems such as the rigid network relationship between units, poor collaborative work efficiency, and weak ability to adapt to environmental changes. How to achieve resource pool scheduling optimization is the key problem faced.
[0003] The characteristic of blockchain technology is decentralization. With the continuous development of blockchain technology, in addition to the financial field, it has also been gradually used in other decentralized scenarios, such as radio network field, energy field, Internet of Things field, etc. In terms of resource scheduling, the existing technology realizes resource scheduling through the combination of mobile edge computing and blockchain, but the resource scheduling effect is not good. Summary of the invention
[0004] Purpose of the invention: In view of the above shortcomings, the present invention provides a resource pool scheduling strategy optimization method based on an improved blockchain with good resource scheduling effect.
[0005] Technical solution: To solve the above problems, the present invention adopts a resource pool scheduling strategy optimization method based on an improved blockchain, comprising the following steps:
[0006] Obtain the new status information of each unit in the resource pool and publish it to the blockchain network;
[0007] Receiving a resource scheduling request, and in response to the resource scheduling request, the blockchain network calls a smart contract, and the smart contract updates an optimal resource scheduling solution according to the newly added status information;
[0008] The resource pool obtains the optimal resource scheduling solution from the blockchain network and performs resource scheduling according to the optimal resource scheduling solution;
[0009] The smart contract outputs the optimal resource scheduling solution through a resource scheduling optimization model. The resource scheduling optimization model is a resource scheduling model based on ant colony algorithm optimization. The resource scheduling model establishes a resource scheduling objective function based on the capabilities and costs of each unit in the resource pool to achieve maximum efficiency.
[0010] Furthermore, the basic component unit of the blockchain is a block. A block is generated at regular intervals, and the blocks form a chain structure in chronological order. The block includes a block header and a block body. The block header includes the current version number, the parent block hash value, the timestamp, and the Merkle root. The block body includes the status information published on the blockchain and the optimal resource scheduling plan calculated by the smart contract.
[0011] Furthermore, the specific steps of the smart contract updating the optimal resource scheduling plan according to the newly added status information are as follows: at time t1, the newly added status information published on the blockchain is obtained as input, and the current optimal resource scheduling plan is calculated by the smart contract. After a new block of the blockchain is generated, the information is packaged and stored in the newly generated block, and a unique Merkle root generated through the hash process is stored in the block header.
[0012] Furthermore, the resource scheduling objective function is:
[0013] ;
[0014] in, is the energy efficiency of the resource pool system, n represents the number of units involved in resource scheduling, Defined as the average trust level of the i-th unit to other units, is the capacity of the ith unit, Express Perform normalization processing, represents the cost of the i-th unit, Express Perform normalization.
[0015] Furthermore, the average trust level of the i-th unit to other units The calculation formula is:
[0016] ;
[0017] in, Indicates the relationship between the i-th unit and the The trust level of each unit.
[0018] Furthermore, the capacity expression of the i-th unit is:
[0019] ;
[0020] The cost expression of the i-th unit is:
[0021] ;
[0022] in, To indicate the Unit The parameters of the capability, For the Unit The weight of each ability, ; To indicate the Unit The cost parameter, For the Unit The weight of the cost, .
[0023] Furthermore, the ant colony algorithm adopts an improved ant colony algorithm, sets environmental factors as heuristic information, and adds open-loop intervention in ant colony path selection.
[0024] Furthermore, the specific steps of the resource scheduling model based on the improved ant colony algorithm optimization are:
[0025] (1) Initialize the pheromone settings for each path;
[0026] (2) One ant corresponds to one unit, and the ants are grouped and numbered. The ant colony is divided into m groups, each of which consists of k ants.
[0027] (3) Adding environmental factors, which are used as heuristic information, to artificially intervene in the path optimization of the ant colony by adding the expected heuristic factor β;
[0028] (4) Randomly initialize an ant, the bth ant in group a, starting from point P, and ask After reaching the node, return to point P; To record the nodes currently visited by the bth ant in the ath group, and distribute the visit list of the ant to each ant;
[0029] (5) Analyze the b'th ant in the a'th group. If the number of nodes crawled by the ant is less than , the selection probability of the ant is calculated according to the resource scheduling objective function, and the next node is selected according to the obtained probability value; otherwise, the b'th ant in the a'th group returns to point P; iterative calculation is performed until all ants return to point P, and the optimal resource scheduling solution at this stage is obtained;
[0030] (6) Determine whether the termination condition is met. If not, select the pheromone in the update path and return to step (4). If the termination condition is met, output the global optimal resource scheduling plan.
[0031] The present invention also adopts a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0032] The present invention also adopts a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.
[0033] Beneficial effects: Compared with the prior art, the significant advantage of the present invention is that it establishes a completely trusted information interaction environment by designing a resource scheduling framework based on blockchain. At the same time, on the basis of considering the capacity and cost of resource units, it introduces the ant colony algorithm to establish a resource scheduling mathematical model, obtains the optimal resource scheduling plan according to the resource model, and improves the resource scheduling efficiency. Environmental factors are introduced to improve the traditional ant colony algorithm, and a resource scheduling optimization model based on the improved ant colony algorithm is proposed, and it is written into the smart contract. Compared with the traditional ant colony algorithm, the improved ant colony algorithm can better fit the actual environment and obtain the optimal resource scheduling plan; the blocks under the blockchain fully trust each other, and the overall collaborative efficiency is higher than the overall efficiency of each resource performance under the non-blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a schematic diagram of the overall framework of resource scheduling optimization based on the improved blockchain in the present invention.
[0035] Figure 2 It is a schematic diagram of the resource system unit capacity cost in the present invention.
[0036] Figure 3 It is a schematic diagram of the process of outputting the optimal resource scheduling solution by the ant colony algorithm and the improved ant colony algorithm in the present invention.
[0037] Figure 4 This is a schematic flow chart of the smart contract input and output in the present invention. DETAILED DESCRIPTION
[0038] In this embodiment, a resource pool scheduling strategy optimization method based on an improved blockchain is used to build an overall framework for resource pool scheduling optimization of an improved blockchain, establish a resource scheduling objective function, build a resource scheduling mathematical model, propose a resource scheduling optimization model based on an improved ant colony algorithm, design a smart contract, and respond to output the optimal resource scheduling solution. The specific steps are as follows:
[0039] Step 1: Figure 1 As shown in the figure, the overall framework design of resource pool scheduling optimization based on improved blockchain
[0040] The resource pool is decentralized to establish a blockchain network, and the consensus algorithm is used to determine the order of block generation. A block is generated at regular intervals, and the blocks form a chain structure in chronological order to form a blockchain. Blocks are the basic components of blockchains, consisting of block headers and block bodies. Usually, the block header contains information such as the current version number, parent block hash value, timestamp, and Merkle root, while the block body contains two parts. One is to obtain the status information published on the blockchain, and the time range covers the time from the generation of the previous block to the generation of the current block, that is, the time span of the status information recorded in the current block is from the generation of the previous block to the generation of the current block; the second is the optimal resource scheduling solution calculated by the established smart contract.
[0041] Figure 1 Three consecutive blocks are intercepted in chronological order to demonstrate the workflow of resource pool scheduling optimization using blockchain technology. First, at time t0, the initial state information published on the blockchain is obtained as input, and the initial optimal resource scheduling plan is calculated by the smart contract. After the block numbered i-1 is generated, the information is packaged and stored in the block, and the unique Merkle root generated by the hash process is stored in the block header; then at time t1, the newly added state information 1 published on the blockchain is obtained as input, and the current optimal resource scheduling plan is calculated by the smart contract. After the block numbered i is generated, the information is packaged and stored in the block, and the unique Merkle root generated by the hash process is stored in the block header; similarly, at time t2, the newly added state information 2 published on the blockchain is obtained as input, and the current optimal resource scheduling plan is calculated by the smart contract. After the block numbered i+1 is generated, the information is packaged and stored in the block, and the unique Merkle root generated by the hash process is stored in the block header. While the resource pool publishes information on the blockchain, it can also query the information to obtain the current optimal resource scheduling plan.
[0042] Step 2: Resource scheduling modeling:
[0043] Before designing a smart contract, you need to first establish a resource scheduling optimization model, and before establishing the optimization model, you need to first build a resource scheduling mathematical model. The establishment of the model needs to be based on the resource status information published on the blockchain, comprehensively considering the capabilities and costs, with the goal of obtaining maximum efficiency. Each unit in the resource pool has capabilities (positive effects) and costs (negative effects). In this embodiment, the capabilities of each unit are composed of four parts: A capability, B capability, C capability, and D capability (capability types and quantities are expandable), and the cost of each unit is composed of four parts: A cost, B cost, C cost, and D cost (cost types and quantities are expandable). Each capability and cost is independent of each other and there is no order relationship. Based on this, the unit capability cost diagram is as follows Figure 2 Here, the unit capacity f is defined as:
[0044] (1);
[0045] Where: , , , They are the parameters of A capability, B capability, C capability and D capability respectively; , , , are the weights of each ability respectively, and the sum of all weights is 1.
[0046] In the whole working process, it is composed of n such units. Based on the unit capacity f defined by formula (1), the capacity f(i) of the i-th unit is defined as:
[0047] (2);
[0048] Then construct the capability matrix of n units:
[0049] (3).
[0050] Define the unit cost g as:
[0051] (4);
[0052] Where: , , , are the parameters of A cost, B cost, C cost and D cost respectively; , , , are the weights of each cost respectively, and the sum of all weights is 1.
[0053] Based on the unit cost g defined in formula (4), the cost of the i-th unit is defined as :
[0054] (5);
[0055] Then construct the cost matrix of n units:
[0056] (6).
[0057] Based on the characteristics of blockchain itself, it is concluded that resources under blockchain fully trust each other, while resources under non-blockchain do not fully trust each other. Therefore, the mutual trust level is introduced here, and the resource scheduling objective function that describes the overall efficiency is designed as follows:
[0058] (7);
[0059] (7) In the formula, M is defined as the overall efficiency; n represents the number of units involved in resource scheduling; It is defined as the average trust level of the i-th unit in other units, where the units under the blockchain fully trust each other, R i = 1; non-blockchain units do not fully trust each other, 0 ≤ R i <1.
[0060] The specific operations are as follows:
[0061] (8);
[0062] In this embodiment, a completely trusted information interaction environment is established based on the resource scheduling framework of the blockchain, and each unit is placed under the blockchain by default, that is, each unit fully trusts each other.
[0063] (7) In the formula, Express Perform normalization processing. The specific operations are as follows:
[0064] (9);
[0065] (7) In the formula, Express Perform normalization processing. The specific operations are as follows:
[0066] (10).
[0067] Step 3: Resource scheduling optimization based on ant colony algorithm
[0068] For the resource scheduling mathematical model describing the overall efficiency constructed in step 2, the ant colony algorithm is used to optimize and solve it, and a resource scheduling optimization model based on the ant colony algorithm is established. For the ant colony algorithm, consider whether to add the influence of environmental factors; when it is chosen not to intervene in environmental factors, the ant colony seeks a path completely randomly; when it is chosen to intervene in environmental factors, the environmental factors are used as heuristic information, and the path optimization of the ant colony is artificially intervened by adding the expected heuristic factor β. By increasing the β weight, the number of iterations is reduced and the convergence speed is improved.
[0069] like Figure 3 As shown, based on the traditional theory of ant colony algorithm, the present invention takes environmental change factors into consideration, uses environmental factors as heuristic information, adds open-loop intervention in ant colony path selection, and proposes an improved ant colony algorithm.
[0070] As environmental factors change, the resource scheduling model should make adaptive adjustments. Set path restrictions, such as setting pheromones very low to assume that there are obstacles on a certain path, or increase the value of heuristic information to assume that the path is unobstructed, so as to intervene in the ant colony's path selection. Taking the coordinated pursuit of attack targets by a swarm as an example, the status information of the drones of both chasing parties will be dynamically updated as the pursuit time goes by, such as the comparison of loss data of the drones of both chasing parties in each area after mutual attack, the support status of drones in each area, etc., which often directly affect the allocation of resource pools. Involving environmental factors as a correction factor, drones tend to avoid relatively unfavorable environments when choosing resource allocation paths, like ants, and guide drones to choose low-risk and easy-to-support environments for coordinated pursuit, thereby improving the overall cooperation efficiency.
[0071] The resource scheduling solution process is mainly divided into four parts: the first part is to complete the initialization setting of parameters; the second part is to complete the grouping and numbering of ants; the third part is to consider whether to intervene in the process of environmental factors; the fourth part is to calculate the optimal target value after the ant colony has found the path, to determine whether to terminate, whether to adjust the pheromone and enter the loop until the termination condition is met (to avoid an infinite loop, set the maximum number of loops) to obtain the optimal solution for resource allocation.
[0072] The main steps are as follows:
[0073] Step 3-1: Initialize the pheromone for each path.
[0074] Step 3-2: Assign one ant to one unit and number the ants in groups. For example, divide the ant colony into m groups, each group consisting of k ants.
[0075] Step 3-3: Consider whether to add the influence of environmental factors. When choosing not to intervene in environmental factors, the ant colony seeks a path completely randomly; when choosing to intervene in environmental factors, environmental factors are used as heuristic information, and the path optimization of the ant colony is artificially intervened by adding the expected heuristic factor β. By increasing the β weight, the number of iterations is reduced and the convergence speed is improved.
[0076] Step 3-4: Assume that the bth (b=1, 2, ..., k)th ant in the ath (a=1, 2, ..., m)th group starts from point P. After reaching each node, return to point P. To record the node currently visited by the bth ant in the ath group, the access list of the ant is distributed to each ant.
[0077] Step 3-5: Analyze the ant b' (b'=1, 2, ..., k) in the a' (a'=1, 2, ..., m) group. If the number of nodes crawled by the ant is less than , calculate the selection probability of the ant according to the resource scheduling objective function, and continue to select the next node based on the obtained probability value; otherwise, the ant returns to point P.
[0078] Step 3-6: If all ants in step 3-5 return to point P, execute step 3-7; otherwise, execute step 3-5.
[0079] Step 3-7: Solve and obtain the optimal resource scheduling solution at the current stage.
[0080] Step 3-8: Determine whether the termination condition is met. If not, select the pheromone in the update path and re-execute step 3-4; otherwise, execute step 3-9.
[0081] Step 3-9: Obtain the global optimal resource scheduling solution.
[0082] Step 4: Create a smart contract
[0083] Smart contracts are a distributed trusted protocol based on blockchain, belonging to the contract layer, which stipulates the rules and logic within the blockchain. Ethereum combines smart contracts with blockchain to establish a completely trusted information interaction environment, which is characterized by the user's right to define rules, formulate transaction methods and state transition functions. Figure 4 Demonstrates the smart contract input and output process.
[0084] Preset rules are established. The improved ant colony algorithm is written into the smart contract, and a resource scheduling optimization model based on the algorithm is established in the smart contract.
[0085] Condition-response mechanism: Once resource information is published on the blockchain, when external transactions and event-activated contract instructions are received, the contract response is triggered, and the smart contract automatically calculates the current optimal resource scheduling plan.
[0086] Sending events to pass information. By sending transaction operations, information is passed and the optimal resource scheduling plan is stored in the next block to be generated.
Claims
1. A resource pool scheduling strategy optimization method based on an improved blockchain, characterized in that: The following steps are involved: Obtain the new status information of each unit in the resource pool and publish it to the blockchain network; Receiving a resource scheduling request, and in response to the resource scheduling request, the blockchain network calls a smart contract, and the smart contract updates an optimal resource scheduling solution according to the newly added status information; The resource pool obtains the optimal resource scheduling solution from the blockchain network and performs resource scheduling according to the optimal resource scheduling solution; The smart contract outputs the optimal resource scheduling solution through a resource scheduling optimization model. The resource scheduling optimization model is a resource scheduling model based on ant colony algorithm optimization. The resource scheduling model establishes a resource scheduling objective function based on the capabilities and costs of each unit in the resource pool to achieve maximum efficiency. The specific steps of the smart contract updating the optimal resource scheduling plan according to the newly added status information are as follows: at time t1, the newly added status information published on the blockchain is obtained as input, and the current optimal resource scheduling plan is calculated by the smart contract. After the next new block of the blockchain is generated, the information is packaged and stored in the newly generated block, and the unique Merkle root generated by the hash process is stored in the block header; The resource scheduling objective function is: ; in, is the energy efficiency of the resource pool system, n represents the number of units involved in resource scheduling, Defined as the average trust level of the i-th unit to other units, is the capacity of the ith unit, Express Perform normalization processing, represents the cost of the i-th unit, Express Perform normalization processing; The average trust level of the i-th unit to other units The calculation formula is: ; in, Indicates the relationship between the i-th unit and the The trust level of each unit; The capacity expression of the i-th unit is: ; The cost expression of the i-th unit is: ; in, To indicate the Unit The parameters of the capability, For the Unit The weight of each ability, ; To indicate the Unit The cost parameter, For the Unit The weight of the cost, .
2. The resource pool scheduling strategy optimization method according to claim 1, characterized in that: The basic unit of blockchain is block. A block is generated at regular intervals, and blocks form a chain structure in chronological order. The block includes a block header and a block body. The block header includes the current version number, parent block hash value, timestamp and Merkle root. The block body includes status information published on the blockchain and the optimal resource scheduling plan calculated by smart contracts.
3. The resource pool scheduling strategy optimization method according to claim 2, characterized in that: The ant colony algorithm adopts an improved ant colony algorithm, sets environmental factors as heuristic information, and adds open-loop intervention in ant colony path selection.
4. The resource pool scheduling strategy optimization method according to claim 3 is characterized in that: The specific steps of the resource scheduling model based on the improved ant colony algorithm optimization are: (1) Initialize the pheromone settings for each path; (2) One ant corresponds to one unit, and the ants are grouped and numbered. The ant colony is divided into m groups, each of which consists of k ants. (3) Adding environmental factors, which are used as heuristic information, to artificially intervene in the path optimization of the ant colony by adding the expected heuristic factor β; (4) Randomly initialize an ant, the bth ant in group a, starting from point P, and ask After reaching the node, return to point P; To record the nodes currently visited by the bth ant in the ath group, and distribute the visit list of the ant to each ant; (5) Analyze the b'th ant in the a'th group. If the number of nodes crawled by the ant is less than , the selection probability of the ant is calculated according to the resource scheduling objective function, and the next node is selected according to the obtained probability value; otherwise, the b'th ant in the a'th group returns to point P; iterative calculation is performed until all ants return to point P, and the optimal resource scheduling solution at this stage is obtained; (6) Determine whether the termination condition is met. If not, select the pheromone in the update path and return to step (4). If the termination condition is met, output the global optimal resource scheduling plan.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Task scheduling method based on greedy adaptive ant colony algorithm
CN111967643A
Emergency resource scheduling method based on ant colony algorithm and multi-objective function model
CN112288152A