System task automatic scheduling method, device, computer equipment and storage medium

By monitoring the system pressure value and task indicators, prioritization and scheduling are determined, the problem of inaccurate task scheduling in the existing technology is solved, and the stability and user efficiency of the system under abnormal load conditions is improved.

CN111475267BActive Publication Date: 2024-11-12CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010162338.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-10
Publication Date
2024-11-12
Estimated Expiration
2040-03-10

AI Technical Summary

Technical Problem

The accuracy of task scheduling in existing systems is not high under load conditions, resulting in reduced system processing speed and crashes, affecting user work efficiency.

Method used

By obtaining the system pressure value from the preset log table, obtaining the indicators for the execution of tasks, determining priority, and scheduling according to the number of thread connections and the central processor occupancy ratio; if the pressure value is still high, sending the scheduling method to feedback to the user. Until the pressure value decreases.

Benefits of technology

Improve the accuracy of task scheduling, avoid system crashes, improve user work efficiency, and ensure the stable operation of the system under abnormal load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111475267B_ABST
    Figure CN111475267B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and provides a method, device, computer equipment and storage medium for automatic scheduling of system tasks, wherein the method comprises: if the acquired system pressure value is greater than the preset pressure value, then acquiring the execution task in the target system and n indicators corresponding to the execution task, and determining the priority of the execution task according to the n indicators; scheduling each execution task according to the acquired number of thread connections, occupancy ratio and priority, and acquiring the target pressure value; if the target pressure value is less than the preset pressure value, completing the scheduling of each execution task; if the target pressure value is greater than or equal to the preset pressure value, scheduling the execution task according to the target user feedback until the target pressure value is less than the preset pressure value. The technical solution of the present invention realizes automatic scheduling of the execution task in the case of abnormal load in the target system, thereby ensuring the work efficiency of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment and storage medium for automatic scheduling of system tasks. Background Art

[0002] As the usage time increases, the data information in the system's database continues to expand, and the demand for information collection from the database is increasing. When the system is normal and the request volume is not large, data collection in multiple dimensions will not cause too much pressure on the system. However, when the request volume is large, it will increase the system load and affect the system's availability and health.

[0003] The existing method of scheduling tasks under abnormal system load mainly relies on human subjectivity to schedule tasks according to their importance, and cannot be accurately adjusted according to the actual situation of system operation, resulting in a decrease in system processing speed and system crashes, further affecting user work efficiency. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, computer equipment and storage medium for automatically scheduling system tasks, so as to solve the problem that the existing method of scheduling tasks under abnormal load is not accurate enough, thus affecting the work efficiency of users.

[0005] A method for automatically scheduling system tasks, comprising:

[0006] Obtain the system pressure value of the target system from the preset log table;

[0007] If the system pressure value is greater than the preset pressure value, all execution tasks in the target system and n indicators corresponding to each execution task are obtained from a preset database, where n is a positive integer greater than 0;

[0008] For each of the execution tasks, determining the priority of the execution task according to the n indicators;

[0009] Obtaining the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit;

[0010] Scheduling each of the execution tasks according to the number of thread connections, the occupancy ratio and the priority, and reacquiring a system pressure value of the target system as a target pressure value based on a preset condition;

[0011] If the target pressure value is less than the preset pressure value, the scheduling process for each of the execution tasks is completed;

[0012] If the target pressure value is greater than or equal to the preset pressure value, the current scheduling processing mode of the target system is sent to the target user, and the target scheduling mode fed back by the target user is obtained to schedule each execution task until the target pressure value is less than the preset pressure value.

[0013] A system task automatic scheduling device, comprising:

[0014] A first acquisition module is used to obtain a system pressure value of a target system from a preset log table;

[0015] An indicator acquisition module, used for acquiring all execution tasks in the target system and n indicators corresponding to each execution task from a preset database if the system pressure value is greater than a preset pressure value, wherein n is a positive integer greater than 0;

[0016] A priority determination module, used for determining the priority of each execution task according to the n indicators;

[0017] A second acquisition module is used to obtain the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit;

[0018] A scheduling module, used for scheduling each of the execution tasks according to the number of thread connections, the occupancy ratio and the priority, and re-obtaining the system pressure value of the target system as the target pressure value based on preset conditions;

[0019] A first scheduling completion module, configured to complete the scheduling process for each of the execution tasks if the target pressure value is less than a preset pressure value;

[0020] The second scheduling completion module is used to send the current scheduling processing method of the target system to the target user if the target pressure value is greater than or equal to the preset pressure value, and obtain the target scheduling method fed back by the target user to schedule each execution task until the target pressure value is less than the preset pressure value.

[0021] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned system task automatic scheduling method are implemented.

