Resource allocation method, device and equipment based on virtualization technology
By using virtualization technology for resource allocation, the problems of increased vehicle weight and wasted computing power caused by the increase in electronic control units have been solved, realizing multi-domain integration and performance release of the whole vehicle, and reducing vehicle complexity and cost.
Patent Information
- Application Number
- CN202111678552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2041-12-31
AI Technical Summary
With the development of vehicle intelligence, electrification and connectivity technologies, the number of electronic control units has increased, leading to increased vehicle weight, longer and more complex wiring harnesses. At the same time, the performance of system-on-a-chip cannot be fully utilized, resulting in a waste of computing power.
A resource allocation method based on virtualization technology is adopted. By receiving resource requests from applications, virtual hardware resource information and addresses are obtained, and computing and memory resources are allocated to achieve virtualization and unified scheduling of hardware resources, supporting multi-domain integration.
Performing multiple functions on a single chip reduces the number of electronic control units, lowers vehicle weight and wiring harness complexity, reduces manufacturing costs and maintenance difficulty, and fully unleashes chip performance.
Smart Images

Figure CN114296943B_ABST
Abstract
Description
Technical Field
[0001] This application relates to multi-domain fusion control technology for vehicles, and more particularly to a resource allocation method, apparatus, and device based on virtualization technology. Background Technology
[0002] With the rapid development of vehicle intelligence, electrification and connectivity technologies, the number of vehicle electronic control units is also gradually increasing. For example, there are electronic control units responsible for intelligent driving functions, instrument functions, entertainment functions and vehicle control functions.
[0003] Currently, within the electronic and electrical architecture of a vehicle, each electronic control unit performs its own function, and these electronic control units interact with each other through a communication bus to realize the functions of the entire vehicle.
[0004] However, with the increase in electronic control units, problems such as increased vehicle weight, increased vehicle wiring harness length and complexity will arise. At the same time, with the continuous improvement of system-on-a-chip performance, the performance of chips that are only responsible for a single function cannot be fully utilized, resulting in a waste of computing power. Summary of the Invention
[0005] This application provides a resource allocation method, apparatus, and device based on virtualization technology to solve the problem of wasted computing power.
[0006] Firstly, this application provides a resource allocation method based on virtualization technology, including:
[0007] Receive resource requests sent by applications to be processed;
[0008] In response to the resource request, the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located are obtained from the configuration file.
[0009] Based on the virtual hardware resource information corresponding to the application to be processed, allocate corresponding computing resources to the application to be processed.
[0010] Based on the virtual address of the application to be processed and the virtual physical address of the application domain in which the application to be processed resides, allocate corresponding memory resources to the application to be processed.
[0011] Secondly, this application provides a resource allocation device based on virtualization technology, comprising:
[0012] The receiving unit is used to receive resource requests sent by applications to be processed.
[0013] The acquisition unit is used to, in response to the resource request, acquire from the configuration file the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located.
[0014] The first allocation unit is used to allocate corresponding computing resources to the application to be processed according to the virtual hardware resource information corresponding to the application to be processed;
[0015] The second allocation unit is used to allocate corresponding memory resources to the application to be processed based on the virtual address corresponding to the application to be processed and the virtual physical address corresponding to the application domain where the application to be processed is located.
[0016] Thirdly, this application provides a computer device, including: a processor and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method described in the first aspect above.
[0017] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in the first aspect above.
[0018] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the first aspect above.
[0019] The resource allocation method, apparatus, and device based on virtualization technology provided in this application receive resource requests sent by applications to be processed; in response to resource requests, obtain virtual hardware resource information, virtual address, and virtual physical address of the application domain to be processed from a configuration file; allocate corresponding computing resources to the application based on the virtual hardware resource information; and allocate corresponding memory resources to the application based on the virtual address and virtual physical address of the application domain. Accordingly, by virtualizing the hardware resources of a system-on-a-chip and allocating them to various application domains of the vehicle, multiple functions can be completed on the same chip, thereby fully releasing chip performance and reducing computing power waste; simultaneously, it can support multi-domain fusion of the entire vehicle through a single controller, thereby reducing the number of electronic control units in the vehicle, reducing the length and complexity of vehicle wiring harnesses, reducing vehicle weight, lowering vehicle manufacturing costs, and reducing vehicle maintenance difficulty. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 A system architecture diagram illustrating a resource allocation method based on virtualization technology as an exemplary embodiment;
[0022] Figure 2 This is a schematic diagram illustrating the implementation principle of a scheduling management module as an exemplary embodiment.
[0023] Figure 3 This is a schematic diagram illustrating the implementation principle of an address space management module as an exemplary embodiment.
[0024] Figure 4 This is a schematic diagram illustrating the implementation principle of an exception handling module as an exemplary embodiment.
[0025] Figure 5 This is a schematic diagram illustrating the implementation principle of a shared memory module as an exemplary embodiment.
[0026] Figure 6 A flowchart illustrating a resource allocation method based on virtualization technology as an exemplary embodiment;
[0027] Figure 7 A flowchart illustrating a resource allocation method based on virtualization technology, as shown in another exemplary embodiment;
[0028] Figure 8 A schematic diagram of a resource allocation device based on virtualization technology, as shown in an exemplary embodiment;
[0029] Figure 9 A schematic diagram of the structure of a resource allocation device based on virtualization technology, as shown in another exemplary embodiment;
[0030] Figure 10 A schematic diagram of the structure of a computer device shown in an exemplary embodiment;
[0031] Figure 11 A block diagram of a computer device illustrated in an exemplary embodiment.
[0032] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0034] With the rapid development of vehicle intelligence, electrification and connectivity technologies, the number of vehicle electronic control units is also gradually increasing. For example, there are electronic control units responsible for intelligent driving functions, instrument functions, entertainment functions and vehicle control functions.
[0035] Currently, within the electronic and electrical architecture of a vehicle, each electronic control unit performs its own function, and these electronic control units interact with each other through a communication bus to realize the functions of the entire vehicle.
[0036] However, with the increase in electronic control units, problems such as increased vehicle weight, increased vehicle wiring harness length and complexity will arise. At the same time, with the continuous improvement of system-on-a-chip performance, the performance of chips that are only responsible for a single function cannot be fully utilized, resulting in a waste of computing power.
[0037] The resource allocation method based on virtualization technology provided in this application aims to solve the above-mentioned technical problems of the prior art.
[0038] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0039] Figure 1 This is a system architecture diagram illustrating a resource allocation method based on virtualization technology according to an exemplary embodiment. (e.g.) Figure 1 As shown, the system architecture, from bottom to top, includes a hardware layer, a virtualization layer, an operating system layer, and an application layer.
[0040] The hardware layer includes the hardware resources required to implement various functions, such as the central processing unit (CPU), neural network processor (NPU), graphics processing unit (GPU), security island (MCU), memory, and peripherals.
[0041] The virtualization layer includes basic modules that implement virtualization, such as scheduling and management modules, address space management modules, shared memory modules, exception handling modules, and device driver virtualization modules.
[0042] The operating system layer includes the underlying systems required to implement the functions of the upper layers. It is mainly divided into real-time operating systems with high functional safety levels and Linux operating systems without functional safety levels.
[0043] The application layer consists of applications that enable various functions. Application domains include, but are not limited to, the instrument domain, entertainment domain, intelligent driving domain, and vehicle control domain, which correspond to instrument applications (such as alarm display and speed display), vehicle networking applications (such as music and navigation), intelligent driving applications (such as fusion and perception), and control applications (such as lateral and longitudinal control and body control).
[0044] This system architecture enables the integration of most of the vehicle's main functions onto a single high-performance system-on-a-chip, thereby achieving the fusion of the entertainment, instrumentation, intelligent driving, and vehicle control domains.
[0045] The following section provides a detailed explanation of each module in the virtualization layer.
[0046] Figure 2 This is a schematic diagram illustrating the implementation principle of a scheduling management module according to an exemplary embodiment.
[0047] The scheduling and management module is responsible for the unified abstraction and scheduling of actual hardware resources. It configures corresponding computing resources for the instrument domain, entertainment domain, intelligent driving domain, and vehicle control domain, and provides computing resources to each domain in the form of virtual central processing unit (vCPU), virtual neural network processor (vNPU), virtual graphics processor (vGPU), and virtual security island (vMCU).
[0048] Optionally, in order to achieve efficient utilization of hardware resources, virtual hardware resources may be larger than physical hardware resources. Therefore, time-sharing multiplexing of physical hardware resources is necessary. The scheduling management module can reasonably allocate appropriate time slices to each virtual hardware resource and introduce different scheduling strategies (such as dedicated scheduling strategy and round-robin scheduling strategy) to meet the scheduling needs of different scenarios.
[0049] Dedicated scheduling strategies assign specific physical hardware resources to virtual hardware resources, guaranteeing their priority and time slices. This ensures that domains requiring real-time tasks can continuously obtain physical hardware resources, thus ensuring their security. This strategy can be applied to high-security application domains, such as vehicle control and autonomous driving domains.
[0050] Round-robin scheduling is a strategy that uses shared resources among applications of the same priority to achieve relative load balancing. This strategy can be applied to general application domains, such as entertainment domains.
[0051] Figure 3This is a schematic diagram illustrating the implementation principle of an address space management module according to an exemplary embodiment.
[0052] The address space management module virtualizes physical memory resources through the memory management unit, thereby enabling unified scheduling of physical memory resources.
[0053] The virtualization of physical memory resources is implemented through a two-level mapping. The first-level mapping maps the virtual addresses of application memory to the virtual physical addresses of operating system memory, while the second-level mapping maps the virtual physical addresses of operating system memory to the physical addresses of physical memory. The first-level mapping is implemented by the memory management unit within each domain, while the second-level mapping is implemented by the memory management unit of the virtualization layer.
[0054] For multi-domain integration, especially the integration of high-safety-level domains with low-safety-level domains or no-safety-level domains, such as the integration of the vehicle control domain and the entertainment domain, a key issue that needs to be addressed is the mutual interference between different domains to support the implementation of ASIL D (Automotive Safety Integrity Level) functional safety. A two-level mapping approach can ensure the continuation and independence of physical memory addresses between domains, thereby avoiding mutual interference and resolving memory fragmentation issues, ensuring efficient utilization of physical memory resources.
[0055] Figure 4 This is a schematic diagram illustrating the implementation principle of an exception handling module according to an exemplary embodiment.
[0056] The exception handling module is responsible for monitoring the health information of the entire domain and handling exceptions to ensure the safe and normal operation of each domain. For example... Figure 4 As shown, the exception handling module includes a virtualization layer self-test module, a domain status monitoring module, and a virtualization layer status monitoring module.
[0057] Initialization is achieved through the virtualization layer self-test module. Specifically, after the virtualization layer has started, it will initialize the environment of each domain according to the configuration file, including initializing the virtual physical resource list, allocating memory and address resources for peripheral devices, registering and binding related resources, and initializing and checking the virtual driver status of shared devices.
[0058] The domain status monitoring module monitors whether each domain is operating normally. Specifically, after the virtualization layer is turned on, the virtualization hardware watchdog continuously monitors the health status of each domain through heartbeat. When the heartbeat information is abnormal, the virtualization layer will take measures such as recovery or reset of each domain according to the preset strategy.
[0059] The virtualization layer status monitoring module monitors whether the virtualization layer is operating normally. Specifically, the virtualization layer monitors its own health information. Through the hardware watchdog mechanism, the virtualization layer feeds the hardware watchdog periodically. Once the virtualization layer's feeding time exceeds the set threshold, the hardware watchdog will immediately trigger a hardware interrupt to the virtualization layer or directly restart the hardware to ensure the normal operation of the virtualization layer.
[0060] Figure 5 This is a schematic diagram illustrating the implementation principle of a shared memory module according to an exemplary embodiment.
[0061] Because there is information exchange and communication between different domains, the virtualization layer uses a shared memory module to enable information exchange between multiple domains.
[0062] The shared memory module allocates shared memory across domains through a memory space allocation unit, thereby ensuring that the shared memory spaces of each domain do not interfere with each other. At the same time, by managing the memory space of each domain, the utilization of shared memory can be maximized and the generation of memory fragmentation can be reduced.
[0063] The shared memory module allocates read and write permissions to the shared memory space of each domain through the memory permission management unit, preventing abnormal read and write operations on the memory space by each domain under abnormal conditions, which could lead to cascading failures and meet the functional safety ASIL D requirements.
[0064] The shared memory module enables communication between domains through a publish-subscribe management unit. Communication between domains adopts a publish-subscribe model. When a domain wants to send information, it sends the topic to the shared memory module. The publish-subscribe management unit of the shared memory module will then send the topic to other domains. Other domains can choose whether to subscribe. After subscribing, once there are any updates to the topic, the publish-subscribe management unit will notify the domains that have subscribed to the topic.
[0065] The shared memory module verifies data through a secure communication strategy unit. The secure communication strategy unit has built-in cyclic redundancy check (CRC) and checksum algorithms. When writing data, each domain can call the CRC and checksum algorithms of the secure communication strategy unit and write the results into the data. When other domains read the data, they can verify it using the same algorithms to check whether the data has been lost, damaged, or otherwise faulty, thus ensuring the integrity and correctness of the communication data.
[0066] The device driver virtualization module is used to virtualize peripheral resources and provides functions such as registration and binding of peripheral resources.
[0067] The resource allocation method based on virtualization technology provided in this application is applied to the aforementioned virtualization layer, and the executing entity can be the chip or computer device where the aforementioned virtualization layer is located.
[0068] Figure 6 This is a flowchart illustrating a resource allocation method based on virtualization technology according to an exemplary embodiment, such as... Figure 6 As shown, the method includes:
[0069] S601 receives resource requests sent by applications to be processed.
[0070] An application pending processing refers to an application that needs to be allocated resources to perform its related functions. It can be an application in any of the application domains of the entire vehicle. A resource request is used to request the allocation of resources.
[0071] In one example, the resource request sent by the application to be processed carries the application identifier of the application to be processed and the application domain identifier of the application domain in which the application to be processed resides. The application identifier is used to distinguish different applications, and each application has a unique application identifier. The application domain identifier is used to distinguish different application domains, and each application domain has a unique application domain identifier.
[0072] S602, in response to a resource request, obtains from the configuration file the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located.
[0073] The configuration file pre-configures the mapping relationships between applications and virtual hardware resource information, applications and virtual addresses, and application domains and virtual physical addresses.
[0074] Optionally, the correspondence between the application and the virtual hardware resource information is specifically the correspondence between the application identifier and the virtual hardware resource information; the correspondence between the application and the virtual address is specifically the correspondence between the application identifier and the virtual address; and the correspondence between the application domain and the virtual physical address is specifically the correspondence between the application domain identifier and the virtual physical address.
[0075] Upon receiving a resource request from an application to be processed, the system retrieves the application identifier of the application to be processed and the application domain identifier of the application domain in which the application to be processed resides from the resource request. Then, based on the above correspondence, it retrieves the virtual hardware resource information corresponding to the application identifier of the application to be processed from the configuration file, using this as the virtual hardware resource information for the application to be processed; it retrieves the virtual address corresponding to the application identifier of the application to be processed from the configuration file, using this as the virtual address for the application to be processed; and it retrieves the virtual physical address corresponding to the application domain identifier of the application domain in which the application to be processed resides from the configuration file, using this as the virtual physical address for the application domain in which the application to be processed resides.
[0076] S603 allocates corresponding computing resources to the application to be processed based on the virtual hardware resource information corresponding to the application to be processed.
[0077] In one example, the virtual hardware resource information corresponding to the application to be processed includes computing power requirements, which indicate the type and size of computing resources needed by the application. Based on the virtual hardware resource information, corresponding computing resources are allocated to the application; specifically, this can be done by allocating computing resources to the application based on the computing power requirements in the virtual hardware resource information.
[0078] For example, if the current idle computing resources can meet the computing power requirements, then the corresponding idle computing resources are allocated to the application to be processed according to the computing power requirements.
[0079] In one example, the virtual hardware resource information corresponding to the application to be processed also includes a priority, which indicates the priority for the application to obtain computing resources. A priority can be pre-set for each application, and different applications can have the same or different priorities.
[0080] For example, if the current idle computing resources cannot meet the computing power demand, the priority of the application is compared to determine whether there are any free computing resources among the occupied resources. If so, the corresponding free computing resources are allocated to the application to be processed.
[0081] S604 allocates corresponding memory resources to the application to be processed based on the virtual address of the application to be processed and the virtual physical address of the application domain in which the application to be processed resides.
[0082] The mapping relationship between the virtual address of each application and the virtual physical address of its application domain, as well as the mapping relationship between the virtual physical address of each application domain and the physical address of the memory resource, can be pre-configured for allocating memory resources.
[0083] In one example, after obtaining the virtual address of the application to be processed and the virtual physical address of the application domain where the application to be processed is located, the physical address of the application to be processed is obtained based on the virtual address of the application to be processed, the virtual physical address of the application domain where the application to be processed is located, and the above two mapping relationships. The corresponding memory resources are then allocated to the application to be processed based on the obtained physical address.
[0084] In this embodiment, the hardware resources of the system-on-a-chip can be virtualized and allocated to various application domains of the vehicle, enabling multiple functions to be completed on the same chip, thereby fully releasing chip performance and reducing computing power waste. At the same time, it can support the integration of multiple domains of the vehicle through a single controller, thereby reducing the number of electronic control units in the vehicle, reducing the length and complexity of the vehicle's wiring harness, reducing the weight of the vehicle, and lowering the vehicle's manufacturing cost and maintenance difficulty.
[0085] Figure 7 This is a flowchart illustrating a resource allocation method based on virtualization technology according to an exemplary embodiment, such as... Figure 7 As shown, the method includes:
[0086] S701 receives a resource request sent by an application to be processed, the resource request including a shared topic.
[0087] A shared topic is an information topic used to enable communication between different domains. When a domain sends information on a shared topic, other domains that have subscribed to the shared topic can receive the notification of that information synchronously.
[0088] For example, other descriptions of S701 can be found in the description of S601, which will not be repeated here.
[0089] S702, in response to a resource request, obtains from the configuration file the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, the virtual physical address corresponding to the application domain where the application to be processed is located, and the virtual physical address corresponding to the shared topic.
[0090] The configuration file pre-configures the mapping between shared topics and virtual physical addresses. After obtaining a shared topic from a resource request, the virtual physical address corresponding to that shared topic is obtained from the configuration file according to the mapping.
[0091] For example, other descriptions of S702 can be found in the description of S602, which will not be repeated here.
[0092] S703 allocates corresponding computing resources to the application to be processed based on the virtual hardware resource information corresponding to the application to be processed.
[0093] In one example, the virtual hardware resource information corresponding to the application to be processed includes computing power requirements and priority. Based on the virtual hardware resource information corresponding to the application to be processed, corresponding computing resources are allocated to the application, including: if the currently available computing resources cannot meet the computing power requirements, then a corresponding first computing resource is allocated to the application to be processed; the first computing resource is the computing resource occupied by the first application, and the priority in the virtual hardware resource information corresponding to the first application is lower than the priority in the virtual hardware resource information corresponding to the application to be processed.
[0094] The priority in the virtual hardware resource information corresponding to the application to be processed is used to indicate the priority of the application in obtaining computing resources. A priority can be preset for each application, and the priorities of different applications can be the same or different. For example, applications in high security level domains (such as vehicle control domains or intelligent driving domains) can be set to higher priorities; applications in low security level domains (such as entertainment domains) can be set to higher priorities.
[0095] If the currently available computing resources are insufficient to meet the computing power requirements of the application waiting to be processed, a query is performed among the applications consuming computing resources to identify a first application with a lower priority than the application waiting to be processed. If such an application exists, the computing resources occupied by the first application can be released and allocated to the application waiting to be processed. This ensures that the domain requiring real-time tasks can continuously obtain physical hardware resources, guaranteeing its security.
[0096] In one example, the virtual hardware resource information corresponding to the application to be processed includes computing power requirements, priority, and time slice; according to the virtual hardware resource information corresponding to the application to be processed, the corresponding computing resources are allocated to the application, including: if the current idle computing resources cannot meet the computing power requirements, then according to the time slice, the corresponding second computing resources are allocated to the application to be processed; the second computing resources are the computing resources occupied by the second application, and the priority in the virtual hardware resource information corresponding to the second application is the same as the priority in the virtual hardware resource information corresponding to the application to be processed.
[0097] The priority slice in the virtual hardware resource information corresponding to the application to be processed indicates the time that the application will use the computing resources in turn. A time slice can be pre-set for each application, and the time slices of different applications can be the same or different.
[0098] If the currently available computing resources are insufficient to meet the computing power requirements of the application being processed, a query is performed among the applications occupying computing resources to identify a first application with a lower priority than the application being processed. If none are found, the query continues to identify a second application with a priority equal to that of the application being processed. If such an application exists, the application being processed and the second application take turns using the computing resources occupied by the second application. The duration for each use of the computing resources by the application being processed is the time indicated by the time slice. Based on this, for virtual hardware resources of the same priority, a shared resource-sharing approach is adopted to achieve relative load balancing.
[0099] S704, perform a first-level mapping on the virtual address corresponding to the application to be processed according to the first-level mapping relationship to obtain the virtual physical address corresponding to the application to be processed; the first-level mapping relationship includes the mapping relationship between the virtual address corresponding to each application and the virtual physical address corresponding to the application domain in which it is located.
[0100] For example, the mapping relationship between the virtual address of each application and the virtual physical address of the application domain can be pre-configured. After obtaining the virtual address of the application to be processed and the virtual physical address of the application domain, the virtual physical address of the application to be processed can be obtained based on the virtual address of the application to be processed, the virtual physical address of the application domain, and the mapping relationship.
[0101] S705 performs secondary mapping on the virtual physical address corresponding to the application to be processed according to the secondary mapping relationship to obtain the physical address corresponding to the application to be processed; the secondary mapping relationship includes the mapping relationship between the virtual physical address corresponding to each application domain and the physical address corresponding to the memory resource.
[0102] For example, the mapping relationship between the virtual physical address corresponding to each application domain and the physical address corresponding to the memory resource can be pre-configured. After obtaining the virtual physical address corresponding to the application to be processed, the physical address corresponding to the application to be processed can be obtained according to the virtual physical address corresponding to the application to be processed and the mapping relationship.
[0103] S706 allocates corresponding memory resources to the application to be processed based on the physical address of the application.
[0104] By allocating memory resources to the application to be processed through the above two-level mapping, the continuity and independence of physical memory addresses between domains can be guaranteed, thereby avoiding mutual interference between different domains. At the same time, it can also solve the problem of memory fragmentation and ensure the efficient use of physical memory resources.
[0105] S707 allocates corresponding shared memory resources to the application to be processed based on the virtual physical address corresponding to the shared topic.
[0106] For example, the mapping between shared topics and virtual physical addresses can be pre-configured. Based on the shared topic requested by the application to be processed and the mapping, the physical address corresponding to the shared topic can be obtained. Based on the physical address corresponding to the shared topic, the corresponding shared memory resources can be allocated to the application to be processed.
[0107] In one example, the running status of each application domain is monitored by heartbeat detection. If it is determined that the running status of an application domain is abnormal, the application domain is handled according to a preset strategy.
[0108] For example, the operation status of each application domain is monitored by heartbeat detection, including: sending a first heartbeat message to each application domain every first preset time interval; monitoring whether a second heartbeat message based on the first heartbeat message is received from each application domain within a second preset time interval after sending the first heartbeat message; if a second heartbeat message based on the first heartbeat message is not received from the application domain for a preset number of consecutive times, it is determined that the operation status of the application domain is abnormal.
[0109] The first preset time, second preset time, and consecutive preset number of times can all be set according to actual needs and are not limited here. Under normal circumstances, after receiving the first heartbeat information, the application domain will send back the second heartbeat information within the preset time. If the second heartbeat information is not sent back within the preset number of consecutive times, it indicates that an anomaly has occurred. When an application domain anomaly is detected, the application domain can be restored or reset according to the preset strategy to ensure the normal operation of the application domain.
[0110] Figure 8 This is a schematic diagram illustrating the structure of a resource allocation device 800 based on virtualization technology according to an exemplary embodiment. The device can be a software module, a hardware module, or a combination of both, integrated into a computer device, such as... Figure 8 As shown, the device 800 includes:
[0111] The receiving unit 810 is used to receive resource requests sent by the application to be processed;
[0112] The acquisition unit 820 is used to obtain, in response to a resource request, the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located from the configuration file.
[0113] The first allocation unit 830 is used to allocate corresponding computing resources to the application to be processed according to the virtual hardware resource information corresponding to the application to be processed.
[0114] The second allocation unit 840 is used to allocate corresponding memory resources to the application to be processed based on the virtual address corresponding to the application to be processed and the virtual physical address corresponding to the application domain where the application to be processed is located.
[0115] In one example, the virtual hardware resource information corresponding to the application to be processed includes computing power requirements and priority; the first allocation unit 830 is specifically used to: if the current idle computing resources cannot meet the computing power requirements, allocate the corresponding first computing resources to the application to be processed; the first computing resources are the computing resources occupied by the first application, and the priority in the virtual hardware resource information corresponding to the first application is lower than the priority in the virtual hardware resource information corresponding to the application to be processed.
[0116] In one example, the virtual hardware resource information corresponding to the application to be processed includes computing power requirements, priority, and time slice; the first allocation unit 830 is specifically used to: if the current idle computing resources cannot meet the computing power requirements, allocate corresponding second computing resources to the application to be processed according to the time slice; the second computing resources are the computing resources occupied by the second application, and the priority in the virtual hardware resource information corresponding to the second application is the same as the priority in the virtual hardware resource information corresponding to the application to be processed.
[0117] Figure 9 This is a schematic diagram illustrating the structure of a resource allocation device 900 based on virtualization technology according to an exemplary embodiment. Figure 8 Based on the illustrated embodiments, as Figure 9 As shown, the second allocation unit 840 includes:
[0118] The first mapping module 841 is used to perform a first-level mapping on the virtual address corresponding to the application to be processed according to the first-level mapping relationship, so as to obtain the virtual physical address corresponding to the application to be processed; the first-level mapping relationship includes the mapping relationship between the virtual address corresponding to each application and the virtual physical address corresponding to the application domain in which it is located.
[0119] The second mapping module 842 is used to perform secondary mapping on the virtual physical address corresponding to the application to be processed according to the secondary mapping relationship, so as to obtain the physical address corresponding to the application to be processed; the secondary mapping relationship includes the mapping relationship between the virtual physical address corresponding to each application domain and the physical address corresponding to the memory resource.
[0120] The memory allocation module 843 is used to allocate corresponding memory resources to the application to be processed based on the physical address of the application to be processed.
[0121] In one example, the resource request includes a shared topic, and the acquisition unit 820 is also used to retrieve the virtual physical address corresponding to the shared topic from the configuration file in response to the resource request.
[0122] In one example, the device 800 also includes:
[0123] The third allocation unit 850 is used to allocate corresponding shared memory resources to the application to be processed based on the virtual physical address corresponding to the shared topic.
[0124] In one example, the device 800 also includes:
[0125] The exception handling unit 860 is used to monitor the running status of each application domain through heartbeat detection. If it is determined that the running status of an application domain is abnormal, the exception handling unit will handle the application domain according to the preset strategy.
[0126] In one example, the exception handling unit 860 is also configured to send heartbeat detection information to each application domain every first preset time interval, and monitor whether heartbeat feedback information returned by each application domain is received within a second preset time interval after sending the heartbeat detection information; if no heartbeat feedback information returned by the application domain is received for a consecutive preset number of times, it is determined that the running status of the application domain is abnormal.
[0127] Figure 10 This is a schematic diagram of the structure of a computer device according to an exemplary embodiment. The computer device includes: a processor 1001 and a memory 1002 communicatively connected to the processor 1001; the memory 1002 stores computer execution instructions; the processor 1001 executes the computer execution instructions stored in the memory 1002 to implement the method provided in the above embodiment.
[0128] The computer device also includes a receiver 1003 and a transmitter 1004. The receiver 1003 is used to receive instructions and data sent by external devices, and the transmitter 1004 is used to send instructions and data to external devices.
[0129] Figure 11 This is a block diagram illustrating a terminal device according to an exemplary embodiment. The device may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc.
[0130] Device 1100 may include one or more of the following components: processing component 1102, memory 1104, power supply component 1106, multimedia component 1108, audio component 1110, input / output (I / O) interface 1112, sensor component 1114, and communication component 1116.
[0131] Processing component 1102 typically controls the overall operation of device 1100, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1102 may include one or more processors 1120 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1102 may include one or more modules to facilitate interaction between processing component 1102 and other components. For example, processing component 1102 may include a multimedia module to facilitate interaction between multimedia component 1108 and processing component 1102.
[0132] Memory 1104 is configured to store various types of data to support the operation of device 1100. Examples of such data include instructions for any application or method operating on device 1100, contact data, phonebook data, messages, pictures, videos, etc. Memory 1104 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0133] Power supply component 1106 provides power to various components of device 1100. Power supply component 1106 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to device 1100.
[0134] Multimedia component 1108 includes a screen that provides an output interface between device 1100 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1108 includes a front-facing camera and / or a rear-facing camera. When device 1100 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0135] Audio component 1110 is configured to output and / or input audio signals. For example, audio component 1110 includes a microphone (MIC) configured to receive external audio signals when device 1100 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1104 or transmitted via communication component 1116. In some embodiments, audio component 1110 also includes a speaker for outputting audio signals.
[0136] I / O interface 1112 provides an interface between processing component 1102 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0137] Sensor assembly 1114 includes one or more sensors for providing state assessments of various aspects of device 1100. For example, sensor assembly 1114 may detect the on / off state of device 1100, the relative positioning of components such as the display and keypad of device 1100, changes in the position of device 1100 or a component of device 1100, the presence or absence of user contact with device 1100, the orientation or acceleration / deceleration of device 1100, and temperature changes of device 1100. Sensor assembly 1114 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1114 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1114 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.
[0138] Communication component 1116 is configured to facilitate wired or wireless communication between device 1100 and other devices. Device 1100 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1116 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1116 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0139] In an exemplary embodiment, the apparatus 1100 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0140] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1104 including instructions, which can be executed by a processor 1120 of the device 1100 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0141] This application also provides a non-transitory computer-readable storage medium, wherein when the instructions in the storage medium are executed by the processor of a computer device, the computer device is able to perform the method provided in any of the above embodiments.
[0142] This invention also provides a computer program product, comprising: a computer program stored in a readable storage medium, wherein at least one processor of a computer device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the computer device to perform the method provided in any of the above embodiments.
[0143] It should be understood that the terms "first," "second," etc., used in the above embodiments are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Furthermore, in the description of this application, unless otherwise stated, "a plurality of" means at least two.
[0144] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0145] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A resource allocation method based on virtualization technology, characterized in that, The method includes: Receive resource requests sent by applications to be processed; wherein, the applications to be processed are applications in any application domain; the application domain includes at least one of the instrument domain, entertainment domain, intelligent driving domain, and vehicle control domain; In response to the resource request, the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located are obtained from the configuration file; the resource request carries the application identifier of the application to be processed and the application domain identifier of the application domain where the application to be processed is located. Based on the virtual hardware resource information corresponding to the application to be processed, allocate corresponding computing resources to the application to be processed. The virtual addresses corresponding to the applications to be processed are mapped according to the primary mapping relationship to obtain the virtual physical addresses corresponding to the application domains where the applications to be processed reside; the primary mapping relationship includes the mapping relationship between the virtual addresses corresponding to each application and the virtual physical addresses corresponding to the application domains where they reside. The virtual physical address corresponding to the application domain where the application to be processed is located is mapped in a secondary mapping relationship to obtain the physical address corresponding to the application to be processed; the secondary mapping relationship includes the mapping relationship between the virtual physical address corresponding to each application domain and the physical address corresponding to the memory resource. Based on the physical address of the application to be processed, allocate corresponding memory resources to the application to be processed. If the resource request includes a shared topic, then the response to the resource request also includes: Obtain the virtual physical address corresponding to the shared topic from the configuration file; Based on the virtual physical address corresponding to the shared topic, allocate the corresponding shared memory resources to the application to be processed.
2. The method according to claim 1, characterized in that, The virtual hardware resource information corresponding to the application to be processed includes computing power requirements and priority; Based on the virtual hardware resource information corresponding to the application to be processed, allocate corresponding computing resources to the application, including: If the current idle computing resources cannot meet the computing power requirements, then the corresponding first computing resources are allocated to the application to be processed. The first computing resource is the computing resource occupied by the first application, and the priority in the virtual hardware resource information corresponding to the first application is lower than the priority in the virtual hardware resource information corresponding to the application to be processed.
3. The method according to claim 1, characterized in that, The virtual hardware resource information corresponding to the application to be processed includes computing power requirements, priority, and time slice; Based on the virtual hardware resource information corresponding to the application to be processed, allocate corresponding computing resources to the application, including: If the current idle computing resources cannot meet the computing power demand, then the corresponding second computing resources are allocated to the application to be processed according to the time slice; The second computing resource is the computing resource occupied by the second application, and the priority in the virtual hardware resource information corresponding to the second application is the same as the priority in the virtual hardware resource information corresponding to the application to be processed.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: The operating status of each application domain is monitored by heartbeat detection. If it is determined that the operating status of an application domain is abnormal, the application domain is handled according to a preset strategy.
5. The method according to claim 4, characterized in that, The operational status of each application domain is monitored through heartbeat detection, including: A first heartbeat message is sent to each application domain at a first preset time interval. After sending the first heartbeat message, it is monitored whether a second heartbeat message based on the first heartbeat message is received from each application domain within a second preset time interval. If the application domain fails to receive a second heartbeat based on the first heartbeat information for a preset number of consecutive times, it is determined that the application domain is in an abnormal operating state.
6. A resource allocation device based on virtualization technology, characterized in that, The device includes: A receiving unit is configured to receive resource requests sent by an application to be processed; wherein the application to be processed is an application in any application domain; the application domain includes at least one of an instrument domain, an entertainment domain, an intelligent driving domain, and a vehicle control domain; The acquisition unit is configured to, in response to the resource request, acquire from the configuration file the virtual hardware resource information corresponding to the application to be processed, the virtual address corresponding to the application to be processed, and the virtual physical address corresponding to the application domain where the application to be processed is located; the resource request carries the application identifier of the application to be processed and the application domain identifier of the application domain where the application to be processed is located. The first allocation unit is used to allocate corresponding computing resources to the application to be processed according to the virtual hardware resource information corresponding to the application to be processed; The second allocation unit is configured to perform a first-level mapping on the virtual addresses corresponding to the application to be processed according to a first-level mapping relationship, thereby obtaining the virtual physical address corresponding to the application domain where the application to be processed resides; the first-level mapping relationship includes the mapping relationship between the virtual addresses corresponding to each application and the virtual physical addresses corresponding to the application domain where it resides; perform a second-level mapping on the virtual physical addresses corresponding to the application domain where the application to be processed resides according to a second-level mapping relationship, thereby obtaining the physical address corresponding to the application to be processed; the second-level mapping relationship includes the mapping relationship between the virtual physical addresses corresponding to each application domain and the physical addresses corresponding to memory resources; and allocate corresponding memory resources to the application to be processed according to the physical address corresponding to the application to be processed. If the resource request includes a shared topic, the acquisition unit is further configured to, in response to the resource request, obtain the virtual physical address corresponding to the shared topic from the configuration file; The third allocation unit is used to allocate corresponding shared memory resources to the application to be processed based on the virtual physical address corresponding to the shared topic.
7. A computer device, characterized in that, include: A processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Resource processing method and device
CN105988874A
Resource access method applied to computer and computer
CN107783913A