Task scheduling method and device based on edge computing, equipment and medium

By dynamically adjusting resource allocation for model training and inference tasks on edge servers, the problem of data drift caused by improper resource allocation is solved, improving processing performance and diagnostic accuracy.

CN119668798BActive Publication Date: 2025-11-28PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411717142.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-11-28
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

When performing medical image data analysis on edge servers, improper resource allocation for model training and inference tasks leads to data drift and poor processing performance, which existing technologies struggle to address effectively.

Method used

By obtaining the task accuracy and resource allocation within the current time window, the resource allocation for model training and inference tasks can be dynamically adjusted to optimize resource utilization and model accuracy.

Benefits of technology

This improved the processing performance of edge servers, thereby enhancing the accuracy and efficiency of medical diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668798B_ABST
    Figure CN119668798B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of digital medical treatment, and in particular to a task scheduling method and device based on edge computing, equipment and medium. The task scheduling method comprises: obtaining the task accuracy of each video stream in a previous time window at the current time; calculating the mean of the task accuracy of all video streams, and if the mean is less than a first preset threshold, determining K first target video streams with the highest task accuracy and M second target video streams with the lowest task accuracy; in a current time window formed by a preset time length after the current time, respectively adjusting the processing resource allocation amount occupied by the K first target video streams and the M second target video streams, and based on the task accuracy in the previous time window, the processing resource allocation amount of each task in the next time window is dynamically adjusted in real time, so that the resource utilization rate and the model training accuracy are both optimized, and the accuracy of obtaining medical diagnosis results by using the edge server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of digital medical treatment, and in particular to a task scheduling method and device based on edge computing, equipment and medium. BACKGROUND

[0002] In recent years, with the continuous development and breakthrough of digital medical treatment, a large number of advanced medical imaging devices have been gradually applied and popularized in hospitals at all levels. The rich medical imaging information obtained by advanced medical devices provides great help for doctors' examination, diagnosis and treatment.

[0003] At present, video stream data related to medical images is collected through medical image terminal equipment (such as ultrasonic equipment), and then a model for inference is deployed for the medical image equipment on an edge server. The model is used to analyze the video stream collected by the medical image terminal equipment to obtain a medical diagnosis result, thereby assisting doctors in diagnosis, consultation, clinical training, etc.

[0004] However, the amount of data for medical image examination is increasing, and the content in the video stream also changes constantly, resulting in data drift of the model deployed on the edge server, i.e. the real-time video stream data deviates from the training data, and the model needs to be retrained on new data continuously to solve the data drift problem of the model. However, it is a great challenge for the edge server to complete the retraining task and the video inference task simultaneously. If more resources are allocated to the retraining task under the condition that the total resources remain unchanged, the overall utilization rate of the GPU will be affected, and if more resources are allocated to the inference task, the retraining will take a long time, which will affect the accuracy of the inference model and reduce the efficiency of medical diagnosis. Therefore, how to perform appropriate task and resource scheduling to improve the processing effect of the edge server has become a problem to be solved. SUMMARY

[0005] Therefore, the embodiments of the present application provide a task scheduling method and device based on edge computing, equipment and medium to solve the problem of low processing effect of the edge server.

[0006] In a first aspect, the embodiments of the present application provide a task scheduling method based on edge computing, which is applied to a model training scene. The model training includes a training task and an inference task. The task scheduling method comprises the following steps:

[0007] obtaining the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current time, wherein the time window is a preset time length;

[0008] For any video stream, the training task and the inference task corresponding to the video stream are used to perform inference on each verification data in a preset verification data set, to obtain an inference result corresponding to the verification data;

[0009] The accuracy detection module is configured to detect whether the real result of each verification data is same as the corresponding inference result, to obtain a detection result corresponding to the verification data, and determine a proportion of verification data with the same detection result in the preset verification data set as the task accuracy corresponding to the video stream;

[0010] The first determination module is configured to calculate a mean value of the task accuracy of all video streams, and if the mean value is less than a first preset threshold, determine K first target video streams with the highest task accuracy in all video streams and M second target video streams with the lowest task accuracy in all video streams, K and M being integers greater than 0.

[0011] In a current time window formed by the preset time length after the current time, the processing resource allocation amount occupied by the training task and the inference task corresponding to the K first target video streams is reduced, and the surplus resource obtained after the reduction is allocated to the training task and the inference task corresponding to the M second target video streams.

[0012] In a second aspect, an embodiment of the present application provides a task scheduling device based on edge computing, which is applied to a model training scene, the model training including a training task and an inference task, and the task scheduling device includes:

[0013] The allocation amount acquisition module is configured to acquire a processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window of a current time, wherein the time window is a preset time length.

[0014] The inference analysis module is configured to, for any video stream, use the training task and the inference task corresponding to the video stream to perform inference on each verification data in a preset verification data set, to obtain an inference result corresponding to the verification data.

[0015] The accuracy detection module is configured to detect whether the real result of each verification data is same as the corresponding inference result, to obtain a detection result corresponding to the verification data, and determine a proportion of verification data with the same detection result in the preset verification data set as the task accuracy corresponding to the video stream.

[0016] The first determination module is configured to calculate a mean value of the task accuracy of all video streams, and if the mean value is less than a first preset threshold, determine K first target video streams with the highest task accuracy in all video streams and M second target video streams with the lowest task accuracy in all video streams, K and M being integers greater than 0.

[0017] The first adjusting module is configured to reduce the processing resource allocation of the training task and the inference task corresponding to the K first target video streams in a current time window formed by the preset time length after the current time, and allocate the surplus resource obtained after the reduction to the training task and the inference task corresponding to the M second target video streams.

[0018] In a third aspect, an embodiment of the present application provides a computer device, which comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the task scheduling method according to the first aspect when executing the computer program.

[0019] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the task scheduling method according to the first aspect.

[0020] Compared with the prior art, the embodiment of the present application has the following beneficial effects:

