AUTOSAR architecture diagnosis code generation method, equipment and medium

By generating AUTOSAR diagnostic registry and global manager in the Simulink application layer model, the problem of relying on expensive tools to generate diagnostic codes under the AUTOSAR architecture is solved, and the lightweight implementation and efficient configuration of AUTOSAR diagnostic functions are realized.

CN119938026AActive Publication Date: 2025-05-06FOSHAN XIANHU LAB

Patent Information

Application Number
CN202411922507.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-05-06
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

Under the AUTOSAR architecture, relying on expensive AUTOSAR tools to generate diagnostic codes makes it difficult for small and medium-sized enterprises to implement AUTOSAR diagnostic functions, and the configuration efficiency of the diagnostic system is inefficient, making it difficult to adapt to the needs of rapid iteration and frequent changes.

Method used

By configuring the AUTOSAR diagnostic system based on the diagnostic database configured in the Simulink application layer model, a registry module is used to generate a diagnostic registry and a diagnostic global manager is generated. The diagnostic code file corresponding to the AUTOSAR diagnostic system is generated through parameter configuration, and the AUTOSAR diagnostic function is realized lightweight.

Benefits of technology

Without relying on the AUTOSAR tool, AUTOSAR architecture diagnostic code is generated through modeling, which realizes the lightweight implementation of the AUTOSAR diagnostic function, improves the configuration efficiency of the diagnostic system, and adapts to the needs of rapid iteration and frequent changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938026A_ABST
    Figure CN119938026A_ABST
Patent Text Reader

Abstract

The invention provides an AUTOSAR architecture diagnosis code generation method and device and a medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a diagnosis database required for configuring the AUTOSAR diagnosis system, wherein the diagnosis database records a plurality of diagnosis units and a logic relation graph formed by the diagnosis units; generating a plurality of diagnosis registrators corresponding to the plurality of diagnosis units in a Simulink application layer model by adopting a registrator module according to the logic relation graph; performing parameter configuration on the plurality of diagnosis registrators to generate a diagnosis database configuration file; generating a diagnosis global manager in the Simulink application layer model, and then performing parameter configuration to generate a diagnosis global configuration file; and integrating the diagnosis database configuration file and the diagnosis global configuration file to obtain an AUTOSAR architecture diagnosis code file corresponding to the AUTOSAR diagnosis system. According to the invention, the AUTOSAR diagnosis function can be realized in a lightweight manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device and medium for generating diagnostic code for an AUTOSAR architecture. Background Art

[0002] Model-based development under the AUTOSAR architecture uses diagnostic functions during the modeling process, that is, the diagnostic event management module and function suppression management module of the AUTOSAR architecture are directly called in the application layer, which requires the pre-configuration of the diagnostic system according to the modeling requirements. Usually, the diagnostic code files are generated by relying on AUTOSAR tools, but AUTOSAR tools are expensive and not suitable for small and medium-sized enterprises. Summary of the invention

[0003] The main purpose of this application is to propose an AUTOSAR architecture diagnostic code generation method, device and medium, which can generate AUTOSAR architecture diagnostic code files through modeling without relying on AUTOSAR tools, thereby realizing AUTOSAR diagnostic functions in a lightweight manner.

[0004] To achieve the above object, one aspect of the present application provides a method for generating diagnostic code for an AUTOSAR architecture, the method comprising: Acquire a diagnostic database required for configuring an AUTOSAR diagnostic system, wherein the diagnostic database records a plurality of diagnostic units and a logical relationship diagram formed therefrom; According to the logic relationship diagram, a register module is used in a Simulink application layer model to generate a plurality of diagnostic registers corresponding to the plurality of diagnostic units; Performing parameter configuration on the plurality of diagnostic registers to generate a diagnostic database configuration file; Generate a diagnostic global manager in the Simulink application layer model, the diagnostic global manager is used to manage the behavior of the AUTOSAR diagnostic system, and then configure parameters of the diagnostic global manager to generate a diagnostic global configuration file; The diagnostic database configuration file and the diagnostic global configuration file are integrated to obtain an AUTOSAR architecture diagnostic code file corresponding to the AUTOSAR diagnostic system.

[0005] Furthermore, the step of configuring parameters of the plurality of diagnostic registers to generate a diagnostic database configuration file includes: Classifying the plurality of diagnostic registers to obtain a plurality of diagnostic register sets; For each of the diagnostic register sets, generating a first configuration structure corresponding to the diagnostic register set, assigning a value to the first configuration structure using the diagnostic register set, and then generating a first configuration code file corresponding to the diagnostic register set using the assigned first configuration structure; The plurality of first configuration code files corresponding to the plurality of diagnosis register sets are integrated to obtain the diagnosis database configuration file.

[0006] Further, the assigning of the first configuration structure by using the diagnostic register set includes: For each diagnostic register included in the diagnostic register set, in response to a user clicking operation on the diagnostic register, displaying a first configuration interface corresponding to the diagnostic register; The configuration parameter value related to the diagnostic register input by the user on the first configuration interface is received to assign values ​​to members associated with the diagnostic register contained in the first configuration structure.

