Process scheduling method and computer storage medium
By comprehensively analyzing the interaction characteristics, data dependencies, and runtime context characteristics of processes, calculating the comprehensive dependency strength index, and adjusting process scheduling parameters, the problems of high scheduling overhead and low resource utilization in traditional scheduling methods are solved, thereby improving system performance and stability.
Patent Information
- Application Number
- CN202411494905.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2044-10-24
AI Technical Summary
Traditional process scheduling methods fail to fully consider factors such as process interaction characteristics, data dependencies, and runtime context, resulting in high scheduling overhead, low resource utilization, and limited optimization effects.
By acquiring the interaction characteristic data, data dependency characteristic data, and runtime context characteristic data of the target process, we determine its characteristic dependency strength index, calculate the comprehensive dependency strength index, and adjust the process scheduling parameters to optimize scheduling.
It reduces scheduling overhead, improves resource utilization and response speed, and significantly enhances the overall performance and stability of the system.
Smart Images

Figure CN119248455B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer application, and particularly relates to a process scheduling method and a computer storage medium. BACKGROUND
[0002] In modern multitasking operating systems, process scheduling and resource management are complex and critical issues. Traditional process scheduling methods are often based on static priority and time slice allocation, which are difficult to adapt to dynamic changes in workloads and complex process dependencies.
[0003] To solve the above problems, related technologies attempt to optimize scheduling by dynamically adjusting the priority and time slice of the process. However, these methods usually only consider a single feature, such as CPU usage or memory occupancy, and fail to fully consider the interactive features, data dependencies, and running context of the process, resulting in high scheduling overhead, low resource utilization, and limited optimization effect. SUMMARY
[0004] The present application provides a process scheduling method and a computer storage medium to solve the problem of high scheduling overhead, low resource utilization, and limited optimization effect in related technologies.
[0005] According to an aspect of the present application, a process scheduling method is provided, which comprises:
[0006] Obtaining target interaction feature data, data dependency feature data, and running context feature data of a target process, respectively determining characteristic dependency strength indicators of the target interaction feature data, the data dependency feature data, and the running context feature data on the target process;
[0007] Determining a comprehensive dependency strength indicator corresponding to the target process according to the characteristic dependency strength indicators corresponding to the target interaction feature data, the data dependency feature data, and the running context feature data;
[0008] Obtaining a scheduling overhead ratio of the target process, and adjusting process scheduling parameters of the target process according to the scheduling overhead ratio and the comprehensive dependency strength indicator.
[0009] According to another aspect of the present application, a process scheduling device is provided, which comprises:
[0010] A characteristic dependency strength indicator determination module is configured to obtain target interaction feature data, data dependency feature data, and running context feature data of a target process, and respectively determine characteristic dependency strength indicators of the target interaction feature data, the data dependency feature data, and the running context feature data on the target process;
[0011] a comprehensive dependency strength index determination module configured to determine a comprehensive dependency strength index corresponding to the target process according to the feature dependency strength indexes corresponding to the target interaction feature data, the data dependency feature data and the running context feature data;
[0012] a process scheduling parameter adjustment module configured to obtain a scheduling overhead ratio of the target process, and adjust a process scheduling parameter of the target process according to the scheduling overhead ratio and the comprehensive dependency strength index.
[0013] According to another aspect of the present application, an electronic device is provided, which comprises:
[0014] at least one processor; and
[0015] a memory connected to the at least one processor in communication; wherein,
[0016] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the process scheduling method according to any one of the embodiments of the present application.
[0017] According to another aspect of the present application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to perform the process scheduling method according to any one of the embodiments of the present application when executed by the processor.
[0018] According to another aspect of the present application, a computer program product is provided, which comprises a computer program for implementing the process scheduling method according to any one of the embodiments of the present application when executed by a processor.
[0019] The technical scheme of the embodiment of the application first acquires target interaction feature data, data dependency feature data and running context feature data of a target process, respectively determines feature dependency strength indexes of the target interaction feature data, the data dependency feature data and the running context feature data on the target process, can comprehensively analyze various feature data of the target process, and accurately assess the dependency strength; then, according to the feature dependency strength indexes corresponding to the target interaction feature data, the data dependency feature data and the running context feature data, a comprehensive dependency strength index corresponding to the target process is determined, the comprehensive dependency strength index can be calculated, the comprehensive dependency strength index can comprehensively reflect various dependency relationships of the target process, and provides a data basis for optimizing scheduling parameters; finally, a scheduling overhead ratio of the target process is acquired, the process scheduling parameters of the target process are adjusted according to the scheduling overhead ratio and the comprehensive dependency strength index, the process scheduling parameters can be dynamically adjusted, the scheduling overhead is reduced, the problems of high scheduling overhead, low resource utilization and limited optimization effect of the scheduling method in the related art are solved, the resource utilization and the response speed can be improved, and therefore the overall performance and stability of the system are significantly improved.
[0020] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 is a flow chart of a process scheduling method provided by the first embodiment of the application;
[0023] Figure 2 is a flow chart of a process scheduling method provided by the second embodiment of the application;
[0024] Figure 3 is a structural schematic diagram of a process scheduling device provided by the third embodiment of the application;
[0025] Figure 4 is a structural schematic diagram of an electronic device for implementing the process scheduling method of the embodiment of the application. DETAILED DESCRIPTION
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0029] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0030] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0031] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0032] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0033] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0034] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0035] Example 1
[0036] Figure 1 The flowchart of a process scheduling method provided in Embodiment 1 of the present invention is applicable to scenarios involving complex process scheduling to optimize resource allocation and response speed. The method can be executed by a process scheduling device, which can be implemented in hardware and / or software, or optionally through an electronic device, such as a mobile terminal, a PC, or a server.
[0037] like Figure 1 As shown, the method may specifically include:
[0038] S110. Obtain target interaction feature data, data dependency feature data, and runtime context feature data of the target process, and determine the feature dependency strength index of the target interaction feature data, the data dependency feature data, and the runtime context feature data on the target process, respectively.
[0039] The target process can be understood as a program or task executing in the operating system, used to complete specific functions or services. The target interaction characteristic data can be understood as data related to the target process that reflects the interaction behavior between the target process and other processes or system components. It is understood that by analyzing the target interaction characteristic data, the interaction pattern of the target process within the operating system can be understood. The data dependency characteristic data can be understood as the degree of dependence of the target process on external data resources during execution. It is understood that by analyzing data dependency characteristic data, it is helpful to assess the stability of the process and its impact on other operating system components. The runtime context characteristic data can be understood as the environmental conditions in which the target process runs. It is understood that by analyzing runtime context characteristic data, it can be used to diagnose performance bottlenecks and optimize resource usage. The characteristic dependency strength index can be understood as an indicator used to measure the degree of influence of target interaction characteristics, data dependency characteristics, and runtime context characteristics on the target process.
[0040] Based on the above scheme, optionally, the step of obtaining target interaction feature data of the target process and determining the feature dependence strength index of the target interaction feature data on the target process includes: obtaining target interaction feature data of the target process; in the case that there is abnormal operation feature data in the target interaction feature data, determining the abnormality degree index corresponding to the abnormal operation feature data, and determining the feature dependence strength index of the target interaction feature data on the target process based on the abnormality degree index of the abnormal operation feature data.
[0041] The target interaction feature data process can be understood as feature data generated during operation when interacting with other processes, system components, or external resources. For example, the target interaction feature data may include, but is not limited to, at least one of the following interaction feature data: mouse click interval time, keyboard key press interval time, and touchscreen click intensity. The target interaction feature data may include normal operation feature data and / or abnormal operation feature data. Normal operation features can be understood as features exhibited by the target process under normal operating conditions. For example, normal operation features may include mouse click interval time, keyboard key press interval time, and touchscreen click intensity that conform to conventional operation features. Abnormal operation features, distinct from normal operation features, can be understood as features exhibited by the target process under abnormal operation conditions. For example, conventional operation features may include at least one of the following: mouse click interval time is not within a preset first time range, keyboard key press interval time is not within a preset second time range, and touchscreen click intensity is not within a preset intensity range. The first preset condition may be that the proportion of data with changes within a preset change range is greater than a preset percentage. For example, the abnormal operation characteristics may include, but are not limited to, abnormal mouse click intervals (too short or too long), abnormal keyboard key press intervals (too fast or too slow), and abnormal touchscreen click pressure (too light or too heavy). The anomaly severity index can be understood as an indicator used to measure the severity of the abnormal operation characteristics. For example, mouse click intervals significantly below the normal range, or abnormally short keyboard key press intervals, can both be considered abnormal operation characteristics. The anomaly severity index can be determined by setting a threshold; the more severe the exceedance of the threshold, the higher the index value. The feature dependency strength index can be understood as an indicator used to measure the degree of influence of target interaction feature data on the target process. Specifically, if a process is highly sensitive to a certain target interaction feature data (such as mouse click intervals, keyboard key press intervals, or touchscreen click pressure), the corresponding abnormal operation characteristic may lead to performance degradation or malfunction of the process. The feature dependency strength index can be calculated based on the anomaly severity index; the higher the anomaly severity, the higher the feature dependency strength index.
[0042] In one optional implementation, target interaction feature data of the target process is acquired, mouse click events are recorded and the interval between two adjacent clicks is calculated, and keyboard key events are recorded and the interval between two adjacent key presses is calculated. This data is stored in an interaction feature database. Based on historical data stored in the interaction feature database, the mean and standard deviation of mouse click intervals and keyboard key press intervals are calculated. The range of mean ± 2 times standard deviation is set as the normal operation threshold and stored in a threshold configuration table. The latest user operation data is read from the interaction feature database and compared with the judgment thresholds in the threshold configuration table. If a certain operation feature data exceeds the corresponding threshold range, the feature is marked as an abnormal operation feature, and the degree of abnormality (percentage deviation from the threshold) is recorded. For the marked abnormal operation features, the influence weight is adjusted according to its degree of abnormality. For every 10% increase in the degree of abnormality, the influence weight corresponding to the feature is increased by 0.1, and the adjusted weight is updated in the weight configuration table. Based on the updated weight configuration table, the feature dependency strength score of the target process is recalculated. The score is calculated by multiplying each feature value by its corresponding weight and then summing the results. The calculated result is used as the feature dependency strength index of the target process. A global hook can be set using the WinAPI function `SetWindowsHookEx` provided by the Windows system to capture mouse click and keyboard key events. When an event is captured, the event type and timestamp are recorded, such as the timestamp for a left mouse click event being 1632547890. The time difference between two adjacent events is calculated, such as an interval of 500 milliseconds between two mouse clicks and 200 milliseconds between two keyboard key presses. This data is stored in an interaction feature table in an SQLite database. Historical data analysis uses Python's pandas library to read data from the last 7 days and calculate the mean and standard deviation of mouse click and keyboard key press intervals. Assuming a mean mouse click interval of 600 milliseconds and a standard deviation of 100 milliseconds, the normal operation threshold range is 400-800 milliseconds. A mean keyboard key press interval of 250 milliseconds and a standard deviation of 50 milliseconds indicates a normal operation threshold range of 150-350 milliseconds. This threshold is written to a configuration file. Every 5 seconds, the latest 100 operation data entries are read from the database and compared with the thresholds in the configuration file. If a mouse click interval of 900 milliseconds is found, exceeding the threshold limit of 100 milliseconds, the anomaly level is recorded as 12.5%. For anomalous data, the original weight value is increased by 0.1 × 12.5% = 0.0125. Assuming the original weight was 0.5, the updated weight is 0.5125, and this is updated in the weight configuration table. The latest values and weights of all features are read and weighted summed.If the feature value of the mouse click interval time is 900 and the weight is 0.5125, and the feature value of the keyboard key press interval time is 300 and the weight is 0.4, then the dependency strength score is 900×0.5125+300×0.4=581.25. This score is used as the feature dependency strength index of the process for subsequent anomaly detection and processing.
[0043] The above solution, by acquiring target interaction feature data of the target process, identifies and evaluates the degree of abnormality of abnormal operation features, thereby determining the feature dependence strength index of the target interaction feature data on the target process. This enables timely detection and handling of abnormal interaction operations, optimization of process scheduling parameters, reduction of system overhead, improvement of response speed and resource utilization, and ensures system stability and performance.
[0044] Based on the above scheme, optionally, the step of acquiring data dependency feature data of the target process and determining the feature dependency strength index of the data dependency feature data on the target process includes: acquiring data dependency feature data of multiple data processing nodes in the target process; marking the data processing node as an abnormal processing node when the data processing node is located on the data dependency critical path and the data arrival time interval of the data processing node is greater than or equal to a preset time interval threshold; determining the node abnormality degree corresponding to the abnormal processing node, and determining the node influence weight corresponding to the abnormal processing node based on the position of the abnormal processing node in the data dependency critical path and the node abnormality degree; and determining the feature dependency strength index of the data dependency feature data on the target process based on the node influence weight corresponding to the abnormal processing node in the target process.
[0045] In this context, a data processing node can be understood as a component or module within the target process responsible for processing data and performing specific data processing tasks. For example, these tasks may include, but are not limited to, data reading, computation, transformation, and storage. It is understood that corresponding data dependency characteristic data can be obtained from the data processing nodes. This data dependency characteristic data includes the data arrival time interval and the data dependency critical path. The data arrival time interval can be understood as the time difference between data transmission from one data processing node to the next, reflecting the transmission efficiency between different nodes. The data dependency critical path can be understood as the path of data through key nodes in the processing flow; these key nodes have the greatest impact on the performance of the entire data processing process. Delays on the data dependency critical path directly affect processing time. The preset time interval threshold can be understood as a pre-set time value used to determine whether the data arrival time interval is normal. It is understood that if the actual data arrival time interval is greater than or equal to the time interval, the data processing node may be abnormal, and this data processing node is marked as an abnormal processing node. The abnormal processing node reflects problems with the processing speed or data transmission efficiency of the data processing node. The node anomaly degree can be understood as a quantitative indicator used to measure the severity of anomalies in anomaly handling nodes, and can be determined by calculating the difference between the actual data arrival time interval and a preset time interval threshold. The node influence weight can be understood as a measure of the impact of anomaly handling nodes on the entire data processing flow. For example, the earlier the anomaly handling node is on the critical path of data dependency, the greater its impact on subsequent nodes. The feature dependency strength index can be used to measure the impact of data dependency features on the target process. Specifically, by analyzing the node influence weights of all anomaly handling nodes, the feature dependency strength index of the entire data dependency features on the target process is determined; the higher the feature dependency strength index, the greater the impact of the data dependency features on the target process.
[0046] In one optional implementation, the data arrival timestamps of each data processing node in the target process are obtained, the data arrival time interval between two adjacent data arrivals is calculated, and the data arrival time interval is stored in a time series database. Data dependencies are identified using a dependency graph construction tool, and the dependency information is saved to a dependency database. Based on the most recent 1000 data points stored in the time series database, the mean and standard deviation of the data arrival time intervals are calculated using a sliding window method. The range of mean ± 3 times the standard deviation is set as the normal time interval threshold, which is the preset time interval threshold, and this threshold information is written to a configuration file. The latest data arrival time interval data is read from the time series database and compared with the preset time interval threshold in the configuration file. If the time interval of a data processing node is not less than the corresponding time interval threshold, it is marked as an anomalous processing node. The node dependencies in the dependency database are analyzed using a topological sorting algorithm to determine the critical path of data dependency. For data processing nodes marked as anomalous and located on the critical path of data dependency, their anomalousness degree (percentage exceeding the threshold) is calculated. Based on the node's position and anomalousness degree on the critical path of data dependency, a new node influence weight is calculated using linear interpolation, with nodes located at the beginning of the critical path receiving a larger weight increase. The updated weight values are written to the weight configuration table. Taking into account the updated weights of all abnormal nodes, a weighted average method is used to recalculate the feature dependency strength index of the entire target process. A higher score indicates a higher sensitivity of the target process to abnormal data dependencies. The distributed log collector Fluentd is used, with an agent deployed on each data processing node to collect data arrival timestamps. The timestamps are accurate to milliseconds, such as 1632547890123. The calculated time intervals are stored in the InfluxDB time series database. The dependency graph construction tool uses Apache Airflow's task dependency analysis function to generate a DAG graph, identifying data flow directions and critical paths. Dependencies are stored in the Neo4j graph database. The sliding window method uses Python's pandas library, setting the window size to 1000 and the step size to 1, to calculate the moving average and standard deviation. Assuming the mean time interval of a node is 500 milliseconds and the standard deviation is 100 milliseconds, the normal threshold range is 200-800 milliseconds. The threshold information is written to the Redis configuration center. The system reads the latest 100 time interval data entries from InfluxDB every second and compares them with a threshold in Redis. If a node's data arrival time interval is found to be 900 milliseconds, exceeding the threshold limit by 100 milliseconds, the node's anomaly level is recorded as 12.5%. The topology sorting algorithm uses the Kahn algorithm to read dependencies from Neo4j and determine the critical path.The new weights are calculated using linear interpolation. Assuming the original weight is 0.5, the node is located at the start of the critical path, and its anomaly level is 12.5%, the updated node influence weight is 0.5 + (1 - 0.5) * 0.125 * (1 - 0.5) = 0.53125. The updated node influence weights are written to the weight configuration index in Elasticsearch. Finally, MapReduce is used to calculate a weighted average of the weights of all nodes in Elasticsearch to obtain the feature dependency strength index score of the target process. For example, a score of 0.75 indicates that the process has a high sensitivity to anomalous data dependencies.
[0047] The above solution obtains the data dependency feature data of the target process, identifies and marks the abnormal handling nodes located on the critical path of data dependency, evaluates the degree of node abnormality and the influence weight of the node, and thus determines the feature dependency strength index of the data dependency feature on the target process. This enables precise location and processing of data, optimization of process scheduling parameters, reduction of data processing latency, and improvement of overall system performance and stability.
[0048] Based on the above scheme, optionally, the step of obtaining the runtime context feature data of the target process and determining the feature dependency strength index of the runtime context feature data on the target process includes: obtaining the runtime context feature data of the target process; determining the joint probability distribution of the key resource occupancy duration distribution and the key function call frequency distribution of the target process, and determining the Mahalanobis distance between the joint probability distribution corresponding to the target process and the benchmark model; and determining the feature dependency strength index of the runtime context feature data on the target process when the Mahalanobis distance is greater than a preset distance threshold.
[0049] The runtime context feature data can be understood as feature data related to the target process's runtime environment during operation. For example, the runtime context feature data may include, but is not limited to, the distribution of critical resource usage time and the distribution of critical function call frequency. The critical resource usage time distribution can be understood as the time distribution of the target process's use of critical resources (such as CPU, memory, and disk I / O) during operation. For example, the critical resource usage time distribution can be determined by the length of time the target process uses the CPU in different time periods. The critical function call frequency distribution can be understood as the frequency distribution of the target process's calls to critical functions (such as system calls or library functions) during operation. For example, the critical function call frequency distribution can be determined by recording the number of times the process calls a certain critical function in different time periods. The joint probability distribution can be understood as the probability distribution of the co-occurrence of the critical resource usage time and the critical function call frequency in the target process. The benchmark model can be understood as a model built based on a known normal or expected reference process. The benchmark model is the joint probability distribution of the critical resource usage time and the critical function call frequency corresponding to the reference process. The Mahalanobis distance can be understood as an indicator used to measure the difference between the joint probability distribution of the target process and the baseline model. The preset distance threshold can be understood as a metric used to determine whether the Mahalanobis distance exceeds the normal range. For example, if the Mahalanobis distance is greater than the preset distance threshold, it is determined that the runtime context features of the target process differ significantly from the baseline model, and an anomaly may exist. The feature dependency strength index can be used to measure the degree of influence of runtime context feature data on the target process. Specifically, if the Mahalanobis distance is greater than the preset distance threshold, the runtime context features have a greater influence on the target process, and the feature dependency strength index will also be higher.
[0050] In one optional implementation, the runtime context feature data of the target process is acquired, recording the occupancy time of key resources (such as CPU, memory, and disk I / O). Simultaneously, counters are inserted at the entry and exit points of key functions using binary interpolation to obtain the distribution of key resource occupancy time and capture the distribution of key function call frequencies. This data is stored in a time-series database. Based on the historical data stored in the time-series database, a multidimensional kernel density estimation algorithm is used to calculate the joint probability distribution of key resource occupancy time and key function call frequencies. This joint probability distribution is used as the baseline model for the normal runtime context and saved to a feature vector database. The latest runtime context feature data is read from the feature vector database, and its Mahalanobis distance to the baseline model is calculated. If the Mahalanobis distance exceeds a preset distance threshold, the runtime context at that time point is marked as an abnormal state. For runtime contexts marked as abnormal, new influence weights are calculated based on their Mahalanobis distance value and a preset sigmoid weight adjustment function. The sigmoid function ensures smooth weight changes with upper and lower limits. The updated weight values are written to a weight configuration table. Taking into account the updated weights of all anomaly features, a weighted average method is used to recalculate the feature dependency strength index of the entire process. A higher score indicates a higher sensitivity of the process to abnormal runtime contexts. Mahalanobis distance is calculated using linear algebra functions from the NumPy library, with a preset threshold of 3.0. The Sigmoid weight adjustment function is f(x) = 1 / (1 + e^(-0.1*(x-3))), where x is the Mahalanobis distance value. The weight configuration table is stored in MySQL, creating a table structure containing feature names, original weights, and adjusted weights. The weighted average calculation uses the NumPy dot() function, multiplying the feature vector and weight vector to obtain the final score. The process is scheduled by Airflow, triggering a DAG every minute for automated operation. Anomaly detection results are pushed to the Prometheus gateway to send alerts, integrated into the detection system. Finally, the feature dependency strength index score is provided to upper-layer applications via a RESTful API implemented using the Flask framework, returning JSON data including timestamps, scores, and key anomaly features.
[0051] The above scheme obtains the runtime context feature data of the target process, calculates the joint probability distribution of its key resource usage time distribution and key function call frequency distribution, and compares it with the benchmark model to determine the Mahalanobis distance. When the Mahalanobis distance is greater than a preset distance threshold, it evaluates the impact of runtime context features on the target process, thereby accurately adjusting process scheduling parameters, reducing scheduling overhead, improving resource utilization and response speed, and ensuring system stability and performance optimization.
[0052] S120. Determine the comprehensive dependency strength index corresponding to the target process based on the feature dependency strength index corresponding to the target interaction feature data, the data dependency feature data, and the runtime context feature data.
[0053] The comprehensive dependency strength index can be understood as an indicator used to measure the overall impact of target interaction feature data, data dependency feature data, and runtime context feature data on the target process. The comprehensive dependency strength index is calculated by integrating various feature dependency strength indices, and can more comprehensively reflect the dependency relationships and performance status of the target process.
[0054] S130. Obtain the scheduling overhead ratio of the target process, and adjust the process scheduling parameters of the target process according to the scheduling overhead ratio and the comprehensive dependency strength index.
[0055] The scheduling overhead ratio can be understood as the proportion of time and resources consumed by the operating system when scheduling the target process to the total execution time. The scheduling overhead ratio can be determined based on factors such as average context switch time, number of context switches, and input / output wait time. It is understood that the higher the scheduling overhead ratio, the greater the impact of scheduling on process performance. The process scheduling parameters can be understood as parameters used by the operating system to control and manage process scheduling. These process scheduling parameters may include, but are not limited to, process priority, time slice length, process scheduling frequency, and time slice length.
[0056] Based on the above scheme, optionally, obtaining the scheduling overhead ratio of the target process includes: determining the number of context switches and the running time of the target process based on the input / output operations of the target process, and determining the average context switch time of the target process based on the number of context switches and the running time; multiplying the number of context switches by the average context switch time plus the waiting time of the input / output operations, and then dividing by the total running time of the target process to obtain the scheduling overhead ratio of the target process.
[0057] Input / output (I / O) operations can be understood as the input and output operations performed by the target process during its execution, such as reading files, writing files, or network communication. These operations typically involve interaction with external devices and may cause the process to block or wait. Context switching can be understood as the process by which the operating system switches the CPU from one process to another; each switch consumes certain operating system resources. The number of context switches can be understood as the number of times the target process switches contexts with other processes during its execution. The average context switch time can be understood as the average time consumed by each context switch, which can be determined by dividing the total context switch time by the number of context switches.
[0058] In one optional implementation, the `sar` command from the `sysstat` toolkit is used to obtain information on the target process's average CPU load, average memory usage, I / O scheduling counts, and resource utilization. Simultaneously, the `strace` tool is used to trace the target process's I / O operations, recording context switch counts and runtime. This data is stored in a performance metrics database. Based on historical data from the past 24 hours stored in the performance metrics database, a simple moving average algorithm is used to calculate the average values of each metric, and the results are stored as baseline values in a baseline configuration table. The latest system status data is read from the performance metrics database, and the scheduling overhead ratio of the current process is calculated as follows: Scheduling overhead ratio = (Context switch count * Average switch time + I / O wait time) / Total runtime.
[0059] The above approach can more accurately assess the scheduling overhead ratio of the target process, thereby providing a basis for optimizing process scheduling parameters and improving operating system performance.
[0060] Based on the above scheme, the process scheduling method may optionally further include: reducing the scheduling frequency of the target process when the scheduling overhead ratio of the target process is higher than a preset overhead threshold, and adjusting the time slice length of the target process through a backoff algorithm.
[0061] The preset overhead threshold can be understood as a threshold set to determine whether the scheduling overhead ratio exceeds the normal range. For example, if the scheduling overhead ratio is greater than the preset overhead threshold, it indicates that the process's scheduling overhead is too high and optimization may be necessary. Optimization methods include, but are not limited to, reducing the scheduling frequency of the target process and adjusting the time slice length of the target process through a backoff algorithm. The scheduling frequency can be understood as the frequency at which the target process is scheduled for execution. It is understood that a high scheduling frequency means that the target process is frequently scheduled, increasing the overhead of context switching. The backoff algorithm can be understood as an algorithm used to adjust the process time slice length. Specifically, the backoff algorithm can reduce conflicts and improve resource utilization by dynamically adjusting the time slice length. In process scheduling, the backoff algorithm can dynamically adjust the time slice length based on the process's current state and historical performance, thereby optimizing scheduling performance. The time slice length can be understood as the CPU execution time allocated to each target process by the operating system. For example, the shorter the time slice length, the higher the frequency of target process switching, but the shorter the execution time of each target process.
[0062] In one optional implementation, the calculated scheduling overhead ratio is compared with a preset threshold (e.g., 20%), while simultaneously checking whether the number of I / O scheduling operations exceeds a preset threshold (e.g., 1000 times per second). If either condition is met, the current process is determined to have excessive scheduling overhead, and the determination result is written to the scheduling exception log. For processes determined to have excessive scheduling overhead, detailed performance metrics, including CPU utilization, memory utilization, I / O operation type and frequency, are recorded and stored in a performance analysis database. For identified high-overhead processes, a token bucket algorithm is used to limit their scheduling frequency, while a backoff algorithm is used to dynamically adjust their time slice length, achieving precise control over high-overhead processes.
[0063] The above technical solution reduces scheduling overhead by lowering the scheduling frequency and adjusting the time slice length, thereby improving the execution efficiency of the target process and the overall performance of the operating system.
[0064] The technical solution of this invention firstly acquires target interaction feature data, data dependency feature data, and runtime context feature data of a target process, and determines the feature dependency strength index of the target interaction feature data, data dependency feature data, and runtime context feature data on the target process, respectively. This allows for comprehensive analysis of multiple feature data of the target process and accurate assessment of its dependency strength. Next, based on the feature dependency strength index corresponding to the target interaction feature data, data dependency feature data, and runtime context feature data, a comprehensive dependency strength index corresponding to the target process is determined. This comprehensive dependency strength index comprehensively reflects the multifaceted dependencies of the target process, providing a data foundation for optimizing scheduling parameters. Finally, the scheduling overhead ratio of the target process is acquired, and the process scheduling parameters of the target process are adjusted based on the scheduling overhead ratio and the comprehensive dependency strength index. By dynamically adjusting the process scheduling parameters, scheduling overhead is reduced, solving the problems of high scheduling overhead, low resource utilization, and limited optimization effect in related technologies. This improves resource utilization and response speed, thereby significantly enhancing the overall performance and stability of the system.
[0065] Example 2
[0066] Figure 2This is a flowchart of a process scheduling method provided in Embodiment 2 of the present invention. This embodiment further refines how to adjust the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index, building upon the previous embodiment. Optionally, the step of adjusting the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index includes: adjusting the process priority and time slice allocation ratio of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index, and updating the process scheduling parameters of the target process based on the adjusted process priority and time slice allocation ratio. The process scheduling parameters include at least one of process priority, time slice length, process scheduling frequency, and time slice length. Detailed implementation can be found in the description of this embodiment. Technical features that are the same as or similar to those in the foregoing embodiments will not be repeated here.
[0067] like Figure 2 As shown, the method may specifically include:
[0068] S210. Obtain target interaction feature data, data dependency feature data, and runtime context feature data of the target process, and determine the feature dependency strength index of the target interaction feature data, the data dependency feature data, and the runtime context feature data on the target process, respectively.
[0069] S220. Determine the comprehensive dependency strength index corresponding to the target process based on the feature dependency strength index corresponding to the target interaction feature data, the data dependency feature data, and the runtime context feature data.
[0070] S230. Obtain the scheduling overhead ratio of the target process, adjust the process priority and time slice allocation ratio of the target process according to the scheduling overhead ratio and the comprehensive dependency strength index, and update the process scheduling parameters of the target process according to the adjusted process priority and time slice allocation ratio.
[0071] The process priority can be understood as the priority assigned to processes by the operating system during scheduling, used to characterize the scheduling order of the target processes. It is understood that processes with higher priority will be scheduled for execution first. Specifically, adjusting process priorities can affect the scheduling order and frequency of target processes. The time slice allocation ratio can be understood as the proportion of CPU execution time allocated by the operating system to each target process. It is understood that the time slice allocation ratio determines the CPU time that the target process can obtain within a scheduling cycle. Specifically, adjusting the time slice allocation ratio can affect the execution efficiency and response time of the target process. The process scheduling parameters can be understood as parameters used by the operating system to control and manage process scheduling. The process scheduling parameters may include, but are not limited to, process priority, time slice length, process scheduling frequency, and time slice length.
[0072] Based on the above scheme, optionally, adjusting the process priority and time slice allocation ratio of the target process according to the scheduling overhead ratio and the comprehensive dependency strength index includes: determining the changing trend of the comprehensive dependency strength index using a time window method based on the scheduling overhead ratio and the comprehensive dependency strength value; determining the placement position of the target process in the scheduling queue based on the growth rate of the comprehensive dependency strength index when the comprehensive dependency strength index exceeds a preset strength index threshold; determining the time slice length of the target process using an exponential backoff algorithm based on the placement position of the target process, and updating the time slice allocation table corresponding to the target process based on the time slice length; and updating the scheduling queue using a red-black tree data structure to obtain the adjusted process priority and time slice length corresponding to the target process.
[0073] The time window method can be understood as a data analysis method used to determine the changing trend of the comprehensive dependency intensity index. The changing trend refers to how the comprehensive dependency intensity index changes over time. This trend may include, but is not limited to, an increasing trend. The preset intensity index threshold can be understood as a pre-set threshold used to determine whether the comprehensive dependency intensity index exceeds the normal range. For example, if the comprehensive dependency intensity index exceeds the preset threshold, it is determined that the target process has a high dependency level and may require optimization. The growth rate can be understood as the increase in the comprehensive dependency intensity index within a certain time window. For example, a larger growth rate indicates a faster increase in the dependency level of the target process. The placement position can be understood as the position of the target process in the scheduling queue. Specifically, the placement position of the target process in the scheduling queue can be determined based on the growth rate of the comprehensive dependency intensity index. The exponential backoff algorithm can be understood as an algorithm used to adjust the time slice length. The time slice length can be understood as the CPU execution time allocated to each target process by the operating system. The time slice allocation table can be understood as a data structure used to record the time slice length of each process. The time slice allocation of the target process can be dynamically adjusted by updating the time slice allocation table. The red-black tree data structure can be understood as a self-balancing binary search tree used to implement efficient insertion, deletion, and search operations. It can be used to update the scheduling queue and ensure the efficient management and maintenance of the scheduling queue.
[0074] One optional implementation involves retrieving the scheduling overhead ratio and overall dependency strength of the current process from a performance monitoring database, and reading a preset strength index threshold from the target process configuration file. A time window method is used to calculate the trend of the overall dependency strength, determining whether it simultaneously exceeds the preset strength index threshold and shows an increasing trend. If the determination is true, a multi-level feedback queue algorithm based on a priority queue is activated. The process's position in the queue is dynamically adjusted according to the increase in overall dependency strength, and the adjustment result is written to the process control block. Based on the new position, the time slice length of the process is recalculated using an exponential backoff algorithm. Considering the process's historical behavior and current system load, the scheduler's time slice allocation table is updated. A red-black tree data structure is used to reorganize the queue, ensuring that the time complexity of the scheduling operation is O(logn). The updated process priority and time slice length are applied to the next scheduling cycle, and the adjustment result is recorded in the target process log. This implements a feedback control loop, periodically evaluating the effectiveness of the scheduling strategy, automatically fine-tuning relevant parameters based on performance indicators, and optimizing overall scheduling performance. Specifically, the InfluxDB performance monitoring database records that process ID 1234 has a scheduling overhead ratio of 0.25 and an overall dependency strength of 0.8. The system configuration file has preset thresholds of 0.2 and 0.7. Using data from the past 10 minutes, the time window method calculates an overall dependency strength growth rate of 5% per minute. A multi-level feedback queue algorithm demotes the process from level 2 to level 3, reducing its priority from 50 to 40. The exponential backoff algorithm, based on the new priority and a historical CPU utilization of 80%, reduces the time slice from 100ms to 75ms. A red-black tree, using process priority as the key and process control block pointer as the value, reorganizes the ready queue containing 1000 processes, with an insertion operation taking 0.5ms. The system log records the adjustment time as 2023-06-01, 14:30:00, along with the process ID, new priority, and time slice information. The feedback control loop executes every 5 minutes, monitoring metrics such as CPU utilization and average response time. If CPU utilization exceeds 90%, the number of stages in the multi-level feedback queue is increased from 3 to 4, and the time slice base is reduced from 50ms to 40ms. These parameters are stored in Redis with the key "scheduler_params". The entire scheduling process is implemented by the Linux kernel's Completely Fair Scheduler (CFS) scheduler, which dynamically adjusts the scheduling policy by modifying relevant files in / proc / sys / kernel / sched_*. The adjustment results are recorded as kernel scheduling events using the ftrace tool for subsequent analysis and optimization.
[0075] The above scheme, by employing the time window method and the exponential backoff algorithm, dynamically adjusts the priority and time slice length of the target process, which can effectively cope with the increasing trend of the comprehensive dependency strength index, reduce scheduling overhead, improve the execution efficiency and response speed of the target process, thereby optimizing the overall performance of the operating system. Furthermore, the use of a red-black tree data structure to update the scheduling queue ensures the efficiency and stability of scheduling.
[0076] Based on the above scheme, optionally, updating the process scheduling parameters of the target process according to the adjusted process priority and the time slice allocation ratio includes: obtaining the resource usage information of the target process; using a multi-objective optimization algorithm to obtain the process scheduling frequency and time slice length of the target process based on the adjusted process priority, the time slice allocation ratio, and the resource usage information; generating a process scheduling sequence that satisfies the inter-process dependency relationship using an ant colony algorithm for the process scheduling frequency and the time slice length; and updating the process scheduling parameters of the target process according to the scheduling sequence.
[0077] The resource usage information can be understood as information about the actual consumption of computing resources (such as CPU utilization or memory usage) in the target process, which can be used to assess the resource requirements of the target process and optimize process scheduling strategies. For example, the resource usage information may include, but is not limited to, processor utilization and memory usage. The multi-objective optimization algorithm can be understood as an algorithm used when there are multiple conflicting target processes in the problem, aiming to find a solution that allows all target processes to reach the optimal solution as much as possible. The ant colony algorithm can be understood as a heuristic search algorithm that simulates the behavior of an ant colony searching for food paths. In this embodiment, the ant colony algorithm is used to generate a process scheduling sequence that satisfies inter-process dependencies, i.e., how to reasonably arrange the execution order of each process to achieve the best operating efficiency of the entire system.
[0078] In one optional implementation, the adjusted target process priority and time slice allocation ratio are read, and the process resource usage, including CPU utilization and memory usage, is obtained using the Linux kernel's cgroup mechanism. This data is then input into the scheduling parameter calculation module. NSGA-II (Non-Dominated Sorting Genetic Algorithm II) is used for multi-objective optimization, with objective functions including minimizing response time and maximizing resource utilization. The new target process's scheduling frequency and time slice length are calculated, and the results are stored in the scheduling parameter cache. Based on the data in the scheduling parameter cache, an ant colony algorithm is used to generate an approximately optimal process scheduling sequence, while considering inter-process dependencies to ensure that process dependency strength constraints are met. The generated scheduling sequence is applied to the scheduler to update the process scheduling parameters, including priority, time slice length, and scheduling interval. Simultaneously, the Linux kernel's perf subsystem is used to monitor the performance counters of high-overhead processes in real time, such as cache miss rate and context switch count. For identified high-overhead processes, a token bucket algorithm is used to limit their scheduling frequency, while a backoff algorithm is used to dynamically adjust their time slice length, achieving precise control over high-overhead processes. Specifically, the cgroup mechanism, through the ` / sys / fs / cgroup / cpu` interface, obtains that process ID 1234 has a CPU utilization of 80% and a memory usage of 2GB. The process control block shows its priority as 10 and its time slice as 10ms. The NSGA-II algorithm uses 100 individuals, evolves for 50 generations, with a crossover probability of 0.9 and a mutation probability of 0.1, to obtain the Pareto optimal solution set. The solution that reduces response time by 20% and improves resource utilization by 15% is selected, reducing the scheduling frequency from 100 times per second to 80 times per second and increasing the time slice length from 10ms to 12ms. The ant colony algorithm uses 20 ants, iterates 100 times, and has a pheromone evaporation coefficient of 0.5, obtaining a near-optimal scheduling sequence. The perf subsystem detects that the process has a cache miss rate of 5% and context switches of 1000 times per second. The token bucket algorithm sets the bucket capacity to 10, the token generation rate to 5 per second, and limits the maximum scheduling frequency of high-overhead processes to 50 times per second. The backoff algorithm initially sets the time slice to 12ms, increasing by 25% for each unfinished task, up to a maximum of 20ms. Ultimately, the process scheduling parameters are updated to priority 12, time slice 15ms, and scheduling interval 20ms. This is executed by the Linux kernel's Completely Fair Scheduler (CFS), which dynamically adjusts the scheduling policy by modifying relevant files in ` / proc / sys / kernel / sched_*`. The adjustments are recorded as kernel scheduling events using the `ftrace` tool for subsequent analysis and optimization.
[0079] The above scheme, by dynamically adjusting process priority and time slice allocation ratio, and combining multi-objective optimization algorithm and ant colony algorithm, can generate an efficient process scheduling sequence, thereby effectively improving system resource utilization and process response speed.
[0080] The technical solution of this invention uses a time window method to determine the changing trend of the comprehensive dependency strength index. When the index exceeds a preset strength index threshold and shows an increasing trend, the arrangement position of the process in the scheduling queue is adjusted according to the growth rate. The time slice length is determined using an exponential backoff algorithm, and the scheduling queue is updated using a red-black tree data structure. Furthermore, combined with the resource usage information of the target process, a multi-objective optimization algorithm and an ant colony algorithm are used to generate a scheduling sequence that satisfies the inter-process dependency relationship and update the process scheduling parameters. This can effectively reduce scheduling overhead, improve resource utilization and response speed, and significantly improve the overall performance and stability of the system.
[0081] Example 3
[0082] Figure 3 This is a schematic diagram of a process scheduling device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a feature dependency strength index determination module 310, a comprehensive dependency strength index determination module 320, and a process scheduling parameter adjustment module 330.
[0083] The feature dependency strength index determination module 310 is used to acquire target interaction feature data, data dependency feature data, and runtime context feature data of the target process, and determine the feature dependency strength index of the target interaction feature data, the data dependency feature data, and the runtime context feature data to the target process, respectively; the comprehensive dependency strength index determination module 320 is used to determine the comprehensive dependency strength index corresponding to the target process based on the feature dependency strength index corresponding to the target interaction feature data, the data dependency feature data, and the runtime context feature data; and the process scheduling parameter adjustment module 330 is used to acquire the scheduling overhead ratio of the target process and adjust the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index.
[0084] The technical solution of this invention firstly involves obtaining target interaction feature data, data dependency feature data, and runtime context feature data of a target process through a feature dependency strength index determination module 310. The module then determines the feature dependency strength index of the target interaction feature data, data dependency feature data, and runtime context feature data on the target process, enabling comprehensive analysis of various feature data of the target process and accurate assessment of its dependency strength. Next, a comprehensive dependency strength index determination module 320 determines a comprehensive dependency strength index corresponding to the target process based on the feature dependency strength indices corresponding to the target interaction feature data, data dependency feature data, and runtime context feature data. This comprehensive dependency strength index comprehensively reflects the multifaceted dependencies of the target process, providing a data foundation for optimizing scheduling parameters. Finally, a process scheduling parameter adjustment module 330 obtains the scheduling overhead ratio of the target process and adjusts the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index. This dynamic adjustment of process scheduling parameters reduces scheduling overhead, solving the problems of high scheduling overhead, low resource utilization, and limited optimization effects in related technologies. It improves resource utilization and response speed, thereby significantly enhancing the overall performance and stability of the system.
[0085] Based on the above scheme, optionally, the feature dependency strength index determination module includes: a first feature dependency strength index determination submodule. The first feature dependency strength index determination submodule is used to acquire target interaction feature data of the target process, wherein the target interaction feature data includes at least one of mouse click interval time, keyboard key press interval time, and touchscreen click force; if abnormal operation feature data exists in the target interaction feature data, it determines an anomaly degree index corresponding to the abnormal operation feature data, and determines the feature dependency strength index of the target interaction feature data on the target process based on the anomaly degree index of the abnormal operation feature data.
[0086] Based on the above scheme, optionally, the feature dependency strength index determination module includes: a second feature dependency strength index determination submodule. The second feature dependency strength index determination submodule is used to acquire data dependency feature data of multiple data processing nodes in the target process, wherein the data dependency feature data includes data arrival time intervals and data dependency critical paths; when a data processing node is located on the data dependency critical path and the data arrival time interval of the data processing node is greater than or equal to a preset time interval threshold, the data processing node is marked as an anomalous processing node; the node anomalousness degree corresponding to the anomalous processing node is determined, and the node influence weight corresponding to the anomalous processing node is determined based on the position of the anomalous processing node in the data dependency critical path and the node anomalousness degree; the feature dependency strength index of the data dependency feature data on the target process is determined based on the node influence weight corresponding to the anomalous processing node in the target process.
[0087] Based on the above scheme, optionally, the feature dependency strength index determination module includes: a third feature dependency strength index determination submodule. The third feature dependency strength index determination submodule is used to acquire runtime context feature data of the target process, wherein the runtime context feature data includes the distribution of critical resource usage time and the distribution of critical function call frequency; determine the joint probability distribution of the critical resource usage time distribution and the critical function call frequency distribution of the target process, and determine the Mahalanobis distance between the joint probability distribution corresponding to the target process and the benchmark model; wherein the benchmark model is the joint probability distribution of the critical resource usage time and the critical function call frequency corresponding to the reference process; and, if the Mahalanobis distance is greater than a preset distance threshold, determine the feature dependency strength index of the runtime context feature data on the target process.
[0088] Based on the above scheme, optionally, the process scheduling parameter adjustment module includes: a context average switch time determination submodule and a scheduling overhead ratio determination submodule. The context average switch time determination submodule is used to determine the number of context switches and the running time of the target process based on the input / output operations of the target process, and to determine the context average switch time of the target process based on the number of context switches and the running time. The scheduling overhead ratio determination submodule is used to multiply the number of context switches by the context average switch time plus the waiting time of the input / output operations, and then divide by the total running time of the target process to obtain the scheduling overhead ratio of the target process.
[0089] Based on the above scheme, optionally, the process scheduling parameter adjustment module includes a process scheduling parameter update submodule. The process scheduling parameter update submodule is used to adjust the process priority and time slice allocation ratio of the target process according to the scheduling overhead ratio and the comprehensive dependency strength index, and to update the process scheduling parameters of the target process according to the adjusted process priority and time slice allocation ratio. The process scheduling parameters include at least one of process priority, time slice length, process scheduling frequency, and time slice length.
[0090] Based on the above scheme, optionally, the process scheduling parameter update submodule includes: a trend determination unit, a placement position determination unit, a time slice allocation table update unit, and a scheduling queue update unit. Specifically, the trend determination unit is used to determine the trend of the comprehensive dependency intensity index using a time window method based on the scheduling overhead ratio and the comprehensive dependency intensity value, wherein the trend includes an increasing trend; the placement position determination unit is used to determine the placement position of the target process in the scheduling queue based on the growth rate of the comprehensive dependency intensity index when the comprehensive dependency intensity index exceeds a preset intensity index threshold and shows the increasing trend; the time slice allocation table update unit is used to determine the time slice length of the target process using an exponential backoff algorithm based on the placement position of the target process, and update the time slice allocation table corresponding to the target process according to the time slice length; the scheduling queue update unit is used to update the scheduling queue using a red-black tree data structure to obtain the adjusted process priority and time slice length corresponding to the target process.
[0091] Based on the above scheme, optionally, the process scheduling parameter update submodule includes: a time slice length determination unit and a process scheduling parameter update unit. The time slice length determination unit is used to obtain the resource usage information of the target process, and, based on the adjusted process priority, the time slice allocation ratio, and the resource usage information, uses a multi-objective optimization algorithm to obtain the process scheduling frequency and time slice length of the target process; wherein the resource usage information includes processor utilization and memory usage; the process scheduling parameter update unit is used to generate a process scheduling sequence that satisfies inter-process dependencies using an ant colony algorithm based on the process scheduling frequency and the time slice length, and update the process scheduling parameters of the target process according to the scheduling sequence.
[0092] Based on the above scheme, optionally, the process scheduling device further includes a time slice length adjustment module. The time slice length adjustment module is used to reduce the scheduling frequency of the target process when the scheduling overhead ratio of the target process is higher than a preset overhead threshold, and to adjust the time slice length of the target process using a backoff algorithm.
[0093] The process scheduling device provided in the embodiments of the present invention can execute the process scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0094] Example 4
[0095] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0096] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0097] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0098] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a schedule method.
[0099] In some embodiments, a schedule scheduling method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the schedule scheduling method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform a schedule scheduling method by any other suitable means (e.g., by means of firmware).
[0100] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0102] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0104] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0105] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0106] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0107] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A process scheduling method, characterized in that, include: Obtain target interaction feature data, data dependency feature data, and runtime context feature data of the target process, and determine the feature dependency strength index of the target interaction feature data, the data dependency feature data, and the runtime context feature data on the target process, respectively. Based on the feature dependency strength index corresponding to the target process, the target interaction feature data, the data dependency feature data, and the runtime context feature data, a comprehensive dependency strength index corresponding to the target process is determined. Obtain the scheduling overhead ratio of the target process, and adjust the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index; The step of acquiring target interaction feature data of the target process and determining the feature dependency strength index of the target interaction feature data on the target process includes: Acquire target interaction feature data of the target process, wherein the target interaction feature data includes at least one of mouse click interval time, keyboard key interval time and touch screen click force; In the case that there is abnormal operation feature data in the target interaction feature data, an abnormality degree index corresponding to the abnormal operation feature data is determined, and a feature dependency strength index of the target interaction feature data on the target process is determined based on the abnormality degree index of the abnormal operation feature data. The step of acquiring data dependency feature data of the target process and determining the feature dependency strength index of the data dependency feature data on the target process includes: Obtain data dependency feature data of multiple data processing nodes in the target process, wherein the data dependency feature data includes data arrival time interval and data dependency critical path; If the data processing node is located on the data-dependent critical path and the data arrival time interval of the data processing node is greater than or equal to a preset time interval threshold, the data processing node is marked as an abnormal processing node. Determine the degree of node anomaly corresponding to the anomaly handling node, and determine the node influence weight corresponding to the anomaly handling node based on the position of the anomaly handling node in the data dependency critical path and the degree of node anomaly. The feature dependency strength index of the data dependency feature data on the target process is determined based on the node influence weight corresponding to the anomaly handling node in the target process. The step of obtaining the runtime context feature data of the target process and determining the feature dependency strength index of the runtime context feature data on the target process includes: Obtain the runtime context feature data of the target process, wherein the runtime context feature data includes the distribution of key resource usage time and the distribution of key function call frequency; Determine the joint probability distribution of the critical resource usage duration distribution and the critical function call frequency distribution of the target process, and determine the Mahalanobis distance between the joint probability distribution corresponding to the target process and the benchmark model; wherein, the benchmark model is the joint probability distribution of the critical resource usage duration and the critical function call frequency corresponding to the reference process; If the Mahalanobis distance is greater than a preset distance threshold, determine the feature dependency strength index of the runtime context feature data on the target process; The step of obtaining the scheduling overhead ratio of the target process includes: Based on the input / output operations of the target process, determine the number of context switches and the running time of the target process, and determine the average context switch time of the target process based on the number of context switches and the running time. Multiply the number of context switches by the average context switch time plus the waiting time for input / output operations, and then divide by the total running time of the target process to obtain the scheduling overhead ratio of the target process.
2. The method according to claim 1, characterized in that, The step of adjusting the process scheduling parameters of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index includes: The process priority and time slice allocation ratio of the target process are adjusted according to the scheduling overhead ratio and the comprehensive dependency strength index, and the process scheduling parameters of the target process are updated according to the adjusted process priority and time slice allocation ratio, wherein the process scheduling parameters include at least one of process priority, process scheduling frequency and time slice length.
3. The method according to claim 2, characterized in that, The step of adjusting the process priority and time slice allocation ratio of the target process based on the scheduling overhead ratio and the comprehensive dependency strength index includes: Based on the scheduling overhead ratio and the overall dependency intensity value, the time window method is used to determine the changing trend of the overall dependency intensity index, wherein the changing trend includes an increasing trend; If the comprehensive dependency intensity index exceeds the preset intensity index threshold and shows the growth trend, the placement position of the target process in the scheduling queue is determined according to the growth rate of the comprehensive dependency intensity index. Based on the arrangement position of the target process, the time slice length of the target process is determined using the exponential backoff algorithm, and the time slice allocation table corresponding to the target process is updated according to the time slice length. The scheduling queue is updated using a red-black tree data structure to obtain the adjusted process priority and time slice length corresponding to the target process.
4. The method according to claim 2, characterized in that, The step of updating the process scheduling parameters of the target process according to the adjusted process priority and the time slice allocation ratio includes: The resource usage information of the target process is obtained. Based on the adjusted process priority, the time slice allocation ratio, and the resource usage information, a multi-objective optimization algorithm is used to obtain the process scheduling frequency and time slice length of the target process. The resource usage information includes processor utilization and memory usage. Based on the process scheduling frequency and the time slice length, an ant colony algorithm is used to generate a process scheduling sequence that satisfies the inter-process dependencies, and the process scheduling parameters of the target process are updated according to the scheduling sequence.
5. The method according to claim 1, characterized in that, Also includes: If the scheduling overhead ratio of the target process is higher than a preset overhead threshold, the scheduling frequency of the target process is reduced, and the time slice length of the target process is adjusted by a backoff algorithm.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the process scheduling method of any one of claims 1-5.
Citation Information
Patent Citations
Process scheduling method and device, equipment and storage medium
CN117420806A
Process scheduling method and device, electronic equipment and storage medium
CN117519940A