[0021] The task scheduling method based on edge computing provided by the present application is applied to a model training scene, the model training includes a training task and an inference task, and the task scheduling method comprises the following steps: obtaining the processing resource allocation of the training task and the inference task corresponding to each video stream in a previous time window of a current time, wherein the time window is a preset time length; for any video stream, using the training task and the inference task corresponding to the video stream, inferring each verification data in a preset verification data set to obtain an inference result of the corresponding verification data; detecting whether the real result of each verification data is the same as the corresponding inference result to obtain a detection result of the corresponding verification data, determining the proportion of the verification data whose detection result is the same in the preset verification data set as the task accuracy of the corresponding video stream; calculating the mean value of the task accuracy of all video streams, if the mean value is less than a first preset threshold, determining K first target video streams with the highest task accuracy and M second target video streams with the lowest task accuracy in all video streams, K and M are both integers greater than 0; reducing the processing resource allocation of the training task and the inference task corresponding to the K first target video streams in a current time window formed by the preset time length after the current time, and allocating the surplus resource obtained after the reduction to the training task and the inference task corresponding to the M second target video streams, dynamically adjusting the processing resource allocation of the training task and the inference task in a next time window based on the task accuracy of the training task and the inference task in the previous time window, so that the resource utilization rate and the model training accuracy are optimized, and the processing effect of the edge server is improved, and the medical diagnosis result obtained by using the edge server is more accurate. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0023] Figure 1 is an application environment schematic diagram of a task scheduling method based on edge computing provided by the first embodiment of the present application;

[0024] Figure 2 is a flow schematic diagram of a task scheduling method based on edge computing provided by the first embodiment of the present application;

[0025] Figure 3 is a flow schematic diagram of a task scheduling method according to resource utilization provided by the first embodiment of the present application;

[0026] Figure 4 is a structure schematic diagram of a task scheduling device based on edge computing provided by the second embodiment of the present application;

[0027] Figure 5 is a structure schematic diagram of a computer device provided by the third embodiment of the present application. DETAILED DESCRIPTION

[0028] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art should understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary details.

[0029] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0030] It should also be understood that the term "and / or" used in the specification and the appended claims of the present application means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0031] As used in the description of the application and the appended claims, the term "if' can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]."

[0032] In addition, in the description of the application and the appended claims, the terms "first", "second", "third", etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0033] The description of "one embodiment" or "some embodiments" or the like in the present application specification means that the specific features, structures or characteristics described in connection with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in further some embodiments" and the like appearing in different places in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "include", "contain", "have" and their variants mean "include but not limited to", unless otherwise specifically emphasized.

[0034] It should be understood that the size of the serial number of each step in the following embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0035] In order to illustrate the technical solutions of the present application, the following specific embodiments are described.

[0036] The task scheduling method based on edge computing provided by the embodiment one of the present application can be applied to, for example, Figure 1The application environment is that the client communicates with the server. The client includes, but is not limited to, a palm computer, a desktop computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cloud terminal device, a personal digital assistant (PDA), and the like. The server can be a stand-alone server or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, a content delivery network (CDN), and basic cloud computing services such as a big data and artificial intelligence platform.

[0037] The task scheduling method is applied to a scene in the field of digital medicine. The client is a medical image terminal device operated by a doctor or a patient. The medical image terminal device is connected to the server through a wireless network to send video stream data of the patient, and then the video stream data is scheduled on the server.

[0038] Referring to Figure 2 , Fig. 1 is a flowchart of a task scheduling method based on edge computing provided by an embodiment of the present application. The task scheduling method can be applied to a server in Figure 1 to obtain video stream data related to medical images, medical models, and the like. As shown in Figure 2 , the task scheduling method is applied to a model training scene. The model training includes a training task and an inference task. The task scheduling method can include the following steps:

[0039] In step S201, the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current time is obtained.

[0040] The time window is a preset time length. The training task refers to training a model using a video stream to obtain a trained model. The inference task refers to inferring a model using a video stream to obtain an inference result. The video stream refers to the transmission of video data, which can be processed as a stable and continuous stream through a network. The video stream is provided by the client. For example, in the scene of diagnosing Parkinson's disease, a doctor collects the facial video stream of a patient during a conversation by operating a medical image terminal device, and transmits the facial video stream to the server, so that the server obtains the facial video stream. The processing resource allocation amount refers to the occupation of a graphics processing unit (GPU) resource. Therefore, the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current time is obtained to facilitate subsequent task scheduling.

[0041] For example, in the scenario of diagnosing Parkinson's disease, the doctor collects the patient's facial video stream when the patient is talking by operating the medical image terminal device, obtains two facial video streams, and under the resource uniform allocation strategy, allocates the 3 GPUs to the 2 facial video streams. Since each facial video stream corresponds to a training task and an inference task, that is, there are 4 tasks in total, each task occupies 3 / 4 of the GPU, and therefore, the processing resource allocation amount of the training task and the inference task corresponding to each facial video stream in the previous time window at the current moment is 3 / 4 of the GPU.

[0042] In step S202, for any video stream, the training task and the inference task corresponding to the video stream are used to infer each verification data in the preset verification data set, obtain the inference result of the corresponding verification data, detect whether the true result of each verification data is the same as the corresponding inference result, obtain the detection result of the corresponding verification data, and determine the proportion of the verification data whose detection result is the same in the preset verification data set as the task accuracy of the corresponding video stream.

[0043] The verification data set is the data sample reserved for training the model, and is used for training the hyperparameters of the model. The task accuracy refers to the performance of the model under the corresponding task, and in the present application, it refers to the model accuracy trained by the video stream under the training task and the inference task.

[0044] The process of training the model using the video stream includes the training task and the inference task, so the training task and the inference task corresponding to the video stream are used to infer each verification data in the preset verification data set, that is, the model trained by each video stream is used to infer each verification data in the preset verification data set, and the model parameters trained under each video stream are different. Therefore, for any video stream, the model trained based on the video stream is used to input each verification data in the preset verification data set into the model, and the inference result of the corresponding verification data is obtained. Based on the inference result of each verification data in the preset verification data set, it is detected whether the true result of each verification data is the same as the corresponding inference result, and the detection result of the corresponding verification data is obtained. If the detection result is the same, it means that the accuracy of the model trained by the video stream is high, and if the detection result is not the same, the accuracy of the model trained by the video stream is poor. Therefore, the proportion of the verification data whose detection result is the same in the preset verification data set is taken as the task accuracy of the video stream, which indirectly represents the training accuracy of the model under the training task and the inference task corresponding to the video stream.

