Computer resource management and control method and related equipment
By introducing data area engine process objects and data area container objects into the operating system, combining memory, disk and CPU controllers, the problem of low resource utilization in the cloud computing environment is solved, and efficient resource management and lightweight operation and maintenance are achieved.
Patent Information
- Application Number
- CN202510475458.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-08-01
AI Technical Summary
In cloud computing environments, virtualization technology and containerization technology have performance bottlenecks and low resource utilization, especially in private cloud or cloud operating systems, resulting in waste of computer resources and increased operation and maintenance complexity.
By introducing data area engine process objects into the operating system, creating and managing data area container objects, using memory, disk and CPU controllers for resource isolation and limitation, the lightweight operation and function loading of data area container objects are achieved, and the resource utilization rate is improved by combining multi-replica collaboration technology.
It improves the utilization rate and operation and maintenance reliability of computer resources, reduces dependence on the operating system, and realizes efficient resource management and lightweight operation and maintenance.
Smart Images

Figure CN120407170A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software technology, and in particular, to a computer resource control method and related devices. Background Art
[0002] Currently, cloud-related products such as cloud native, cloud platforms, and cloud operating systems have received increasing attention. The application of traditional operating systems on the cloud faces operation and maintenance problems such as resource isolation and elastic expansion. To meet cloud-related needs, open-source components such as virtualization technologies (such as kvm) and containerization technologies (such as Docker podman) have gradually been applied to cloud systems. As of now, virtualization technologies and containerization technologies have become the standard for building cloud platforms.
[0003] Among them, virtualization technology mainly starts multiple virtual machines in the native operating system, and a real system runs inside the virtual machines. For details, refer to Figure 1 as shown. Although cloud server virtual machines have characteristics such as high availability and high scalability, in actual applications, performance bottleneck problems still exist because virtualization technology itself will bring certain performance losses, resulting in the usage efficiency of resources such as memory, disk, and CPU in the running process of virtual machines being lower than that of physical servers.
[0004] Container technology is a sandbox technology, and its main purpose is to isolate the operation of applications to facilitate the transfer of applications to other host machines. For details, refer to Figure 2 as shown. Essentially, a container is a special process that divides resources, files, devices, status, and configurations into an independent space through namespace, control groups, and chroot technologies. Because there is no additional hardware virtualization and the overhead of a complete operating system, containers utilize operating system resources more efficiently than virtual machines. The startup time of containers reaches the second level, which is faster than that of virtual machines, etc. Although containers have many advantages compared to virtual machines, there are also some disadvantages in actual use: for example, container instances are essentially individual processes, and there are also multi-process management problems; for example, although containers share the native operating system kernel, in a production environment, a miniaturized operating system generally needs to be embedded inside the container image to meet the running requirements, which results in a large container image package. Since container operation requires a container image, generally a separate image repository is needed to manage the image, and this kind of management has a certain degree of complexity.
[0005] In summary, similar containerization-related technologies of Docker are mainly designed to solve the problems of convenient installation and deployment in the cloud era, resource isolation, and flexible elastic expansion. It is an improvement compared to virtual machines before, and the corresponding application scenarios are mainly in the scenarios of public cloud such as Internet platforms. However, in the scenarios of private cloud or cloud operating system, although Docker is lighter than virtual machines, after integrating Docker into the private cloud or cloud operating system and packaging it into a product, the above-mentioned disadvantages of Docker have become a major problem, resulting in complex installation and maintenance of a product, and further causing complex use of the product form of the cloud operating system and greatly reducing the usability. Moreover, in the traditional virtualization environment, fixed computer resources are allocated to Docker, and since these resources are idle most of the time, the utilization rate of computer resources is low. Summary of the Invention
[0006] This application provides a computer resource management and control method and related devices to solve the problem of low utilization rate of computer resources.
[0007] The technical solution of this application is as follows:
[0008] In the first aspect, this application provides a computer resource management and control method, which is applied to a computer resource management and control system. The management and control system includes: an operating system, a data area engine process object, and a data area container object; the management and control method includes:
[0009] The data area engine process object receives a creation instruction, and the creation instruction is used to indicate the creation of a data area container object; the creation instruction includes resource quota configuration information;
[0010] The data area engine process object creates the data area container object based on the creation instruction;
[0011] The data area engine process object starts the data area container object and loads the functions of the data area container object;
[0012] Among them, the operating system is the running environment of the data area engine process object; the data area engine process object is the running environment of the data area container object.
[0013] In an optional implementation manner, the resource quota configuration information includes memory quota information, disk quota information, and CPU quota information;
[0014] The management and control method further includes:
[0015] The data area engine process object creates a memory controller, a disk controller, and a CPU controller based on the resource quota configuration information;
[0016] The data area engine process object binds the memory controller, the disk controller, and the CPU controller to the data area container object.
[0017] In an alternative embodiment, the management method further includes:
[0018] The memory controller binds the memory controller to the target memory of the corresponding operating system based on the system function of the operating system called; when exceeding the limit of the target memory, a memory failure error message is returned; or,
[0019] The disk controller binds the data area container object to the corresponding physical disk based on a preset relationship, and sets the storage space size of the physical disk, and all data of the data area container object are stored in the physical disk; or,
[0020] The CPU controller binds the data area engine process object to the target CPU core in response to a CPU binding instruction; the CPU controller also creates a thread in response to a thread creation instruction, and binds the thread to the target CPU core in response to a thread binding CPU instruction; the CPU controller also calculates the time that the thread uses the target CPU core at a preset time interval to obtain the usage ratio of the CPU controller, and when the usage ratio reaches the limit, the thread is stopped from running.
[0021] In an alternative embodiment, the creating of the data area container object includes:
[0022] Create a data area container body object; set a function module list of the data area application in the data area container body object.
[0023] In an alternative embodiment, the creation instruction further includes the address information of the secondary data area container object; the creating of the data area container object further includes:
[0024] Set the address information of the secondary data area container object in the data area container body object.
[0025] In an alternative embodiment, the data area container object includes a primary data area container object and a secondary data area container object; the management method further includes:
[0026] The primary data area container object receives a replica coordination instruction, where the replica coordination instruction includes the address information of the secondary data area container object;
[0027] Based on the replica coordination instruction, synchronize the data in the primary data area container object to the secondary data area container object.
[0028] In an alternative embodiment, the control method further includes:
[0029] The secondary data area container object stores the received data to the physical disk bound to the secondary data area container object and loads it into the target memory bound to the secondary data area container object, and sets the received data to a read-only state.
[0030] In a second aspect, the present application provides a computer resource control system, the control system includes: an operating system, a data area engine process object, and a data area container object; the data area engine process object includes:
[0031] A receiving unit, configured to receive a creation instruction for instructing to create a data area container object; the creation instruction includes resource quota configuration information;
[0032] A creation unit, configured to create the data area container object based on the creation instruction;
[0033] A processing unit, configured to start the data area container object and load the functions of the data area container object;
[0034] Wherein, the operating system is the operating environment of the data area engine process object; the data area engine process object is the operating environment of the data area container object.
[0035] In an alternative embodiment, the resource quota configuration information includes memory quota information, disk quota information, and CPU quota information;
[0036] The creation unit is further configured to create a memory controller, a disk controller, and a CPU controller based on the resource quota configuration information;
[0037] The processing unit is further configured to bind the memory controller, the disk controller, and the CPU controller to the data area container object.
[0038] In an alternative embodiment, the memory controller binds the memory controller to the target memory of the corresponding operating system based on the system function of the called operating system; when the limit of the target memory is exceeded, a memory failure error message is returned; or,
[0039] The disk controller binds the data area container object to the corresponding physical disk based on a preset relationship and sets the storage space size of the physical disk, and all data of the data area container object is stored in the physical disk; or,
[0040] The CPU controller binds the data area engine process object to a target CPU core in response to a CPU binding instruction; the CPU controller also creates a thread in response to a thread creation instruction, and binds the thread to the target CPU core in response to a thread CPU binding instruction; the CPU controller also calculates the time that the thread uses the target CPU core at a preset time interval to obtain the usage ratio of the CPU controller, and when the usage ratio reaches the limit, the thread is stopped from running.
[0041] In an alternative embodiment, a creation unit is specifically configured to create a data area container body object; and set a function module list of a data area application in the data area container body object.
[0042] In an alternative embodiment, the creation instruction further includes address information of a secondary data area container object; the creation unit is further configured to set the address information of the secondary data area container object in the data area container body object.
[0043] In an alternative embodiment, the data area container object includes a primary data area container object and a secondary data area container object; the primary data area container object is used to receive a replica coordination instruction, where the replica coordination instruction includes address information of the secondary data area container object;
[0044] The processing unit further synchronizes the data in the primary data area container object to the secondary data area container object based on the replica coordination instruction.
[0045] In an alternative embodiment, the secondary data area container object is used to store the received data to a physical disk bound to the secondary data area container object and load it into a target memory bound to the secondary data area container object, and set the received data to a read-only state.
[0046] In a third aspect, the present application provides an electronic device, which includes: a processor, a memory, and a computer program. Wherein, the computer program is stored on the memory, and when the computer program is executed by the processor, the device implements the multi-replica collaborative management method according to any one of the first aspects.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium, which includes: a computer program. When the computer program runs on a server, the server implements the multi-replica collaborative management method according to any one of the first aspects.
[0048] Based on any one of the first to fourth aspects above, the present application at least has the following beneficial effects:
[0049] In this application, a data area container object is created based on a creation instruction including resource quota configuration information, and quota resources are configured for the data area container object to meet the actual resource requirements of the user for the data area container object, avoiding waste of resources; the data area container object is used as the smallest running unit, and the data area container object can directly run in the data area engine process object and load the functions of the data area container object, thereby realizing lightweight resource consumption and operation and maintenance of the management and control system, reducing the dependence on the computer operating system, and improving the utilization rate of computer resources and the reliability of operation and maintenance. In addition, computer resources are based on data area container objects, improving the reliability of computer resource data.
[0050] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application, and do not constitute an improper limitation of this application.
[0052] Figure 1 It is a schematic structural diagram of a virtual machine in the related art;
[0053] Figure 2 It is a schematic structural diagram of a container in the related art;
[0054] Figure 3 It is a schematic structural diagram of a computer resource management and control system provided by an embodiment of this application;
[0055] Figure 4 It is a schematic flowchart of a management and control system method provided by an embodiment of this application;
[0056] Figure 5 It is another schematic flowchart of a management and control system method provided by an embodiment of this application;
[0057] Figure 6 It is a schematic diagram of the resource control mechanism of the data area container object provided by an embodiment of this application;
[0058] Figure 7 It is another schematic flowchart of a management and control system method provided by an embodiment of this application;
[0059] Figure 8 It is a schematic diagram of the multi-copy mechanism of the data area container object provided by an embodiment of this application;
[0060] Figure 9 It is a schematic hardware structure diagram of the data area engine process object provided by an embodiment of this application;
[0061] Figure 10 This is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0062] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0063] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. Thus, the features defined with "first", "second" may explicitly or implicitly include one or more of such features. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0064] It should also be understood that the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements and / or components.
[0065] The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: the situation where A exists alone, the situation where A and B exist simultaneously, and the situation where B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0066] The term "exemplary" means "serving as an example, an embodiment or an illustration". Any embodiment described as "exemplary" does not necessarily need to be interpreted as superior to or better than other embodiments.
[0067] The meaning of the term "at least one" is one or more, and "multiple" means two or more; the meaning of the term "at least one kind" is one kind or more, and "multiple kinds" means two or more kinds.
[0068] The design concept of the embodiment of the present application will be briefly introduced below:
[0069] Currently, in the process of computer resource management, containers are usually used as the basic configuration of the public cloud platform. A container is like a virtual container that can package an application program and all its components and dependencies into a container, and then deploy it to any computer that supports container technology, facilitating the transfer of the application program to other host machines.
[0070] However, in practical applications, each container needs to be allocated fixed CPU, memory, and storage resources, even if these resources are idle most of the time. For example, a container is allocated a large amount of CPU resources, but only a small amount of CPU resources are actually required when the container is running, and the remaining resources are idle, resulting in a waste of computer resources.
[0071] In view of this, the embodiments of the present application provide a computer resource management and control method, system, device, and storage medium, which relate to the software technology field, especially to the computer resource management technology, and are used to improve the utilization rate of computer resources and reduce the dependence on the computer operating system.
[0072] The following gives an example of the architecture of the computer resource management and control system of the embodiments of the present application.
[0073] As Figure 3 shown, Figure 3 is a schematic structural diagram of a computer resource management and control system provided by the embodiments of the present application. The management and control system 300 includes: an operating system 301, a data area engine process object 302, and a data area container object 303. Among them:
[0074] Operating system 301: refers to the operating system 301 running on a physical machine, such as the HostOS system, Linux system, Windows system, etc. Components corresponding to the operating system 301 environment. The components corresponding to the operating system 301 environment include but are not limited to the Lib directory and the Bin directory.
[0075] Data area engine process object 302: is a customizable process object 302 that provides software support for controlling the application resources in the data area, such as loading the system environment and common software modules, and providing common software services.
[0076] Data area container object 303: can be in a single-instance mode or multiple replicas. For multiple replicas, an independent synchronization network is established between the data containers to synchronize the data of the main container to the slave containers to jointly provide services.
[0077] Next, the technical solutions of the present application will be described in detail through specific embodiments. It should be noted that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0078] See Figure 4 , Figure 4 is a schematic flowchart of the method for changing the data structure provided by the embodiments of the present application. The change method includes the following steps:
[0079] Step S401: The data area engine process object receives a creation instruction.
[0080] Among them, the creation instruction is used to indicate the creation of a data area container object; the creation instruction includes resource quota configuration information. Optionally, the resource quota configuration information includes memory quota information, disk quota information, and CPU quota information.
[0081] Among them, the main functions of the data area engine process object are to create, start, stop, and delete data area container objects. Optionally, when creating a data area container object, initial resources are allocated to the data area container object based on the resource quota configuration information; when starting a data area container object, resource isolation policies can be applied to achieve resource isolation of data area container objects within the data area engine process object; when stopping a data area container object, the resources of the data area container object can be released and reallocated; when deleting a data area container object, the resources bound to the data area container object can be completely released.
[0082] Among them, the operating system is the running environment of the data area engine process object.
[0083] Exemplarily, when starting the data area engine process object on the operating system, the data area engine process object receives a creation instruction sent by the user. The user can customize the resource quota information for the data area container object in the creation instruction according to the actual resource requirements of the data area container object. For example, the memory quota information, disk quota information, and CPU quota information, so as to configure reasonable resources for the data area container object and avoid waste of resources. In this way, when creating a data area container object, the resources with customized quotas can be provided for the data area container object to meet the actual resource requirements of the user for the data area container object and avoid waste of resources.
[0084] Step S402: The data area engine process object creates a data area container object based on the creation instruction.
[0085] Among them, the data area engine process object is the running environment of the data area container object.
[0086] Optionally, during the process of creating a data area container object, first, a data area container body object is created; secondly, a list of functional modules for data area applications is set in the data area container body object. For example, the list of functional modules includes a data access module, a data integration module, a data storage module, a data analysis module, a data service and application module, a data permission and security module, a data monitoring module, and other functional modules, which are not listed one by one here.
[0087] Optionally, in the case where multiple copies need to be supported, the creation instruction further includes the address information of the secondary data area container object; during the process of creating the data area container object, the address information of the secondary data area container object can also be set in the data area container body object. Based on the address information of the secondary data area container object, the data of the primary data area container object can be synchronized to the secondary data area container object. Relevant data is stored in both the primary and secondary data area container objects, providing services together.
[0088] Step S403: The data area engine process object starts the data area container object and loads the functions of the data area container object.
[0089] Optionally, after the data area engine process object creates the data area container object, it starts. When starting, it loads function modules according to the set requirements. For example, other function modules such as data access module, data integration module, data storage module, data analysis module, data service and application module, data permission and security module, data monitoring module, etc.; based on the set resource quota configuration information, it starts the logic of resource limitation, so as to provide services for the functions of the data area container object itself externally.
[0090] Next, refer to Figure 5 and Figure 6 , Figure 5 which is another process schematic diagram of a control system method provided by an embodiment of the present application; Figure 6 which is a schematic diagram of the resource control mechanism of the data area container object provided by an embodiment of the present application. The solution for the resource quota of the data area container object is elaborated in detail.
[0091] As Figure 5 shown, the control method further includes the following steps:
[0092] Step S501: The data area engine process object creates a memory controller, a disk controller, and a CPU controller based on the resource quota configuration information.
[0093] Exemplarily, the resource quota configuration information includes memory quota information, disk quota information, and CPU quota information. The data area engine process object creates a memory controller based on the memory quota information; the data area engine process object creates a disk controller based on the disk quota information; the data area engine process object creates a CPU controller based on the CPU quota information. In this way, the memory controller, disk controller, and CPU controller can be managed separately, realizing resource isolation of the data area engine process object in units of data area container objects. Compared with the prior art, it is lighter in system resource consumption and operation and maintenance, less dependent on the operating system, and improves resource utilization efficiency and operation and maintenance reliability. That is to say, this embodiment provides a new technical solution for resource isolation.
[0094] Step S502: The data area engine process object binds the memory controller, disk controller, and CPU controller to the data area container object.
[0095] When creating the data area container object, a quota-limited memory controller, disk controller, and CPU controller are bound to the data area container object. Since the memory controller, disk controller, and CPU controller are created based on the user-defined memory quota information, disk quota information, and CPU quota information, the actual usage requirements of the user for the memory controller, disk controller, and CPU controller are met, reasonable resources are configured for the data area container object, and resource waste caused by excessive allocated resources is avoided.
[0096] Optionally, as Figure 6 shown, the internal implementation mechanism of the memory controller can be: The memory controller binds the memory controller to the target memory of the corresponding operating system based on the system functions called by the operating system.
[0097] Taking the Linux system as an example, the system functions include the memory system functions mmap and mlock of the Linux system. The memory controller can manage the target memory and encapsulate the allocation and release functions of the target memory. For example, the my_malloc function encapsulates the malloc function, the my_free function encapsulates the free function, etc. The data area business application program allocates memory for use. When the limit of the target memory is exceeded, a memory failure error message is returned. Of course, the above functions of the system are not limited to the functions listed above, and other functions can also be used, which will not be listed one by one here.
[0098] Optionally, as Figure 6 shown, the internal implementation mechanism of the disk controller can be: The disk controller binds the data area container object to the corresponding physical disk based on a preset relationship and sets the storage space size of the physical disk. All data of the data area container object is stored in the physical disk.
[0099] Taking the Linux system as an example, the data area container object is bound to the physical disk by using the technology of the Linux system logical volume, and the physical disk occupied by the data area container object is realized by means of the logical volume.
[0100] Optionally, as Figure 6As shown, the internal implementation mechanism of the CPU controller can be as follows: The CPU controller binds the data area engine process object to the target CPU core in response to a CPU binding instruction; the CPU controller also creates a thread in response to a create thread instruction and binds the thread to the target CPU core in response to a thread binding CPU instruction; the CPU controller also calculates the time the thread uses the target CPU core at a preset time interval to obtain the usage ratio of the CPU controller. When the usage ratio reaches the limit, the thread is stopped from running.
[0101] Taking the Linux system as an example, the data area engine process object is bound to the target CPU core through the CPU binding instruction of the Linux system; a thread is created through the create thread instruction of the Linux system, and the function of creating the thread is encapsulated; the thread is bound to the target CPU core through the thread binding CPU instruction of the Linux system. The CPU controller calculates the time the thread uses the target CPU core at regular intervals (such as 2 minutes) to obtain the usage ratio of the CPU controller. Among them, the usage ratio of the CPU controller = the time the thread uses the target CPU core / the total running time of the target CPU core. When the usage ratio reaches the limit, it means that the CPU controller is overloaded, and the thread is stopped from running to prevent the CPU controller from being damaged due to high-load operation.
[0102] Next, refer to Figure 7 and Figure 8 , Figure 7 which is another process schematic diagram of a control system method provided by an embodiment of the present application; Figure 8 which is a schematic diagram of the multi-copy mechanism of the data area container object provided by an embodiment of the present application. The solution of the multi-copy of the data area container object is elaborated in detail.
[0103] As Figure 7 shown, the data area container object includes a main data area container object and a secondary data area container object; the control method further includes:
[0104] Step S701, the main data area container object receives a copy coordination instruction.
[0105] Among them, the copy coordination instruction includes the address information of the secondary data area container object.
[0106] Exemplarily, as Figure 8As shown, for data area container objects created simultaneously on two nodes, if it is necessary to share the data in one of the data area container objects, then this data area container object can be used as the primary data area container object, and the other data area container object can be used as the secondary data area container object. The user sends a replica coordination instruction to the primary data area container object. Alternatively, the user can also determine the data area container object for which data sharing is required according to the usage requirements, use this data area container object as the primary data area container object, and the other data area container object as the secondary data area container object, and the user sends a replica coordination instruction to the primary data area container object.
[0107] It should be noted that although Figure 8 two nodes are shown, in actual applications, data area container objects can also be created simultaneously on three nodes, and the data area container objects can provide data sharing technologies with dual replicas or triple replicas.
[0108] Step S702: Based on the replica coordination instruction, synchronize the data in the primary data area container object to the secondary data area container object.
[0109] Among them, the secondary data area container object stores the received data in the physical disk bound to the secondary data area container object and loads it into the target memory bound to the secondary data area container object, and sets the received data to a read-only state.
[0110] Exemplarily, as Figure 8 shown, after the primary data area container object receives the replica coordination instruction, based on this instruction, it uses the storage engine common component and the consistency common component to synchronize the data in the primary data area container object to the secondary data area container object in real time through network communication. The secondary data area container object stores the received data in the physical disk bound to the secondary data area container object and loads it into the target memory bound to the secondary data area container object using its bound memory controller, disk controller, and CPU controller based on the same business application program. Moreover, the received data is set to a read-only state, that is, only data read services are provided, and data modification is not participated in. Using the consistency common component, redundant switchover detection is achieved through the method of active detection, so as to achieve the effect of resource redundancy, and multi-replica operation of a data area operation unit is achieved through data synchronization at the software level, getting rid of the reliability dependence at the hardware level.
[0111] Based on the technical solution of the embodiments of the present application, it should be emphasized that, compared with the prior art, in the embodiments of the present application, the resource management method for the data area container object realizes resource control by using the system interfaces of the Linux system on memory, disk, and CPU in combination with its own detection logic. These interfaces are common kernel underlying technologies in the Linux system. The data sharing within the data area container object is realized through software-level data synchronization, which improves the reliability of the data and is independent of hardware-level data sharing and hardware reliability dependence. That is to say, this embodiment provides a new technical solution for resource isolation and elastic expansion.
[0112] Based on the same inventive concept, the embodiments of the present application also provide a computer resource management and control system. The principle of the system to solve problems is similar to the method of the above embodiments. Therefore, the implementation of this device can refer to the implementation of the above method, and the repeated parts will not be described again.
[0113] See Figure 9 , Figure 9 is the hardware structure schematic diagram of the data area engine process object provided by the embodiments of the present application. The management and control system includes: an operating system, a data area engine process object, and a data area container object. The data area engine process object 900 includes:
[0114] A receiving unit 901, configured to receive a creation instruction, where the creation instruction is used to indicate the creation of a data area container object;
[0115] A creation unit 902, configured to create a data area container object based on the creation instruction;
[0116] A processing unit 903, configured to start the data area container object and load the functions of the data area container object;
[0117] Among them, the operating system is the running environment of the data area engine process object; the data area engine process object is the running environment of the data area container object.
[0118] In an alternative embodiment, the resource quota configuration information includes memory quota information, disk quota information, and CPU quota information;
[0119] The creation unit 902 is further configured to create a memory controller, a disk controller, and a CPU controller based on the resource quota configuration information;
[0120] The processing unit 903 is further configured to bind the memory controller, the disk controller, and the CPU controller to the data area container object.
[0121] In an alternative embodiment, the memory controller binds the memory controller to the target memory of the corresponding operating system based on the system functions of the called operating system, where the system functions include the memory system function mmap and the system function mlock of the operating system; when the limit of the target memory is exceeded, a memory failure error message is returned; or,
[0122] The disk controller binds the data area container object to the corresponding physical disk based on a preset relationship and sets the storage space size of the physical disk, and all data of the data area container object is stored in the physical disk; or,
[0123] The CPU controller binds the data area engine process object to the target CPU core in response to a CPU binding instruction; the CPU controller also creates a thread in response to a create thread instruction and binds the thread to the target CPU core in response to a thread binding CPU instruction; the CPU controller also calculates the time that the thread uses the target CPU core at a preset time interval to obtain the usage ratio of the CPU controller, and when the usage ratio reaches the limit, the thread is stopped from running.
[0124] In an alternative embodiment, the creation unit 902 is specifically configured to create a data area container body object; and set a function module list of the data area application in the data area container body object.
[0125] In an alternative embodiment, the creation instruction further includes the address information of the secondary data area container object; the creation unit 902 is further configured to set the address information of the secondary data area container object in the data area container body object.
[0126] In an alternative embodiment, the data area container object includes a primary data area container object and a secondary data area container object; the primary data area container object is used to receive a replica cooperation instruction, where the replica cooperation instruction includes the address information of the secondary data area container object;
[0127] The processing unit 903 further synchronizes the data in the primary data area container object to the secondary data area container object based on the replica cooperation instruction.
[0128] In an alternative embodiment, the secondary data area container object is used to store the received data in the physical disk bound to the secondary data area container object and load it into the target memory bound to the secondary data area container object, and set the received data to a read-only state.
[0129] Based on the same inventive concept as the above method embodiment, an electronic device is further provided in an embodiment of the present application. In one embodiment, the electronic device may be a server or a terminal device. In this embodiment, as Figure 10 shown, Figure 10The structural schematic diagram of an electronic device is shown. The electronic device 1000 includes: a processor 1001, a communication interface 1002, a memory 1003, and a bus 1004.
[0130] Among them, the processor 1001 is used to control and manage the operations of the device. For example, it executes each step in the method process shown in the above method embodiments, and / or is used to execute other processes of the technologies described herein.
[0131] The processor 1001 can implement or execute various exemplary logic blocks, units, and circuits described in connection with the disclosure of the present invention. The processor can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, units, and circuits described in connection with the disclosure of the present invention. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0132] Among them, the communication interface 1002 is used to support the communication of the device with other network entities. For example, it supports the information interaction between the electronic device 1000 and other devices. The communication interface 1002, the processor 1001, and the memory 1003 can be coupled to each other. For example, they are coupled to each other through the bus 1004.
[0133] Among them, the memory 1003 is used to store the program code and data of the device and is controlled by the processor 1001 for execution.
[0134] The memory 1003 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1003 can exist independently and be connected to the processor 1001 through the bus 1004. The memory 1003 can also be integrated with the processor 1001.
[0135] Among them, the bus 1004 can be an extended industry standard architecture (EISA) bus, etc. The bus 1004 can be divided into an address bus, a data bus, a control bus, etc. For the sake of easy representation, Figure 10 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0136] It should be noted that Figure 10 the device structure shown in the figure does not constitute a limitation on the electronic device 1000. Except Figure 10 for the components shown, the electronic device 1000 can include more or fewer components than those shown in the figure, or combine some components, or have a different component arrangement.
[0137] In actual implementation, the functions implemented by the processing unit can be Figure 10 implemented by the processor 1001 shown in the figure calling the program code in the memory 1003.
[0138] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the above division of each functional module is used as an example. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0139] As described above, the embodiments of the present application can divide the functional modules of each execution entity involved in the method for changing the data structure according to the above method examples. Among them, the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. In addition, it should be noted that the division of modules in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation. For example, each functional module can be corresponding to each function, or two or more functions can be integrated into one processing module.
[0140] In an exemplary embodiment, the embodiments of the present application further provide a computer-readable storage medium, on which computer program instructions are stored; when the computer program runs on the server, the server implements the method as described in the foregoing embodiments.
[0141] Optionally, the above computer-readable storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0142] In an exemplary embodiment, the embodiments of the present application further provide a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in an electronic device, the processor in the electronic device implements the method as described in the foregoing embodiments.
[0143] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not claimed in the present application. The specification and embodiments are only to be regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0144] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A computer resource control method, characterized in that, Applied to a computer resource control system, the control system includes: an operating system, a data area engine process object, and a data area container object; the control method includes: The data area engine process object receives a creation instruction for instructing the creation of a data area container object; the creation instruction includes resource quota configuration information. The data area engine process object creates the data area container object based on the creation instruction. The data area engine process object starts the data area container object and loads the functions of the data area container object. Among them, the operating system is the running environment of the data area engine process object; the data area engine process object is the running environment of the data area container object.
2. The control method according to claim 1, wherein The resource quota configuration information includes memory quota information, disk quota information, and CPU quota information. The control method further includes: The data area engine process object creates a memory controller, a disk controller, and a CPU controller based on the resource quota configuration information. The data area engine process object binds the memory controller, the disk controller, and the CPU controller to the data area container object.
3. The control method according to claim 2, characterized in that The control method further includes: The memory controller binds the memory controller to the target memory of the corresponding operating system based on the system function called by the operating system; when the limit of the target memory is exceeded, a memory failure error message is returned; or, The disk controller binds the data area container object to the corresponding physical disk based on a preset relationship and sets the storage space size of the physical disk, and all data of the data area container object is stored in the physical disk; or, The CPU controller binds the data area engine process object to the target CPU core in response to a CPU binding instruction; the CPU controller also creates a thread in response to a create thread instruction and binds the thread to the target CPU core in response to a thread binding CPU instruction; the CPU controller also calculates the time for the thread to use the target CPU core at a preset time interval to obtain the usage ratio of the CPU controller, and when the usage ratio reaches the limit, the thread is stopped from running.
4. The control method according to any one of claims 1 to 3, characterized in that The creation of the data area container object includes: Creating a data area container body object. Setting a list of function modules for the data area application in the data area container body object.
5. The control method according to claim 4, wherein The creation instruction further includes the address information of the secondary data area container object; the creation of the data area container object further includes: Setting the address information of the secondary data area container object in the data area container body object.
6. The control method according to claim 5, wherein The data area container object includes a primary data area container object and a secondary data area container object; the control method further includes: The primary data area container object receives a replica coordination instruction, where the replica coordination instruction includes the address information of the secondary data area container object. Based on the replica coordination instruction, synchronize the data in the primary data area container object to the secondary data area container object.
7. The control method according to claim 6, characterized in that The control method further includes: The secondary data area container object stores the received data into the physical disk bound to the secondary data area container object and loads it into the target memory bound to the secondary data area container object, and sets the received data to the read-only state.
8. A computer resource control system, characterized in that, The management and control system includes: an operating system, a data area engine process object, and a data area container object; the data area engine process object includes: a receiving unit, configured to receive a creation instruction for instructing to create a data area container object; a creating unit, configured to create the data area container object based on the creation instruction; a processing unit, configured to start the data area container object and load the functions of the data area container object; wherein, the operating system is the running environment of the data area engine process object; the data area engine process object is the running environment of the data area container object.
9. An electronic device, characterized in that, including: a processor; a memory; and a computer program; wherein, the computer program is stored on the memory, and when the computer program is executed by the processor, the electronic device implements the method according to any one of claims 1-7.
10. A computer-readable storage medium, the computer-readable storage medium comprising a computer program, characterized in that, When the computer program runs on the server, the server implements the method according to any one of claims 1-7.