Process management method and device, computer device and storage medium

By obtaining the total resource usage of online processes and updating the resource availability of offline processes, the accuracy problem of process management methods under the Kubernetes platform is solved, enabling flexible hybrid deployment of online and offline processes and improving resource utilization and management accuracy.

CN115686811BActive Publication Date: 2026-11-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110858364.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-28
Publication Date
2026-11-06
Estimated Expiration
2041-07-28

AI Technical Summary

Technical Problem

In existing technologies, process management methods based on the Kubernetes platform cannot effectively cope with unexpected situations when online and offline processes are deployed in a mixed manner, resulting in low accuracy of process management.

Method used

By obtaining the total resource usage of online processes and updating the resource availability of offline processes, the system ensures that the resource availability does not exceed the remaining resources, thus enabling flexible hybrid deployment of online and offline processes.

Benefits of technology

It improves the accuracy and flexibility of mixed deployment of online and offline processes, makes full use of host resources, and improves resource utilization and process management accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686811B_ABST
    Figure CN115686811B_ABST
Patent Text Reader

Abstract

The application provides a process management party, device, computer equipment and storage medium, and relates to the technical field of cloud technology, big data processing and cloud storage. Through an online process directory set, the total resource occupation amount of the online process is obtained, and the standby resource amount is updated based on the total resource occupation amount, so as to realize linkage between resources of the online process and the offline process. In addition, the standby resource amount is not greater than the remaining resource amount except the total resource occupation amount, the efficient operation of the online process is fully ensured, the offline resource amount interfering with the online resource is accurately obtained, and the accuracy and flexibility of the mixed deployment of the online process and the offline process are improved. The offline process is updated based on the standby resource amount, so that the remaining resources can be fully utilized under the premise of ensuring the stable and efficient operation of the online process, the resource utilization rate is improved, and the accuracy of the process management is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of cloud technology, big data processing, and cloud storage technology. This application relates to a process management method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Kubernetes is a platform that manages business processes using containerized deployment, and its simplicity and efficiency have made it a growing industry trend. Business processes include containerized online and offline processes. On the Kubernetes platform, resource allocation can be used to achieve hybrid online and offline deployment of business processes. Currently, some online processes are not included in hybrid online-offline deployment because they are not containerized or are unsuitable for containerization. In this field, by managing offline processes and non-containerized online processes, hybrid deployment of non-containerized online and offline processes can be achieved.

[0003] In related technologies, process management methods may include: non-containerized online processes running on the host machine, and resources of a fixed value on the host machine being allocated to run offline processes. For example, two cores of the host machine's eight-core CPU (Central Processing Unit) may be allocated to run offline processes, while the other resources run non-containerized online processes, so as to achieve a hybrid deployment of online and offline processes on the host machine.

[0004] The aforementioned hybrid online / offline deployment method, which involves allocating fixed resources, is rigid and can lead to online processes being unable to cope well with unexpected situations (such as a sudden increase in the number of online processes), thus affecting their normal operation. Therefore, the accuracy of this process management method is relatively low. Summary of the Invention

[0005] This application provides a process management method, apparatus, computer device, and storage medium, which can solve the problem of low accuracy in related process management methods. The technical solution is as follows:

[0006] On the one hand, a process management method is provided, the method comprising:

[0007] Based on the online process directory set, obtain the total resource usage of at least one currently running online process on the host machine;

[0008] Based on the total resource usage, update the resource availability of the offline process on the host machine. The resource availability is not greater than the remaining resources on the host machine other than the total resource usage.

[0009] Based on the available resources, update the offline processes running on the host machine.

[0010] On the other hand, a process management device is provided, the device comprising:

[0011] The acquisition module is used to obtain the total resource usage of at least one currently running online process on the host machine based on the online process directory set;

[0012] The update module is used to update the resource availability of the offline process on the host machine based on the total resource usage, wherein the resource availability is not greater than the remaining resources on the host machine other than the total resource usage.

[0013] The update module is also used to update the offline processes running on the host machine based on the amount of resources available.

[0014] On the other hand, a computer device is provided, the computer device comprising:

[0015] One or more processors;

[0016] Memory;

[0017] One or more computer programs, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to: perform the process management method described above.

[0018] On the other hand, a computer-readable storage medium is provided for storing computer instructions that, when executed on a computer, enable the computer to perform the aforementioned process management method.

[0019] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the process management method described above.

[0020] The beneficial effects of the technical solution provided in this application are:

[0021] The total resource occupation amount of online processes is obtained through the online process directory set, and the resource to-be-used amount is updated based on the total resource occupation amount, so as to realize the linkage between the respective resources of the online processes and the offline processes. Moreover, the resource to-be-used amount is not greater than the remaining resource amount excluding the total resource occupation amount, which fully ensures the efficient operation of the online processes, accurately obtains the offline resource amount that avoids interfering with online resources, and improves the accuracy and flexibility of mixed deployment of online processes and offline processes. The offline processes are updated based on the resource to-be-used amount, so that the remaining resources can be fully utilized on the premise of ensuring the stable and efficient operation of the online processes, the resource utilization rate is improved, and further the accuracy of process management is enhanced. Brief Description of the Drawings

[0022] To more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings required in the description of the embodiments of the present application will be briefly introduced below.

[0023] Figure 1 is a schematic diagram of an implementation environment of the process management method provided by the present application;

[0024] Figure 2 is a schematic flowchart of a process management method provided by an embodiment of the present application;

[0025] Figure 3 is a schematic flowchart of batch matching online processes in process management provided by an embodiment of the present application;

[0026] Figure 4 is a schematic diagram of the generation and update process of an online process directory set provided by an embodiment of the present application;

[0027] Figure 5 is a schematic diagram of management based on a mixed deployment component provided by an embodiment of the present application;

[0028] Figure 6 is a schematic diagram of a process management apparatus provided by an embodiment of the present application;

[0029] Figure 7 is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed Description of the Embodiments

[0030] The embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary, are only used to explain the present application, and cannot be construed as a limitation to the present invention.

[0031] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0033] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.

[0034] Cloud technology is a collective term for network technology, information technology, integration technology, management platform technology, and application technology applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.

[0035] Cloud computing is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" appear infinitely scalable, readily available, on-demand, and expandable, with payment based on usage.

[0036] As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices.

[0037] Based on logical function, a PaaS (Platform as a Service) layer can be deployed on top of the IaaS (Infrastructure as a Service) layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be deployed directly on top of IaaS. PaaS is a platform for running software, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally speaking, SaaS and PaaS are upper layers compared to IaaS.

[0038] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.

[0039] Currently, the storage method of storage systems is as follows: Logical volumes are created. During the creation of a logical volume, physical storage space is allocated to each logical volume. This physical storage space may consist of a single storage device or the disks of several storage devices. Clients store data on a logical volume, which means storing the data on the file system. The file system divides the data into many parts, each part being an object. Each object contains not only the data but also additional information such as a data identifier (ID, ID entity). The file system writes each object to the physical storage space of that logical volume and records the storage location information of each object. Therefore, when a client requests access to data, the file system can allow the client to access the data based on the storage location information of each object.