[0045] For example, in the process of diagnosing Parkinson's disease, the doctor collects the face video stream of the patient during the conversation by operating the medical image terminal device, obtains two face video streams, takes any face video stream as a target face video stream, trains the medical model by using the target face video stream, and performs the training task and the inference task, obtains the trained medical model, and uses the trained medical model to diagnose whether the patient has Parkinson's disease. Meanwhile, a plurality of face video streams in the historical medical video stream are selected to form a preset verification data set, and then each face video stream in the preset verification data set is input into the trained medical model to obtain an inference result of whether the patient has Parkinson's disease. The real result of whether the patient has Parkinson's disease corresponding to each face video stream in the preset verification data set is known, and it is detected whether the inference result of each face video stream in the preset verification data set is the same as the real result. If they are the same, it means that the diagnosis result of the trained medical model is accurate and the training precision is high. The first number of face video streams corresponding to the same inference result and real result is counted, wherein the larger the first number is, the higher the training precision of the trained medical model is, and the more accurate the diagnosis result of the trained medical model is. Then, the ratio between the first number and the total number of face video streams in the preset verification data set is calculated. The ratio is the training precision of the trained medical model, and also reflects the task precision of the training task and the inference task corresponding to the target face video stream.

[0046] In step S203, the average of the task precisions of all video streams is calculated. If the average is less than a first preset threshold, the K first target video streams with the highest task precisions in all video streams and the M second target video streams with the lowest task precisions in all video streams are determined.

[0047] The task precision of each video stream is obtained by using the above step S202, and then the average of the task precisions of all video streams is calculated. Since the range of the task precision is [0, 1], the first preset threshold is set according to the range of the task precision, for example, the first preset threshold is set to 0.5, which is not limited by the present application. The average is compared with the first preset threshold. If the average is not less than the first preset threshold, it means that the distribution strategy at the current moment is reasonable, and the edge server continues to operate according to the distribution strategy. Otherwise, if the average is less than the first preset threshold, it means that the distribution strategy at the current moment is unreasonable and needs to be adjusted. Then, the K first target video streams with the highest task precisions in all video streams and the M second target video streams with the lowest task precisions in all video streams are determined. K and M are both integers greater than 0. For example, the doctor collects five face video streams of patients during the conversation, and the task precisions of the five face video streams at the current moment are 0.5, 0.6, 0.4, 0.4 and 0.3 respectively. The average of the task precisions of the five face video streams is calculated as The first preset threshold is set to 0.5, and since 0.44 is less than 0.5, it is indicated that the training accuracy of the medical model is poor due to unreasonable resource allocation strategy at the current moment, the result of diagnosing Parkinson's disease is inaccurate, and the resource allocation strategy needs to be adjusted to maximize the training accuracy of the medical model. Therefore, according to the size of the task accuracy, the facial video stream corresponding to the task accuracy of 0.6 is determined as the first target video stream, and the facial video stream corresponding to the task accuracy of 0.3 is determined as the second target video stream, that is, K and M are both 1. In some optional embodiments, after calculating the mean value of the task accuracy of all video streams, if the mean value is less than the first preset threshold, a third target video stream with the highest task accuracy in all video streams is determined, and the task configuration gear of the training task and the inference task corresponding to the third target video stream is obtained.

[0048] In the current time window formed by the preset time length after the current moment, the task configuration gear of the training task and the inference task corresponding to the third target video stream is reduced.

[0049] The task configuration gear is the priority of each task. Considering the limited edge service resources, the task configuration gear is set for each task to facilitate the edge server to allocate resources to the task with a higher task configuration gear first. Therefore, if the mean value is less than the first preset threshold, the third target video stream with the highest task accuracy in all video streams is determined, and the task configuration gear of the training task and the inference task corresponding to the third target video stream is obtained. The higher the task configuration gear is, the higher the training accuracy of the model corresponding to the task is, and the less resources are needed in the subsequent training process. Therefore, in the current time window formed by the preset time length after the current moment, the task configuration gear of the training task and the inference task corresponding to the third target video stream is reduced.

[0050] Optionally, suppose there are L gears for the task configuration gear, and the range of the task configuration gear of the training task is [ ], the range of the task configuration gear of the inference task is [ ], the task configuration gears of the training task and the inference task corresponding to the third target video stream are and , then after reducing the task configuration gears of the training task and the inference task corresponding to the third target video stream, they are:

[0051]

[0052]

[0053] wherein, is the task configuration gear of the training task corresponding to the third target video stream after the task configuration gear is reduced; decrease the task configuration level of the training task corresponding to the third target video stream; decrease the maximum task configuration level of the training task; decrease the minimum task configuration level of the training task; decrease the maximum task configuration level of the inference task; decrease the minimum task configuration level of the inference task; is a maximum function, and the task configuration level is prevented from being lower than the minimum task configuration level.

[0054] For example, a doctor collects 5 facial video streams of patients in the process of diagnosing Parkinson's disease, and in the case that the average of the task accuracy of the 5 facial video streams is less than a first preset threshold, the third target video stream with the highest task accuracy in the 5 facial video streams is determined. Assuming that the task configuration level has a total of 10 levels, i.e., 1 level to 10 level, the task configuration levels of the training task and the inference task corresponding to the third target video stream are 8 level and 9 level respectively, then the task configuration levels of the training task and the inference task corresponding to the third target video stream are both decreased by 1 level, and become 7 level and 8 level respectively.

[0055] In some optional embodiments, after calculating the average of the task accuracy of all video streams, if the average is less than the first preset threshold, a fourth target video stream with the lowest task accuracy in all video streams is determined, and the task configuration levels of the training task and the inference task corresponding to the fourth target video stream are obtained;

