CN109240826B - Method for allocating computing resources when nodes share computing equipment in multi-block chain network - Google Patents

Method for allocating computing resources when nodes share computing equipment in multi-block chain network Download PDF

Info

Publication number
CN109240826B
CN109240826B CN201810927989.9A CN201810927989A CN109240826B CN 109240826 B CN109240826 B CN 109240826B CN 201810927989 A CN201810927989 A CN 201810927989A CN 109240826 B CN109240826 B CN 109240826B
Authority
CN
China
Prior art keywords
computing
computing device
blockchain network
nodes
tasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810927989.9A
Other languages
Chinese (zh)
Other versions
CN109240826A (en
Inventor
吴胜文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ke'an (Xiamen) Technology Co.,Ltd.
Original Assignee
Tailian Xiamen Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tailian Xiamen Technology Co ltd filed Critical Tailian Xiamen Technology Co ltd
Priority to CN201810927989.9A priority Critical patent/CN109240826B/en
Publication of CN109240826A publication Critical patent/CN109240826A/en
Application granted granted Critical
Publication of CN109240826B publication Critical patent/CN109240826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Abstract

The invention discloses a computing resource allocation method when multi-block chain network nodes share computing equipment, which comprises the following steps: acquiring the number of tasks currently operated by the computing equipment; when the number of tasks currently operated by the computing equipment exceeds a preset value, judging whether the computing equipment has new requirements to occupy computing resources; if the computing device has new requirements to occupy computing resources, tasks with the most blockchain network nodes in the tasks currently running by the computing device are obtained, and the tasks with the most blockchain network nodes are suspended from the computing device to release the occupied computing resources, so that the number of the tasks currently running by the computing device is smaller than a preset value. Therefore, the invention adopts the task of preferentially suspending the blockchain network with the maximum total number of nodes accessed by the computing equipment, thereby greatly reducing the possibility that the blockchain network is divided into two parts due to suspension of the nodes and simultaneously improving the use efficiency of the computing resources.

Description

Method for allocating computing resources when nodes share computing equipment in multi-block chain network
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and a device for allocating computing resources when nodes share computing devices in a multi-blockchain network.
Background
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. With the continuous evolution of the blockchain technology, the situation that nodes in a multi-blockchain network share the same computing device occurs, and when the shared computing device runs the verification and broadcast tasks of a few different blockchain network nodes, the computing resources of the shared computing device can meet the requirements of the tasks, so how to allocate the computing resources of the shared computing device does not need to be considered. However, when the common computing device runs the authentication and broadcast tasks of many different blockchain network nodes, the number of tasks is increased, which leads to a problem that the computing resources of the common computing device are insufficient.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an object of the present invention is to provide a method for allocating computing resources when nodes share a computing device in a multi-blockchain network, where when the computing resources of the shared computing device are limited, the method uses priority to suspend the task of the blockchain network with the largest total number of nodes accessed by the computing device, so as to greatly reduce the possibility that the blockchain network is divided into two parts due to suspension of the nodes, avoid the occurrence of security problems such as double flowers, and improve the utilization efficiency of the computing resources.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the present invention is to provide an apparatus for allocating computing resources when nodes share a computing device in a multi-blockchain network.
To achieve the above object, an embodiment of a first aspect of the present invention provides a method for allocating computing resources when nodes share a computing device in a multi-blockchain network, where the method includes: acquiring the number of tasks currently operated by the computing equipment; when the number of tasks currently operated by the computing equipment exceeds a preset value, judging whether the computing equipment has new requirements to occupy computing resources; if the computing device has new requirements to occupy computing resources, tasks with the most blockchain network nodes in the tasks currently running by the computing device are obtained, and the tasks with the most blockchain network nodes are suspended from the computing device to release the occupied computing resources, so that the number of the tasks currently running by the computing device is smaller than a preset value.
According to the method for distributing the computing resources when the nodes in the multi-block chain network share the computing equipment, the number of the tasks currently operated by the computing equipment is firstly obtained, whether the computing equipment has new requirements to occupy the computing resources is judged when the number of the tasks currently operated by the computing equipment exceeds the preset value, if the computing equipment has the new requirements to occupy the computing resources, the task with the most block chain network nodes in the tasks currently operated by the computing equipment is obtained, the task with the most block chain network nodes is hung from the computing equipment to release the occupied computing resources, and the number of the tasks currently operated by the computing equipment is smaller than the preset value, so that the computing equipment can meet the new computing resource requirements. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
In addition, the method for allocating computing resources when nodes share a computing device in a multi-block chain network according to the above embodiment of the present invention may further have the following additional technical features:
optionally, when the computing device receives a request for activating a suspended task and/or a request for starting a new blockchain network node process, it is determined that a new demand exists for the computing device to occupy computing resources.
Optionally, when the computing device receives a request for activating a suspended task and a request for starting a new blockchain network node process, if the number of tasks currently running by the computing device is less than a preset value, the computing device is controlled to preferentially execute the request for activating the suspended task.
Optionally, when the computing device executes the request for activating the suspension task, the computing device is further controlled to preferentially execute the suspension task having the least blockchain network nodes.
Optionally, after the computing device runs the verification and broadcast task of any one of the blockchain network nodes, the number of tasks run by the computing device is increased by 1, and the computing device accesses the blockchain network as a node.
Optionally, the computing device sends search information to the blockchain network accessed by the computing device to obtain the number of nodes in the blockchain network accessed by the computing device, so as to obtain the task with the most blockchain network nodes in the tasks currently running by the computing device.
In order to achieve the above object, a second aspect of the present invention provides a computer-readable storage medium, on which a computing resource allocation program for a multi-blockchain network when nodes share a computing device is stored, where the computing resource allocation program for the multi-blockchain network when nodes share the computing device is executed by a processor to implement the above computing resource allocation method for the multi-blockchain network when nodes share the computing device.
According to the computer readable storage medium of the embodiment of the invention, the computing resource allocation program when the nodes in the multi-block chain network share the computing device is stored, so that the computing resource allocation program when the nodes in the multi-block chain network share the computing device is executed by the processor to realize the computing resource allocation method when the nodes in the multi-block chain network share the computing device, therefore, when the computing resource of the shared computing device is limited, the task of the block chain network which has the largest total number of the nodes and is accessed by the computing device is preferentially suspended, so that the possibility that the block chain network is divided into two parts due to the suspension of the nodes can be greatly reduced, the occurrence of safety problems such as double flowers is avoided, and the use efficiency of the computing resource is improved.
In order to achieve the above object, a third embodiment of the present invention provides an apparatus for allocating computing resources when nodes share a computing device in a multi-blockchain network, including an obtaining module, configured to obtain a number of tasks currently running by the computing device; the judging module is used for judging whether the computing equipment has new requirements to occupy computing resources when the number of tasks currently operated by the computing equipment exceeds a preset value; the allocation module is used for acquiring the task with the most blockchain network nodes in the tasks currently run by the computing equipment when the computing equipment has new requirements to occupy computing resources, and suspending the task with the most blockchain network nodes from the computing equipment to release the occupied computing resources so that the number of the tasks currently run by the computing equipment is smaller than a preset value.
According to the computing resource allocation device for the multi-block chain network when the nodes share the computing equipment, the number of the tasks currently operated by the computing equipment is acquired through the acquisition module, whether the computing equipment has new requirements to occupy the computing resources is judged through the judgment module when the number of the tasks currently operated by the computing equipment exceeds the preset value, if the computing equipment has the new requirements to occupy the computing resources, the tasks with the most block chain network nodes in the tasks currently operated by the computing equipment are acquired through the allocation module, the tasks with the most block chain network nodes are suspended from the computing equipment to release the occupied computing resources, the number of the tasks currently operated by the computing equipment is smaller than the preset value, and therefore the computing equipment can meet the new computing resource requirements. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
In addition, the computing resource allocation apparatus for nodes sharing a computing device in a multi-block chain network according to the above embodiment of the present invention may further have the following additional technical features:
optionally, when the computing device receives a request for activating a suspend task and/or a request for starting a new blockchain network node process, the determining module determines that a new requirement exists in the computing device to occupy computing resources.
Optionally, when the computing device receives a request for activating a suspended task and a request for starting a new blockchain network node process, if the number of tasks currently running by the computing device is less than a preset value, the allocation module controls the computing device to preferentially execute the request for activating the suspended task, where the allocation module is further configured to control the computing device to preferentially execute the suspended task having the fewest blockchain network nodes when the computing device executes the request for activating the suspended task.
Drawings
FIG. 1 is a flowchart illustrating a method for allocating computing resources when nodes share a computing device in a multi-block chain network according to an embodiment of the invention;
FIG. 2 is a flowchart illustrating a computing resource allocation method when nodes share a computing device in a multi-zone blockchain network according to another embodiment of the present invention;
FIG. 3 is a block diagram illustrating a computing device shared by nodes in a multi-blockchain network according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating an apparatus for allocating computing resources when nodes share a computing device in a multi-block chain network according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
At present, with the continuous evolution of the blockchain technology, a situation occurs in which nodes in a multi-blockchain network share the same computing device, and when a shared computing device runs verification and broadcast tasks of a few different blockchain network nodes, since the computing resources of the shared computing device can meet the requirements of the tasks, the problem of how to allocate the computing resources of the shared computing device does not need to be considered. However, when the shared computing device runs the authentication and broadcast tasks of many different blockchain network nodes, the number of tasks will be more and more, which leads to a problem that the computing resources of the shared computing device are insufficient.
To solve the technical problem, a method for allocating computing resources when nodes in a multi-block chain network share a computing device according to an embodiment of the present invention includes first obtaining a number of tasks currently running by the computing device, and determining whether the computing device has a new requirement to occupy computing resources when the number of tasks currently running by the computing device exceeds a preset value, and if the computing device has a new requirement to occupy computing resources, obtaining a task having a largest number of block chain network nodes among the tasks currently running by the computing device, and suspending the task having the largest number of block chain network nodes from the computing device to release occupied computing resources, so that the number of tasks currently running by the computing device is smaller than the preset value, and the computing device can meet the new computing resource requirement. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a flowchart illustrating a method for allocating computing resources when nodes share a computing device in a multi-block chain network according to an embodiment of the present invention. As shown in fig. 1, the method for allocating computing resources when nodes share a computing device in the multi-blockchain network includes the following steps:
step 101, acquiring the number of tasks currently operated by the computing equipment.
It should be noted that, the initial value of the currently running task number is 0, and after the computing device runs the verification and broadcast task of one blockchain network node, the task number is added by 1, and the computing device is used as a node to access the blockchain network, which is specifically shown in fig. 3.
As an embodiment, the computing device may be a server or other device with certain computing power disposed on a network.
And 102, when the number of tasks currently operated by the computing equipment exceeds a preset value, judging whether the computing equipment has a new requirement to occupy computing resources.
It should be noted that the preset value is the maximum number of tasks allowed to be run by the computing resources on the computing device, and may be calibrated according to actual situations.
That is, when the number of tasks currently run by the computing device exceeds the number of tasks that the computing resources on the computing device are allowed to run at most, it is determined whether there is a new need for the computing device to occupy the computing resources, e.g., whether the computing device needs to access a new blockchain network.
Step 103, if the computing device has a new requirement to occupy the computing resource, acquiring the task having the most blockchain network nodes in the tasks currently running by the computing device, and suspending the task having the most blockchain network nodes from the computing device to release the occupied computing resource, so that the number of tasks currently running by the computing device is less than a preset value.
As one embodiment, when a computing device receives a request to activate a suspend task and/or a request to start a new blockchain network node process, it is determined that a new demand exists for the computing device to occupy computing resources.
That is, when the computing device receives a request to activate a suspend task, or receives a request to open a new blockchain network node process, or both, it is determined that a new need exists for the computing device to occupy computing resources.
When the computing equipment receives a request for activating the suspended task and a request for starting a new blockchain network node process, if the number of tasks currently running by the computing equipment is less than a preset value, the computing equipment is controlled to preferentially execute the request for activating the suspended task.
And when the computing device executes the request for activating the suspension task, the computing device is also controlled to preferentially execute the suspension task with the least block chain network nodes.
For one embodiment, the computing device may obtain the number of nodes in the blockchain network accessed by the computing device by sending the search information to the blockchain network accessed by the computing device, so as to obtain the task having the most blockchain network nodes in the tasks currently run by the computing device.
It can be understood that, by acquiring the number of nodes in the blockchain network accessed by the computing device, not only the task having the most blockchain network nodes among the tasks currently running by the computing device can be acquired, but also the suspended task having the least blockchain network nodes among all the suspended tasks can be acquired.
In one embodiment of the invention, after the computing device runs the verification and broadcast tasks of any one of the blockchain network nodes, the number of tasks run by the computing device is increased by 1, and the computing device accesses the blockchain network as a node.
Moreover, when the computing device accesses the blockchain network as a node, the number of nodes in the blockchain network accessed by the computing device can be obtained by sending the search information to the accessed blockchain network, so that a table of the number of nodes in different blockchain networks can be constructed, and the table records the number of node processes started in the computing device, the number of blockchain networks accessed by the computing device, and the number of nodes num in the blockchain network, for example, as shown in fig. 3 and table 1 below.
TABLE 1 number table for different block chain links
Node process numbering for opening in a computing device Block chain network number index Number of nodes num
1 a 6
2 b 7
3 c 5
4 d 4
According to the method for distributing the computing resources when the nodes in the multi-block chain network share the computing equipment, the number of the tasks currently operated by the computing equipment is firstly obtained, whether the computing equipment has new requirements to occupy the computing resources is judged when the number of the tasks currently operated by the computing equipment exceeds the preset value, if the computing equipment has the new requirements to occupy the computing resources, the task with the most block chain network nodes in the tasks currently operated by the computing equipment is obtained, the task with the most block chain network nodes is hung from the computing equipment to release the occupied computing resources, and the number of the tasks currently operated by the computing equipment is smaller than the preset value, so that the computing equipment can meet the new computing resource requirements. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
In order to further understand the above technical solution, the above technical solution will be described in detail by fig. 2.
FIG. 2 is a flowchart illustrating a method for allocating computing resources when nodes share a computing device in a multi-blockchain network according to an embodiment. The number of tasks run by the computing device is set to be N, the number of tasks allowed to run by computing resources on the computing device at most is set to be M, namely node verification and broadcast tasks of M different blockchain networks are set, and N is initialized to be 0.
As shown in fig. 2, the method for allocating computing resources when nodes share a computing device in the multi-blockchain network includes the following steps:
in step 201, a blockchain network node process is started in a computing device, and let N + 1.
That is, when a computing device runs an authentication and broadcast task for a blockchain network node, N is added to 1, and the computing device becomes a node to access the blockchain network.
Step 202, obtaining the total node number in the block chain network where the node is located, and constructing a table of the number of different block link points.
When the computing device is accessed to the blockchain network as a node, the number of nodes in the blockchain network accessed by the computing device can be obtained by sending search information to the accessed blockchain network, so that a table of the number of nodes in different blockchain networks can be constructed, and the table records the number of node processes started in the computing device, the number of the blockchain networks accessed by the computing device, and the number of nodes num in the blockchain network.
As an embodiment, as shown in fig. 3 and table 1 above, the number of processes of the node of the blockchain network that is turned on the computing device is 4, where each node is connected to a different blockchain network, such as blockchain networks a, b, c, and d, and there are different total numbers of nodes corresponding to different blockchain networks.
Step 203, determine whether N is less than M. If so, go to step 205; if not, step 204 is performed.
And step 204, suspending the most process numbers in the link point number tables of different blocks, letting N-1, and returning to the step 203 to continue judging.
That is, when the number N of tasks currently run by the computing device exceeds the maximum number M of tasks allowed to run by the computing resource on the computing device, if the computing device has a new requirement to occupy the computing resource, the task having the most blockchain network nodes in the tasks currently run by the computing device is acquired, and the task having the most blockchain network nodes is suspended from the computing device to release the occupied computing resource, for example, the computing device suspends the most number of process numbers in the number table of different blockchain network nodes and lets N-1; then returning to step 203, continuing to determine whether the number N of tasks currently run by the computing device is less than the number M of tasks that are allowed to be run by the computing resources on the computing device at most.
As an embodiment, the computing device suspends the process number with the largest node number num in the node number tables of different blockchain networks, so as to release the computing resources occupied by the process number, and sets the suspension time T of the process number.
Step 205, determine whether to activate the node process request. If yes, go to step 207; if not, step 206 is performed.
It should be noted that, when the number N of tasks currently running by the computing device is smaller than the maximum number M of tasks allowed to run by the computing resource on the computing device, it is preferentially determined whether a request for activating a suspended task is received, and after a suspension time T set by a task of a blockchain network node suspended in the computing device is reached, step 207 is executed.
Step 206, determine whether to access the new blockchain network request. If yes, go to step 201; if not, step 203 is performed.
Step 207, activating the process number with the minimum number of nodes in the link point number tables of different blocks, and letting N + 1; and then returns to step 203.
That is, after receiving a request to access a new blockchain network, the computing device first finds the least blockchain network node task among all currently pending blockchain network nodes and preferentially activates the pending tasks with the least blockchain network nodes.
In one embodiment, after a pending task having a minimum blockchain network node is activated, the node activation information is broadcast to the blockchain network.
The method comprises the steps of firstly obtaining the number of tasks currently operated by the computing equipment, judging whether the computing equipment has new requirements to occupy computing resources when the number of the tasks currently operated by the computing equipment exceeds a preset value, if so, obtaining the tasks with the most block chain network nodes in the tasks currently operated by the computing equipment, suspending the tasks with the most block chain network nodes from the computing equipment to release the occupied computing resources, and enabling the number of the tasks currently operated by the computing equipment to be smaller than the preset value, so that the computing equipment can meet the new computing resource requirements. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
In order to implement the above embodiments, an embodiment of the present invention provides a computer-readable storage medium, on which a computing resource allocation program when nodes share a computing device in a multi-zone block chain network is stored, and when the computing resource allocation program when nodes share a computing device in the multi-zone block chain network is executed by a processor, the computing resource allocation method when nodes share a computing device in the multi-zone block chain network is implemented.
According to the computer readable storage medium of the embodiment of the invention, the computing resource allocation program when the nodes in the multi-block chain network share the computing equipment is stored, so that the computing resource allocation program when the nodes in the multi-block chain network share the computing equipment is executed by the processor to realize the computing resource allocation method when the nodes in the multi-block chain network share the computing equipment.
Fig. 4 is a flowchart illustrating an apparatus for allocating computing resources when nodes share a computing device in a multi-block chain network according to an embodiment of the present invention. As shown in fig. 4, the dispensing device includes: an acquisition module 401, a judgment module 402, and an allocation module 403.
The obtaining module 401 is configured to obtain the number of tasks currently running on the computing device.
A determining module 402, configured to determine whether a new requirement exists for the computing device to occupy computing resources when the number of tasks currently running on the computing device exceeds a preset value.
The allocating module 403 is configured to, when a new requirement exists for the computing device to occupy the computing resource, acquire a task having the most blockchain network nodes among tasks currently running by the computing device, and suspend the task having the most blockchain network nodes from the computing device to release the occupied computing resource, so that the number of tasks currently running by the computing device is smaller than a preset value.
As an embodiment, when the computing device receives a request to activate a suspend task and/or a request to start a new blockchain network node process, the determination module determines that a new requirement exists for the computing device to occupy computing resources.
As an embodiment, when the computing device receives a request for activating a suspended task and a request for starting a new blockchain network node process, if the number of tasks currently running by the computing device is less than a preset value, the allocation module controls the computing device to preferentially execute the request for activating the suspended task, wherein the allocation module is further configured to control the computing device to preferentially execute the suspended task having the fewest blockchain network nodes when the computing device executes the request for activating the suspended task.
According to the computing resource allocation device for the multi-block chain network when the nodes share the computing equipment, the number of the tasks currently operated by the computing equipment is acquired through the acquisition module, whether the computing equipment has new requirements to occupy the computing resources is judged through the judgment module when the number of the tasks currently operated by the computing equipment exceeds the preset value, if the computing equipment has the new requirements to occupy the computing resources, the tasks with the most block chain network nodes in the tasks currently operated by the computing equipment are acquired through the allocation module, the tasks with the most block chain network nodes are suspended from the computing equipment to release the occupied computing resources, the number of the tasks currently operated by the computing equipment is smaller than the preset value, and therefore the computing equipment can meet the new computing resource requirements. Therefore, when the shared computing resources of the computing equipment are limited, the task of preferentially suspending the blockchain network with the largest total number of nodes accessed by the computing equipment is adopted, so that the possibility that the blockchain network is divided into two parts due to suspension of the nodes can be greatly reduced, the safety problems of double flowers and the like are avoided, and the use efficiency of the computing resources is improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A method for allocating computing resources when nodes share a computing device in a multi-blockchain network, comprising the steps of:
acquiring the number of tasks currently operated by the computing equipment;
when the number of tasks currently operated by the computing equipment exceeds a preset value, judging whether the computing equipment has new requirements to occupy computing resources;
if the computing device has new requirements to occupy computing resources, acquiring the tasks with the most blockchain network nodes in the tasks currently running by the computing device, and suspending the tasks with the most blockchain network nodes from the computing device to release the occupied computing resources, so that the number of the tasks currently running by the computing device is smaller than a preset value.
2. The method of claim 1, wherein when the computing device receives a request to activate a suspend task and/or a request to start a new blockchain network node process, determining that there is a new demand for the computing device to occupy computing resources.
3. The method according to claim 2, wherein when the computing device receives a request for activating a pending task and a request for starting a new node process of the blockchain network, if the number of tasks currently running by the computing device is less than a preset value, the computing device is controlled to preferentially execute the request for activating the pending task.
4. A method of allocating computational resources when nodes share a computational device in a multi-blockchain network according to claim 2 or 3, wherein the computational device is further controlled to preferentially execute the pending task having the fewest blockchain network nodes when the computational device executes the request to activate the pending task.
5. The method of claim 4, wherein after the computing device runs the validation and broadcast tasks of any one of the blockchain network nodes, the number of tasks run by the computing device is increased by 1, and the computing device accesses the blockchain network as a node.
6. The method of claim 5, wherein the task having the largest number of blockchain network nodes among the tasks currently run by the computing device is obtained by sending, by the computing device, a search message to the blockchain network to which the computing device accesses to obtain the number of nodes in the blockchain network to which the computing device accesses.
7. A computer-readable storage medium having stored thereon a computing resource allocation program when nodes share a computing device in a multi-blockchain network, the computing resource allocation program when nodes share a computing device in the multi-blockchain network when executed by a processor implementing a computing resource allocation method when nodes share a computing device in the multi-blockchain network according to any one of claims 1 to 6.
8. An apparatus for allocating computing resources when nodes share a computing device in a multi-blockchain network, comprising:
the acquisition module is used for acquiring the number of tasks currently operated by the computing equipment;
the judging module is used for judging whether the computing equipment has new requirements to occupy computing resources when the number of tasks currently operated by the computing equipment exceeds a preset value;
the allocation module is used for acquiring the task with the most blockchain network nodes in the tasks currently run by the computing equipment when the computing equipment has new requirements to occupy computing resources, and suspending the task with the most blockchain network nodes from the computing equipment to release the occupied computing resources so that the number of the tasks currently run by the computing equipment is smaller than a preset value.
9. The apparatus of claim 8, wherein the determining module determines that there is a new demand for the computing device to occupy computing resources when the computing device receives a request to activate a suspend task and/or a request to start a new blockchain network node process.
10. The apparatus for allocating computing resources when nodes share a computing device in a multi-blockchain network according to claim 9, wherein when the computing device receives a request for activating a pending task and a request for starting a new blockchain network node process, the allocation module controls the computing device to preferentially execute the request for activating the pending task if the number of tasks currently run by the computing device is less than a preset value,
the allocation module is further configured to control the computing device to preferentially execute the suspended task having the fewest blockchain network nodes when the computing device executes the request to activate the suspended task.
CN201810927989.9A 2018-08-15 2018-08-15 Method for allocating computing resources when nodes share computing equipment in multi-block chain network Active CN109240826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810927989.9A CN109240826B (en) 2018-08-15 2018-08-15 Method for allocating computing resources when nodes share computing equipment in multi-block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810927989.9A CN109240826B (en) 2018-08-15 2018-08-15 Method for allocating computing resources when nodes share computing equipment in multi-block chain network

Publications (2)

Publication Number Publication Date
CN109240826A CN109240826A (en) 2019-01-18
CN109240826B true CN109240826B (en) 2020-10-23

Family

ID=65070425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810927989.9A Active CN109240826B (en) 2018-08-15 2018-08-15 Method for allocating computing resources when nodes share computing equipment in multi-block chain network

Country Status (1)

Country Link
CN (1) CN109240826B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489488B (en) * 2019-08-21 2021-06-15 腾讯科技(深圳)有限公司 Data processing method and device
CN110784521B (en) * 2019-09-30 2022-05-27 远光软件股份有限公司 Block chain consensus method, electronic device and storage medium
CN112419014A (en) * 2021-01-19 2021-02-26 浙江育英职业技术学院 Block chain system, data processing method and device thereof and storage medium

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506203A (en) * 2016-10-25 2017-03-15 杭州云象网络技术有限公司 A kind of monitoring nodes system for being applied to block chain
CN106530083A (en) * 2016-10-27 2017-03-22 上海亿账通区块链科技有限公司 Multi-chain management method and system based on block chain
CN107085810A (en) * 2017-04-19 2017-08-22 朱皞罡 Across the chain operating method and block chain management system of a kind of block chain
CN107231299A (en) * 2017-06-07 2017-10-03 众安信息技术服务有限公司 A kind of chain route and realized the system that block chain communicates across chain
CN107395403A (en) * 2017-07-07 2017-11-24 北京区块链云科技有限公司 A kind of fiduciary block chain common recognition method suitable for extensive ecommerce
CN107453896A (en) * 2017-06-27 2017-12-08 阿里巴巴集团控股有限公司 Multiple sector chain network data processing method, device and server
CN107832139A (en) * 2017-09-26 2018-03-23 上海点融信息科技有限责任公司 For the method, apparatus and system for the computing resource for managing block chain link point
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN107995120A (en) * 2016-11-22 2018-05-04 南京银链信息科技有限公司 Construct the method and multi-tiling catenary system of multi-tiling chain
CN108234677A (en) * 2018-03-09 2018-06-29 高飞 A kind of block chain network node serve device towards multi-tiling platform chain
CN108305056A (en) * 2018-03-27 2018-07-20 搜游网络科技(北京)有限公司 Data processing method, device based on block chain and block chain meshed network
CN108650333A (en) * 2018-07-31 2018-10-12 泰链(厦门)科技有限公司 Dispersed nodes load method, medium, device and the block catenary system of block catenary system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10225273B2 (en) * 2017-01-27 2019-03-05 International Business Machines Corporation Secured event monitoring leveraging blockchain

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106506203A (en) * 2016-10-25 2017-03-15 杭州云象网络技术有限公司 A kind of monitoring nodes system for being applied to block chain
CN106530083A (en) * 2016-10-27 2017-03-22 上海亿账通区块链科技有限公司 Multi-chain management method and system based on block chain
CN107995120A (en) * 2016-11-22 2018-05-04 南京银链信息科技有限公司 Construct the method and multi-tiling catenary system of multi-tiling chain
CN107085810A (en) * 2017-04-19 2017-08-22 朱皞罡 Across the chain operating method and block chain management system of a kind of block chain
CN107231299A (en) * 2017-06-07 2017-10-03 众安信息技术服务有限公司 A kind of chain route and realized the system that block chain communicates across chain
CN107453896A (en) * 2017-06-27 2017-12-08 阿里巴巴集团控股有限公司 Multiple sector chain network data processing method, device and server
CN107395403A (en) * 2017-07-07 2017-11-24 北京区块链云科技有限公司 A kind of fiduciary block chain common recognition method suitable for extensive ecommerce
CN107832139A (en) * 2017-09-26 2018-03-23 上海点融信息科技有限责任公司 For the method, apparatus and system for the computing resource for managing block chain link point
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN108234677A (en) * 2018-03-09 2018-06-29 高飞 A kind of block chain network node serve device towards multi-tiling platform chain
CN108305056A (en) * 2018-03-27 2018-07-20 搜游网络科技(北京)有限公司 Data processing method, device based on block chain and block chain meshed network
CN108650333A (en) * 2018-07-31 2018-10-12 泰链(厦门)科技有限公司 Dispersed nodes load method, medium, device and the block catenary system of block catenary system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
区块链技术发展现状与展望;袁勇等;《自动化学报》;20160430;第42卷(第4期);第481-494页 *

Also Published As

Publication number Publication date
CN109240826A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN108667748B (en) Method, device, equipment and storage medium for controlling bandwidth
CN109240826B (en) Method for allocating computing resources when nodes share computing equipment in multi-block chain network
CN109213600B (en) GPU resource scheduling method and device based on AI cloud
CN107066332B (en) Distributed system and scheduling method and scheduling device thereof
CN109936604B (en) Resource scheduling method, device and system
CN107239336B (en) Method and device for realizing task scheduling
CN109783157B (en) Method and related device for loading algorithm program
CN108268317B (en) Resource allocation method and device
CN110941481A (en) Resource scheduling method, device and system
CN106502767B (en) A kind of process management method and its device
WO2017089944A1 (en) Techniques for analytics-driven hybrid concurrency control in clouds
CN111045795A (en) Resource scheduling method and device
CN105591809B (en) A kind of resource allocation methods and device
WO2016011953A1 (en) Scheduling of service resource
CN108519917A (en) A kind of resource pool distribution method and device
CN103257898A (en) Resource allocation method and system in embedded system
US20120233313A1 (en) Shared scaling server system
CN108111337B (en) Method and equipment for arbitrating main nodes in distributed system
CN112214288B (en) Pod scheduling method, device, equipment and medium based on Kubernetes cluster
CN114020407A (en) Container management cluster container group scheduling optimization method, device and equipment
CN104281587B (en) A kind of method and device for establishing connection
CN111796933A (en) Resource scheduling method, device, storage medium and electronic equipment
CN107229519B (en) Task scheduling method and device
CN114924888A (en) Resource allocation method, data processing method, device, equipment and storage medium
CN111459651B (en) Load balancing method, device, storage medium and scheduling system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: 361000 B1F-065, Zone A, Huaxun Building, Software Park, Xiamen Torch Hi-tech Zone, Huli District, Xiamen City, Fujian Province

Patentee after: Ke'an (Xiamen) Technology Co.,Ltd.

Address before: B1f-065, zone a, Huaxun building, software park, torch hi tech Zone, Xiamen City, Fujian Province, 361000

Patentee before: TAILIAN (XIAMEN) TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address