[0040] The process by which a storage system allocates physical storage space to a logical volume is as follows: the physical storage space is pre-divided into strips according to the capacity estimate of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of Redundant Array of Independent Disks (RAID). A logical volume can be understood as a strip, thus allocating physical storage space to the logical volume.

[0041] A database, simply put, can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, capable of being shared by multiple users, with minimal redundancy, and independent of application programs.

[0042] Big data refers to data sets that cannot be captured, managed, and processed within a certain timeframe using conventional software tools. It represents massive, rapidly growing, and diverse information assets that require new processing models to achieve stronger decision-making, insightful discovery, and process optimization capabilities. With the advent of the cloud era, big data has attracted increasing attention. Big data requires specialized technologies to effectively process large amounts of data within a tolerable timeframe. Technologies suitable for big data include massively parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the internet, and scalable storage systems.

[0043] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0044] The process management method provided in this application enables the hybrid deployment of online and offline processes through process management. For example, cloud technology can be used to manage processes running on devices within a cloud computing resource pool, thus achieving hybrid deployment of online and offline processes on these devices. Alternatively, cloud storage or big data technologies can be used to achieve hybrid deployment of online and offline processes on various node servers in a cloud storage system or servers in various data centers within a big data system. For example, offline processes in this application can be business processes implemented using machine learning technology, such as training machine learning models. This allows the model to be trained using remaining resources on the host machine not occupied by online processes, maximizing the utilization of host machine resources. For example, for distributed storage-related businesses in cloud storage technology, some businesses are not suitable for containerized deployment on the Kubernetes platform. Therefore, for business processes running directly on the host machine of the distributed storage system, the process management method in this application can be used to calculate their total resource usage, thereby achieving hybrid deployment of online and offline processes.

[0045] Figure 1 This is a schematic diagram illustrating the implementation environment of a process management method provided in this application. For example... Figure 1 As shown, the implementation environment includes: a computer device. The target application is installed on the computer device. Business processes run on the computer device, which may include online processes and offline processes. The target application is used for a hybrid deployment of online and offline processes. For example, as... Figure 1 As shown, the computer device can be a server with the host identity, and the target application can be a hybrid component.

[0046] In this embodiment, the online process can run directly on the host machine in a non-containerized manner. In one possible scenario, the host machine can manage offline processes and non-containerized online processes through a hybrid deployment component to achieve hybrid deployment of online and offline processes. Figure 1 As shown, the host machine can calculate the total resource usage of each online process based on the online process directory set. Based on this total resource usage, it can update the resource availability of offline processes on the host machine. This resource availability allows for adjustments to the running offline processes, improving host machine resource utilization. For example, if the updated resource availability increases or decreases, the number of offline processes running on the host machine will increase or decrease accordingly. In one possible example, the offline process could be a containerized process deployed on a Kubernetes platform. Therefore, a Kubernetes platform can be built on the host machine to run the offline process on the Kubernetes platform.

[0047] It should be noted that the target application includes process management logic. The host machine can execute the program code of the target application to achieve hybrid deployment of offline and online processes based on the process management logic. The target application can be a component, a standalone application, or a plugin installed on a standalone application. Figure 1 This embodiment only illustrates the case where the target application is a hybrid deployment component; the specific form of the target application is not limited in this application embodiment. In one possible example, the computer device can be a server for an application, which supports front-end business by running business processes; for example, related businesses supported by technologies such as cloud technology, cloud storage, cloud computing, big data, and machine learning. In this embodiment, the computer device is only exemplified as a host machine, i.e., a server with a special identity. This server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In another possible example, the computing device can also be any machine running business processes and capable of hybrid deployment, such as a large management device of a bank or other institution, supporting various bank business operations by running a large number of processes. Of course, the computer device can also be other forms of machine equipment; the specific form of the computer device is not limited in this embodiment.

[0048] The following is a description of the terms used in the embodiments of this application:

[0049] Online processes: For online services with short expected response times, the host machine runs online processes in real time to quickly respond to frontend requests. Examples include browser search and online chat.

[0050] Offline processes: For services that do not require immediate response or have no demand for immediate response, offline processes can be run, such as model training in machine learning.

[0051] Host machine: In contrast to virtual machines and containers, the machine on which a virtual machine or container is deployed is the host of that virtual machine or container. In this application, the host machine is a machine running non-containerized online processes. This application can utilize the idle resources on the host machine that are not occupied by online processes to run offline processes.

[0052] Total resource usage: Each online process corresponds to a resource usage, and the total resource usage refers to the sum of the resource usage of multiple online processes currently running on the host machine.

[0053] Available resources: The amount of resources available on the host machine to run offline processes.

[0054] Non-containerized processes refer to services deployed directly as processes and started directly on the host machine. Their runtime environment depends on the host machine's configuration, which was the main management method before the widespread adoption of containers. The online processes in this application are non-containerized processes. It should be noted that although using the Kubernetes platform to containerize and deploy business processes is a trend, there are still non-containerized online processes, or some online processes that are not suitable for containerization, such as processes for distributed storage services. These non-containerized online processes can run directly on the host machine. This application aims to utilize the resources on the host machine that are not occupied by non-containerized online processes running directly on the host machine, thereby improving the host machine's resource utilization.

[0055] Kubernetes: A resource scheduling and management platform for container orchestration. It is the foundation of container cloud platforms. Users can submit business applications based on the Kubernetes platform, and these applications run in the form of containers.

[0056] Containers: Business processes and their runtime environment dependencies are packaged together into an image. During business deployment, the image is deployed directly, and the business processes are launched within the image. The runtime environment of the business processes is isolated from the host machine. Online and offline processes on the Kubernetes platform can be deployed using containerization. In this application, for offline processes on the Kubernetes platform, offline processes from the Kubernetes platform can be appropriately populated based on resources on the host machine that are not occupied by online processes, thereby improving host machine resource utilization.

[0057] Online and offline mixed deployment: Online and offline processes are deployed in a mixed manner. Online processes run first on the host machine, and some offline processes are appropriately populated to improve resource utilization by utilizing resources not occupied by online processes.

[0058] Cgroups (control groups) are a mechanism for dividing business processes on a machine into groups for resource control. For example, in a Linux environment, they can control the memory, CPU, and other resources of processes corresponding to different business processes.

[0059] The process management method of this application is described below with reference to the steps in a specific embodiment.

[0060] Figure 2This is a flowchart illustrating a process management method provided in an embodiment of this application. The executing entity of this method can be a computer device. This computer device can be a server acting as a host machine, running non-containerized online and offline processes. The offline processes can be containerized processes deployed on a Kubernetes platform. The following description uses a host machine as an example. Figure 2 As shown, the method includes the following steps.

[0061] Step 201: The host machine filters out the online processes of the business process based on the command line string of the currently running business process on the host machine.