[0007] Further, the configuring parameters of the diagnosis global manager to generate a diagnosis global configuration file includes: In response to a user clicking operation on the diagnosis global manager, displaying a second configuration interface corresponding to the diagnosis global manager; The global attribute parameter value related to the behavior of the AUTOSAR diagnostic system input by the user on the second configuration interface is received to generate the diagnostic global configuration file.

[0008] Furthermore, the method further comprises: Construct the interactive relationship between the Simulink application layer model and the underlying AUTOSAR software.

[0009] Furthermore, the construction of the interactive relationship between the Simulink application layer model and the underlying AUTOSAR software includes: A callback module is used in the Simulink application layer model to configure a first standard interface, wherein the first standard interface is used to allow the underlying AUTOSAR software to call a functional service provided by the Simulink application layer model; A service module is used in the Simulink application layer model to configure a second standard interface, where the second standard interface is used to allow the Simulink application layer model to call the AUTOSAR basic diagnosis service provided by the underlying AUTOSAR software.

[0010] Further, the configuration of the first standard interface using a callback module in the Simulink application layer model includes: According to preset AUTOSAR specification information, multiple API interfaces and input parameter types and return parameter types of each of the API interfaces are determined, and each of the API interfaces is used as a first standard interface; According to the multiple API interfaces and the input parameter type and return parameter type of each of the API interfaces, a callback module is used in the Simulink application layer model to generate multiple callback triggers corresponding to the multiple API interfaces; For each callback trigger corresponding to the API interface, a second configuration structure corresponding to the callback trigger is generated, and then a function call subsystem connected to the callback trigger is configured in the Simulink application layer model. Subsequently, a model function is constructed using the connection relationship between the callback trigger and the function call subsystem, and a value is assigned to the second configuration structure.

[0011] Furthermore, the configuration of the second standard interface using a service module in the Simulink application layer model includes: According to preset AUTOSAR specification information, determine multiple AUTOSAR interfaces and input parameter types, return parameter types and interface function names of each of the AUTOSAR interfaces, and use each of the AUTOSAR interfaces as a second standard interface; According to the multiple AUTOSAR interfaces and the input parameter type, return parameter type and interface function name of each of the AUTOSAR interfaces, a service module is used in the Simulink application layer model to generate multiple interface servers corresponding to the multiple AUTOSAR interfaces, and the interface server corresponding to each of the AUTOSAR interfaces is used to directly call the AUTOSAR standard service function.

[0012] To achieve the above objective, another aspect of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above method when executing the computer program.

[0013] To achieve the above objective, another aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0014] The present application includes at least the following beneficial effects: by generating a plurality of diagnostic registrars in a Simulink application layer model based on configuring a diagnostic database required by an AUTOSAR diagnostic system and adopting a registrar module, and generating a diagnostic global manager for managing the behavior of the AUTOSAR diagnostic system in a Simulink application layer model, and then configuring parameters of the plurality of diagnostic registrars and the diagnostic global manager to further generate an AUTOSAR architecture diagnostic code file corresponding to the AUTOSAR diagnostic system, the AUTOSAR diagnostic function can be lightweight implemented through modeling without relying on AUTOSAR tools. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flowchart of a method for generating diagnostic code for an AUTOSAR architecture provided in an embodiment of the present application; Figure 2 is a schematic diagram of a logical relationship formed by a plurality of diagnostic units provided in an embodiment of the present application; Figure 3 is a schematic diagram of several diagnostic registers provided in an embodiment of the present application; Figure 4 It is a schematic diagram of the configuration effect of the extended data record register provided in an embodiment of the present application; Figure 5 It is a schematic diagram of the configuration effect of the data register provided in the embodiment of the present application; Figure 6 It is a schematic diagram of the configuration effect of the diagnostic global manager provided in an embodiment of the present application; Figure 7 is a schematic diagram of at least eight callback triggers provided in an embodiment of the present application; Figure 8 It is a schematic diagram of the configuration effect of the callback trigger corresponding to the Event Data Changed interface provided in an embodiment of the present application; Fig. 9 is a schematic diagram of at least four interface servers provided in an embodiment of the present application; Fig.10 It is a schematic diagram of the configuration effect of the interface server corresponding to the Set Event Status interface provided in an embodiment of the present application; Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of systems and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0017] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0018] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0020] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations: AUTOSAR (Automotive Open System Architecture) is a collaborative development framework for automotive electronic systems jointly participated by global automobile manufacturers, parts suppliers, various automotive research institutions and various automotive service agencies. It aims to establish an open standard software architecture for automotive controllers and improve the reusability and interchangeability of software modules of various components.