[0056] In a current time window formed by a preset time length after the current time, the task configuration levels of the training task and the inference task corresponding to the fourth target video stream are increased.

[0057] Similarly, the task configuration level refers to the priority of each task. Considering the limited resources of the edge service, the task configuration level of each task is set so that the edge server preferentially allocates resources to tasks with higher task configuration levels. Therefore, if the average is less than the first preset threshold, a fourth target video stream with the lowest task accuracy in all video streams is determined, and the task configuration levels of the training task and the inference task corresponding to the fourth target video stream are obtained. The lower the task configuration level, the lower the training accuracy of the model corresponding to the task, and the more resources it needs in the subsequent training process to ensure the accuracy of the model. Therefore, in a current time window formed by a preset time length after the current time, the task configuration levels of the training task and the inference task corresponding to the fourth target video stream are increased.

[0058] Optionally, assuming that the task configuration level has a total of L levels, and the range of the task configuration level of the training task is [ ], and the range of the task configuration level of the inference task is [ The task configuration gears of the training task and the inference task corresponding to the fourth target video stream are respectively and After the task configuration gears of the training task and the inference task corresponding to the fourth target video stream are improved, they are

[0059]

[0060]

[0061] wherein, is the task configuration gear of the training task corresponding to the fourth target video stream after being improved; is the task configuration gear of the inference task corresponding to the fourth target video stream after being improved; is the maximum task configuration gear of the training task; is the minimum task configuration gear of the training task; is the maximum task configuration gear of the inference task; is the minimum task configuration gear of the inference task; is the minimum value function, which avoids the task configuration gear being greater than the maximum task configuration gear.

[0062] For example, a doctor collects five facial video streams of patients in the process of diagnosing Parkinson's disease, and determines the fourth target video stream with the lowest task accuracy in the five facial video streams in the case that the average of the task accuracy of the five facial video streams is less than a first preset threshold. Assuming that the task configuration gears have 10 gears, i.e. 1-10 gears, the task configuration gears of the training task and the inference task corresponding to the fourth target video stream are 3 gears and 4 gears respectively, then the task configuration gears of the training task and the inference task corresponding to the third target video stream are both increased by 1 gear, i.e. 4 gears and 5 gears.

[0063] In step S204, the processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced in a current time window formed by a preset time length after the current time, and the surplus resource obtained after the reduction is allocated to the training task and the inference task corresponding to the M second target video streams.

[0064] The step S203 is configured to determine whether the resource allocation and the task scheduling in the previous time window at the current moment are reasonable according to the task accuracy of the video stream. If not, the K first target video streams with the highest task accuracy and the M second target video streams with the lowest task accuracy in all the video streams are determined. The processing resource allocation of each task in the current time window is dynamically adjusted according to the processing resource allocation of each task of the first target video stream and the second target video stream in the previous time window. Therefore, in the current time window formed by the preset time length after the current moment, the processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced, and the surplus resource obtained after the reduction is allocated to the training task and the inference task corresponding to the M second target video streams. The processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced by 1 / G virtual GPUs, and the surplus resource is formed. The surplus resource is evenly allocated to the training task and the inference task corresponding to the M second target video streams. It can be understood that when K=M, the processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced by 1 / G virtual GPUs, and the processing resource allocation of the training task and the inference task corresponding to the M second target video streams is increased.

[0065] Optionally, each GPU is divided into G virtual GPUs by using a GPU virtualization technology. Each virtual GPU can independently allocate GPU resources. The processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced by 1 / G virtual GPUs, respectively, to form surplus resources. The surplus resources are evenly allocated to the training task and the inference task corresponding to the M second target video streams. It can be understood that when K=M, the processing resource allocation of the training task and the inference task corresponding to the K first target video streams is reduced by 1 / G virtual GPUs, and the processing resource allocation of the training task and the inference task corresponding to the M second target video streams is increased.

[0066] For example, in the scene of diagnosing Parkinson's disease, a doctor collects face video streams of a patient during a conversation by operating a medical image terminal device, obtains 6 face video streams, and evenly allocates 6 GPUs to the 6 face video streams. Each face video stream corresponds to a training task and an inference task, that is, a total of 12 tasks, and each task occupies 1 / 2 GPU. According to the task accuracy of each face video stream, 2 first target video streams with the highest task accuracy and 2 second target video streams with the lowest task accuracy are determined in 5 face video streams. It is assumed that each GPU can be divided into 6 virtual GPUs. The processing resource allocation of the training task and the inference task corresponding to each first target video stream is reduced by 1 / 6 virtual GPUs, respectively. The processing resource allocation of the training task and the inference task corresponding to each first target video stream after the reduction is 1 / 3 virtual GPU, that is, The surplus resource amount of 4 tasks corresponding to the 2 first target video streams is 1 / 3 virtual GPU, and then the surplus resource is evenly allocated to the training task and the inference task corresponding to the 2 second target video streams. The virtual GPU is averagely allocated to the training task and the inference task corresponding to the second target video stream, so that the processing resource allocation amount occupied by the training task and the inference task corresponding to the second target video stream is respectively increased by 1 / 6 virtual GPU. The task scheduling method based on edge computing provided by the application is applied to a model training scene, the model training includes a training task and an inference task, and the task scheduling method includes the following steps: acquiring the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current moment, wherein the time window is a preset time length; for any video stream, using the training task and the inference task corresponding to the video stream, performing inference on each verification data in a preset verification data set to obtain an inference result corresponding to the verification data; detecting whether the real result of each verification data is same as the corresponding inference result to obtain a detection result corresponding to the verification data, and determining the proportion of the verification data whose detection result is same in the preset verification data set as the task accuracy of the corresponding video stream; calculating the average value of the task accuracy of all video streams, if the average value is less than a first preset threshold, determining K first target video streams with the highest task accuracy and M second target video streams with the lowest task accuracy in all video streams, K and M are both integers greater than 0; in a current time window formed by a preset time length after the current moment, the processing resource allocation amount occupied by the training task and the inference task corresponding to the K first target video streams is reduced, and the surplus resource obtained after the reduction is allocated to the training task and the inference task corresponding to the M second target video streams, the processing resource allocation amount of the training task and the inference task in the next time window is dynamically adjusted in real time based on the task accuracy of the training task and the inference task in the previous time window, so that the resource utilization rate and the model training accuracy are optimized, and the processing effect of the edge server is improved.

[0067] Optionally, based on the task scheduling method of the above Figure 2 embodiment, as Figure 3 shown, the task scheduling method provided by the application according to the resource utilization rate, specifically includes:

[0068] After acquiring the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current moment, the task scheduling method further includes:

[0069] Step S301, for the training task and the inference task corresponding to any video stream, the resource utilization rate of the training task and the inference task is calculated according to the processing resource allocation amount, and the average value of the resource utilization rate of the training task and the inference task corresponding to all video streams is calculated.

[0070] The resource utilization rate is a proportion of the processing resource allocation amount in the total resource amount. Therefore, for a training task and an inference task corresponding to any video stream, the resource utilization rates of the training task and the inference task are calculated according to the processing resource allocation amount. One video stream corresponds to a resource utilization rate of a training task and a resource utilization rate of an inference task. The resource utilization rates of the training task and the inference task corresponding to each video stream are obtained. The average of the resource utilization rates of all tasks is calculated according to the resource utilization rates of the training task and the inference task corresponding to all video streams, so as to intuitively reflect the total resource allocation state.

[0071] For example, in the scenario of diagnosing Parkinson's disease, the doctor collects the facial video stream of the patient during the conversation by operating the medical image terminal device, and obtains two facial video streams. Assuming that the total resource amount is 100, the processing resource allocation amounts of the training task and the inference task corresponding to one facial video stream are 20 and 10 respectively, the resource utilization rates of the corresponding training task and inference task are 1 / 5 and 1 / 10 respectively, and the processing resource allocation amounts of the training task and the inference task corresponding to the other facial video stream are 20 and 30 respectively, the resource utilization rates of the corresponding training task and inference task are 1 / 5 and 3 / 10 respectively, and the average of the resource utilization rates of the training task and the inference task corresponding to all facial video streams is , that is, .

[0072] In step S302, if the average is less than the second preset threshold, the first training task group and the first inference task group with the lowest resource utilization rate in all video streams, and the second training task group and the second inference task group with the highest resource utilization rate in all video streams are determined.

[0073] The first training task group refers to a set of multiple training tasks, and the first inference task group refers to a set of multiple inference tasks. Similarly, the second training task group refers to a set of multiple training tasks, and the second inference task group refers to a set of multiple inference tasks. The threshold, also known as the critical value, refers to an effect that can produce the lowest value or the highest value. Therefore, when the average is less than the second preset threshold, the first training task group and the first inference task group with the lowest resource utilization rate in all video streams, and the second training task group and the second inference task group with the highest resource utilization rate in all video streams are obtained.

[0074] Since the range of the resource utilization rate is [0, 1], the second preset threshold is adaptively set according to the range of the resource utilization rate, for example, the second preset threshold is set to 0.5, which is not limited by the present application. The average value is compared with the second preset threshold. If the average value is not less than the second preset threshold, it indicates that the allocation strategy at the current moment is reasonable, and the edge server continues to proceed with the allocation strategy. Otherwise, if the average value is less than the second preset threshold, it indicates that the allocation strategy at the current moment is unreasonable and needs to be adjusted. Then, the resource utilization rates of the training tasks of all video streams are sorted in ascending order to obtain a first sorting result of the resource utilization rates of the training tasks, and the training tasks corresponding to the first A resource utilization rates in the first sorting result are taken as a first training task group. Meanwhile, the resource utilization rates of the inference tasks of all video streams are sorted in ascending order to obtain a second sorting result of the resource utilization rates of the inference tasks, and the inference tasks corresponding to the first B resource utilization rates in the second sorting result are taken as a first inference task group. A and B are both integers greater than 0. For example, a doctor collects 5 facial video streams of patients in the process of diagnosing Parkinson's disease, and the resource utilization rates of the inference tasks corresponding to the 5 facial video streams are 1 / 5, 1 / 20, 3 / 10, 1 / 10 and 3 / 10 respectively. The inference tasks corresponding to 1 / 20 and 1 / 10 are taken as the first inference task group. The resource utilization rates of the training tasks corresponding to the 5 facial video streams are 1 / 20, 1 / 20, 4 / 10, 1 / 10 and 3 / 10 respectively. The training tasks corresponding to 1 / 20 and 1 / 20 are taken as the first training task group.

[0075] Similarly, the resource utilization rates of the training tasks of all video streams are sorted in descending order to obtain a third sorting result of the resource utilization rates of the training tasks, and the training tasks corresponding to the first A resource utilization rates in the third sorting result are taken as a second training task group. Meanwhile, the resource utilization rates of the inference tasks of all video streams are sorted in descending order to obtain a fourth sorting result of the resource utilization rates of the inference tasks, and the inference tasks corresponding to the first B resource utilization rates in the fourth sorting result are taken as a second inference task group. For example, a doctor collects five facial video streams of patients in the process of diagnosing Parkinson's disease, and the resource utilization rates of the inference tasks corresponding to the five facial video streams are 1 / 5, 1 / 20, 3 / 10, 1 / 10 and 3 / 10 respectively. The inference tasks corresponding to 3 / 10 and 3 / 10 are taken as the second inference task group. The resource utilization rates of the training tasks corresponding to the five facial video streams are 1 / 10, 1 / 20, 4 / 10, 1 / 10 and 3 / 10 respectively, and the training tasks corresponding to 4 / 10 and 3 / 10 are taken as the second training task group. In some optional embodiments, if the average value is less than the second preset threshold, the m fifth target video streams with the lowest resource utilization rates and the n sixth target video streams with the highest resource utilization rates are obtained according to the resource utilization rates of the training tasks and the inference tasks corresponding to the video streams, the training tasks and the inference tasks in the m fifth target video streams are correspondingly grouped into a first training task group and a first inference task group, and the training tasks and the inference tasks in the n sixth target video streams are correspondingly grouped into a second training task group and a second inference task group, wherein m and n are both integers greater than 0. Specifically, for any video stream, the resource utilization rate sum of the video stream is calculated according to the resource utilization rates of the training tasks and the inference tasks corresponding to the video stream, all resource utilization rate sums of the video streams are sorted in ascending order, the first m resource utilization rate sums in the sorted order are taken as the fifth target video streams, and the last n resource utilization rate sums in the sorted order are taken as the sixth target video streams.

[0076] It should be noted that in other embodiments, the fifth target video stream and the sixth target video stream can also be confirmed according to the average value between the resource utilization rates of the training tasks and the inference tasks corresponding to the video streams, and the present application is not limited thereto.

[0077] In step S303, the processing resource allocation amount occupied by the first training task group and the first inference task group is reduced in a current time window formed by a preset time length after the current time, and the surplus resource obtained after the reduction is allocated to the second training task group and the second inference task group.

[0078] The step S302 is configured to determine whether the resource allocation and task scheduling in the previous time window at the current moment are reasonable according to the resource utilization of the training tasks and the inference tasks corresponding to the video streams. If not, the first training task group and the first inference task group with the lowest resource utilization and the second training task group and the second inference task group with the highest resource utilization in all video streams are determined. The processing resource allocation of each task in the current time window is dynamically adjusted according to the resource utilization of each task in the previous time window. Therefore, in the current time window formed by the preset time length after the current moment, the processing resource allocation of the first training task group and the first inference task group is reduced, and the surplus resource obtained after the reduction is allocated to the second training task group and the second inference task group. More resources are allocated to the tasks with excessively high resource utilization, and fewer resources are allocated to the tasks with excessively low resource utilization. The real-time requirement of the dynamic scene is met with low computational complexity, and the load balancing problem in the large-scale edge computing scene is effectively solved.

[0079] Optionally, each GPU is divided into G virtual GPUs by using the GPU virtualization technology. Each virtual GPU can independently allocate GPU resources. The processing resource allocation of each task in the first training task group and the first inference task group is reduced by 1 / G virtual GPUs, and the surplus resource is formed. The surplus resource is evenly allocated to each task in the second training task group and the second inference task group.

[0080] For example, it is assumed that each GPU can be divided into 6 virtual GPUs. The processing resource allocation of each task in the first training task group and the first inference task group is GPU, and the processing resource allocation of each task in the second training task group and the second inference task group is also GPU. The processing resource allocation of each task in the first training task group and the first inference task group is reduced by 1 / 6 virtual GPUs. After the reduction, the processing resource allocation of each task in the first training task group and the first inference task group is 1 / 3 virtual GPUs, that is, It is assumed that the first training task group and the first inference task group include 4 tasks. The surplus resource amount formed is virtual GPUs. Furthermore, the virtual GPUs are evenly allocated to each task in the two second training task groups and the second inference task groups. The processing resource allocation of each task in the second training task group and the second inference task group is increased by 1 / 6 virtual GPUs.

[0081] In some optional embodiments, after determining the second training task group and the second inference task group with the highest resource utilization in all video streams, the task configuration gear of the second training task group and the second inference task group is obtained; and the task configuration gear of the second training task group and the second inference task group is reduced in a current time window formed by a preset time length after the current time.

[0082] wherein, assuming that there are L gears in total for the task configuration gear, and the range of the task configuration gear of the training task is [ ], the range of the task configuration gear of the inference task is [ ], the task configuration gear of any training task in the second training task group is , and the task configuration gear of any inference task in the second inference task group is , then the task configuration gear of the training task and the inference task after being reduced is:

[0083]

[0084]

[0085] wherein, is the task configuration gear of the training task after being reduced; is the task configuration gear of the inference task after being reduced; is the maximum task configuration gear of the training task; is the minimum task configuration gear of the training task; is the maximum task configuration gear of the inference task; is the minimum task configuration gear of the inference task; is the maximum function, which avoids the task configuration gear being lower than the minimum task configuration gear.

[0086] For example, based on the face video streams collected by a doctor in the process of diagnosing Parkinson's disease in 5 patients, after determining the second training task group and the second inference task group with the highest resource utilization in the 5 face video streams, wherein the second training task group and the second inference task group both contain one task, assuming that there are 10 gears in total for the task configuration gear, i.e. 1 gear to 10 gears, the task configuration gears of the training task in the second training task group and the inference task in the second inference task group are 8 gears and 9 gears respectively, then the task configuration gears of the training task in the second training task group and the inference task in the second inference task group are both reduced by 1 gear, corresponding to 7 gears and 8 gears.

[0087] In some optional embodiments, after determining the first training task group and the first inference task group with the lowest resource utilization in all video streams, the task configuration gear of the first training task group and the first inference task group is obtained; and within a current time window formed by a preset time length after the current time, the task configuration gear of the first training task group and the first inference task group is increased.

[0088] Similarly, assuming that there are L gears of task configuration, the range of the task configuration gear of the training task is [ ], the range of the task configuration gear of the inference task is [ ], the task configuration gear of any training task in the first training task group is , and the task configuration gear of any inference task in the first inference task group is , then the task configuration gear of the training task and the inference task after being increased is:

[0089]

[0090]

[0091] wherein, is the task configuration gear of the training task after being increased; is the task configuration gear of the inference task after being increased; is the maximum task configuration gear of the training task; is the minimum task configuration gear of the training task; is the maximum task configuration gear of the inference task; is the minimum task configuration gear of the inference task; is the minimum function, which avoids the task configuration gear being greater than the maximum task configuration gear.

[0092] For example, based on the face video streams collected by a doctor in the process of diagnosing Parkinson's disease of 5 patients, after determining the first training task group and the first inference task group with the lowest resource utilization in the 5 face video streams, wherein the first training task group and the first inference task group both contain one task, assuming that there are 10 gears of task configuration, i.e. 1 gear to 10 gears, the task configuration gears of the training task in the first training task group and the inference task in the first inference task group are 3 gears and 4 gears respectively, then the task configuration gears of the training task in the first training task group and the inference task in the first inference task group are both increased by 1 gear, which corresponds to 4 gears and 5 gears.

[0093] corresponding to the task scheduling method of the above embodiments, Figure 4A structural block diagram of a task scheduling device based on edge computing is shown. For the convenience of description, only the part related to the embodiment of the present application is shown.

[0094] Referring to Figure 4 The task scheduling device is applied to a model training scene, and the model training includes training tasks and inference tasks. The task scheduling device comprises:

[0095] The allocation amount acquisition module 41 is configured to acquire the processing resource allocation amount of the training task and the inference task corresponding to each video stream in a previous time window at a current time, wherein the time window is a preset time length.

[0096] The inference analysis module 42 is configured to, for any video stream, use the training task and the inference task corresponding to the video stream to perform inference on each verification data in a preset verification data set, and obtain an inference result of the corresponding verification data.

[0097] The precision detection module 43 is configured to detect whether the true result of each verification data is the same as the corresponding inference result, and obtain a detection result of the corresponding verification data. The proportion of the verification data whose detection result is the same in the preset verification data set is determined as the task precision of the corresponding video stream.

[0098] The first determination module 44 is configured to calculate the mean value of the task precision of all video streams. If the mean value is less than a first preset threshold, the K first target video streams with the highest task precision in all video streams and the M second target video streams with the lowest task precision in all video streams are determined, and K and M are both integers greater than 0.

[0099] The first adjustment module 45 is configured to, in a current time window formed by a preset time length after the current time, reduce the processing resource allocation amount occupied by the training task and the inference task corresponding to the K first target video streams, and allocate the surplus resource obtained after the reduction to the training task and the inference task corresponding to the M second target video streams.

[0100] Optionally, the first determination module 44 comprises:

[0101] The first target acquisition unit is configured to, if the mean value is less than the first preset threshold, determine a third target video stream with the highest task precision in all video streams, and acquire the task configuration gear of the training task and the inference task corresponding to the third target video stream.

[0102] The first gear down unit is configured to, in a current time window formed by a preset time length after the current time, reduce the task configuration gear of the training task and the inference task corresponding to the third target video stream.

[0103] Optionally, the first determination module 44 comprises:

[0104] The second target acquisition unit is configured to, if the average value is less than the first preset threshold, determine a fourth target video stream with the lowest task accuracy among all the video streams, and acquire task configuration gears of training tasks and inference tasks corresponding to the fourth target video stream.

[0105] The first gear increasing unit is configured to, within a current time window formed by a preset time length after the current time, increase the task configuration gears of the training tasks and the inference tasks corresponding to the fourth target video stream.

[0106] Optionally, the task scheduling apparatus further comprises:

[0107] The utilization rate calculation module is configured to, after acquiring the processing resource allocation of the training tasks and the inference tasks corresponding to each video stream within a previous time window before the current time, calculate, for any training task and inference task corresponding to a video stream, resource utilization rates of the training task and the inference task respectively according to the processing resource allocation, and calculate an average value of the resource utilization rates of the training tasks and the inference tasks corresponding to all the video streams.

[0108] The second determination module is configured to, if the average value is less than the second preset threshold, determine a first training task group and a first inference task group with the lowest resource utilization rates among all the video streams, and a second training task group and a second inference task group with the highest resource utilization rates among all the video streams.

[0109] The second adjustment module is configured to, within a current time window formed by the preset time length after the current time, reduce the processing resource allocation occupied by the first training task group and the first inference task group, and allocate the surplus resource obtained after the reduction to the second training task group and the second inference task group.

[0110] Optionally, the second determination module comprises:

[0111] The third target acquisition unit is configured to, after determining the second training task group and the second inference task group with the highest resource utilization rates among all the video streams, acquire task configuration gears of the second training task group and the second inference task group.

[0112] The second gear decreasing unit is configured to, within a current time window formed by a preset time length after the current time, decrease the task configuration gears of the second training task group and the second inference task group.

[0113] Optionally, the second determination module comprises:

[0114] The fourth target acquisition unit is configured to, after determining the first training task group and the first inference task group with the lowest resource utilization rates among all the video streams, acquire task configuration gears of the first training task group and the first inference task group.

[0115] The second profile unit is configured to improve the task configuration profile of the first training task group and the first inference task group in a current time window formed by a preset time length after a current time.

[0116] It should be noted that the information interaction between the above modules, units, and the execution process are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by them can be referred to the method embodiments part, which will not be repeated here.

[0117] Figure 5 A structural schematic diagram of a computer device is provided for the third embodiment of the present application. Figure 5 As shown in the figure, the computer device of the embodiment comprises at least one processor (only one is shown in the figure), a memory, and a computer program stored in the memory and executable on the at least one processor, and the processor executes the computer program to implement the steps in any of the task scheduling method embodiments described above. Figure 5

[0118] The computer device can include, but is not limited to, a processor, a memory. Those skilled in the art can understand that, Figure 5 only an example of the computer device, and does not constitute a limitation on the computer device. The computer device can include more or fewer components than those shown, or combine certain components, or different components, for example, it can also include a network interface, a display screen, and an input device, etc.

[0119] The processor can be a CPU, and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), ready programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0120] ​The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory can be a memory of the computer device, and the internal memory provides an environment for running of the operating system and the computer-readable instructions in the readable storage medium. The readable storage medium can be a hard disk of the computer device, and in other embodiments, can also be an external storage device of the computer device, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory can include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a BootLoader, data, and other programs, such as program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.

