CN111240830A - Public link contract resource allocation method and device, electronic equipment and storage medium - Google Patents

Public link contract resource allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111240830A
CN111240830A CN201911413537.XA CN201911413537A CN111240830A CN 111240830 A CN111240830 A CN 111240830A CN 201911413537 A CN201911413537 A CN 201911413537A CN 111240830 A CN111240830 A CN 111240830A
Authority
CN
China
Prior art keywords
contract
resource
docker
deployed
version
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.)
Pending
Application number
CN201911413537.XA
Other languages
Chinese (zh)
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.)
Shaanxi Medicine Chain Group Co Ltd
Original Assignee
Shaanxi Medicine Chain Group 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 Shaanxi Medicine Chain Group Co Ltd filed Critical Shaanxi Medicine Chain Group Co Ltd
Priority to CN201911413537.XA priority Critical patent/CN111240830A/en
Publication of CN111240830A publication Critical patent/CN111240830A/en
Pending legal-status Critical Current

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/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides a public link contract resource allocation method, a public link contract resource allocation device, electronic equipment and a storage medium, wherein the method comprises the following steps: using a stable operating system as a base version of Docker; respectively evaluating the resource usage of different contracts to be deployed on a public chain; constructing a running version of the contract according to the resource use condition obtained by the evaluation; constructing a corresponding Docker mirror image according to the contract running version; and determining the number of the individual contract executors needing to be deployed according to the external contract access request, and deploying the individual contract executors to each resource point of the node in a Docker container form. According to the method and the device, each Docker container is divided in a mode of minimum execution resources as much as possible, efficient resource utilization and allocation can be achieved, and resource waste is avoided.

Description