[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned system task automatic scheduling method.

[0023] The above-mentioned system task automatic scheduling method, device, computer equipment and storage medium, when the system pressure value of the target system is greater than the preset pressure value, obtains all execution tasks in the target system and n indicators corresponding to each execution task from the preset database, and determines the priority of each execution task according to the n indicators, and schedules each execution task based on the number of thread connections and the occupancy ratio of the central processing unit corresponding to the database in the target system obtained, and combines the priority to schedule each execution task, and re-acquires the system pressure value of the target system as the target pressure value according to preset conditions. If the target pressure value is less than the preset pressure value, the scheduling of the execution task is completed. If the target pressure value is greater than or equal to the preset pressure value, the current scheduling processing method is sent to the target user, and the target scheduling method fed back by the target user is obtained to schedule the execution task until the target pressure value is less than the preset pressure value. By monitoring the system pressure value of the target system, the priority is determined according to the corresponding indicators of the execution task when the system pressure value is abnormal, and the importance of the execution task can be accurately analyzed. The execution task can be effectively adjusted according to the actual operation of the target system by scheduling the execution task according to the number of thread connections, occupancy ratio and priority. If the target pressure value is still abnormal after scheduling, the current scheduling method is fed back to the target user for analysis, which can help the target user understand the actual situation of the target system and improve the accuracy of the target scheduling method fed back by the target user. In this way, when the target system has abnormal load, the accuracy of the execution task scheduling is improved, the crash of the target system is avoided, and the user's work efficiency is further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0025] Figure 1 is a flow chart of a method for automatically scheduling system tasks provided by an embodiment of the present invention;

[0026] Figure 2 is a flowchart of step S3 in the system task automatic scheduling method provided by an embodiment of the present invention;

[0027] Figure 3 is a flowchart of step S33 in the system task automatic scheduling method provided by an embodiment of the present invention;

[0028] Figure 4 is a flowchart of step S34 in the system task automatic scheduling method provided by an embodiment of the present invention;

[0029] Figure 5 is a flowchart of step S5 in the system task automatic scheduling method provided by an embodiment of the present invention;

[0030] Figure 6 This is a flowchart of step S51 in the system task automatic scheduling method provided by an embodiment of the present invention.

[0031] Figure 7 It is a flow chart of adjusting the running state of an executed task in the system task automatic scheduling method provided by an embodiment of the present invention;

[0032] Figure 8 is a schematic diagram of a system task automatic scheduling device provided by an embodiment of the present invention;

[0033] Fig. 9 It is a basic structural block diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] The system task automatic scheduling method provided in this application is applied to the server side, which can be implemented by an independent server or a server cluster composed of multiple servers. Figure 1 As shown, a method for automatic scheduling of system tasks is provided, comprising the following steps:

[0036] S1: Obtain the system pressure value of the target system from the preset log table.

[0037] In the embodiment of the present invention, the system pressure value is used to represent the load condition corresponding to the target system, and the system pressure value is proportional to the load condition corresponding to the target system, that is, the larger the system pressure value, the heavier the load condition corresponding to the target system.

[0038] By directly obtaining the current system pressure value of the target system from a preset log table, wherein the preset log table refers to a data table specifically used to record the system pressure value of the target system in real time.

[0039] S2: If the system pressure value is greater than the preset pressure value, all execution tasks in the target system and n indicators corresponding to each execution task are obtained from a preset database, where n is a positive integer greater than 0.

[0040] In an embodiment of the present invention, the system pressure value is compared with the preset pressure value. If the system pressure value is greater than the preset pressure value, it means that the current load condition of the target system has reached the upper limit value set by the user, and all current execution tasks of the target system and n indicators corresponding to each execution task are obtained from the preset database.

[0041] The preset database refers to a database specifically used to store the execution tasks currently being executed by the target system and the indicators corresponding to each execution task.

[0042] S3: For each execution task, determine the priority of the execution task according to n indicators.

[0043] Specifically, for each execution task, the n indicators corresponding to the execution task are imported into the preset parsing port for priority assessment. After detecting the indicators, the preset parsing port will parse and process all indicators according to the priority screening requirements pre-set by the user, and output the priority after parsing. This priority is the priority of the execution task.

[0044] The preset parsing port refers to a processing port specifically used to determine priorities based on indicators, which includes priority screening requirements pre-set by the user.

[0045] S4: Obtain the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit.

[0046] In the embodiment of the present invention, the number of thread connections is used to reflect the number of tasks currently processed by the database in the target system. The CPU occupancy ratio is used to reflect the CPU load in the target system.

[0047] Specifically, the number of thread connections corresponding to the database in the target system and the occupancy ratio of the central processing unit are directly obtained from a preset record table, wherein the preset record table refers to a data table specifically used to record the number of thread connections corresponding to the database in the target system and the occupancy ratio of the central processing unit in the target system.

[0048] S5: Schedule each execution task according to the number of thread connections, occupancy ratio and priority, and re-obtain the system pressure value of the target system as the target pressure value based on preset conditions.