[0021] In the model-based development under the AUTOSAR architecture, the diagnostic function will be used in the modeling process, that is, the diagnostic event management module (DEM) and the functional inhibition management module (FiM) of the AUTOSAR architecture will be directly called in the application layer, which requires the diagnostic system to be pre-configured according to the modeling requirements. Usually, the AUTOSAR tool is relied on to generate the diagnostic code file, but the AUTOSAR tool is expensive and not conducive to the use of small and medium-sized enterprises. In addition, this implementation method will also have the following disadvantages: the integration between the AUTOSAR software and the model code is relatively complex, which makes the configuration of the AUTOSAR diagnostic system inefficient; the configuration method of the AUTOSAR software is difficult to adapt to the requirements of rapid iteration and frequent changes proposed by model-based development.

[0022] In view of this, an embodiment of the present application provides an AUTOSAR architecture diagnostic code generation method, device and medium. The solution generates a plurality of diagnostic registers in a Simulink application layer model based on configuring a diagnostic database required by the AUTOSAR diagnostic system and using a register module, and generates a diagnostic global manager for managing the behavior of the AUTOSAR diagnostic system in the Simulink application layer model, and then further generates an AUTOSAR architecture diagnostic code file corresponding to the AUTOSAR diagnostic system by configuring parameters of the plurality of diagnostic registers and the diagnostic global manager. This solution can realize the AUTOSAR diagnostic function in a lightweight manner through modeling without relying on AUTOSAR tools.

[0023] The embodiment of the present application provides a method for generating AUTOSAR architecture diagnostic code, which relates to the field of computer technology and can be applied to a terminal or a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a vehicle-mounted terminal, etc., but is not limited thereto; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, and the server can also be a node server in a blockchain network; the software can be an application that implements the above-mentioned AUTOSAR architecture diagnostic code generation method, etc., but is not limited to the above forms.

[0024] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, systems using microprocessors, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0025] Figure 1 is an optional flow chart of a method for generating AUTOSAR architecture diagnostic code provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105: Step S101, obtaining a diagnostic database required for configuring an AUTOSAR diagnostic system, the diagnostic database recording a number of diagnostic units and a logical relationship diagram formed therefrom; Step S102: according to the logic relationship diagram, a register module is used in the Simulink application layer model to generate a plurality of diagnostic registers corresponding to a plurality of diagnostic units; Step S103, performing parameter configuration on a plurality of diagnostic registers to generate a diagnostic database configuration file; Step S104, generating a diagnosis global manager in the Simulink application layer model, and then performing parameter configuration on the diagnosis global manager to generate a diagnosis global configuration file; Step S105 : Integrate the diagnosis database configuration file and the diagnosis global configuration file to obtain an AUTOSAR architecture diagnosis code file corresponding to the AUTOSAR diagnosis system.

[0026] Steps S101 to S105 shown in the embodiment of the present application can generate an AUTOSAR architecture diagnostic code file by performing reasonable modeling in a Simulink application layer model without relying on the AUTOSAR tool, thereby realizing the AUTOSAR diagnostic function in a lightweight manner.

[0027] In step S101 of some embodiments, the several diagnostic units recorded in the diagnostic database include at least one component, at least one event, at least one function identifier (FID), at least one operation cycle, at least one diagnostic trouble code (DTC), at least one freeze frame, at least one extended data, at least one extended data record, at least one data identifier (DID) and at least one data.

[0028] In step S101 of some embodiments, the logic relationship diagram is mainly used to represent the logic relationship between a plurality of diagnosis units, wherein the logic relationship between different types of diagnosis units at least includes the following: A component is associated with at least one event, and a connection line is formed from the event to the component; A function identifier (FID) is associated with a component or at least one event, and a connection line is formed from the function identifier (FID) to the component, or a connection line is formed from the function identifier (FID) to the event; A diagnostic trouble code (DTC) is associated with at least one event, and a connection line is formed from the event to the diagnostic trouble code (DTC); An event is associated with an operation cycle, and a connection line is formed from the event to the operation cycle; A diagnostic trouble code (DTC) is associated with an operating cycle, and a connection line is formed from the diagnostic trouble code (DTC) to the operating cycle; A diagnostic trouble code (DTC) is associated with at most one freeze frame and at most one extended data, that is, a diagnostic trouble code (DTC) is associated with one freeze frame, or a diagnostic trouble code (DTC) is associated with one extended data, or a diagnostic trouble code (DTC) is associated with both a freeze frame and an extended data, and a connection line is formed from the diagnostic trouble code (DTC) to the freeze frame, and / or a connection line is formed from the diagnostic trouble code (DTC) to the extended data; A freeze frame is associated with at least one data identifier (DID), and a connection line is formed from the freeze frame to the data identifier (DID); One extended data is associated with at least one extended data record, and a connection line is formed from the extended data to the extended data record; A data identifier (DID) is associated with at least one data, and a connection line is formed from the data identifier (DID) to the data; An extended data record is associated with at least one data, and a connection line is formed from the extended data record to the data; It should be noted that an operation cycle can be associated with an event and a diagnostic trouble code (DTC) at the same time, and a data can be associated with a data identifier (DID) and an extended data record at the same time.

