Methods and systems for scheduling and borrowing hardware-in-the-loop test resources in multi-tenant environments
By using dynamic verification and cross-tenant borrowing of compatible devices, the problems of low resource utilization and functional safety hierarchical isolation in hardware-in-the-loop testing were solved, achieving efficient resource management and security compliance, and improving overall testing efficiency and cost-effectiveness.
Patent Information
- Application Number
- CN202611362372.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-11-17
AI Technical Summary
In existing multi-tenant environments, hardware-in-the-loop testing resources are underutilized, lack cross-tenant borrowing mechanisms, have insufficient hardware compatibility verification, lack functional safety hierarchical isolation, suffer from deadlock in multi-resource collaborative scheduling, and cannot bind test environment snapshots to physical hardware.
By receiving test tasks, analyzing task security levels and compatibility requirements, dynamically verifying resource quotas, borrowing compatible devices across tenants, implementing isolation levels and permission management, monitoring heartbeat status, automatically restoring hardware connection status, generating snapshots, and performing full-link auditing.
Significantly improves the utilization rate of hardware-in-the-loop testing resources, reduces hardware procurement costs, improves R&D testing efficiency, meets functional safety compliance requirements, reduces the need for manual coordination, and eliminates resource deadlock and long-term occupation.
Smart Images