[0049] In an embodiment of the present invention, when the number of thread connections and the occupancy ratio reach preset values, each execution task is scheduled according to preset rules and priorities, and the system pressure value of the target system is re-acquired as the target pressure value based on preset conditions.

[0050] S6: If the target pressure value is less than the preset pressure value, the scheduling process for each execution task is completed.

[0051] Specifically, the target pressure value is compared with the preset pressure value. If the target pressure value is less than the preset pressure value, it means that the scheduling processing scheme for the execution task of the target system can effectively reduce the system load, that is, the scheduling processing for each execution task is completed.

[0052] S7: If the target pressure value is greater than or equal to the preset pressure value, the current scheduling processing method of the target system is sent to the target user, and the target scheduling method fed back by the target user is obtained to schedule each execution task until the target pressure value is less than the preset pressure value.

[0053] Specifically, if the target pressure value is greater than or equal to the preset pressure value, it means that the scheduling processing plan for the execution task of the target system cannot effectively reduce the system load, and the current scheduling processing method for the execution task will be sent to the target user according to the preset sending method. After receiving the information, the target user can analyze the actual situation and re-feedback the new scheduling plan to the server. When the scheduling plan feedback from the target user is received, the execution task will be scheduled according to the scheduling plan until the target pressure value is less than the preset pressure value.

[0054] The preset sending method may specifically refer to the form of email, which is not limited here.

[0055] In this embodiment, when the system pressure value of the target system is greater than the preset pressure value, all execution tasks in the target system and n indicators corresponding to each execution task are obtained from the preset database, and the priority of each execution task is determined according to the n indicators. Based on the obtained number of thread connections corresponding to the database in the target system and the occupancy ratio of the central processing unit, each execution task is scheduled and processed in combination with the priority, and the system pressure value of the target system is re-obtained as the target pressure value according to preset conditions. If the target pressure value is less than the preset pressure value, the scheduling processing of the execution task is completed. If the target pressure value is greater than or equal to the preset pressure value, the current scheduling processing method is sent to the target user, and the target scheduling method fed back by the target user is obtained to schedule the execution task until the target pressure value is less than the preset pressure value. By monitoring the system pressure value of the target system, the priority is determined according to the corresponding indicators of the execution task when the system pressure value is abnormal, and the importance of the execution task can be accurately analyzed. The execution task can be effectively adjusted according to the actual operation of the target system by scheduling the execution task according to the number of thread connections, occupancy ratio and priority. If the target pressure value is still abnormal after scheduling, the current scheduling method is fed back to the target user for analysis, which can help the target user understand the actual situation of the target system and improve the accuracy of the target scheduling method fed back by the target user. In this way, when the target system has abnormal load, the accuracy of the execution task scheduling is improved, the crash of the target system is avoided, and the user's work efficiency is further improved.

[0056] In one embodiment, if Figure 2 As shown, in step S3, that is, for each execution task, the step of determining the priority of the execution task according to n indicators includes:

[0057] S31: For each execution task, the initial score, task impact value, current usage rate and limited usage rate of each indicator included in the execution task are obtained from the preset log library.

[0058] In an embodiment of the present invention, the execution task includes its corresponding task id. According to the task id, all indicators corresponding to the task id, as well as the initial score, task impact value, current usage rate and limited usage rate corresponding to each indicator are queried from the preset log library.

[0059] The preset log library refers to a database specifically used to record task IDs, indicators corresponding to task IDs, and initial scores, task impact values, current usage rates, and limited usage rates corresponding to each indicator in real time.

[0060] S32: For each indicator, compare the current usage rate with the limited usage rate to obtain a comparison result.

[0061] Specifically, for each indicator, the current usage rate of the indicator is compared with the limited usage rate to obtain a comparison result.

[0062] It should be noted that there are mainly two types of comparison results, one is that the current usage rate is equal to the limited usage rate, and the other is that the current usage rate is less than the limited usage rate.

[0063] S33: Determine the target value of each indicator based on the comparison result and the preset requirements.

[0064] In the embodiment of the present invention, the target value corresponding to each indicator is determined according to the comparison result obtained in step S32 in combination with the preset requirements, wherein the preset requirements refer to the rules for determining the target value corresponding to the indicator set according to the actual needs of the user.

[0065] S34: For each execution task, a comprehensive score of the execution task is calculated based on the initial score, the target value and the preset weight value.

[0066] Specifically, for each execution task, the initial score and target value corresponding to each indicator contained in the execution task are added together with the preset weight value to obtain a comprehensive score corresponding to the execution task.

[0067] S35: Determine the priority of each execution task by matching the comprehensive score with the score range in the preset grade library.

