Process control method and device, computer readable storage medium, computer program product and terminal equipment
By obtaining and setting restrictions in the terminal device, controlling the status of the background process, solving the IO resource conflict caused by the background process occupies memory, ensuring that the foreground application responds in a timely manner, and improving the user experience.
Patent Information
- Application Number
- CN202410931392.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-08
AI Technical Summary
In terminal devices, due to poor performance of flash memory particles, the background process will squeeze the memory of the foreground application when it generates dirty pages in the page cache, resulting in IO resource conflicts and the foreground application cannot respond in a timely manner.
By obtaining and setting restrictions information, control the status of the background process, such as suspending the background process when the current limit bandwidth and the amount of data in the statistics window meet the limit conditions, avoiding it writing to memory, and ensuring that the foreground application can respond in a timely manner.
It effectively avoids the problem of writing background data into memory and occupies memory, improves the response speed and user experience of the foreground application. It is suitable for various systems, without the need to save process data in memory, and avoids page bumps caused by memory occupied.
Smart Images

Figure CN118916084A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a process control method and apparatus, a computer-readable storage medium, a computer program product, and a terminal device. Background Art
[0002] Current terminal devices usually use flash memory for storage. In devices with poor flash memory performance, when running input / output (IO) stress testing in the background, such as copying large files, the foreground application will be stuck. The reason is that the background process continues to generate dirty pages in the page cache, occupying the available memory (which may include pages used by the foreground application), and the background generates a large number of IO requests when writing back dirty pages in the page cache.
[0003] However, due to the physical characteristics of the disk, there are limitations such as bandwidth limitations and maximum read and write speeds. Therefore, there is a conflict in the use of IO resources between background IO requests and IO requests generated by foreground application page faults, resulting in the foreground application not being able to obtain a timely response. Summary of the invention
[0004] The present application provides a solution for timely responding to the process of a foreground application.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] In a first aspect, a process control method is provided, the process control method comprising: obtaining first restriction information, the first restriction information indicating restriction conditions on a first process; and controlling a state of the first process according to the restriction conditions, the state comprising suspension or writing.
[0007] Optionally, controlling the state of the first process according to the restriction condition includes: suspending the first process in response to the first process satisfying the restriction condition; or continuing to execute the first process in response to the first process not satisfying the restriction condition.
[0008] Optionally, the first restriction information includes at least one of the following: limited bandwidth, statistical window period, and limited data volume.
[0009] Optionally, the first process satisfies the restriction condition including that the bandwidth of the first process in the statistical window period reaches the limited bandwidth, and / or the data volume of the first process in the statistical window period reaches the limited data volume.
[0010] Optionally, before obtaining the first restriction information, the method further includes: creating a first group of policies, wherein the first group of policies includes the first restriction information.
[0011] Optionally, the creating the first group of policies includes: in response to a global array in blkcg having free items, determining an identifier of the first group of policies; creating a data structure of the first group of policies; and storing the data structure in the blkcg array to form a blkcg structure.
[0012] Optionally, the obtaining of the first restriction information includes: obtaining a css structure of a cgroup according to the first process; and obtaining the blkcg structure according to the css structure, wherein the blkcg structure includes the first restriction information.
[0013] In a second aspect, the present application also discloses a process control device, which includes: an acquisition module for acquiring first restriction information, wherein the first restriction information indicates restriction conditions on a first process; and a processing module for controlling a state of the first process according to the restriction conditions, wherein the state includes suspension or writing.
[0014] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. The computer program is executed by a processor to execute the method provided in the first aspect.
[0015] In a fourth aspect, a communication device is provided, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to execute the method provided in the first aspect.
[0016] According to a fifth aspect, a computer program product is provided, on which a computer program is stored, and the computer program is executed by a processor to execute a method provided in the first aspect.
[0017] In a sixth aspect, an embodiment of the present application further provides a chip (or a data transmission device) on which a computer program is stored, and when the computer program is executed by the chip, the steps of the above method are implemented.
[0018] In the seventh aspect, an embodiment of the present application also provides a system chip, which is applied to a terminal, and the chip system includes at least one processor and an interface circuit, the interface circuit and the at least one processor are interconnected through lines, and the at least one processor is used to execute instructions to execute the method provided in the first aspect.
[0019] Compared with the prior art, the technical solution of this application has the following beneficial effects:
[0020] In the technical solution of the present application, by pre-setting the first restriction information, the first process can be controlled according to the restriction conditions during the process of writing the process to the memory; when a resource conflict occurs between the IO request of the foreground application and the IO request of the background, the first process in the background can be suspended according to the first restriction information, thereby avoiding the background data being written to the memory and occupying the memory, thereby ensuring that the foreground application process can be responded to in a timely manner, thereby improving the user experience.
[0021] Furthermore, the restriction condition includes at least one of the following: limited bandwidth, statistical window period, and limited data volume. In the technical solution of the present application, by designing specific restriction conditions, the amount of data written and / or the written bandwidth can be counted during the statistical window period, thereby ensuring the smooth processing of a specific process under limited bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a process control method provided by an embodiment of the present application;
[0023] Figure 2 is a flow chart of a method for creating a first set of policies provided in an embodiment of the present application;
[0024] Figure 3 is a flow chart of a method for obtaining a first set of policies provided in an embodiment of the present application;
[0025] Figure 4 It is a structural diagram of an operating system provided in an embodiment of the present application;
[0026] Figure 5 It is a structural schematic diagram of a process control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] As described in the background technology, due to the physical characteristics of the disk, there are limitations such as bandwidth limitations and maximum read and write speeds. Therefore, there is a conflict in the use of IO resources between background IO requests and IO requests generated by foreground application page faults, resulting in the foreground application not being able to obtain a timely response.
[0028] An existing method of IO speed limiting is to use control groups (cgroup) V2, which can limit the speed of writeback. This function can identify the process that generates dirty data in memory, and then pass the speed limit information (blkcg information) to the block device layer during writeback to achieve the speed limit purpose.
[0029] However, the above method requires the support of the memcgv2 mechanism of the storage subsystem in the cgroup, so that the block layer can obtain the original cache write process of the IO request, thereby limiting the process. The limiting here means that the IO request is not sent to the driver, but is stored in the memory. This operation will cause the following problems: 1. Memcgv2 is not supported by all systems, especially in the Android system, memcgv2 will introduce a significant performance regression; 2. IO requests are stored in the memory, causing the foreground process to experience page thrashing due to memory pressure. Although the IO request can be processed in time, the IO operation is time-consuming.
[0030] In the technical solution of the present application, by pre-setting the first restriction information, the first process can be controlled according to the restriction conditions during the process of writing the process to the memory; when a resource conflict occurs between the IO request of the foreground application and the IO request of the background, the first process in the background can be suspended according to the first restriction information, thereby avoiding the background data being written to the memory and occupying the memory, thereby ensuring that the foreground application process can be responded to in a timely manner, thereby improving the user experience.
[0031] The technical solution of the present application can be used in various types of systems and has a wide range of applications. In addition, the technical solution of the present application does not need to store process data in memory, that is, it does not need to occupy memory, thereby avoiding problems such as page thrashing caused by memory occupation.
[0032] The blkcg in the present application embodiment refers to the IO subsystem of the control group (cgroup). The control group is a function of the Linux kernel that is used to limit, control and separate the resources of a process group (such as memory, disk input and output, etc.).
[0033] The terminal equipment in the embodiments of the present application may refer to various forms of access terminals, user units, user stations, mobile stations, mobile stations (Mobile Station, MS), remote stations, remote terminals, mobile devices, user terminals, wireless communication devices, user agents or user devices. The terminal equipment may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a future 5G network or a terminal device in a future evolving Public Land Mobile Network (PLMN), etc., which is not limited in the embodiments of the present application. The terminal equipment may also be referred to as User Equipment (UE), a terminal, etc.
[0034] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0035] See also Figure 1 The method provided in this application specifically includes the following steps:
[0036] Step 101: Obtain first restriction information.
[0037] Step 102: Control the state of the first process according to the restriction condition, where the state of the first process includes suspension or writing.
[0038] It should be noted that the serial numbers of the steps in this embodiment do not limit the execution order of the steps.
[0039] It is understandable that, in a specific implementation, the process control method can be implemented in the form of a software program, and the software program runs in a processor integrated inside a chip or a chip module. The method can also be implemented in the form of software combined with hardware, which is not limited in this application.
[0040] In this embodiment, the restriction condition in the first restriction information may be preset, and the restriction condition is applicable to the first process, and the number of the first process may be one or more.
[0041] That is, when configuring the first restriction information, the first process to which the restriction condition in the first restriction information applies may be configured at the same time.
[0042] For example, in a scenario where a resource conflict occurs between the IO request of a foreground application and the background IO request, the background IO process needs to be restricted to ensure the smooth progress of the IO process of the foreground application. In this case, the background IO process can be used as the first process.
[0043] In this embodiment, the first process is a writing process, and when the first process meets the restriction condition, the first process is suspended, that is, the first process is controlled to enter a sleep state. On the contrary, when the first process does not meet the restriction condition, the first process is written, that is, the data of the first process is written to the disk.
[0044] The embodiment of the present application suspends the first process according to the restriction condition in the first restriction information, thereby avoiding background data writing to the memory and occupying the memory, thereby ensuring that the foreground application process can be responded to in a timely manner, thereby improving the user experience.
[0045] In a specific embodiment, in response to the first process satisfying the restriction condition, the first process is suspended. The suspended process can be defined as a process that is temporarily eliminated from the memory. In the case of insufficient resources, the operating system reasonably arranges the programs in the memory, and some processes are temporarily transferred out of the memory. When conditions permit, the process will be transferred back to the memory by the operating system and re-enter the state of waiting to be executed, that is, the ready state. From the time the process is suspended to the time the process is transferred back to the memory again, the operating system does not take any action on the process within a certain period of time.
[0046] In another specific embodiment, in response to the first process not satisfying the restriction condition, the first process is continued to be executed. For example, if the first process is a write process, the operating system executing the first process means writing the data of the first process to the disk; if the first process is a read process, the operating system executing the first process means reading data from the disk.
[0047] In a non-limiting embodiment, the first restriction information includes at least one of the following: limited bandwidth, statistical window period, and limited data volume.
[0048] The statistical window period may specifically include a starting position of the statistical window and a duration of the statistical window. The operating system may count the amount of data of the first process within the statistical window period, and the operating system may also count the bandwidth of the first process within the statistical window period.
[0049] The flow-limiting bandwidth indicates the upper limit of the bandwidth of the first process in the statistical window period. That is, if the bandwidth of the first process in the statistical window period exceeds the flow-limiting bandwidth, it means that the first process meets the restriction condition and the first process will be suspended.
[0050] The data limit indicates the upper limit of the data volume of the first process in the statistical window period. That is, if the data volume of the first process in the statistical window period exceeds the data limit, it means that the first process meets the restriction condition and the first process will be suspended.
[0051] The embodiments of the present application are capable of counting the amount of written data and / or the write bandwidth during the statistical window period by designing specific restriction conditions, thereby ensuring the smooth processing of a specific process when the bandwidth is limited.
[0052] In a non-limiting embodiment, the first restriction information may be included in a first set of policies, wherein the first set of policies may be a structure in blkcg, and the structure includes the first restriction information.
[0053] Please refer to Figure 2 , Figure 2 A process for creating a first set of policies is shown.
[0054] In step 201, in response to a global array in blkcg having a free entry, an identifier of a first group of policies is determined.
[0055] Specifically, the number of policies supported by the kernel of the operating system is limited, for example, it supports a maximum of six policies. Therefore, before creating the first set of policies, it is necessary to check whether the global array in the blkcg mechanism has free items. If the global array in blkcg has free items, it means that a new policy can be created, and the identifier of the first set of policies can be determined. For example, check whether the global array blkcg_policy[6] still has free items. If so, write the data index pol of the free item into the identifier plid of the first set of policies, that is, pol->plid. Among them, the value of the identifier plid of the first set of policies is obtained from the global array. For example, there are already 3 policies in the global array. When registering this time, plid should be 3 because 0-2 already have other policies.
[0056] In step 202, a data structure of a first set of policies is created.
[0057] Specifically, all blkcgs are traversed, and each blkcg group calls the function pol->cpd_alloc_fn() to allocate a custom data structure and create the first field cpd in the data structure of the blkcg policy.
[0058] In step 203, the data structure is stored in the blkcg array to form a blkcg structure.
[0059] Specifically, the newly created cpd is stored in the blkcg->cpd array; the blkcg of Cpd points to the blkcg structure; and the identifier plid of the first group of policies is also stored in the data structure of the first group of policies.
[0060] Furthermore, an interface file of the first set of policies may be generated in cgroupv2; and an interface file of the first set of policies may be generated in cgroupv1, so that other programs can call the first set of policies through the interface file.
[0061] In this embodiment, the first set of policies may be triggered and generated when the driver is started. The first set of policies may be written in the driver and executed under the control of the driver.
[0062] The embodiment of the present application can implement restrictions on the first process at the software level by controlling and executing the first set of policies through the driver, without the need for support from additional storage mechanisms, thereby improving system compatibility.
[0063] In a non-limiting embodiment, Figure 3 A schematic diagram of a first set of strategies for obtaining the blkcg where the current task is located is also shown.
[0064] Among them, through the first process, the Cascading Style Sheets (CSS) structure of the cgroup is obtained. The blkcg structure (struct blkcg) can be obtained through the css structure, that is, Figure 3 301 shown in FIG. 4. The blkcg structure includes first restriction information.
[0065] Specifically, according to the identifier plid of the first group of policies, the first field cpd (i.e. Figure 3 The first set of policies 302 can be obtained through cpd.
[0066] The embodiment of the present application links the first group of policies through the blkcg structure, and obtains the first restriction information and restricts the first process in the operating system at the software level without the need for additional storage mechanisms or additional hardware support, thereby improving system compatibility and being applicable to a wider range of application scenarios.
[0067] In a specific application scenario, please refer to Figure 4 , each step of the above process control method can be executed by the read-write restriction module 401.
[0068] In this embodiment, the operating system includes a plurality of application programs 404 , such as APP1 , APP2 , . . . APPn. The process of the application program 404 reaches the read / write restriction module 401 via a virtual file system (VFS) 403 .
[0069] The read / write restriction module 401 controls the state of the first process according to the restriction condition.
[0070] Specifically, the read / write restriction module 401 can time the statistical window period through a timer, and count the bandwidth or data volume of the first process during the statistical window period. After the timer times out, the bandwidth or data volume of the first process is no longer counted.
[0071] The operating system further includes a page cache 402, which is used to cache files in the disk in the memory.
[0072] In a specific application scenario of the present application, an existing operating system and an operating system adopting the technical solution of the present application can be compared.
[0073] Specifically, the comparison can be made using the scores of the benchmark application androbench, where higher scores indicate better performance.
[0074] Please refer to Table 1 for specific scores. As shown in Table 1, in the four scenarios of sequential reading, sequential writing, random reading and random writing, the test scores in this application are higher than those in the prior art, and the performance of the operating system in this application is better. Among them, in the two scenarios of random reading and random writing, the performance of the operating system using the technical solution of this application is improved to a greater extent.
[0075] Table 1
[0076] Prior art The present invention Improvement ratio Sequential read 177.23 261.63 47.62% Sequential write 44.76 225.14 402.99% Random read 3.08 91.20 2857.73% Random write 2.53 61.84 2340.92%
[0077] Please refer to Figure 5 , Figure 5 A process control device 50 is shown, and the process control device 50 may include an acquisition module 501 and a processing module 502 .
[0078] The acquisition module 501 is used to acquire first restriction information, where the first restriction information indicates a restriction condition on the first process;
[0079] The processing module 502 is used to control the state of the first process according to the restriction condition, and the state includes suspension or writing.
[0080] In the embodiment of the present application, the acquisition module 501 and the processing module 502 are equivalent to Figure 4 The read and write restriction module 401 in.
[0081] In an embodiment of the present application, by pre-setting the first restriction information, the first process can be controlled according to the restriction conditions during the process of writing the process to the memory; when a resource conflict occurs between the IO request of the foreground application and the IO request of the background, the first process in the background can be suspended according to the first restriction information, thereby avoiding the background data being written to the memory and occupying the memory, thereby ensuring that the foreground application process can be responded to in a timely manner, thereby improving the user experience.
[0082] In a specific implementation, the above-mentioned process control device 50 can correspond to a chip with a process control function in a terminal device, such as a system-on-a-chip (SOC), a baseband chip, etc.; or correspond to a chip module with a process control function in a terminal device; or correspond to a chip module with a process control function chip, or correspond to a terminal device.
[0083] Furthermore, the processing module 502 is further configured to suspend the first process in response to the first process satisfying the restriction condition.
[0084] Furthermore, the processing module 502 is further configured to continue executing the first process in response to the first process not satisfying the restriction condition.
[0085] Furthermore, the acquisition module 501 includes a creation unit, and the creation unit is used to create a first set of policies, and the first set of policies includes first restriction information.
[0086] Furthermore, the creation unit also includes: an identification determination subunit, which is used to determine the identification of the first group of policies in response to the global array in blkcg having free items; a creation subunit, which is used to create a data structure of the first group of policies; and a structure formation subunit, which is used to store the data structure in the blkcg array to form a blkcg structure.
[0087] Furthermore, the acquisition module 501 is further configured to acquire a css structure of the cgroup according to the first process; and acquire a blkcg structure according to the css structure, wherein the blkcg structure includes the first restriction information.
[0088] For other relevant descriptions about the process control device 50, reference can be made to the relevant descriptions in the aforementioned embodiments, which will not be repeated here.
[0089] Regarding the various modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, or hardware modules / units, or they can be partially software modules / units and partially hardware modules / units. For example, for various devices and products applied to or integrated in a chip, the various modules / units included therein can all be implemented in the form of hardware such as circuits, or at least some of the modules / units can be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining (if any) modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in a chip module, the various modules / units included therein can all be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component of the chip module (such as a chip, circuit module, etc.) or in different components, or at least some of the modules / units can be implemented in the form of software programs. It is implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in hardware such as circuits.
[0090] The embodiment of the present application also discloses a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and the steps of the method shown in the aforementioned "everything goes smoothly" can be executed when the computer program is running. The storage medium may include a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. The storage medium may also include a non-volatile memory (non-volatile) or a non-transitory memory, etc.
[0091] The terminal device referred to in the embodiments of the present application may also include a processor and a memory.
[0092] The processor may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application. The processor may also include multiple CPUs, and the processor may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, or processing cores for processing data (such as computer program instructions).
[0093] The memory may be a ROM or other types of static storage devices that can store static information and instructions, a RAM or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a disk storage medium or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, and the embodiments of the present application do not impose any restrictions on this. The memory may exist independently (in this case, the memory may be located outside the device or inside the device), or it may be integrated with the processor. Among them, the memory may contain a computer program code. The processor is used to execute the computer program code stored in the memory, thereby realizing the method provided in the embodiments of the present application.
[0094] The processor and the memory are connected via a bus. The processor is used to control and manage the actions of the terminal device, for example, the processor is used to support the terminal device to execute the actions executed by the terminal device in other processes described in the embodiments of the present application.
[0095] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article indicates that the associated objects before and after are in an "or" relationship.
[0096] The "plurality" appearing in the embodiments of the present application refers to two or more.
[0097] The first, second, etc. descriptions appearing in the embodiments of the present application are only used for illustration and distinction of the description objects. There is no order, nor do they indicate any special limitation on the number of devices in the embodiments of the present application, and cannot constitute any limitation on the embodiments of the present application.
[0098] The "connection" that appears in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.
[0099] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means.
[0100] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0101] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are merely schematic; for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0102] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0103] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0104] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform some steps of the method described in each embodiment of the present application.
[0105] Although the present application is disclosed as above, the present application is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application. Therefore, the protection scope of the present application shall be subject to the scope defined by the claims.
Claims
1. A process control method, characterized in that: include: Acquire first restriction information, where the first restriction information indicates a restriction condition on the first process; The state of the first process is controlled according to the restriction condition, where the state includes suspension or writing.
2. The process control method according to claim 1, characterized in that: The controlling the state of the first process according to the restriction condition comprises: In response to the first process satisfying the restriction condition, suspending the first process; Alternatively, in response to the first process not satisfying the restriction condition, the first process continues to be executed.
3. The process control method according to claim 1, characterized in that: The first restriction information includes at least one of the following: limited bandwidth, statistical window period, and limited data volume.
4. The process control method according to claim 3, characterized in that: The first process satisfies the restriction condition including that the bandwidth of the first process in the statistical window period reaches the limited bandwidth, and / or the data volume of the first process in the statistical window period reaches the limited data volume.
5. The process control method according to claim 1, characterized in that: Before obtaining the first restriction information, the method further includes: A first set of policies is created, wherein the first set of policies includes the first restriction information.
6. The process control method according to claim 5, characterized in that: The creating of the first set of policies comprises: In response to the global array in blkcg having a free entry, determining an identifier of the first group of policies; Creating a data structure of the first set of policies; The data structure is stored in the blkcg array to form a blkcg structure.
7. The process control method according to claim 6, characterized in that: The obtaining of the first restriction information includes: Obtain the css structure of the cgroup according to the first process; The blkcg structure is obtained according to the css structure, where the blkcg structure includes the first restriction information.
8. A process control device, characterized in that: include: An acquisition module, configured to acquire first restriction information, where the first restriction information indicates a restriction condition on the first process; A processing module is used to control the state of the first process according to the restriction condition, and the state includes suspension or writing.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the process control method according to any one of claims 1 to 7 are executed.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the process control method according to any one of claims 1 to 7 are implemented.
11. A terminal device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor runs the computer program, the steps of the process control method according to any one of claims 1 to 7 are performed.