[0062] The command-line string is used to indicate whether the business process is an online process. In this step, the host machine can obtain the command-line string of each business process. When the command-line string indicates that the business process is an online process, the host machine determines that the business process is an online process. In one possible example, the host machine can make a judgment based on the characters included in the command-line string. When the host machine detects that the command-line string includes a target character, the host machine determines that the business process is an online process. The target character is used to indicate that the business process is an online process; that is, a business process whose command-line string includes the target character is an online process. For example, each business process corresponds to a command-line string, and the business process is started and run on the host machine based on the command-line string. The command-line string can be the command-line parameters of the business process. For example, the command-line parameters can include the startup parameters of the business process. The command-line parameters of online processes include target characters. The target characters of different online processes can be the same or different. The target characters can be updated as needed; for example, the target character can be "upset".

[0063] In one possible implementation, at least two business processes are currently running on the host machine; for example, when hundreds or thousands or even more business processes are running, the server can also group multiple business processes and complete the filtering in batches. Accordingly, this step can be implemented through the following steps 2011-2013.

[0064] Step 2011: The host machine concatenates at least two command line strings of the at least two business processes based on the process identifiers of the at least two business processes to obtain a concatenated string.

[0065] The host machine can obtain the process identifier of each currently running business process. For each business process, the host machine obtains the command-line string of that business process based on its process identifier, and concatenates the multiple command-line strings of multiple business processes into a single concatenated string according to the order of their process identifiers. The host machine can also determine the position index of this concatenated string, which indicates the business process corresponding to the command-line string at each concatenation position. For example, for each business process, the host machine can obtain the command-line reading path of that business process based on its process identifier, and read the command-line string from that path. The process identifier can be a PID (Process Identification). For example, in a Linux operating system, the host machine can obtain the command-line reading path of a business process based on its PID, which could be ` / proc / {pid} / cmdline`, and read the command-line string from ` / proc / {pid} / cmdline`. Here, `{pid}` represents the process ID of the corresponding business process, and the value of `{pid}` is different for different business processes.

[0066] In one possible implementation, the host machine can concatenate the command-line strings of each business process using a concatenation operator according to the order of their process identifiers, resulting in a concatenated string. Furthermore, the host machine can establish an index between the order of the process identifiers and the concatenation position of the command-line strings of each business process, obtaining the position index of the concatenated string. That is, this index relationship includes the index between the order of the process identifiers and the concatenation position. For example, the host machine can group currently running business processes, with each group containing multiple business processes, and concatenate the command-line strings of the multiple business processes in each group in batches to obtain the concatenated string corresponding to that group. Based on the subsequent steps in 2012-2013, batch matching of multiple business processes can be achieved.

[0067] In one possible example, the host machine could use arrays to represent process identifiers and position indices. For instance, the process identifiers of each business process, the command-line strings, and the position indices of the concatenated strings could be represented by the following three data structures:

[0068] 1. The process PIDs of multiple business processes can be in the form of an array of process PIDs, which can be represented as ARRAY_PID, where ARRAY(array);

[0069] 2. Command line strings of multiple business processes can be matched according to the PID order in the process PID array and concatenated with a plus sign to obtain a concatenated string, which can be represented as CMDS_STR;

[0070] 3. The starting positions of multiple command-line strings in the concatenated string and the order of their corresponding process IDs can be represented as a two-dimensional array ARRAY_CMD, resulting in the position index array ARRAY_CMD.

[0071] like Figure 3 As shown, Figure 3 The left rectangle shows the various data structures. Process PID_1, Process PID_2, and Process PID_3 represent the process IDs of three business processes. Correspondingly, the command line strings of the three business processes are connected by a plus sign in the order of their process IDs. The indexes of the three command line strings in the concatenated string are represented as (star1, end1), (star2, end2), and (star3, end3), respectively. Here, star indicates the starting position of the command line string in the concatenated string, and end indicates the ending position of the command line string in the concatenated string. For example, the starting and ending positions of process PID_2 in the concatenated string can be represented as (6, 10).

[0072] Step 2012: The host machine performs character matching on the target character and the concatenated string to determine the character position of the matching character in the concatenated string.

[0073] The host machine can use regular expression matching to perform character matching between the target character and the concatenated string. For example, the host machine can generate a regular expression based on the target character, and based on this regular expression, obtain the matching characters in the concatenated string that match the target character, and obtain the matching position of the matching character in the concatenated string. For example, this regular expression is used to represent the character matching rules between the target character and the concatenated string. For instance, when a character in the concatenated string includes the target character or is identical to the target character, the host machine can determine that character is a matching character that matches the target character.

[0074] In one possible example, the hybrid component may include a matching program that includes matching logic based on a target character. The user can input the target character into the host machine, and the host machine executes the matching program based on the input target character to perform character matching between the target character and the concatenated string, and outputs the character position of the matched character. For example, the character position can be represented as a two-dimensional array. For instance, the host machine can output a two-dimensional array that includes the character positions of one or more matched characters. For example, outputting a two-dimensional array a[8][2] indicates that the two-dimensional array a is an 8-row, 2-column array, with each row representing the character position of a matched character in the concatenated string. For example, the first row of a[8][2]: a[0][0] = 7, a[0][1] = 8; represents the character position of the first matched character in the concatenated string, with the first matched character at the beginning position 7 and the end position 8 of the concatenated string.

[0075] like Figure 3 As shown, Figure 3 The right-hand rectangle shows one matching result, where the host machine matched the first character of the concatenated string in the command-line string of process PID_2. For example... Figure 3 As shown, the position of the first matching character can be represented as (matchstart1, matchend1), where matchstart1 indicates the beginning position of the first matching character in the concatenated string, and matchend1 indicates the end position of the first matching character in the concatenated string. Figure 3 As we can see, the matched character is located in the second command line string. That is, the character position of the matched character (matchstart1, matchend1) is located in the concatenation position (start2, end2) of the second command line string. For example, if the concatenation position of the second command line string is (6, 10), the character position of the matched character is (7, 8).

[0076] Step 2013: The host machine determines the business process corresponding to the matching character based on the character position of the matching character and the position index of the concatenated string, and identifies the business process corresponding to the matching character as an online process.

[0077] The host machine locates the concatenation position of the command line string containing the matching character in the position index based on the character position, and then looks up the process identifier corresponding to that concatenation position in the position index.

[0078] In one possible example, the host machine can determine the business process corresponding to a matching character based on a two-dimensional array of character positions, a process PID array ARRAY_PID, and a position index array ARRAY_CMD. For instance, the host machine can perform an intersection operation between the two-dimensional array of character positions and the position index array ARRAY_CMD, obtaining the index of the intersection in the position index array ARRAY_CMD. This index represents the order of the process identifiers corresponding to the intersection in the position index array ARRAY_CMD. Based on this order of process identifiers, the host machine can locate the business process corresponding to that order in the process PID array ARRAY_PID. For example... Figure 3 As shown, the intersection of the character position (matchstart1, matchend1) of the first matching character and the position index array ARRAY_CMD is found to be the concatenation position (start2, end2) of the second command line string. Accordingly, based on the position index array ARRAY_CMD, it can be determined that the order of the business process corresponding to the matching character is the second one. Then, based on the process PID array ARRAY_PID, the process PID of the second business process can be located, thus determining that the business process with this PID is an online process.

