Load optimization method and device, equipment, medium and vehicle
By obtaining target load parameters in the autonomous driving system, matching load scores and migrating tasks, the problem of excessive load on the autonomous driving system causing tasks to not be able to operate normally is solved, and more efficient load optimization is achieved.
Patent Information
- Application Number
- CN202311431198.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2025-05-02
AI Technical Summary
In the case of too many tasks, after the load optimization of the prior art methods, the load of the autonomous driving system may still be large, and it is impossible to ensure that the tasks can operate normally.
By obtaining the target load parameters of the autonomous driving system, matching the preset correspondence between the load parameters and the load score, it is determined whether the target load score is greater than the load score threshold, and when the conditions are met, the target task that meets the preset conditions is migrated to the target system for operation.
Achieve greater load optimization, reduce the load of the autonomous driving system, and ensure that the tasks can operate normally.
Smart Images

Figure CN119917248A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a load optimization method, device, equipment, medium and vehicle. Background Art
[0002] The autonomous driving system is mainly responsible for running tasks related to the autonomous driving function. The autonomous driving system is a real-time operating system, and most of the tasks it runs are real-time tasks. Therefore, the autonomous driving system usually needs to run more tasks and has high requirements for the real-time performance of the tasks.
[0003] However, due to the huge amount of computational effort and the large number of tasks, the load on the autonomous driving system may be very large, resulting in problems with the tasks not being able to run normally or being delayed, so it is necessary to optimize the load of the autonomous driving system.
[0004] In the prior art, tasks are usually prioritized so that the autonomous driving system runs tasks in order of priority from high to low, which can achieve load optimization of the autonomous driving system. However, when there are too many tasks, after load optimization according to the prior art method, the load of the autonomous driving system may still be large, and it is impossible to ensure that the tasks in the autonomous driving system can run normally. Summary of the invention
[0005] The embodiments of the present application provide a load optimization method, device, equipment, medium and vehicle, which can at least solve the problem in the prior art that when the number of tasks is too large, after load optimization is performed according to the methods of the prior art, the load of the autonomous driving system may still be large, and the normal operation of the tasks in the autonomous driving system cannot be guaranteed.
[0006] In a first aspect, an embodiment of the present application provides a load optimization method, the method comprising:
[0007] Obtain target load parameters of the autonomous driving system;
[0008] Matching the target load parameters based on a preset correspondence between the load parameters and the load score to obtain a target load score that matches the target load parameters, where the target load score is positively correlated with the load size of the autonomous driving system;
[0009] Determine whether the target load score is greater than a load score threshold;
[0010] When the target load score is greater than the load score threshold, the target task that meets the first preset condition in the autonomous driving system is migrated to the target system for execution.
[0011] In a second aspect, an embodiment of the present application provides a load optimization device, the device comprising:
[0012] A first acquisition module is used to acquire a target load parameter of the automatic driving system;
[0013] A first determination module is used to match the target load parameter based on a preset correspondence between the load parameter and the load score to obtain a target load score that matches the target load parameter, wherein the target load score is positively correlated with the load size of the autonomous driving system;
[0014] A first judgment module is used to judge whether the target load score is greater than a load score threshold;
[0015] The first migration module is used to migrate the target task that meets the first preset condition in the automatic driving system to the target system for operation when the target load score is greater than the load score threshold.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor and a memory storing computer program instructions;
[0017] When the processor executes the computer program instructions, the load optimization method as shown in any one of the embodiments of the first aspect is implemented.
[0018] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the load optimization method shown in any one of the embodiments of the first aspect is implemented.
[0019] In a fifth aspect, an embodiment of the present application further provides a vehicle, the vehicle comprising at least one of the following:
[0020] The load optimization device as described in the second aspect;
[0021] The electronic device according to the third aspect;
[0022] The computer storage medium as described in the fourth aspect.
[0023] The load optimization method, device, equipment, medium and vehicle of the embodiment of the present application can obtain the target load parameters of the autonomous driving system, and match the target load parameters based on the preset correspondence between the load parameters and the load score to obtain the target load score that matches the target load parameters, and then determine whether the target load score is greater than the load score threshold. If the target load score is greater than the load score threshold, the target task that meets the first preset condition in the autonomous driving system is migrated to the target system for operation. Among them, the target load score is positively correlated with the load size of the autonomous driving system. That is to say, the embodiment of the present application can migrate at least part of the tasks in the autonomous driving system to other systems for operation when the load of the autonomous driving system is too large, so that the load of the autonomous driving system can be optimized to a greater extent, and the load of the autonomous driving system can be reduced as much as possible to ensure that the tasks in the autonomous driving system can operate normally.
[0024] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0026] Figure 1 is an architecture diagram of a vehicle operating system provided by an embodiment of the present application;
[0027] Figure 2 This is a curve diagram showing the change of the number of interruptions over time provided by an embodiment of the present application;
[0028] Figure 3 This is a curve diagram showing the change of the number of context switches over time provided by an embodiment of the present application;
[0029] Figure 4 is a flow chart of a load optimization method provided by an embodiment of the present application;
[0030] Figure 5 is a schematic diagram of task migration between computing resources provided by an embodiment of the present application;
[0031] Figure 6 is a schematic diagram of a data interaction process provided by an embodiment of the present application;
[0032] Figure 7 is a structural schematic diagram of a load optimization device provided by an embodiment of the present application;
[0033] Figure 8 It is a structural schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0035] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.
[0036] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0037] like Figure 1 As shown, the current operating system of an intelligent vehicle may include: a vehicle control system 110, an automatic driving system 120 and a cockpit entertainment system 130, and data interaction may exist between the three.
[0038] The automatic driving system 120 is mainly responsible for running tasks related to the automatic driving function. The automatic driving system is a real-time operating system, and most of the tasks running in it are real-time tasks. Therefore, the automatic driving system usually needs to run more tasks and has a relatively high real-time requirement for the task running.
[0039] However, due to the huge amount of computation required and the large number of tasks, the load on the autonomous driving system may be very large, resulting in load peaks, which can be reflected as Figure 2 The number of interruptions shown and Figure 3 The peak number of context switches shown in Figure 1. Excessive load may cause tasks to fail to run properly or run delayed, so the autonomous driving system needs to be load optimized.
[0040] The load optimization method, device, equipment, medium and vehicle of the embodiment of the present application can obtain the target load parameters of the autonomous driving system, and match the target load parameters based on the preset correspondence between the load parameters and the load score to obtain the target load score that matches the target load parameters, and then determine whether the target load score is greater than the load score threshold. If the target load score is greater than the load score threshold, the target task that meets the first preset condition in the autonomous driving system is migrated to the target system for operation. Among them, the target load score is positively correlated with the load size of the autonomous driving system. That is to say, the embodiment of the present application can migrate at least part of the tasks in the autonomous driving system to other systems for operation when the load of the autonomous driving system is too large, so that the load of the autonomous driving system can be optimized to a greater extent, and the load of the autonomous driving system can be reduced as much as possible to ensure that the tasks in the autonomous driving system can operate normally.
[0041] A load optimization method provided in an embodiment of the present application is described in detail below.
[0042] Figure 4 A schematic flow chart of a load optimization method provided by an embodiment of the present application is shown, and the execution subject of the load optimization method may be a load optimization device. It should be noted that the above execution subject does not constitute a limitation on the present application.
[0043] like Figure 4 As shown, the load optimization method may include the following steps:
[0044] S410, obtaining a target load parameter of the automatic driving system;
[0045] S420, matching the target load parameter based on a preset correspondence between the load parameter and the load score to obtain a target load score matching the target load parameter;
[0046] S430, determining whether the target load score is greater than a load score threshold;
[0047] S440: When the target load score is greater than the load score threshold, migrate the target task that meets the first preset condition in the autonomous driving system to the target system for execution.
[0048] Thus, the target load parameter of the autonomous driving system can be obtained, and the target load parameter can be matched based on the preset correspondence between the load parameter and the load score to obtain the target load score that matches the target load parameter, and then it is determined whether the target load score is greater than the load score threshold. When the target load score is greater than the load score threshold, the target task in the autonomous driving system that meets the first preset condition is migrated to the target system for operation. Among them, the target load score is positively correlated with the load size of the autonomous driving system, that is, the embodiment of the present application can migrate at least part of the tasks in the autonomous driving system to other systems for operation when the load of the autonomous driving system is too large, so that the load of the autonomous driving system can be optimized to a greater extent, and the load of the autonomous driving system can be reduced as much as possible to ensure that the tasks in the autonomous driving system can operate normally.
[0049] In S410, the target load parameter may be a parameter that can be used to measure the load size of the autonomous driving system. During the operation of the autonomous driving system, the background resource monitoring program may continuously obtain the target load parameter of the autonomous driving system.
[0050] In S420, the preset correspondence between the load parameter and the load score may be a formula capable of calculating the load score based on the load parameter. The target load score may be positively correlated with the load size of the autonomous driving system.
[0051] Exemplarily, during the operation of the autonomous driving system, the background resource monitoring program can continuously calculate the target load score based on the target load parameters, thereby achieving continuous detection of the load condition of the autonomous driving system.
[0052] In some embodiments, in order to more accurately measure the load size of the autonomous driving system, the target load parameters may include the average load of the central processing unit (CPU), the number of context switches, the number of interrupts, and the physical available memory;
[0053] Based on this, S420 may include:
[0054] Based on the preset weights corresponding to the average CPU load, the number of context switches, the number of interrupts and the physical available memory, the average CPU load, the number of context switches, the number of interrupts and the physical available memory are weighted and summed to obtain the target load score.
[0055] Here, the background resource monitoring program can comprehensively measure the load size of the autonomous driving system by obtaining the average CPU load, context switching times, interrupt times, and physical available memory of the autonomous driving system in real time.
[0056] For example, the calculation formula of the target load score may be as follows:
[0057] Score=LA*P 1 +CS*P 2 +IRQ*P 3 +MEM*P 4
[0058] Among them, Score is the target load score, LA is the average CPU load, CS is the number of context switches, IRQ is the number of interrupts, MEM is the physical available memory, P 1 , P 2 , P 3 and P 4 All are preset weights.
[0059] In this way, a more accurate target load score can be calculated based on parameters such as the average CPU load, number of context switches, number of interrupts, and physical available memory, thereby more accurately measuring the load size of the autonomous driving system.
[0060] In S430, the load score threshold may be preset manually. It is possible to determine whether the load of the autonomous driving system is too large and whether load optimization is required by judging whether the target load score is greater than the load score threshold. If the target load score is greater than the load score threshold, it indicates that the load of the autonomous driving system is too large and load optimization is required; if the target load score is not greater than the load score threshold, it indicates that the load of the autonomous driving system is not too large and load optimization may not be required.
[0061] Exemplarily, the load score threshold may be 80 points.
[0062] In S440, the target load score is greater than the load score threshold, indicating that the load of the autonomous driving system is too large, so the load of the autonomous driving system needs to be optimized. Here, the load optimization of the autonomous driving system is achieved by migrating the target task that meets the first preset condition in the autonomous driving system to the target system for operation.
[0063] The target system may be other operating systems in the vehicle where the above-mentioned autonomous driving system is located. For example, the target system may be a cockpit entertainment system.
[0064] In some implementations, in order to ensure the normal operation of the task, the first preset condition may include at least one of the following:
[0065] The execution period of the target task is greater than the execution period threshold;
[0066] The input data required to run the target task does not include the running results of the preset core task;
[0067] Target tasks have preset labels.
[0068] Here, non-critical tasks with longer execution cycles and weaker dependencies in the autonomous driving system can be migrated to the target system for operation.
[0069] The execution cycle being longer may refer to the execution cycle being greater than an execution cycle threshold, and the execution cycle threshold may be manually preset. For example, the execution cycle threshold may be 30 minutes.
[0070] Weak dependency may mean that the input data required to run the target task does not include the running result of the preset core task. In other words, after the preset core task is completed, it is not necessary to use the running result of the preset core task as the input data for running the target task. The preset core task may be manually preset.
[0071] A non-critical task may be a task that does not require high real-time performance. A preset label may be manually set for the target task in advance, and the preset label may indicate that the allowed response time of the target task is greater than the time threshold, that is, the real-time performance requirement of the target task is not high.
[0072] In this way, based on the first preset condition, non-critical tasks with longer execution cycles and weaker dependencies can be migrated to the target system for execution, so as to avoid affecting the normal operation of the tasks due to task migration.
[0073] Based on this, in some implementations, in order to better optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system may be divided into a first computing resource and a shared computing resource;
[0074] After S430, the method may further include:
[0075] When the target load score is not greater than the load score threshold, obtaining a proportion of the first computing resource occupied by the first task in the first computing resource to obtain a first resource occupation ratio;
[0076] Determine whether the first resource occupancy ratio is greater than a ratio threshold;
[0077] When the first resource occupancy ratio is greater than the ratio threshold, determining whether the shared computing resource is fully occupied;
[0078] When the shared computing resource is not fully occupied, the second task that meets the second preset condition in the first computing resource is migrated to the shared computing resource for execution.
[0079] Here, the CPU computing resources of the autonomous driving system may be divided in advance to obtain first computing resources and shared computing resources, wherein the first computing resources may be used to run tasks with a priority higher than a first priority threshold, and the shared computing resources may be used to run tasks of any priority.
[0080] The first task may be all tasks in the first computing resource. The ratio threshold may be manually preset, and by way of example, the ratio threshold may be 90%.
[0081] Specifically, after determining whether the target load score is greater than the load score threshold, if the target load score is not greater than the load score threshold, the resource monitoring program can be triggered to obtain the proportion of the first computing resource occupied by the first task in the first computing resource, and obtain the first resource occupation ratio. Then, it can be determined whether the first resource occupation ratio is greater than the ratio threshold. If it is greater, it indicates that the load of the first computing resource is too large and load optimization is required. At this time, it can be determined whether the shared computing resource is fully occupied. If it is not fully occupied, the second task in the first computing resource that meets the second preset condition can be migrated to the shared computing resource for operation. Since the priority of the task in the first computing resource is higher, by migrating the second task in the first computing resource that meets the second preset condition to the shared computing resource for operation, it can be ensured that the higher priority task can run normally.
[0082] In some embodiments, in order to ensure the normal operation of the task as much as possible while optimizing the load of the first computing resource, the second preset condition may be that the priority of the second task is lower than the third priority threshold and the total amount of computing resources occupied by the second task does not exceed the available computing resources of the shared computing resources.
[0083] Exemplarily, the third priority threshold may be 8.
[0084] That is to say, tasks with lower priorities in the first computing resource can be migrated to the shared computing resource for execution, and the number of tasks to be migrated can be based on the maximum number of tasks that can be executed by the shared computing resource.
[0085] In this way, by migrating as many tasks with lower priorities as possible to the shared computing resources for execution, the load of the first computing resource can be optimized to a greater extent, while giving priority to ensuring the normal operation of tasks with higher priorities.
[0086] In this way, by dividing the CPU computing resources in advance, when the load on the first computing resource running high-priority tasks is too large, at least part of the tasks in the first computing resource can be migrated to the shared computing resources for execution, thereby ensuring the normal operation of high-priority tasks as much as possible and achieving preliminary load optimization of the autonomous driving system.
[0087] Based on this, in some implementations, in order to better optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system may be further divided into second computing resources, and the second computing resources may be used to run tasks with a priority lower than a second priority threshold, and the second priority threshold may be lower than the first priority threshold;
[0088] When the first resource occupancy ratio is greater than the ratio threshold, after determining whether the shared computing resource is fully occupied, the method may further include:
[0089] When the shared computing resources are fully occupied, the third task in the second computing resource that meets the third preset condition is migrated to the target system for execution, and the fourth task in the first computing resource that meets the fourth preset condition is migrated to the second computing resource for execution.
[0090] Here, the third preset condition may include at least one of the following:
[0091] The execution period of the third task is greater than the execution period threshold;
[0092] The input data required to run the third task does not include the running result of the preset core task;
[0093] The third task has a preset label, and the preset label may indicate that the allowed response time of the third task is greater than the time threshold.
[0094] Exemplarily, the first priority threshold may be 7, and the second priority threshold may be 3.
[0095] Specifically, if the target load score is not greater than the load score threshold, the first resource occupancy ratio is greater than the ratio threshold, and the shared computing resources are fully occupied, the third task in the second computing resource that meets the third preset condition can be migrated to the target system for execution, and the fourth task in the first computing resource that meets the fourth preset condition can be migrated to the second computing resource for execution, so as to ensure that the higher priority tasks in the first computing resource can run normally.
[0096] In some embodiments, in order to ensure the normal operation of the task as much as possible while optimizing the load of the autonomous driving system, the fourth preset condition may be that the priority of the fourth task is lower than the third priority threshold and the total amount of computing resources occupied by the fourth task does not exceed the available computing resources of the second computing resources.
[0097] That is, the resource monitoring program can suspend the non-critical tasks with longer execution cycles and weaker dependencies in the second computing resource, that is, the third tasks, and then migrate the fourth tasks with relatively lower priorities in the first computing resource to the second computing resource for execution, and the number of fourth tasks is based on the maximum number of tasks that the second computing resource can run. At the same time, the target system can be notified to start and run the new third task.
[0098] In this way, migrating the third task in the second computing resource to the target system for execution can both free up computing resources for higher priority tasks and ensure that the third task can run normally. Then, migrating as many lower priority tasks as possible in the first computing resource to the second computing resource for execution can optimize the load of the autonomous driving system to a greater extent and ensure that higher priority tasks can run normally.
[0099] In this way, by dividing the CPU computing resources in advance, when the load on the first computing resource running high-priority tasks is too large, part of the tasks running in the second computing resource can be migrated to the target system to run, thereby freeing up part of the second computing resources. This allows at least part of the tasks in the first computing resource to be migrated to the second computing resource for running. Therefore, the normal operation of high-priority tasks can be guaranteed as much as possible, thereby achieving load optimization of the autonomous driving system.
[0100] Based on this, in some embodiments, in order to optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system may be divided into a first computing resource and a second computing resource, the first computing resource may be used to run tasks with a priority higher than a first priority threshold, the second computing resource may be used to run tasks with a priority lower than a second priority threshold, and the second priority threshold may be lower than the first priority threshold;
[0101] The above-mentioned migrating the target task that meets the first preset condition in the autonomous driving system to the target system for execution may include:
[0102] The target task that meets the first preset condition in the second computing resource is migrated to the target system for execution, and the fifth task that meets the fifth preset condition in the first computing resource is migrated to the second computing resource for execution.
[0103] Here, the CPU computing resources of the autonomous driving system may be divided in advance to obtain a first computing resource, a second computing resource, and a shared computing resource. The second computing resource may be used to run tasks with a priority lower than a second priority threshold, and the second priority threshold may be lower than the first priority threshold. For example, the first priority threshold may be 7, and the second priority threshold may be 3.
[0104] Specifically, since the priority of the original task in the first computing resource is higher than the priority of the original task in the second computing resource, migrating at least part of the first computing resource to the second computing resource for execution can give priority to ensuring the normal operation of the higher priority task. Migrating at least part of the tasks in the second computing resource to the target system for execution can ensure the normal operation of the lower priority tasks as much as possible.
[0105] In some embodiments, in order to further optimize the load of the autonomous driving system while ensuring the normal operation of the task as much as possible, the fifth preset condition may be that the priority of the fifth task is lower than the third priority threshold and the total amount of computing resources occupied by the fifth task does not exceed the available computing resources of the second computing resources.
[0106] That is, the resource monitoring program can suspend the non-critical tasks with longer execution cycles and weaker dependencies in the second computing resource, that is, the target tasks, and then migrate the fifth tasks with relatively lower priorities in the first computing resource to the second computing resource for execution, and the number of fifth tasks is based on the maximum number of tasks that the second computing resource can run. At the same time, the target system can be notified to start and run the new target task.
[0107] In this way, the target task in the second computing resource is migrated to the target system for execution, which can not only free up computing resources for higher priority tasks, but also ensure that the target task can run normally. Then, as many lower priority tasks as possible in the first computing resource are migrated to the second computing resource for execution, which can optimize the load of the autonomous driving system to a greater extent and ensure that higher priority tasks can run normally.
[0108] In this way, by determining whether the target load score of the autonomous driving system is greater than the load score threshold, and when the target load score is greater than the load score threshold, migrating at least part of the tasks in the second computing resource to the target system for execution, and then migrating at least part of the first computing resource to the second computing resource for execution, the load of the autonomous driving system can be optimized to a greater extent.
[0109] In addition, after dividing the CPU computing resources of the autonomous driving system, in addition to obtaining the above-mentioned first computing resources, second computing resources and shared computing resources, third computing resources and fourth computing resources can also be obtained.
[0110] The third computing resource may be used to run system-level tasks, for example, the third computing resource may be used to run tasks that divide the CPU computing resources of the autonomous driving system. The fourth computing resource may be used to run tasks with a priority lower than the first priority threshold and higher than the second priority threshold.
[0111] Exemplarily, 11 CPUs 0-10 can be divided, and the division result can be shown in Table 1, where other (i.e., the third computing resource) includes CPU 0, high-group (i.e., the first computing resource) includes CPU 1, CPU 2, CPU 3, and CPU 4, mid-group (i.e., the fourth computing resource) includes CPU 5 and CPU 6, low-group (i.e., the second computing resource) includes CPU 7 and CPU 8, and share (i.e., shared computing resources) includes CPU 9 and CPU 10. Figure 5 As shown in the figure, any task running in Other, high-group, mid-group, and low-group can be migrated to share for running.
[0112] Table 1 - Division results table
[0113]
[0114] In this way, by pre-dividing the CPU computing resources of the autonomous driving system, resource isolation can be achieved, and different groups of computing resources can run tasks of different priorities, providing a good foundation for load optimization within the autonomous driving system.
[0115] In some implementations, in order to ensure that the target task can run normally, the above-mentioned migration of the target task that meets the first preset condition in the autonomous driving system to the target system for running may include:
[0116] Send the input data required to run the target task to the target system through the Data Distribution Service (DDS);
[0117] Control the target system to run the target task based on the input data.
[0118] Among them, DDS technology can not only support internal communication within the same operating system, but also support mutual communication between different operating systems. Shared memory can be used to achieve data transmission within the same operating system. Data transmission between different operating systems can be achieved through a network (such as Ethernet). DDS can also be called an inter-domain bus.
[0119] Here, when it is necessary to migrate the target task in the autonomous driving system to the target system for operation, the autonomous driving system can be controlled to send the input data required to run the target task to the target system via Ethernet through DDS technology, and then the target system can be controlled to run the target task based on the input data to obtain the target operation result. Then, the target system can also be controlled to return the target operation result to the autonomous driving system via Ethernet through DDS technology.
[0120] For example, Figure 6 As shown, when the target task in the automatic driving system 610 needs to be migrated to the cockpit entertainment system 620 for operation, the server (Service_2) 611 of the automatic driving system 610 can notify the server (Service_2) 621 of the cockpit entertainment system 620 to enable the target task in the cockpit entertainment system 620, and the client (Client_2) 612 of the automatic driving system 610 can also send the input data required for running the target task to the server (Service_2) 621 of the cockpit entertainment system 620 through Ethernet using the DDS technology, and then the server (Service_2) 621 of the cockpit entertainment system 620 can run the target task based on the input data to obtain the target operation result. The server (Service_2) 621 of the cockpit entertainment system 620 can also return the target operation result to the client (Client_2) 612 of the automatic driving system 610 through Ethernet using the DDS technology.
[0121] In this way, data interaction between the autonomous driving system and the target system can be achieved through DDS, thereby ensuring that the target task can run normally.
[0122] The load optimization method provided in the embodiment of the present application fully utilizes the hardware advantages of multiple high-performance central processing units on the intelligent vehicle and the software advantages of interconnected multiple operating systems, that is, it fully utilizes the two powerful computing units of the chip of the autonomous driving system and the chip of the cockpit entertainment system, as well as the architectural design of interconnected heterogeneous systems. The running carriers of the tasks in the autonomous driving system are scheduled in real time, and some tasks in the autonomous driving system are transferred to the cockpit entertainment system for operation, which reduces the running load of a single system (i.e., the autonomous driving system) and ensures the real-time performance of the autonomous driving tasks as much as possible, thereby ensuring the normal and stable operation of the autonomous driving function. In addition, it also reduces the hardware cost of the autonomous driving system, optimizes the performance of the autonomous driving algorithm, and improves the driving experience of the intelligent vehicle.
[0123] Based on the same inventive concept, the present application embodiment further provides a load optimization device, and the load optimization method provided in the present application embodiment can be executed by the load optimization device. Figure 7 The load optimization device provided in the embodiment of the present application is described in detail.
[0124] Figure 7 A structural schematic diagram of a load optimization device provided by an embodiment of the present application is shown.
[0125] like Figure 7 As shown, the load optimization device may include:
[0126] A first acquisition module 701 is used to acquire a target load parameter of the automatic driving system;
[0127] A first determination module 702 is used to match the target load parameter based on a preset correspondence between the load parameter and the load score to obtain a target load score that matches the target load parameter, where the target load score is positively correlated with the load size of the autonomous driving system;
[0128] A first judgment module 703 is used to judge whether the target load score is greater than a load score threshold;
[0129] The first migration module 704 is used to migrate the target task that meets the first preset condition in the automatic driving system to the target system for execution when the target load score is greater than the load score threshold.
[0130] Thus, the target load parameter of the autonomous driving system can be obtained, and the target load parameter can be matched based on the preset correspondence between the load parameter and the load score to obtain the target load score that matches the target load parameter, and then it is determined whether the target load score is greater than the load score threshold. When the target load score is greater than the load score threshold, the target task in the autonomous driving system that meets the first preset condition is migrated to the target system for operation. Among them, the target load score is positively correlated with the load size of the autonomous driving system, that is, the embodiment of the present application can migrate at least part of the tasks in the autonomous driving system to other systems for operation when the load of the autonomous driving system is too large, so that the load of the autonomous driving system can be optimized to a greater extent, and the load of the autonomous driving system can be reduced as much as possible to ensure that the tasks in the autonomous driving system can operate normally.
[0131] In some implementations, in order to more accurately measure the load size of the autonomous driving system, the target load parameters include the average load of the central processing unit (CPU), the number of context switches, the number of interrupts, and the physical available memory; the first determination module 702 may include:
[0132] The calculation submodule is used to perform weighted summation of the average CPU load, the number of context switches, the number of interrupts and the physical available memory based on the preset weights corresponding to the average CPU load, the number of context switches, the number of interrupts and the physical available memory, so as to obtain a target load score.
[0133] In some embodiments, in order to better optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system are divided into a first computing resource and a shared computing resource, and the first computing resource is used to run tasks with a priority higher than a first priority threshold; the device may also include:
[0134] A second acquisition module is used to, after determining whether the target load score is greater than the load score threshold, obtain a ratio of the first task in the first computing resource occupying the first computing resource to obtain a first resource occupation ratio if the target load score is not greater than the load score threshold;
[0135] The second judgment module is used to judge whether the first resource occupancy ratio is greater than a ratio threshold;
[0136] A second determination module is used to determine whether the shared computing resource is fully occupied when the first resource occupancy ratio is greater than a ratio threshold;
[0137] The second migration module is used to migrate the second task that meets the second preset condition in the first computing resource to the shared computing resource for execution when the shared computing resource is not fully occupied.
[0138] In some embodiments, in order to better optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system are further divided into a second computing resource, and the second computing resource is used to run tasks with a priority lower than a second priority threshold, and the second priority threshold is lower than the first priority threshold;
[0139] The device may also include:
[0140] The third migration module is used to determine whether the shared computing resources are fully occupied when the occupancy ratio of the first resource is greater than the ratio threshold. If the shared computing resources are fully occupied, the third task in the second computing resource that meets the third preset condition is migrated to the target system for execution, and the fourth task in the first computing resource that meets the fourth preset condition is migrated to the second computing resource for execution.
[0141] In some embodiments, in order to further optimize the load of the autonomous driving system, the CPU computing resources of the autonomous driving system are divided into a first computing resource and a second computing resource, the first computing resource is used to run tasks with a priority higher than a first priority threshold, and the second computing resource is used to run tasks with a priority lower than a second priority threshold, and the second priority threshold is lower than the first priority threshold;
[0142] The first migration module 704 may include:
[0143] The migration submodule is used to migrate the target task that meets the first preset condition in the second computing resource to the target system for execution, and migrate the fifth task that meets the fifth preset condition in the first computing resource to the second computing resource for execution.
[0144] In some implementations, in order to ensure that the target task can run normally, the first migration module 704 may include:
[0145] The first control submodule is used to send input data required for running the target task to the target system through DDS;
[0146] The second control submodule is used to control the target system to execute the target task based on the input data.
[0147] In some implementations, to ensure the normal operation of the task, the first preset condition includes at least one of the following:
[0148] The execution period of the target task is greater than the execution period threshold;
[0149] The input data required to run the target task does not include the running results of the preset core task;
[0150] The target task has a preset label, and the preset label indicates that the allowed response time of the target task is greater than the time threshold.
[0151] In some embodiments, in order to ensure the normal operation of the task as much as possible while optimizing the load of the first computing resource, the second preset condition is that the priority of the second task is lower than the third priority threshold and the total amount of computing resources occupied by the second task does not exceed the available computing resources of the shared computing resources.
[0152] In some embodiments, in order to ensure the normal operation of the task as much as possible while further optimizing the load of the first computing resource, the third preset condition is that the priority of the third task is lower than the third priority threshold and the total amount of computing resources occupied by the third task does not exceed the available computing resources of the second computing resource.
[0153] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present application is shown.
[0154] like Figure 8 As shown, the electronic device 8 is a structural diagram of an exemplary hardware architecture of an electronic device that can implement the load optimization method and load optimization device in the embodiment of the present application. The electronic device can refer to the electronic device in the embodiment of the present application.
[0155] The electronic device 8 may include a processor 801 and a memory 802 storing computer program instructions.
[0156] Specifically, the processor 801 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0157] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 802 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 802 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 802 is a non-volatile solid-state memory. In a specific embodiment, the memory 802 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, typically, the memory 802 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.
[0158] The processor 801 implements any one of the load optimization methods in the above embodiments by reading and executing computer program instructions stored in the memory 802 .
[0159] In one example, the electronic device may further include a communication interface 803 and a bus 804. Figure 8 As shown, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 804 and communicate with each other.
[0160] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0161] Bus 804 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 804 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0162] The electronic device can execute the load optimization method in the embodiment of the present application, thereby realizing the combination Figures 1 to 7 Described is a load optimization method and apparatus.
[0163] In addition, in combination with the load optimization method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the load optimization methods in the above embodiment is implemented.
[0164] In addition, in combination with the load optimization method in the above embodiment, the embodiment of the present invention can provide a vehicle for implementation. The vehicle includes at least one of the load optimization device in the above embodiment, an electronic device, and a computer-readable storage medium.
[0165] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0166] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0167] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0168] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0169] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A load optimization method, characterized in that: The method comprises: Obtain target load parameters of the autonomous driving system; Matching the target load parameter based on a preset correspondence between the load parameter and the load score to obtain a target load score that matches the target load parameter, wherein the target load score is positively correlated with the load size of the autonomous driving system; Determining whether the target load score is greater than a load score threshold; When the target load score is greater than the load score threshold, the target task in the automatic driving system that meets the first preset condition is migrated to the target system for execution.
2. The method according to claim 1, characterized in that The target load parameters include the average load of the central processing unit (CPU), the number of context switches, the number of interrupts and the physical available memory; The matching the target load parameter based on the preset corresponding relationship between the load parameter and the load score to obtain the target load score matching the target load parameter includes: Based on the preset weights corresponding to the average CPU load, the number of context switches, the number of interrupts and the physically available memory, the average CPU load, the number of context switches, the number of interrupts and the physically available memory are weightedly summed to obtain the target load score.
3. The method according to claim 1, characterized in that The CPU computing resources of the autonomous driving system are divided into first computing resources and shared computing resources, the first computing resources being used to run tasks with a priority higher than a first priority threshold; After determining whether the target load score is greater than a load score threshold, the method further includes: When the target load score is not greater than the load score threshold, obtaining a proportion of the first computing resource occupied by the first task in the first computing resource to obtain a first resource occupation proportion; Determine whether the first resource occupancy ratio is greater than a ratio threshold; When the first resource occupancy ratio is greater than the ratio threshold, determining whether the shared computing resource is fully occupied; When the shared computing resource is not fully occupied, a second task in the first computing resource that meets a second preset condition is migrated to the shared computing resource for execution.
4. The method according to claim 3, characterized in that The CPU computing resources of the autonomous driving system are further divided into second computing resources, the second computing resources are used to run tasks with a priority lower than a second priority threshold, the second priority threshold is lower than the first priority threshold; In the case where the first resource occupancy ratio is greater than the ratio threshold, after determining whether the shared computing resource is fully occupied, the method further includes: When the shared computing resource is fully occupied, the third task in the second computing resource that meets the third preset condition is migrated to the target system for execution, and the fourth task in the first computing resource that meets the fourth preset condition is migrated to the second computing resource for execution.
5. The method according to claim 1, characterized in that The CPU computing resources of the autonomous driving system are divided into a first computing resource and a second computing resource, the first computing resource is used to run tasks with a priority higher than a first priority threshold, the second computing resource is used to run tasks with a priority lower than a second priority threshold, and the second priority threshold is lower than the first priority threshold; The step of migrating the target task in the autonomous driving system that meets the first preset condition to the target system for execution includes: The target task in the second computing resource that meets the first preset condition is migrated to the target system for execution, and the fifth task in the first computing resource that meets the fifth preset condition is migrated to the second computing resource for execution.
6. The method according to claim 1, characterized in that The step of migrating the target task in the autonomous driving system that meets the first preset condition to the target system for execution includes: Sending input data required for running the target task to the target system through a data distribution service DDS; The target system is controlled to execute the target task based on the input data.
7. The method according to claim 1, characterized in that The first preset condition includes at least one of the following: The execution period of the target task is greater than the execution period threshold; The input data required to run the target task does not include the running result of the preset core task; The target task has a preset label, and the preset label indicates that the allowed response time of the target task is greater than a time threshold.
8. The method according to claim 3, characterized in that The second preset condition is that the priority of the second task is lower than a third priority threshold and the total amount of computing resources occupied by the second task does not exceed the available computing resources of the shared computing resources.
9. The method according to claim 4, characterized in that The fourth preset condition is that the priority of the fourth task is lower than the third priority threshold and the total amount of computing resources occupied by the fourth task does not exceed the available computing resources of the second computing resources.
10. A load optimization device, characterized in that: The device comprises: A first acquisition module is used to acquire a target load parameter of the automatic driving system; A first determination module is used to match the target load parameter based on a preset correspondence between the load parameter and the load score to obtain a target load score that matches the target load parameter, wherein the target load score is positively correlated with the load size of the autonomous driving system; A first judgment module, used to judge whether the target load score is greater than a load score threshold; The first migration module is used to migrate the target task that meets the first preset condition in the automatic driving system to the target system for operation when the target load score is greater than the load score threshold.
11. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the load optimization method as described in any one of claims 1-9 is implemented.
12. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the load optimization method according to any one of claims 1 to 9 is implemented.
13. A vehicle, characterized in that: The vehicle includes at least one of the following: The load optimization device according to any one of claim 10; The electronic device as claimed in claim 11; The computer storage medium of claim 12.
Citation Information
Cited By
Cooperative operation method of multiple substrate management controllers and electronic equipment
CN120723489A