Public link contract resource allocation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of block link point resource allocation technologies, and in particular, to a public link contract resource allocation method, apparatus, electronic device, and storage medium.
Background
As an emerging virtualization approach, Docker has numerous advantages over traditional virtualization approaches, such as faster delivery and deployment, more efficient virtualization, easier migration and expansion, and simpler management. Resources within the nodes of the block chain are currently fixed, and therefore the allocation policy of resources is only relevant to the executing virtual machine. When the resources become elastically variable, no appropriate allocation utilization policy is given.
Disclosure of Invention
In view of the above, the present application provides a public link contract resource allocation scheme, which efficiently achieves resource allocation and utilization when the resources in the nodes on the blockchain are flexible and variable.
In order to achieve the purpose, the technical scheme adopted by the application is as follows:
in a first aspect, the present application provides a method for allocating a public link contract resource, including:
using a stable operating system as a base version of Docker;
respectively evaluating the resource usage of different contracts to be deployed on a public chain;
constructing a running version of the contract according to the resource use condition obtained by the evaluation;
constructing a corresponding Docker mirror image according to the contract running version;
determining the number of individual contract executors needing to be deployed according to an external contract access request; and deployed to various resource points of the node in the form of a Docker container.
Optionally, the respectively performing resource usage evaluations on different contracts waiting to be deployed on the public chain specifically includes:
a. deploying environment requirements, and removing unnecessary functions in a Docker basic version;
b. analyzing the use condition of system resources;
c. according to the resource use characteristics of the contract, dividing corresponding resources from the resource pool, and forming an available independent contract execution body mirror image by using Docker according to the deployment environment requirement;
optionally, the removing of the unnecessary functions in the Docker base version in step a includes removing graphical interface related items and USB related items.
Optionally, the step b specifically includes: and analyzing the use conditions of the CPU, the memory and the disk when the contract is subjected to high concurrent processing of the limit performance of the external interface request to obtain the resource use limit data of a single contract execution body.
Optionally, the corresponding resources in step c include a CPU, a memory, a storage medium, and a network.
Optionally, in the step a, a distorless tool is used to remove all unnecessary contents in the Docker container.
In a second aspect, the present application further provides a public link contract resource allocation apparatus, including:
a configuration module for using the stable operating system as a base version of Docker;
the evaluation module is used for respectively evaluating the resource usage of different contracts to be deployed on the public chain;
a construction module for constructing a running version of the contract using the evaluated resource usage;
the mirror image module is used for constructing a corresponding Docker mirror image according to the contract running version;
the distribution module is used for determining the number of the individual contract executors needing to be deployed according to the external contract access request; and deployed to various resource points of the node in the form of a Docker container.
In a third aspect, the present application further provides an electronic device, including:
a processor, a memory and a communication unit;
the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate via the communication unit when the terminal is operating;
wherein the processor executes the machine-readable instructions to perform the methods of the various aspects described above.
In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the method according to the above-mentioned aspects.
The beneficial effect of this application is:
according to the method, an optimized Docker-based block link point resource use allocation scheme is used, each Docker container is divided in a minimum execution resource mode as much as possible, and therefore the deployment and allocation of the maximum contract executors can be achieved under the condition of limited node resources, so that resources are allocated and utilized reasonably, and resource waste is avoided.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a flowchart of a public link contract resource allocation method provided in the present application.
Fig. 2 is a block diagram of a public link contract resource allocation apparatus provided in the present application.
Fig. 3 is a schematic structural diagram of an electronic device according to the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments.
As shown in fig. 1, the present application provides a method for allocating a public link contract resource, including:
s10: using a stable operating system as a base version of Docker;
a stable operating system is used, for example a stable version of centros 7.2 is used as a base version of Docker to initially reduce the capacity of the base version. The stable operating system is an operating system which runs for a long time, has few bugs and can run for a long time without errors, each operating system has a plurality of stable versions, and the specific version depends on the running environment requirements of a contract, such as: there are many stable versions of centros, commonly 6.5, 7.0,7.2, etc., and the decision as to which version to use can be made depending on the particular contract execution environment.
S20: respectively evaluating the resource usage of different contracts waiting to be deployed on the public chain, wherein the evaluation contents are as follows:
a. deployment environment requirements: eliminating the functions which are not needed in the Docker basic version by using a tool; depending on which functions, then the reservation; the missing necessary functions are installed and configured;
b. analyzing the use condition of system resources: analyzing the use conditions of a CPU, a memory, a disk and the like of the contract when the contract is in high concurrent processing of the limit performance of the external interface request to obtain the resource use limit data of a single contract execution body;
c. according to the resource use characteristics of the obtained contract, corresponding resources such as CPU, internal memory, disk capacity and the like are divided from the resource pool, and a usable independent contract execution body mirror image is formed by Docker according to the deployment environment requirement.
The limit performance refers to the maximum limit value that a certain contract executor can process concurrently, such as: the maximum number of users that can be processed concurrently, the maximum number of requests that can be processed simultaneously within one second, etc., and the externally accessible interface provided by each contract has a concurrency processing limit.
The resource usage limit data refers to the usage of the physical resource when the contract execution body reaches the maximum processing performance, such as: the number of CPU cores occupied, the number of occupied memories, the occupation condition of disk space, the number of I/O access times and the like. The data in these limit states is the basis for dividing the Docker.
The unnecessary content in the Docker container refers to a component or a function which cannot be used by all interfaces of a contract execution body in the basic operating system version used by the Docker. For example, if there is a calculation-type contract, only the calculation is made and the result is returned. For this contract, the usage amount of the disk may be 0, and the CPU and the memory are needed much, and for this contract, in its Docker image, the content related to the interaction between the components and functions of the operating system and the disk file and the service management can be removed, and the specific content items need to be determined for the operating system used in the image and the corresponding specific contract interfaces. For example, the contracts in the above example do not need to rely on multimedia related content, and thus, multimedia related functions and components can be removed when mirroring is performed. In addition, for another contract, the graphical interface related item and the USB related item may also be removed as needed.
S30: constructing a running version of the contract according to the resource use condition obtained by the evaluation;
s40: constructing a corresponding Docker mirror image according to the contract running version;
s50: and determining how many independent contract executors need to be deployed actually according to the external contract access request condition, deploying the contract executors to each resource point of the node in a Docker container mode, and waiting for the external contract access request.
Examples are:
there is a blockchain node, where there are 4 contract execution servers, each server is configured as 64 cores 128 threads CPU, 256GB memory, 200TB disk, ten gigabit network card, and all contract executors need to be deployed on these 4 servers respectively. If a game contract is currently to be deployed, evaluation shows that the resource use condition of the game contract at the limit processing performance is 8 threads, 4GB, 20GB is maximally occupied by disk space, 50Mb is maximally occupied by network bandwidth, and 1 universal user can be supported to be simultaneously used online, so that a basic version of Docker mirror image needs to be created, a tcp/ip network communication function needs to be reserved in the mirror image, service functions such as other udp and ftp are removed, and the configuration of the Docker is set according to 4-core, 4GB and 25GB disks. The deployment of the executive body of each game contract can be directly carried out according to the Docker mirror image. When 5 multiple users need to be supported for simultaneous online use, we need to deploy 5 executives of the contract.
Various contracts all need to carry out Docker mirror image configuration of an executive body according to respective resource use limits, and resources of the servers are reasonably adjusted and distributed dynamically, so that the maximum number of deployed contract executive bodies is achieved as much as possible, supported users are not the maximum, and resource utilization is maximized.
As shown in fig. 2, the present application further provides a public link contract resource allocation apparatus, including:
a configuration module 210 for using a stable operating system as a base version of Docker;
an evaluation module 220, configured to perform resource usage evaluation on different contracts to be deployed on the public chain;
a construction module 230 for constructing a running version of the contract using the evaluated resource usage;
the mirror image module 240 is used for constructing a corresponding Docker mirror image according to the contract running version;
an allocation module 250, configured to determine the number of individual contract executors to be deployed according to an external contract access request; and deployed to various resource points of the node in the form of a Docker container.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
The above units may be one or more integrated circuits configured to implement the above methods, for example: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above units is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. As another example, these units may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 3 is a schematic structural diagram of an electronic device provided in the present application, where the electronic device includes:
a processor 310, a memory 320, and a communication unit 330;
the memory 320 stores machine-readable instructions executable by the processor 310, and when the terminal is running, the processor 310 communicates with the memory 320 through the communication unit 330;
wherein the processor 310 executes the machine-readable instructions to perform the methods of the various aspects described above.
The components of the server shown in the figures are not meant to be limiting, and may be in a bus configuration, a star configuration, more or less components than those shown, some components in combination, or a different arrangement of components, as will be appreciated by those skilled in the art.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The execution instructions in the memory 320, when executed by the processor 310, enable the electronic device to perform some or all of the steps in the above-described method embodiments.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiments of the present application, the CPU may be a single arithmetic core or may include multiple arithmetic cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present application also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided in the present application when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
According to the method, an optimized Docker-based block link point resource use allocation scheme is used, each Docker container is divided in a minimum execution resource mode as much as possible, and therefore the deployment and allocation of the maximum contract executors can be achieved under the condition of limited node resources, so that resources are allocated and utilized reasonably, and resource waste is avoided.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method for allocating common link contract resources, comprising:
using a stable operating system as a base version of Docker;
respectively evaluating the resource usage of different contracts to be deployed on a public chain;
constructing a running version of the contract according to the resource use condition obtained by the evaluation;
constructing a corresponding Docker mirror image according to the contract running version;
determining the number of individual contract executors needing to be deployed according to an external contract access request; and deployed to various resource points of the node in the form of a Docker container.
2. A method for allocating resource of a public chain contract as claimed in claim 1, wherein the resource usage evaluation is performed on different contracts waiting to be deployed on the public chain separately, wherein the evaluation comprises:
a. deploying environment requirements, and removing unnecessary functions in a Docker basic version;
b. analyzing the use condition of system resources;
c. according to the resource use characteristics of the contract, corresponding resources are divided from the resource pool, and a Docker is used for forming an available independent contract execution body mirror image according to the deployment environment requirement.
3. The method as claimed in claim 2, wherein the step a of removing the unnecessary functions in the Docker base version includes removing the gui related items and the USB related items.
4. The method for allocating a common link contract resource according to claim 2, wherein the step b specifically comprises: and analyzing the use conditions of the CPU, the memory and the disk when the contract is subjected to high concurrent processing of the limit performance of the external interface request to obtain the resource use limit data of a single contract execution body.
5. The method as claimed in claim 2, wherein the corresponding resources in step c include CPU, memory, storage medium and network.
6. The method as claimed in claim 2, wherein in step a, unnecessary functions in the Docker base version can be removed by using a distorless tool.
7. A common link contract resource allocation apparatus, comprising:
a configuration module for using the stable operating system as a base version of Docker;
the evaluation module is used for respectively evaluating the resource usage of different contracts to be deployed on the public chain;
a construction module for constructing a running version of the contract using the evaluated resource usage;
the mirror image module is used for constructing a corresponding Docker mirror image according to the contract running version;
the distribution module is used for determining the number of the individual contract executors needing to be deployed according to the external contract access request; and deployed to various resource points of the node in the form of a Docker container.
8. An electronic device, comprising:
a processor, a memory and a communication unit;
the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate via the communication unit when the terminal is operating;
wherein the processor executes the machine readable instructions to perform the method of any of claims 1-6.
9. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the method of any one of claims 1-6.
CN201911413537.XA 2019-12-31 2019-12-31 Public link contract resource allocation method and device, electronic equipment and storage medium Pending CN111240830A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911413537.XA CN111240830A (en) 2019-12-31 2019-12-31 Public link contract resource allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911413537.XA CN111240830A (en) 2019-12-31 2019-12-31 Public link contract resource allocation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111240830A true CN111240830A (en) 2020-06-05