[0121] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of each functional unit and module is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the unit and module in the above device can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. If the integrated unit is realized in the form of software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the above-mentioned embodiment methods, which can be realized by a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer readable medium cannot be electric carrier signal and telecommunication signal.

[0122] The present application realizes all or part of the processes in the above-mentioned embodiment methods, which can also be completed by a computer program product. When the computer program product runs on the computer equipment, it makes the computer equipment execute the steps in the above-mentioned embodiment methods.

[0123] In the above-mentioned embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.

[0124] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0125] In the embodiments provided by the present application, it should be understood that the disclosed apparatus / computer device and method can be implemented in other manners. For example, the described apparatus / computer device embodiments are merely schematic. For example, the division of the modules or units can be different, and each can include a plurality of sub-units. Some or all of the modules or units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0126] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0127] The above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalent ones. Such modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A task scheduling method based on edge computing, characterized in that, The task scheduling method is applied to a model training scenario, where model training includes training tasks and inference tasks. The task scheduling method includes: Obtain the processing resource allocation for each video stream in the previous time window at the current moment, which is a preset duration. For any video stream, the training task and inference task corresponding to the video stream are used to infer each verification data in the preset verification dataset to obtain the inference result of the corresponding verification data; The actual result of each verification data is detected to be the same as the corresponding inferred result, and the detection result of the corresponding verification data is obtained. The proportion of verification data with the same detection result in the preset verification dataset is determined as the task accuracy of the corresponding video stream. Calculate the average task accuracy of all video streams. If the average is less than a first preset threshold, then determine the K first target video streams with the highest task accuracy among all video streams, and the M second target video streams with the lowest task accuracy among all video streams, where K and M are both integers greater than 0. Within the current time window formed by the preset duration after the current moment, the amount of processing resources allocated to the training and inference tasks corresponding to the K first target video streams is reduced, and the free resources obtained after the reduction are allocated to the training and inference tasks corresponding to the M second target video streams. After obtaining the processing resource allocation for the training and inference tasks corresponding to each video stream within the previous time window, the task scheduling method further includes: For any training task and inference task corresponding to any video stream, the resource utilization rate of the training task and inference task is calculated according to the processing resource allocation, and the average resource utilization rate of the training task and inference task corresponding to all video streams is calculated. If the average value is less than the second preset threshold, then the first training task group and the first inference task group with the lowest resource utilization rate among all video streams are determined, and the second training task group and the second inference task group with the highest resource utilization rate among all video streams are determined. Within the current time window formed by the preset duration after the current moment, the amount of processing resources allocated to the first training task group and the first inference task group is reduced, and the free resources obtained after the reduction are allocated to the second training task group and the second inference task group. After determining the second training task group and the second inference task group with the highest resource utilization among all video streams, the following were also included: Obtain the task configuration profiles for the second training task group and the second inference task group; Within the current time window, which is defined by the preset duration following the current moment, the task configuration levels of the second training task group and the second inference task group are reduced.