[0068] Specifically, the comprehensive score is matched with each score range in the preset grade library respectively. If the comprehensive score is within the score range, the priority corresponding to the score range is obtained, and the priority is used as the priority corresponding to the execution task.

[0069] The preset rating library refers to a database used to store different rating ranges and the priorities corresponding to each rating range, and the priorities include important level, secondary level and ordinary level.

[0070] In this embodiment, the initial score, task impact value, current usage rate and limited usage rate corresponding to each indicator included in the execution task are obtained, and for each indicator, the current usage rate is compared with the limited usage rate, and the target value of each indicator is determined according to the comparison result and the preset requirements, and the comprehensive score corresponding to the execution task is calculated according to the initial score, the target value and the preset weight value, and the priority of the execution task is determined by matching the comprehensive score with the score range. By calculating the comprehensive score according to the initial score, the target value and the preset weight value, and then determining the priority according to the comprehensive score, the priority can be accurately determined according to the actual situation of the execution task, and the accuracy of the subsequent scheduling of the execution task according to the priority can be improved.

[0071] In one embodiment, if Figure 3 As shown, in step S33, the step of determining the target value of each indicator according to the comparison result and the preset requirement includes:

[0072] S331: If the comparison result is that the current usage rate is equal to the limited usage rate, the task impact value of the indicator is used as the target value.

[0073] Specifically, for each indicator in step 32, the current usage rate of the indicator is compared with the limited usage rate. If the comparison result is that the current usage rate is equal to the limited usage rate, the task impact value of the indicator is used as the target value.

[0074] S332: If the comparison result is that the current usage rate is less than the limited usage rate, the target value of each indicator is calculated according to formula (1):

[0075] X=b*(1+c / d) (1)

[0076] Among them, X is the target value, b is the task impact value, c is the current usage rate, and d is the limited usage rate.

[0077] Specifically, for each indicator in step 32, the current usage rate of the indicator is compared with the limited usage rate. If the comparison result is that the current usage rate is less than the limited usage rate, the target value corresponding to each indicator is calculated according to formula (1).

[0078] It should be noted that the task impact value refers to the score corresponding to the degree of influence of the indicators contained in the execution task on the execution task. For example, the indicators can be CPU, memory, IO, etc. If the CPU has a greater impact on the execution task, the task impact value corresponding to the CPU will also be higher, otherwise it will be lower.

[0079] The current usage rate refers to the usage rate of the indicator when the task is running. For example, the CPU usage rate is 10%.

[0080] The limited usage rate refers to the maximum usage rate of the indicator per second when the task is running. When there is no resource competition during the execution of the task, the current usage rate of the indicators it contains is equal to the limited usage rate. If there is resource competition, the current usage rate of the indicators it contains will be less than the limited usage rate.

[0081] In this embodiment, when the current usage rate is equal to the limited usage rate, the task impact value is used as the target value, and when the current usage rate is less than the limited usage rate, the target value of the indicator is calculated according to formula (1). This enables accurate calculation of the target value according to different comparison results, and improves the accuracy of the subsequent calculation of the corresponding comprehensive score of the execution task using the target value.

[0082] In one embodiment, if Figure 4 As shown, in step S34, that is, for each execution task, the step of calculating the comprehensive score of the execution task based on the initial score, the target value and the preset weight value includes:

[0083] S341: For each execution task, the target values ​​of all indicators in the execution task are added together to obtain the total target value of all indicators.

[0084] In the embodiment of the present invention, for each execution task, the target values ​​of all indicators in the execution task are added together, and the accumulated value obtained is the total target value corresponding to all indicators included in the execution task.

[0085] S342: For each indicator in the execution task, the target value of the indicator is divided by the total target value to obtain the weight value of the indicator.

[0086] Specifically, for each indicator in the execution task, the target value corresponding to the indicator is divided by the total target values ​​of all indicators included in the corresponding execution task to obtain the weight value corresponding to the indicator.

[0087] S343: Based on the initial scores, target values ​​and weight values ​​of the n indicators, the comprehensive score of each execution task is calculated according to formula (2):

[0088] S=a1*q1+a2*q2+...+a n *q n (2)

[0089] Among them, S is the comprehensive score, a1 is the initial score corresponding to the A1 indicator, q1 is the target value corresponding to the A1 indicator, a2 is the initial score corresponding to the A2 indicator, q2 is the target value corresponding to the A2 indicator, and a n is the initial score corresponding to the An indicator, q n is the initial score corresponding to the An indicator.

[0090] Specifically, according to the initial scores, target values ​​and weight values ​​of the n indicators included in the execution task, the comprehensive score of each execution task is calculated according to formula (2).

[0091] In this embodiment, for each execution task, the target values ​​of all indicators in the execution task are added to obtain the total target value, and for each indicator, the target value is divided by the total target value to obtain the weight value corresponding to the indicator. The comprehensive score of each execution task is calculated according to formula (2) by combining the initial scores, target values ​​and weight values ​​of the n indicators. This can achieve fast and accurate calculation of the comprehensive score corresponding to the comprehensive score, and ensure the accuracy of the subsequent determination of the priority of the execution task using the comprehensive score.

