CN116578410A - Resource management method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN116578410A
CN116578410A CN202310394995.3A CN202310394995A CN116578410A CN 116578410 A CN116578410 A CN 116578410A CN 202310394995 A CN202310394995 A CN 202310394995A CN 116578410 A CN116578410 A CN 116578410A
Authority
CN
China
Prior art keywords
resource
target application
allocated
mode
starting mode
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
CN202310394995.3A
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.)
Tianjin Zhongke Shuguang Storage Technology Co ltd
Original Assignee
Tianjin Zhongke Shuguang Storage 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 Tianjin Zhongke Shuguang Storage Technology Co ltd filed Critical Tianjin Zhongke Shuguang Storage Technology Co ltd
Priority to CN202310394995.3A priority Critical patent/CN116578410A/en
Publication of CN116578410A publication Critical patent/CN116578410A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • 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/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • 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/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The application relates to a resource management method, a resource management device, a computer device and a storage medium. The method comprises the following steps: determining a starting mode of the target application, and distributing corresponding resources for the target application according to the starting mode and a preset configuration file, wherein the preset configuration file comprises resource distribution modes in different starting modes. According to the method, the corresponding resources are allocated to the target application through the resource allocation mode indicated by the preset configuration file, the target application is guided to use the hardware resources in a mode which is beneficial to resource allocation in the target application as much as possible in the execution process, the integration degree of the hardware of the target application and the corresponding interaction part in design and realization is improved, and therefore the loss of IO performance of a distributed system where the terminal is located is reduced.

Description