2. The task scheduling method according to claim 1, characterized in that, After calculating the average task precision across all video streams, the following is also included: If the mean is less than the first preset threshold, determine the third target video stream with the highest task accuracy among all video streams, and obtain the task configuration level of the training task and inference task corresponding to the third target video stream. Within the current time window, which is composed of the preset duration after the current moment, the task configuration level of the training task and the inference task corresponding to the third target video stream is reduced.

3. The task scheduling method according to claim 1, characterized in that, After calculating the average task precision across all video streams, the following is also included: If the mean is less than the first preset threshold, determine the fourth target video stream with the lowest task accuracy among all video streams, and obtain the task configuration level of the training task and inference task corresponding to the fourth target video stream. Within the current time window, which is composed of the preset duration after the current moment, the task configuration level of the training task and the inference task corresponding to the fourth target video stream is increased.

4. The task scheduling method according to claim 1, characterized in that, After determining the first training task group and the first inference task group with the lowest resource utilization among all video streams, the following are also included: Obtain the task configuration levels for the first training task group and the first inference task group; Within the current time window, which is defined by the preset duration following the current moment, the task configuration level of the first training task group and the first inference task group is increased.

5. A task scheduling device based on edge computing, characterized in that, The task scheduling device is applied in a model training scenario, where model training includes training tasks and inference tasks. The task scheduling device includes: The allocation module is used to obtain the processing resource allocation for each video stream corresponding to the training and inference tasks within the previous time window at the current moment, where the time window is a preset duration. The inference analysis module is used to infer the inference results of each verification data in a preset verification dataset for any given video stream, using the training task and inference task corresponding to the video stream. The accuracy detection module is used to detect whether the actual result of each verification data is the same as the corresponding inferred result, obtain the detection result of the corresponding verification data, and determine the proportion of verification data with the same detection result in the preset verification dataset as the task accuracy of the corresponding video stream. The first determining module is used to calculate the average task accuracy of all video streams. If the average is less than a first preset threshold, then the K first target video streams with the highest task accuracy and the M second target video streams with the lowest task accuracy are determined among all video streams, where K and M are both integers greater than 0. The first adjustment module is used to reduce the amount of processing resources allocated to the training and inference tasks corresponding to the K first target video streams within the current time window formed by the preset duration after the current time, and allocate the free resources obtained after the reduction to the training and inference tasks corresponding to the M second target video streams. After obtaining the processing resource allocation for the training and inference tasks corresponding to each video stream within the previous time window, the task scheduling device further includes: The utilization calculation module is used to calculate the resource utilization rate of the training task and the inference task corresponding to any video stream, based on the processing resource allocation, and to calculate the average resource utilization rate of the training task and the inference task corresponding to all video streams. The second determining module is used to determine the first training task group and the first inference task group with the lowest resource utilization rate among all video streams, and the second training task group and the second inference task group with the highest resource utilization rate among all video streams if the average value is less than the second preset threshold. The second adjustment module is used to reduce the amount of processing resources allocated to the first training task group and the first inference task group within the current time window formed by the preset duration after the current time, and to allocate the free resources obtained after the reduction to the second training task group and the second inference task group. The third target acquisition unit is used to acquire the task configuration level of the second training task group and the second inference task group after determining the second training task group and the second inference task group with the highest resource utilization among all video streams. The second downgrade unit is used to reduce the task configuration level of the second training task group and the second inference task group within the current time window, which is composed of a preset duration after the current moment.

6. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the task scheduling method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the task scheduling method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Task allocation method and device, electronic equipment and storage medium

    CN117076131A

  • Hardware accuracy counters for application precision and quality feedback

    US20170185409A1