[0092] In one embodiment, if Figure 5 As shown, in step S5, each execution task is scheduled according to the number of thread connections, the occupancy ratio and the priority, and the system pressure value of the target system is re-acquired as the target pressure value based on the preset conditions, including the following steps:

[0093] S51: Compare the number of thread connections and the occupancy ratio with the preset threshold value, and schedule each execution task according to the preset scheduling rule based on the comparison result and the priority.

[0094] In the embodiment of the present invention, the number of thread connections and the occupancy ratio are compared with the preset thresholds, and each execution task is scheduled according to the comparison result and the priority and the preset scheduling rule. The preset scheduling rule is a scheduling method for the execution task set by the user in advance according to the comparison result and the priority corresponding to the execution task.

[0095] S52: Obtain the scheduling processing progress of each execution task from the preset processing library.

[0096] In an embodiment of the present invention, the scheduling processing progress is used to reflect the scheduling processing status of the execution task, by directly obtaining the scheduling processing progress of each execution task from a preset processing library, wherein the preset processing library refers to a database specifically used to store execution tasks and the scheduling processing progress corresponding to the execution tasks.

[0097] It should be noted that the scheduling processing progress includes scheduling completed and scheduling incomplete.

[0098] S53: If it is detected that the scheduling processing progress of each execution task is completed, the system pressure value of the target system is re-obtained after a preset time interval as the target pressure value.

[0099] Specifically, when it is detected that the scheduling processing progress of each execution task is completed, after a preset time interval, the pressure value of the target system is re-acquired from the preset log table as the target pressure value.

[0100] The preset time interval may be 1 minute or 30 seconds, and there is no limitation here.

[0101] In this embodiment, the number of thread connections and the occupancy ratio are compared with the preset thresholds respectively, and each execution task is scheduled according to the preset scheduling rules based on the comparison result and the priority, and after detecting that the scheduling progress of each execution task is completed, the system pressure value of the target system is re-acquired based on the preset time interval as the target pressure value. By combining the comparison result and the priority, and then scheduling the execution task according to the preset scheduling rules, the accuracy of the scheduling process can be effectively improved, and the target pressure value is obtained after the scheduling progress of each execution task is completed, which can improve the accuracy of the subsequent judgment of whether the current scheduling process is effective according to the target pressure value.

[0102] In one embodiment, the preset threshold includes a first threshold, a second threshold and a third threshold, the scheduling process includes a downgrade process and a pause process, and the priority level includes a normal level, a secondary level and an important level. Figure 6 As shown, in step S51, the number of thread connections and the occupancy ratio are compared with the preset threshold, and scheduling each execution task according to the comparison result and the priority includes the following steps:

[0103] S511: Compare the number of thread connections and the occupancy ratio with the first threshold, the second threshold, and the third threshold respectively.

[0104] Specifically, the number of thread connections and the occupancy ratio are compared with a first threshold, a second threshold, and a third threshold, respectively.

[0105] S512: If the number of thread connections and the occupancy ratio both reach a first threshold, downgrading the execution task with a normal priority level.

[0106] In the embodiment of the present invention, the downgrade process refers to reducing the processing efficiency of the execution task. If the number of thread connections and the occupancy ratio both reach the first threshold, the execution task with a normal priority level is downgraded.

[0107] S513: If both the number of thread connections and the occupancy ratio reach the second threshold, suspend the execution task with a normal priority level, and downgrade the execution task with a secondary priority level.

[0108] Specifically, if both the number of thread connections and the occupancy ratio reach the second threshold, the execution task with a normal priority level is suspended, and the execution task with a secondary priority level is downgraded.

[0109] S514: If both the number of thread connections and the occupancy ratio reach a third threshold, suspend the execution task with a secondary priority level, and downgrade the execution task with an important priority level.

[0110] Specifically, if both the number of thread connections and the occupancy ratio reach the third threshold, the execution task with a secondary priority level is suspended, and the execution task with an important priority level is downgraded.

[0111] In this embodiment, when the number of thread connections and the occupancy ratio both reach the first threshold, the execution task with a normal priority level is downgraded; when the number of thread connections and the occupancy ratio both reach the second threshold, the execution task with a normal priority level is suspended and the execution task with a secondary priority level is downgraded; when the number of thread connections and the occupancy ratio both reach the third threshold, the execution task with a secondary priority level is suspended and the execution task with an important priority level is downgraded. Thus, according to the above scheduling processing method, the execution task can be effectively scheduled according to the current actual situation of the target system and the importance of the execution task, thereby improving the effectiveness of the scheduling processing.

