CN111338779B - Resource allocation method, device, computer equipment and storage medium - Google Patents

Resource allocation method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN111338779B
CN111338779B CN202010124889.XA CN202010124889A CN111338779B CN 111338779 B CN111338779 B CN 111338779B CN 202010124889 A CN202010124889 A CN 202010124889A CN 111338779 B CN111338779 B CN 111338779B
Authority
CN
China
Prior art keywords
resource
resources
business
program
service
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
CN202010124889.XA
Other languages
Chinese (zh)
Other versions
CN111338779A (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.)
Shenzhen Huarui Distributed Technology Co.,Ltd.
Original Assignee
Shenzhen Archforce Financial 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 Shenzhen Archforce Financial Technology Co Ltd filed Critical Shenzhen Archforce Financial Technology Co Ltd
Priority to CN202010124889.XA priority Critical patent/CN111338779B/en
Publication of CN111338779A publication Critical patent/CN111338779A/en
Application granted granted Critical
Publication of CN111338779B publication Critical patent/CN111338779B/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/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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a resource allocation method, a resource allocation device, computer equipment and a storage medium. The method comprises the following steps: acquiring a service program to be operated; the business program comprises at least one business process; determining target system resources which are to be allocated currently and correspond to the business program; partitioning the target system resource according to the resource demand corresponding to each service process in the service program to obtain partitioned resources matched with each resource demand; distributing the partition resources matched with the resource demand quantity to corresponding business processes respectively; when an execution instruction for a business process is generated, the business process is executed by calling partition resources allocated to the business process. The method can improve the operation efficiency of the service program.

Description