Resource management 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 management method, apparatus, computer device, and storage medium.
Background
With the development of computer science, the data path performance of a distributed file system is highly dependent on the performance of network cards and disks on Input/Output (IO) paths.
At present, the hardware of an application program and a corresponding interaction part on a client side in a distributed file system has low fusion degree in design and implementation, so that data in the distributed file system can be accessed across non-uniform memory (Non Uniform Memory Access, NUMA) when written into a cache or sent to a network, and further IO performance is lost.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a resource management method, apparatus, computer device, and storage medium that can improve the degree of integration of design and implementation of applications and corresponding hardware on a client.
In a first aspect, the present application provides a resource management method. The method comprises the following steps:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
According to the method, the corresponding resources are allocated to the target application through the resource allocation mode indicated by the preset configuration file, the target application is guided to use the hardware resources in a mode which is beneficial to resource allocation in the target application as much as possible in the execution process, the integration degree of the hardware of the target application and the corresponding interaction part in design and realization is improved, and therefore the loss of IO performance of a distributed system where the terminal is located is reduced.
In one embodiment, allocating corresponding resources for the target application according to the start mode and the preset configuration file includes:
determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
and distributing corresponding resources for the target application according to the resource distribution mode.
In the resource allocation method provided by the embodiment of the application, different resource allocation modes can be matched for different starting modes of the target application, so that the target application and the hardware can be fused more flexibly, and the fusion degree of the software and the hardware is improved.
In one embodiment, allocating corresponding resources for a target application according to a resource allocation manner includes:
and under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
The embodiment of the application provides a resource allocation mode in a direct starting mode, and resource allocation is carried out according to the weight of each allocated resource, so that the process of a target application can be matched for each allocated resource, the target application and hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, binding each allocated resource with a process of a target application according to a weight of each resource to be allocated includes:
determining the binding quantity corresponding to each resource to be allocated according to the weight of each resource to be allocated;
and binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In the resource allocation method provided by the embodiment of the application, the processes of different numbers of target applications can be matched for different resources to be allocated, so that the target applications and hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, allocating corresponding resources for a target application according to a resource allocation manner includes:
and under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
The embodiment of the application provides a resource allocation mode in a multi-task starting mode, and resource allocation is carried out according to the identification numbers of all processes of the target application, so that the processes of the target application can be matched for all allocated resources, the target application and hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, binding each allocated resource with a process of a target application according to a resource allocation mode corresponding to a multi-task starting mode and an identification number of each process, including:
determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and binding each allocated resource with the process of the target application according to the corresponding relation.
In the resource allocation method provided by the embodiment of the application, the processes of different numbers of target applications can be matched for different resources to be allocated according to the identification numbers of the processes, so that the target applications and the hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, the method further comprises:
loading a dynamic database;
and calling a preset configuration file in the dynamic database.
In the embodiment of the application, the resource allocation is carried out by calling the preset configuration file through the dynamic database, and the dynamic database can be automatically loaded, so that the method can realize the automatic resource optimization after the terminal is started, thereby improving the performance of the terminal.
In a second aspect, the application further provides a resource management device. The device comprises:
The determining module is used for determining a starting mode of the target application;
the allocation module is used for allocating corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In a fourth aspect, the present application also provides a computer-readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In a fifth aspect, the present application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
The resource management method, the device, the computer equipment and the storage medium firstly determine the starting mode of the target application, and allocate corresponding resources for the target application according to the starting mode and the preset configuration file, wherein the preset configuration file comprises resource allocation modes in different starting modes. According to the method, the corresponding resources are allocated to the target application through the resource allocation mode indicated by the preset configuration file, the target application is guided to use the hardware resources in a mode which is beneficial to resource allocation in the target application as much as possible in the execution process, the integration degree of the hardware of the target application and the corresponding interaction part in design and realization is improved, and therefore the loss of IO performance of a distributed system where the terminal is located is reduced.
Drawings
FIG. 1 is an application environment diagram of a resource management method in one embodiment;
FIG. 2 is a flow diagram of a method of resource management in one embodiment;
FIG. 3 is a schematic flow chart of step S202 in the embodiment of FIG. 2;
FIG. 4 is a schematic flow chart of step S302 in the embodiment of FIG. 3;
FIG. 5 is a schematic diagram showing another embodiment of the step S302 in the embodiment of FIG. 3;
FIG. 6 is a flow chart of a method of resource management in another embodiment;
FIG. 7 is a flow chart of a method of resource management in another embodiment;
FIG. 8 is a block diagram of a resource management device in one embodiment;
FIG. 9 is a block diagram of a resource management device in one embodiment;
fig. 10 is a block diagram of a resource management device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
With the development of computer science, the data path performance of a distributed file system is highly dependent on the performance of network cards and disks on Input/Output (IO) paths. At present, the hardware of an application program and a corresponding interaction part on a client side in a distributed file system has low fusion degree in design and implementation, so that data in the distributed file system can be accessed across non-uniform memory (Non Uniform Memory Access, NUMA) when written into a cache or sent to a network, and further IO performance is lost. The present application aims to solve this problem.
After the background technology of the resource management method provided by the embodiment of the present application is described above, an implementation environment related to the resource management method provided by the embodiment of the present application will be briefly described below. The resource management method provided by the embodiment of the application can be applied to the terminal shown in figure 1. The terminal comprises a processor and an internal memory which are connected through a system bus, wherein the internal memory stores a computer program, and the processor can execute the steps of the following method embodiments when executing the computer program. Optionally, the terminal may further comprise a communication interface. Wherein the processor of the terminal is adapted to provide computing and control capabilities. The internal memory of the terminal includes a nonvolatile storage medium storing an operating system and a computer program, and an internal memory. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The communication interface of the terminal is used for communicating with an external terminal through network connection. Optionally, the terminal may be a personal computer, a personal digital assistant, other terminal devices, such as a tablet computer, a mobile phone, etc., or a cloud or remote server, and the embodiment of the present application is not limited to a specific form of the server.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely a block diagram of a portion of the structure associated with the present inventive arrangements and is not limiting of the terminal to which the present inventive arrangements are applied, and that a particular terminal may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, as shown in fig. 2, a resource management method is provided, and the method is applied to the terminal in fig. 1 for illustration, and includes the following steps:
s201, determining a starting mode of the target application.
The starting mode of the target application comprises a direct starting mode and a multi-task starting mode, wherein the direct starting mode is used for starting the application program in a mode of a single process or a few processes, and the multi-task starting mode is used for starting the application program in a mode of a plurality of processes. For example, the direct start mode may be specifically a PROC mode, and the multitasking start mode may be specifically an MPI mode.
In the embodiment of the application, the starting mode of the target application can be configured in advance according to the requirement of a user or configured by a terminal by default, for example, when the target application needs to be started by multiple processes, the starting mode of the target application can be set to be a multi-task starting mode, and when the target application needs to be started by a single process, the starting mode of the target application can be set to be a direct starting mode. In practical application, when the terminal starts the target application, the starting mode of the target application can be further obtained from the corresponding configuration parameters of the terminal, so as to determine whether the target application is in a direct starting mode or a multi-task starting mode.
S202, corresponding resources are allocated to the target application according to the starting mode and the preset configuration file.
The preset configuration file includes resource allocation manners in different starting modes, for example, the resource allocation manner in the direct starting mode is different from the resource allocation manner in the multi-task starting mode. It should be noted that, before the terminal starts the target application, the preset configuration file is determined according to the relationship between the hardware configuration of the target application and the resources occupied by each hardware configuration of the target application under the optimal target, where the optimal target refers to a target where the fusion degree between the target application and each type of hardware is the highest. The resources in allocating corresponding resources to the target application may be memory, disk, central processing unit (Central Processing Unit/Processor, CPU), etc.
In the embodiment of the application, after determining the starting mode of the target application, the terminal screens the resource allocation mode corresponding to the starting mode of the target application in the preset configuration file according to the starting mode of the target application, and allocates corresponding resources for the target application according to the resource allocation mode corresponding to the starting mode of the target application. Optionally, after determining the starting mode of the target application, the terminal may further determine one or more starting processes corresponding to the starting mode in a preset configuration file according to the starting mode of the target application, and bind the one or more starting processes to resources corresponding to the target application, and if the plurality of starting processes are bound, bind different processes to different resources corresponding to the target application.
The resource management method provided by the embodiment of the application comprises the steps of firstly determining the starting mode of the target application, and distributing corresponding resources for the target application according to the starting mode and the preset configuration file, wherein the preset configuration file comprises resource distribution modes under different starting modes. According to the method, the corresponding resources are allocated to the target application through the resource allocation mode indicated by the preset configuration file, the target application is guided to use the hardware resources in a mode which is beneficial to resource allocation in the target application as much as possible in the execution process, the integration degree of the hardware of the target application and the corresponding interaction part in design and realization is improved, and therefore the loss of IO performance of a distributed system where the terminal is located is reduced.
In one embodiment, a process of allocating corresponding resources to the target application according to the start mode and the preset configuration file may be described based on the embodiment shown in fig. 2, as shown in fig. 3, the "allocating corresponding resources to the target application according to the start mode and the preset configuration file" in S202 includes:
s301, determining a corresponding resource allocation mode according to the starting mode and a preset configuration file.
The resource allocation modes comprise a resource allocation mode corresponding to a direct starting mode and a resource allocation mode corresponding to a multi-task starting mode, and the resource allocation mode corresponding to the direct starting mode is different from the resource allocation mode corresponding to the multi-task starting mode.
In the embodiment of the application, after determining the starting mode of the target application, the terminal can read the corresponding resource allocation mode under the starting mode of the target application in the preset configuration file; for example, if the starting mode of the target application is a direct starting mode, reading a resource allocation mode corresponding to the direct starting mode in a preset configuration file; if the starting mode of the target application is a multi-task starting mode, the resource allocation mode corresponding to the multi-task starting mode is read from a preset configuration file. It should be noted that different target applications may correspond to different starting modes, and optionally, different target applications may also correspond to the same starting mode, based on this, resource allocation manners corresponding to the same starting mode corresponding to different target applications may be the same or different, so when determining a resource allocation manner corresponding to the starting mode of the target application, the terminal may determine an identifier of the target application or a type of the target application first, read a starting mode corresponding to the identifier of the target application or the type of the target application in a preset configuration file, and then read a resource allocation manner corresponding to the starting mode of the target application in the preset configuration file in combination with the current starting mode of the target application. The identification of the target application described above is used to uniquely characterize the target application, which may be represented using one of text, letters, symbols, numbers, or using a combination of text, letters, symbols, numbers.
S302, corresponding resources are allocated to the target application according to the resource allocation mode.
In the embodiment of the application, after determining the resource allocation mode corresponding to the starting mode of the target application, the terminal allocates corresponding resources for the target application according to the resource allocation mode corresponding to the starting mode of the target application, for example, if the resource allocation mode is used for indicating the terminal to allocate two memory nodes for processing for the target application and uniformly allocate all processes of the target application to the two memory nodes for processing, then correspondingly, after determining all processes of the target application, the terminal can allocate all processes to the two memory nodes for processing uniformly, so that all processes of the target application are matched with the two memory nodes.
In the resource allocation method provided by the embodiment of the application, different resource allocation modes can be matched for different starting modes of the target application, so that the target application and the hardware can be fused more flexibly, and the fusion degree of the software and the hardware is improved.
In one embodiment, a process of allocating a corresponding resource to a target application according to a resource allocation manner may be described based on the embodiment shown in fig. 3, where "allocating a corresponding resource to a target application according to a resource allocation manner" in S302 includes:
And under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
The weight of the resource to be allocated represents the number of processes to be bound for the resource to be allocated, and the larger the weight is, the more the number of processes to be bound for the resource to be allocated is, the smaller the weight is, and the fewer the number of processes to be bound for the resource to be allocated is. Optionally, the weight of the resource to be allocated may also represent the size of the space occupied by the resource to be allocated, for example, the larger the weight, the larger the space occupied by the corresponding memory if the resource to be allocated is the memory; the smaller the weight, the smaller the space occupied by the corresponding memory.
In the embodiment of the application, if the terminal determines that the starting mode of the target application is the direct starting mode, the resource allocation mode corresponding to the direct starting mode is used for allocating resources according to the weights of the resources, specifically, the terminal can determine the resources to be allocated corresponding to the target application from the preset configuration file, then correspondingly acquire the weights of the resources to be allocated, and then bind all processes of the target application with the corresponding resources to be allocated according to the weights of the resources to be allocated. It should be noted that, the preset configuration file records a resource allocation mode corresponding to the direct start mode, and the resource allocation mode corresponding to the direct start mode indicates the weight of each resource to be allocated.
Optionally, as shown in fig. 4, the process of binding each allocated resource with the process of the target application includes:
s401, determining the binding number corresponding to each resource to be allocated according to the weight of each resource to be allocated.
The binding number refers to the number of binding processes for the resource to be allocated.
In the embodiment of the application, after determining the weight of each resource to be allocated, the terminal determines the binding number corresponding to the weight of each resource to be allocated according to the corresponding relation between the weight and the process number, wherein the corresponding relation between the weight and the process number can be determined in advance according to an optimal target, and the optimal target refers to a target with the highest fusion degree of the target application and various types of hardware. Moreover, the correspondence between the weights and the number of processes may be predetermined and then recorded in a preset configuration file. For example, if the weight of each resource to be allocated recorded in the resource allocation manner corresponding to the direct start mode is "node1=1, node2=2, node3=3", the number of bindings corresponding to the resource to be allocated node1 is 1, the number of bindings corresponding to the resource to be allocated node2 is 2, and the number of bindings corresponding to the resource to be allocated node3 is 3, where node1 is the memory NODE1, node2 is the memory NODE2, and node3 is the memory NODE 3.
S402, binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In the embodiment of the application, after determining the binding number corresponding to each resource to be allocated, the terminal can further determine the process of the target application, select the process corresponding to the binding number corresponding to each resource to be allocated from the processes of the target application, and execute the operation of binding each resource to be allocated. For example, if the weight of each resource to be allocated recorded in the resource allocation method corresponding to the direct start mode is "node1=1 and node2=2", the number of bindings corresponding to the resource to be allocated node1 is 1, and if the number of processes of the target application is 3, one process is allocated from the memory NODE node1, and two processes are allocated from the memory NODE node2.
In the resource allocation method provided by the embodiment of the application, the processes of different numbers of target applications can be matched for different resources to be allocated, so that the target applications and hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, a process of allocating a corresponding resource to a target application according to a resource allocation manner may be described based on the embodiment shown in fig. 3, where "allocating a corresponding resource to a target application according to a resource allocation manner" in S302 includes:
And under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
Wherein, the identification number of each process is the rand value of each target application.
In the embodiment of the application, if the terminal determines that the starting mode of the target application is the multi-task starting mode, the resource allocation mode corresponding to the multi-task starting mode is used for allocating the process resources according to the identification numbers of all the processes of the target application, specifically, the terminal can firstly determine the resources to be allocated corresponding to the target application from the preset configuration file, then correspondingly acquire the identification numbers of all the processes of the target application, and then bind all the processes of the target application with the corresponding resources to be allocated according to the identification numbers of all the processes of the target application. It should be noted that, a resource allocation manner corresponding to the multi-task starting mode is recorded in the preset configuration file, and the resource allocation manner corresponding to the multi-task starting mode indicates a corresponding relationship between an identification number of each process of the target application and a resource to be allocated.
Optionally, as shown in fig. 5, the process of binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multitasking start mode and the identifier of each process includes:
s501, according to a resource allocation mode corresponding to the multi-task starting mode, determining the corresponding relation between the identification number of each process and each resource to be allocated.
In the embodiment of the application, after the identification number of each process of the target application is determined, the terminal determines the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode, wherein the corresponding relation between the identification number of each process and each resource to be allocated can be determined in advance according to an optimal target, and the optimal target refers to a target with the highest fusion degree of the target application and various types of hardware. Moreover, the correspondence between the identification number of each process and each resource to be allocated may be predetermined and then recorded in a preset configuration file. For example, if the correspondence between the identification number of each process and each resource to be allocated recorded in the resource allocation method corresponding to the multitask start mode is "the number of resources allocated for 1-20 is 20 and the number of resources allocated for 21-50 is 30", the number of resources allocated for 1-20 is determined to be 20 and the number of resources allocated for 21-50 is determined to be 30.
S502, binding each allocated resource with the process of the target application according to the corresponding relation.
In the embodiment of the application, after the correspondence between the identification number of each process and each resource to be allocated is determined, the terminal can further determine the process of the target application, select the corresponding resource pair to be allocated from the process of the target application, and execute the operation of binding each resource to be allocated. For example, if the correspondence between the identification number of each process and each resource to be allocated recorded in the resource allocation manner corresponding to the multitask start mode is "the number of resources allocated for 1-20 is 20 and the number of resources allocated for 21-50 is 30", it is determined that the number of resources allocated for 1-20 is 20 and the number of resources allocated for 21-50 is 30, 20 memory nodes are allocated for the identification number 1-20 of the target application and 30 memory nodes are allocated for the identification number 21-50 of the target application.
In the resource allocation method provided by the embodiment of the application, the processes of different numbers of target applications can be matched for different resources to be allocated according to the identification numbers of the processes, so that the target applications and the hardware can be highly fused, and the fusion degree of the software and the hardware is improved.
In one embodiment, based on the embodiment shown in fig. 2, as shown in fig. 6, the method further includes:
s601, loading a dynamic database.
The dynamic database can be used for automatically loading and replacing the realization of the designated function when the target application is started through an LD_PRELOAD mechanism, and can be called by a hook.
In the embodiment of the application, before the target application is started, the terminal loads the dynamic database after receiving the optimization instruction input by the user, or the terminal automatically loads the dynamic database through an LD_PRELOAD mechanism after starting.
S602, calling a preset configuration file in the dynamic database.
In the embodiment of the application, after the terminal loads the dynamic database, the preset configuration file in the dynamic database can be directly called to execute the resource management method in the previous embodiment.
In the embodiment of the application, the resource allocation is carried out by calling the preset configuration file through the dynamic database, and the dynamic database can be automatically loaded, so that the method can realize the automatic resource optimization after the terminal is started, thereby improving the performance of the terminal.
In summary, as shown in fig. 7, the embodiment of the present application further provides a complete flowchart of a resource management method, where the method includes:
s701, loading a dynamic database;
s702, calling a preset configuration file in a dynamic database;
s703, determining a starting mode of a target application;
s704, determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
s705, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode and determining the binding number corresponding to each resource to be allocated according to the weight of each resource to be allocated when the starting mode is the direct starting mode;
s706, binding the processes with the binding number corresponding to each resource to be allocated with each resource to be allocated;
s707, determining the identification number of each process of the target application when the starting mode is a multi-task starting mode, and determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and S708, binding each allocated resource with the process of the target application according to the corresponding relation.
The resource management method provided by the embodiment of the application comprises the steps of firstly determining the starting mode of the target application, and distributing corresponding resources for the target application according to the starting mode and the preset configuration file, wherein the preset configuration file comprises resource distribution modes under different starting modes. According to the method, the corresponding resources are allocated to the target application through the resource allocation mode indicated by the preset configuration file, the target application is guided to use the hardware resources in a mode which is beneficial to resource allocation in the target application as much as possible in the execution process, the integration degree of the hardware of the target application and the corresponding interaction part in design and realization is improved, and therefore the loss of IO performance of a distributed system where the terminal is located is reduced.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a resource management device for realizing the above-mentioned resource management method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the resource management device provided below may refer to the limitation of the resource management method hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 8, there is provided a resource management apparatus including: a determining module 10, an allocating module 11, wherein:
a determining module 10, configured to determine a start mode of the target application.
The allocation module 11 is configured to allocate corresponding resources for the target application according to the start mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In one embodiment, as shown in fig. 9, the distribution module 11 includes: a determination unit 110 and an allocation unit 111, wherein:
the determining unit 110 is specifically configured to determine a corresponding resource allocation manner according to the start mode and a preset configuration file;
the allocation unit 111 is specifically configured to allocate corresponding resources for the target application according to the resource allocation manner.
In one embodiment, the allocation unit 111 is specifically configured to determine the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct start mode when the start mode is the direct start mode, and bind each allocated resource with the process of the target application according to the weight of each resource to be allocated.
In one embodiment, the allocation unit 111 is specifically configured to determine, according to the weight of each resource to be allocated, a binding number corresponding to each resource to be allocated; and binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In one embodiment, the allocation unit 111 is specifically configured to determine an identifier of each process of the target application when the starting mode is a multi-task starting mode, and bind each allocated resource with the process of the target application according to a resource allocation mode corresponding to the multi-task starting mode and the identifier of each process.
In one embodiment, the allocation unit 111 is specifically configured to determine, according to a resource allocation manner corresponding to the multi-task starting mode, a correspondence between an identification number of each process and each resource to be allocated;
and binding each allocated resource with the process of the target application according to the corresponding relation.
In one embodiment, as shown in fig. 10, the apparatus further includes: a loading module 12, a calling module 13, wherein:
a loading module 12 for loading the dynamic database;
and the calling module 13 is used for calling the preset configuration file in the dynamic database.
The respective modules in the above-described resource management apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in FIG. 1. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is for storing resource allocation data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a resource management method.
It will be appreciated by those skilled in the art that the architecture shown in fig. 1 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements may be implemented, as a particular computer device may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In one embodiment, the processor when executing the computer program further performs the steps of:
determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
and distributing corresponding resources for the target application according to the resource distribution mode.
In one embodiment, the processor when executing the computer program further performs the steps of:
and under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
In one embodiment, the processor when executing the computer program further performs the steps of:
determining the binding quantity corresponding to each resource to be allocated according to the weight of each resource to be allocated;
and binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In one embodiment, the processor when executing the computer program further performs the steps of:
and under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
In one embodiment, the processor when executing the computer program further performs the steps of:
determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and binding each allocated resource with the process of the target application according to the corresponding relation.
In one embodiment, the processor when executing the computer program further performs the steps of:
loading a dynamic database;
and calling a preset configuration file in the dynamic database.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
and distributing corresponding resources for the target application according to the resource distribution mode.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the binding quantity corresponding to each resource to be allocated according to the weight of each resource to be allocated;
And binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and binding each allocated resource with the process of the target application according to the corresponding relation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
loading a dynamic database;
and calling a preset configuration file in the dynamic database.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
determining a starting mode of a target application;
Distributing corresponding resources for the target application according to the starting mode and the preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
and distributing corresponding resources for the target application according to the resource distribution mode.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to the resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the binding quantity corresponding to each resource to be allocated according to the weight of each resource to be allocated;
and binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
In one embodiment, the computer program when executed by the processor further performs the steps of:
And under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and binding each allocated resource with the process of the target application according to the corresponding relation.
In one embodiment, the computer program when executed by the processor further performs the steps of:
loading a dynamic database;
and calling a preset configuration file in the dynamic database.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (10)