[0112] In one embodiment, the execution task includes an operation state, and the operation state includes normal, degraded, and suspended. Figure 7 As shown, after step S6, the system task automatic scheduling method further includes the following steps:

[0113] S8: If the target pressure value is less than the preset restart value, the running status of all currently executed tasks of the target system is obtained from the preset status library.

[0114] In an embodiment of the present invention, if the target pressure value is less than the preset restart value, the running status of all currently executed tasks of the target system is obtained from the preset status library, wherein the preset restart value refers to a value set according to the actual needs of the user for restoring the normal running status of the executed tasks.

[0115] The preset status library refers to a database specifically used to store the current execution tasks of the target system and the running status corresponding to the execution tasks, where the running status includes normal, degraded and suspended.

[0116] S9: If it is detected that the running state of the execution task is degraded or suspended, the running state of the execution task corresponding to the degraded or suspended state is adjusted to normal.

[0117] Specifically, if it is detected that the running state of the execution task is degraded or suspended, the running state of the execution task corresponding to the degraded or suspended state is adjusted to normal.

[0118] In this embodiment, when the target pressure value is less than the preset restart value, the running status of all currently executed tasks of the target system is obtained. If the running status of the executed task is detected to be degraded or suspended, the running status of the executed task is adjusted to normal. By adjusting the running status, the target system can restore the original running status of the executed task after the load condition is improved, thereby ensuring the processing efficiency of the executed task and improving the work efficiency of the user.

[0119] It should be understood that the order of execution of the steps in the above embodiment does not necessarily 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 embodiment of the present invention.

[0120] In one embodiment, a system task automatic scheduling device is provided, and the system task automatic scheduling device corresponds to the system task automatic scheduling method in the above embodiment. Figure 8 As shown, the system task automatic scheduling device includes a first acquisition module 81, an indicator acquisition module 82, a priority determination module 83, a second acquisition module 84, a scheduling module 85, a first scheduling completion module 86 and a second scheduling completion module 87. The functional modules are described in detail as follows:

[0121] A first acquisition module 81 is used to acquire a system pressure value of a target system from a preset log table;

[0122] The indicator acquisition module 82 is used to acquire all execution tasks in the target system and n indicators corresponding to each execution task from a preset database if the system pressure value is greater than a preset pressure value, where n is a positive integer greater than 0;

[0123] A priority determination module 83 is used to determine the priority of each execution task according to n indicators;

[0124] The second acquisition module 84 is used to obtain the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit;

[0125] The scheduling module 85 is used to schedule each execution task according to the number of thread connections, the occupancy ratio and the priority, and re-acquire the system pressure value of the target system as the target pressure value based on the preset conditions;

[0126] A first scheduling completion module 86, used to complete the scheduling process for each execution task if the target pressure value is less than the preset pressure value;

[0127] The second scheduling completion module 87 is used to send the current scheduling processing method of the target system to the target user if the target pressure value is greater than or equal to the preset pressure value, and obtain the target scheduling method fed back by the target user to schedule each execution task until the target pressure value is less than the preset pressure value.

[0128] Furthermore, the priority determination module 83 includes

[0129] The third acquisition submodule is used to obtain, for each execution task, the initial score, task impact value, current usage rate and limited usage rate of each indicator included in the execution task from the preset log library;

[0130] A comparison submodule is used to compare the current usage rate with the limited usage rate for each indicator to obtain a comparison result;

[0131] The target value determination submodule is used to determine the target value of each indicator based on the comparison results and preset requirements;

[0132] The calculation submodule is used to calculate the comprehensive score of each execution task based on the initial score, the target value and the preset weight value;

[0133] The matching submodule is used to determine the priority of each execution task by matching the comprehensive score with the score range in the preset grade library.

[0134] Furthermore, the target value determination submodule includes:

[0135] A first comparison result unit, configured to use the task impact value of the indicator as the target value if the comparison result shows that the current usage rate is equal to the limited usage rate;

[0136] The second comparison result unit is used to calculate the target value of each indicator according to formula (1) if the comparison result is that the current usage rate is less than the limited usage rate:

[0137] X=b*(1+c / d) (1)

[0138] Among them, X is the target value, b is the task impact value, c is the current usage rate, and d is the limited usage rate.

[0139] Furthermore, the calculation submodule includes:

[0140] An adding unit, for adding the target values ​​of all indicators in each execution task to obtain a total target value of all indicators;

[0141] A division unit is used to divide each indicator in the execution task by the target value of the indicator and the total target value to obtain the weight value of the indicator;

[0142] The comprehensive score calculation unit is used to calculate the comprehensive score of each execution task according to the initial scores, target values ​​and weight values ​​of the n indicators according to formula (2):

[0143] S=a1*q1+a2*q2+...+a n *q n (2)