[0079] It should be noted that the host machine can execute step 201 periodically to achieve real-time filtering of online processes. Alternatively, step 201 can be executed based on the triggering of a target event. For example, the target event may include, but is not limited to: host machine startup, hybrid deployment component startup, the current time being the target time point, or a user triggering the hybrid deployment component to update the hybrid deployment. For instance, the host machine can execute step 201 once when the hybrid deployment component starts; and then execute subsequent steps 202 based on the filtering result.

[0080] By filtering online processes within business processes based on command-line strings, the system can accurately determine the process based on specific characters, thus improving filtering accuracy. Furthermore, it can concatenate multiple command-line strings, perform character matching between the target character and the concatenated string, and use the matching results to batch locate online processes within multiple business processes. The batch matching method using the target character against multiple command-line strings accelerates the matching process. Moreover, by using position indices and the positions of the batch-matched characters, the system can precisely locate the process identifier of online processes, ensuring that all online processes within the business processes are filtered out. Even when the number of business processes on the host machine is large, it can efficiently and accurately filter online processes, improving filtering efficiency while maintaining accuracy.

[0081] Step 202: The host machine creates an initial set of directories.

[0082] The host machine is configured with a Cgroup resource control mechanism. The host machine can create an initial directory set in the Cgroup. This initial directory set is used to record the directories to which each online process belongs, so that the total resource usage of online processes on the host machine can be calculated based on the directories to which each online process belongs.

[0083] Step 203: Based on at least one currently running online process on the host machine, the host machine adds the directory to which each online process belongs to the initial directory set to generate the online process directory set.

[0084] This directory is used to indicate the online processes for which resource statistics are to be performed. Based on the selected online processes, the host machine obtains the directories to which those online processes belong, and adds the directories to the initial directory set to generate a set of online process directories containing multiple directories. This set of online process directories is used to indicate the multiple online processes currently running on the host machine.

[0085] In one possible example, when a user creates a business instance, they can configure resource statistics for the business processes of that instance. In this case, a business directory for the business instance is created on the host machine, which includes the process identifiers of the online processes of the business instance. Alternatively, the user can choose not to configure resource statistics for the business processes of the business instance. In this case, the online processes of the business instance do not belong to any business directory. Accordingly, step 203 can include: for each online process, in response to the online process belonging to any business directory, the host machine adds that business directory to the initial directory set; in response to the online process not belonging to any business directory, the host machine creates a statistics directory corresponding to the online process, adds the process identifier of the online process to the newly created statistics directory, and adds the newly created statistics directory to the initial directory set. For example, the business directory can include the process identifiers of online processes belonging to the same business instance. After the host machine adds the business directory to the initial directory set, it can monitor the resource usage of each online process under that business directory in real time. If an online process does not belong to any business directory, a statistics directory can be created, and the process identifier of the online process can be added to the newly created statistics directory to perform resource statistics for that online process. After adding the newly created statistics directory to the initial directory set, the resource usage of the online process can also be monitored in real time.

[0086] In one possible implementation, the host machine can also monitor changes in online processes in each directory to update the online process directory set in real time. That is, after generating the online process directory set, the host machine can also update the online process directory set. For example, the host machine can update the online process directory set in real time based on each online process in the directory, such as updating when an online process restarts, logs off, or creates a new child process. Accordingly, this update method can include the following three approaches.

[0087] Method 1: When the process identifier of the online process belongs to any business directory, in response to the restart or update event of the online process, the host adds the process identifier of the restarted or updated online process to any business directory.

[0088] The restart event refers to the restart of the online process, while the update event refers to the version upgrade of the online process. When the process identifier of an online process belongs to any business directory, the online process will be automatically added to the business directory to which the old process belonged, based on either the restart or update event.

[0089] If the process identifier of an online process does not belong to any business directory, the host machine can monitor the number of online processes in each directory and re-filter online processes based on changes in the number of processes to update the online process directory set in real time. In one possible example, the host machine can count the changes in the total number of online processes on the host machine in real time and filter online processes based on this total number of processes. This process may include: the host machine periodically counting the total number of currently running online processes on the host machine based on each directory in the online process directory set; in response to a change in the total number of processes, re-executing the filtering process for online processes from business processes, and updating the online process directory set based on the newly filtered online processes; wherein, the filtering process includes: filtering online processes in the business processes based on the command line string of the currently running business processes on the host machine; this filtering process is similar to step 201 above and will not be described again here.

[0090] For example, the host machine can accumulate the number of online processes included in each directory and use the accumulated value as the total number of online processes in the host machine. When the total number of processes changes, for example, if the total number of processes increases or decreases, the filtering process is executed again. For example, if the total number of processes decreases, it indicates that some old online processes have exited, and new online processes may be created, such as when an old process exits and restarts, or when it exits during a version update and then restarts after the update. For example, based on the filtered online processes, the host machine compares them with the processes included in each business directory in the current online process directory set, finds new online processes that do not belong to any business directory from the filtered online processes, creates a statistical directory corresponding to the new online process, adds the process identifier of the new online process to the newly created statistical directory, and adds the newly created statistical directory to the online process directory set to ensure the timeliness of the online process directory set.

[0091] In another possible example, the host machine can also monitor the changes in the number of processes in each statistical directory. For example, the host machine can periodically count the number of online processes in each statistical directory. When the number of online processes in any statistical directory changes, the filtering process of selecting online processes from business processes is executed again, and the online process directory set is updated based on the online processes selected again.

[0092] like Figure 4 As shown, if an online process already belongs to a certain Cgroup directory, it can be directly added to the online process Cgroup directory set. If an online process does not belong to any business directory, a new Cgroup directory corresponding to the online process can be created, the process identifier can be added to the Cgroup directory, and then the Cgroup directory can be added to the Cgroup directory set. Furthermore, when the number of processes is inconsistent, the online processes can be filtered again to trigger the migration Cgroup logic, that is, the Cgroup directory of the new process can be added to the Cgroup directory set to ensure that the latest resource usage of online processes can be obtained based on the Cgroup directory set.

[0093] It should be noted that for online processes that are already in the business directory, the restarted or updated online processes can be automatically added to the business directory in real time based on the changes in the online processes in the business directory. This allows for subsequent statistics on the latest status of online processes based on the online process directory set, ensuring the accuracy of the statistics.