Figure CN123114971A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud-native multi-tenant resource scheduling technology, and in particular to a method, system and storage medium for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment, applicable to cross-tenant scheduling and borrowing of hardware-in-the-loop test equipment and simulation software license resources in a multi-tenant R&D verification platform of an automotive group. Background Technology
[0002] As automotive groups advance their digital transformation in R&D, an increasing number of automotive parts groups are adopting a multi-tenant architecture to build unified R&D verification platforms. Each subsidiary acts as a first-level tenant, while business units and projects act as lower-level tenants. Within the platform, they independently conduct hardware-in-the-loop (HIL) testing of electronic control units (such as transmission control units (TCUs), brake-by-wire EMBs, and autonomous driving actuators). Hardware-in-the-loop testing requires the simultaneous use of various resources, including HIL physical testing equipment, corresponding simulation software licenses, and dedicated testing environments. Furthermore, the testing tasks of different tenants vary significantly in terms of security levels, priorities, and hardware compatibility requirements, posing high demands on resource scheduling in a multi-tenant environment.
[0003] In existing technologies, multi-tenant systems typically allocate HIL physical test equipment and simulation software licenses using a fixed, static quota method. However, the testing tasks of different subsidiary tenants often exhibit significant peak-and-trough imbalances: some tenants experience congestion and equipment queuing during peak testing periods, while tenants with ample idle resources operate at low loads for extended periods, resulting in an overall utilization rate of only around 30% for both equipment and licenses. Because dynamic resource allocation among different tenants is not possible, the group is forced to repeatedly purchase expensive HIL hardware and commercial simulation licenses based on each tenant's peak demand, leading to persistently high overall resource ownership costs.
[0004] Meanwhile, existing resource scheduling only supports resource reuse within a tenant and lacks an automated mechanism for temporary borrowing of idle equipment across tenants. In actual R&D, resource borrowing between tenants often relies on manual coordination, resulting in a lengthy borrowing process. There is a lack of quantifiable borrowing trigger thresholds and automatic expiration recovery logic. Borrowed resources cannot be distinguished from tenants' own resources, which can easily lead to resource occupation conflicts, missed returns, and other problems, resulting in low efficiency in cross-tenant resource collaboration.
[0005] Furthermore, existing scheduling schemes only verify whether the tenant's remaining quota is sufficient when matching resources for test tasks, without verifying hardware compatibility parameters such as the number of I / O channels, bus protocol, ECU compatibility model, and real-time computing power of HIL devices. HIL test tasks are strongly hardware-bound; once a task is assigned to incompatible hardware, the test task will fail directly, resulting in ineffective resource usage and further exacerbating resource shortages.
[0006] In terms of functional safety, the development of automotive electronic control products follows the ISO 26262 functional safety standard. High-level functional safety testing tasks such as ASIL-D and ASIL-C require complete physical isolation of hardware and data to eliminate safety risks. However, existing scheduling systems generally adopt a unified logical sharing model, allowing high-security-level equipment to be borrowed by ordinary tenants, posing functional safety compliance risks. Furthermore, existing systems lack mechanisms to prevent such violations, such as tool-based status verification and automated verification of graded test coverage, making it difficult to meet functional safety audit requirements.
[0007] On the other hand, HIL test tasks need to occupy three types of resources simultaneously: physical test equipment, simulation software licenses, and dedicated test environments. The existing scheduling scheme does not have an ordered locking sequence and rollback mechanism for resources, which can easily lead to resource deadlocks. In scenarios such as task crashes, node failures, and abnormal process interruptions, there is also a lack of a forced heartbeat reclamation mechanism, which can easily cause licenses and hardware resources to be suspended and occupied for a long time without being released in a timely manner.
[0008] Furthermore, existing general-purpose container snapshots can only save the software runtime environment and cannot bind to the connection status of HIL physical hardware. When testing to reproduce the problem, it is necessary to redo the hardware wiring, communication matching, and other tasks. Environment reconstruction is time-consuming, prolongs the fault repair cycle, and reduces the efficiency of R&D testing iterations.
[0009] In summary, existing publicly available solutions for multi-tenant resource scheduling, multi-level group tenants, and data isolation are mostly aimed at the management of general computing resources or software systems. They lack an integrated scheduling solution specifically designed for automotive HIL-specific physical test equipment, encompassing compatibility matching, cross-tenant borrowing, functional safety hierarchical isolation, and multi-resource collaborative locking. This makes them unsuitable for the specific scenario requirements of automotive group electronic control hardware-in-the-loop R&D and verification. Therefore, there is an urgent need for a scheduling and borrowing solution for hardware-in-the-loop test resources in a multi-tenant environment that is compatible with the ISO 26262 functional safety standard and caters to multi-level group tenants. Summary of the Invention
[0010] To address the technical problems in existing technologies, such as low resource utilization due to static quotas for HIL devices and simulation licenses, lack of standardized cross-tenant borrowing mechanisms, lack of hardware compatibility verification, missing functional safety hierarchical isolation, deadlock and abnormal occupation in multi-resource collaborative scheduling, and inability to bind test environment snapshots to physical hardware, this invention provides a method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment, comprising the following steps:
[0011] Receive test tasks, determine the tenant to which the test task belongs, and parse the task security level, priority, compatibility requirements for hardware-in-the-loop devices, and the required simulation software license model and concurrent seats. Compatibility requirements include ECU model, number of I / O channels, bus protocol, and real-time processing performance requirements.
[0012] The test tasks are validated based on the tenant’s resource quota, which includes the hardware-in-the-loop device quota, the simulation software license quota, and the test environment quota.
[0013] After verification, the isolation level and cross-tenant borrowing permissions for the test task are determined based on the task's security level.
[0014] Iterate through all hardware-in-the-loop devices in the global hardware-in-the-loop device pool, filter candidate devices based on compatibility requirements, and prioritize matching idle compatible devices of the tenant to which the test task belongs.
[0015] When the tenant to which the test task belongs has no available compatible devices, the borrowing admission conditions are determined based on the priority of the test task and the cross-tenant borrowing permission.
[0016] If the secondment eligibility criteria are not met, the test task will be placed in the queue. If the secondment eligibility criteria are met, a cross-tenant secondment decision will be triggered.
[0017] When the borrowing trigger condition is met, idle hardware-in-the-loop devices and simulation software licenses are borrowed from the lending tenant with idle compatible devices in the global hardware-in-the-loop device pool. The number of hardware-in-the-loop devices to be borrowed is determined based on the number of hardware-in-the-loop devices required by the test task, the number of idle compatible devices of the tenant to which the test task belongs, and the global borrowing limit. The borrowing period is set based on the estimated runtime of the test task, and a borrowing record is generated.
[0018] Build the corresponding test environment according to the isolation level, and lock the simulation software license, hardware-in-the-loop device, and test environment in sequence. If locking any resource fails, release all locked resources. After all resources are successfully locked, start the test task.
[0019] During the test task execution, monitor the heartbeat status of the hardware-in-the-loop device. If the heartbeat is interrupted for more than a set duration, forcibly reclaim the occupied resources and terminate the test task.
[0020] After the test task is completed, return the owned resources to the resource pool corresponding to the tenant to which the test task belongs, return the borrowed resources to the resource pool corresponding to the lending tenant, release the simulation software license, destroy the test environment and archive the test data, and generate a recycling record.
[0021] Furthermore, candidate devices are screened based on compatibility requirements, including:
[0022] Obtain device information for each device in the global hardware-in-the-loop device pool. Device information includes the number of IO channels, supported bus protocols, a list of compatible ECU models, real-time processor computing power, current status, tenant, and security partition identifier. The current status is reported periodically and updated in real time by the edge acquisition nodes.
[0023] Remove devices currently under maintenance or faulty status, as well as devices whose security zones do not meet isolation level requirements.
[0024] Among the devices belonging to the tenant of the test task, devices currently in an idle state and matching the compatibility requirements are selected as candidate devices. Matching the compatibility requirements means: the number of I / O channels of the candidate device is not less than the number of I / O channels specified in the compatibility requirements; the bus protocols supported by the candidate device include those specified in the compatibility requirements; the list of compatible ECU models for the candidate device includes those specified in the compatibility requirements; and the real-time processor computing power of the candidate device is not less than the real-time processing performance requirements specified in the compatibility requirements.
[0025] If the tenant to which the test task belongs does not have any available candidate devices, select devices that are currently available and match the compatibility requirements from among the devices of the lending tenants whose cross-tenant borrowing permissions are allowed, and use them as candidate devices.
[0026] Furthermore, the priorities are divided into five levels from high to low: P0, P1, P2, P3, and P4. Test tasks are assigned to the corresponding queues according to their priorities, with higher priority queues being scheduled first.
[0027] After P0, P1, and P2 level test tasks are started, they enter a preemptive protection period of a set duration. When a high-priority test task competes with a running low-priority test task for equipment, and the low-priority test task has exceeded its preemptive protection period, the low-priority test task is paused, an environment snapshot is generated, the hardware-in-the-loop device it occupies is released, and the low-priority test task is re-queued. Specifically, P0 level test tasks can preempt P2 level and lower level test tasks, and P1 level test tasks can preempt P3 level and lower level test tasks.
[0028] High-priority test tasks can reserve hardware-in-the-loop devices within a set time period in advance. During the reserved time period, the hardware-in-the-loop devices remain locked and do not participate in cross-tenant borrowing and allocation. Low-priority test tasks should avoid the reserved time period.
[0029] Furthermore, the borrowing trigger conditions include: the hardware-in-the-loop utilization rate of the tenant to which the test task belongs is not lower than a first threshold for a first set duration; and the hardware-in-the-loop utilization rate of the lending tenant is not higher than a second threshold for a second set duration.
[0030] Determine the number of devices to be borrowed, including: the remaining number after deducting the number of idle compatible devices of the tenant to which the test task belongs from the number of hardware-in-the-loop devices required for the test task, the number of idle compatible devices of the lending tenant, and the global borrowing limit. Select the minimum value among the three as the number of hardware-in-the-loop devices to be borrowed.
[0031] The number of simulation software licenses that can be borrowed is determined by the minimum of the following three factors: the number of concurrent seats required for the test task (after deducting the available license seats of the tenant to which the test task belongs), the available license seats of the borrowing tenant, and the global license borrowing limit.
[0032] Set a secondment period, including: setting an initial period for the secondment, allowing the submission of a renewal application before the expiration of the initial period, and ensuring that the cumulative period after renewal does not exceed the set upper limit.
[0033] During the secondment period, the seconded hardware-in-the-loop equipment is prohibited from being seconded to other tenants.
[0034] Furthermore, the return of owned resources and borrowed resources should be differentiated and made separately, including:
[0035] Upon the expiration of the secondment period, after the testing tasks are completed, the seconded hardware-in-the-loop equipment and simulation software licenses will be retrieved and returned to the lending tenant.
[0036] When a tenant initiates a high-priority test task and there are insufficient compatible devices available, the borrowed hardware-in-the-loop devices and simulation software licenses will be reclaimed after the test task is completed, without forcibly interrupting the running test task.
[0037] If a test task crashes, a node becomes unreachable, or a heartbeat interruption exceeds a set time, the borrowed hardware-in-the-loop devices will be forcibly reclaimed and returned to the lending tenant. If a test task terminates abnormally or the queue times out, the simulation software license occupied by the test task will be forcibly released and returned according to the ownership of the simulation software license, generating an abnormal reclamation record.
[0038] Generate end-to-end audit logs, which include the tenant initiating the borrowing, the lending tenant, the device number of the hardware-in-the-loop device, the start and end times of the borrowing, renewal records, reasons for retrieval, and task execution logs.
[0039] Furthermore, based on the task's security level, the isolation level and cross-tenant borrowing permissions for the test task are determined, including:
[0040] The isolation level and cross-tenant borrowing permissions are determined based on preset security level mapping rules. Specifically: When the task security level is ASIL-C or ASIL-D, the isolation level is physical isolation, and cross-tenant borrowing permissions prohibit borrowing tenant equipment and also prohibit lending idle equipment. When the task security level is ASIL-A or ASIL-B, the isolation level is schema-level logical isolation, and cross-tenant borrowing permissions only allow borrowing idle equipment from QM-level tenants and prohibit lending idle equipment. When the task security level is QM, the isolation level is row-level logical isolation, and cross-tenant borrowing permissions allow free participation in cross-tenant borrowing and the lending of idle equipment.
[0041] Verify the qualification status of the simulation tools required for the test task. If the task safety level is ASIL-A or higher and the simulation tools have not completed functional safety qualification, block the allocation of resources for the test task.
[0042] The test coverage threshold for a test task is determined based on the task's security level. When the actual coverage of a test task is lower than the test coverage threshold, the test task is blocked from starting, and locked resources are reclaimed.
[0043] After borrowing hardware-in-the-loop devices, an independent isolated test environment is automatically created, and the operating data and test reports of the hardware-in-the-loop devices are stored separately with a borrowing identifier attached.
[0044] Furthermore, the simulation software license pool model is established based on four dimensions: toolchain, functional module, concurrent seats, and tenant quota, and managed by distinguishing between owned licenses and borrowed licenses. The license type refers to the type of license identified by the toolchain or functional module.
[0045] Furthermore, an environment snapshot is generated for the test task. The environment snapshot includes the container software status, test data volume, hardware-in-the-loop device IO channel configuration, bus communication parameters, and hardware connection handshake information, and supports incremental snapshots.
[0046] When a test task is preempted, a defect occurs during testing, or the test task is manually saved, an environment snapshot is generated and the hardware-in-the-loop device occupied by the test task is bound.
[0047] When restoring an environment snapshot, it automatically matches compatible hardware-in-the-loop devices, relocks the simulation software licenses required for the test task, rebuilds the hardware communication link, and synchronizes the IO configuration.
[0048] On the other hand, the present invention provides a scheduling and borrowing system for hardware-in-the-loop test resources in a multi-tenant environment, comprising:
[0049] The task access module is used to receive test tasks, determine the tenant to which the test task belongs, and parse the task security level, priority, compatibility requirements for hardware-in-the-loop devices, and the required simulation software license model and concurrent seats of the test task. The compatibility requirements include ECU model, number of IO channels, bus protocol and real-time processing performance requirements.
[0050] The scheduling engine verifies test tasks based on tenant resource quotas, including hardware-in-the-loop (HIL) device quotas, simulation software license quotas, and test environment quotas. It determines the isolation level and cross-tenant borrowing permissions for test tasks based on their security level. The engine iterates through the global HIL pool, filtering candidate devices based on compatibility requirements and prioritizing idle compatible devices belonging to the tenant of the test task. If no idle compatible devices are available in the tenant of the test task, the engine determines whether the borrowing criteria are met based on the test task's priority and cross-tenant borrowing permissions. If not, the test task is placed in a queue. If the criteria are met, a cross-tenant borrowing decision is triggered.
[0051] The borrowing module is used to borrow idle hardware-in-the-loop devices and simulation software licenses from tenants with idle compatible devices in the global hardware-in-the-loop device pool when the borrowing trigger conditions are met. The number of hardware-in-the-loop devices to be borrowed is determined based on the number of hardware-in-the-loop devices required by the test task, the number of idle compatible devices of the tenant to which the test task belongs, and the global borrowing limit. The borrowing period is set based on the estimated runtime of the test task, and a borrowing record is generated.
[0052] The multi-resource locking module is used to build corresponding test environments according to isolation levels, locking the simulation software license, hardware-in-the-loop devices, and the test environment sequentially. If locking any resource fails, all locked resources are released. After all resources are successfully locked, the test task is started.
[0053] The monitoring module is used to monitor the heartbeat status of hardware-in-the-loop devices during the test task. If the heartbeat is interrupted for more than a set time, the occupied resources will be forcibly reclaimed and the test task will be terminated.
[0054] The resource recycling module is used to return owned resources and borrowed resources separately after the test task is completed, release the simulation software license, destroy the test environment and archive the test data, and generate recycling records.
[0055] In another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment.
[0056] By automatically borrowing idle resources across tenants and dynamically allocating simulation software licenses through pooling, the utilization rate of hardware-in-the-loop testing resources can be significantly improved. The overall utilization rate of hardware equipment can be increased from about 30% to over 76%, and the concurrent utilization rate of simulation software licenses can be increased from 31% to over 81%. The group no longer needs to repeatedly purchase expensive HIL hardware and commercial simulation licenses according to the peak demand of each tenant, and the overall cost of ownership of hardware procurement can be reduced by more than 40%.
[0057] By automatically matching hardware compatibility to eliminate invalid resource allocations and by automatically borrowing resources across tenants to eliminate the need for manual coordination, the task queuing time for congested tenants can be reduced by more than 72%. Through a dedicated snapshot recovery mechanism that binds hardware connection status, the time required to rebuild the defect reproduction environment can be shortened by 90%, and the overall R&D testing iteration efficiency can be improved by more than 8.5%.
[0058] Through a security-level driven hierarchical isolation scheduling architecture, high-security-level hardware is prohibited from being shared across tenants. Combined with supporting tools for identification and verification, hierarchical test coverage, automated blocking, and full-link audit logging, it can meet the functional safety compliance requirements of ISO 26262 and directly support the functional safety audit of automotive electronic control products as well as external audits such as Level 3 Information Security Protection and ISO27001.
[0059] Multi-level group tenants can quickly connect. New subsidiary tenants only need to configure the security level and basic resource quota template to reuse the global hardware-in-the-loop device pool and scheduling engine. There is no need to purchase a complete set of testing hardware separately. The new tenant's online cycle can be shortened from several months to less than 2 hours.
[0060] Resource scheduling is fully automated, with no need for manual intervention in borrowing, reclaiming, abnormal resource release, and load monitoring. This reduces maintenance work such as manually coordinating hardware borrowing and manually reclaiming suspended licenses, thus lowering the manpower required for group resource management.
[0061] Through multi-resource orderly locking and control, real-time heartbeat monitoring and full-scenario anomaly recovery mechanism, the problems of long-term suspension and occupation of hardware devices and simulation software licenses and resource deadlock can be eliminated, and the annual downtime of the HIL test system can be reduced by more than 90%. Attached Figure Description
[0062] Figure 1 This is a schematic diagram of the overall architecture of the hardware-in-the-loop test resource scheduling and borrowing system in a multi-tenant environment provided in an embodiment of the present invention.
[0063] Figure 2 This is a flowchart illustrating the scheduling and borrowing method for hardware-in-the-loop test resources in a multi-tenant environment provided in an embodiment of the present invention.
[0064] Figure 3This is a schematic diagram of the state transition of a hardware-in-the-loop test task provided in an embodiment of the present invention;
[0065] Figure 4 A timing diagram illustrating the cross-tenant secondment process provided in an embodiment of the present invention;
[0066] Figure 5 This is a schematic diagram illustrating the mapping relationship between security level, isolation level, and cross-tenant borrowing permissions provided in an embodiment of the present invention. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings.
[0068] Terminology Explanation
[0069] Hardware-in-the-Loop (HIL) is an abbreviation for Hardware-in-the-Loop, referring to a testing method that connects a real electronic control unit (ECU) to a closed-loop circuit containing a simulation model of the controlled object. In this invention, hardware-in-the-loop testing specifically refers to the functional verification testing of automotive electronic control products (such as transmission control units (TCUs), brake-by-wire mechanisms (EMBs), and autonomous driving actuators) under interactive conditions between real hardware and a virtual simulation environment.
[0070] Multi-level tenants: A tree-like tenant structure is used, divided into group-subsidiary-business unit-project levels, including the group root tenant, first-level subsidiary tenants, second-level business unit tenants, and third-level project tenants. Each level of tenant independently conducts testing within the R&D verification platform and has its own independent security level identifier and resource quota.
[0071] Single Sign-On (SSO): An abbreviation for Single Sign-On, referring to a unified identity authentication system within the group. After logging in, users are issued tokens that carry tenant identifiers and the security level of their respective projects. Test task-related interface requests automatically carry tenant identifier headers, enabling transparent transmission of tenant context throughout the entire chain of scheduling, borrowing, and retrieval.
[0072] Safety Level: Following the ISO 26262 functional safety standard, the task safety levels are classified from lowest to highest as QM, ASIL-A, ASIL-B, ASIL-C, and ASIL-D. Safety levels can be linked to three dimensions: tenant, project, and individual test task.
[0073] Isolation levels: The granularity of data and resource isolation determined by the task's security level, including three levels: physical isolation, schema-level logical isolation, and row-level logical isolation. Physical isolation requires independent hardware, an independent database, and a dedicated isolated cluster; schema-level logical isolation refers to tenant-level isolation based on the database schema; row-level logical isolation refers to data isolation within a shared resource pool controlled by row-level permissions.
[0074] Global Hardware-in-the-Loop Device Pool: A resource pool that centrally manages all hardware-in-the-loop testing devices from all tenants. Devices are organized according to security partition identifiers, with high-security-level devices residing in separate partitions from shared devices.
[0075] Device Information: Description information of each device in the global hardware-in-the-loop device pool, including the number of I / O channels, supported bus protocols, list of compatible ECU models, real-time processor computing power, current status, tenant, and security partition identifier.
[0076] Current status: The operating status of the hardware-in-the-loop device, including idle, occupied, under maintenance, faulty, and loaned-out. The current status is reported periodically and updated in real time by the edge acquisition nodes.
[0077] Edge acquisition nodes: acquisition agents deployed on the ring rack side of each hardware device. They collect online, fault, and occupancy status information of the devices according to a set period and report it to the scheduling engine to refresh the device status of the global hardware ring device pool in real time.
[0078] Compatibility Requirements: The test task imposes hardware capability requirements on the hardware-in-the-loop device, including ECU model, number of I / O channels, bus protocol, and real-time processing performance requirements. Candidate devices must meet all four requirements to be considered compatible with the compatibility requirements.
[0079] Real-time processing performance requirements: The minimum requirements of the test task for the real-time computing power of the device. Whether the requirements are met is determined by whether the real-time processor computing power of the candidate device is not lower than this requirement.
[0080] License type: The type of simulation software license identified by the toolchain or functional module, such as the license type corresponding to toolchains like MATLAB / Simulink, dSPACE ControlDesk, and CANoe.
[0081] Concurrent Seats: The number of concurrent online users supported by the simulation software license, used to measure the capacity of the license resources.
[0082] Simulation software license pool: A collection of license resources modeled according to four dimensions: toolchain, functional module, concurrent seats, and tenant quota, and managed by distinguishing between owned licenses and borrowed licenses.
[0083] Tenant quotas: The maximum number of resources a tenant is allowed to use, including hardware-in-the-loop device quotas, simulation software license quotas, and test environment quotas. Quotas are divided into hard limits and soft oversubscription ratios.
[0084] Hard limit: The absolute upper limit of a tenant's resource quota that cannot be exceeded. Resource requests exceeding the hard limit will be rejected.
[0085] Soft Oversubscription Ratio: A percentage that allows tenants to oversubscribe from the hard limit. When a tenant's resource usage exceeds the hard limit but does not exceed the product of the hard limit and the soft oversubscription ratio, the excess amount enters the soft limit queue to wait for available resources; any amount exceeding the soft limit is rejected directly. The soft oversubscription ratio can be configured centrally by the group and distributed to each tenant; lower-level tenants can only tighten it, not loosen it.
[0086] Queuing queue: A waiting queue used to hold test tasks that have not yet received resource allocation. They are assigned to queues according to their priority, with higher priority queues being scheduled first.
[0087] Priority Tiers: Test task scheduling priorities are categorized into five tiers from highest to lowest: P0, P1, P2, P3, and P4. P0 corresponds to emergency regression testing, P1 to mass production version iteration testing, P2 to regular project iterations, P3 to pre-research verification, and P4 to teaching and repetitive testing.
[0088] Non-preemptive protection period: A set duration protection period after a high-priority test task starts, during which it cannot be preempted by other tasks. The protection period duration can be set according to actual needs, such as 30 minutes.
[0089] Reservation window: The hardware resource usage time slot reserved in advance for high-priority test tasks. During the reserved time slot, the corresponding hardware remains locked and does not participate in cross-tenant borrowing and allocation.
[0090] Secondment: A resource allocation method in which idle hardware-in-the-loop devices and simulation software licenses are temporarily obtained from a lending tenant when the secondment trigger conditions are met, and are returned upon the expiration of the secondment period. Seconded resources are marked with a secondment identifier and are subject to the secondment period, and are managed separately from the tenant's own resources.
[0091] Lending tenants: Tenants who are allowed to lend resources to borrowing tenants, including tenants who are eligible to lend but have not yet actually lent, and tenants who have already lent.
[0092] Borrowing tenant: A tenant that obtains hardware-in-the-loop devices and simulation software licenses by borrowing from the lending tenant across tenants, i.e., the initiator of the borrowing request (the tenant to which the test task belongs).
[0093] Borrowing trigger conditions: The conditions for triggering cross-tenant borrowing judgment include: the hardware-in-the-loop utilization rate of the tenant to which the test task belongs is not lower than the first threshold for a first set time, for example, not lower than 85% for 5 minutes; and the hardware-in-the-loop utilization rate of the lending tenant is not higher than the second threshold for a second set time, for example, not higher than 30% for 5 minutes.
[0094] Utilization: The ratio of the actual number of hardware-in-the-loop devices or simulation software licenses occupied to the number of available licenses. It is used to measure the resource load level and is an important basis for borrowing trigger determination and resource scheduling.
[0095] Secondment Period: The effective usage time of seconded resources, including the initial period and the extension period. The initial period is the period set when the secondment is initiated, such as 24 hours; the extension period is the period extended after submitting a extension application before the initial period expires, and the cumulative period after extension shall not exceed the set upper limit, such as 72 hours.
[0096] Global Borrowing Limit: A global limit on the number of hardware-in-the-loop devices a single tenant can borrow simultaneously. Global License Borrowing Limit: A global limit on the number of simulation software licenses a single tenant can borrow simultaneously, used to prevent excessive concentration of borrowed resources.
[0097] Locked: The state in which resources are pre-occupied before a task starts. Resource locking follows the order of "emulation software license → hardware-in-the-loop device → test environment". If any resource locking fails, all locked resources are released.
[0098] Occupied: The state of resources being used during task execution, distinguished from "locked" before startup by time phase.
[0099] Heartbeat: An online status signal periodically reported by hardware-in-the-loop devices to monitor the operational health of devices and tasks. The scheduling engine collects heartbeat signals at a set period (e.g., every minute), and if no heartbeat is received for a set duration (e.g., 5 minutes), the heartbeat is considered interrupted.
[0100] Recycling: The process of returning resources to their respective resource pools after the test task is completed or in abnormal scenarios, including three categories: automatic recycling upon expiration, recycling of resource conflicts with source tenants, and forced recycling due to abnormalities.
[0101] Full-link audit logs: Audit information generated throughout the entire process of borrowing, operation, and recovery, including the borrowing initiating tenant, lending tenant, device number of hardware-in-the-loop device, borrowing start and end time, renewal records, recovery reasons, and task operation logs.
[0102] Tool Qualification: The process of performing functional safety qualification on hardware-in-the-loop simulation tools. Tools that have not completed functional safety qualification will have their resource allocation blocked for ASIL-A and higher level testing tasks.
[0103] Test coverage threshold: The minimum test coverage requirement set according to the task's security level, such as 100% for ASIL-D, 95% for ASIL-C, 90% for ASIL-A and ASIL-B, and 80% for QM. Test tasks with actual coverage below the threshold are blocked from starting, and locked resources are reclaimed.
[0104] Environment Snapshot: Saves test environment information bound to the hardware-in-the-loop device connection status, including container software status, test data volume, hardware-in-the-loop device IO channel configuration, bus communication parameters, and hardware connection handshake information. Incremental snapshots are supported.
[0105] Incremental snapshot: An environment snapshot method that only saves changed data since the last snapshot, used to reduce snapshot storage usage and generation time.
[0106] Borrowing identifier: Identification information attached to the operational data and test reports of borrowed resources, used to distinguish and store the data of borrowed resources from the data of the tenant's own resources.
[0107] Secondment access criteria: Conditions for allowing entry into the cross-tenant secondment process, determined based on the priority of the test task and cross-tenant secondment permissions.
[0108] Example 1
[0109] This embodiment is a scheduling and borrowing system for hardware-in-the-loop test resources in a multi-tenant environment. This system is the execution carrier of the scheduling and borrowing method of the present invention. Each step of the method is completed collaboratively by various modules of the system. The specific process is described in subsequent embodiments.
[0110] See Figure 1 The system provided in this embodiment adopts a layered architecture, which includes, from top to bottom, a group management and analysis layer, a tenant gateway access layer, a core scheduling engine layer, a global resource pool layer, and a multi-level tenant business layer, and connects with external systems through data interfaces.
[0111] The group-level management and analysis layer provides group administrators with a unified global management view, including a global performance dashboard, a policy distribution center, and a compliance audit module. This allows for the display of global resource load, unified distribution of scheduling policies, and support for end-to-end compliance auditing. The tenant gateway access layer serves as the unified access point for test tasks, providing unified authentication, task parsing, tenant context pass-through, and pre-task verification. The core scheduling engine layer is the system's scheduling decision-making hub, carrying core scheduling logic such as security level modeling, hardware compatibility matching, priority queuing scheduling, cross-tenant borrowing and reclamation, multi-resource locking, and snapshot management. The global resource pool layer uniformly manages each tenant's hardware-in-the-loop devices, simulation software licenses, and test environments, divided into high-security partitions and shared partitions based on security level. High-security partitions accommodate ASIL-C level and above hardware-in-the-loop devices, while shared partitions accommodate QM level devices. Different partitions are isolated from each other. The multi-level tenant business layer provides testing service capabilities for the group root tenant, first-level subsidiary tenants, business unit tenants, and project tenants. Each tenant independently conducts hardware-in-the-loop testing within the platform. External systems connect to the system through data interfaces, including Product Lifecycle Management System (PLM), Application Lifecycle Management System (ALM), Model-Based Systems Engineering Platform (MBSE), System Validation System (SVS), Office Automation System (OA), and Data Lake Platform, to enable the seamless flow of test tasks, model data, and test results.
[0112] From a logical composition perspective, the system includes a task access module, a scheduling engine, a borrowing module, a multi-resource locking module, a runtime monitoring module, and a resource reclamation module. The task access module, implemented at the tenant gateway access layer, receives test tasks and parses task attributes. The scheduling engine, implemented at the core scheduling engine layer, performs resource verification, compatibility matching, and queuing scheduling. The borrowing module, implemented at the core scheduling engine layer, performs cross-tenant borrowing and reclamation. The multi-resource locking module, runtime monitoring module, and resource reclamation module are respectively used for ordered resource locking, runtime monitoring, and resource return and release, implemented at the core scheduling engine layer and the global resource pool layer.
[0113] From a functional perspective, the system is divided into eight core functional modules: multi-level tenant metadata and security level modeling module, unified gateway tenant context parsing and task access module, unified hardware-in-the-loop device modeling and compatibility matching filtering module, multi-priority task queuing scheduling and reservation management module, cross-tenant resource borrowing and automatic reclamation module, multi-resource joint locking and abnormal release and reclamation module, dedicated test environment snapshot and hardware binding recovery module, and group-wide global management and performance analysis center. These functional modules work together to achieve full lifecycle scheduling, cross-tenant borrowing, and functional safety graded isolation management of hardware-in-the-loop devices and simulation software licenses. Each functional module is described below.
[0114] (1) Multi-level tenant metadata and security level modeling module
[0115] This module serves as the system's underlying organization and security benchmark engine, enabling three-level security level binding management of tenants, projects, and tasks based on metadata.
[0116] The system constructs a multi-level tenant tree model, reusing the nested structure of the group root tenant, first-level subsidiary tenants, second-level business unit tenants, and third-level project tenants. Each tenant's metadata includes a new security level identifier and a resource quota structure. The resource quota structure is divided into two parts: hard limits and soft over-allocation ratios, containing fields such as hardware-in-the-loop device model quotas, simulation software license concurrent seats, and test environment concurrency. The hard limit is the absolute upper limit of a tenant's resource quota that cannot be exceeded; resource requests exceeding the hard limit will be rejected. The soft over-allocation ratio allows tenants to over-allocate resource usage beyond the hard limit. When a tenant's resource usage exceeds the hard limit but does not exceed the product of the hard limit and the soft over-allocation ratio, the excess portion enters the soft limit queue to wait for available resources, while the portion exceeding the soft limit is directly rejected. The soft over-allocation ratio can be uniformly configured by the group and distributed to each tenant. Lower-level tenants can only tighten it, not loosen it. For example, the group can configure the soft over-allocation ratio to 1.2 and adjust it to 1.3 based on resource elasticity needs.
[0117] The security levels follow the ISO 26262 functional safety standard, ranging from low to high: QM, ASIL-A, ASIL-B, ASIL-C, and ASIL-D. These levels can be bound to three dimensions: tenant, project, and individual test task. The module has built-in automatic mapping rules between security levels and resource isolation, automatically determining the isolation level and cross-tenant borrowing permissions based on the task's security level: When the task security level is ASIL-C or ASIL-D, the isolation level is physical isolation, requiring independent hardware, an independent database, and a dedicated isolated cluster; borrowing tenant equipment and lending idle equipment are prohibited. When the task security level is ASIL-A or ASIL-B, the isolation level is schema-level logical isolation, allowing only borrowing of idle equipment from QM-level tenants and prohibiting the lending of idle equipment. When the task security level is QM, the isolation level is row-level logical isolation, allowing free participation in cross-tenant borrowing and the lending of idle equipment. The partitions containing high-security-level devices and the partitions containing shared devices are managed separately. The scheduling engine automatically filters partitions that do not meet the isolation level requirements during resource screening.
[0118] The module also includes built-in tool identification and verification rules and tiered test coverage blocking rules. The tool identification and verification rules are executed before resource allocation, verifying the functional safety assessment status of the simulation tools required for the test task. If the task's safety level is ASIL-A or higher and the simulation tool has not completed functional safety assessment, resource allocation for that test task will be blocked. The tiered test coverage blocking rules set test coverage thresholds according to the task's safety level, for example, 100% for ASIL-D, 95% for ASIL-C, 90% for ASIL-A and ASIL-B, and 80% for QM. When the actual coverage of the test task is lower than the corresponding threshold, the test task will be blocked from starting, and locked resources will be reclaimed.
[0119] In addition, the module provides a tenant quota verification process: after a test task is submitted, the remaining quota of the tenant to which the test task belongs is first verified. If the remaining quota is sufficient, the tenant's own resources are directly allocated. If the remaining quota is exceeded, the cross-tenant borrowing judgment logic is triggered.
[0120] (2) Unified gateway tenant context resolution and task access module
[0121] This module is based on a cloud-native gateway to build a unified access point for test tasks, connecting the group's unified identity system to achieve test task tenant context binding and standardized parsing of task fields.
[0122] The system connects to the group's unified identity authentication system and integrates AD / LDAP domain controllers. After a user logs in, a token is issued, which carries the tenant identifier and the security level of the project to which the user belongs. Test task-related interface requests automatically carry the tenant identifier header, enabling the transparent transmission of tenant context throughout the entire chain of scheduling, borrowing, and recycling.
[0123] The module defines standardized test task data fields, and the parsed task attributes include: tenant identifier, task security level, task priority, compatibility requirements of required hardware-in-the-loop devices (including ECU model, number of IO channels, bus protocol and real-time processing performance requirements), required simulation software license model and concurrent seats, expected task runtime, and whether environment snapshot restoration is required.
[0124] The module performs task legitimacy verification at the gateway layer, checking the match between user tenant permissions, task security levels, and user access permissions. Illegal tasks are directly intercepted and audit logs are generated. Simultaneously, a complete end-to-end audit log is recorded for the entire process of task submission, scheduling, borrowing, and release, including information such as tenant, operator, hardware number, borrowing duration, and security level, meeting compliance traceability requirements. By moving hardware compatibility requirements and functional safety levels to the gateway task parsing stage, pre-scheduling filtering is achieved, intercepting tasks with invalid parameters or mismatched permissions in advance, reducing unnecessary calculations by the backend scheduling engine.
[0125] (3) Hardware-in-the-loop device unified modeling and compatibility matching screening module
[0126] This module constructs a globally unified hardware-in-the-loop device resource pool, performs standardized modeling of all test hardware, and realizes automatic compatibility matching and selection of test tasks and hardware devices.
[0127] The module defines device information including: unique device ID, device type, number of I / O channels, list of supported bus protocols, list of compatible ECU models, real-time processor computing power, current status, tenant, security partition identifier, and snapshot capability. The current status includes idle, occupied, under maintenance, faulty, and loaned-out. This status is collected and reported periodically by edge acquisition nodes deployed on each hardware unit on the ring-shaped test bench. The scheduling engine refreshes the device status of the global hardware in the ring-shaped device pool in real time, automatically removing devices in the under maintenance or faulty status during candidate device filtering.
[0128] The module's compatibility matching and filtering logic is as follows: Input the hardware compatibility requirements of the test task, traverse the global hardware-in-the-loop device pool, and prioritize filtering compatible hardware belonging to the tenant to which the test task belongs; after the compatible hardware of the tenant to which the test task belongs is exhausted, within the scope allowed by cross-tenant borrowing permissions, filter out idle compatible hardware from the borrowing tenant; if no matching hardware is available, the test task is placed in the corresponding priority queue. The criteria for matching compatibility requirements include: the number of IO channels of the candidate device is not less than the number of IO channels in the compatibility requirements; the bus protocol supported by the candidate device includes the bus protocol in the compatibility requirements; the list of compatible ECU models of the candidate device includes the ECU models in the compatibility requirements; and the real-time processor computing power of the candidate device is not less than the real-time processing performance requirements in the compatibility requirements. By using a standardized compatibility matching model for dedicated hardware-in-the-loop physical devices, the problem of task failure and resource waste caused by missing hardware adaptation verification in electronic control testing scenarios is solved.
[0129] (4) Multi-priority task queuing scheduling and reservation management module
[0130] This module enables the orderly scheduling of multi-tenant mixed test tasks, distinguishes task priorities, supports resource reservation windows, and includes non-preemptive protection period management.
[0131] The module employs a five-tier priority queue structure, with priorities ranked from highest to lowest as P0, P1, P2, P3, and P4. P0 corresponds to urgent regression testing, P1 to mass production version iteration testing, P2 to regular project iterations, P3 to pre-research verification, and P4 to teaching and repetitive testing. Test tasks are assigned to the corresponding priority queue, with higher-priority queues being scheduled first.
[0132] Module settings for preemption and protection rules: After starting test tasks in P0, P1, and P2 levels, they enter a preemptive protection period of a set duration. During this period, they cannot be preempted by other tasks. The duration of the protection period can be set according to actual needs, such as 30 minutes. When a high-priority test task competes with a running low-priority test task for equipment, and the low-priority test task has exceeded its preemptive protection period, the low-priority test task is paused, a snapshot of the current test environment is automatically saved, the hardware-in-the-loop device it occupies is released, and the low-priority test task is re-entered into the queuing queue. Specifically, P0 level test tasks can preempt test tasks in P2 and lower levels, and P1 level test tasks can preempt test tasks in P3 and lower levels.
[0133] The module sets up a resource reservation window mechanism: high-priority test tasks can reserve hardware-in-the-loop devices within a set time period in advance. During the reserved time period, the corresponding hardware remains locked and does not participate in cross-tenant borrowing and allocation. Low-priority test tasks automatically avoid the reserved time period.
[0134] The module is configured with a queuing timeout control mechanism: when the queue of test tasks exceeds the preset threshold, an alarm will be automatically pushed. After a set number of consecutive timeouts, the task priority can be reduced or the task can be terminated, and the pre-locked license resources will be released.
[0135] (5) Cross-tenant resource borrowing and automatic recycling module
[0136] This module enables automated cross-tenant temporary borrowing of idle resources, including quantitative threshold determination, borrowing quantitative calculation, term control, operation isolation, hierarchical automatic recycling, and full-link auditing.
[0137] The module sets up quantitative judgment conditions for triggering a cross-tenant borrowing: The hardware-in-the-loop utilization rate of the tenant to which the test task belongs must be no less than a first threshold for a first set duration, and the hardware-in-the-loop utilization rate of the lending tenant must be no more than a second threshold for a second set duration. A cross-tenant borrowing judgment is triggered when both conditions are met simultaneously. For example, if the utilization rate of the tenant to which the test task belongs is no less than 85% for 5 minutes, and the utilization rate of the compatible hardware of the same model in the lending tenant is no more than 30% for 5 minutes, a borrowing is triggered. The lending tenant must be a QM-level tenant; equipment from tenants with ASIL-A or higher levels is prohibited from being lent out.
[0138] The module performs a borrowing quantization calculation: the minimum value among the following three factors is selected as the number of hardware-in-the-loop devices borrowed: the number of available compatible devices of the tenant to which the test task belongs after deducting the number of available compatible devices of the lending tenant, and the global borrowing limit. The number of hardware-in-the-loop devices borrowed is determined by the minimum value among the following three factors: the number of concurrent seats required by the test task after deducting the number of available license seats of the tenant to which the test task belongs, the number of available license seats of the lending tenant, and the global license borrowing limit.
[0139] Module settings for temporary loan period control: Set an initial loan period. Renewal requests are allowed before the initial period expires, and the cumulative loan period after renewal cannot exceed the set limit. For example, if the initial period is 24 hours, the cumulative loan period after renewal cannot exceed 72 hours. During the loan period, the borrowed hardware-in-the-loop equipment cannot be re-loaned to other tenants.
[0140] Module settings for borrowed operation isolation management: After borrowed hardware is allocated to the borrowing tenant, an independent isolated test environment is automatically created. Hardware operation data and test reports are marked with a borrowing identifier and stored separately from the tenant's own resources.
[0141] The module is configured with a tiered automatic recycling strategy, including three categories: automatic recycling upon expiration, recycling due to source tenant resource conflicts, and forced recycling due to anomalies. Automatic recycling upon expiration occurs when the borrowing period expires and the current test task is completed, reclaiming the borrowed hardware-in-the-loop devices and simulation software licenses and returning them to the lending tenant. Reclaiming due to source tenant resource conflicts occurs when the lending tenant initiates a high-priority test task and there are insufficient available compatible devices, only waiting for the current borrowing task to complete before recycling, without forcibly interrupting the running test task. Forced recycling due to anomalies occurs when a test task crashes, a node becomes disconnected, or a heartbeat interruption exceeds a set time, forcibly reclaiming the borrowed hardware-in-the-loop devices and returning them to the lending tenant. When a test task terminates abnormally or the queue times out, the simulation software licenses occupied by the test task are forcibly released and returned according to their ownership, generating an abnormal recycling record.
[0142] The module generates full-chain audit records, including the tenant initiating the borrowing, the lending tenant, the device number of the hardware-in-the-loop device, the start and end times of the borrowing, renewal records, reasons for recovery, and task operation logs, supporting group compliance audit retrieval.
[0143] (6) Multi-resource joint locking and abnormal release and recovery module
[0144] This module addresses the deadlock and abnormal occupancy issues in the coordinated allocation of three types of bound resources: hardware-in-the-loop devices, simulation software licenses, and testing environments.
[0145] The module sets up an ordered resource locking rule: it follows the locking order of simulation software license, hardware-in-the-loop device, and test environment, and releases them in reverse order; if any resource locking fails, it immediately rolls back and releases all locked resources to prevent resource deadlock.
[0146] The module sets up a license pool for refined management: a license pool model is established based on four dimensions: toolchain, functional module, concurrent seats and tenant quotas, and the management is differentiated between owned licenses and borrowed licenses; in abnormal scenarios such as task crash, process killing, node failure, and queuing timeout, the license is automatically forced to flow back to the global pool through heartbeat detection.
[0147] The module is configured for real-time monitoring during runtime: it collects heartbeat data, test process status, and resource usage metrics from hardware-in-the-loop devices at set intervals, such as collecting heartbeats every minute. When hardware goes offline, the process freezes, or heartbeats are not reported for a set duration, a resource release process is immediately triggered, destroying the test environment and returning the hardware and license. The heartbeat collection period and the disconnection determination period are set separately; for example, if the heartbeat collection period is 1 minute, a disconnection is determined if no heartbeat is received for 5 consecutive minutes.
[0148] The module sets up resource release differentiation logic: resources are released sequentially for normally completed test tasks, borrowed resources are returned to the resource pool of the lending tenant, and owned resources are retained in the resource pool of the tenant to which the test task belongs; test data and test reports are archived and saved in isolation by tenant.
[0149] (7) Dedicated test environment snapshot and hardware binding recovery module
[0150] This module differs from general container snapshots, adapting to hardware-in-the-loop physical hardware linkage scenarios to enable rapid reproduction of test failures.
[0151] The module defines the content of the environment snapshot, including container software status, test data volume, hardware-in-the-loop device IO channel configuration, bus communication parameters and hardware connection handshake information, and supports incremental snapshots, which only save the changed data since the last snapshot, reducing storage usage and generation time.
[0152] The module sets the snapshot trigger timing: an environment snapshot is automatically generated in three scenarios: the test task is preempted, a defect occurs in the test, and the test task is manually saved, and the snapshot is bound to the hardware-in-the-loop device currently occupied by the test task.
[0153] The module sets up automatic handshake logic for snapshot recovery: When restoring an environment snapshot, it automatically matches compatible hardware-in-the-loop devices, relocks the simulation software license required for the test task, rebuilds the hardware communication link and synchronizes IO configuration. There is no need for manual re-debugging of hardware wiring and communication protocols, and the environment recovery time can be shortened from hours to minutes.
[0154] Module settings for snapshot lifecycle management: Set the snapshot storage period according to the tenant's security level. For example, ASIL-C and ASIL-D level snapshots are encrypted and archived for a long time, while QM level snapshots are automatically cleaned up after 30 days.
[0155] (8) Group-wide Overall Control and Performance Analysis Center
[0156] The center provides a unified management view for group administrators, supporting scheduling strategy optimization and global resource analysis.
[0157] The center provides a global resource load dashboard, which displays in real time the utilization rate of each tenant's hardware-in-the-loop devices and simulation software licenses, the number of borrowed and occupied items, the total number of queued tasks, and distinguishes between the load data of owned resources and borrowed resources.
[0158] The center provides cross-tenant scheduling performance measurement functions, which can statistically analyze data such as hardware utilization, borrowing frequency, task queuing time, test environment reconstruction time, and resource borrowing cost allocation for each tenant, and output comparative reports to provide data support for group hardware procurement, tenant resource quota adjustment and R&D process optimization.
[0159] The center provides a unified policy distribution function, allowing the group to globally configure parameters such as borrowing trigger thresholds, security isolation rules, coverage blocking standards, and resource reservation rules, and distribute them to all tenants with one click. Subordinate tenants can only tighten the rules and cannot loosen them.
[0160] The center provides compliance audit retrieval functions, allowing users to search the entire audit log by multiple dimensions such as tenant, security level, secondment records, and hardware serial number, and export ISO 26262 and information security compliance audit reports with one click.
[0161] In summary, the system in this embodiment, through the above-described layered architecture and the coordinated operation of eight core functional modules, provides a complete system carrier for the execution of the scheduling and borrowing methods described in subsequent embodiments.
[0162] Example 2
[0163] Based on the aforementioned system architecture, this embodiment provides a method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment. This method is executed collaboratively by various functional modules of the system and is applicable to cross-tenant scheduling and borrowing scenarios involving hardware-in-the-loop devices and simulation software licenses. See also Figure 2 The overall process of this method includes seven steps: receiving and parsing test tasks, quota verification and security level mapping, screening candidate devices and determining scheduling strategies, cross-tenant borrowing, multi-resource locking and task initiation, operation monitoring and anomaly handling, and resource return and recycling records.
[0164] See Figure 3The flow of test tasks in the system includes the following states: pending verification, queued, pending locking, running, and reclaimed. After submission, a test task enters the pending verification state. If verification passes and the tenant to which the test task belongs has available compatible devices, it directly enters the pending locking state. If the tenant to which the test task belongs has no available compatible devices, it enters the queued state to await scheduling. During the queuing period, if the task passes the borrowing admission judgment and meets the cross-tenant borrowing trigger conditions, it is transferred to borrowing processing. After successful borrowing, it enters the pending locking state. In the pending locking state, after all resources are successfully locked, it enters the running state. Test tasks in the running state enter the reclaimed state after completion, and the task ends upon completion of reclaiming. In the running state, low-priority test tasks are paused by high-priority test tasks when preemption conditions are met. After generating an environment snapshot and releasing resources, they re-enter the queued state. Test tasks in the queued state exceed the set queuing time, and their priority is reduced or the task is terminated according to a preset strategy. The transitions between these states are uniformly managed by the scheduling engine and recorded in the end-to-end audit log.
[0165] Step 1: Receive and parse the test task.
[0166] This step is performed by the task access module. The task access module receives the test task, determines the tenant to which the test task belongs, and parses the test task's security level, priority, hardware-in-the-loop compatibility requirements, and the required simulation software license model and concurrent seats. The compatibility requirements include the ECU model, number of I / O channels, bus protocol, and real-time processing performance requirements, used for compatibility matching with subsequent candidate devices.
[0167] Specifically, when the task access module receives a test task, it obtains the tenant identifier and security level metadata carried in the request to determine the tenant to which the test task belongs. The parsing of the task fields is based on the standardized task data definition. The parsed security level is used to determine the isolation level and cross-tenant borrowing permissions. The parsed priority is used for queuing queue level division. The parsed compatibility requirements, license type and concurrent seats are used for resource screening and borrowing quantity determination.
[0168] In this step, the task access module also performs task legality verification at the gateway layer, verifying the matching between user tenant permissions, task security level and user access permissions, directly intercepting illegal tasks and generating audit logs; at the same time, it records task submission and parsing information to the full-link audit log.
[0169] Step 2: Quota verification and security level mapping.
[0170] This step is performed by the scheduling engine. The scheduling engine verifies the test task based on the tenant's resource quota, which includes the hardware-in-the-loop device quota, the simulation software license quota, and the test environment quota; and determines the isolation level and cross-tenant borrowing permissions of the test task based on the task's security level.
[0171] Specifically, during quota verification, the remaining quota of the tenant to which the test task belongs is first checked. If the remaining quota is sufficient, the test task can directly use its own resources; if the remaining quota is exceeded, the cross-tenant borrowing judgment logic is triggered. Quota verification follows hard limit and soft over-allocation rules: resource requests exceeding the hard limit are rejected; when resource usage exceeds the hard limit but does not exceed the product of the hard limit and the soft over-allocation ratio, the excess portion enters the soft limit queuing queue to wait for available resources; the portion exceeding the soft limit is directly rejected.
[0172] The isolation level and cross-tenant borrowing permissions are determined according to preset security level mapping rules. The isolation level includes three levels: physical isolation, schema-level logical isolation, and row-level logical isolation. Cross-tenant borrowing permissions include borrowing permissions and lending permissions. Detailed determination of the security level mapping rules will be provided in subsequent embodiments. This step only uses the mapping results to constrain the subsequent resource filtering and borrowing scope.
[0173] This step also includes pre-checks for tool qualification verification and test coverage verification: when the task safety level is ASIL-A or higher and the accompanying simulation tool has not completed functional safety qualification, resource allocation for the test task is blocked; when the test coverage threshold of the test task cannot be met, the start of the test task is blocked. Specific judgment rules are detailed in subsequent embodiments.
[0174] Step 3: Screen candidate devices and determine scheduling strategy.
[0175] This step is executed by the scheduling engine. The scheduling engine traverses the global hardware-in-the-loop device pool, filters candidate devices based on compatibility requirements, and prioritizes matching idle compatible devices of the tenant to which the test task belongs; if the tenant to which the test task belongs has no idle compatible devices, the test task is placed in the queuing queue or a cross-tenant borrowing decision is triggered.
[0176] Specifically, candidate devices are selected based on device information, including the number of I / O channels, supported bus protocols, a list of compatible ECU models, real-time processor computing power, current status, tenant affiliation, and security partition identifier. The current status is reported periodically by the edge acquisition nodes and updated in real time. Devices currently under maintenance or faulty, as well as those whose security partitions do not meet isolation level requirements, are excluded during the selection process. Subsequently, among the devices belonging to the tenant of the test task, devices currently idle and matching the compatibility requirements are selected as candidate devices. Matching the compatibility requirements means that: the number of I / O channels of the candidate device is not less than the number of I / O channels required by the compatibility requirements; the bus protocols supported by the candidate device include those required by the compatibility requirements; the list of compatible ECU models of the candidate device includes those required by the compatibility requirements; and the real-time processor computing power of the candidate device is not less than the real-time processing performance requirements required by the compatibility requirements.
[0177] When the tenant to which the test task belongs has an available compatible device, the test task directly uses the tenant's own device and enters a locked state. When the tenant to which the test task belongs does not have an available compatible device, the scheduling engine determines the borrowing admission based on the test task's priority and cross-tenant borrowing permissions: if the borrowing admission conditions are not met, the test task is placed into the corresponding tier of the queue according to priority; if the borrowing admission conditions are met, a cross-tenant borrowing determination is triggered to further determine whether the cross-tenant borrowing trigger conditions are met. If met, the borrowing process begins (see step four); otherwise, the test task is placed into the corresponding tier of the queue according to priority. During the queuing period, test tasks are scheduled in descending order of priority, with higher priority queues scheduled first. Among them, test tasks in tiers P0, P1, and P2 enter a set-length non-preemptive protection period after startup, during which they cannot be preempted by other tasks. When a high-priority test task competes with a running low-priority test task for equipment, and the low-priority test task has exceeded its non-preemption protection period, the low-priority test task is paused, an environment snapshot is generated, the hardware-in-the-loop device it occupies is released, and the low-priority test task is re-entered into the queuing queue. Among them, P0 level test tasks can preempt test tasks of P2 level and below, and P1 level test tasks can preempt test tasks of P3 level and below.
[0178] When a test task in the queue exceeds the set queuing time, the system will push an alarm. After a set number of consecutive timeouts, you can choose to reduce the task priority or terminate the task. When the task is terminated, the pre-locked license resources will be released.
[0179] Step 4: Cross-tenant borrowing.
[0180] This step is performed by the borrowing module. When the borrowing trigger condition is met, the borrowing module borrows idle hardware-in-the-loop devices and simulation software licenses from the global hardware-in-the-loop device pool of tenants with idle compatible devices. The number of hardware-in-the-loop devices to be borrowed is determined based on the number of hardware-in-the-loop devices required by the test task, the number of idle compatible devices of the tenant to which the test task belongs, and the global borrowing limit. The borrowing period is set according to the estimated runtime of the test task, and a borrowing record is generated.
[0181] Specifically, the conditions for triggering a borrowing operation include: the hardware-in-the-loop utilization rate of the tenant to which the test task belongs is not lower than a first threshold for a first set duration; and the hardware-in-the-loop utilization rate of the lending tenant is not higher than a second threshold for a second set duration. For example, if the utilization rate of the tenant to which the test task belongs is not lower than 85% for 5 minutes, and the utilization rate of the compatible hardware of the same model in the lending tenant is not higher than 30% for 5 minutes, a cross-tenant borrowing operation is triggered. The lending tenant must be a QM-level tenant, and the security partition where its equipment is located must meet the isolation level requirements.
[0182] When determining the number of hardware-in-the-loop devices to be borrowed, the minimum value among the following three factors is selected: the number of hardware-in-the-loop devices required for the test task (minus the number of idle compatible devices belonging to the tenant to which the test task belongs), the number of idle compatible devices of the lending tenant, and the global borrowing limit. Similarly, when determining the number of simulation software licenses to be borrowed, the minimum value among the following three factors is selected: the number of concurrent seats required for the test task (minus the number of idle license seats belonging to the tenant to which the test task belongs), the number of idle license seats of the lending tenant, and the global license borrowing limit.
[0183] When setting the borrowing period, an initial period is set, determined based on the estimated runtime of the test task. Renewal requests are allowed before the initial period expires, and the cumulative period after renewal cannot exceed the set limit. For example, if the estimated runtime of the test task is 12 hours, the initial period can be set to 14 hours (i.e., adding 2 hours of redundancy to the estimated runtime) to ensure the task's complete execution; alternatively, a fixed initial period of 24 hours can be used, with the cumulative period after renewal not exceeding 72 hours. During the borrowing period, the borrowed hardware-in-the-loop equipment cannot be re-borrowed to other tenants.
[0184] Once the secondment is confirmed, a secondment record is generated, including information such as the tenant initiating the secondment, the lending tenant, the device number of the hardware-in-the-loop device, the start and end times of the secondment, and the renewal record, and is written to the end-to-end audit log.
[0185] Step 5: Multi-resource locking and task initiation.
[0186] This step is performed by the multi-resource locking module. The multi-resource locking module constructs the corresponding test environment according to the isolation level of the test task, and locks the simulation software license, hardware-in-the-loop devices, and the test environment sequentially. If locking any resource fails, all locked resources are released; after all resources are successfully locked, the test task is started.
[0187] Specifically, resource locking follows the order of simulation software license, hardware-in-the-loop device, and test environment, and is released in reverse order. When locking the simulation software license, the required model and corresponding concurrent seats are locked from the license pool for this test task; when locking the hardware-in-the-loop device, the candidate devices selected in step three (including the tenant's own devices or borrowed devices) are marked as locked; when locking the test environment, the corresponding test environment is built according to the isolation level of the test task: when the isolation level is physical isolation, a physically isolated test environment with independent hardware, independent database, and dedicated isolated cluster is built; when the isolation level is schema-level logical isolation or row-level logical isolation, a schema-level or row-level logical isolation test environment instance is built within the shared cluster. The test environment created in the borrowed scenario is isolated from the tenant's own test environment.
[0188] If any resource lock fails, all locked resources are released in reverse order of the locking sequence, and the test task re-enters the queue to wait for subsequent scheduling.
[0189] After all resources are successfully locked, the test task will be started. Once started, the test task will enter a preemptive protection period of a set duration, during which it cannot be preempted by other tasks.
[0190] In this step, if the test task is actively cancelled by the user before all resources are successfully locked, the multi-resource locking module immediately releases all locked resources in reverse order of the locking sequence, does not start the test task, and generates a cancellation record.
[0191] Step Six: Operation Monitoring and Anomaly Handling.
[0192] This step is performed by the runtime monitoring module. During the test task, the runtime monitoring module monitors the heartbeat status of the hardware-in-the-loop device. If the heartbeat is interrupted for more than the set duration, the module forcibly reclaims the occupied resources and terminates the test task.
[0193] Specifically, the monitoring module collects heartbeat signals from the hardware-in-the-loop device at a set period, such as once per minute; if no heartbeat is received for a set period of time, it is considered a heartbeat interruption, for example, if no heartbeat is received for 5 consecutive minutes, it is considered a loss of connection. The heartbeat collection period and the loss of connection determination period are set separately. The heartbeat collection period is used for status refresh frequency control, and the loss of connection determination period is used for anomaly determination threshold.
[0194] When the heartbeat is interrupted, the monitoring module determines that the test task is abnormal, terminates the test task, and triggers the resource forced reclamation process: forcibly reclaims the occupied hardware-in-the-loop devices and simulation software licenses, destroys the test environment, generates an abnormal reclamation record and writes it to the end-to-end audit log.
[0195] Optionally, if the hardware-in-the-loop device running the test task fails, but the tenant or lending tenant of the test task has a compatible idle device of the same type, the system will first automatically migrate the test task to a compatible idle device. If the migration is successful, the test task will continue to run; if the migration fails or no compatible idle device exists, a forced recycling process will be executed. The running data generated during the task migration process is archived and saved to avoid test data loss.
[0196] Step 7: Resource return and recycling records.
[0197] This step is performed by the resource recycling module. After the test task is completed, the resource recycling module distinguishes between owned resources and borrowed resources, returns them separately, releases the simulation software license, destroys the test environment, archives the test data, and generates a recycling record.
[0198] Specifically, after the test task is successfully completed, resources are released in reverse order of the resource locking sequence: the simulation software license is released back to the license pool, the hardware-in-the-loop device is restored to an idle state, the test environment is destroyed, and test data and test reports are archived and saved in tenant isolation. Resource ownership is distinguished during resource release: owned resources are retained in the resource pool of the tenant to which the test task belongs, and borrowed resources are returned to the resource pool of the lending tenant.
[0199] In a secondment scenario, upon the expiration of the secondment period, the seconded hardware-in-the-loop equipment and simulation software licenses will be reclaimed and returned to the lending tenant after the current test task is completed. If the lending tenant initiates a high-priority test task and there are insufficient compatible devices available, the secondment will only wait for the current test task to be completed before reclaiming the secondment, without forcibly interrupting the running test task. If a test task crashes, a node becomes unreachable, or a heartbeat interruption exceeds a set time, the seconded hardware-in-the-loop equipment will be forcibly reclaimed and returned to the lending tenant. If a test task terminates abnormally or the queue times out, the simulation software licenses occupied by the test task will be forcibly released and returned according to the ownership of the simulation software licenses.
[0200] If a test task is actively canceled by the user during its execution, the resource reclamation module will, in addition to releasing resources according to the above rules, mark the generated environment snapshot as an isolated snapshot, archive it according to the snapshot lifecycle policy, and archive the test data in tenant isolation.
[0201] After the recycling is completed, a recycling record is generated, including information such as the type and quantity of recycled resources, the object to which they are returned, and the reason for recycling. This record is then written into the full-link audit log, forming a complete audit link from task submission, scheduling, borrowing, locking, running to recycling.
[0202] In summary, this embodiment realizes the entire process of scheduling, borrowing, locking, operation monitoring and recycling of hardware-in-the-loop test resources in a multi-tenant environment by executing the above seven steps in sequence. Each step of the method corresponds one-to-one with each functional module of the aforementioned system, together constituting the complete scheduling and borrowing scheme of this invention.
[0203] Example 3
[0204] This embodiment further describes the detailed features of each step in the aforementioned method, including detailed determination of candidate device screening, priority scheduling rules, quantitative calculation of cross-tenant borrowing, resource reclamation strategy, security level mapping rules, license pool model, and environment snapshot management. The above detailed features are implemented in accordance with the functional modules of the aforementioned system.
[0205] (a) Refinement of candidate equipment screening
[0206] In step three above, the selection of candidate devices is based on device information. The device information is maintained uniformly by the global hardware-in-the-loop device pool and specifically includes: unique device number, device type, number of IO channels, supported bus protocols, list of compatible ECU models, real-time processor computing power, current status, tenant affiliation, and security partition identifier.
[0207] The current status includes idle, occupied, under maintenance, faulty, and loaned out, which is collected and reported to the scheduling engine by edge acquisition nodes at set intervals. Edge acquisition nodes are deployed on each hardware-on-ring rack side, collecting online, faulty, and occupied status information of the devices. The scheduling engine updates the device status in the global hardware-on-ring device pool in real time based on the reported results. When a device experiences status changes such as online / offline, faulty, or under maintenance, the edge acquisition node completes the reporting in the next acquisition cycle, and the device status takes effect immediately in the global hardware-on-ring device pool.
[0208] When screening candidate devices, devices currently under maintenance or faulty, as well as devices whose security partitions do not meet the isolation level requirements, are first removed; then, within the allowed tenant range, devices currently idle and matching compatibility requirements are screened.
[0209] The criteria for determining whether a device matches the compatibility requirements are as follows: the number of I / O channels in the candidate device must be no less than the number of I / O channels required by the compatibility requirements; the bus protocols supported by the candidate device must include those required by the compatibility requirements; the list of compatible ECU models for the candidate device must include those required by the compatibility requirements; and the real-time processor computing power of the candidate device must be no less than the real-time processing performance requirements required by the compatibility requirements. All four criteria must be met simultaneously; failure to meet any one of them results in a mismatch.
[0210] For example, a test task might require the ECU to be a TCU controller, with at least 48 I / O channels, a CAN bus protocol, and a minimum real-time computing power of 2000 MIPS. In this case, candidate devices must simultaneously meet the following requirements: the TCU controller model must be included in the compatible ECU model list; the number of I / O channels must be at least 48; the CAN bus protocol must be supported; and the real-time processor computing power must be at least 2000 MIPS to pass the screening. The real-time processing performance requirement refers to the minimum real-time computing power required by the test task; whether a candidate device meets this requirement is determined by ensuring its real-time processor computing power is not lower than this requirement.
[0211] If there are no available candidate devices in the tenant to which the test task belongs, select devices that are currently available and match the compatibility requirements from among the devices of the tenants whose cross-tenant borrowing permissions are allowed, and use them as candidate devices; cross-tenant borrowing permissions are determined according to the task security level, see Part (V) of this embodiment for details.
[0212] (II) Refinement of Priority Scheduling and Reservation
[0213] In step three above, test tasks are assigned to corresponding priority queues. The priorities, from highest to lowest, are P0, P1, P2, P3, and P4. Specifically: P0 corresponds to emergency regression testing, used for rapid verification in emergency scenarios such as production line failures and safety incidents; P1 corresponds to mass production version iteration testing, used for regression verification of mass production software versions; P2 corresponds to regular project iteration, used for functional verification in daily project development; P3 corresponds to pre-research verification, used for solution verification in pre-research projects; and P4 corresponds to teaching and repetitive testing, used for low-priority scenarios such as teaching and training, and repetitive testing. Higher-priority queues are scheduled first, and within the same priority queue, tasks are scheduled according to the order of submission.
[0214] After a test task in P0, P1, or P2 is started, it enters a preemptive protection period of a set duration. During this period, it cannot be preempted by other tasks. The duration of the protection period can be set according to actual needs, such as 30 minutes. The protection period starts from the time the test task is started. Before the protection period expires, the running test task will continue to run even if there is competition from higher-priority tasks. After the protection period expires, higher-priority test tasks can initiate preemption.
[0215] The preemption determination rule is as follows: When a high-priority test task competes with a running low-priority test task for equipment, and the low-priority test task has exceeded its non-preemption protection period, the low-priority test task is paused, an environment snapshot is generated, the hardware-in-the-loop device it occupies is released, and the low-priority test task is re-entered into the queuing queue. Specifically, P0-level test tasks can preempt P2-level and lower-level test tasks, and P1-level test tasks can preempt P3-level and lower-level test tasks. P3 and P4-level test tasks do not initiate preemption.
[0216] The resource reservation window has been refined: high-priority test tasks can reserve hardware-in-the-loop devices (HIBOLs) in advance for a set time period. During the reserved time period, HIBOLs remain locked and are not involved in cross-tenant allocation. Low-priority test tasks avoid the reserved time period. For example, P0-level test tasks can reserve consecutive time periods within the next 24 hours in advance. Once the reservation is successful, the corresponding devices will not be allocated to other tasks or participate in allocation during that time period, ensuring that urgent tasks can run as scheduled.
[0217] (III) Quantification and Refinement of Cross-Tenant Secondment
[0218] In steps three and four above, the rules for determining borrowing access are as follows: After triggering a cross-tenant borrowing decision, the scheduling engine determines whether the borrowing access conditions are met based on the priority of the test task and the cross-tenant borrowing permissions. Priority determines the order of borrowing requests and their availability, with higher-priority test tasks receiving priority. Cross-tenant borrowing permissions constrain the borrowing scope; test tasks with ASIL-C or ASIL-D security levels are prohibited from borrowing equipment from lending tenants, while ASIL-A or ASIL-B test tasks can only borrow idle equipment from QM-level tenants. Test tasks that do not meet the borrowing permission constraints are not allowed access. Test tasks that do not meet the borrowing access conditions are placed in the corresponding priority queue to await scheduling.
[0219] The process for determining the trigger condition for borrowing is as follows: The scheduling engine calculates the utilization rate of each tenant's hardware-in-the-loop devices at a set period. The utilization rate refers to the ratio of the actual number of occupied hardware-in-the-loop devices to the number of available devices. When the utilization rate of the tenant to which the test task belongs is not lower than the first threshold for a first set duration, it is determined that the tenant to which the test task belongs has a resource shortage. At the same time, the utilization rate of the borrowing tenants in the global hardware-in-the-loop device pool is calculated. When there is a tenant whose utilization rate is not higher than the second threshold for a second set duration, it is determined that the tenant has idle resources available for borrowing, triggering cross-tenant borrowing. For example, the first set duration is 5 minutes, the first threshold is 85%, the second set duration is 5 minutes, and the second threshold is 30%. That is, borrowing is triggered when the utilization rate of the tenant to which the test task belongs is not lower than 85% for 5 minutes and the utilization rate of the borrowing tenant is not higher than 30% for 5 minutes.
[0220] The constraints for lending tenants include: the lending tenant must be a QM-level tenant, and devices of tenants with ASIL-A or higher levels are prohibited from being lent out; the security zone where the lent device is located must meet the isolation level requirements for the borrowing task.
[0221] Determining the number of Hardware-in-the-Loop (HIL) devices to be borrowed: The minimum value among the following three factors is taken: the number of HIL devices required for the test task minus the number of available compatible devices belonging to the tenant to which the test task belongs; the number of available compatible devices of the lending tenant; and the global borrowing limit. The global borrowing limit refers to the global limit on the number of resources a single tenant can borrow simultaneously, and can be configured according to group policies, for example, 5 devices.
[0222] Determining the number of simulation software licenses to be borrowed: Based on the number of concurrent seats required by the test task, minus the available license seats of the tenant to which the test task belongs, the available license seats of the borrowing tenant, and the global license borrowing limit, the minimum value among the three is selected as the number of simulation software licenses to be borrowed.
[0223] For example, a test task requires 3 hardware-in-the-loop devices and 6 license seats. The tenant of the test task has 1 idle compatible device and 2 idle license seats, the lending tenant has 8 idle compatible devices and 10 idle license seats, and the global borrowing limit is 5 devices and the global license borrowing limit is 10. The number of hardware-in-the-loop devices to be borrowed is the minimum of the following three values: the 3 devices required for the test task minus the 1 idle device of the tenant of the test task, the 8 idle devices of the lending tenant, and the global borrowing limit of 5 devices. That is, 2 devices will be borrowed. The number of simulation software licenses to be borrowed is the minimum of the following three values: the 6 concurrent seats required minus the 2 idle seats of the tenant of the test task, the 4 idle seats of the lending tenant, and the 10 idle seats of the global license borrowing limit. That is, 4 licenses will be borrowed.
[0224] Details of the secondment period: The secondment period includes an initial period and a renewal period. The initial period is the period set when the secondment is initiated, which can be determined based on the expected runtime of the test task, such as setting it as "expected runtime plus 2 hours of redundancy," or a fixed initial period, such as 24 hours. Renewal requests can be submitted before the initial period expires, and the cumulative period after renewal cannot exceed the set upper limit, such as 72 hours. Renewal requests must be submitted by the borrowing tenant administrator, and the lending tenant can review and confirm them. Upon successful renewal, a renewal record is added to the secondment log.
[0225] Management constraints during the secondment period: Seconded hardware-in-the-loop devices are prohibited from being seconded to other tenants to prevent secondary circulation of seconded resources; seconded resources are marked with a secondment identifier and managed separately from the tenant's own resources.
[0226] (iv) Refinement of resource recycling strategies
[0227] In step seven above, owned resources and borrowed resources are returned separately. Borrowed resource recovery includes three categories: automatic recovery upon expiration, recovery due to resource conflicts with the source tenant, and forced recovery due to abnormalities.
[0228] Automatic Retrieval Upon Expiration: Upon expiration of the loan period, after the test tasks are completed, the loaned hardware-in-the-loop equipment and simulation software licenses will be retrieved and returned to the lending tenant. If the test tasks are still running when the loan period expires, the retrieval will wait until the current test tasks are completed before proceeding with the retrieval, without interrupting the running test tasks.
[0229] Source tenant resource conflict recovery: When a lending tenant initiates a high-priority test task and there are insufficient available compatible devices, the borrowed hardware-in-the-loop devices and simulation software licenses will be recovered after the current borrowing task is completed, without forcibly interrupting the running test task.
[0230] Forced reclamation for abnormal events: When a test task crashes, a node becomes unreachable, or a heartbeat interruption exceeds a set time, the borrowed hardware-in-the-loop devices are forcibly reclaimed and returned to the lending tenant. When a test task terminates abnormally or a queue times out, the simulation software license occupied by the test task is forcibly released and returned according to the ownership of the simulation software license. Specifically, forced reclamation of hardware-in-the-loop devices addresses scenarios of task crashes, node unreachability, and heartbeat interruptions; abnormal release of simulation software licenses addresses scenarios of abnormal termination and queue times out. Reclamation of these two types of resources is triggered separately according to their respective abnormal scenarios, generating abnormal reclamation records.
[0231] After the recovery is completed, a full-link audit record is generated. The full-link audit record includes the tenant who initiated the borrowing, the lending tenant, the device number of the hardware in the loop, the start and end time of the borrowing, the renewal record, the reason for recovery, and the task operation log. It supports multi-dimensional retrieval by tenant, security level, borrowing record, hardware number, etc.
[0232] (v) Refinement of security level mapping rules
[0233] In step two above, the isolation level and cross-tenant borrowing permissions for the test task are determined based on the task's security level. See [link / reference] Figure 5 The mapping relationship between security level, isolation level, and cross-tenant borrowing permissions is as follows:
[0234] When the task security level is ASIL-C or ASIL-D, the isolation level is physical isolation. Cross-tenant borrowing permissions prohibit borrowing tenant equipment and also prohibit borrowing idle equipment. Physical isolation requires independent hardware, independent database, and dedicated isolated cluster. The hardware-in-the-loop devices for this type of task are deployed in a high-security partition, and the device pool is managed in a separate partition. The scheduling engine automatically filters shared partition devices when screening resources, and devices in the high-security partition do not participate in the global idle borrowing calculation.
[0235] When the task security level is ASIL-A or ASIL-B, the isolation level is schema-level logical isolation. Cross-tenant borrowing permissions only allow borrowing idle devices from QM-level tenants and prohibit the borrowing of idle devices. Schema-level logical isolation refers to tenant-level isolation based on database schema. Test environment instances for this type of task are created independently. After borrowing hardware-in-the-loop devices, an independent isolated test environment is automatically created, and the hardware-in-the-loop device's operating data and test reports are stored separately with a borrowing identifier attached, isolated from the tenant's own data.
[0236] When the task security level is QM, the isolation level is row-level logical isolation, and the cross-tenant borrowing permission allows free participation in cross-tenant borrowing and the lending of idle equipment. Row-level logical isolation refers to data isolation controlled by row-level permissions within the shared resource pool. The resources of QM-level equipment have no partition restrictions and are uniformly included in the scheduling pool to calculate the load, and can be lent to borrowing tenants that meet the isolation level requirements.
[0237] Detailed tool qualification process: This includes the qualification status of simulation tools required for pre-test verification tasks. Simulation tools include hardware-in-the-loop modeling tools, real-time simulation tools, bus analysis tools, etc. When the task safety level is ASIL-A or higher and the simulation tool has not completed functional safety qualification, resource allocation for the test task will be blocked. The tool qualification status is maintained centrally by the group; only tools that have passed qualification can undertake ASIL-A or higher level test tasks.
[0238] Detailed test coverage verification: Test coverage thresholds for test tasks are determined based on the task's security level. For example, ASIL-D is 100%, ASIL-C is 95%, ASIL-A and ASIL-B are 90%, and QM is 80%. When the actual coverage of a test task falls below the test coverage threshold, the test task's startup is blocked, and locked resources are reclaimed. Coverage verification is performed by the pipeline-linked scheduling engine; tasks that fail to meet the threshold are not allowed to proceed to the running state.
[0239] (vi) Refinement of the license pool model
[0240] In step five above, the simulation software license is locked from the license pool. The simulation software license pool model is established according to four dimensions: toolchain, functional module, concurrent seats, and tenant quota, and managed by distinguishing between owned licenses and borrowed licenses.
[0241] The license pool model has four dimensions: the toolchain dimension identifies the toolchain to which the license belongs, such as MATLAB / Simulink, dSPACE ControlDesk, CANoe, etc.; the functional module dimension identifies the functional modules under the toolchain, such as real-time simulation modules, calibration modules, bus simulation modules, etc.; the concurrent seats dimension identifies the number of licenses that can be used online at the same time as the license; and the tenant quota dimension identifies the upper limit of the number of licenses that each tenant can use.
[0242] The license type refers to the license category identified by the toolchain or functional module, used for the precise description and matching of the required licenses for the test task. When a test task is submitted, the required license type and concurrent seats are specified. The scheduling engine searches the license pool for available licenses with matching types, giving priority to using the tenant's own licenses. If the tenant's own licenses are insufficient, licenses borrowed from other tenants are used.
[0243] Abnormal license repatriation: In abnormal scenarios such as task crash, process killing, node failure, and queue timeout, the occupied licenses are automatically and forcibly returned to the license pool through heartbeat detection, distinguishing between owned licenses and borrowed licenses and returning them to their respective positions to avoid licenses being suspended and occupied for a long time.
[0244] (vii) Refinement of environmental snapshot management
[0245] In steps three and six above, an environment snapshot is generated when a test task is preempted or an anomaly occurs. The environment snapshot includes the container software state, test data volume, I / O channel configuration of hardware-in-the-loop devices, bus communication parameters, and hardware connection handshake information, and supports incremental snapshots. Incremental snapshots only save changed data since the last snapshot, reducing snapshot storage usage and generation time.
[0246] Detailed snapshot triggering timing: When a test task is preempted, a defect occurs in the test, or the test task is manually saved, an environment snapshot is generated and bound to the hardware-in-the-loop device occupied by the test task. The snapshot is stored in association with the device number.
[0247] Snapshot recovery details: When restoring an environment snapshot, the scheduling engine automatically matches compatible hardware-in-the-loop devices, re-locks the simulation software licenses required for the test task, rebuilds the hardware communication links, and synchronizes I / O configurations, eliminating the need for manual re-tuning of hardware wiring and communication protocols. After recovery, the test task resumes execution from the running state at the time the snapshot was saved.
[0248] Snapshot lifecycle refinement: Set snapshot storage periods according to tenant security levels. For example, ASIL-C and ASIL-D level snapshots are encrypted and archived long-term, while QM level snapshots are automatically cleaned up after 30 days. Temporary snapshots generated after a preempted task is recovered are retained or cleaned up according to preset policies after the task recovery is complete.
[0249] In summary, this embodiment further explains the detailed features of candidate device screening, priority scheduling, cross-tenant borrowing, resource reclamation, security level mapping, license pool management, and environment snapshot management in the aforementioned method. The above-mentioned detailed features are implemented in accordance with the eight core functional modules and six logical component modules of the aforementioned system, and together constitute the complete technical solution of this invention.
[0250] Example 4
[0251] To facilitate understanding of the complete implementation process of this invention, this embodiment uses the deployment of the scheduling and borrowing system of this invention by an automotive parts group as an example, and illustrates it in conjunction with a typical business scenario. See also... Figure 4 Taking the peak period cross-tenant borrowing scenario of subsidiary A as an example, the complete timeline from task submission, borrowing determination, resource locking to return and recovery is demonstrated.
[0252] I. System Initialization and Tenant / Resource Modeling and Configuration
[0253] When the group deploys the system of this invention, it first completes the infrastructure and tenant modeling and configuration.
[0254] (1) Infrastructure base deployment: The group builds a container cluster on a private cloud, which is uniformly connected to all hardware-in-the-loop test racks and simulation software license servers, constructs a global hardware-in-the-loop device pool, and divides it into ASIL-C / D physical isolation partitions and QM shared partitions according to security level.
[0255] (2) Multi-level tenant creation and metadata configuration: Create a group root tenant, configure a unified security policy, borrowing threshold, and coverage standard; create a first-level tenant subsidiary A (transmission control unit TCU development), with security level supporting QM and ASIL-B, allocate 5 self-owned hardware-in-the-loop devices and 5 concurrent seats for simulation software licenses, and a software over-sale ratio of 1.2; create a first-level tenant subsidiary C (brake-by-wire EMB development), which only supports ASIL-C / D tasks, all hardware is assigned to a physical isolation partition, and configured to prohibit lending and borrowing of external hardware; create a first-level tenant subsidiary B (frontier pre-research), all of which are QM-level tasks, with 10 self-owned hardware-in-the-loop devices, and a daily load that is consistently below 30%, and include it in the global lendable resource pool.
[0256] (3) Unified identity integration: The system is integrated with the group domain control. After logging in with an employee's domain account, the corresponding tenant is automatically mapped. When submitting a task, the tenant and project security level metadata are automatically carried.
[0257] (4) Global scheduling basic parameter configuration: borrowing trigger threshold: 85% of the tenant to which the test task belongs and 30% of the borrowing tenant, the default borrowing duration is 24 hours, the protection period for high priority tasks is 30 minutes, and the ASIL-D test coverage threshold is forced to 100%.
[0258] II. Typical Business Scenario 1: Subsidiary A automatically borrows hardware-in-the-loop devices across tenants during peak periods.
[0259] See Figure 4 This scenario fully demonstrates the operation process of cross-tenant secondment.
[0260] (1) Task submission and parsing: Subsidiary A transmission project submitted multiple ASIL-B level TCU hardware-in-the-loop regression test tasks. The gateway parsed the task fields: tenant identifier T001, security level ASIL-B, priority level P1, compatibility requirements including 48 IO channels, CAN bus protocol, TCU dedicated ECU model, required simulation software license model and concurrent seats are parsed synchronously.
[0261] (2) Tenant quota verification: The scheduling engine verifies that all 5 hardware-in-the-loop devices owned by subsidiary A are occupied, and the utilization rate of the tenant to which the test task belongs reaches 92% for 5 consecutive minutes, exceeding the 85% borrowing trigger threshold, thus triggering cross-tenant borrowing judgment.
[0262] (3) Tenant screening: Traverse the global hardware-in-the-loop device pool. Subsidiary C is in ASIL-D partition and is prohibited from being lent out. Subsidiary B is a QM-level tenant. Currently, only 2 out of 10 devices are occupied, with a utilization rate of 20%, which is lower than the 30% lending threshold. The lending conditions are met, and 3 idle hardware-in-the-loop devices with compatible TCU models are selected.
[0263] (4) Quantitative calculation of borrowing: The test task resource gap is 3 units, the source tenant has 3 idle compatible devices, and the global borrowing limit is 5 units. The minimum value of the three is taken to determine the borrowing of 3 units, and the default borrowing period is 24 hours.
[0264] (5) Orderly locking of resources: First, lock the three simulation software licenses, then lock the three idle hardware-in-the-loop devices of subsidiary B, and finally create an independent ASIL-B isolated test environment; after all resources are successfully locked, start the test task; add borrowing tags to borrowed hardware, generate borrowing records and write them to the audit log.
[0265] (6) Task operation and monitoring: The test task ran continuously for 12 hours. The scheduling engine collected the hardware heartbeat once per minute. There were no faults during the operation. During this period, subsidiary B submitted a P3 pre-research task. There was sufficient spare hardware and no resource conflicts.
[0266] (7) Automatic recovery upon expiration: When the 24-hour borrowing period expires, all 3 TCU test tasks have been completed. The system will automatically destroy the isolated test environment, release the license, return the 3 hardware-in-the-loop devices to the subsidiary B resource pool, and generate a complete borrowing recovery audit log.
[0267] (8) Implementation results: No new hardware needs to be purchased, there is no backlog of testing tasks during peak periods, and the hardware utilization rate has increased from 45% to 78%.
[0268] III. Typical Business Scenario 2: Mandatory Isolation and Control of ASIL-D High-Security-Level Tasks in Subsidiary C
[0269] (1) Task submission and resolution: Subsidiary C submitted an EMB braking ASIL-D level functional safety test task, and the gateway resolution security level was ASIL-D.
[0270] (2) Isolation rule determination: The scheduling engine matches the ASIL-D physical isolation policy according to the security level mapping rule, automatically filters the global QM shared partition devices, allocates its own hardware on-loop devices only from the dedicated physical isolation partition, does not search for external tenants' borrowable devices, and does not include its own devices in the global idle borrowing calculation.
[0271] (3) Pre-compliance verification: Verify that the supporting simulation tool has completed functional safety assessment; the scheduling engine reads the pipeline configuration and forces the test coverage threshold to 100%. In this scenario, the test coverage is only 92%, which is lower than the threshold. The system blocks the start of the test task, releases all locked resources and pushes an alarm.
[0272] (4) Complete physical isolation of tasks: Tasks that pass compliance verification run in independent hardware, independent database and dedicated isolated cluster. The hardware is not shared with other tenants, there is no cross-tenant data interaction, and the security audit log is fully recorded to meet the ISO26262 audit requirements.
[0273] IV. Typical Business Scenario 3: High-Priority Task Preemption and Snapshot Recovery
[0274] (1) Task submission and queuing: Subsidiary A submits an emergency fault regression test task in P0 mode, all its own hardware runs regular iteration tasks in P2 mode, and P0 mode tasks enter the queue to wait for scheduling.
[0275] (2) Preemption determination: The scheduling engine determines that there is a device competition between the P0 level task and the running P2 level task; the P2 level task has been running for more than 30 minutes of non-preemption protection period, and the P0 level test task can preempt P2 level and below, which meets the preemption conditions and executes the preemption logic.
[0276] (3) Automatic snapshot generation: The preempted P2 task automatically generates an incremental snapshot bound to the current hardware-in-the-loop device, saves the IO channel configuration, bus communication parameters and hardware connection handshake information, and then releases hardware resources and allocates them to P0 urgent tasks. The P2 task is then re-entered into the queue.
[0277] (4) Snapshot recovery: After the emergency task is completed and the hardware is returned, the P2 task is re-matched to compatible hardware. The scheduling engine reads the snapshot, automatically rebuilds the hardware communication link and synchronizes the IO configuration. No manual debugging or wiring is required. The environment is restored in 5 minutes and testing can continue.
[0278] V. Group-wide Overall Management and Control Optimization Scenarios
[0279] The group's R&D administrator logs into the group's management and analysis layer to view quarterly scheduling efficiency reports and optimize strategies.
[0280] (1) Load analysis: Subsidiary A had the highest frequency of borrowing during peak periods, with an average hardware utilization rate of 76%; Subsidiary B had a 62% idle resource lending rate, and its hardware utilization rate increased from 28% to 65%; Subsidiary C had a high-security hardware utilization rate of 58%, with no cross-tenant borrowing records, and was compliant and risk-free.
[0281] (2) Strategy optimization intervention: The Group increased the soft over-sale ratio from 1.2 to 1.3 through the control center and uniformly distributed it to all tenants to further improve resource elasticity; a new mandatory 95% test coverage threshold rule was added for ASIL-B tenants, which took effect with one click and did not require separate configuration by subsidiary administrators.
[0282] (3) Cost allocation and accounting: The system automatically calculates the internal settlement cost of hardware based on the duration of each tenant's own hardware occupation and the duration of borrowed hardware use, and outputs resource usage expense reports for each subsidiary to support the group's internal cost assessment.
[0283] VI. Other subsidiaries promote rapid access and expansion
[0284] For subsidiary D (axle R&D, QM-level testing task), the IT administrator completed tenant deployment within 2 hours.
[0285] (1) Create subsidiary D tenant based on the preset QM tenant template, configure basic hardware quota and security level QM, and inherit the group's unified scheduling, borrowing and coverage strategies;
[0286] (2) The domain controller synchronizes new employee accounts and automatically maps them to subsidiary D tenant;
[0287] (3) The scheduling engine automatically grants global QM shared hardware pool borrowing permissions, eliminating the need to purchase hardware-in-the-loop devices separately;
[0288] (4) Tenant administrators can submit vehicle axle hardware-in-the-loop test tasks, and the system will automatically complete compatibility matching and cross-tenant borrowing and scheduling, so that there is no IT construction gap for new services.
[0289] VII. Summary of Implementation Results
[0290] After the group has been running this invention system for six months, the core indicators have improved as follows:
[0291] In terms of hardware resources, the overall utilization rate of hardware-in-the-loop testing equipment increased from 30% to 76%, and the utilization rate of simulation software licenses increased from 31% to 81%. In terms of R&D efficiency, the average queuing time for test tasks decreased by 72%, the time spent rebuilding the defect reproduction environment decreased by 90%, and the overall iteration efficiency of hardware-in-the-loop testing improved by 8.5%. In terms of compliance management, 100% of ASIL-C / D high-security test tasks across the group achieved physical isolation, automated coverage blocking and tool identification and verification were implemented, and complete ISO 26262 audit data could be exported with one click. In terms of operation and maintenance manpower, hardware resource borrowing, recycling, and fault release were all automated, and the workload of resource coordination and operation and maintenance was reduced by 65%. In terms of business expansion, the IT integration cycle of new subsidiaries was shortened from 3 months to 2 hours, and the group's unified hardware-in-the-loop equipment pool was quickly reused.
[0292] This embodiment fully verifies the complete practical value of the present invention in the context of multi-tenant hardware-in-the-loop testing scenarios in automotive groups, including resource scheduling, cross-tenant borrowing, functional safety isolation, and improved testing efficiency.
[0293] Example 5
[0294] This embodiment provides a computer-readable storage medium.
[0295] Specifically, the computer-readable storage medium stores a computer program that, when executed by a processor, implements the aforementioned method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment. For example, the computer-readable storage medium may include, but is not limited to, read-only memory (ROM), random access memory (RAM), disks, or optical discs. When executed by a processor, the computer program stored therein sequentially performs steps such as receiving and parsing test tasks, quota verification and security level mapping, screening candidate devices and determining scheduling strategies, cross-tenant borrowing, multi-resource locking and task initiation, operation monitoring and exception handling, and resource return and record retrieval, thereby enabling the scheduling and borrowing of hardware-in-the-loop devices and simulation software licenses in a multi-tenant environment.
[0296] Optionally, the above system can also be deployed using a cloud-native microservice architecture: the task access module, scheduling engine, borrowing module, multi-resource locking module, operation monitoring module, and resource reclamation module are deployed as independent services, and the services collaborate with each other through message queues or remote calls. Each module can be horizontally scaled independently according to the tenant scale and task load; when the group has multiple R&D centers in multiple locations, the modules can also be distributed and deployed on multiple clusters, realizing unified management and scheduling of the global hardware-in-the-loop device pool through cross-cluster communication, and in the event of a single cluster failure, other clusters take over the scheduling service, improving system availability.
[0297] It should be noted that the above embodiments are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention. Those skilled in the art will understand that the parameter values, number of tenants, number of devices, etc., in each embodiment are merely illustrative examples and can be flexibly adjusted in actual applications based on the group's organizational structure, testing business scale, and resource availability, and still fall within the scope of protection of the present invention.
Claims
1. A method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment, characterized in that, Includes the following steps: Receive test tasks, determine the tenant to which the test tasks belong, and parse the task security level, priority, compatibility requirements for hardware-in-the-loop devices, and the required simulation software license model and concurrent seats of the test tasks. The compatibility requirements include ECU model, number of IO channels, bus protocol and real-time processing performance requirements. The test task is verified based on the tenant's resource quota, which includes the hardware-in-the-loop device quota, the simulation software license quota, and the test environment quota. After the verification is passed, the isolation level and cross-tenant borrowing permissions of the test task are determined according to the task security level. Iterate through all hardware-in-the-loop devices in the global hardware-in-the-loop device pool, filter candidate devices according to the compatibility requirements, and prioritize matching the idle compatible devices of the tenant to which the test task belongs; When the tenant to which the test task belongs has no available compatible devices, the borrowing admission conditions are determined based on the priority of the test task and the cross-tenant borrowing permission. If the secondment admission criteria are not met, the test task will be placed in the queue; if the secondment admission criteria are met, a cross-tenant secondment decision will be triggered. When the borrowing trigger condition is met, idle hardware-in-the-loop devices and simulation software licenses are borrowed from the lending tenant with idle compatible devices in the global hardware-in-the-loop device pool. The number of hardware-in-the-loop devices to be borrowed is determined according to the number of hardware-in-the-loop devices required by the test task, the number of idle compatible devices of the tenant to which the test task belongs, and the global borrowing limit. The borrowing period is set based on the estimated runtime of the test task, and a borrowing record is generated. Construct the corresponding test environment according to the isolation level, and lock the simulation software license, hardware-in-the-loop device and test environment in sequence. If locking any resource fails, release all locked resources. After all resources are successfully locked, start the test task. During the test task, the heartbeat status of the hardware-in-the-loop device is monitored. If the heartbeat is interrupted for more than a set time, the occupied resources are forcibly reclaimed and the test task is terminated. After the test task is completed, the owned resources will be returned to the resource pool corresponding to the tenant to which the test task belongs, the borrowed resources will be returned to the resource pool corresponding to the lending tenant, the simulation software license will be released, the test environment will be destroyed and the test data will be archived, and a recycling record will be generated.
2. The method according to claim 1, characterized in that, The step of screening candidate devices based on the compatibility requirements includes: Obtain device information for each device in the global hardware-in-the-loop device pool. The device information includes the number of IO channels, supported bus protocols, a list of compatible ECU models, real-time processor computing power, current status, tenant, and security partition identifier. The current status is reported periodically and updated in real time by the edge acquisition nodes. Remove devices currently under maintenance or faulty status, as well as devices whose security partitions do not meet the required isolation level. Among the devices of the tenant to which the test task belongs, devices that are currently idle and match the compatibility requirements are selected as candidate devices; wherein, matching the compatibility requirements means that: the number of IO channels of the candidate device is not less than the number of IO channels in the compatibility requirements, the bus protocol supported by the candidate device includes the bus protocol in the compatibility requirements, the list of compatible ECU models of the candidate device includes the ECU models in the compatibility requirements, and the real-time processor computing power of the candidate device is not lower than the real-time processing performance requirements in the compatibility requirements. When the tenant to which the test task belongs does not have any available candidate devices, among the devices of the lending tenants whose cross-tenant borrowing permissions are allowed, devices that are currently idle and match the compatibility requirements are selected as candidate devices.
3. The method according to claim 1, characterized in that, The priorities are divided into five levels from high to low: P0, P1, P2, P3 and P4. The test tasks are assigned to the corresponding queues according to the priorities, and the higher priority queues are scheduled first. After P0, P1, and P2 level test tasks are started, they enter a non-preemptive protection period of a set duration. When a high-priority test task competes with a running low-priority test task for equipment, and the low-priority test task has exceeded its non-preemptive protection period, the low-priority test task is paused, an environment snapshot is generated, the hardware-in-the-loop device it occupies is released, and the low-priority test task is re-entered into the queuing queue. Among them, P0 level test tasks can preempt test tasks of P2 level and below, and P1 level test tasks can preempt test tasks of P3 level and below. High-priority test tasks can reserve hardware-in-the-loop devices within a set time period in advance. During the reserved time period, the hardware-in-the-loop devices remain locked and do not participate in cross-tenant borrowing and allocation. Low-priority test tasks avoid the reserved time period.
4. The method according to claim 1, characterized in that, The borrowing triggering conditions include: the hardware-in-the-loop device utilization rate of the tenant to which the test task belongs is not lower than a first threshold for a first set duration; and the hardware-in-the-loop device utilization rate of the lending tenant is not higher than a second threshold for a second set duration. The determination of the borrowing quantity includes: the remaining quantity after deducting the number of idle compatible devices of the tenant to which the test task belongs from the number of hardware-in-the-loop devices required for the test task, the number of idle compatible devices of the lending tenant, and the global borrowing limit, and selecting the minimum value among the three as the borrowing quantity of hardware-in-the-loop devices. The number of simulation software licenses borrowed is determined by taking the minimum value among the following three factors: the number of concurrent seats required by the test task (after deducting the available license seats of the tenant to which the test task belongs), the available license seats of the lending tenant, and the global license borrowing limit. The setting of the secondment period includes: setting an initial period for the secondment, allowing the submission of a renewal application before the expiration of the initial period, and ensuring that the cumulative period after renewal does not exceed the set upper limit; During the secondment period, the seconded hardware-in-the-loop device is prohibited from being seconded to other tenants again.
5. The method according to claim 1, characterized in that, The distinction between returning owned resources and borrowed resources separately includes: When the secondment period expires and the test tasks are completed, the seconded hardware-in-the-loop equipment and simulation software licenses will be retrieved and returned to the lending tenant. When the lending tenant initiates a high-priority test task and there are insufficient compatible devices available, the borrowed hardware-in-the-loop device and simulation software license will be reclaimed after the test task is completed, without forcibly interrupting the running test task. If the test task crashes, a node becomes disconnected, or a heartbeat is interrupted for more than a set time, the borrowed hardware-in-the-loop device will be forcibly reclaimed and returned to the lending tenant. When the test task terminates abnormally or the queue times out, the simulation software license occupied by the test task is forcibly released and returned according to the ownership of the simulation software license; an abnormal recycling record is generated. Generate a full-link audit log, which includes the borrowing tenant, the lending tenant, the device number of the hardware-in-the-loop device, the borrowing start and end times, the renewal record, the reason for the recovery, and the task operation log.
6. The method according to claim 1, characterized in that, The step of determining the isolation level and cross-tenant borrowing permissions for the test task based on the task security level includes: The isolation level and cross-tenant borrowing permission are determined according to preset task security level mapping rules, wherein: when the task security level is ASIL-C or ASIL-D, the isolation level is physical isolation, and the cross-tenant borrowing permission prohibits borrowing tenant equipment and prohibits borrowing idle equipment; when the task security level is ASIL-A or ASIL-B, the isolation level is schema-level logical isolation, and the cross-tenant borrowing permission only allows borrowing idle equipment from QM-level tenants and prohibits borrowing idle equipment; when the task security level is QM, the isolation level is row-level logical isolation, and the cross-tenant borrowing permission allows free participation in cross-tenant borrowing and allows borrowing idle equipment. Verify the certification status of the simulation tool required for the test task. If the safety level of the task is ASIL-A, ASIL-B, ASIL-C or ASIL-D and the simulation tool has not completed functional safety certification, block the resource allocation of the test task. The test coverage threshold for the test task is determined based on the task security level. When the actual coverage of the test task is lower than the test coverage threshold, the start of the test task is blocked and the locked resources are reclaimed. After borrowing the hardware-in-the-loop device, an independent isolated test environment is automatically created, and the operating data and test reports of the hardware-in-the-loop device are stored separately with a borrowing identifier attached.
7. The method according to claim 1, characterized in that, The simulation software license establishes a license pool model based on four dimensions: toolchain, functional module, concurrent seats, and tenant quota, and manages it by distinguishing between owned licenses and borrowed licenses; the license type refers to the type of license identified by the toolchain or functional module.
8. The method according to claim 1, characterized in that, The method further includes: Generate an environment snapshot for the test task. The environment snapshot includes container software status, test data volume, hardware-in-the-loop device IO channel configuration, bus communication parameters and hardware connection handshake information, and supports incremental snapshots. When the test task is preempted, a defect occurs during the test, or the test task is manually saved, an environment snapshot is generated and bound to the hardware-in-the-loop device occupied by the test task. When restoring the environment snapshot, the system automatically matches compatible hardware-in-the-loop devices, relocks the simulation software license required for the test task, rebuilds the hardware communication link, and synchronizes the IO configuration.
9. A scheduling and borrowing system for hardware-in-the-loop test resources in a multi-tenant environment, characterized in that, include: The task access module is used to receive test tasks, determine the tenant to which the test task belongs, and parse the task security level, priority, compatibility requirements for hardware-in-the-loop devices, and the required simulation software license model and concurrent seats of the test task. The compatibility requirements include ECU model, number of IO channels, bus protocol and real-time processing performance requirements. A scheduling engine is used to verify the test task based on the tenant's resource quota, which includes the hardware-in-the-loop device quota, the simulation software license quota, and the test environment quota. Based on the security level of the task, determine the isolation level and cross-tenant borrowing permissions for the test task; Traverse the global hardware-in-the-loop device pool, filter candidate devices according to the compatibility requirements, and prioritize matching the idle compatible devices of the tenant to which the test task belongs; if the tenant to which the test task belongs has no idle compatible devices, determine whether the borrowing admission conditions are met based on the priority of the test task and the cross-tenant borrowing permission. If the conditions are not met, the test task will be placed in the queue; if the conditions are met, a cross-tenant borrowing decision will be triggered. The borrowing module is used to borrow idle hardware-in-the-loop devices and simulation software licenses from the lending tenant with idle compatible devices in the global hardware-in-the-loop device pool when the borrowing trigger conditions are met. The number of hardware-in-the-loop devices to be borrowed is determined according to the number of hardware-in-the-loop devices required by the test task, the number of idle compatible devices of the tenant to which the test task belongs, and the global borrowing limit. The borrowing period is set based on the estimated runtime of the test task, and a borrowing record is generated. The multi-resource locking module is used to construct a corresponding test environment according to the isolation level, and lock the simulation software license, hardware-in-the-loop device and test environment in sequence. If any resource locking fails, all locked resources are released. After all resources are successfully locked, start the test task. The monitoring module is used to monitor the heartbeat status of the hardware-in-the-loop device during the test task. If the heartbeat is interrupted for more than a set time, the occupied resources are forcibly reclaimed and the test task is terminated. The resource recycling module is used to return owned resources and borrowed resources separately after the test task is completed, release the simulation software license, destroy the test environment and archive the test data, and generate recycling records.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for scheduling and borrowing hardware-in-the-loop test resources in a multi-tenant environment as described in any one of claims 1 to 8.