[0144] Among them, S is the comprehensive score, a1 is the initial score corresponding to the A1 indicator, q1 is the target value corresponding to the A1 indicator, a2 is the initial score corresponding to the A2 indicator, q2 is the target value corresponding to the A2 indicator, and a n is the initial score corresponding to the An indicator, q n is the initial score corresponding to the An indicator.

[0145] Furthermore, the scheduling module 85 includes:

[0146] The third comparison submodule is used to compare the number of thread connections and the occupancy ratio with the preset threshold value, and schedule each execution task according to the preset scheduling rule based on the comparison result and the priority;

[0147] The fourth acquisition submodule is used to obtain the scheduling processing progress of each execution task from the preset processing library;

[0148] The detection submodule is used to re-acquire the system pressure value of the target system as the target pressure value after a preset time interval if it is detected that the scheduling processing progress of each execution task is completed.

[0149] Furthermore, the third comparison submodule includes:

[0150] a fourth comparison unit, configured to compare the number of thread connections and the occupancy ratio with the first threshold, the second threshold, and the third threshold respectively;

[0151] A first scheduling unit is used to downgrade the execution task with a normal priority level if the number of thread connections and the occupancy ratio both reach a first threshold;

[0152] A second scheduling unit is used for suspending the execution tasks with a normal priority level and downgrading the execution tasks with a secondary priority level if both the number of thread connections and the occupancy ratio reach a second threshold;

[0153] The third scheduling unit is used to suspend the execution task with a secondary priority level and downgrade the execution task with an important priority level if the number of thread connections and the occupancy ratio both reach a third threshold.

[0154] Furthermore, the system task automatic scheduling device also includes:

[0155] The running status acquisition module is used to obtain the running status of all currently executed tasks of the target system from the preset status library if the target pressure value is less than the preset restart value;

[0156] The running state adjustment module is used to adjust the running state of the execution task corresponding to the degradation or suspension to normal if it is detected that the running state of the execution task is degraded or suspended.

[0157] Some embodiments of the present application disclose computer devices. Fig. 9 , which is a basic structural block diagram of a computer device 90 in one embodiment of the present application.

[0158] like Fig. 9 As shown in FIG. 1 , the computer device 90 includes a memory 91, a processor 92, and a network interface 93 that are interconnected and communicated via a system bus. It should be noted that Fig. 9 Only a computer device 90 having components 91-93 is shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0159] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0160] The memory 91 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 91 can be an internal storage unit of the computer device 90, such as a hard disk or memory of the computer device 90. In other embodiments, the memory 91 can also be an external storage device of the computer device 90, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. equipped on the computer device 90. Of course, the memory 91 can also include both the internal storage unit of the computer device 90 and its external storage device. In this embodiment, the memory 91 is generally used to store the operating system and various application software installed on the computer device 90, such as the program code of the system task automatic scheduling method, etc. In addition, the memory 91 can also be used to temporarily store various types of data that have been output or are to be output.

[0161] The processor 92 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 92 is generally used to control the overall operation of the computer device 90. In this embodiment, the processor 92 is used to run the program code stored in the memory 91 or process data, such as running the program code of the system task automatic scheduling method.

[0162] The network interface 93 may include a wireless network interface or a wired network interface. The network interface 93 is generally used to establish a communication connection between the computer device 90 and other electronic devices.

[0163] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores a task execution information entry program, and the task execution information entry program can be executed by at least one processor to enable the at least one processor to perform any step of the above-mentioned system task automatic scheduling method.

[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a computer device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0165] Finally, it should be noted that the embodiments described above are obviously only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. A method for automatic scheduling of system tasks, characterized in that: The system task automatic scheduling method comprises: Obtain the system pressure value of the target system from the preset log table; If the system pressure value is greater than a preset pressure value, all execution tasks in the target system and n indicators corresponding to each execution task are obtained from a preset database, where n is a positive integer greater than 0; For each of the execution tasks, determining the priority of the execution task according to the n indicators; Obtaining the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit; Scheduling each of the execution tasks according to the number of thread connections, the occupancy ratio and the priority, and reacquiring a system pressure value of the target system as a target pressure value based on a preset condition; If the target pressure value is less than the preset pressure value, the scheduling process for each of the execution tasks is completed; If the target pressure value is greater than or equal to the preset pressure value, the current scheduling processing mode of the target system is sent to the target user, and the target scheduling mode fed back by the target user is obtained to schedule each of the execution tasks until the target pressure value is less than the preset pressure value; The step of determining the priority of each execution task according to the n indicators comprises: For each of the execution tasks, the initial score, task impact value, current usage rate and limited usage rate of each of the indicators included in the execution task are obtained from a preset log library; For each of the indicators, the current usage rate is compared with the limited usage rate to obtain a comparison result; Determine the target value of each indicator according to the comparison result and the preset requirements; For each of the execution tasks, based on the initial score, the target value and the preset weight value, calculate a comprehensive score of the execution task; Determine the priority of each of the execution tasks by matching the comprehensive score with the score range in the preset grade library; The step of determining the target value of each indicator according to the comparison result and the preset requirement includes: If the comparison result is that the current usage rate is equal to the limited usage rate, the task impact value of the indicator is used as the target value; If the comparison result is that the current usage rate is less than the limited usage rate, the target value of each indicator is calculated according to the following formula: X=b*(1+c / d); Wherein, X is the target value, b is the task impact value, c is the current usage rate, and d is the limited usage rate; The step of scheduling each of the execution tasks according to the number of thread connections, the occupancy ratio and the priority, and re-obtaining the system pressure value of the target system as the target pressure value based on a preset condition includes: Compare the number of thread connections and the occupancy ratio with a preset threshold, and schedule each of the execution tasks according to a preset scheduling rule based on the comparison result and the priority; Obtaining the scheduling processing progress of each of the execution tasks from a preset processing library; If it is detected that the scheduling processing progress of each of the execution tasks is completed, the system pressure value of the target system is re-acquired after a preset time interval as the target pressure value.