Resource allocation method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a resource allocation method and apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, a performance optimization technology appears, which is to improve the operating efficiency of the system without affecting the normal operation of the system, that is, the performance optimization technology can make the system operate in unit time and complete more tasks. The traditional method for implementing the performance optimization technology is to increase the performance of the system by increasing schedulable resources of the system, and specifically may be implemented by using a multi-core CPU (Central Processing Unit), increasing a memory, increasing a network bandwidth, using a solid state disk, or modifying kernel parameters.
However, for the system, although a conventional manner of increasing system schedulable resources plays a certain role in optimizing system performance, the response time spent by the programs on the system when running using external resources is long, so that the time for running each program is long, thereby causing a problem of low efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a resource allocation method, device, computer device, and storage medium capable of improving operating efficiency.
A method of resource allocation, the method comprising:
acquiring a service program to be operated; the business program comprises at least one business process;
determining a target system resource which is to be allocated currently and corresponds to the business program;
partitioning the target system resource according to the resource demand amount corresponding to each business process in the business program to obtain partitioned resources matched with each resource demand amount;
distributing the partition resources matched with the resource demand quantity to corresponding business processes respectively;
and when an execution instruction for the business process is generated, the business process is executed by calling the partition resources distributed to the business process.
An apparatus for resource allocation, the apparatus comprising:
the acquisition module is used for acquiring a service program to be operated; the business program comprises at least one business process;
the determining module is used for determining the target system resource which is currently to be allocated and corresponds to the business program;
the partitioning module is used for partitioning the target system resource according to the resource demand amount corresponding to each business process in the business program to obtain partitioned resources matched with each resource demand amount;
the distribution module is used for distributing the partition resources matched with the resource demand quantity to the corresponding service processes respectively;
and the execution module is used for executing the business process by calling the partition resources distributed to the business process when an execution instruction of the business process is generated.
A computer device comprising a memory storing a computer program and a processor implementing the above steps of resource allocation when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned steps of resource allocation.
In the resource allocation method, the target system resources corresponding to each service program are subjected to resource partitioning according to the resource demand required by each service process in the service program, partition resources matched with the resource demand of each service process are allocated, and finally the corresponding service process is executed by calling the partition resources of each service process. From the perspective of a single process, each business process has exclusive resources, so that the problem of interruption caused by resource preemption of the business process during processing can be avoided, the time for transmitting and switching the business process among different resources is reduced, the time for processing the whole serial task is effectively shortened, and the processing efficiency of an operating system is improved. From the perspective of multi-service processes, resource contention among different service processes can be avoided. Especially under the condition of high service pressure, the method can ensure that the processing time of each different service process is shortened, thereby greatly improving the efficiency of running the service program on the operating system. Meanwhile, the performance of the system is optimized by partitioning the resources in the inherent resources, and the cost of the spent resources is almost zero, so that the cost of the resources is effectively saved.
Drawings
FIG. 1 is a diagram of an exemplary environment in which a method for allocating resources may be implemented;
FIG. 2 is a flow diagram illustrating a method for resource allocation in one embodiment;
FIG. 3 is a flowchart illustrating steps of allocating partition resources matching the resource demands to corresponding business processes, respectively, in an embodiment;
FIG. 4 is a flowchart illustrating a resource allocation method according to another embodiment;
FIG. 5 is a block diagram showing the structure of a resource allocation apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The resource allocation method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 110 communicates with the server 120 through a network. The terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers. The terminal 110 and the server 120 may be used separately to execute the resource allocation method mentioned in the embodiments of the present application. The terminal 110 and the server 120 may also be cooperatively used to perform the resource allocation method mentioned in the embodiments of the present application.
It is understood that the terminal and the server in fig. 1 can be referred to as a computer device, and the computer device runs an operating system, and the service program runs in the operating system. Of course, the computer device also includes hardware structures, such as hardware servers, for supporting the operation of the operating system and the service programs. When the computer device runs the service program, the content related to the service process in the service program can be converted into the form of electric signals of 0 and 1, and the electric signals are used for operation, processing and transmission on the hardware structure.
In an embodiment, as shown in fig. 2, a resource allocation method is provided, which is described by taking an example that the method is applied to a computer device, where the computer device may specifically be the terminal 110 or the server 120 in fig. 1, and the resource allocation method includes the following steps:
s202, acquiring a service program to be operated; the business program includes at least one business process.
Wherein the business program is a computer program running on an operating system of the computer device. Computer programs are ordered sequences of instructions that can be used to direct a computer device to perform a particular action, written in a programming language, and converted into instructions that can be recognized by the computer device to perform a corresponding function. The service program is an application program in a computer program, and is used for solving a user-specific problem, and may specifically be a text translation program, a financial management program, or a network data monitoring program, and the like, which is determined according to a specific service to be processed, and is not limited in this embodiment of the present application.
A business process is a dynamic execution process of a business program on an operating system. Each business program may comprise at least one business process, i.e. each business program comprises at least one dynamic execution process. The process is a basic unit of system resource competition on the computer equipment, one business program can correspond to a plurality of business processes, but each business process can only correspond to one business program.
Specifically, the computer device may obtain the service program to be run from an operating system of the local or other computer device. In one embodiment, a service program runs on a terminal, a computer device can obtain address information of the service program by sending an instruction to the terminal, and the computer device calls the corresponding service program on the terminal through the received address information.
In one embodiment, an operating system runs in the computer device, and a service program runs in the operating system, and the computer device manages and controls system resources of the device through the running operating system, and schedules corresponding system resources to execute the service program running on the operating system. Among other things, operating systems are computer programs that manage and control the hardware and software resources in a computer device. Specifically, the operating system may be a desktop operating system such as a Windows (Windows) operating system, a Linux operating system, or a Mac OS (apple desktop operating system), or may be a mobile terminal operating system such as an iOS (apple mobile terminal operating system) or an Android (Android) operating system.
In one embodiment, the operating system running on the computer device is a Linux operating system, and the computer device manages and controls system resources of the device through the Linux operating system and schedules corresponding system resources to execute the service program running on the operating system.
S204, determining the target system resource which is to be distributed currently and corresponds to the business program.
Wherein the target system resource is a resource corresponding to the business program in the system resources. The system resources include software resources and hardware resources. The software resources refer to programs developed for improving the use efficiency of the computer and related documents for development, use and maintenance of the computer, and the hardware resources mainly refer to computing resources and storage resources, such as a CPU, a hard disk or an internal memory. The hardware resources comprise local hardware resources or external hardware resources.
In an embodiment, the number of the service programs is greater than one, and step S204, that is, the step of determining the target system resource to be currently allocated and corresponding to the service program specifically includes: determining the system resources to be distributed currently and the total resource demand amount corresponding to each business program; partitioning the system resources according to the total resource demand amount corresponding to each business program to obtain target system resources matched with the total resource demand amount; and respectively distributing the target system resources matched with the total quantity of the resource demands to the corresponding business programs.
In one embodiment, a computer device may partition system resources in business program units by a running operating system. The computer equipment determines the total resource demand amount corresponding to each service program, partitions the system resources according to the total resource demand amount, obtains target system resources matched with the total resource demand amount, and distributes the target system resources to the corresponding service programs.
In one embodiment, the computer device may allocate resources to hardware resources, such as CPUs, among the system resources. Specifically, the computer device may obtain target CPUs matched with the total CPU demand by determining the total CPU demand corresponding to each service program, and partitioning the CPUs according to the total CPU demand, and allocate the target CPUs to the corresponding service programs.
In one embodiment, a computer device performs resource allocation for hard disks in system resources. Specifically, the computer device may obtain a target hard disk matching the total amount of the hard disk requirements by determining the total amount of the hard disk requirements corresponding to each service program, and partitioning the hard disk according to the total amount of the hard disk requirements, and allocating the target hard disk to the corresponding service program.
In one embodiment, the computer device allocates resources to network cards in the system resources. Specifically, the computer device may obtain a target network card matching the total amount of the network card requirements by determining the total amount of the network card requirements corresponding to each service program, and partitioning the network card according to the total amount of the network card requirements, and allocating the target network card to the corresponding service program.
In the above embodiment, the computer device partitions the system resources according to the total amount of resource requirements corresponding to each service program, so that each service program can be allocated to sufficient system resources. When each service program runs on the operating system, resources cannot be occupied by other service programs, and the running efficiency of each service program is ensured, so that the running efficiency of the whole operating system is improved.
In an embodiment, the step S204, that is, the step of determining the target system resource to be currently allocated and corresponding to the service program, specifically includes: determining system resources in an idle state and additional tasks irrelevant to a service program; binding the extra task with a preset resource in the system resource; and taking the resource without the preset resource in the system resource as a target system resource corresponding to the service program.
Wherein, the extra task unrelated to the service program can be an interrupt program, such as system interrupt or network interrupt. The system resources comprise preset resources and target system resources, and the preset resources are resources which are preset by the computer equipment and are used for running extra tasks irrelevant to the service program.
In one embodiment, the computer device sets a preset resource from the system resources, takes the system resources except the preset resource as target system resources, and binds with each service program. When the computer device detects an interrupt program generated by the peripheral device, such as a keyboard key is clicked or the network connection does not respond to the interrupt program, the computer device can call a preset resource in the system resource to process the interrupt program.
In one embodiment, the computer device may allocate resources to hardware resources in the system resources, where the hardware resources include a CPU, a hard disk, or a network card. Specifically, the computer device can use the external CPU as a preset resource, and bind with other additional tasks, and use the local CPU as a target system resource; the computer equipment can take the external hard disk as a preset resource, bind with other extra tasks and take the local hard disk as a target system resource; the computer equipment can take the external network card as a preset resource, and bind with other additional tasks, and take the local network card as a target system resource.
In the above embodiment, the computer device reserves the preset resource in the system resource, and uses the resource from which the preset resource is removed in the system resource as the target system resource corresponding to the service program, so that the computer device can quickly determine the target system resource to be allocated currently and corresponding to the service program, and when each service program runs on the operating system, the resource is not preempted by an additional task, thereby ensuring the running efficiency of the service program, and improving the running efficiency of the entire operating system.
And S206, partitioning the target system resource according to the resource demand corresponding to each service process in the service program to obtain partitioned resources matched with each resource demand.
The resource demand is the amount of resources required by each service process in the service program. The target system resource is the amount of resource required by the business program. The partition resource is a resource obtained by dividing the target system resource into regions, that is, the target system resource at least includes one partition resource.
In one embodiment, the computer device may retrieve configuration information of each service process in the service program, determine a resource demand amount corresponding to each service process, and partition the target system resource according to the resource demand amount corresponding to each service process in the service program, thereby obtaining a partition resource matched with each resource demand amount.
In one embodiment, the computer device may determine the total number of the service processes by counting the number of the service processes in the service program, and partition the target system resource according to the total number of the service processes in the service program, thereby obtaining a partition resource matching the number of the service processes.
And S208, distributing the partition resources matched with the resource demand quantity to corresponding business processes respectively.
Specifically, the computer device determines partition resources matched with the resource demand amount corresponding to each service process from the target system resources, and allocates the partition resources matched with the resource demand amount corresponding to each service process to the corresponding service process respectively.
In one embodiment, the computer device may determine partition resources matching the number of the business processes from the target system resources, and allocate the partition resources matching the number of the business processes to the corresponding business processes respectively.
In one embodiment, the computer device manages and controls the running business program through the operating system of the Linux kernel. The Linux operating system performs resource scheduling on the service programs in a mode of mutually occupying resources. The resource allocation may be applied spontaneously by each service process in the service program, and the computer device may allocate the corresponding system resource according to the priority of each service process, and preferentially allocate the system resource corresponding to the service process with the higher priority.
In one embodiment, when each business process in the business program applies for resource allocation, the computer device may allocate system resources corresponding to each business process according to a polling algorithm. Specifically, the CPU sends out an inquiry command to each service process at regular time, so as to instruct to sequentially inquire the resource allocation status of each service process, and allocate corresponding system resources according to the resource demand of each service process.
S210, when an execution instruction for the business process is generated, the business process is executed by calling the partition resources allocated to the business process.
Wherein the execution instruction is an instruction instructing the business process to run on the system.
Specifically, the computer device calls partition resources allocated to the business process on the operating system according to the generated execution instruction, wherein the partition resources are used for executing the corresponding business process.
In one embodiment, the computer device may allocate resources to hardware resources, such as CPUs, among the system resources. Specifically, the computer device may determine the CPU demand amount corresponding to each service process, and partition the target CPU according to the CPU demand amount corresponding to each service process, thereby determining the partition resources matched with the CPU demand amount corresponding to each service process, and respectively allocating the partition resources matched with the CPU demand amount corresponding to each service process to the corresponding service process. The computer equipment can call the target CPU to perform corresponding operation processing on each service program according to the received execution instruction.
In one embodiment, a computer device performs resource allocation for hard disks in system resources. Specifically, the computer device may determine the hard disk demand amount corresponding to each service process, and partition the target hard disk according to the hard disk demand amount corresponding to each service process, thereby determining the partition resources matched with the hard disk demand amount corresponding to each service process, and respectively allocating the partition resources matched with the hard disk demand amount corresponding to each service process to the corresponding service process. The computer device may call the target hard disk to perform corresponding read-write processing on each service program according to the received execution instruction, under the condition that the IOPS (Input/Output Operations Per Second) of the local hard disk is not changed.
In one embodiment, the computer device allocates resources to network cards in the system resources. Specifically, the computer device may determine the network card demand amount corresponding to each service process, and partition the target network card according to the network card demand amount corresponding to each service process, thereby determining the partition resources matched with the network card demand amount corresponding to each service process, and respectively allocate the partition resources matched with the network card demand amount corresponding to each service process to the corresponding service process. The computer equipment can call the target network card to perform corresponding network interaction processing on each service program according to the received execution instruction, and respectively binds the network data traffic of each service process in the service program to the corresponding network card.
In the resource allocation method, the target system resources corresponding to each service program are subjected to resource partitioning according to the resource demand required by each service process in the service program, partition resources matched with the resource demand of each service process are allocated, and finally the corresponding service process is executed by calling the partition resources of each service process. From the perspective of a single process, each business process has exclusive resources, so that the problem of interruption caused by resource preemption of the business process during processing can be avoided, the time for transmitting and switching the business process among different resources is reduced, the time for processing the whole serial task is effectively shortened, and the processing efficiency of an operating system is improved. From the perspective of multi-service processes, resource contention among different service processes can be avoided. Especially under the condition of high service pressure, the processing time of each different service process can be ensured to be shortened, thereby greatly improving the efficiency of operating the service program by the operating system. Meanwhile, the performance of the system is optimized by partitioning the resources in the inherent resources, and the cost of the spent resources is almost zero, so that the cost of the resources is effectively saved.
Referring to fig. 3, in an embodiment, the step S208, that is, the step of allocating the partition resources matched with the resource demand to the corresponding service processes respectively includes:
s302, distributing corresponding resource identifiers for the partition resources.
The resource identifier is identification information for distinguishing each partition resource, and may be an ID (Identity document) of each partition resource, address information of each partition resource stored in the system, and the like. Wherein the resource identifier is used to uniquely identify the partitioned resource.
S304, determining the partition resources matched with the resource demand of each business process.
Specifically, the computer device determines the resource demand amount corresponding to each service process in the service program, and partitions the target system resource according to the resource demand amount corresponding to each service process in the service program to obtain the partition resource matched with each resource demand amount.
In one embodiment, the computer device determines the number of each service process in the service program, and partitions the target system resource according to the number of each service process in the service program to obtain partitioned resources matched with the number of each service process.
S306, the process identification of the business process is associated with the resource identification of the matched partition resource, so that the corresponding partition resource is distributed to each business process.
Specifically, the computer device determines a process identifier of each service process, associates the process identifier of the service process with a resource identifier of a partition resource matched with the process identifier of the service process, and allocates the partition resource corresponding to each service process, so that the computer device can execute each service process by calling the partition resource matched with each service process.
In the above embodiment, the computer device performs association processing on the process identifier of the service process and the resource identifier of the partition resource that is matched with the process identifier, and allocates the partition resource corresponding to each service process, so that each partition resource can be bound with the corresponding service process, and each service process can call the corresponding partition resource to operate. Therefore, the method can avoid the contention of resources for each business process in the operation process, and can ensure that the processing time of each different business process is shortened especially under the condition of high business pressure, thereby greatly improving the efficiency of the whole operating system.
In one embodiment, the resource allocation method is executed by a computer device, where the computer device is provided with a CPU slot, the CPU slot is electrically connected to at least one corresponding memory slot through a memory controller, and a CPU inserted in the CPU slot is used to schedule an internal memory inserted in the memory slot electrically connected to the CPU slot.
In one embodiment, the computer device is connected with the external CPU through a built-in CPU socket, schedules an external memory inserted in an external memory socket electrically connected with the external CPU socket, and allocates resources of the external memory to a business process controlled by the local CPU.
In one embodiment, the computer device is connected with an external CPU through a built-in CPU slot, schedules an external hard disk inserted in an external hard disk slot electrically connected with the external CPU slot, and allocates resources of the external hard disk to a business process controlled by a local CPU.
In one embodiment, the computer device is connected with the external CPU through a built-in CPU slot, schedules the external network card inserted into an external network card slot electrically connected with the external CPU slot, and allocates the resources of the external network card to a service process controlled by the local CPU.
In the above embodiment, the computer device is connected to the external CPU through the CPU socket, and schedules the external resource electrically connected to the external CPU socket. The response time of resources required by the scheduling of the business process in the computer equipment can be reduced, so that the efficiency of the operating system is effectively improved.
In one embodiment, the target system resource includes an internal memory; the memory slots comprise a local memory slot and an external memory slot; step S206, namely, the step of partitioning the target system resource according to the resource demand corresponding to each service process in the service program to obtain the partition resource matching with each resource demand specifically includes the following steps: according to the resource demand quantity corresponding to each service process in the service program, the local memory inserted in the local memory slot is preferentially partitioned to obtain the corresponding partition resource; when the storage capacity in the local internal memory is partitioned, partitioning the external internal memory inserted into the external internal memory slot according to the resource demand corresponding to the unallocated service process to obtain the corresponding partition resource.
In one embodiment, the computer device may allocate resources to hardware resources, such as CPUs, among the system resources. And the computer equipment preferentially partitions the local CPU inserted into the local CPU slot according to the CPU demand corresponding to each business process in the business program to obtain corresponding partition resources. And when the local CPU is partitioned, partitioning the external CPU inserted into the external CPU slot according to the CPU demand corresponding to the unallocated service process to obtain corresponding partition resources.
In one embodiment, the external memory of the computer device may be an external hard disk. And the computer equipment preferentially partitions the local memory inserted into the local memory slot according to the storage resource demand amount corresponding to each service process in the service program to obtain the corresponding partition resource. And when the storage capacity in the local memory is partitioned, partitioning the external hard disk inserted into the external hard disk slot according to the storage resource demand corresponding to the unallocated service process to obtain the corresponding partition resource.
In one embodiment, the computer device determines network data traffic generated by each business process in the business program during operation. The computer device preferentially partitions the local network card inserted into the local network card slot according to the network data traffic generated by each service process in the service program in the operation process to obtain the corresponding partition traffic. And when the flow in the local network card is partitioned, partitioning the external network card inserted into the external network card slot according to the network data flow generated by the unallocated service process to obtain the corresponding partition flow. The network card slot may be a PCIE (peripheral component interconnect express, bus and interface standard) network card slot.
In the above embodiment, the computer device preferentially partitions the local internal memory inserted into the local internal memory slot to obtain the partition resource corresponding to the local internal memory, and partitions the external internal memory inserted into the external internal memory slot to obtain the partition resource corresponding to the external internal memory when the storage capacity in the local internal memory is partitioned. By means of the partition mode of resource expansion, the transmission distance of electric signals generated during the execution of the business process in a hardware server of the computer equipment is greatly shortened, the time consumed for completing the business process is reduced, and therefore the efficiency of an operating system is effectively improved.
Referring to fig. 4, in a specific embodiment, the resource allocation method includes the following steps:
s402, acquiring a service program to be operated; the business program includes at least one business process.
S404, determining the system resource to be distributed currently and the total resource demand amount corresponding to each business program.
S406, partitioning the system resources according to the total resource demand amount corresponding to each service program to obtain target system resources matched with the total resource demand amount.
And S408, distributing the target system resources matched with the total resource demand amount to corresponding business programs respectively.
And S410, partitioning the target system resource according to the resource demand corresponding to each service process in the service program to obtain partitioned resources matched with each resource demand.
And S412, distributing the partition resources matched with the resource demand quantities to corresponding business processes respectively.
S414, when the execution instruction of the business process is generated, the partition resources distributed to the business process are called to execute the business process.
According to the business process processing method, the target system resources corresponding to each business program are subjected to resource partitioning according to the resource demand required by each business process in the business program, partition resources matched with the resource demand of each business process are distributed, and finally the corresponding business process is executed by calling the partition resources of each business process. From the perspective of a single process, each business process has exclusive resources, so that the problem of interruption caused by resource preemption of the business process during processing can be avoided, the time for transmitting and switching the business process among different resources is reduced, the time for processing the whole serial task is effectively shortened, and the processing efficiency of an operating system is improved. From the perspective of multi-service processes, resource contention among different service processes can be avoided. Especially under the condition of high service pressure, the processing time of each different service process can be ensured to be shortened, thereby greatly improving the efficiency of operating the service program by the operating system. Meanwhile, the performance of the system is optimized by partitioning the resources in the inherent resources, and the cost of the spent resources is almost zero, so that the cost of the resources is effectively saved.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 5, there is provided a resource allocation apparatus, including: an obtaining module 501, a determining module 502, a partitioning module 503, an allocating module 504, and an executing module 505, wherein:
an obtaining module 501, configured to obtain a service program to be run; the business program includes at least one business process.
A determining module 502, configured to determine a target system resource to be currently allocated and corresponding to the service program.
And the partitioning module 503 is configured to partition the target system resource according to the resource demand corresponding to each service process in the service program, so as to obtain a partition resource matched with each resource demand.
An allocating module 504, configured to allocate the partition resources matched with the resource demand to corresponding service processes respectively.
And the execution module 505 is used for executing the business process by calling the partition resources allocated to the business process when the execution instruction of the business process is generated.
In one embodiment, the determining module 502 is further configured to determine the system resources to be currently allocated and the total amount of resource demand corresponding to each service program; partitioning the system resources according to the total resource demand amount corresponding to each business program to obtain target system resources matched with the total resource demand amount; and respectively distributing the target system resources matched with the total quantity of the resource demands to the corresponding business programs.
In one embodiment, the determining module 502 is further configured to determine the system resources currently in the idle state and additional tasks unrelated to the business process; binding the extra task with a preset resource in the system resource; and taking the resource without the preset resource in the system resource as a target system resource corresponding to the service program.
In one embodiment, the allocating module 504 is further configured to allocate a corresponding resource identifier for each partition resource; determining partition resources matched with the resource demand of each business process; and performing association processing on the process identifier of the service process and the resource identifier of the matched partition resource to allocate corresponding partition resources to each service process.
In an embodiment, the resource allocation apparatus 500 is deployed on a computer device, where a CPU slot is disposed in the computer device, the CPU slot is electrically connected to at least one corresponding memory slot through a memory controller, and a CPU inserted in the CPU slot is used to schedule an internal memory inserted in the memory slot electrically connected to the CPU slot.
In one embodiment, the target system resource includes an internal memory; the memory slots comprise a local memory slot and an external memory slot; the partitioning module 503 is further configured to preferentially partition the local memory inserted in the local memory slot according to the resource demand corresponding to each service process in the service program, so as to obtain a partition resource corresponding to the local memory inserted in the local memory slot; when the storage capacity in the local internal memory is partitioned, partitioning the external internal memory inserted into the external internal memory slot according to the resource demand corresponding to the unallocated service process to obtain the corresponding partition resource.
In the resource allocation device, the target system resources corresponding to each service program are subjected to resource partitioning according to the resource demand required by each service process in the service program, partition resources matched with the resource demand of each service process are allocated, and finally the corresponding service process is executed by calling the partition resources of each service process. From the perspective of a single process, each business process has exclusive resources, so that the problem of interruption caused by resource preemption of the business process during processing can be avoided, the time for transmitting and switching the business process among different resources is reduced, the time for processing the whole serial task is effectively shortened, and the processing efficiency of an operating system is improved. From the perspective of multi-service processes, resource contention among different service processes can be avoided. Especially under the condition of high service pressure, the processing time of each different service process can be ensured to be shortened, thereby greatly improving the efficiency of operating the operating program by the operating system. Meanwhile, the performance of the system is optimized by partitioning the resources in the inherent resources, and the cost of the spent resources is almost zero, so that the cost of the resources is effectively saved.
For specific limitations of the resource allocation apparatus, reference may be made to the above limitations of the resource allocation method, which is not described herein again. The modules in the resource allocation apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, and the computer device may be specifically a terminal or a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, and a communication interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The Communication interface of the computer device is used for performing wired or Wireless Communication with an external terminal, and the Wireless Communication may be implemented by WIFI (Wireless Fidelity, Wireless local area network), an operator network, NFC (Near Field Communication), or other technologies. The computer program is executed by a processor to implement a resource allocation method.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the steps of the above-described resource allocation method. Here, the steps of the resource allocation method may be steps in the resource allocation methods of the above-described embodiments.
In one embodiment, a computer readable storage medium is provided, storing a computer program which, when executed by a processor, causes the processor to perform the steps of the above-described resource allocation method. Here, the steps of the resource allocation method may be steps in the resource allocation methods of the above-described embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A resource allocation method is executed by a computer device, the computer device is provided with a CPU slot, the CPU slot is electrically connected with at least one corresponding memory slot through a memory controller, a CPU inserted into the CPU slot is used for scheduling an internal memory inserted into the memory slot electrically connected with the CPU slot, and the method comprises the following steps:
acquiring a service program to be operated; the business program comprises at least one business process;
determining a target system resource to be allocated currently and corresponding to the service program, wherein the target system resource comprises an external system resource except a preset resource from the external system resource, the target system resource is bound with the service program, and the target system resource comprises an internal memory; the memory slots comprise a local memory slot and an external memory slot;
partitioning the target system resource according to the resource demand amount corresponding to each business process in the business program to obtain partitioned resources matched with each resource demand amount, wherein the partitioning method comprises the following steps: according to the resource demand quantity corresponding to each business process in the business program, preferentially partitioning a local internal memory inserted into a local internal memory slot to obtain corresponding partitioned resources; when the storage capacity in the local internal memory is partitioned, partitioning the external internal memory inserted into the external internal memory slot according to the resource demand corresponding to the unallocated service process to obtain the corresponding partition resource;
distributing the partition resources matched with the resource demand quantity to corresponding business processes respectively;
and when an execution instruction for the business process is generated, the business process is executed by calling the partition resources distributed to the business process.
2. The method of claim 1, wherein the number of business processes is greater than one; the determining of the target system resource to be allocated currently and corresponding to the business program includes:
determining the system resources to be distributed currently and the total resource demand amount corresponding to each business program;
partitioning the system resources according to the total resource demand amount corresponding to each business program to obtain target system resources matched with the total resource demand amount;
and respectively distributing the target system resources matched with the total quantity of the resource demands to corresponding business programs.
3. The method of claim 1, wherein determining the target system resource to be currently allocated and corresponding to the business process further comprises:
determining the system resources which are in an idle state at present and additional tasks which are irrelevant to the service program;
binding the additional task with a preset resource in the system resource;
and taking the resource without the preset resource in the system resource as a target system resource corresponding to the service program.
4. The method according to claim 1, wherein said allocating the partition resources matched with each of the resource demands to the corresponding business processes respectively comprises:
distributing corresponding resource identifiers for the partition resources;
determining partition resources matched with the resource demand of each business process;
and associating the process identification of the service process with the resource identification of the matched partition resource to allocate the corresponding partition resource to each service process.
5. A resource allocation apparatus, configured to a computer device, where the computer device is provided with a CPU socket, the CPU socket is electrically connected to at least one corresponding memory socket through a memory controller, and a CPU inserted in the CPU socket is configured to schedule an internal memory inserted in the memory socket electrically connected to the CPU socket, and the apparatus includes:
the acquisition module is used for acquiring a service program to be operated; the business program comprises at least one business process;
a determining module, configured to determine a target system resource to be currently allocated and corresponding to the service program, where the target system resource includes an external system resource except a preset resource from the external system resource, the target system resource is bound with the service program, and the target system resource includes an internal memory; the memory slots comprise a local memory slot and an external memory slot;
the partitioning module is configured to partition the target system resource according to the resource demand corresponding to each service process in the service program, so as to obtain a partitioned resource matching each resource demand, and includes: according to the resource demand quantity corresponding to each business process in the business program, preferentially partitioning a local internal memory inserted into a local internal memory slot to obtain corresponding partitioned resources; when the storage capacity in the local internal memory is partitioned, partitioning the external internal memory inserted into the external internal memory slot according to the resource demand corresponding to the unallocated service process to obtain the corresponding partition resource;
the distribution module is used for distributing the partition resources matched with the resource demand quantity to the corresponding service processes respectively;
and the execution module is used for executing the business process by calling the partition resources distributed to the business process when an execution instruction of the business process is generated.
6. The apparatus of claim 5, wherein the number of business processes is greater than one; the determining module is further configured to determine a current system resource to be allocated and a total resource demand amount corresponding to each service program; partitioning the system resources according to the total resource demand amount corresponding to each business program to obtain target system resources matched with the total resource demand amount; and respectively distributing the target system resources matched with the total quantity of the resource demands to corresponding business programs.
7. The apparatus of claim 5, wherein the determining module is further configured to determine the system resources currently in an idle state and additional tasks unrelated to the business process; binding the additional task with a preset resource in the system resource; and taking the resource without the preset resource in the system resource as a target system resource corresponding to the service program.
8. The apparatus of claim 5, wherein the allocating module is further configured to allocate a corresponding resource identifier for each of the partition resources; determining partition resources matched with the resource demand of each business process; and associating the process identification of the service process with the resource identification of the matched partition resource to allocate the corresponding partition resource to each service process.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 4.
CN202010124889.XA 2020-02-27 2020-02-27 Resource allocation method, device, computer equipment and storage medium Active CN111338779B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010124889.XA CN111338779B (en) 2020-02-27 2020-02-27 Resource allocation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010124889.XA CN111338779B (en) 2020-02-27 2020-02-27 Resource allocation method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111338779A CN111338779A (en) 2020-06-26
CN111338779B true CN111338779B (en) 2021-11-02

