AUTOSAR-based module verification method and system
By using the JEP interface to call Python verification files in the AUTOSAR module verification method, the problems of high learning threshold and weak data processing capabilities when writing module verification rules in the prior art are solved, and more efficient data processing and lower development and maintenance costs are achieved.
Patent Information
- Application Number
- CN202411576986.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-28
AI Technical Summary
When writing module verification rules in the prior art, the use of Java leads to a high learning threshold, weak data processing library functions, and Configurator Pro is limited in the development process, making it difficult to flexibly adjust and optimize, increasing development and maintenance costs.
Using AUTOSAR-based module verification method, Python verification files are called through the JEP interface, and the input module configuration data is verified in real time. Python's powerful data processing library is used to improve data processing capabilities and reduce development and maintenance costs.
It significantly lowers the learning threshold for developers, improves data processing capabilities, ensures the consistency and integrity of ECU configurations, and reduces development and maintenance costs.
Smart Images

Figure CN119537122A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data input verification technology, in particular to an AUTOSAR-based module verification method and system thereof. Background Art
[0002] With the improvement of automobile electronics and the increase of vehicle functions, modern automobiles are experiencing a technological revolution. The electronic control unit ECU (Electronic Control Unit) of automobiles, also known as "driving computer" or "on-board computer", is generally composed of a microcontroller and its peripheral circuits. Like ordinary computers, ECU is composed of a microprocessor (MCU), memory (ROM, RAM), input / output interface (I / O), analog-to-digital converter (A / D), and large-scale integrated circuits such as shaping and driving. ECU is usually likened to the brain of the car.
[0003] Since 2003, companies in the automotive industry have worked together to develop an open, standardized software architecture for the automotive industry. As a result, the AUTOSAR (AUTomotive Open System ARchitecture) standard was proposed and widely recognized. AUTOSAR is jointly established by global automakers, component suppliers and other electronics, semiconductor and software system companies, and each member maintains a development partnership. The AUTOSAR architecture facilitates the exchange and update of vehicle electronic system software and provides a foundation for the efficient management of increasingly complex vehicle electronic and software systems.
[0004] ECU configuration is one of the important steps of AUTOSAR. ECU configuration needs to integrate the software implementations of different basic software providers, provide the required configuration content to the user, and record the user's configuration information. After consistency and integrity verification, the code is generated. Therefore, verification code is very important in the ECU configuration process. Especially module-related verification, it determines whether the generated code can be used normally.
[0005] In the existing technology, the SmartSAR kernel developed by Zhejiang University is an automotive electronics basic software based on the AUTOSAR standard, which has the characteristics of standardization, portability and code reusability. SmartSAR is built on the OSGi modular system and chooses the Java language to build its infrastructure Bundle group to achieve module correlation verification.
[0006] However, after analyzing the applicable scenarios of Java, although Java performs well in projects with high performance requirements, its advantages are not obvious in the process of rule writing. Java's grammatical structure is relatively complex, which undoubtedly increases a certain learning threshold for professionals in the embedded field. In the process of writing module verification rules, a lot of data processing work is involved. Although Java provides data processing functions, its data processing library is not the richest.
[0007] In the field of scientific computing, Python has a powerful NumPy library that can efficiently perform multidimensional array operations and processing, while Java's library in this regard is relatively weak. NumPy provides a wealth of mathematical functions and linear algebra operations, which can greatly improve the efficiency of scientific computing. In terms of data analysis, Python's Pandas library is a very powerful tool that can easily read, clean, convert and analyze data.
[0008] Although there are some data analysis libraries in Java, they are not as comprehensive and easy to use as Pandas. Pandas can easily process tabular data and perform operations such as slicing, indexing, and aggregation of data. Obviously, using Java to write module validation rules is not the best way.
[0009] Vector's Configurator Pro provides verification and consistency checking of configuration content in accordance with the AUTOSAR specification. However, the Configurator Pro solution is largely limited by its own original development tool structure in the development process, and is not completely consistent with AUTOSAR's definition of development methods. In addition, it may be difficult to make flexible adjustments and optimizations when faced with complex and changing development tasks. When new verification rules or functional modules need to be added, Configurator Pro may require complex configuration and customized development. At the same time, its configuration content only supports MICROSAR source code, and cannot implement parameter verification functions for other basic software, which increases the cost of development and maintenance. Summary of the invention
[0010] The present invention aims to avoid the deficiencies existing in the above-mentioned prior art and to provide a module verification method based on AUTOSAR to improve data processing capability and reduce development and maintenance costs.
[0011] The present invention adopts the following technical solutions to solve the technical problems.
[0012] A module verification method based on AUTOSAR of the present invention comprises the following steps: Step 1: Data loading step: for each functional module involved in the ECU configuration process, load the configuration information of all current functional modules from the configurator; Step 2: Data input step; receiving module configuration data input by the user; Step 3: Input verification step: Call the Python verification file through the JEP interface to perform real-time verification on the input module configuration data; Step 4: If the real-time verification fails, a notification of data configuration failure is fed back to the user; then the process returns to step 2, and the user re-enters the data to continue verification; Step 5: If the real-time verification is successful, a notification of successful data configuration is fed back to the user, and the verification ends.
[0013] The AUTOSAR-based module verification method of the present invention is also characterized in that: Furthermore, in step 1, the configuration information is stored in a MongoDB database.
[0014] Furthermore, in step 2, the module configuration data includes module instances, parameter settings, and referenced configurations.
[0015] Furthermore, in step 2, when the user inputs module configuration data, the correctness of the data type, format and range is verified, and it is checked whether the required parameters are complete.
[0016] Furthermore, in step 3, the input module configuration data is verified in real time, including instance verification, parameter verification, reference verification and automatic calculation.
[0017] Furthermore, in step 4, the notification of data configuration failure is fed back to the user, and error and warning information are sent at the same time.
[0018] Furthermore, in step 4, the error and warning information includes error parameters and modification suggestions for the error parameters.
[0019] The present invention also discloses a verification system of a module verification method based on AUTOSAR, including an ECU configurator verification module and a Python verification file; The ECU configurator verification module is used to verify data processing and calling, including verification module configuration management, Python method classification and verification result return; The Python verification file includes a main folder; the main folder includes version subfolders of different AUTOSAR standard versions.
[0020] Further, the version folder includes a device core subfolder and a device core subfolder.
[0021] Furthermore, the easysar core subfolder corresponds to the basic software layer BSW; the device core subfolder corresponds to the microcontroller abstraction layer MCAL.
[0022] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention discloses a module verification method based on AUTOSAR and a system thereof, comprising: for each function module involved in the ECU configuration process, loading the configuration information of all current function modules from a configurator; receiving the module configuration data input by the user; calling the Python verification file through the JEP interface to perform real-time verification on the input module configuration data; if the real-time verification fails, feeding back a notification of data configuration failure to the user, and then continuing the verification; if the real-time verification succeeds, feeding back a notification of data configuration success to the user, and ending the verification. The verification system of the module verification method based on AUTOSAR of the present invention comprises an ECU configurator verification module and a Python verification file.
[0023] The verification system of the module verification method based on AUTOSAR of the present invention has the following technical advantages.
[0024] 1. Using Python as the language for writing validation rules significantly reduces the learning threshold for developers. ; 2. Python's cross-platform feature enables the verification module to run flexibly on different operating systems and has good portability.
[0025] 3. The system adopts JEP technology, which enables Java and Python to run in the same process. It not only realizes the efficient calling of Java to Python scripts, but also ensures the independence and security of Python scripts through multi-threaded design.
[0026] 4. Automatically perform configuration parameter verification and feedback warnings and errors. Users adjust the configuration according to the prompts and repeat the verification until it passes, ensuring that the final generated code complies with the AUTOSAR standard and guarantees the consistency and integrity of the ECU configuration.
[0027] The AUTOSAR-based module verification method and system of the present invention have the advantages of low learning threshold, good portability, ensuring the independence and security of Python scripts, and being able to ensure the consistency and integrity of ECU configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1The present invention is a flow chart of a module verification method based on AUTOSAR.
[0029] Figure 2 The present invention is an architecture diagram of a verification system of an AUTOSAR-based module verification method.
[0030] Figure 3 The present invention is a structural diagram of a Python verification file of a verification system of an AUTOSAR-based module verification method.
[0031] Figure 4 Schematic diagram of calling python file for JEP of the present invention.
[0032] The present invention will be further described below through specific implementation modes in conjunction with the accompanying drawings. DETAILED DESCRIPTION
[0033] See also Figure 1 to Figure 4 , a module verification method based on AUTOSAR of the present invention comprises the following steps: Step 1: Data loading step: for each functional module involved in the ECU configuration process, load the configuration information of all current functional modules from the configurator; Step 2: Data input step; receiving module configuration data input by the user; Step 3: Input verification step: Call the Python verification file through the JEP interface to perform real-time verification on the input module configuration data; Step 4: If the real-time verification fails, a notification of data configuration failure is fed back to the user; then the process returns to step 2, and the user re-enters the data to continue verification; Step 5: If the real-time verification is successful, a notification of successful data configuration is fed back to the user, and the verification ends.
[0034] like Figure 1As shown, a module verification method based on AUTOSAR of the present invention divides the ECU by using a module division method based on AUTOSAR. AUTOSAR abstracts the microcontroller into three layers at the software height: application layer Application, real-time operating environment layer and basic software layer BSW. The basic software layer BSW includes a service layer, an ECU abstract layer, a microcontroller abstract layer and a complex driver layer. The ECU abstract layer, the microcontroller abstract layer and the complex driver layer are divided into many abstract modules, and each abstract module includes submodules. For example, there are many submodules in the LIN COMM abstract module, and the linif submodule is responsible for processing the LIN interface. The present invention divides each functional module involved in the ECU configuration process based on AUTOSAR, and independently verifies each functional module; during the verification process, Python scripts are used to flexibly process various configuration data, and the correctness and consistency of each functional module are guaranteed by calling different verification rules.
[0035] like Figure 2 The verification system of the module verification method based on AUTOSAR of the present invention includes an ECU configurator verification module and a Python verification file. The configurator verification module is responsible for the verification data processing and calling of the entire verification system, including functions such as verification module configuration management, Python method classification, and verification result return, and is used to verify the various functional modules involved in the ECU configuration process. The specific verification logic is implemented through the Python verification file. In order to execute these Python scripts in the Java environment, the system adopts JEP (Java Embedded Python) technology.
[0036] During specific implementation, in step 1, the configuration information is stored in a MongoDB database.
[0037] The configuration information loaded from the configurator is stored in the MongoDB database. The configuration information defines the parameters of each functional module and the mutual reference relationship between different functional modules.
[0038] For example, a series of containers are defined in the linif submodule of the LIN COMM abstract module. The container stores user configuration data, including instance creation, parameter configuration, reference relationships, and nesting of subcontainers. For ease of management, Python scripts of different functional modules are organized in corresponding folders. The verification script of the linif submodule is specifically placed in the linif verification folder. The verification script of the linif submodule defines the configuration information such as parameters, number of references, size, and number of instances that the linif submodule needs to configure. When performing linif verification, the system will call the invoke method of JEP and input the name that needs to be constrained and the corresponding module configuration data. At this time, the Python method will verify the input module configuration data. If the input module configuration data exceeds the preset range or is not configured, the system will return an error message, prompting the preset range of the input module configuration data and whether a configuration parameter is missing. Through this verification mechanism, the integrity and accuracy of the configuration data of each module of the system are ensured.
[0039] During specific implementation, in step 2, the module configuration data includes module instance, parameter settings and referenced configurations.
[0040] The module configuration data includes module instances, parameter settings, and referenced configurations.
[0041] During specific implementation, in step 2, when the user inputs module configuration data, the correctness of the data type, format and range is verified, and it is checked whether the required parameters are complete.
[0042] In step 2, the verification system performs input verification on the module configuration data input in real time. Input verification ensures the correctness of data types, formats, and ranges, and checks whether the required parameters are complete. Input verification in the functional module is implemented through the metamodel. In the metamodel, the number of instances, parameters, references, and parameter ranges are preliminarily defined to ensure that the value model complies with the general verification rules.
[0043] In specific implementation, in step 3, the input module configuration data is verified in real time, including instance verification, parameter verification, reference verification and automatic calculation.
[0044] In the present invention, the Python script is called through the JEP interface to perform verification. JEP allows Java and Python codes to run in the same process, so the parameters of the module configuration data are passed to Python for verification. In the Python verification stage, each functional module has a special method to check whether its parameters comply with the rules, including instance verification, parameter verification, reference verification and automatic calculation to ensure the rationality of the ECU configuration.
[0045] During specific implementation, in step 4, the notification of data configuration failure is fed back to the user, and error and warning information is sent at the same time.
[0046] During specific implementation, in step 4, the error and warning information includes error parameters and modification suggestions for the error parameters.
[0047] If the verification fails, Python will return a notification of data configuration failure, along with detailed error and warning information. The error and warning information will be displayed to the user through the system, and the specific error parameters and modification suggestions will be indicated. For example, in the linif submodule, if a parameter configuration is entered as 5, and the corresponding parameter range of the Python script is 6 to 10, then the user will be reminded that the parameter configuration value does not meet the requirements and should be in the range of 6 to 10.
[0048] The user can make modifications based on the feedback and then restart the verification process until all verifications pass. In this way, through input verification, module instantiation, JEP interface calling Python, feedback of verification results, and user modification and re-verification, the entire verification process forms a complete closed loop to ensure the correctness and stability of system configuration.
[0049] If the verification is successful, the Python script will return a success status and the system will notify the user that the verification was successful.
[0050] The present invention also discloses a verification system of a module verification method based on AUTOSAR, including an ECU configurator verification module and a Python verification file; The ECU configurator verification module is used to verify data processing and calling, including verification module configuration management, Python method classification and verification result return; The Python verification file includes a main folder; the main folder includes version subfolders of different AUTOSAR standard versions.
[0051] During specific implementation, the version folder includes a device core subfolder and a device core subfolder.
[0052] During specific implementation, the easysar core subfolder corresponds to the basic software layer BSW; the device core subfolder corresponds to the microcontroller abstraction layer MCAL.
[0053] like Figure 2The verification system of the module verification method based on AUTOSAR of the present invention includes an ECU configurator verification module and a Python verification file. The configurator verification module is responsible for the verification data processing and calling of the entire verification system, including functions such as verification module configuration management, Python method classification, and verification result return, and is used to verify the various functional modules involved in the ECU configuration process. The specific verification logic is implemented through the Python verification file. In order to execute these Python scripts in the Java environment, the system adopts JEP (Java Embedded Python) technology.
[0054] Python verifies the file structure as Figure 3 As shown, it includes a main folder ANGHUI. The subfolders of the main folder ANGHUI are divided according to different AUTOSAR standard versions (such as AUTOSAR 4.2.2 and AUTOSAR 4.4.0). In the version subfolder of each AUTOSAR standard version, there are two core subfolders, namely the easysar core subfolder and the device core subfolder.
[0055] The two core subfolders correspond to the two main layers of the AUTOSAR architecture: Basic Software (BSW) and Microcontroller Abstraction Layer (MCAL). The easysar core subfolder corresponds to the basic software layer BSW. The basic software layer BSW is an important part of the AUTOSAR architecture and contains basic software modules that support the application layer and runtime environment (RTE) functions. The device core subfolder corresponds to the microcontroller abstraction layer MCAL. The microcontroller abstraction layer MCAL is at the bottom layer of the AUTOSAR architecture and interacts directly with the hardware.
[0056] In the present invention, JEP technology is used to enable Java and Python to run in the same process. When the ECU configurator verifies the parameters of the function module, the verification interface is called to pass in the name of the corresponding function module, and the verification Python file of the corresponding function module in the ANGHUI folder is called by JEP. The schematic diagram of JEP calling the python file is shown in Figure 4 .
[0057] The function module parameters are validated through the Python file, and then a prompt indicating success or failure of the validation is returned. For example, if the normaltable instance of the LinIf Schedule Table container in the linif submodule lacks the required parameter LinIf ScheduleTable Index, an error message will be reported, indicating: "ERROR: LinIf Schedule TableIndex parameter is not configured".
[0058] In the present invention, JEP (Java Embedded Python) embeds the Python interpreter into the JVM by calling JNI (Java Native Interface) and CPython APIs, so that Java can call Python code.
[0059] The working mechanism of embedding the Python interpreter in the JVM is as follows: a top-level Python interpreter is initialized when the JVM starts, which is responsible for starting and managing the Python environment. The top-level interpreter remains active throughout the life cycle of the JVM until the JVM is destroyed. Whenever a JEP instance is created in Java code, JEP creates an independent sub-interpreter for the instance based on this top-level interpreter. The sub-interpreter is an independent environment isolated from other JEP instances, allowing Python code to be safely executed in a multi-threaded scenario.
[0060] Since JEP itself is thread-safe, different Java threads can create and use their own JEP instances, ensuring the independent operation of multiple Python environments and avoiding mutual interference between different Java threads. The life cycle of the sub-interpreter is bound to the JEP instance. When the JEP instance is no longer needed, the sub-interpreter corresponding to the instance can be closed by calling the jep.close() function to release the resources it occupies. The top-level interpreter will remain in the JVM until the entire JVM process terminates.
[0061] JEP allows each JEP instance to run in an isolated environment through the design of a sub-interpreter. This isolation avoids interference between different threads and ensures that resources and states do not affect each other. It effectively ensures the security of the interaction between Java and Python in single-threaded and multi-threaded environments.
[0062] The verification system of the module verification method based on AUTOSAR of the present invention has the following characteristics.
[0063] 1. Use Python scripting language for development, its syntax is concise and clear, making the code highly readable. At the same time, Python has built-in rich data structures, such as lists, dictionaries, sets, etc., which provides great convenience for developers and saves learning costs. In addition, Python has a large number of data science libraries as support, providing powerful tools for data processing, analysis and other tasks.
[0064] 2. Python's interpreter can run on multiple operating systems, including but not limited to Windows, macOS, and Linux, and has good portability.
[0065] 3. Through AUTOSAR-based module division, each module is independently verified to improve the maintainability of the system.
[0066] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0067] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A module verification method based on AUTOSAR, characterized in that: The steps include: Step 1: Data loading step: for each functional module involved in the ECU configuration process, load the configuration information of all current functional modules from the configurator; Step 2: Data input step; receiving module configuration data input by the user; Step 3: Input verification step: Call the Python verification file through the JEP interface to perform real-time verification on the input module configuration data; Step 4: If the real-time verification fails, a notification of data configuration failure is fed back to the user; then the process returns to step 2, and the user re-enters the data to continue verification; Step 5: If the real-time verification is successful, a notification of successful data configuration is fed back to the user, and the verification ends.
2. The module verification method based on AUTOSAR according to claim 1, characterized in that: In the step 1, the configuration information is stored in a MongoDB database.
3. The module verification method based on AUTOSAR according to claim 1, characterized in that: In step 2, the module configuration data includes module instance, parameter settings and referenced configurations.
4. The module verification method based on AUTOSAR according to claim 1, characterized in that: In step 2, when the user inputs module configuration data, the correctness of the data type, format and range is verified, and whether the required parameters are complete.
5. The module verification method based on AUTOSAR according to claim 1, characterized in that: In step 3, the input module configuration data is verified in real time, including instance verification, parameter verification, reference verification and automatic calculation.
6. The module verification method based on AUTOSAR according to claim 1, characterized in that: In step 4, the notification of data configuration failure is fed back to the user, and error and warning information are sent at the same time.
7. The module verification method based on AUTOSAR according to claim 6, characterized in that: In step 4, the error and warning information includes error parameters and modification suggestions for the error parameters.
8. A verification system for the module verification method based on AUTOSAR according to claim 1, characterized in that: Includes ECU configurator verification module and Python verification files; The ECU configurator verification module is used to verify data processing and calling, including verification module configuration management, Python method classification and verification result return; The Python verification file includes a main folder; the main folder includes version subfolders of different AUTOSAR standard versions.
9. The verification system according to claim 8, characterized in that: The version folder includes a device core subfolder and a device core subfolder.
10. The verification system according to claim 9, characterized in that: The easysar core subfolder corresponds to the basic software layer BSW; the device core subfolder corresponds to the microcontroller abstraction layer MCAL.