1. A method of resource management, the method comprising:
determining a starting mode of a target application;
distributing corresponding resources for the target application according to the starting mode and a preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
2. The method according to claim 1, wherein the allocating the corresponding resource for the target application according to the start-up mode and the preset configuration file includes:
Determining a corresponding resource allocation mode according to the starting mode and a preset configuration file;
and distributing corresponding resources for the target application according to the resource distribution mode.
3. The method according to claim 2, wherein the allocating the corresponding resource for the target application according to the resource allocation manner includes:
and under the condition that the starting mode is a direct starting mode, determining the weight of each resource to be allocated according to a resource allocation mode corresponding to the direct starting mode, and binding each allocated resource with the process of the target application according to the weight of each resource to be allocated.
4. The method of claim 3, wherein binding each of the allocated resources with the process of the target application according to the weight of each of the resources to be allocated comprises:
determining the binding quantity corresponding to each resource to be allocated according to the weight of each resource to be allocated;
and binding the processes with the binding number corresponding to the resources to be allocated with the resources to be allocated.
5. The method according to claim 2, wherein the allocating the corresponding resource for the target application according to the resource allocation manner includes:
And under the condition that the starting mode is a multi-task starting mode, determining the identification number of each process of the target application, and binding each allocated resource with the process of the target application according to the resource allocation mode corresponding to the multi-task starting mode and the identification number of each process.
6. The method according to claim 5, wherein binding each allocated resource with the process of the target application according to the resource allocation manner corresponding to the multitasking mode and the identifier of each process includes:
determining the corresponding relation between the identification number of each process and each resource to be allocated according to the resource allocation mode corresponding to the multi-task starting mode;
and binding each allocated resource with the process of the target application according to the corresponding relation.
7. The method according to any one of claims 1-6, further comprising:
loading a dynamic database;
and calling the preset configuration file in the dynamic database.
8. A resource management apparatus, the apparatus comprising:
the determining module is used for determining a starting mode of the target application;
The allocation module is used for allocating corresponding resources for the target application according to the starting mode and a preset configuration file; the preset configuration file comprises resource allocation modes under different starting modes.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.
CN202310394995.3A 2023-04-13 2023-04-13 Resource management method, device, computer equipment and storage medium Pending CN116578410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310394995.3A CN116578410A (en) 2023-04-13 2023-04-13 Resource management method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310394995.3A CN116578410A (en) 2023-04-13 2023-04-13 Resource management method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116578410A true CN116578410A (en) 2023-08-11