[0094] For newly created online processes on the host machine, the online processes in this directory may not be automatically added to the newly created directory after a restart or update event. The host machine can monitor the total number of online processes on the host machine based on the online process directory set, or it can monitor the number of online processes in the statistics directory. This allows for further filtering of online processes based on the total number of processes or changes in the number of processes, eliminating the need for real-time execution of the filtering process in step 201 above. This ensures the timeliness and accuracy of the online process directory set, reduces the number of filtering operations, lowers system overhead, and improves the accuracy of subsequent statistics on the total resource consumption of online processes while minimizing system resource consumption.

[0095] Method 2: In response to an online process in any of the directories, a child process is created, and the host machine adds the process identifier of the child process to any of the directories.

[0096] For any directory, when an online process in that directory creates a child process, the host machine can directly add the process identifier of that child process to the service.

[0097] Method 3: In response to the cancellation event of an online process in any of the directories, the host machine deletes the process identifier of the cancelled online process in any of the business directories.

[0098] For any directory in the business directory or statistics directory, when an online process under that directory is deregistered, the host machine can directly delete the process identifier of the deregistered process from that directory.

[0099] It should be noted that the host machine can execute steps 202-203 based on the online processes filtered in step 201. After generating the online process directory set based on step 203, the host machine can monitor the changes in the number of online processes in each directory, such as monitoring the number of processes in each statistical directory or monitoring the total number of processes in the online process directory set. When the number of processes or the total number of processes changes, step 201 is executed again to filter the latest online processes. The online process directory set is then updated based on the latest online processes, which can effectively monitor the changes in online processes, reduce the number of filtering times, reduce the amount of computation, and reduce system overhead.

[0100] In another possible example, the host machine can also periodically execute step 201. For example, after generating the online process directory set, the host machine can periodically execute the above step 201 to update the online process directory set in real time based on the periodically selected online processes, thereby accurately controlling the overall changes of online processes and further improving the accuracy of the online process directory set.

[0101] When an online process creates a new child process or thread, the newly created child process or thread is automatically added to the directory where the online process is located, or the process identifier of the unregistered process is automatically deleted. Thus, the latest online process status can be obtained based on the online process directory set, ensuring the timeliness and accuracy of the online process directory set, and ensuring the accuracy of process management.

[0102] Step 204: Based on the online process directory set, the host machine obtains the total resource usage of at least one currently running online process on the host machine.

[0103] The host machine can calculate the total resource usage based on each directory. This total resource usage can be the amount of CPU, memory, or disk resources used by online processes. For example, it could be the number of CPU kernels or the amount of memory space used.

[0104] In one possible implementation, this step may include: the host machine obtaining the resource usage of each directory from a resource statistics file based on at least one directory included in the online process directory set. The directory indicates the online processes under the corresponding service for which resource statistics are to be performed. The resource statistics file includes the resource usage obtained by performing resource statistics on the online processes indicated by the directory. Based on the resource usage of the at least one directory, the host machine calculates the total resource usage of at least one online process in the host machine. For example, for each directory, the resource statistics file calculates the resource usage of one or more online processes under that directory. The host machine can obtain the resource usage of each directory from the resource statistics file. The host machine can then determine the total resource usage by summing the resource usage of multiple directories.

[0105] In another possible example, the resource statistics file records the total resource usage of the set of online process directories in real time. That is, the host machine can store the cumulative value of the resource usage of each directory, i.e., the total resource usage, in the resource statistics file, and then the host machine can directly obtain the total resource usage from the resource statistics file. For example, the host machine can periodically calculate the cumulative value of the resource usage of each directory.

[0106] It should be noted that after the host machine determines the set of online process directories based on step 203, it can periodically execute step 204. That is, the host machine periodically executes the step of obtaining the total resource usage of at least one currently running online process based on the set of online process directories according to the target period, in order to monitor the total resource usage of online processes in real time. In this step, the host machine can use the set of online process directories to obtain the total resource usage based on the resource usage of each directory, thereby accurately counting the resource usage of each online process on the host machine. This total resource usage comes from the actual statistical values ​​of each specific directory, ensuring the accuracy and reliability of the total resource usage.

[0107] Step 205: Based on the total resource usage, the host machine updates the resource availability of the offline process on the host machine.

[0108] The amount of resources available for use is no greater than the amount of remaining resources on the host machine excluding the total amount of resources used. Based on the total amount of resources used, the host machine selects a portion of the remaining resources on the host machine excluding the total amount of resources used as the amount of resources available for use for the offline process.

[0109] In one possible implementation, the host machine can periodically execute step 205 based on the total resource usage obtained from periodically executing step 204 to update the available resource quantity in real time. This step can include: after obtaining the total resource usage according to a target period, the host machine updates the available resource quantity based on the total resource usage. For example, the host machine can allocate a first target proportion of the remaining resources as the available resource quantity. For instance, if the total resource usage is 30% of the resources in the host machine and the remaining resources are 70%, the first target proportion can be 60%, then the available resource quantity can be 42% of the resources in the host machine. Of course, other calculation methods can also be used to select an available resource quantity less than the remaining resources. This embodiment only illustrates the allocation using the first target proportion as an example, but the calculation method for the available resource quantity is not specifically limited.

[0110] In one possible example, the host machine can also adjust the available resources in real time based on changes in the total resource usage. This process may include: the host machine obtaining the growth rate of the total resource usage of the online process; and the host machine determining the available resources for the offline process based on the total resource usage of the online process and the growth rate. Specifically, the host machine can determine the growth rate of the total resource usage over a target number of target periods based on the total resource usage over those target periods. When the growth rate exceeds a target threshold, the host machine can reduce the first target ratio to a second target ratio, and the host machine uses the product of the second target ratio and the remaining resources as the available resources. Of course, the host machine can use other calculation methods to calculate the growth rate and the available resources corresponding to the total resource usage, and this embodiment does not specifically limit this. For example, the host machine can also set a correspondence between the growth rate and the target ratio. For instance, the growth rate and the target ratio can be inversely proportional; the larger the growth rate, the smaller the target ratio, meaning that less available resources can be allocated to the offline process.

[0111] By updating the available resources based on resource usage, and adjusting the available resources of offline processes according to the resource usage of online processes, linkage between online and offline processes is achieved, improving the flexibility of process management. Furthermore, the available resources can be adjusted in real time based on periodically calculated total resource usage, enabling dynamic and real-time allocation of resource flow between online and offline processes. This ensures that the host machine has sufficient resources for efficient online operation while also guaranteeing dynamic and timely improvement in resource utilization, further enhancing the efficiency and accuracy of process management and increasing the flexibility of hybrid deployments.

[0112] Step 206: Based on the available resources, the host machine updates the offline processes running on the host machine.

[0113] In one possible example, the host machine can adjust the number of running offline processes in real time based on changes in the available resources. For instance, the host machine can monitor the resource usage of offline processes in real time and adjust the number of running offline processes based on the resource usage and available resources. For example, when the resource usage of an offline process exceeds the available resources, the number of running offline processes is reduced to a target number, where the resource usage of the target number of offline processes does not exceed the available resources.