[0029] For example, when the AUTOSAR diagnostic system is applied in a vehicle tire diagnosis scenario, see Figure 2 As shown, the diagnostic units recorded in the diagnostic database include a component (representing a tire), two events (representing abnormal tire diameter and low tire pressure respectively), a FID (representing tire function degradation), an operation cycle (representing an ignition cycle), a DTC (representing 0x407700), a freeze frame, an extended data, an extended data record (representing number 2), two DIDs (representing 0x1000 and 0x1001 respectively) and four data (representing tire pressure sensor measurement value, temperature, DTC aging count and event ID respectively); the following is for Figure 2 Explain the logical relationship between some diagnostic units in: When a tire (component) fails, tire function degradation (FID) will be activated; when the vehicle is in an ignition cycle (operating cycle), the occurrence of low tire pressure (event) is valid and 0x407700 (DTC) can age; when low tire pressure (event) occurs, it is necessary to record the fault information 0x407700 (DTC), that is, it is necessary to record the freeze frame and extended data. The freeze frame represents the instantaneous information when the fault occurs, and the extended data represents the supplementary information of the fault. The freeze frame contains 0x1000 (DID) for recording the tire pressure sensor measurement value (data) and 0x1001 (DID) for recording the temperature (data). The extended data contains an extended data record for recording the DTC aging count (data) and the event ID (data), and its number is 2.

[0030] In step S102 of some embodiments, a diagnostic register corresponding to each diagnostic unit is generated by using a register module in a Simulink application layer model. The register module is an S-function module in the Simulink software, which can be understood as a custom function module with multiple configuration parameters built in. The rule for generating a code file by the S-function module is written by the user based on TLC (Target Language Compiler). The several diagnostic registers generated for the several diagnostic units include at least one component register, at least one event register, at least one FID register, at least one operation cycle register, at least one DTC register, at least one freeze frame register, at least one extended data register, at least one extended data record register, at least one DID register and at least one data register, see Figure 3 shown.

[0031] In some embodiments, the implementation of the above-mentioned step S102 may include but is not limited to: for every two diagnostic units that are associated with each other recorded in the logical relationship diagram, according to the directed connection line formed between the two diagnostic units, the diagnostic unit at the end point of the directed connection line is recorded as the first diagnostic unit, and the diagnostic unit at the starting point of the directed connection line is recorded as the second diagnostic unit, and a register module is used in the Simulink application layer model to first generate a first diagnostic register corresponding to the first diagnostic unit, and then generate a second diagnostic register corresponding to the second diagnostic unit, and the first diagnostic register and the second diagnostic register are associated.

[0032] For example, if the diagnostic database records an extended data record and its associated three data, the register module is used in the Simulink application layer model to first generate three data registers corresponding to the three data, then generate an extended data register corresponding to the extended data record, and associate the extended data register with the three data registers.

[0033] It should be noted that this application does not require the order in which multiple diagnostic registers corresponding to multiple diagnostic units that are not associated are generated. For example, if there is no association between a component and an operation cycle, the component register corresponding to the component can be generated first, and then the operation cycle register corresponding to the operation cycle can be generated, or the operation cycle register corresponding to the operation cycle can be generated first, and then the component register corresponding to the component can be generated. This application does not limit this.

[0034] In some embodiments, the core of configuring the AUTOSAR diagnostic system is to configure the diagnostic database. The above step S103 may include but is not limited to steps S201 to S203: Step S201: classify a plurality of diagnosis registers corresponding to a plurality of diagnosis units to obtain a plurality of diagnosis register sets.

[0035] In this step, all the diagnosis registers corresponding to all the diagnosis units belonging to the same category are grouped together to form a diagnosis register set.

[0036] Exemplarily, when several diagnostic units include a component and three events, and the three events represent different contents, the component registrar corresponding to the component forms a component registrar set, and the three event registrars corresponding to the three events form an event registrar set.

[0037] Step S202: for each diagnostic register set, generate a first configuration structure corresponding to the diagnostic register set, assign values ​​to the first configuration structure using the diagnostic register set, and then generate a first configuration code file corresponding to the diagnostic register set using the assigned first configuration structure.

[0038] In this step, when the number of all diagnostic registers contained in the diagnostic register set is N, a first configuration structure with a length of N is generated, each diagnostic register contained in the diagnostic register set is used as a member of the first configuration structure, and the index of each diagnostic register contained in the diagnostic register set in the first configuration structure is automatically generated in the form of a macro definition.

[0039] In this step, the first configuration structure is assigned using the diagnostic register set, which is specifically manifested as follows: for each diagnostic register included in the diagnostic register set, in response to a user's click operation on the diagnostic register, the first configuration interface corresponding to the diagnostic register is displayed; the configuration parameter value related to the diagnostic register entered by the user on the first configuration interface is received to assign values ​​to the members associated with the diagnostic register contained in the first configuration structure.

