An AUTOSAR system chip adaptation method, device, equipment, storage medium and product
By converting chip manuals into structured CDF files, constructing resource dependency graphs to generate code in parallel, and adopting a layered automated testing framework, the problems of long chip adaptation cycles and incomplete test coverage in AUTOSAR systems are solved, achieving efficient chip adaptation.
Patent Information
- Application Number
- CN202611323355.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-20
AI Technical Summary
Existing AUTOSAR system chip adaptation methods suffer from problems such as long adaptation cycles, incomplete test coverage, and low efficiency.
By converting chip manuals into structured CDF files, constructing chip resource dependency graphs, determining task execution order, generating code in parallel, and using a layered automated testing framework for verification, a standardized and automated chip adaptation process is achieved.
This improved chip adaptation efficiency, shortened the adaptation cycle, and ensured comprehensive test coverage and quantifiable quality.
Smart Images

Figure CN123138085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip adaptation technology, and in particular to an AUTOSAR system chip adaptation method, apparatus, device, storage medium and product. Background Technology
[0002] Automotive Open System Architecture (AUTOSAR) is a widely adopted software architecture standard in the automotive electronics field. In AUTOSAR, the Microcontroller Abstraction Layer (MCAL) is responsible for directly manipulating the chip hardware registers and serves as the key interface between the AUTOSAR base software and the chip hardware. Upper-layer base software accesses the hardware through the standardized MCAL interface, achieving software-hardware decoupling.
[0003] The current chip adaptation process for AUTOSAR systems typically involves manually reading the chip reference manual to extract key information, configuring the driver code for each MCAL module using Elektrobit (EB), followed by static analysis, unit testing, and board-level debugging. After debugging, integration and verification with the upper-layer basic software (BSW) and application layer are performed. This entire process usually takes 2-3 months. This traditional approach suffers from drawbacks such as a long adaptation cycle, incomplete test coverage, and low efficiency. Summary of the Invention
[0004] This invention provides an AUTOSAR system chip adaptation method, apparatus, device, storage medium, and product to solve the problems of long adaptation cycle, incomplete test coverage, and low efficiency in existing chip adaptation methods.
[0005] According to one aspect of the present invention, an AUTOSAR system chip adaptation method is provided, the method comprising: The chip manual of the chip to be adapted is converted into a structured chip description CDF file according to the CDF adaptation template library, and key chip resource information is extracted from the CDF file. Based on the CDF file and the key information of the chip resources, a chip resource dependency graph is constructed; The execution order of each task is determined based on the preset task dependency graph and the chip resource dependency graph; Based on the CDF file, the execution order of each task, and the template engine, the generated code is merged to obtain a complete code package; The complete code package was verified using a layered automated testing framework, and an adaptation report was obtained.
[0006] According to another aspect of the present invention, an AUTOSAR system chip adapter is provided, the adapter comprising: The conversion module is used to convert the chip manual of the chip to be adapted into a structured chip description CDF file according to the CDF adaptation template library, and extract key chip resource information from the CDF file. The construction module is used to construct a chip resource dependency graph based on the CDF file and the key chip resource information; The determination module is used to determine the execution order of each task based on a preset task dependency graph and the chip resource dependency graph; The generation module is used to generate and merge code based on the CDF file, the execution order of each task, and the template engine to obtain a complete code package; The verification module is used to verify the complete code package using a layered automated testing framework and obtain an adaptation report.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: at least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the AUTOSAR system chip adaptation method according to any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the AUTOSAR system chip adaptation method according to any embodiment of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the AUTOSAR system chip adaptation method according to any embodiment of the present invention.
[0010] This invention discloses an AUTOSAR system chip adaptation method, apparatus, device, storage medium, and product. The method includes: converting the chip manual of the chip to be adapted into a structured chip description CDF file based on a CDF adaptation template library, and extracting key chip resource information from the CDF file; constructing a chip resource dependency graph based on the CDF file and the key chip resource information; determining the execution order of each task based on a preset task dependency graph and the chip resource dependency graph; generating and merging code according to the CDF file, the execution order of each task, and a template engine to obtain a complete code package; and verifying the complete code package using a layered automated testing framework to obtain an adaptation report. This method improves the efficiency of chip adaptation by standardizing chip description files, parallelizing adaptation tasks, and automating regression testing, solving the problems of long adaptation cycles, incomplete test coverage, and low efficiency in existing chip adaptation methods.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating an AUTOSAR system chip adaptation method provided in Embodiment 1 of the present invention. Figure 2 This is a schematic diagram of a CDF metamodel structure provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of parallel task adaptation decomposition and scheduling provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the overall workflow of the adaptation process provided in an embodiment of the present invention; Figure 5 A hierarchical automated testing framework structure diagram provided in an embodiment of the present invention; Figure 6 This is a timing diagram of an adaptation case provided by an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an AUTOSAR system chip adapter provided in Embodiment 2 of the present invention; Figure 8This is a schematic diagram of the electronic device for the AUTOSAR system chip adaptation method according to an embodiment of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention. It should be understood that the various steps described in the method embodiments of the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0015] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0016] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, any variations of the terms "comprising" and "having," etc., are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0017] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0018] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0019] Existing chip adaptation methods have the following problems: (1) Manual coding is inefficient and of unstable quality. MCAL driver code is highly repetitive. The driver code for General Purpose Input Output (GPIO), Universal Asynchronous Receiver / Transmitter (UART), and Serial Peripheral Interface (SPI) of different chips has similar structures but needs to be rewritten manually. Moreover, it is easy to miss key information such as clock enable sequence and reset timing requirements when reading chip manuals manually. Different staff members have different coding styles, making maintenance difficult.
[0020] (2) Adaptation tasks are executed serially, resulting in low resource utilization. The adaptation of each MCAL module relies on manual coordination and cannot be carried out in parallel. Each module occupies the test environment exclusively during adaptation, resulting in low resource utilization. There are many adaptation tasks, but the number of chip verification boards is limited, which leads to long task queuing and waiting times.
[0021] (3) Test cases are scattered and regression test coverage is incomplete. Existing test cases rely on personal experience and lack systematic design; regression tests need to be triggered manually, which is easy to be missed, and the coverage of boundary conditions and abnormal scenarios is insufficient.
[0022] (4) Knowledge is difficult to accumulate and reuse. Experience in chip adaptation is scattered in personal notes and emails. After changing chips, it is necessary to explore again, and existing results cannot be inherited.
[0023] To address the aforementioned issues, this invention provides a rapid adaptation workflow method for AUTOSAR system chips, aiming to solve problems such as excessively long chip adaptation cycles, high manpower investment, and incomplete test coverage in traditional methods. It structures chip information through standardized chip description files, eliminating the inefficiency and error-proneness of manually reading manuals; it maximizes the utilization of computing resources and verification environments by parallelizing adaptation tasks; it ensures quantifiable adaptation quality by constructing a layered automated testing system; and it supports rapid chip iteration by accumulating adaptation knowledge into reusable assets, thereby achieving the goal of compressing the process from chip acquisition to mass production-level adaptation completion to within one week. Specifically: Example 1 Figure 1 This is a flowchart illustrating an AUTOSAR system chip adaptation method according to Embodiment 1 of the present invention. This method is applicable to situations requiring rapid chip adaptation in AUTOSAR systems. The method can be executed by an AUTOSAR system chip adaptation device, which can be implemented in software and / or hardware and is generally integrated into an electronic device. In this embodiment, the electronic device includes, but is not limited to, devices such as computers. Figure 1As shown in Embodiment 1 of the present invention, an AUTOSAR system chip adaptation method includes the following steps: S110. Convert the chip manual of the chip to be adapted into a structured chip description CDF file according to the CDF adaptation template library, and extract key chip resource information from the CDF file.
[0024] The CDF adaptation template library can include standard CDF adaptation templates and historical CDF templates. Historical CDF templates refer to adaptation templates generated based on historical chip adaptation results. The adaptation templates store CDF meta-models, which can be used to convert chip manuals from unstructured text into standardized structured data. The chip to be adapted refers to the chip that needs to complete AUTOSAR low-level software adaptation. The chip manual refers to the officially released datasheet, which records all chip hardware parameters, such as clock trees, interrupt vectors, peripheral registers, bit field definitions, memory mappings, and other raw information. Key chip resource information refers to parameters related to chip hardware resources, such as clock trees, interrupt vectors, peripheral registers, memory mappings, and other key information.
[0025] A clock tree refers to the hierarchical topology of clock signals within a chip, describing the supply and enable dependencies between clock sources, dividers, and peripheral clocks. An interrupt vector refers to the set of entry addresses corresponding to various interrupt service routines within a chip, used to distinguish different interrupt sources. Peripheral registers refer to the memory units integrated within on-chip peripherals. Memory mapping refers to the unique address range allocated to on-chip flash memory (FLASH), static random access memory (SRAM), and peripheral registers.
[0026] In this embodiment, the chip manual can be converted from a PDF / Word file into a structured CDF file, and key information such as clock tree, interrupt vector, peripheral registers and memory mapping can be extracted from the CDF file.
[0027] In one embodiment, the step of converting the chip manual of the chip to be adapted into a structured chip description CDF file according to the CDF adaptation template library includes: performing preliminary analysis of the chip manual of the chip to be adapted using a file parsing tool and manual annotation to obtain a preliminary CDF file with key information annotated; and converting the preliminary CDF file based on the CDF adaptation template library to obtain a structured chip description CDF file.
[0028] The file parsing tool can be a text parsing tool, such as a PDF parsing tool. The initial CDF file can be the CDF file obtained by the file parsing tool.
[0029] In this embodiment, a PDF parsing tool can be used to extract text and tables from the chip manual. Key information, such as register addresses, bit field definitions, and timing requirements, is manually annotated to generate a preliminary CDF file. Then, the preliminary CDF file is converted using a CDF adaptation template library to obtain a structured chip description CDF file. Clock trees, interrupt vector tables, memory mappings, and peripheral registers are extracted from the CDF file. This embodiment can also automatically verify the consistency of key chip resource information, such as whether interrupt numbers are duplicated or register addresses conflict. Suspicious items marked with errors can also be manually reviewed.
[0030] In this embodiment of the invention, Natural Language Processing (NLP) can be used to automatically extract CDF information from the chip manual and train a model using historical data to predict adaptation risk points. Alternatively, the adaptation task can be deployed to a Container Orchestration Platform (Kubernetes) cluster. Kubernetes supports elastic scaling and can handle large-scale chip adaptation needs.
[0031] In one embodiment, the CDF adaptation template library includes a CDF metamodel. The structure of the CDF metamodel includes a chip root node, a clock tree branch, an interrupt vector branch, and a memory branch. The chip root node is used to store basic information about the chip to be adapted. The clock tree branch includes clock nodes, clock peripheral nodes, clock register nodes, and clock bit field nodes. The interrupt vector branch includes interrupt vector nodes, interrupt peripheral nodes, interrupt register nodes, and interrupt bit field nodes. The memory branch includes memory nodes, memory peripheral nodes, memory register nodes, and memory bit field nodes.
[0032] In this embodiment, the CDF metamodel can be a model used to define the structure of a CDF file. The structure of the CDF metamodel can include a chip root node, clock tree branches, interrupt vector branches, and memory branches. The chip root node is the starting node of the CDF metamodel and is used to store basic information such as the chip name, manufacturer, kernel model, and version of the chip to be adapted. The chip root node can have three branches: a clock tree branch, an interrupt vector branch, and a memory region branch. Starting from the chip root node, the clock tree branch sequentially includes clock nodes, clock peripheral nodes, clock register nodes, and clock bit field nodes; the interrupt vector branch sequentially includes interrupt vector nodes, interrupt peripheral nodes, interrupt register nodes, and interrupt bit field nodes; and the memory branch sequentially includes memory nodes, memory peripheral nodes, memory register nodes, and memory bit field nodes.
[0033] For example, Figure 2This is a schematic diagram of a CDF metamodel structure provided in an embodiment of the present invention, as shown below. Figure 2 As shown, each branch under the root node is first associated with a branch node, the corresponding peripheral node, then with a register node, and finally ends with a bit field node.
[0034] The clock tree supports multiple clock sources, including high-speed external oscillators (HSE) and cascaded phase-locked loops (PLLs). Peripherals associated with the clock tree include GPIO, UART, SPI, and Controller Area Network (CAN). Internally associated registers within these peripherals include mode registers (MODER), input data registers (IDR), and output data registers (ODR). Bit fields record each segment of bits within the registers. The clock tree branches reveal the clock dependencies between peripherals.
[0035] Interrupt vector branches support priority grouping and are associated with peripherals such as timers (TIMs), analog-to-digital converters (ADCs), inter-integrated circuits (I2C), and watchdog timers (WDGs). The registers under these peripherals include Control Register 1 (CR1), the Bit Reset Register (BRR), and the Status Register (SR), corresponding to bit fields such as Transmit Enable (TE) and Receive Enable (RE). Interrupt vector branches can be used to detect interrupt priority resource conflicts.
[0036] The memory branch supports various types (FLASH / SRAM / peripherals). Related peripherals include Direct Memory Access (DMA), External Interrupt (EXTI), and Reset and Clock Control (RCC). Associated registers include the Capture / Compare Mode Register (CCMR), Auto-Reload Register (ARR), and Prescaler Register (PSC), with corresponding bit fields such as Output Compare 1 Mode (OC1M). The memory branch can be used to detect memory address conflicts.
[0037] The key rules of the metamodel are: Chip is the root node of CDF, containing basic identifier fields such as name, vendor, core, and revision; ClockTree uses a tree structure to describe the clock domain: external crystal HSE → PLL → Advanced High-performance Bus (AHB) / Advanced Peripheral Bus (APB) frequency divider tree; InterruptVector contains interrupt number, priority bits, and trigger mode (edge / level); Peripheral contains base address, bus mount, enable / reset register offset, and bitmask; Register contains offset address, access type (Read Write / Read Only / Write Only, RW / RO / WO), and reset value; Field contains bit start position (pos), width, and optional enumeration table, automatically generating bit operation macros. The key rules of the metamodel specify which fields each layer of nodes must contain.
[0038] CDF can be a structured chip description in YAML / JSON format, containing the following core nodes: ; CDF files can also support formats such as XML / Protobuf, and can be automatically converted from System View Description (SVD) files provided by chip manufacturers.
[0039] S120. Based on the CDF file and the key information of the chip resources, construct a chip resource dependency graph.
[0040] In this embodiment, the chip resource dependency graph can be a topology graph representing the relationships such as clock dependencies and resource mutual exclusion conflicts among various hardware resources of the chip. The chip resource dependency graph can be built based on a CDF file to analyze relationships such as clock dependencies, interrupt priority conflicts, and memory conflicts between peripherals.
[0041] In one embodiment, constructing a chip resource dependency graph based on the CDF file and the key chip resource information includes: analyzing the key chip resource information in the CDF file to obtain the dependency and conflict relationships between resources; and constructing a chip resource dependency graph based on the dependency and conflict relationships.
[0042] In this embodiment, the key information of each chip resource in the CDF file can be analyzed to obtain the dependency and conflict relationships between each chip resource. Based on the dependency and conflict relationships, a chip resource dependency graph can be constructed.
[0043] S130. Determine the execution order of each task based on the preset task dependency graph and the chip resource dependency graph.
[0044] In this embodiment, the task dependency graph can be a topology graph describing the relationships between various adaptation tasks during chip adaptation, representing the logical dependencies between tasks. Adaptation tasks can refer to tasks such as peripheral MCAL driver code generation, startup code and linker script generation, testing and verification, and code packaging; this embodiment does not limit the scope of these tasks. Based on the preset task dependency graph, the dependencies between tasks can be obtained; based on the chip resource dependency graph, the dependencies between chip resources can be obtained. Combining the task dependency graph and the chip resource dependency graph to obtain the execution order of each task satisfies both task dependencies and resource dependencies.
[0045] In one embodiment, determining the execution order of each task based on a preset task dependency graph and the chip resource dependency graph includes: identifying critical paths in the preset task dependency graph; determining a group of parallel tasks that can be executed simultaneously based on the task dependency graph and the chip resource dependency graph; determining the execution order of each task based on the critical paths and the group of parallel tasks, and allocating resources to each task.
[0046] The critical path can be a critical task execution path within the task dependency graph, such as the longest task chain from start to finish, or a path where clock initialization must precede GPIO. A parallel task group can be a group of tasks capable of executing in parallel.
[0047] In this embodiment, critical paths in a preset task dependency graph can be identified. Based on the task dependency graph and the chip resource dependency graph, topological sorting is performed to first determine parallel task groups that can be executed simultaneously. Based on the critical paths and parallel task groups, the execution order of each task is then determined, and resources are allocated to each task. For example, thread pools can be allocated according to priority (critical path first). During runtime, task status can be monitored, and resource allocation can be dynamically adjusted.
[0048] For example, Figure 3 This is a schematic diagram of parallel task adaptation decomposition and scheduling provided in an embodiment of the present invention, as shown below. Figure 3 As shown, this embodiment decomposes the adaptation work into parallel executable task units. The task decomposition principle can be: peripherals without clock dependence can be parallelized, such as GPIO and UART if they share a clock, they are serial; different levels of the same peripheral can be parallelized, such as register definition generation and driver logic generation; test tasks and generation tasks can be parallelized, such as generation and testing.
[0049] A typical microcontroller unit (MCU) has 15-20 peripherals, of which about 60% can be adapted for parallel processing. Through task parallelization, the theoretical speedup is about 3.5x. According to tests, the traditional serial method takes 48 hours, while the parallel method only takes 14 hours.
[0050] S140. Based on the CDF file, the execution order of each task, and the template engine, generate and merge the code to obtain a complete code package.
[0051] The template engine can be an engine that provides templates for generating code. The complete code package can be a complete set of project code that integrates MCAL drivers, startup code, linker scripts, and other components.
[0052] In this embodiment, MCAL driver code can be generated sequentially according to the execution order of each task based on the CDF file and template engine, and linker script, startup code and header file can be automatically generated and merged to obtain a complete code package.
[0053] In one embodiment, the step of generating and merging code based on the CDF file, the execution order of each task, and the template engine to obtain a complete code package includes: using a parallel adaptive task scheduling engine to execute tasks in parallel according to their execution order; generating Microcontroller Abstraction Layer (MCAL) code for each module by combining the template engine and the CDF file during execution; automatically generating linker scripts, startup code, and header files based on the CDF file; optimizing the storage layout of the MCAL code based on the linker script, and merging the optimized MCAL code, linker script, startup code, and header files to obtain a complete code package.
[0054] The parallel adaptation task scheduling engine can be used to decompose adaptation tasks into independent work packages, enabling multi-threaded / multi-node parallel execution of these tasks. MCAL code can include MCAL template code and MCAL driver code. MCAL template code can refer to the general code framework of the AUTOSAR specification, while MCAL driver code can refer to driver code further generated based on the MCAL template code and CDF files. Startup code refers to the code executed first after the MCU powers on and resets, responsible for system initialization and interrupt vector configuration. Linker scripts refer to configuration files used during the compiler's linking stage, specifying the address distribution of code, constants, and variables in memory. Header files refer to files used to declare functions, macros, classes, and global variables.
[0055] In this embodiment, a parallel adaptive task scheduling engine can be started to execute tasks in parallel according to their execution order. During execution, each task combines the template engine and CDF file to independently generate MCAL code for each module. The linker script is automatically generated based on the storage branches in the CDF file, and the startup code (configuring stack size and interrupt vector table location) is automatically generated based on the interrupt vector branches. The header file is generated based on the peripheral nodes, register nodes, and bit field nodes of each branch in the CDF file. Finally, the storage layout of the MCAL code is optimized based on the linker script (e.g., hot code is placed in SRAM), and the optimized MCAL code, linker script, startup code, and header file are merged to obtain a complete code package.
[0056] S150. The complete code package is verified using a layered automated testing framework to obtain an adaptation report.
[0057] The layered automated testing framework can be sequentially divided into unit testing (driver level) L1, integration testing (BSW level) L2, and system testing (application level) L3. The adaptation report can be a traceable document documenting the execution status of each stage of Hui's chip adaptation process, code generation results, automated testing conclusions, and recording of any exceptions.
[0058] In this embodiment, a layered automated testing framework can be executed to verify the complete code package and obtain an adaptation report, in which items that fail can be marked.
[0059] For example, Figure 4 This is a schematic diagram of the overall workflow of an adaptation process provided in an embodiment of the present invention, such as... Figure 4 As shown, the overall adaptation process can be divided into four stages: description, modeling, generation, and verification. In the verification stage, through code submission, static analysis, unit testing, integration testing, system testing, and report generation, chip adaptation can be completed quickly. If there are failure notifications or regression fixes during report generation, the process can be reversed for retesting or re-adaptation.
[0060] This invention provides an AUTOSAR system chip adaptation method, comprising: converting the chip manual of the chip to be adapted into a structured chip description CDF file according to a CDF adaptation template library, and extracting key chip resource information from the CDF file; constructing a chip resource dependency graph based on the CDF file and the key chip resource information; determining the execution order of each task based on a preset task dependency graph and the chip resource dependency graph; generating and merging code according to the CDF file, the execution order of each task, and a template engine to obtain a complete code package; and verifying the complete code package using a layered automated testing framework to obtain an adaptation report. This method, through standardized chip description files, parallelized adaptation tasks, and automated regression testing, can improve the efficiency of chip adaptation and solve the problems of long adaptation cycles, incomplete test coverage, and low efficiency in existing chip adaptation methods.
[0061] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.
[0062] In one embodiment, the step of using a layered automated testing framework to verify the complete code package and obtain an adaptation report includes: performing driver-level, software-level, and application-level tests on the complete code package sequentially based on the layered automated testing framework to obtain a multi-layered adaptation report.
[0063] In this embodiment, the layered automated testing framework can sequentially perform driver-level, software-level, and application-level tests on the complete code package to obtain a multi-layered adaptation report.
[0064] For example, code can be submitted to a continuous integration (CI) pipeline to automatically trigger L1 / L2 tests and generate a preliminary test report. Then, L3 system tests can be executed, the results can be compared with benchmark test results, and adaptation reports and deliverables can be output.
[0065] Figure 5 A hierarchical automated testing framework structure diagram provided by an embodiment of the present invention, such as... Figure 5 As shown, the testing hierarchy from bottom to top is as follows: L1 unit testing layer (driver level), L2 integration testing layer, and L3 system testing layer. The L1 unit testing layer can include GPIO driver testing, UART driver testing, and CAN driver testing, etc. The L2 integration testing layer can include operating system (OS) integration testing, communication stack integration testing, and storage stack integration testing, etc. The L3 system testing layer can include vehicle domain application testing, powertrain domain application testing, and chassis domain application testing, etc.
[0066] In one embodiment, each MCAL module of the driver level is tested independently, the software level tests the integration of the MCAL module with the upper-level electronic controller unit abstraction layer, and the application level tests typical application scenarios.
[0067] In this embodiment, the testing methods differ for different levels. For example, L1 unit testing (driver level) involves testing each MCAL module independently using a chip emulator or Hardware-in-the-Loop (HIL). Chip emulators can include Quick EMUlator (QEMU). Test items can include register access, interrupt triggering, clock switching, and error handling. L2 integration testing examines the integration of the MCAL with the upper-level Electronic Control Unit (ECU) Abstraction Layer (AL), i.e., ECUAL; verifies OS integration (interrupt nesting, task switching); and tests the communication stack, such as CAN / Ethernet drivers and upper-level protocol stacks. L3 system testing runs typical application scenarios such as vehicle body control and powertrain domain. Performance tests include startup time, interrupt latency, and Central Processing Unit (CPU) load; stability tests include long-term operation and stress testing.
[0068] As shown in Table 1 below, the method of this embodiment can improve adaptation efficiency. Through CDF standardization and automatic code generation, more than 90% of the MCAL layer code can be automatically generated, reducing the MCAL development workload by more than 90%. The overall adaptation cycle is compressed by 8-12 times through multi-dimensional task parallel execution, and the adaptation code reaches mass production quality through layered automated testing.
[0069] Table 1. Comparison of the present invention with existing technologies ; Based on the technical solutions of the above embodiments, this invention provides several specific implementation methods.
[0070] As one specific implementation method of this embodiment. Figure 6 This is a timing diagram of an adaptation case provided by an embodiment of the present invention, such as... Figure 6 As shown, on day 1, the engineer submits the chip manual PDF to the CDF tool. The CDF tool uses a parser to extract structured data and sends it to the generation engine. The generation engine returns a preliminary CDF draft to the CDF tool, which then presents the draft to the engineer for manual review. After the engineer confirms / corrects the CDF, the parallel code generation phase begins. The generation engine generates and submits the code to the CI pipeline, which then sends it to the testing framework. The code is compiled / programmed to the MCU verification board. The chip hardware board returns the running results / logs to the testing framework, which then feeds back the test report to the generation engine. Finally, the generation engine outputs an adaptation report and deliverables to the engineer.
[0071] Example 2 Figure 7 This is a schematic diagram of an AUTOSAR system chip adaptation device provided in Embodiment 2 of the present invention. The device is applicable to the situation of rapid chip adaptation in AUTOSAR system. The device can be implemented by software and / or hardware and is generally integrated on electronic devices.
[0072] like Figure 7 As shown, the device includes: The conversion module 210 is used to convert the chip manual of the chip to be adapted into a structured chip description CDF file according to the CDF adaptation template library, and extract key chip resource information from the CDF file. Construction module 220 is used to construct a chip resource dependency graph based on the CDF file and the chip resource key information; The determination module 230 is used to determine the execution order of each task based on the preset task dependency graph and the chip resource dependency graph; The generation module 240 is used to generate and merge code based on the CDF file, the execution order of each task, and the template engine to obtain a complete code package; Verification module 250 is used to verify the complete code package using a layered automated testing framework and obtain an adaptation report.
[0073] This embodiment provides an AUTOSAR system chip adaptation device, comprising: a conversion module for converting the chip manual of the chip to be adapted into a structured chip description CDF file according to a CDF adaptation template library, and extracting key chip resource information from the CDF file; a construction module for constructing a chip resource dependency graph based on the CDF file and the key chip resource information; a determination module for determining the execution order of each task based on a preset task dependency graph and the chip resource dependency graph; a generation module for generating and merging code according to the CDF file, the execution order of each task, and a template engine to obtain a complete code package; and a verification module for verifying the complete code package using a layered automated testing framework to obtain an adaptation report. By standardizing chip description files, parallelizing adaptation tasks, and automating regression testing, the efficiency of chip adaptation can be improved, solving the problems of long adaptation cycles, incomplete test coverage, and low efficiency in existing chip adaptation methods.
[0074] Furthermore, the conversion module 210 includes: The parsing unit is used to perform preliminary parsing of the chip manual of the chip to be adapted using file parsing tools and manual annotation, and to obtain a preliminary CDF file after annotating key information; The conversion unit is used to convert the preliminary CDF file based on the CDF adaptation template library to obtain a structured chip description CDF file.
[0075] Furthermore, the CDF adaptation template library includes a CDF metamodel, the structure of which includes a chip root node, clock tree branches, interrupt vector branches, and memory branches; The chip root node is used to store basic information about the chip to be adapted. The clock tree branches include clock nodes, clock peripheral nodes, clock register nodes, and clock bit field nodes; The interrupt vector branch includes an interrupt vector node, an interrupt peripheral node, an interrupt register node, and an interrupt bit field node; The storage branch includes storage nodes, storage peripheral nodes, storage register nodes, and storage bit field nodes.
[0076] Furthermore, module 220 includes: The analysis unit is used to analyze the key information of each chip resource in the CDF file to obtain the dependency and conflict relationships between resources; The building unit is used to construct a chip resource dependency graph based on the aforementioned dependency and conflict relationships.
[0077] Furthermore, module 230 is defined as including: The identification unit is used to identify the critical path in a preset task dependency graph; The determining unit is used to determine a group of parallel tasks that can be executed simultaneously based on the task dependency graph and the chip resource dependency graph. The allocation unit is used to determine the execution order of each task based on the critical path and the parallel task group, and to allocate resources to each task.
[0078] Furthermore, the generation module 240 includes: The execution unit is used to execute tasks in parallel according to the execution order of each task using a parallel adaptive task scheduling engine; The first generation unit is used to generate the microcontroller abstraction layer (MCAL) code for each module by combining the template engine and the CDF file when each task is executed. The second generation unit is used to automatically generate linker scripts, startup code, and header files based on the CDF file; The optimization unit is used to optimize the storage layout of the MCAL code based on the linker script, and merge the optimized MCAL code, linker script, startup code and header files to obtain a complete code package.
[0079] Furthermore, the verification module 250 is specifically used for: Based on the layered automated testing framework, driver-level, software-level, and application-level tests are performed sequentially on the complete code package to obtain a multi-layered adaptation report.
[0080] Furthermore, each MCAL module at the driver level is tested independently, the software level tests the integration of the MCAL module with the upper-level electronic controller unit abstraction layer, and the application level tests typical application scenarios.
[0081] The above-mentioned AUTOSAR system chip adaptation device can execute the AUTOSAR system chip adaptation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method.
[0082] Example 3 Figure 8 A schematic diagram of an electronic device that can be used to implement embodiments of the present invention is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0083] like Figure 8As shown, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11. The memory can be read-only memory (ROM) and / or random access memory (RAM), such as ROM 12 and RAM 13. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in ROM 12 or loaded into RAM 13 from storage unit 18. RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An I / O interface 15 with input / output (I / O) functionality is also connected to the bus 14.
[0084] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0085] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the AUTOSAR system-on-a-chip adaptation method.
[0086] In some embodiments, the AUTOSAR system-on-chip adaptation method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the AUTOSAR system-on-chip adaptation method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the AUTOSAR system-on-chip adaptation method by any other suitable means (e.g., by means of firmware).
[0087] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0088] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0089] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM) or flash memory, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0090] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device for displaying information to the user, such as a cathode ray tube (CRT) or liquid crystal display (LCD) monitor; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0091] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0092] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0093] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0094] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for adapting an AUTOSAR system chip, characterized in that, The method includes: The chip manual of the chip to be adapted is converted into a structured chip description CDF file according to the CDF adaptation template library, and key chip resource information is extracted from the CDF file. Based on the CDF file and the key information of the chip resources, a chip resource dependency graph is constructed; The execution order of each task is determined based on the preset task dependency graph and the chip resource dependency graph; Based on the CDF file, the execution order of each task, and the template engine, the generated code is merged to obtain a complete code package; The complete code package was verified using a layered automated testing framework, and an adaptation report was obtained.
2. The method according to claim 1, characterized in that, The step of converting the chip datasheet of the chip to be adapted into a structured chip description CDF file based on the CDF adaptation template library includes: The chip manual of the chip to be adapted is initially analyzed by file parsing tools and manual annotation to obtain a preliminary CDF file with key information annotated. The preliminary CDF file is converted using the CDF adapter template library to obtain a structured chip description CDF file.
3. The method according to claim 1 or 2, characterized in that, The CDF adaptation template library includes a CDF meta-model, the structure of which includes a chip root node, clock tree branches, interrupt vector branches, and memory branches. The chip root node is used to store basic information about the chip to be adapted. The clock tree branches include clock nodes, clock peripheral nodes, clock register nodes, and clock bit field nodes; The interrupt vector branch includes an interrupt vector node, an interrupt peripheral node, an interrupt register node, and an interrupt bit field node; The storage branch includes storage nodes, storage peripheral nodes, storage register nodes, and storage bit field nodes.
4. The method according to claim 1, characterized in that, The construction of the chip resource dependency graph based on the CDF file and the key chip resource information includes: By analyzing the key information of each chip resource in the CDF file, the dependencies and conflicts between resources are obtained; A chip resource dependency graph is constructed based on the aforementioned dependencies and conflicts.
5. The method according to claim 1, characterized in that, The process of determining the execution order of each task based on the preset task dependency graph and the chip resource dependency graph includes: Identify the critical paths in a pre-defined task dependency graph; Based on the task dependency graph and the chip resource dependency graph, a group of parallel tasks that can be executed simultaneously is determined. Based on the critical path and the parallel task group, the execution order of each task is determined, and resources are allocated to each task.
6. The method according to claim 1, characterized in that, The process involves generating and merging code based on the CDF file, the execution order of each task, and the template engine to obtain a complete code package, including: A parallel adaptive task scheduling engine is used to execute tasks in parallel according to their execution order; When each task is executed, it combines the template engine and the CDF file to generate the Microcontroller Abstraction Layer (MCAL) code for each module. Automatically generate linker scripts, startup code, and header files based on the CDF file; The storage layout of the MCAL code is optimized based on the linker script, and the optimized MCAL code, linker script, startup code, and header files are merged to obtain a complete code package.
7. The method according to claim 1, characterized in that, The layered automated testing framework is used to verify the complete code package, and an adaptation report is obtained, including: Based on the layered automated testing framework, driver-level, software-level, and application-level tests are performed sequentially on the complete code package to obtain a multi-layered adaptation report.
8. The method according to claim 7, characterized in that, Each MCAL module in the driver level is tested independently, the software level tests the integration of the MCAL module with the upper-level electronic controller unit abstraction layer, and the application level tests typical application scenarios.
9. An AUTOSAR system chip adapter, characterized in that, The device includes: The conversion module is used to convert the chip manual of the chip to be adapted into a structured chip description CDF file according to the CDF adaptation template library, and extract key chip resource information from the CDF file. The construction module is used to construct a chip resource dependency graph based on the CDF file and the key chip resource information; The determination module is used to determine the execution order of each task based on a preset task dependency graph and the chip resource dependency graph; The generation module is used to generate and merge code based on the CDF file, the execution order of each task, and the template engine to obtain a complete code package; The verification module is used to verify the complete code package using a layered automated testing framework and obtain an adaptation report.
10. An electronic device, characterized in that, The device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the AUTOSAR system chip adaptation method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the AUTOSAR system chip adaptation method according to any one of claims 1-8.
12. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the AUTOSAR system chip adaptation method according to any one of claims 1-8.