[0114] In one possible example, the hybrid component may be configured with a resource management module, which implements the process of step 206. For example, the resource management module may also be configured with a resource management strategy. Based on this strategy, resources are allocated and managed in real time between online and offline processes to achieve linkage between online and offline processes and ensure the efficient operation of each process. In one possible example, the resource management strategy may include a resource isolation strategy between online and offline processes. That is, some online processes may be bound to fixed resources on the host machine, while offline processes can run on other resources besides the fixed resources, thus physically isolating online and offline processes. Based on this resource isolation strategy, the resource management process for online processes may include: in response to the response rate of the corresponding service of the online process being higher than the target rate, the host machine binds the target resource of the host machine to the online process. Correspondingly, the host machine can adjust the running resources of the offline process in real time based on the binding status of the target resource. Therefore, based on the resource isolation strategy, the resource management process for offline processes may include: the host machine, based on the available resource, runs the offline resource on other resources on the host machine besides the target resource. For example, for computationally sensitive services with high response rate requirements, their online processes can be bound to the target CPU core. Since the cache (high-speed buffer memory) is a high-speed storage and retrieval memory between the CPU and main memory, it can store data that the CPU has just used or is recurring. The CPU can achieve fast read and write operations by storing and retrieving data from the cache, greatly improving processing efficiency. Because the online processes of computationally sensitive services are bound to the target core, the cache corresponding to that core can permanently store the relevant data of the online processes of these computationally sensitive services. The cache will not be occupied by other processes of other services, thus avoiding the situation where data is repeatedly read from main memory due to cache occupancy, ensuring that computationally sensitive services are responded to quickly. Meanwhile, the host machine runs offline processes on other resources, binding them to other resources and preventing interference with the online processes of computationally sensitive services, further ensuring the accuracy and reliability of process management.

[0115] like Figure 5 As shown, the host machine can be equipped with a hybrid deployment component, which can be an Agent component. This hybrid deployment component can obtain the node resources of the host machine in real time, and based on the online process directory set, obtain the resource usage of online processes in real time. Based on the resource usage of online processes, it updates the resource availability in real time to update the resources of offline Kubernetes processes and adjust the offline processes. The hybrid deployment component can be configured with a resource management module, which, based on resource management policies, links online and offline processes to ensure the efficient operation of each process.

[0116] It should be noted that after executing steps 201-203 above, the host machine can periodically execute steps 204-206 according to the target cycle to achieve real-time adjustment of online and offline resources. This allows offline resources to reuse idle resources in the host machine in a timely manner. Even if there is a sudden surge in online traffic and a large amount of resources are urgently needed, the host machine can flexibly adjust the resource availability of offline processes based on the growth rate and resource usage to ensure that offline processes can avoid interfering with online processes. This improves the flexibility and accuracy of hybrid deployment and ensures the reliability of process management. Furthermore, the process management method of this application can automatically achieve hybrid deployment of non-containerized online and offline processes, especially saving the cost management of servers in big data centers. By allocating resources to offline processes, revenue can be improved.

[0117] It should be noted that this host machine can allocate a resource reserve not exceeding the remaining resource amount to offline processes based on the total resource usage, ensuring that online processes are not interfered with. This enables resource linkage between online and connected processes, guaranteeing the fast and efficient operation of online processes. Furthermore, through periodic statistics and updates, it monitors changes in online and offline resources in real time. While ensuring sufficient online resources, it can promptly utilize remaining resources. Moreover, by periodically updating the resource reserve, it can rapidly improve resource utilization, ensuring the timeliness of resource utilization improvements. This enhances resource utilization efficiency and process management efficiency, thereby improving resource utilization through improved response time in resource linkage.

[0118] Furthermore, for online processes with high response rate requirements, this application can also ensure the efficiency of the online process and the timely response of services with high response rates by binding the online process to fixed resources. This makes the process management method of this application applicable to the needs of various services and more mixed deployment scenarios, thus improving the applicability of the process management method.

[0119] The process management method provided in this application obtains the total resource usage of online processes through an online process directory set, updates the available resource quantity based on the total resource usage, and realizes the linkage between the resources of online and offline processes. Furthermore, the available resource quantity does not exceed the remaining resource quantity other than the total resource usage, which fully ensures the efficient operation of online processes, accurately obtains the offline resource quantity to avoid interference with online resources, and improves the accuracy and flexibility of mixed deployment of online and offline processes. By updating offline processes based on the available resource quantity, the remaining resources can be fully utilized while ensuring the stable and efficient operation of online processes, thereby improving resource utilization and ultimately improving the accuracy of process management.

[0120] Furthermore, online processes can be accurately filtered out using command-line strings; character matching can also be performed based on the concatenation of multiple command-line strings, and online processes in multiple business processes can be located in batches based on position indexes, improving filtering efficiency and accuracy. It can quickly and efficiently filter out online processes from massive business processes, further improving the efficiency and accuracy of process management.

[0121] Furthermore, based on the online process directory set, the resource usage of online processes in each directory is accurately obtained. Based on the resource usage corresponding to each directory, the total resource usage is accurately calculated, improving the accuracy and efficiency of subsequent resource allocation. Moreover, through periodic statistics and updates, changes between online and offline resources are monitored in real time, ensuring the timeliness of resource utilization improvements. This embodiment of the application, by binding online processes to fixed resources, is applicable to online processes with high response rate requirements, improving the applicability and accuracy of the process management method.

[0122] Figure 6 This is a schematic diagram of a process management device provided in an embodiment of this application. Figure 6 As shown, the device includes:

[0123] The acquisition module 601 is used to acquire the total resource usage of at least one currently running online process in the host machine based on the online process directory set;

[0124] Update module 602 is used to update the resource availability of offline processes on the host machine based on the total resource usage, and the resource availability is not greater than the remaining resources on the host machine other than the total resource usage.

[0125] The update module 602 is also used to update offline processes running on the host machine based on the available resources.

[0126] In one possible implementation, the device further includes:

[0127] Create a module to create the initial set of directories;

[0128] An add module is used to add the directory to which each online process belongs to the initial directory set based on at least one online process currently running on the host machine, so as to generate the online process directory set, which is used to indicate the online processes for which resource statistics are to be performed.

[0129] In one possible implementation, the device further includes:

[0130] The filtering module is used to filter out online processes within a business process based on the command-line string of the currently running business process on the host machine. The command-line string indicates whether the business process is an online process.

[0131] In one possible implementation, the filtering module is configured to concatenate at least two command-line strings of the at least two business processes based on their process identifiers to obtain a concatenated string; perform character matching on a target character and the concatenated string to determine the character position of the matching character in the concatenated string, wherein the target character is used to indicate that the business process belongs to an online business; and determine the business process corresponding to the matching character based on the character position of the matching character and the position index of the concatenated string, thereby identifying the business process corresponding to the matching character as an online process, wherein the position index is used to indicate the business process corresponding to the command-line strings at each concatenation position of the concatenated string.