2. The system task automatic scheduling method according to claim 1, characterized in that: The step of calculating the comprehensive score of each execution task based on the initial score, the target value and the preset weight value comprises: For each of the execution tasks, the target values ​​of all the indicators in the execution task are added together to obtain a total target value of all the indicators; For each of the indicators in the execution task, the target value of the indicator is divided by the total target value to obtain a weight value of the indicator; According to the initial scores, target values ​​and weight values ​​of the n indicators, the comprehensive score of each execution task is calculated according to the following formula: S=a1*q1+a2*q2+...+a n *q n; Among them, S is the comprehensive score, a1 is the initial score corresponding to the A1 indicator, q1 is the target value corresponding to the A1 indicator, a2 is the initial score corresponding to the A2 indicator, q2 is the target value corresponding to the A2 indicator, a n is the initial score corresponding to the An indicator, q n is the initial score corresponding to the An indicator.

3. The system task automatic scheduling method according to claim 1, characterized in that: The preset thresholds include a first threshold, a second threshold and a third threshold, the scheduling process includes a downgrade process and a pause process, the priority includes a normal level, a secondary level and an important level, and the step of comparing the number of thread connections and the occupancy ratio with the preset thresholds, and scheduling each of the execution tasks according to the preset scheduling rules based on the comparison result and the priority includes: Compare the number of thread connections and the occupancy ratio with the first threshold, the second threshold, and the third threshold respectively; If both the number of thread connections and the occupancy ratio reach the first threshold, downgrading the execution task with the normal priority level; If both the number of thread connections and the occupancy ratio reach the second threshold, suspending the execution task with the normal priority level and downgrading the execution task with the secondary priority level; If both the number of thread connections and the occupancy ratio reach the third threshold, the execution task with the secondary priority level is suspended, and the execution task with the important priority level is downgraded.

4. The system task automatic scheduling method according to claim 1, characterized in that: The execution task includes an operation state, and the operation state includes normal, degraded and paused. If the target pressure value is less than the preset pressure value, after completing the step of scheduling processing for each execution task, the system task automatic scheduling method also includes: If the target pressure value is less than the preset restart value, the operating status of all the currently executed tasks of the target system is obtained from a preset status library; If it is detected that the running state of the executing task is the degradation or the suspension, the running state of the executing task corresponding to the degradation or the suspension is adjusted to the normal state.

5. A system task automatic scheduling device, characterized in that: The system task automatic scheduling device performs the steps of the system task automatic scheduling method according to any one of claims 1 to 4, and the system task automatic scheduling device includes: A first acquisition module is used to obtain a system pressure value of a target system from a preset log table; An indicator acquisition module, used for acquiring all execution tasks in the target system and n indicators corresponding to each execution task from a preset database if the system pressure value is greater than a preset pressure value, wherein n is a positive integer greater than 0; A priority determination module, used for determining the priority of each execution task according to the n indicators; A second acquisition module is used to obtain the ratio of the number of thread connections corresponding to the database in the target system to the occupancy of the central processing unit; A scheduling module, used for scheduling each of the execution tasks according to the number of thread connections, the occupancy ratio and the priority, and re-obtaining the system pressure value of the target system as the target pressure value based on preset conditions; A first scheduling completion module, used for completing the scheduling process for each of the execution tasks if the target pressure value is less than a preset pressure value; The second scheduling completion module is used to send the current scheduling processing method of the target system to the target user if the target pressure value is greater than or equal to the preset pressure value, and obtain the target scheduling method fed back by the target user to schedule each execution task until the target pressure value is less than the preset pressure value.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the system task automatic scheduling method as claimed in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the system task automatic scheduling method as claimed in any one of claims 1 to 4 are implemented.