Family

ID=70876040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911413537.XA Pending CN111240830A (en) 2019-12-31 2019-12-31 Public link contract resource allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111240830A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596904A (en) * 2020-12-25 2021-04-02 济南浪潮高新科技投资发展有限公司 Quantum service resource calling optimization method based on quantum cloud platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815764A (en) * 2017-01-18 2017-06-09 中钞***产业发展有限公司北京智能卡技术研究院 A kind of management method and system of the digital asset based on alliance's chain
CN108881440A (en) * 2018-06-19 2018-11-23 北京连琪科技有限公司 A kind of block chain contract method for building up and system for taking into account safety and performance
CN110249307A (en) * 2018-12-29 2019-09-17 阿里巴巴集团控股有限公司 System and method for executing primary contract on block chain
CN110543326A (en) * 2019-08-27 2019-12-06 山东浪潮人工智能研究院有限公司 DevOps intelligent operation and maintenance method based on block chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815764A (en) * 2017-01-18 2017-06-09 中钞***产业发展有限公司北京智能卡技术研究院 A kind of management method and system of the digital asset based on alliance's chain
CN108881440A (en) * 2018-06-19 2018-11-23 北京连琪科技有限公司 A kind of block chain contract method for building up and system for taking into account safety and performance
CN110249307A (en) * 2018-12-29 2019-09-17 阿里巴巴集团控股有限公司 System and method for executing primary contract on block chain
CN110543326A (en) * 2019-08-27 2019-12-06 山东浪潮人工智能研究院有限公司 DevOps intelligent operation and maintenance method based on block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596904A (en) * 2020-12-25 2021-04-02 济南浪潮高新科技投资发展有限公司 Quantum service resource calling optimization method based on quantum cloud platform