Family

ID=87544309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310394995.3A Pending CN116578410A (en) 2023-04-13 2023-04-13 Resource management method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116578410A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116915717A (en) * 2023-09-08 2023-10-20 Tcl通讯科技(成都)有限公司 Throughput distribution method and device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116915717A (en) * 2023-09-08 2023-10-20 Tcl通讯科技(成都)有限公司 Throughput distribution method and device, storage medium and electronic equipment
CN116915717B (en) * 2023-09-08 2024-01-23 Tcl通讯科技(成都)有限公司 Throughput distribution method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
JP5932043B2 (en) Volatile memory representation of non-volatile storage set
JP5160408B2 (en) Method, system, and computer program for selecting a resource manager to satisfy a service request
CN106407207B (en) Real-time newly-added data updating method and device
CN110321225B (en) Load balancing method, metadata server and computer readable storage medium
CN108132759B (en) Method and device for managing data in file system
CN111708738A (en) Method and system for realizing data inter-access between hdfs of hadoop file system and s3 of object storage
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN113010265A (en) Pod scheduling method, scheduler, memory plug-in and system
CN115098426B (en) PCIE equipment management method, interface management module, PCIE system, equipment and medium
CN116578410A (en) Resource management method, device, computer equipment and storage medium
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN117234732A (en) Shared resource allocation method, device, equipment and medium
CN116719646A (en) Hot spot data processing method, device, electronic device and storage medium
CN115934354A (en) Online storage method and device
CN116225314A (en) Data writing method, device, computer equipment and storage medium
CN113360095B (en) Hard disk data management method, device, equipment and medium
CN114493598A (en) Computing resource management method, device, computer equipment and storage medium
CN113918638A (en) Data processing link determining method, system, device and storage medium
CN109582938B (en) Report generation method and device
US12026393B2 (en) Apparatus and method for selecting storage location based on data usage
CN117455501A (en) Request processing method, apparatus, computer device and storage medium
CN113608675B (en) RAID data IO processing method and device, computer equipment and medium
CN114238253A (en) Virtual cloud desktop storage sharing method and device, computer equipment and storage medium
CN118034885A (en) Task processing method, device, computer equipment and storage medium

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