[0040] For example, for any extended data record register included in the extended data record register set, see Figure 4 As shown, by double-clicking the extended data record register, the user can display the first configuration interface corresponding to the extended data record register; by inputting relevant configuration parameter values ​​such as the data record name, data record number and data source on the first configuration interface, the user can synchronously assign values ​​to the members associated with the extended data record register contained in the first configuration structure corresponding to the extended data record register set.

[0041] It should be noted that see Figure 4It can be seen that some members in the first configuration structure corresponding to the extended data record register set do not appear on the first configuration interface corresponding to the extended data record register, that is, they cannot be configured through the extended data record register. These members will automatically adopt preset values ​​when the model generates code. In addition, the present application allows the first configuration interface corresponding to the extended data record register to select preset related configuration information from an external database, and also allows the deletion of some configuration parameter options on the first configuration interface corresponding to the extended data record register to reduce the workload of user configuration, and also allows the addition of some configuration parameter options on the first configuration interface corresponding to the extended data record register to increase the freedom of user configuration.

[0042] Exemplarily, for any data register included in the data register set, since the data can be selected from the underlying AUTOSAR software or the Simulink application layer model, when the data is selected from the Simulink application layer model, in this particular case, the data register will need to set an input interface to obtain specific data from the Simulink application layer model, that is, the data register will additionally generate a function and write the entry of the function into the first configuration structure corresponding to the data register set, see Figure 5 shown.

[0043] Step S203: Integrate multiple first configuration code files corresponding to multiple diagnosis register sets to obtain a diagnosis database configuration file.

[0044] In steps S201 to S203 shown in the embodiment of the present application, by developing a model based on Simulink software, the register module, which is an S-function module, is selected to generate relevant diagnostic registers, and then the structure assignment is completed with the help of the configuration interface provided by the relevant diagnostic register to further complete the generation of the code file, so as to realize the orderly and reasonable construction of the diagnostic event management module in the AUTOSAR architecture.

[0045] In step S104 of some embodiments, the diagnostic global manager is mainly used to manage the behavior of the AUTOSAR diagnostic system, and configure parameters of the diagnostic global manager to generate a diagnostic global configuration file. The corresponding implementation method may but is not limited to include: in response to a user's click operation on the diagnostic global manager, displaying a second configuration interface corresponding to the diagnostic global manager; receiving a global attribute parameter value related to the behavior of the AUTOSAR diagnostic system input by the user on the second configuration interface to generate a diagnostic global configuration file.

[0046] Specifically, see Figure 6As shown, by double-clicking the diagnostic global manager, the second configuration interface corresponding to the diagnostic global manager can be displayed; by the user inputting relevant global attribute parameter values ​​such as the error counter increase step, error counter decrease step, error counter pass threshold, error counter failure threshold, maximum event storage number and freeze frame record counting method on the second configuration interface, a diagnostic global configuration file is automatically generated.

[0047] It should be noted that although the diagnostic global manager is presented in the form of a module, it essentially changes the Simulink model configuration parameters, that is, maps the options in the Simulink model configuration parameters to the diagnostic global manager. This application allows the required global attribute parameter options to be adjusted on the second configuration interface corresponding to the diagnostic global manager.

[0048] By developing the model based on Simulink software and using the configuration interface provided by the diagnostic global manager to complete parameter assignment after generating the code file, the orderly and reasonable construction of the functional inhibition management module in the AUTOSAR architecture can be achieved.

[0049] In some embodiments, after completing the configuration of the AUTOSAR diagnostic system in the Simulink application layer model by executing the above steps S101 to S105, it is also necessary to build an interactive relationship between the Simulink application layer model and the underlying AUTOSAR software so that the AUTOSAR diagnostic function can be fully implemented in the Simulink application layer model, which is specifically manifested as follows: First, a callback module is used in the Simulink application layer model to configure the first standard interface, which is the interface for the underlying AUTOSAR software to access the Simulink application layer model. The called code belongs to the Simulink application layer model and is mainly used to allow the underlying AUTOSAR software to call the functional services provided by the Simulink application layer model.

[0050] Exemplarily, regarding the application scenario of the first standard interface: when the underlying AUTOSAR software detects a change in the UDS (Unified Diagnostic Services) status bit, it needs to notify the Simulink application layer model through the first standard interface so that it can call the corresponding control strategy to handle the change.

[0051] Secondly, a service module is used in the Simulink application layer model to configure the second standard interface. The second standard interface is the interface for the Simulink application layer model to access the underlying AUTOSAR software. The called code belongs to the underlying AUTOSAR software and is mainly used to allow the Simulink application layer model to call the AUTOSAR basic diagnostic service provided by the underlying AUTOSAR software.

[0052] Exemplarily, regarding the application scenario of the second standard interface: the Simulink application layer model can regularly report the test results of certain monitors to the underlying AUTOSAR software through the second standard interface.