Similar Documents

Publication Publication Date Title
CN107360206B (en) Block chain consensus method, equipment and system
CN108614726B (en) Virtual machine creation method and device
Park et al. Locality-aware dynamic VM reconfiguration on MapReduce clouds
CN115328663B (en) Method, device, equipment and storage medium for scheduling resources based on PaaS platform
US20180181439A1 (en) Computing resource allocation optimization
CN108268372B (en) Mock test processing method and device, storage medium and computer equipment
CN112214293A (en) Method for service deployment under server-free architecture and function management platform
CN113535363A (en) Task calling method and device, electronic equipment and storage medium
CN111177984B (en) Resource utilization of heterogeneous computing units in electronic design automation
CN109189572B (en) Resource estimation method and system, electronic equipment and storage medium
CN104283951A (en) Method and device for migrating instances and system
US20200394071A1 (en) Systems and methods for cluster resource balancing in a hyper-converged infrastructure
CN114629960B (en) Resource scheduling method, device, system, equipment, medium and program product
Roytman et al. Algorithm design for performance aware VM consolidation
CN111240830A (en) Public link contract resource allocation method and device, electronic equipment and storage medium
CN112948113A (en) Cluster resource management scheduling method, device, equipment and readable storage medium
CN106919450B (en) Resource adjusting method and device
CN111475251A (en) Cluster container scheduling method, system, terminal and storage medium
CN111143033A (en) Operation execution method and device based on scalable operating system
CN111367648A (en) Resource allocation method and device
CN116010093A (en) Data processing method, apparatus, computer device and readable storage medium
CN110780992B (en) Cloud computing platform optimized deployment method, system, terminal and storage medium
CN114448909A (en) Ovs-based network card queue polling method and device, computer equipment and medium
CN115061816A (en) Method and device for processing data in cache
CN113127289B (en) Resource management method, computer equipment and storage medium based on YARN cluster

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