[0132] In one possible implementation, the adding module is used to add any business directory to the initial directory set for each online process in response to the online process belonging to any business directory. The business directory is used to indicate the online processes under the corresponding business that are to be subject to resource statistics.

[0133] In response to the fact that the online process does not belong to any business directory, a statistical directory corresponding to the online process is created, and the process identifier of the online process is added to the newly created statistical directory. The newly created statistical directory is also added to the initial directory set.

[0134] In one possible implementation, the device further includes:

[0135] The statistics module is used to periodically count the total number of currently running online processes on the host machine based on each directory in the online process directory set.

[0136] The update module 602 is also used to, in response to a change in the total number of processes, re-execute the filtering process of selecting online processes from the business processes, and update the online process directory set based on the online processes selected again;

[0137] The filtering process includes filtering out online processes within a given business process based on the command-line string of the currently running business process on the host machine.

[0138] In one possible implementation, the update module 602 is also used to update the online process directory set;

[0139] The update module 602 is also used for any of the following:

[0140] In response to an online process in any directory, create a child process and add the process identifier of the child process to that directory;

[0141] In response to the logout event of an online process in any of the directories, delete the process identifier of the logged-out online process in any of the directories;

[0142] When the process identifier of the online process belongs to any business directory, in response to the restart or update event of the online process, the process identifier of the restarted or updated online process is added to that business directory.

[0143] In one possible implementation, the acquisition module 601 is configured to acquire the resource usage of each directory from a resource statistics file based on at least one directory included in the online process directory set, wherein the directory is used to indicate the online processes for which resource statistics are to be performed, and the resource statistics file includes the resource usage obtained by performing resource statistics on the online processes indicated by the directory; and based on the resource usage of the at least one directory, to calculate the total resource usage of at least one online process in the host machine.

[0144] In one possible implementation, the acquisition module 601 is used to periodically execute the step of acquiring the total resource usage of at least one currently running online process on the host machine based on the online process directory set according to a target period.

[0145] Correspondingly, the update module 602 is also used to obtain the growth rate of the total resource consumption of the online process; and to determine the resource availability of the offline process based on the total resource consumption of the online process and the growth rate.

[0146] In one possible implementation, the device further includes:

[0147] The binding module is used to bind the target resource of the host machine to the online process when the response rate of the corresponding service of the online process is higher than the target rate.

[0148] Correspondingly, the update module 602 is also used to run the offline resource on other resources in the host machine besides the target resource, based on the resource availability.

[0149] The process management device provided in this application obtains the total resource usage of online processes through an online process directory set, updates the available resource quantity based on the total resource usage, and realizes the linkage between the resources of online and offline processes. Furthermore, the available resource quantity does not exceed the remaining resource quantity other than the total resource usage, which fully ensures the efficient operation of online processes and accurately obtains the offline resource quantity to avoid interfering with online resources, thereby improving the accuracy and flexibility of mixed deployment of online and offline processes. By updating offline processes based on the available resource quantity, the remaining resources can be fully utilized while ensuring the stable and efficient operation of online processes, thus improving resource utilization and improving the accuracy of process management.

[0150] Furthermore, online processes can be accurately filtered out using command-line strings; character matching can also be performed based on the concatenation of multiple command-line strings, and online processes in multiple business processes can be located in batches based on position indexes, improving filtering efficiency and accuracy. It can quickly and efficiently filter out online processes from massive business processes, further improving the efficiency and accuracy of process management.

[0151] Furthermore, based on the online process directory set, the resource usage of online processes in each directory is accurately obtained. Based on the resource usage corresponding to each directory, the total resource usage is accurately calculated, improving the accuracy and efficiency of subsequent resource allocation. Moreover, through periodic statistics and updates, changes between online and offline resources are monitored in real time, ensuring the timeliness of resource utilization improvements. This embodiment of the application, by binding online processes to fixed resources, is applicable to online processes with high response rate requirements, improving the applicability and accuracy of the process management method.

[0152] The process management device in this embodiment can execute the process management method shown in the above embodiments of this application. The implementation principle is similar and will not be described again here.

[0153] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. For example... Figure 7 As shown, the computer device includes: a memory and a processor; at least one program, stored in the memory, which, when executed by the processor, can implement the above-described process management method.

[0154] In one alternative embodiment, a computer device is provided, such as Figure 7 As shown, Figure 7 The computer device 700 shown includes a processor 701 and a memory 703. The processor 701 and the memory 703 are connected, for example, via a bus 702. Optionally, the computer device 700 may further include a transceiver 704, which can be used for data interaction between the computer device and other computer devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 704 is not limited to one type, and the structure of the computer device 700 does not constitute a limitation on the embodiments of this application.

[0155] Processor 701 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 701 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0156] Bus 702 may include a pathway for transmitting information between the aforementioned components. Bus 702 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 702 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0157] The memory 703 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0158] The memory 703 stores application code (computer program) that executes the solution of this application, and its execution is controlled by the processor 701. The processor 701 executes the application code stored in the memory 703 to implement the content shown in the foregoing method embodiments.

[0159] The computer equipment includes, but is not limited to: servers, host machines, or any management device capable of running and managing processes.

[0160] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content of the process management method described in the foregoing method embodiments.

[0161] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the process management method described above.

[0162] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0163] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A process management method characterized by, The method includes: If at least two business processes are currently running on the host machine, the command line strings of the at least two business processes are concatenated based on the process identifiers of the at least two business processes to obtain a concatenated string; Perform character matching on the target character and the concatenated string to determine the character position of the matching character in the concatenated string. The target character is used to indicate that the business process belongs to online business. Based on the character position of the matching character in the concatenated string, the business process corresponding to the matching character is determined to be an online process; Based on at least one online process currently running in the host machine, an online process directory set is generated, the directory being used to indicate the online processes for which resource statistics are to be performed; Based on the online process directory set, obtain the total resource usage of at least one online process currently running in the host machine; Based on the total resource usage, update the resource availability of the offline process on the host machine. The resource availability is not greater than the remaining resources on the host machine other than the total resource usage. Based on the available resources, update the offline processes running on the host machine.

2. The process management method according to claim 1, characterized by, The step of generating an online process directory set based on at least one currently running online process in the host machine includes: Create an initial set of directories; Based on at least one online process currently running in the host machine, the directory to which each online process belongs is added to the initial directory set to generate the online process directory set.

3. The process management method according to claim 2, characterized in that, The command-line string is used to indicate whether the business process is an online process.

4. The process management method according to claim 3, characterized in that, The step of determining the business process corresponding to the matching character as an online process based on the character position of the matching character in the concatenated string includes: Based on the character position of the matching character and the position index of the concatenated string, the business process corresponding to the matching character is determined, and the business process corresponding to the matching character is identified as an online process. The position index is used to indicate the business process corresponding to the command line string at each concatenation position of the concatenated string.