[0053] In some embodiments, for configuring the first standard interface using a callback module in the Simulink application layer model, the corresponding implementation may include but is not limited to steps S301 to S303: Step S301: According to preset AUTOSAR specification information, multiple API interfaces (Application Programming Interface) and input parameter types and return parameter types of each API interface are determined, and each API interface is defined as a first standard interface.

[0054] It should be noted that the input parameter type and return parameter type of each API interface are clearly defined in the AUTOSAR specification information in the form of C language.

[0055] Step S302: According to multiple API interfaces and the input parameter type and return parameter type of each API interface, a callback module is used in the Simulink application layer model to generate multiple callback triggers corresponding to the multiple API interfaces; wherein the callback module is also an S function module in the Simulink software.

[0056] For example, in the existing AUTOSAR specification R23-11 version file, the specification part of the diagnostic event management module of the AUTOSAR architecture has defined at least eight API interfaces, see Figure 7 As shown, eight callback triggers corresponding to the eight API interfaces are generated by using a callback module in the Simulink application layer model, as described below: Clear Event Allowed interface, the input parameter type is empty, the return parameter type includes the Allowed parameter and the StdRet parameter, and the generated callback trigger is recorded as Clear Event Allowed Callback; Event Data Changed interface, the input parameter type is Eventld parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Event Data Changed Callback; Event UDS Status Changed interface, the input parameter types include OldStatus parameter and NewStatus parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Event UDS Status ChangedCallback; Monitor Status Changed interface, the input parameter type is empty, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Monitor Status Changed Callback; Init Monitor ForEvent interface, the input parameter type is InitReason parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Init Monitor ForEvent Callback; Component Failed interface, the input parameter type is Componentld parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Component Failed Callback; DTC Status Changed interface, the input parameter types include DTC parameter, OldStatus parameter and NewStatus parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as DTC Status ChangedCallback; Clear DTC Notification interface, the input parameter types include DTC parameter, DtcFormat parameter and DtcOrigin parameter, the return parameter type is StdRet parameter, and the generated callback trigger is recorded as Clear DTCNotification Callback.

[0057] It should be noted that, in general, for each API interface and its corresponding callback trigger, the input parameter of the API interface is actually the output port of the callback trigger, so that the underlying AUTOSAR software passes the corresponding API parameters to the Simulink application layer model; the input port of the callback trigger is actually the return result of the API interface, so that the Simulink application layer model returns the corresponding function execution result to the underlying AUTOSAR software.

[0058] Step S303: for each callback trigger corresponding to the API interface, generate a second configuration structure corresponding to the callback trigger, then configure a function call subsystem connected to the callback trigger in the Simulink application layer model, then use the connection relationship between the callback trigger and the function call subsystem to build a model function, and assign a value to the second configuration structure; wherein, the function call subsystem (Function-Call Subsystem) is a module that comes with the Simulink software, and the input and output parameters of the function call subsystem generally meet the usage requirements of the callback trigger to which it is connected.

[0059] For example, for the callback trigger corresponding to the Event Data Changed interface, see Figure 8 As shown, by configuring a function call subsystem connected to the callback trigger in the Simulink application layer model, the function() port of the function call subsystem is connected to the Fcn port of the callback trigger, the Eventld port of the function call subsystem is connected to the Eventld port of the callback trigger, and the StdRet port of the function call subsystem is connected to the StdRet port of the callback trigger, and these connection relationships are used to construct the model function corresponding to the callback trigger. At the same time, the user double-clicks the callback trigger to display the third configuration interface corresponding to the callback trigger, and then the user at least enters the function name on the third configuration interface to synchronously assign the second configuration structure.

[0060] In steps S301 to S303 shown in the embodiment of the present application, by developing a model based on Simulink software, a callback module, which is an S-function module, is selected to generate relevant callback triggers, and then the corresponding function call subsystem is configured to connect the relevant callback triggers, so as to realize the function call between the underlying AUTOSAR software and the Simulink application layer model.

[0061] In some embodiments, for configuring the second standard interface using a service module in the Simulink application layer model, the corresponding implementation may include but is not limited to steps S401 to S402: Step S401: According to preset AUTOSAR specification information, multiple AUTOSAR interfaces and input parameter types, return parameter types and interface function names of each AUTOSAR interface are determined, and each AUTOSAR interface is defined as a second standard interface.

[0062] It should be noted that the input parameter type, return parameter type and interface function name of each AUTOSAR interface have clear definitions of syntax and semantics in the AUTOSAR specification information.

[0063] Step S402: According to the multiple AUTOSAR interfaces and the input parameter type, return parameter type and interface function name of each AUTOSAR interface, a service module is used in the Simulink application layer model to generate multiple interface servers corresponding to the multiple AUTOSAR interfaces, and the interface server corresponding to each AUTOSAR interface is used to directly call the AUTOSAR standard service function; wherein the service module is also an S function module in the Simulink software.