Family

ID=71185667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010124889.XA Active CN111338779B (en) 2020-02-27 2020-02-27 Resource allocation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111338779B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112308457A (en) * 2020-11-23 2021-02-02 Oppo(重庆)智能科技有限公司 Resource allocation method, device and computer readable storage medium
CN112506652B (en) * 2020-12-01 2023-10-20 中国科学院深圳先进技术研究院 Dynamic resource partitioning method
CN113204384B (en) * 2021-05-14 2023-05-16 山东英信计算机技术有限公司 Device starting method, device and computer readable storage medium
CN115225565B (en) * 2022-07-25 2023-12-15 科东(广州)软件科技有限公司 Data packet receiving and sending configuration, receiving and sending methods and devices and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043213A (en) * 2007-03-15 2007-09-26 复旦大学 Field programmable logical array wiring resource structure and its modeling approach thereof
CN108845884A (en) * 2018-06-15 2018-11-20 中国平安人寿保险股份有限公司 Physical source distributing method, apparatus, computer equipment and storage medium
CN110427246A (en) * 2019-06-29 2019-11-08 西南电子技术研究所(中国电子科技集团公司第十研究所) Multi-core virtual subregion reconfiguration system
CN110489227A (en) * 2019-07-09 2019-11-22 招联消费金融有限公司 A kind of resource allocation methods, device, computer equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766182A (en) * 2018-12-18 2019-05-17 平安科技(深圳)有限公司 The scalable appearance method, apparatus of system resource dynamic, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101043213A (en) * 2007-03-15 2007-09-26 复旦大学 Field programmable logical array wiring resource structure and its modeling approach thereof
CN108845884A (en) * 2018-06-15 2018-11-20 中国平安人寿保险股份有限公司 Physical source distributing method, apparatus, computer equipment and storage medium
CN110427246A (en) * 2019-06-29 2019-11-08 西南电子技术研究所(中国电子科技集团公司第十研究所) Multi-core virtual subregion reconfiguration system
CN110489227A (en) * 2019-07-09 2019-11-22 招联消费金融有限公司 A kind of resource allocation methods, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111338779A (en) 2020-06-26

