Task scheduling method, task scheduling device, vehicle-mounted equipment and readable storage medium
By obtaining on-board video data and equipment resources and dynamically allocating computing tasks, the problem of high resource consumption of on-board equipment is solved, computing power and data processing speed are improved, and resource utilization is optimized.
Patent Information
- Application Number
- CN202410903086.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-11-22
AI Technical Summary
In vehicle-mounted equipment, algorithms such as advanced driving assistance systems and driver monitoring systems have a huge amount of computing on vehicle-mounted video data, which affects computing power and data processing speed.
By obtaining the on-board video data and resource usage of on-board equipment, dynamically allocate computing tasks, rationally utilize the computing resources of each on-board equipment, and improve computing power and data processing speed.
It effectively improves the computing power and data processing speed of on-board equipment, optimizes resource allocation, reduces the situation of oversupply or tight resources, and improves the system response speed.
Smart Images

Figure CN119003113A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of task scheduling, and in particular, relates to a task scheduling method, a task scheduling device, a vehicle-mounted device, and a readable storage medium. Background Art
[0002] With the rapid development of smart device technology, in the field of in-vehicle video, it is no longer limited to video monitoring and storage functions, but also increasingly adds many intelligent functions. For example, the functions implemented by algorithms such as Advanced Driver Assistance Systems (ADAS) and Driver Monitoring Systems (DMS) have greatly improved the driving safety of vehicles. However, such algorithms require a large amount of calculations on in-vehicle video data, which consumes a huge amount of resources on in-vehicle devices and affects the computing power and data processing speed of in-vehicle devices. Summary of the invention
[0003] The embodiments of the present application provide a task scheduling method, a task scheduling device, a vehicle-mounted device, and a readable storage medium, which can improve the computing power and data processing speed of the vehicle-mounted device.
[0004] In a first aspect, an embodiment of the present application provides a task scheduling method, including:
[0005] Obtain vehicle video data;
[0006] Obtain resource usage of at least two vehicle-mounted devices;
[0007] For the at least two computing tasks of the vehicle-mounted video data, tasks are allocated to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices.
[0008] In an embodiment of the present application, by obtaining vehicle-mounted video data and obtaining the resource usage of at least two vehicle-mounted devices, tasks can be allocated to at least two vehicle-mounted devices for at least two computing tasks of the vehicle-mounted video data according to the resource usage of at least two vehicle-mounted devices, so as to achieve the purpose of rationally utilizing the computing resources of each vehicle-mounted device, thereby improving the computing power and data processing speed of each vehicle-mounted device.
[0009] In a second aspect, an embodiment of the present application provides a task scheduling device, including:
[0010] A data acquisition module, used to acquire vehicle-mounted video data;
[0011] A resource acquisition module, used to obtain resource usage of at least two vehicle-mounted devices;
[0012] The task allocation module is used to allocate tasks to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices for the at least two computing tasks of the vehicle-mounted video data.
[0013] In a third aspect, an embodiment of the present application provides a vehicle-mounted device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the task scheduling method described in the first aspect above is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the task scheduling method described in the first aspect above is implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a vehicle-mounted device, enables the vehicle-mounted device to execute the task scheduling method described in the first aspect above.
[0016] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a schematic diagram of a task scheduling system provided in an embodiment of the present application;
[0019] Figure 2 is a schematic flow chart of a task scheduling method provided in an embodiment of the present application;
[0020] Figure 3 is a schematic flow chart of determining the algorithm modules that need to be run on at least two vehicle-mounted devices respectively provided in an embodiment of the present application;
[0021] Figure 4 is an example graph of the training dataset;
[0022] Figure 5 is a structural diagram of a task scheduling device provided in an embodiment of the present application;
[0023] Figure 6It is a schematic diagram of the structure of the vehicle-mounted equipment provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may 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 to prevent unnecessary details from obstructing the description of the present application.
[0025] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0026] It should also be understood that the term "and / or" used in the present specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0027] It should also be understood that in the embodiments of the present application, "plurality" refers to two or more than two.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] It should be noted that the task scheduling method, task scheduling device, vehicle-mounted device and readable storage medium provided in the embodiments of the present application relate to the fields of cloud computing, edge computing and embedded systems, and in particular to the technology of dynamically allocating and scheduling computing tasks on embedded vehicle-mounted devices with limited resources. Of course, it is understandable that in addition to embedded vehicle-mounted devices, the embodiments of the present application are also applicable to non-embedded vehicle-mounted devices, and the present application does not limit the specific type of vehicle-mounted devices.
[0032] Taking embedded vehicle-mounted devices as an example, for embedded vehicle-mounted devices, their computing power, storage space, etc. are very limited due to factors such as cost and volume during their design. This brings a challenge: how to effectively process and respond to these huge data requirements under limited resource conditions, while also ensuring the response speed of the device and the stable operation of the system. In this context, the embodiment of the present application is aimed at complex computing tasks that need to be run on embedded vehicle-mounted devices. By allocating tasks to at least two embedded vehicle-mounted devices based on the resource usage of at least two embedded vehicle-mounted devices, the purpose of reasonably utilizing the computing resources of each embedded vehicle-mounted device can be achieved, and resource allocation can be optimized. Without significantly increasing the hardware cost of the embedded vehicle-mounted device, the device processing power and system response speed can be effectively improved.
[0033] For example, Figure 1 Schematic diagram of the task scheduling system provided by the embodiment of the present application is shown. Figure 1 ,The task scheduling system includes at least two vehicle-mounted devices, Figure 1 Two vehicle-mounted devices (i.e., vehicle-mounted device 101 and vehicle-mounted device 102) are used as an example, but are not limited to two, and may also be three, or more. When processing vehicle-mounted video data according to the video processing algorithm, the processing process may be divided into at least two computing tasks, and the vehicle-mounted devices in the task scheduling system are responsible for executing at least two computing tasks, and each vehicle-mounted device is responsible for executing different computing tasks.
[0034] In this embodiment, a vehicle-mounted device can be selected from the above task scheduling system as a master device. The master device is used to obtain vehicle-mounted video data, collect resource usage of all vehicle-mounted devices, and run a decision tree to determine which algorithm steps to run on different vehicle-mounted devices to process the vehicle-mounted video data based on the resource usage of each vehicle-mounted device.
[0035] Through this embodiment, it is possible to dynamically decide how to allocate tasks for the calculation of the video processing algorithm based on the resource usage of all vehicle-mounted devices in the above-mentioned task scheduling system, so as to achieve the purpose of most rationally utilizing the computing resources of all vehicle-mounted devices and reduce the situation where some vehicle-mounted devices have excess resources while some devices have tight resources.
[0036] See also Figure 2 , Figure 2 A schematic flowchart of a task scheduling method provided in an embodiment of the present application is shown. As an example but not a limitation, the method includes the following steps:
[0037] Step 201, obtaining vehicle-mounted video data.
[0038] Among them, the above-mentioned vehicle-mounted video data may refer to video data collected by a vehicle-mounted camera. Video data refers to a continuous sequence of images, which is essentially composed of a group of continuous images. Vehicle-mounted cameras include but are not limited to interior cameras, rear-view cameras, front-view cameras, top-view cameras, surround-view cameras, etc. Interior cameras are mainly used to monitor the interior of the vehicle, such as in-vehicle monitoring, driver behavior analysis, etc. Rear-view cameras are usually used for reversing images to help drivers view the situation behind the vehicle when reversing. Front-view cameras are used for environmental perception in front of the vehicle, such as automatic cruise control, front vehicle collision warning, etc. Side-view cameras are usually installed on both sides of the vehicle to assist in lane changes or detect road edges. Surround-view cameras capture the environment around the vehicle by installing multiple cameras. After image processing, they display the situation around the vehicle in a 360-degree panoramic manner, such as parking assistance, panoramic monitoring, etc.
[0039] Step 202: Obtain resource usage of at least two vehicle-mounted devices.
[0040] Optionally, the resource usage of the above-mentioned vehicle-mounted equipment can be set according to actual scenario requirements, and this application does not limit this.
[0041] For example, the resource usage of the vehicle-mounted device includes, but is not limited to, processor usage (e.g., central processing unit (CPU) usage), memory remaining, memory bandwidth usage (e.g., double data rate (DDR) bandwidth utilization), network bandwidth utilization, etc. Among them, DDR bandwidth utilization refers to the ratio between the actual bandwidth used by the DDR memory during read and write operations and its theoretical maximum bandwidth.
[0042] It should be noted that the execution subject of the task scheduling method provided in the embodiment of the present application can be any one of the at least two vehicle-mounted devices, or a master device selected from the at least two vehicle-mounted devices. Optionally, the vehicle-mounted device connected to the vehicle-mounted camera that collects vehicle-mounted video data can be used as the master device. For example, the at least two vehicle-mounted devices in step 202 are vehicle-mounted device A and vehicle-mounted device B, respectively. The vehicle-mounted camera that collects vehicle-mounted video data is connected to vehicle-mounted device A. Since the collection of vehicle-mounted video data is controlled by vehicle-mounted device A, vehicle-mounted device A can be used as the master device. Vehicle-mounted device A obtains vehicle-mounted video data and the resource usage of itself and vehicle-mounted device B in real time, and on this basis, executes step 203 to realize task scheduling for itself and vehicle-mounted device B.
[0043] When the vehicle-mounted device as the execution subject needs to obtain the resource usage of other devices (i.e., the devices other than the vehicle-mounted device as the execution subject among the at least two vehicle-mounted devices mentioned above), it can send a resource acquisition instruction to the other devices, and the other devices send their own resource usage to the vehicle-mounted device after receiving the resource acquisition instruction. For example, vehicle-mounted device A sends a resource acquisition instruction to vehicle-mounted device B, and vehicle-mounted device B sends its own resource usage to vehicle-mounted device A after receiving the resource acquisition instruction. In this way, vehicle-mounted device A can obtain the resource usage of vehicle-mounted device B.
[0044] In this embodiment, the vehicle-mounted device as the execution subject can obtain the resource usage of at least two vehicle-mounted devices at a preset time interval to achieve regular monitoring of the resource usage of all vehicle-mounted devices in the task scheduling system, thereby achieving dynamic adjustment of computing tasks. Optionally, the preset time interval can be set according to actual scene requirements, and this application does not limit this.
[0045] Step 203 : allocating tasks for at least two computing tasks of the vehicle-mounted video data to at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices.
[0046] When using a video processing algorithm to process vehicle-mounted video data, the entire processing process can be regarded as a large task, and then the large task can be divided into at least two computing tasks, each computing task requires a certain amount of resources when executed, and at least two computing tasks are assigned to at least two vehicle-mounted devices according to the resource usage of at least two vehicle-mounted devices, so that task scheduling can be achieved. Optionally, the above-mentioned video processing algorithm can be any algorithm for processing vehicle-mounted video, and this application does not limit this. For example, the video processing algorithm can be an ADAS algorithm, a DMS algorithm, etc.
[0047] It should be noted that different vehicle-mounted devices have different computing tasks assigned to them. For example, if the video processing algorithm is divided into four steps: data preprocessing, key area extraction, feature value extraction, and final decision-making, then the video processing algorithm can be divided into four computing tasks: data preprocessing, key area extraction, feature value extraction, and final decision-making. According to the resource usage of vehicle-mounted device A and vehicle-mounted device B, the data preprocessing task and key area extraction task are assigned to vehicle-mounted device A, and the feature value extraction task and final decision-making task are assigned to vehicle-mounted device B.
[0048] In a possible implementation, at least two computing tasks each correspond to an algorithm module, and tasks are allocated to at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices, including:
[0049] According to resource usage of at least two vehicle-mounted devices, algorithm modules that need to be run on each of the at least two vehicle-mounted devices are determined.
[0050] Among them, the algorithm module can refer to the program code used to implement the corresponding algorithm. Each computing task can be executed by the corresponding algorithm module, so the allocation of computing tasks is actually to determine the algorithm module that needs to be run in the vehicle-mounted device. For example, the data preprocessing task can be executed by the data preprocessing module, the key area extraction task can be executed by the key area extraction module, the feature value extraction task can be executed by the feature value extraction module, and the final decision task can be executed by the final decision module.
[0051] All algorithm modules of the video processing algorithm are installed in each vehicle-mounted device. According to the resource usage of at least two vehicle-mounted devices, the algorithm modules that need to be run in each vehicle-mounted device when the vehicle-mounted video data is processed using the video processing algorithm can be determined, so that multiple vehicle-mounted devices can collaborate to complete the entire processing process of the vehicle-mounted video data. For example, when the vehicle-mounted video data is processed using the video processing algorithm, the algorithm modules that need to be run on vehicle-mounted device A are the data preprocessing module and the key area deduction module, and the algorithm modules that need to be run on vehicle-mounted device B are the feature value extraction module and the final decision module.
[0052] In one possible implementation, after determining the algorithm modules that need to be run on each of at least two vehicle-mounted devices, the algorithm modules that need to be run on each of the at least two vehicle-mounted devices are run in sequence according to the execution order of at least two computing tasks, so that multiple vehicle-mounted devices collaborate to complete the entire processing process of the vehicle-mounted video data.
[0053] Exemplarily, the execution order of the four computing tasks is data preprocessing task, key area extraction task, feature value extraction task and final decision task. According to this execution order, the data preprocessing module and key area extraction module on the vehicle-mounted device A, and the feature value extraction module and final decision module on the vehicle-mounted device B can be run in sequence.
[0054] See also Figure 3 After obtaining the resource usage of at least two vehicle-mounted devices, the vehicle-mounted device as the execution subject can determine the algorithm modules that need to be run on the at least two vehicle-mounted devices according to step 301 and step 302, including:
[0055] Step 301, inputting resource usage of at least two vehicle-mounted devices into a decision tree to obtain a decision result, which represents the allocation of at least two algorithm modules.
[0056] The decision tree is used to determine the operating devices of different algorithm modules, and the scheduling of algorithm module execution can be dynamically adjusted.
[0057] In order to improve data quality and make it more suitable for modeling and analysis, before inputting the resource usage of at least two vehicle-mounted devices into the decision tree, the resource usage of at least two vehicle-mounted devices may be preprocessed and the preprocessed data may be input into the decision tree.
[0058] The above-mentioned preprocessing of resource usage includes but is not limited to data cleaning, data normalization or standardization, feature engineering, etc.
[0059] Data cleaning of resource usage can remove invalid, erroneous, or missing data points. For example: (1) Remove duplicate data: Delete duplicate records in resource usage to avoid giving inappropriate weight to certain observations during analysis. (2) Correct data errors: Correct obvious errors in resource usage, such as spelling errors, range errors, or impossible data values (such as CPU usage exceeding 100% or negative numbers). (3) Handle missing values: Fill or delete missing values in resource usage to ensure data integrity. For example, use median or mean filling or nearest neighbor filling to fill missing values.
[0060] Normalize or standardize resource usage: Since the resource usage of different on-board devices (such as CPU usage, remaining memory, etc.) may vary greatly in magnitude, directly using this data may cause the decision tree to favor certain features with a larger numerical range. By normalizing (scaling the data to the [0,1] interval) or standardizing (adjusting the mean of the data to 0 and the variance to 1), all features can contribute equally to the decision tree.
[0061] Feature engineering is the selection, modification, or creation of new features to increase the predictive power of a decision tree. For example, in addition to the raw CPU usage, you can calculate the average usage over the past few minutes, or the rate of change in resource usage (such as the rate at which CPU usage increases), which can increase the predictive power of a decision tree.
[0062] In this embodiment, by data cleaning and data normalization or standardization, it is possible to ensure that the prediction of the decision tree is carried out on a stable and unified data basis, and to prevent the decision tree from deviating from the actual situation due to data problems. The preprocessed data is more regular, which can reduce the computational burden of the decision tree when processing a large amount of unprocessed data. Through effective feature engineering, the risk of overfitting can be reduced, the performance of the decision tree on new data can be improved, and the generalization ability of the decision tree can be improved.
[0063] Step 302: Based on the decision result, determine the algorithm modules that need to be run on at least two vehicle-mounted devices.
[0064] The decision data indicates that a certain algorithm module is assigned to the corresponding vehicle-mounted device, which means that when the vehicle-mounted video data is processed using the video processing algorithm, the algorithm module needs to be run on the corresponding vehicle-mounted device.
[0065] Exemplarily, the decision result is: the data preprocessing module and the key area extraction module are assigned to the vehicle-mounted device A, and the feature value extraction module and the final decision module are assigned to the vehicle-mounted device B. It can be determined that when the vehicle-mounted video data is processed using the video processing algorithm, the data preprocessing module and the key area extraction module in the vehicle-mounted device A need to be run, and the feature value extraction module and the final decision module in the vehicle-mounted device B need to be run.
[0066] In a possible implementation, before inputting the resource usage of at least two vehicle-mounted devices into the decision tree, a decision tree may also be determined based on a video processing algorithm corresponding to the algorithm module.
[0067] Among them, the video processing algorithm corresponding to the above algorithm module is a video processing algorithm for processing vehicle-mounted video data.
[0068] In order to allocate tasks more specifically, the vehicle-mounted equipment as the execution entity can set different decision trees for different video processing algorithms.
[0069] In one possible implementation, the decision tree training process includes:
[0070] Obtaining a training data set, where the training data set includes resource usage of at least two sample devices and algorithm modules that need to be run on the two sample devices respectively;
[0071] Train a decision tree based on the training data set.
[0072] The resource usage of the at least two sample devices may be referred to as a series of attributes, and the algorithm modules that need to be run on the two sample devices may be referred to as class labels.
[0073] Optionally, you can use the C4.5 algorithm to train a decision tree. The C4.5 algorithm is an algorithm for generating decision trees. It can process data sets with discrete or continuous attributes and is used for classification tasks. C4.5 selects the optimal features for segmentation by calculating the information gain ratio, generating a multi-branch tree.
[0074] The steps and main formulas involved in training a decision tree using the C4.5 algorithm are as follows:
[0075] 1. Prepare a training data set, which contains a series of attributes (features) and class labels. For example, the collected input is Figure 4 As shown (the actual data used for training is larger than Figure 4 More data shown). Figure 4 The CPU usage_A, memory remaining amount_A, memory bandwidth usage_A and network bandwidth usage_A in the figure are the resource usage of sample device A, and the CPU usage_B, memory remaining amount_B, memory bandwidth usage_B and network bandwidth usage_B are the resource usage diagrams of sample device B. Figure 4 The A under each algorithm module indicates that the device running the algorithm module is sample device A. Figure 4 The B under each algorithm module indicates that the device running the algorithm module is sample device B.
[0076] 2. Information gain calculation:
[0077] The C4.5 algorithm selects the best attribute for segmenting data by calculating the information gain ratio of each attribute. The information gain ratio is the ratio of the information gain to the intrinsic value of the attribute.
[0078] The relevant formula is as follows:
[0079]
[0080] Where Gain(S,A) represents the information gain of data set S about attribute A. Entropy(S) represents the entropy of data set S, which is used to quantify the uncertainty or confusion of the data set. Values(A) represents all possible values of attribute A. S v Indicates the subsets into which the data set S is divided when the value of attribute A is v. |S v | represents a subset S v |S| represents the total number of instances in the entire dataset S. Entropy(Sv) represents the number of instances in the subset S. v The entropy of .
[0081] The above formula calculates the amount by which the uncertainty of the system is reduced when the data set S is split according to different values v of the attribute A. The attribute with the highest information gain is usually selected as the split node of the decision tree. During the construction of the decision tree, this process is repeated to select the most appropriate attribute for each node.
[0082] 3. Calculation of information gain ratio:
[0083] In order to reduce the bias towards attributes with more values, C4.5 uses information gain ratio instead of pure information gain, calculated as follows:
[0084]
[0085] The calculation formula of SplitInfo(A) is:
[0086]
[0087] SplitInfo(A) is called the split information value, which is used to measure the breadth and size uniformity of the partitions obtained by splitting the data set according to attribute A.
[0088] 4. Select the optimal segmentation attribute:
[0089] According to the information gain ratio of each attribute calculated in the previous step, the attribute with the largest information gain ratio is selected as the node splitting attribute.
[0090] This process is iterative. For each node, the above steps are repeated until some stopping condition is met. For example, the data set can no longer be effectively split, or a pre-set maximum depth of the tree has been reached.
[0091] 5. Recursively build a decision tree:
[0092] (1) Select the optimal attribute:
[0093] Select the attribute with the largest information gain ratio from the current data set as the test attribute of the node. Use the information gain ratio formula mentioned above to calculate the information gain ratio of each attribute.
[0094] (2) Create a node:
[0095] Create decision tree nodes for the selected attributes. Each node may contain information such as the name of the attribute, information gain ratio, etc.
[0096] (3) Split the dataset:
[0097] Split the current dataset into several subsets based on the selected attribute, each subset contains all instances with the same value on the attribute.
[0098] (4) Recursive call:
[0099] For each subset after segmentation, the process of building a decision tree is recursively called.
[0100] The condition for recursion termination can be any of the following four conditions: all instances in the subset belong to the same category and no further division is required; there are no more attributes available for further division; the number of instances in the subset is less than a predetermined threshold; the maximum depth of the decision tree has been reached.
[0101] (5) Branches of the spanning tree:
[0102] If the recursive call does not terminate, a decision tree branch is generated for each subset. If the recursive call terminates, a leaf node is created and the most common class label is used as the class of the node.
[0103] (6) Post-pruning processing:
[0104] Once the entire tree is built, post-pruning can be optionally performed to remove branches that overfit the data. After each split, the purity of the subset should increase, that is, the instances in the same subset should belong to the same or similar categories. The tree is recursively constructed until all instances are reasonably classified or the termination condition is met.
[0105] Through recursive construction, we can ensure that each decision is based on the best choice in the current situation, thus building a powerful classifier with strong generalization ability. The final decision tree can be applied to new data instances and make classification predictions based on their attribute values.
[0106] 6. Decision Tree Deployment:
[0107] Deploy the built and trained decision tree to the production environment for real-time decision support. For example, deploy the trained decision tree to the vehicle-mounted device as the execution subject.
[0108] In this embodiment, by obtaining vehicle-mounted video data and obtaining the resource usage of at least two vehicle-mounted devices, tasks can be allocated to at least two vehicle-mounted devices for at least two computing tasks of the vehicle-mounted video data according to the resource usage of at least two vehicle-mounted devices, so as to achieve the purpose of rationally utilizing the computing resources of each vehicle-mounted device, thereby improving the computing power and data processing speed of each vehicle-mounted device.
[0109] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0110] Corresponding to the task scheduling method described in the above embodiment, Figure 5 A structural schematic diagram of a task scheduling device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0111] Reference Figure 5 , the device comprises:
[0112] A data acquisition module 51 is used to acquire vehicle-mounted video data;
[0113] A resource acquisition module 52, used to acquire resource usage of at least two vehicle-mounted devices;
[0114] The task allocation module 53 is used to allocate tasks to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices with respect to the at least two computing tasks of the vehicle-mounted video data.
[0115] Optionally, each of the at least two computing tasks corresponds to an algorithm module, and the task allocation module 53 is specifically used to:
[0116] According to the resource usage of the at least two vehicle-mounted devices, the algorithm modules that need to be run on the at least two vehicle-mounted devices are determined.
[0117] Optionally, the above device further includes:
[0118] The algorithm running module is used to sequentially run the algorithm modules that need to be run on the at least two vehicle-mounted devices respectively according to the execution order of the at least two computing tasks.
[0119] Optionally, the task allocation module 53 is specifically used for:
[0120] Inputting resource usage of the at least two vehicle-mounted devices into a decision tree to obtain a decision result, wherein the decision result indicates allocation of algorithm modules corresponding to the at least two computing tasks;
[0121] Based on the decision result, the algorithm modules that need to be run on the at least two vehicle-mounted devices are determined.
[0122] Optionally, the above device further includes:
[0123] A decision tree determination module is used to determine the decision tree based on the video processing algorithm corresponding to the algorithm module.
[0124] Optionally, the above device further includes:
[0125] A data set acquisition module, used to acquire a training data set, wherein the training data set includes resource usage of at least two sample devices and algorithm modules that need to be run on each of the at least two sample devices;
[0126] The decision tree training module is used to train the decision tree according to the training data set.
[0127] Optionally, the resource acquisition module 52 is specifically used for:
[0128] The resource usage of the at least two vehicle-mounted devices is obtained at preset time intervals.
[0129] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0130] Figure 6 This is a schematic diagram of the structure of the vehicle-mounted device provided in the embodiment of the present application. Figure 6 As shown, the vehicle-mounted device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, and when the processor 60 executes the computer program 62, the steps in the above-mentioned task scheduling method embodiment are implemented.
[0131] The vehicle-mounted device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of the vehicle-mounted device 6 and does not constitute a limitation on the vehicle-mounted device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0132] The processor 60 may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0133] In some embodiments, the memory 61 may be an internal storage unit of the vehicle-mounted device 6, such as a hard disk or memory of the vehicle-mounted device 6. In other embodiments, the memory 61 may also be an external storage device of the vehicle-mounted device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the vehicle-mounted device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the vehicle-mounted device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0134] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0135] An embodiment of the present application also provides a vehicle-mounted device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor implements the steps in any of the above-mentioned method embodiments when executing the computer program.
[0136] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0137] An embodiment of the present application provides a computer program product. When the computer program product is run on a vehicle-mounted device, the vehicle-mounted device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0138] If the integrated unit is implemented in the form of a 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 implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / vehicle-mounted equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0139] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0140] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0141] In the embodiments provided in the present application, it should be understood that the disclosed devices / vehicle-mounted equipment and methods can be implemented in other ways. For example, the device / vehicle-mounted equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0142] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0143] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A task scheduling method, characterized in that: include: Obtain vehicle video data; Obtain resource usage of at least two vehicle-mounted devices; For the at least two computing tasks of the vehicle-mounted video data, tasks are allocated to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices.
2. The task scheduling method according to claim 1, characterized in that: The at least two computing tasks each correspond to an algorithm module, and the task allocation to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices includes: According to the resource usage of the at least two vehicle-mounted devices, the algorithm modules that need to be run on the at least two vehicle-mounted devices are determined.
3. The task scheduling method according to claim 2, characterized in that: After determining the algorithm modules that need to be run on the at least two vehicle-mounted devices respectively, the method further includes: According to the execution order of the at least two computing tasks, the algorithm modules that need to be executed on the at least two vehicle-mounted devices are executed in sequence.
4. The task scheduling method according to claim 2, characterized in that: The step of determining the algorithm modules to be run on the at least two vehicle-mounted devices respectively according to the resource usage of the at least two vehicle-mounted devices comprises: Inputting resource usage of the at least two vehicle-mounted devices into a decision tree to obtain a decision result, wherein the decision result represents allocation of algorithm modules corresponding to the at least two computing tasks; Based on the decision result, the algorithm modules that need to be run on the at least two vehicle-mounted devices are determined.
5. The task scheduling method according to claim 4, characterized in that: Before inputting the resource usage of the at least two vehicle-mounted devices into the decision tree, the method further includes: The decision tree is determined based on the video processing algorithm corresponding to the algorithm module.
6. The task scheduling method according to claim 4, characterized in that: The training process of the decision tree includes: Acquire a training data set, where the training data set includes resource usage of at least two sample devices and algorithm modules that need to be run on each of the at least two sample devices; The decision tree is trained according to the training data set.
7. The task scheduling method according to any one of claims 1 to 6, characterized in that: The obtaining of resource usage of at least two vehicle-mounted devices includes: The resource usage of the at least two vehicle-mounted devices is obtained at preset time intervals.
8. A task scheduling device, characterized in that: include: A data acquisition module, used to acquire vehicle-mounted video data; A resource acquisition module, used to obtain resource usage of at least two vehicle-mounted devices; The task allocation module is used to allocate tasks to the at least two vehicle-mounted devices according to resource usage of the at least two vehicle-mounted devices for the at least two computing tasks of the vehicle-mounted video data.
9. A vehicle-mounted 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 task scheduling method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the task scheduling method according to any one of claims 1 to 7 is implemented.