[0064] For example, in the existing AUTOSAR specification R23-11 version file, the specification part of the diagnostic event management module and the function inhibition management module of the AUTOSAR architecture has defined at least four AUTOSAR interfaces, which can meet most usage requirements, see Fig. 9 As shown, four interface servers corresponding to the four AUTOSAR interfaces are generated by using a callback module in the Simulink application layer model, as described below: Set Event Status interface, the input parameter types include EventId parameter and EventStatus parameter, the return parameter type is StdRet parameter, the interface function name is Dem_SetEventStatus, and the generated interface server is directly recorded as Set Event Status; Set Event Available interface, the input parameter types include EventId parameter and Available parameter, the return parameter type is StdRet parameter, the interface function name is Dem_SetEventAvailable, and the generated interface server is directly recorded as Set Event Available; Get Event UDS Status interface, the input parameter type is EventId parameter, the return parameter types include UdsStatus parameter and StdRet parameter, the interface function name is Dem_GetEventUdsStatus, and the generated interface server is directly recorded as Get Event UDS Status; Get Function Permission interface, the input parameter type is FID parameter, the return parameter types include Permission parameter and StdRet parameter, the interface function name is FiM_GetFunctionPermission, and the generated interface server is directly recorded as Get Function Permission; Among them, the Dem_SetEventStatus function, Dem_SetEventAvailable function, Dem_GetEventUdsStatus function and FiM_GetFunctionPermission function should all belong to the AUTOSAR standard service functions.

[0065] It should be noted that, in general, for the interface server corresponding to each AUTOSAR interface, the input port of the interface server is the input parameter of the AUTOSAR basic diagnostic service provided by the underlying AUTOSAR software, so that the Simulink application layer model passes the corresponding AUTOSAR parameters to the underlying AUTOSAR software; the output port of the interface server is the return result of the AUTOSAR basic diagnostic service provided by the underlying AUTOSAR software, so that the underlying AUTOSAR software returns the execution result of the AUTOSAR basic diagnostic service to the Simulink application layer model.

[0066] For example, for the interface server corresponding to the Set Event Status interface, the interface server is used to directly call the Dem_SetEventStatus function, and the input parameter types of the Dem_SetEventStatus function include an EventId parameter and an EventStatus parameter, see Fig.10 As shown, the EventStatus parameter of the Dem_SetEventStatus function corresponds to the input port of the interface server, and the return parameter of the Dem_SetEventStatus function corresponds to the output port of the interface server. Considering that the EventId parameter of the Dem_SetEventStatus function cannot be used as the input port of the interface server, the user double-clicks the interface server to display the fourth configuration interface corresponding to the interface server. The EventId parameter of the Dem_SetEventStatus function corresponds to the parameter item of selecting an event displayed on the fourth configuration interface. Because the EventId parameter is associated with the event, it needs to be associated with the event registrar in the form of a configuration interface.

[0067] In steps S401 to S402 shown in the embodiment of the present application, by developing a model based on Simulink software, a service module, which is an S-function module, is selected to generate a related interface server, thereby realizing service calls between the underlying AUTOSAR software and the Simulink application layer model.

[0068] The AUTOSAR architecture diagnostic code generation method proposed in the embodiment of the present application can realize the AUTOSAR diagnostic function in a lightweight way through modeling without relying on AUTOSAR tools. In addition, by integrating the diagnostic configuration content, diagnostic function interface and diagnostic service interface into the modeling process, the effective integration between the underlying AUTOSAR software and the Simulink application layer model can be achieved, and the diagnostic configuration content, diagnostic function interface and diagnostic service interface can be adaptively updated with the frequently changed model version to meet the requirements of rapid iteration and other requirements proposed by model-based development, thereby improving development work efficiency.

[0069] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned AUTOSAR architecture diagnostic code generation method when executing the computer program. The electronic device includes any intelligent terminal such as a tablet computer and a vehicle-mounted computer.

[0070] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0071] See also Fig.11 , Fig.11 The hardware structure of an electronic device according to another embodiment is shown, and the electronic device includes: The processor 501 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 502 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store an operating system and other application programs. When the technical solution provided in the embodiment of the present application is implemented by software or firmware, the relevant program code is stored in the memory 502, and the processor 501 calls and executes the technical solution provided in the embodiment of the present application; Input / output interface 503, used to implement information input and output; Communication interface 504, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 505 that transmits information between various components of the device (e.g., the processor 501, the memory 502, the input / output interface 503, and the communication interface 504); The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via the bus 505 .

[0072] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned AUTOSAR architecture diagnostic code generation method is implemented.

[0073] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0074] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0075] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0076] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0077] The system embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0078] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0079] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0080] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0081] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0082] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0083] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. With this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.