Similar Documents

Publication Publication Date Title
CN111338779B (en) Resource allocation method, device, computer equipment and storage medium
US20220342713A1 (en) Information reporting method, apparatus and device, and storage medium
CN110096336B (en) Data monitoring method, device, equipment and medium
CN111104208B (en) Process scheduling management method, device, computer equipment and storage medium
CN111406250A (en) Provisioning using prefetched data in a serverless computing environment
CN108572845B (en) Upgrading method of distributed micro-service cluster and related system
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN107766145B (en) Memory management method and device under dual systems
CN112905342B (en) Resource scheduling method, device, equipment and computer readable storage medium
CN110704177A (en) Computing task processing method and device, computer equipment and storage medium
CN112685148A (en) Asynchronous communication method and device of mass terminals, computer equipment and storage medium
CN116185623A (en) Task allocation method and device, electronic equipment and storage medium
CN111625339A (en) Cluster resource scheduling method, device, medium and computing equipment
CN113886058A (en) Cross-cluster resource scheduling method and device
CN106775975B (en) Process scheduling method and device
CN106354428B (en) Storage sharing system of multi-physical layer partition computer system structure
CN114546587A (en) Capacity expansion and reduction method of online image recognition service and related device
CN107634978B (en) Resource scheduling method and device
CN116881003A (en) Resource allocation method, device, service equipment and storage medium
CN116233022A (en) Job scheduling method, server and server cluster
CN111813564B (en) Cluster resource management method and device and container cluster management system
CN114217956A (en) Container cluster deployment method and device and computer equipment
CN115878309A (en) Resource allocation method, device, processing core, equipment and computer readable medium
CN109062702B (en) Computing resource allocation method, related device and readable storage medium
CN109478151B (en) Network accessible data volume modification

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Applicant after: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

Address before: 518048 603-604, block a, Tianjing building, Tian'an Digital City, Futian District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Huarui Distributed Technology Co.,Ltd.

Address before: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.