5. The process management method according to claim 2, characterized in that, The step of adding the directory to the initial directory set for each online process, based on at least one currently running online process in the host machine, includes: For each online process, in response to the online process belonging to any business directory, the business directory is added to the initial directory set. The business directory is used to indicate the online processes under the corresponding business that are to be subject to resource statistics. In response to the fact that the online process does not belong to any business directory, a statistical directory corresponding to the online process is created, and the process identifier of the online process is added to the created statistical directory. The created statistical directory is then added to the initial directory set.

6. The process management method according to claim 2, characterized in that, After generating the online process directory set, the method further includes: Based on each directory in the online process directory set, the total number of currently running online processes in the host machine is periodically counted. When the total number of processes changes, the filtering process of selecting online processes from the business processes is executed again, and the online process directory set is updated based on the online processes selected again. The filtering process includes: filtering out online processes from the business processes based on the command line strings of the currently running business processes in the host machine.

7. The process management method according to claim 2, characterized in that, After generating the online process directory set, the method further includes: Update the set of online process directories; The update methods include any of the following: In response to an online process in any directory, a child process is created, and the process identifier of the child process is added to that directory. In response to an online process logout event in any of the directories, delete the process identifier of the logged-out online process in any of the directories; When the process identifier of the online process belongs to any business directory, in response to the restart or update event of the online process, the process identifier of the restarted or updated online process is added to the business directory.

8. The process management method according to claim 1, characterized in that, The step of obtaining the total resource usage of at least one currently running online process on the host machine based on the online process directory set includes: Based on at least one directory included in the online process directory set, the resource usage of each directory is obtained from the resource statistics file, wherein the directory is used to indicate the online process for which resource statistics are to be performed, and the resource statistics file includes the resource usage obtained by performing resource statistics on the online process indicated by the directory; Based on the resource usage of the at least one directory, the total resource usage of at least one online process in the host machine is calculated.

9. The process management method according to claim 1, characterized in that, The step of obtaining the total resource usage of at least one currently running online process on the host machine based on the online process directory set includes: According to the target cycle, the step of periodically executing the step of obtaining the total resource usage of at least one currently running online process in the host machine based on the online process directory set; Accordingly, updating the resource availability of offline processes on the host machine based on the total resource usage includes: Obtain the growth rate of the total resource consumption of the online process; Based on the total resource consumption of the online processes and the growth rate, the resource availability corresponding to the offline processes is determined.

10. The process management method according to claim 1, characterized in that, Before updating the offline processes running on the host machine based on the available resources, the method further includes: If the response rate of the service corresponding to the online process is higher than the target rate, the target resources of the host machine are bound to the online process; Accordingly, updating the offline processes running on the host machine based on the available resources includes: Based on the available resources, the offline process will run on other resources in the host machine besides the target resource.

11. A process management device, characterized in that, The device includes: A filtering module is used to, when at least two business processes are currently running on the host machine, concatenate at least two command line strings of the at least two business processes based on their process identifiers to obtain a concatenated string; perform character matching on a target character and the concatenated string to determine the position of the matching character in the concatenated string, wherein the target character indicates that the business process belongs to an online business; and determine the business process corresponding to the matching character as an online process based on the position of the matching character in the concatenated string. An add module is used to generate a set of online process directories based on at least one currently running online process in the host machine, the directory being used to indicate the online processes for which resource statistics are to be performed; The acquisition module is used to acquire the total resource usage of at least one online process currently running in the host machine based on the online process directory set. The update module is used to update the resource availability of the offline process on the host machine based on the total resource usage, wherein the resource availability is not greater than the remaining resources on the host machine other than the total resource usage. The update module is also used to update the offline processes running on the host machine based on the amount of resources available.

12. The process management device according to claim 11, characterized in that, The device further includes: Create a module to create the initial set of directories; The adding module is used to add the directory to which each online process belongs to the initial directory set based on at least one online process currently running in the host machine, so as to generate the online process directory set, wherein the directory is used to indicate the online processes for which resource statistics are to be performed.

13. The process management device according to claim 12, characterized in that, The command-line string is used to indicate whether the business process is an online process.

14. The process management device according to claim 13, characterized in that, The filtering module is used to determine the business process corresponding to the matching character based on the character position of the matching character and the position index of the concatenated string, and to determine the business process corresponding to the matching character as an online process. The position index is used to indicate the business process corresponding to the command line string at each concatenation position of the concatenated string.

15. The process management device according to claim 12, characterized in that, The adding module is used to add any business directory to the initial directory set for each online process in response to the online process belonging to any business directory. The business directory is used to indicate the online processes under the corresponding business that need to be subject to resource statistics. In response to the fact that the online process does not belong to any business directory, a statistical directory corresponding to the online process is created, and the process identifier of the online process is added to the created statistical directory. The created statistical directory is then added to the initial directory set.

16. The process management device according to claim 12, characterized in that, The device further includes: The statistics module is used to periodically count the total number of currently running online processes on the host machine based on each directory in the online process directory set. The update module is also configured to, in response to a change in the total number of processes, re-execute the filtering process of selecting online processes from the business processes, and update the online process directory set based on the online processes selected again; The filtering process includes: filtering out online processes from the business processes based on the command line strings of the currently running business processes in the host machine.

17. The process management device according to claim 12, characterized in that, The update module is also used to update the online process directory set; The update module is further configured to perform any of the following: In response to an online process in any directory, a child process is created, and the process identifier of the child process is added to that directory. In response to an online process logout event in any of the directories, delete the process identifier of the logged-out online process in any of the directories; When the process identifier of the online process belongs to any business directory, in response to the restart or update event of the online process, the process identifier of the restarted or updated online process is added to the business directory.

18. The process management device according to claim 11, characterized in that, The acquisition module is used to acquire the resource usage of each directory from the resource statistics file based on at least one directory included in the online process directory set. The directory is used to indicate the online process for which resource statistics are to be performed. The resource statistics file includes the resource usage obtained by performing resource statistics on the online process indicated by the directory. Based on the resource usage of the at least one directory, the module calculates the total resource usage of at least one online process in the host machine.

19. The process management device according to claim 11, characterized in that, The acquisition module is used to periodically execute the step of acquiring the total resource usage of at least one currently running online process in the host machine based on the online process directory set according to the target period. Accordingly, the update module is also used to obtain the growth rate of the total resource consumption of the online process; and to determine the resource availability of the offline process based on the total resource consumption of the online process and the growth rate.

20. The process management device according to claim 11, characterized in that, The device further includes: A binding module is used to bind the target resources of the host machine to the online process in response to the online process's response rate being higher than the target rate. Correspondingly, the update module is also used to run the offline process on other resources in the host machine besides the target resource, based on the resource availability.

21. A computer device, characterized in that, The computer device includes: One or more processors; Memory; One or more computer programs, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to: perform the process management method according to any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that, The computer storage medium is used to store computer instructions, which, when executed on the computer, enable the computer to perform the process management method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • System resource monitoring method, device and equipment and machine readable storage medium

    CN112181774A

  • Resource allocation method and device, equipment and storage medium

    CN112559182A