[0085] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for generating diagnostic code for an AUTOSAR architecture, characterized in that: The method comprises: Acquire a diagnostic database required for configuring an AUTOSAR diagnostic system, wherein the diagnostic database records a plurality of diagnostic units and a logical relationship diagram formed therefrom; According to the logic relationship diagram, a register module is used in a Simulink application layer model to generate a plurality of diagnostic registers corresponding to the plurality of diagnostic units; Performing parameter configuration on the plurality of diagnostic registers to generate a diagnostic database configuration file; Generate a diagnostic global manager in the Simulink application layer model, the diagnostic global manager is used to manage the behavior of the AUTOSAR diagnostic system, and then configure parameters of the diagnostic global manager to generate a diagnostic global configuration file; The diagnostic database configuration file and the diagnostic global configuration file are integrated to obtain an AUTOSAR architecture diagnostic code file corresponding to the AUTOSAR diagnostic system.

2. The AUTOSAR architecture diagnostic code generation method according to claim 1, characterized in that: The step of configuring parameters of the plurality of diagnostic registers to generate a diagnostic database configuration file includes: Classifying the plurality of diagnostic registers to obtain a plurality of diagnostic register sets; For each of the diagnostic register sets, generating a first configuration structure corresponding to the diagnostic register set, assigning a value to the first configuration structure using the diagnostic register set, and then generating a first configuration code file corresponding to the diagnostic register set using the assigned first configuration structure; The plurality of first configuration code files corresponding to the plurality of diagnosis register sets are integrated to obtain the diagnosis database configuration file.

3. The AUTOSAR architecture diagnostic code generation method according to claim 2, characterized in that: The assigning of the first configuration structure by using the diagnostic register set includes: For each diagnostic register included in the diagnostic register set, in response to a user clicking operation on the diagnostic register, displaying a first configuration interface corresponding to the diagnostic register; The configuration parameter value related to the diagnostic register input by the user on the first configuration interface is received to assign values ​​to members associated with the diagnostic register contained in the first configuration structure.

4. The AUTOSAR architecture diagnostic code generation method according to claim 1, characterized in that: The step of configuring parameters of the diagnosis global manager to generate a diagnosis global configuration file includes: In response to a user clicking operation on the diagnosis global manager, displaying a second configuration interface corresponding to the diagnosis global manager; The global attribute parameter value related to the behavior of the AUTOSAR diagnostic system input by the user on the second configuration interface is received to generate the diagnostic global configuration file.

5. The AUTOSAR architecture diagnostic code generation method according to claim 1, characterized in that: The method further comprises: Construct the interactive relationship between the Simulink application layer model and the underlying AUTOSAR software.

6. The AUTOSAR architecture diagnostic code generation method according to claim 5, characterized in that: The construction of the interactive relationship between the Simulink application layer model and the underlying AUTOSAR software includes: A callback module is used in the Simulink application layer model to configure a first standard interface, wherein the first standard interface is used to allow the underlying AUTOSAR software to call a functional service provided by the Simulink application layer model; A service module is used in the Simulink application layer model to configure a second standard interface, where the second standard interface is used to allow the Simulink application layer model to call the AUTOSAR basic diagnosis service provided by the underlying AUTOSAR software.

7. The AUTOSAR architecture diagnostic code generation method according to claim 6, characterized in that: The configuration of the first standard interface using a callback module in the Simulink application layer model includes: According to preset AUTOSAR specification information, multiple API interfaces and input parameter types and return parameter types of each of the API interfaces are determined, and each of the API interfaces is used as a first standard interface; According to the multiple API interfaces and the input parameter type and return parameter type of each of the API interfaces, a callback module is used in the Simulink application layer model to generate multiple callback triggers corresponding to the multiple API interfaces; For each callback trigger corresponding to the API interface, a second configuration structure corresponding to the callback trigger is generated, and then a function call subsystem connected to the callback trigger is configured in the Simulink application layer model. Subsequently, a model function is constructed using the connection relationship between the callback trigger and the function call subsystem, and a value is assigned to the second configuration structure.

8. The AUTOSAR architecture diagnostic code generation method according to claim 6, characterized in that: The configuration of the second standard interface using a service module in the Simulink application layer model includes: According to preset AUTOSAR specification information, determine multiple AUTOSAR interfaces and input parameter types, return parameter types and interface function names of each of the AUTOSAR interfaces, and use each of the AUTOSAR interfaces as a second standard interface; According to the multiple AUTOSAR interfaces and the input parameter type, return parameter type and interface function name of each of the AUTOSAR interfaces, a service module is used in the Simulink application layer model to generate multiple interface servers corresponding to the multiple AUTOSAR interfaces, and the interface server corresponding to each of the AUTOSAR interfaces is used to directly call the AUTOSAR standard service function.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method for converting UML (Unified Modeling Language) model into AUTOSAR software assembly model

    CN101794227A

  • Program configuration method, system and equipment based on AUTOSAR and medium

    CN114691234A

  • PCU diagnostic software architecture of power domain controller of hybrid vehicle and vehicle

    CN117008578A

Cited By

  • Fault monitoring code generation method and device, medium and program product

    CN121680835A