WO2022241589A1 - 控制器软件架构、控制器软件升级方法、控制器和装置 - Google Patents

控制器软件架构、控制器软件升级方法、控制器和装置 Download PDF

Info

Publication number
WO2022241589A1
WO2022241589A1 PCT/CN2021/093991 CN2021093991W WO2022241589A1 WO 2022241589 A1 WO2022241589 A1 WO 2022241589A1 CN 2021093991 W CN2021093991 W CN 2021093991W WO 2022241589 A1 WO2022241589 A1 WO 2022241589A1
Authority
WO
WIPO (PCT)
Prior art keywords
controller
configuration data
target
layer
global buffer
Prior art date
Application number
PCT/CN2021/093991
Other languages
English (en)
French (fr)
Inventor
张馨龙
李泉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202180006855.3A priority Critical patent/CN115623871A/zh
Priority to PCT/CN2021/093991 priority patent/WO2022241589A1/zh
Priority to EP21940048.8A priority patent/EP4336347A4/en
Publication of WO2022241589A1 publication Critical patent/WO2022241589A1/zh
Priority to US18/511,105 priority patent/US20240095016A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/545Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/542Intercept
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware

Definitions

  • This application relates to the field of information technology. More specifically, it relates to a software architecture, a method for upgrading software, and a method and device for running software.
  • the system for implementing electronic control functions in automobiles mainly includes electronic control components, for example, electronic control unit (ECU).
  • ECU electronice control unit
  • the ECU can control the auto parts based on the control information, and for another example, the ECU can process the data to be transmitted in the auto parts.
  • the underlying software architecture in the automotive field mostly adopts the automotive open system architecture (automotive open system architecture, AUTOSAR), automotive electronics open systems and corresponding interface standards (open systems and the corresponding interfaces for automotive electronics, OSEK) architecture or automotive distributed Implement standard (vehicle distributed executive, VDX) architecture.
  • These underlying software architectures have a set of frameworks that cover part of the chip, all hardware, all underlying software logic, and the business requirements of all application layers.
  • Such a large and comprehensive framework leads to a large number of configuration parameters.
  • the underlying software configuration parameters of an ECU reach tens of thousands, requiring a team of dozens to hundreds of people to develop. In short, the development threshold is high, and the testing workload is relatively large.
  • the development of these underlying software architectures requires the purchase of configuration tools. On the one hand, the configuration tool needs to be bound to the chip and compiler separately, resulting in poor reusability. On the other hand, this configuration tool is expensive.
  • Post-build loadable stores the configuration parameters that need to be changed in a flash memory (flash) area.
  • flash flash memory
  • Post-build selectable stores various configuration parameters that need to be changed in a flash area.
  • the ECU When the ECU is powered on (which can be understood as turning on the power supply), one of the configuration parameters in the flash area can be selected to be loaded according to the external situation. Before compiling the Post-build selectable, the changed configuration parameters need to be stored in the flash area. When the changed configuration parameters are not the configuration parameters stored in the flash area, all the code needs to be rewritten, which is less flexible.
  • XCP universal measurement and calibration protocol
  • XCP needs to fix the physical address of the configuration item.
  • the type and quantity of the configuration item cannot change.
  • the ECU is configured to support receiving 100 controller area network (CAN) signals when it leaves the factory, but it cannot be changed to receive 101 CAN signals through XCP.
  • CAN controller area network
  • the present application provides a controller software architecture, a controller software upgrade method, a controller and a device, which can realize the development of the controller.
  • a controller software architecture including: a driver layer, an interface layer, an application layer, and a global buffer, and the interface layer is used to exchange data through the global buffer and the application layer; The interface layer is also used for exchanging data through the global buffer and the driver layer.
  • the controller may include a controller developed based on a microcontroller unit (microcontroller unit, MCU) and using an operating system running on a read-only memory (read-only memory, ROM).
  • MCU microcontroller unit
  • ROM read-only memory
  • the controller can be applied in the field of automobiles.
  • the controller may include an ECU or a vehicle interface unit (vehicle interface unit, VIU) and the like.
  • the controller software architecture provided by the embodiment of the present application can realize the data exchange between the interface layer and the application and the data exchange between the interface layer and the driver layer through the global buffer, and then realize the work of controller development.
  • the interface layer is specifically configured to: the interface layer is configured to perform a first target operation according to a parameter value of a target signal; the interface layer, It is also used to cache the result of the first target operation in the global buffer according to the address stored in the global buffer by the target signal; the application layer is specifically used to: acquire the first The result of a target operation.
  • the parameter value of the target signal includes, but is not limited to: a collection period value, a channel number for transmission of the target signal, a collection mode of the target signal, and the like.
  • the sampling mode can be understood as information that needs to be collected.
  • the sampling mode may include collecting input frequency, collecting duty cycle, and collecting rising/falling edge data.
  • the target signal may be transmitted through ADC, ICU, DI, DO, DI, H-bridge, LIN, CAN, and/or ETH.
  • the first target operation may be collecting a target signal
  • the result of the first target operation may be the collected target signal
  • the interface layer executes the first target operation according to the parameter value of the target signal, and caches the result of the first target operation in the global buffer according to the address stored in the global buffer of the target signal. Then, the application layer obtains the result of the first target operation. Then realize the scheme that the interface layer writes the result of the first target operation into the global buffer, and the application layer reads the result of the first target operation from the global buffer, so that the controller can realize the corresponding function and complete the development of the controller work.
  • the interface layer is further configured to: read configuration data, where the configuration data includes the parameter value of the target signal and the target signal in the The address where the global buffer is stored.
  • the application layer is further specifically configured to: read the address of the target signal in the global buffer from the global buffer The result of the first target operation described above.
  • the application layer is further specifically configured to: read configuration data, where the configuration data includes the parameter value of the target signal and the value of the target signal in the The address where the global buffer is stored.
  • the application layer is specifically configured to: the application layer is configured to perform the first target operation according to a parameter value of the target signal; the application layer, It is also used to cache the result of the first target operation in the global buffer according to the address stored in the global buffer by the target signal; the interface layer is specifically used to: acquire the first target The result of a target operation.
  • the application layer executes the first target operation according to the parameter value of the target signal, and caches the result of the first target operation in the global buffer according to the address stored in the global buffer of the target signal. Then, the interface layer obtains the result of the first target operation. Furthermore, the application layer writes the result of the first target operation into the global buffer, and the interface layer reads the result of the first target operation from the global buffer, so that the controller can realize the corresponding function and complete the development of the controller work.
  • the application layer is further configured to: read configuration data, where the configuration data includes the parameter value of the target signal and the target signal in the The address where the global buffer is stored.
  • the interface layer is further specifically configured to: read the address of the target signal from the global buffer according to the address of the target signal in the global buffer The result of the first target operation described above.
  • the interface layer is further specifically configured to: read configuration data, where the configuration data includes the parameter value of the target signal and the value of the target signal in the The address where the global buffer is stored.
  • the interface layer is further configured to: execute a second target operation according to a result of the first target operation.
  • the result of the first target operation includes collecting a target signal, and the second target operation includes forwarding the target signal; or, the first target operation
  • the result of includes a target output value, the target output value is the changed output value of the target drive channel of the drive layer, and the second target operation includes changing the output value of the target drive channel to the target output value.
  • the controller software architecture further includes a flashing program layer, and the flashing program layer is used to: acquire machine codes; flash the machine codes to the storage memory of the controller to modify the configuration data.
  • the interface layer further includes a management plane function, and the management plane function is used to monitor the running status of the interface layer, so that the interface layer runs abnormally , causing the interface layer to take abnormal countermeasures.
  • the interface layer further includes an initialization function, where the initialization function is used to initialize communication parameters when the interface layer is running.
  • the application layer further includes a data surface function, and a behavior of the data surface function is determined by the configuration data.
  • the controller software architecture further includes a basic software layer BSW, and the interface layer is located in a communication service of the BSW.
  • a controller is provided, and the software architecture of the controller adopts the controller software architecture described in the first aspect or some implementation manners of the first aspect.
  • the controller includes a first memory, the first memory is the running memory of the controller, and the global buffer of the first memory is used for Cache data generated when the controller is running.
  • the controller includes a second memory, the second memory is a storage memory of the controller, and the second memory is used to store configuration data.
  • the controller provided by the embodiment of the present application does not need to improve the hardware of the controller, but only needs to write dozens of configuration data into the storage memory of the controller, so that the controller can directly read from the storage memory of the controller Configure the data, and according to the configuration data, read the operation data corresponding to the configuration data from the operation memory of the controller, so as to realize the development of the function of the controller. Therefore, the configuration data is reduced from hundreds to dozens, and the development of the controller can be completed, reducing the workload of controller development, reducing the development cost of the controller, and speeding up the development speed of the controller.
  • a method for upgrading controller software is provided.
  • Configuration data is stored in the storage memory of the controller, and the configuration data is data related to the function of the controller.
  • the method includes: reading The configuration data; according to the configuration data, perform an operation corresponding to the configuration data.
  • the configuration data includes a parameter value of the target signal and an address of the target signal stored in the controller.
  • the reading the configuration data includes: reading the configuration data when the controller is started or restarted.
  • the configuration data is read, that is, the configuration data is loaded each time the controller is started, and then the configuration data is dynamically loaded.
  • a method for upgrading controller software comprising: acquiring configuration data, the configuration data being related to the functions of the controller; generating machine codes according to the configuration data, the machine code for the controller upgrade.
  • the upgrade of the controller is realized by obtaining the configuration data related to the function of the controller and generating the machine code.
  • the method further includes: flashing the machine code into a storage memory of the controller.
  • the acquiring configuration data includes: acquiring a user instruction, and the user instruction is used to indicate at least one of the following: adding one or more of the configuration data, deleting one or more of the configuration data, modify one or more of the configuration data.
  • the acquiring the user instruction includes: acquiring the user instruction according to a user's operation on a software human-computer interaction interface.
  • a storage method comprising: dividing the storage area of the second storage into N storage areas, where N is a positive integer greater than or equal to; generating at least one link file, and the at least A connection file is used to identify the N storage areas; obtain N groups of configuration data; store the N groups of configuration data in the N storage areas respectively; generate the target machine code according to the at least one link file, The at least one link file is used to identify the N storage areas.
  • the storage area of the second memory is divided into storage areas with the same number as the number of configuration data groups, and a group of configuration data is stored in each storage area. It is also possible to generate at least one link file identifying the N storage areas, so that the address and size of each storage area in the corresponding storage area are fixed, so that the configuration data can be obtained only through the link file.
  • the storage method further includes: determining that the n-th storage sub-area in the N storage areas includes unused storage space; filling it with specific characters The unused storage space.
  • the unfulfilled storage space in the storage area of the second memory is filled with specific characters, thereby preventing stack overflow.
  • a device for upgrading a controller configured to upgrade a controller.
  • Configuration data is stored in the storage memory of the controller, and the configuration data is data related to the function of the controller.
  • the device includes: a reading unit, for reading the configuration data; and a processing unit for executing an operation corresponding to the configuration data according to the configuration data.
  • the configuration data includes a parameter value of the target signal and an address of the target signal stored in the controller.
  • the reading unit is specifically configured to: read the configuration data when the controller is started or restarted.
  • a controller upgrade device the device includes: an acquisition unit, configured to acquire configuration data, the configuration data is related to the functions of the controller; a processing unit, configured to generate machine code for the controller upgrade.
  • the device further includes: a flashing unit, configured to flash the machine code into the storage memory of the controller.
  • the acquiring unit is specifically configured to: acquire a user instruction, where the user instruction is used to indicate at least one of the following: add one or more of the configuration data 1. Deleting one or more configuration data, modifying one or more configuration data.
  • the acquiring unit is further specifically configured to: acquire the user instruction according to the user's operation on the software human-computer interaction interface.
  • a readable storage medium wherein a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed, the third aspect or certain implementations of the third aspect are realized Any one of the ways implements the method described in the ways.
  • a ninth aspect provides a readable storage medium, wherein the readable storage medium stores programs or instructions, and when the programs or instructions are executed, the fourth aspect or certain implementations of the fourth aspect are implemented Any one of the ways implements the method described in the ways.
  • a readable storage medium wherein a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed, the fifth aspect or some implementations of the fifth aspect are realized Any one of the ways implements the method described in the ways.
  • a device which is characterized by comprising at least one memory and at least one processor, the at least one memory is used to store a program, and the at least one processor is used to run the program, so as to realize the first
  • a software tool is provided, and the software tool is used to implement the method described in the fourth aspect or some implementation manners of the fourth aspect.
  • a vehicle including the controller described in the second aspect or some implementation manners of the second aspect.
  • a vehicle including the controller upgrading device described in the sixth aspect or some implementations of the sixth aspect or the seventh aspect or some implementations of the seventh aspect
  • a chip including at least one processor and an interface circuit, the interface circuit is used to provide program instructions or data for the at least one processor, and the at least one processor is used to execute the program Instructions to implement the third aspect or the method described in any of the implementations of the third aspect, or to achieve the fourth aspect or any of the implementations of the fourth aspect The method described above, or the method described in any of the implementation manners to achieve the fifth aspect or certain implementation manners of the fifth aspect.
  • Figure 1 is a schematic diagram of the underlying software architecture of AUTOSAR.
  • FIG. 2 is a schematic diagram of a storage area of a second memory provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a software architecture of a controller provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of an interface layer architecture provided by an embodiment of the present application.
  • Fig. 5 is a schematic diagram of an example application scenario provided by the embodiment of the present application.
  • Fig. 6 is a schematic diagram of another application scenario provided by the embodiment of the present application.
  • Fig. 7 is a schematic structural diagram of an example of a controller software upgrading device provided in an embodiment of the present application.
  • Fig. 8 is a schematic structural diagram of another example of a controller upgrading device provided by an embodiment of the present application.
  • FIG. 9 shows a schematic structural diagram of a controller upgrading device provided by an embodiment of the present application.
  • references to "one embodiment” or “some embodiments” and the like described in the embodiments of the present application mean that specific features, structures or characteristics described in connection with the embodiments are included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • the terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless specifically stated otherwise.
  • the software architecture of AUTOSAR includes Application Layer (Application Layer), Runtime Environment (Runtime Environment, RTE), and Basic Software Layer (Basic Software Layer, BSW).
  • BSW includes operating system (operation system, OS), system service (system), diagnostic service (Diagnostic), encryption service (crypto), memory management (memory), communication service (communication), controller area network protocol stack ( controller area network, CAN), local interconnect network protocol stack (local interconnect network, LIN), Ethernet protocol stack (ethernet, ETH), microcontroller abstraction layer (microcontroller abstraction layer, MCAL), complex device driver (complex device drivers, CDD) and the input and output hardware abstraction layer (loHwAb).
  • System modules include: Basic Software Mode Management (BswM), Communication Mode Management (ComM), Electronic Control Unit Mode Management (EcuM), Synchronous Time Base Management (StbM), Diagnostic Troubleshooting (Det), Watchdog Management (WdgM) and watchdog interface (WdgIf) (not shown in Figure 1).
  • BswM Basic Software Mode Management
  • ComM Communication Mode Management
  • EcuM Electronic Control Unit Mode Management
  • StbM Synchronous Time Base Management
  • Det Diagnostic Troubleshooting
  • Watchdog Management WdgM
  • WdgIf watchdog interface
  • the diagnostic module includes: a diagnostic communication module (Dcm), a diagnostic event management module (Dem), and a function limitation management (FiM) (not shown in FIG. 1 ).
  • Dcm diagnostic communication module
  • Dem diagnostic event management module
  • FAM function limitation management
  • Storage management includes: Electrically Erasable Programmable Memory Emulated Flash (Fee), Memory Management Interface (MemIf), Electrically Erasable Programmable Memory Abstraction Layer (Ea) and Non-Volatile Memory Management (NvM) (not shown in Figure 1 out).
  • the communication module includes: communication management (Com), big data communication management (LdCom), protocol data unit router (PduR), network management (Nm), interaction layer protocol data unit multiplexer (IpduM), end-to-end converter (E2eXf), Communication Converter (ComXf), Scalable Service-Oriented Internet Protocol-based Middleware Converter (SomeIpXf), Security for Vehicle Communications (SecOC), Universal Calibration Protocol (Xcp) and Scalable Service-Oriented Internet Protocol-based The middleware transport layer (SomeIpTp) (not shown in Figure 1).
  • CAN communication protocol stack includes CAN interface layer (CanIf), CAN network management module (CanNm), CAN state management module (CanSM), CAN transport layer module (CanTp) and CAN time synchronization module (CanTsyn) (not shown in Fig. 1 ).
  • CanIf CAN interface layer
  • CanNm CAN network management module
  • CanSM CAN state management module
  • CanTp CAN transport layer module
  • CanTsyn CAN time synchronization module
  • the LIN communication protocol stack includes: LIN interface layer (LinIf), LIN network management module (LinNm), LIN state management module (LinSM) and LIN transport layer module (LinTp) (not shown in Figure 1).
  • the Ethernet communication protocol stack includes: Ethernet interface layer (EthIf), socket adapter (SoAd), UDP (User Datagram Protocol) network management (UdpNm), IP (Internet Protocol) layer diagnostic protocol stack (DoIP), Ethernet state management (EthSM), service discovery module (Sd), Ethernet transport layer protocol stack (TcpIp) and Ethernet time synchronization module (EthTsyn) (not shown in FIG. 1 ).
  • MCAL is a driver software directly related to the hardware, which can drive the chip, provide a unified interface to the application layer, and decouple the application layer and the chip.
  • MCAL includes: analog-to-digital converter (Adc), general-purpose timer (Gpt), microcontroller core driver (Mcu), CAN controller driver (Can), digital input and output driver (Dio), flash memory driver (Fls) , Input Capture Unit (Icu), Serial Peripheral Interface (Spi), Chip Port Driver (Port), Pulse Width Modulation Module (Pwm), Ethernet Controller Driver (Eth) and LIN Controller Driver (Lin) ( Figure 1 not shown).
  • Adc analog-to-digital converter
  • Gpt general-purpose timer
  • Mcu microcontroller core driver
  • Can CAN controller driver
  • Dio digital input and output driver
  • Fls flash memory driver
  • Icu Input Capture Unit
  • Spi Serial Peripheral Interface
  • Pwm Chip Port Driver
  • CDD is a driver module for external devices on the microcontroller. CDD provides users with the possibility to write special device driver software by themselves. CDD includes: CAN bus transceiver (CanTrcv), LIN bus transceiver (LinTrcv), Ethernet router (EthSwt), Ethernet transceiver (EthTrcv), watchdog (Wdg), external electrically programmable memory (Eep ) and H bridge (H bridge) and high side/low side driver (HS/LS) (not shown in Figure 1).
  • the embodiment of the present application provides a controller, without improving the hardware of the controller, and without compiling or compiling (that is, without compiling), only dozens of configuration data need to be written to the storage memory of the controller
  • the controller can directly read the configuration data from the storage memory of the controller, and according to the configuration data, read the operation data corresponding to the configuration data from the operation memory of the controller, so as to realize the development of the function of the controller. Therefore, the configuration data is reduced from hundreds to dozens, and the development of the controller can be completed, reducing the workload of controller development, reducing the development cost of the controller, and speeding up the development speed of the controller.
  • the controller may be developed based on an MCU and use an operating system running on a read-only memory ROM.
  • the controller can be applied in the field of automobiles.
  • the controller may include an ECU or a vehicle integration unit (VIU).
  • VU vehicle integration unit
  • the controller provided in the embodiment of the present application includes a first memory and a second memory.
  • the first memory is the running memory of the controller.
  • the first memory may be a random access memory (random access memory, RAM).
  • the second storage is the storage memory of the controller.
  • the second memory may be a ROM.
  • the second memory may be flash memory.
  • the storage area of the second memory is divided into M storage areas.
  • corresponding configuration data may be flashed into the second memory according to user requirements.
  • the configuration data includes N types of configuration data
  • the N types of configuration data are stored in N storage areas of the M storage areas in the second memory, where M is greater than or equal to N.
  • the storage area of the second memory includes N storage areas, that is, the first storage sub-area, the second storage sub-area, . . . , the N-th storage sub-area.
  • the first storage sub-area stores the first configuration data
  • the second storage sub-area stores the second configuration data
  • the Nth storage sub-area stores the Nth configuration data, that is, the N storage sub-areas store respectively N kinds of configuration data.
  • the unfilled storage space in the storage area of the second memory may also be filled with specific characters. This prevents stack overflow.
  • the unused storage space of the first configuration data and the unused storage space of the second configuration data may be respectively filled with specific characters.
  • the specific character may be 0.
  • At least one link file identifying the M storage areas may also be generated. In this way, the address and size of each storage area in the corresponding storage area can be fixed, so that the configuration data can be obtained only by linking the file later.
  • FIG. 3 is a schematic diagram of the underlying software architecture of the controller provided by the embodiment of the present application.
  • the underlying software architecture is different from that of AUTOSAR in Figure 1.
  • some system modules such as the initialization sequence, can be fixed without According to the change of requirements, the configuration is solidified.
  • the content included in the communication service of the basic software layer is replaced by the interface layer.
  • the data-driven approach is different. When data driving is performed, the configuration data is no longer read from the configuration code, but the flashed configuration data in the second memory is read from the second memory.
  • the interface layer exchanges data with the driver layer and the application layer respectively.
  • the interface layer is between the application layer and the driver layer.
  • the driver layer includes digital-to-analog conversion (analog digital conversion, ADC) driver, input capture unit (input capture unit, ICU) driver, digital input (digital input, DI) driver, digital output (digital output, DO) driver, H Bridge (H bridge) HB driver, local interconnect network (local interconnect network, LIN) driver, controller area network (controller area network, CAN) driver, Ethernet (ethernet, ETH) driver.
  • ADC analog digital conversion
  • ICU input capture unit
  • DI digital input
  • DO digital output
  • H Bridge H bridge
  • HB local interconnect network
  • controller area network controller area network
  • Ethernet Ethernet
  • the interface layer provided by the embodiment of the present application includes a data plane function, a management plane function or an initialization function.
  • the data surface function can configure periodic tasks for the software. For example, on each core/process running the interface layer, configure 1 millisecond task, 10 millisecond task, 100 millisecond task and 1 second periodic task. Each task queries the data of ADC, ICU, DI, DO, HB, CAN/CANFD, LIN and Ethernet in the global buffer in turn to determine whether certain channels need to be manipulated.
  • the behavior of the data plane functions is defined by configuration data stored in the second memory.
  • the target configuration can be managed hierarchically.
  • the configuration data related to ADC, ICU, DI, DO, HB, CAN/CANFD or LIN can be divided into three levels, and the configuration data related to Ethernet can be divided into four levels.
  • the content specifically included in the configuration data can be referred to Table 1.
  • the configuration data shown in Table 1 is an example of configuration data related to the embodiment of the present application.
  • the embodiment of the present application does not limit the content specifically included in the configuration data.
  • the first-level configuration data includes the cycle type of the target signal; the second-level configuration data includes at least one of the following: the cycle of the target signal, the starting address of the target signal corresponding to the cycle in the third-level configuration data, and the number of target signals .
  • the type of cycle can be understood as the number of cycles. For example, if the period type is 3, and the periods include 10ms, 20ms and 50ms respectively, there are three periods for reading the target signal.
  • the third-level configuration data includes the target signal Channel number and/or address of the target signal in the global buffer.
  • the third-level configuration data includes at least one of the following: the channel number of the target signal, the sampling mode of the target signal, and the location of the target signal in the global buffer. address.
  • the sampling mode can be understood as information that needs to be collected.
  • the sampling mode may include collecting input frequency, collecting duty cycle, and collecting rising/falling edge data.
  • the third-level configuration data includes at least one of the following: the channel number for receiving the target signal; the target signal in CANFD
  • the ID in the message, the CAN message includes the target signal, and the CANFD message includes the target signal; the start bit of the target signal in the CAN/CANFD message; the bit length of the target signal; the address of the target signal in the global buffer;
  • a timeout threshold, the first timeout threshold is used to indicate the threshold at which the target signal is considered to be received overtime; the action after the target signal is received overtime; and the initial value of the target signal.
  • the initial value of the target signal can be understood as the initial value of the target signal when the controller is started or restarted (also referred to as just powered on).
  • the third-level configuration data includes at least one of the following items: address, the address of the target signal in the global buffer after grouping, the start bit of the target signal in the message carrying the target signal, the bit length of the target signal, and the big-endian and small-endian flag bits of the target signal.
  • the start bit of the target signal in the message carrying the target signal may be understood as the position or address of the target signal in the message carrying the target signal.
  • Little-endian refers to storing low-order bits at the starting address (low address), and big-endian stores high-order bits at the starting address (low address).
  • the third-level configuration data includes at least one of the following: the CAN channel and/or CANFD channel carried by the target signal, the ID of the target signal, the target The byte length of the signal, the starting address of the target signal in the global buffer.
  • the third-level configuration data includes at least one of the following: the channel number carried by the target signal, the PID of the LIN message carried by the target signal, the target signal The start bit in the LIN message, the bit length of the target signal, and the address of the target signal in the global buffer.
  • the third-level configuration data includes at least one of the following: the address of the global buffer before the target signal is packaged, and the address of the target signal after the package is packaged.
  • the third-level configuration data includes at least one of the following: the LIN channel carried by the target signal, the PID of the target signal, and the byte length of the target signal , The starting address of the target signal in the global buffer.
  • the third-level configuration data includes at least one of the following: the PDU ID of the Ethernet message carried by the target signal, the PDU ID contained in the Ethernet message, The starting position of the target signal in the fourth-level configuration data, the number of target signals; the fourth-level configuration data includes at least one of the following: the address of the target signal in the global buffer of the target device; the local (understandable) location of the target signal.
  • the embodiment of this application relates to the controller) global buffer address; the byte length of the target signal.
  • the address of the target signal in the global buffer of the target device can be understood as the address in the global buffer of the target device after the target signal is transmitted to the target device.
  • the levels of the first-level configuration data, the second-level configuration data, the third-level configuration data, and the fourth-level configuration data increase sequentially.
  • the content included in the configuration data can be divided into two categories: the first category is the address of the target signal stored in the global buffer.
  • the second category is the parameter value of the target signal.
  • the parameter value of the target signal may include the content in Table 1 except the address stored in the global buffer of the target signal.
  • the management surface function monitors the running status of the interface layer, so that when the interface layer runs abnormally, the interface layer can take abnormal countermeasures.
  • the management plane function judges whether the signal received through CAN/CANFD times out. If it times out, take abnormal countermeasures according to the action after the target signal reception timeout indicated in the third-level configuration data, so as to restore the normal operation of the interface layer. In addition, if the time to restore the data is indicated in the configuration data, the data can be restored at the corresponding time.
  • the management plane function can process the LIN schedule. For example, it is judged whether the schedule table is switched, and the LIN message is sent or received according to the configuration of the schedule table.
  • the initialization function is used to initialize the communication parameters when the interface layer is running.
  • the communication parameters may include baud rate and initial values of all signals.
  • the channels of all CAN controllers have been pre-set to support CAN FD, and several sets of commonly used CAN/CANFD baud rates have been pre-configured.
  • the initialization function can set the corresponding channels to CAN or CAN according to the configuration of the baud rate. CAN FD.
  • the initialization function includes setting the LIN baud rate and loading the schedule information into the global buffer.
  • the initialization function needs to read the configured MAC address, the IP addresses of the local device and the target device, and the port numbers of the local device and the target device, and Ethernet receives/sends packets based on this during runtime.
  • various layers included in the software architecture of the controller run on the second memory.
  • the generated data is cached in the first memory.
  • the software architecture includes interface layer, application layer, driver layer and global buffer.
  • the interface layer can exchange data with the application layer through the global buffer.
  • the interface layer can also exchange data with the driver layer through the global buffer. That is, it can be understood that the global buffer is the link between the interface layer and the application layer, and also the link between the interface layer and the driver layer.
  • the specific data exchange process may include the following steps S1 to S5. Each step is described in detail below.
  • the first layer may be an interface layer
  • the second layer may be an application layer
  • the first layer may be an application layer
  • the second layer may be an interface layer
  • the first layer reads configuration data.
  • Reading configuration data by the first layer can be understood as reading configuration data from the second memory by the first layer.
  • the first layer executes the first target operation according to the parameter value of the target signal.
  • the first target operation may be collecting target signals.
  • the first layer caches the result of the first target operation in the global buffer according to the address stored in the global buffer by the target signal.
  • the result of the first target operation may be a collected target signal.
  • the second layer can read the configuration data, and read the result of the first target operation from the global buffer according to the address of the target signal in the global buffer.
  • the user when the user needs to modify the functions of the controller, that is, when the controller software needs to be upgraded, the user can, for example, input user instructions through the operation of the human interaction interface of the software (target software described below), and the user The instruction is used to indicate at least one of the following: adding one or more configuration data, deleting one or more configuration data, or modifying one or more configuration data.
  • the software can generate machine codes according to the configuration data indicated by user instructions.
  • the flashing program layer of the controller can flash the machine code into the second memory, so as to modify the configuration data in the controller.
  • the controller If the controller is started (powered on), and the user changes the control function, that is, the configuration data in the second memory is changed, in a possible implementation, the controller needs to be restarted to make the controller again Read the configuration data in the second memory. If the controller is not started (not powered on), the user changes the function of the controller, that is, the configuration data in the second memory is changed, in a possible implementation, only when using the controller start the controller at that time. That is, it can be understood that, in a possible implementation manner, the controller will only read the configuration data stored in the second memory every time it is started or restarted (power-on).
  • the user may add one or more configuration data in the second memory, delete one or more configuration data in the second memory, and/or modify one or more configuration data in the second memory.
  • the interface layer may also perform a second target operation according to the result of the first target operation.
  • the second target operation may be to forward the target signal.
  • the underlying software architecture provided by the embodiment of this application is consistent with the behavior of the original AUTOSAR from the perspective of the application layer, that is, the same output can be obtained at the same input, allowing the application layer to seamlessly switch from the original AUTOSAR architecture to this application
  • the software architecture provided by the embodiment In the following, the operation process of each layer in the software architecture of the controller provided by the embodiment of the present application (the controller is applied in the automotive field) will be introduced in combination with different application scenarios.
  • the tasks mentioned below may include periodic tasks or event tasks.
  • the first layer is the interface layer as shown in FIG. 4
  • the second layer is the application layer as shown in FIG. 4 .
  • the operation process of each layer in the software architecture of the controller can be divided into two processes: first, the interface layer first writes data into the global buffer; second, the application layer needs to read the data written by the interface layer from the global buffer. data.
  • the ADC task may be, for example, collecting brake input values through an ADC channel.
  • the interface layer needs to write the ADC task into the global buffer.
  • the application layer needs to read the ADC task written by the interface layer from the global buffer.
  • the interface layer can read from the second memory the cycle of braking input value acquisition, the channel number of braking input value acquisition and the address stored in the global buffer after the braking input value acquisition (an example of configuration data),
  • the brake input value is collected through the ADC channel (the channel corresponding to the corresponding ADC driver of the driver layer) (executing the first target An example of the operation), and according to the address stored in the global buffer after the brake input value is collected, the collected brake input value (an example of the result of the first target operation) is cached in the global buffer area, that is, the interface layer implementation will collect
  • the brake input value of (an example for the result of the first target operation) is written into the global buffer (arrow 1 shown in FIG.
  • the application layer can read the address stored in the global buffer after the brake input value is collected from the second memory, and read the collected brake input from the global buffer according to the address stored in the global buffer after the brake input value is collected.
  • value an example of the result of the first target operation
  • the application layer realizes reading the collected braking input value from the global buffer (arrow 9 shown in FIG. 4 ).
  • the interface layer can also forward the collected brake input value to other devices via LIN/CAN/ETH (an example of the second target operation) (arrow 6'/arrow 7'/arrow 8' as shown in Figure 4).
  • LIN/CAN/ETH an example of the second target operation
  • the ICU task may be, for example, collecting parameters of the input voltage of the controller through the ICU channel (for example, the frequency of the input voltage, the duty cycle of the input voltage, the edge count of the input voltage, etc. ).
  • the interface layer needs to write the ICU task into the global buffer.
  • the application layer needs to read the ICU tasks written by the interface layer from the global buffer.
  • the interface layer first writes data into the global buffer.
  • the interface layer can read the sampling mode of the parameter of the input voltage of the controller, the channel number of the parameter acquisition of the input voltage of the controller and the parameter acquisition of the input voltage of the controller from the second memory and store them in the global buffer address (an example of configuration data), according to the sampling mode of the parameter of the input voltage of the controller and the channel number (an example of the parameter value of the target signal) collected by the parameter of the input voltage of the controller, through the ICU channel (the corresponding ICU drives the corresponding channel) collects the parameters of the input voltage of the controller (executing an example of the first target operation), and stores the address in the global buffer after collecting the parameters of the input voltage of the controller, and stores the collected controller
  • the parameters of the input voltage of the controller (an example of the result of the first target operation) are cached in the global buffer area, that is, the interface layer implements the parameter of the input voltage of the controller collected (an example of the result of the first target operation) into in the global buffer (arrow
  • the application layer needs to read the data written by the interface layer from the global buffer. Specifically, the application layer can read from the second memory the address stored in the global buffer after the parameter of the input voltage of the controller is collected, and store the address in the global buffer after the parameter of the input voltage of the controller is collected, from the global Read the parameters of the input voltage of the controller collected in the buffer (an example for the result of the first target operation), that is, the application layer realizes reading the parameters of the input voltage of the controller collected from the global buffer (as shown in Figure 4 Arrows shown in 9).
  • the interface layer can also transmit the parameters of the input voltage of the collected controller to other devices through LIN/CAN/ETH (an example of the second target operation) (arrow 6'/arrow 7'/arrow as shown in Figure 4 8').
  • LIN/CAN/ETH an example of the second target operation
  • the DI task when there is a DI task, the DI task may be, for example, collecting a feedback signal of a solenoid valve through a DI channel.
  • the interface layer needs to write the DI task into the global buffer.
  • the application layer needs to read the DI tasks written by the interface layer from the global buffer.
  • the interface layer first writes data into the global buffer.
  • the interface layer can read the sampling mode of the feedback signal of the solenoid valve, the channel number of the feedback signal collection of the solenoid valve, and the address stored in the global buffer after the feedback signal of the solenoid valve is collected from the second memory (configuration data According to the sampling mode of the feedback signal of the solenoid valve and the channel number collected by the feedback signal of the solenoid valve (an example of the parameter value of the target signal), through the DI channel (the channel corresponding to the corresponding DI driver of the drive layer) to the solenoid valve
  • the feedback signal of the solenoid valve is collected (an example of performing the first target operation), and according to the address of the feedback signal of the solenoid valve stored in the global buffer after collection, the feedback signal of the electromagnetic valve collected (an example of the result of the first target operation) ) into the global buffer, that is, the interface layer implements writing the collected feedback signal of the solenoid valve (an example of the result of the first target operation) into the global buffer
  • the application layer needs to read the data written by the interface layer from the global buffer. Specifically, the application layer can read the address stored in the global buffer after the feedback signal of the solenoid valve is collected from the second memory, and read from the global buffer according to the address stored in the global buffer after the feedback signal of the solenoid valve is collected. Get the collected feedback signal of the solenoid valve (an example of the result of the first target operation), that is, the application layer realizes reading the collected feedback signal of the solenoid valve from the global buffer (arrow 9 shown in FIG. 4 ).
  • the interface layer can also transmit the feedback signal of the collected solenoid valve to other devices (an example of the second target operation) through LIN/CAN/ETH (arrow 6'/arrow 7'/arrow 8' as shown in Figure 4 ).
  • the first LIN/CAN/ETH task may be, for example, receiving messages sent by other devices (for convenience of description, hereinafter referred to as received messages) and /or send messages to other devices (for convenience of description, hereinafter referred to as sent messages).
  • the interface layer may first write the first LIN/CAN/ETH task into the global buffer.
  • the application layer can read the first LIN/CAN/ETH task written by the interface layer from the global buffer.
  • the received message is the sent message. It is only necessary to replace the received message described below with the sent message, which will not be repeated here.
  • the interface layer first writes data into the global buffer. Specifically, the interface layer can read the channel number of the received message, the ID of the received message, the byte length of the received message, and the stored in the global buffer after the received message is collected from the second memory. Address, etc.
  • the application layer needs to read the data written by the interface layer from the global buffer. Specifically, the application layer may read from the second memory the address of the received message collected and stored in the global buffer, and read the disassembled address from the global buffer according to the address of the received message collected and stored in the global buffer.
  • One or more analysis signals after division (an example of the result of the first target operation), that is, the application layer realizes reading one or more analysis signals after division from the global buffer (as shown in Figure 4 arrow 9).
  • the interface layer can also forward one or more split analysis signals to other devices through another LIN/CAN/ETH according to the configured communication matrix (an example of the second target operation) (as shown in Figure 4 Arrow 6'/Arrow 7'/Arrow 8').
  • the second LIN/CAN/ETH task may be, for example, receiving a first request message from other devices through LIN/CAN/ETH, and the first request message requests Change the output value of the first DO/HB channel.
  • the first request message may carry the changed output value of the first DO/HB channel.
  • the interface layer needs to write the second LIN/CAN/ETH task into the global buffer.
  • the application layer needs to read the second LIN/CAN/ETH task written by the application layer from the global buffer.
  • the interface layer can read from the second memory the cycle of the output value collection of the first target DO/HB channel after change, the channel number of the output value collection of the first target DO/HB channel after change, and The changed output value of the first target DO/HB channel is stored in the address of the global buffer (an example of configuration data) after the output value is collected.
  • the cycle and the changed output value of the first target DO/HB channel The channel number collected by the output value of the first target DO/HB channel (an example of the parameter value of the target signal), through the DO/HB channel (the channel corresponding to the corresponding DO/HB driver of the driver layer) to the changed first target
  • the output value of the DO/HB channel is collected (an example of performing the first target operation), and the address stored in the global buffer after the output value of the changed first target DO/HB channel is collected, and the changed collected
  • the output value of the first target DO/HB channel (for an example of the result of the first target operation) is cached in the global buffer area, that is, the interface layer realizes the output value of the first target DO/HB channel after the change of the collection (for the first target DO/HB channel)
  • An example of the result of the first target operation is written into the global buffer (6'/arrow 7'/arrow 8' shown in FIG.
  • the application layer can read the changed output value of the first target DO/HB channel from the second memory and store it in the global buffer address, and collect the output value according to the changed output value of the first target DO/HB channel. Then store the address in the global buffer, read the output value of the first target DO/HB channel after the change of the collection from the global buffer (an example for the result of the first target operation), that is, the application layer realizes from the global buffer.
  • the acquired output value of the changed first target DO/HB channel is read in the field (arrow 9 shown in FIG. 4 ).
  • the interface layer can judge whether the changed output value of the first target DO/HB channel in the global buffer is consistent with the current output value of the first target DO/HB channel (an example of the second target operation). If not, the first target DO/HB channel is manipulated so that the output value of the first target DO/HB channel is changed to the output value of the first target DO/HB channel. If they are consistent, no action can be taken.
  • the first layer is the application layer as shown in FIG. 4
  • the second layer is the interface layer as shown in FIG. 4 .
  • the application layer first writes data into the global buffer.
  • the interface layer needs to read the data written by the application layer from the global buffer.
  • the DO/HB task may be, for example, an application layer request to change the output value of the second target DO/HB channel.
  • the application layer needs to write the DO/HB task into the global buffer.
  • the application layer needs to read the DO/HB tasks written by the interface layer from the global buffer.
  • the application layer can read from the second memory the changed output value acquisition cycle of the second target DO/HB channel, the changed output value of the second target DO/HB channel
  • the collected channel number and the changed output value of the second target DO/HB channel are collected and stored in the global buffer address (an example of configuration data), and are collected according to the changed output value of the second target DO/HB channel period and the channel number (an example of the parameter value of the target signal) collected by the output value of the second target DO/HB channel after the change, through the DO/HB channel (the channel corresponding to the corresponding DO/HB driver of the driver layer) to change
  • the output value of the second target DO/HB channel is collected (executing an example of the first target operation)
  • the address stored in the global buffer after the output value of the changed second target DO/HB channel is collected, the The collected output value of the changed second target DO/HB channel (an example of the result of the first target operation) is cached in the global buffer area, that is, the application layer implements the collected changed second target DO/HB channel
  • the interface layer can read the address stored in the global buffer after the output value of the changed second target DO/HB channel is collected from the second memory, and collect according to the output value of the changed second target DO/HB channel Store the address in the global buffer afterwards, read the output value of the second target DO/HB channel after the change of collection from the global buffer (an example for the result of the first target operation), that is, the interface layer realizes from the global buffer
  • the acquired changed output value of the second target DO/HB channel is read in the region (arrow 4/arrow 5 shown in FIG. 4 ).
  • the interface layer can judge whether the changed output value of the second target DO/HB channel in the global buffer is consistent with the current output value of the second target DO/HB channel (an example of the second target operation). If not, the second target DO/HB channel is manipulated so that the output value of the second target DO/HB channel is changed to the output value of the second target DO/HB channel. If they are consistent, no action can be taken.
  • a controller 610 and a car seat 620 are included.
  • the functions of the controller 610 need to be added, that is, the controller 610 needs to be able to control the movement of the car seat 620 . That is, the controller 610 needs to be developed so that the controller 610 can control the movement of the car seat 620 .
  • the configuration data shown in Table 1 above needs to be written into the second memory of the controller 610 .
  • the motor of the car seat 620 needs to be controlled by the controller 610 through the H bridge, and the car seat 620 needs to feed back the pulse width modulation (PWM) signal and the ADC signal to the controller 610, so as to prevent overcurrent and movement Precise control.
  • the PWM signal is transmitted through the ICU, and the ADC signal is transmitted through the ADC channel. Therefore, at this time, among the configuration data in the second memory, the configuration data related to the H bridge, the configuration data related to the ICU and the configuration data related to the ADC have corresponding values, and the corresponding values of other configuration data are all 0.
  • the configuration data related to the H bridge may include the channel number of the signal transmitted through the H bridge, the cycle of controlling the signal transmitted through the H bridge, the address allocated in the global buffer area of the signal transmitted through the H bridge, and the like.
  • the configuration data related to the ICU may include the channel number of the signal transmitted through the ICU, the cycle of reading the signal transmitted through the ICU, the sampling mode, and the address allocated in the global buffer area of the signal transmitted through the ICU.
  • the configuration data related to the ADC may include the channel number of the signal transmitted through the ADC, the cycle of reading the signal transmitted through the ADC, the address allocated in the global buffer area of the signal transmitted through the ADC, and the like.
  • the user inputs the above-mentioned configuration data into the target software, and the target software converts the configuration data into machine codes, and the flashing program layer of the controller 610 (the flashing program layer as shown in FIG. 4 ) flashes the machine codes to the second memory, to realize that the controller 610 controls the car seat 620 .
  • the control algorithm can be flashed in the controller 610 (630) through the flashing program layer of the controller 610 (as shown in FIG. 4 ).
  • the application layer of the controller 610 can issue control instructions, and the application layer of the controller 610 can read the configuration data from the second memory, and store the control instructions in the configuration data according to the configuration data (configuration data related to the H bridge).
  • the interface layer of the controller 610 can read the configuration data from the second memory, read the control instruction from the second memory according to the address of the global buffer indicated by the configuration data, and convert the control instruction into an H bridge through the H bridge.
  • the axle control signal is sent to the car seat 620 . Finally, the car seat 620 moves according to the control signal.
  • the car seat 620 can also transmit the motion feedback result (PWM signal and ADC signal) to the controller 610 through the ADC channel and the ICU. Subsequently, the interface layer of the controller 610 can read the configuration data from the second memory, and read the received feedback result from the address of the global buffer indicated by the configuration data (configuration data related to ADC or ICU).
  • a controller 630 may be added due to the limitation of the wiring harness of the entire vehicle and the saving of wiring harnesses.
  • both the configuration data and the control algorithm are deployed on the controller 630 , and the controller 610 can serve as an intermediary for transmitting information between the controller 630 and the car seat 620 to realize the process of the controller 630 controlling the car seat 620 .
  • information may be transmitted between the controller 620 and the controller 610 through ETH.
  • the controller 630 can issue a control command, and transmit the control command to the controller 610 through, for example, ETH, and the interface layer of the controller 610 can read the configuration data (configuration data related to ETH) from the second memory, and read the configuration data from the configuration data
  • the control instruction is read from the indicated address of the global buffer, and then the controller 620 acquires the control instruction.
  • the configuration data related to ETH in the configuration data has corresponding values.
  • controller 610 may send the motion feedback result to the controller 630 through, for example, ETH.
  • configuration data related to ETH may include assembled PDU ID, sending cycle, global buffer address of the target device (ie, controller 630), and the like.
  • the controller 630 may be arranged in a place in the vehicle where the controller 630 is not easy to be damaged or where heat dissipation is favorable.
  • the controller 630 may be installed at four corners of the vehicle.
  • a controller 710 and a controller 720 are included.
  • the functions of the controller 710 need to be added, that is, the controller 710 needs to be able to control the controller 720 . That is, the controller 710 needs to be developed so that the controller 710 can control the controller 720 .
  • the configuration data shown in Table 1 above needs to be written into the second memory of the controller 710 . If the controller 720 needs the controller 710 to supply power to it through high-side/low-side drivers, and the controller 720 needs to communicate with its 710 through CAN/CANFD, it will also send some general-purpose input/output , GPIO) signal is fed back to the controller 710. Therefore, at this time, among the configuration data in the second memory, the configuration data related to CAN/CANFD, the configuration data related to DO and the configuration data related to DI have corresponding values, and the corresponding values of other configuration data are all 0.
  • GPIO general-purpose input/output
  • configuration data related to CAN/CANFD may include baud rate, initial value of signal transmitted through CAN/CANFD, channel number of signal transmitted through CAN/CANFD, cycle of sending/receiving signal transmitted through CAN/CANFD, CAN ID, the first timeout threshold, the signal transmitted through CAN/CANFD and the address allocated in the global buffer area of the signal transmitted through CAN/CANFD, etc.
  • the configuration data related to DO can include the channel number of the signal transmitted through DO, the cycle of controlling the signal transmitted through DO, and the allocation of signals transmitted through DO in the global buffer area. address etc.
  • the configuration data related to DI may include the channel number of the signal transmitted through DI, the cycle of reading the signal transmitted through DI, the address allocated in the global buffer area of the signal transmitted through DI, and the like.
  • the user inputs the above configuration data into the target software, and the target software converts the configuration data into machine codes, and the flashing program layer of the controller 710 flashes the machine codes into the second memory, so that the controller 710 controls the controller 720 .
  • the control algorithm can be flashed in the controller 710 through the flashing program layer of the controller 710 (as shown in FIG. 4 ).
  • the application layer of the controller 710 can send an electrical signal
  • the application layer of the controller 710 can read the configuration data from the second memory, and store the electrical signal in the configuration data (configuration related to CAN/CANFD) according to the configuration data. data) at the address of the global buffer indicated.
  • the interface layer of the controller 710 can read the configuration data from the second memory, read the electrical signal from the second memory according to the address of the global buffer indicated by the configuration data (configuration data related to CAN/CANFD), and pass CAN/CANFD, send the electrical signal to the controller 720 . Finally, the controller 720 works according to the electric signal. In this way, the process of the controller 710 controlling the controller 720 is realized.
  • the controller 720 may also transmit the GPIO signal to the controller 710 through the DI channel. Subsequently, the interface layer of the controller 720 can read the configuration data from the second memory, and read the GPIO signal from the address of the global buffer indicated by the configuration data (configuration data related to the DI channel).
  • a controller can be added, and the configuration data and control algorithm are deployed on the new controller, which can be used as a control It is an intermediary for transmitting information between the controller 710 and the controller 720, and realizes the process that the newly added controller controls the controller 720. Wherein, information may be transmitted between the newly added controller and the controller 720 through ETH.
  • the process of deploying configuration data and control algorithms on the newly added controller can refer to the related description of configuration data and control algorithms deployed on the controller 710 above, and will not be repeated here.
  • the newly-added controller can issue a control instruction, and transmit the control instruction to the controller 710 through, for example, ETH, and the interface layer of the controller 710 can read the configuration data (configuration data related to ETH) from the second memory, and from the The control instruction is read from the address of the global buffer indicated by the configuration data, so as to realize the acquisition of the control instruction by the controller 710 .
  • the configuration data related to ETH in the configuration data has corresponding values.
  • controller 610 may send the motion feedback result to the controller 630 through, for example, ETH.
  • controller of the embodiment of the present application is described above with reference to FIG. 1 to FIG. 6 , and the device of the embodiment of the present application is described below in conjunction with FIG. 7 and FIG. 9 .
  • Fig. 7 is a schematic structural diagram of an example of a controller upgrading device provided by an embodiment of the present application.
  • the controller upgrading device 700 may include a reading unit 710 and a processing unit 720 .
  • Configuration data is stored in the storage memory of the controller, and the configuration data is data related to the function of the controller.
  • the device upgrading device 700 includes: a reading unit 710, configured to read the configuration data ;
  • the processing unit 720 is configured to execute operations corresponding to the configuration data according to the configuration data.
  • the configuration data includes a parameter value of the target signal and an address of the target signal stored in the controller.
  • the reading unit 710 is specifically configured to: read the configuration data when the controller is started or restarted.
  • Fig. 8 is a schematic structural diagram of another example of a controller upgrading device provided by an embodiment of the present application.
  • the controller upgrading apparatus 800 may include an acquisition unit 810 and a processing unit 820 .
  • the controller upgrading device 800 includes: an acquisition unit 810, configured to acquire configuration data, the configuration data is related to the functions of the controller; a processing unit 820, configured to generate machine codes according to the configuration data, the The above machine code is used for the controller upgrade.
  • the controller upgrading apparatus 800 further includes: a flashing unit, configured to flash the machine code into the storage memory of the controller.
  • the acquiring unit 810 is specifically configured to: acquire a user instruction, where the user instruction is used to indicate at least one of the following: adding one or more configuration data, deleting one or more configuration data, Modify one or more of said configuration data.
  • the acquiring unit 810 is further specifically configured to: acquire the user instruction according to the user's operation on the software human-computer interaction interface.
  • FIG. 9 shows a schematic structural diagram of a controller upgrading apparatus 900 provided by an embodiment of the present application.
  • the controller upgrading device 900 includes at least one memory 410 and at least one processor 420, the at least one memory 410 is used to store a program, and the at least one processor 420 is used to run the program, so as to realize the technical solution of the present application .
  • the processor in the embodiment of the present application may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory in the embodiments of the present application may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories.
  • the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erases programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which acts as external cache memory.
  • RAM random access memory
  • static random access memory static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory Access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate synchronous dynamic random access memory double data rate SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • serial link DRAM SLDRAM
  • direct memory bus random access memory direct rambus RAM, DR RAM
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium has program instructions, and when the program instructions are directly or indirectly executed, the technical solution of the present application is realized.
  • the embodiment of the present application also provides a computer program product containing instructions, which, when run on a computing device, enables the computing device to execute the technical solution of the present application, or enables the computing device to realize the functions of the aforementioned controller.
  • the embodiment of the present application also provides a chip, including at least one processor and an interface circuit, the interface circuit is used to provide program instructions or data for the at least one processor, and the at least one processor is used to execute the program instructions , so that the technical solution of the present application can be realized.
  • the embodiment of the present application also provides a vehicle, including the controller designed in the embodiment of the present application.
  • a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
  • an application running on a computing device and the computing device can be components.
  • One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between two or more computers.
  • these components can execute from various computer readable media having various data structures stored thereon.
  • a component may, for example, be based on a signal having one or more packets of data, such as data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet through a signal interacting with other systems. Communicate through local and/or remote processes.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described 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 may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: various media capable of storing program codes such as U disk, mobile hard disk, ROMRAM, magnetic disk or optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

本申请提供了一种控制器软件架构、控制器软件升级方法、控制器和装置。该控制器软件架构包括:驱动层、接口层、应用层和全局缓冲区,所述接口层,用于通过所述全局缓冲区和所述应用层进行数据交换;所述接口层,还用于通过所述全局缓冲区和所述驱动层进行数据交换。从而可以通过全局缓冲区,实现接口层和应用的数据交换以及接口层和驱动层的数据交换,进而实现对控制器开发的工作。

Description

控制器软件架构、控制器软件升级方法、控制器和装置 技术领域
本申请涉及信息技术领域。更具体地,涉及软件架构、软件升级的方法、软件运行的方法和装置。特别是,安装在例如智能汽车(smart/intelligent car)等交通工具中的电子设备的控制器软件架构、控制器软件升级方法、控制器和装置。
背景技术
随着社会的发展,现代生活中越来越多的机器向自动化、智能化发展,移动出行用的车辆也不例外,智能车辆正在逐步进入人们的日常生活中,这得益于实现汽车中电子控制功能的系统的发展。目前,实现汽车中电子控制功能的系统主要包括电子控制元件,例如,电子控制单元(electronic control unit,ECU)。其作为位于汽车内部的零部件,具有电子控制功能。例如,ECU可以基于控制信息对汽车零部件进行控制,又例如,ECU可以对汽车零部件中待传输的数据进行数据处理。
目前,汽车领域的底层软件架构大多采用汽车开放系统架构(automotive open system architecture,AUTOSAR)、汽车电子类开放系统和对应接口标准(open systems and the corresponding interfaces for automotive electronics,OSEK)架构或汽车分布式执行标准(vehicle distributed executive,VDX)架构。这些底层软件架构有一套框架,覆盖部分芯片、全部硬件、全部底层软件逻辑和全部应用层的业务需求。如此大而全的框架导致配置的参数非常多,例如,一个ECU的底层软件配置参数达到数万个,需要数十到上百人的团队去开发。总之,开发门槛较高,测试工作量较大。此外,这些底层软件架构的开发需要购买配置工具。一方面,该配置工具需要分别和芯片、编译器绑定,造成复用性差。另一方面,该配置工具价格昂贵。
目前,可以基于以下两种方式实现该汽车领域的底层软件架构的开发。
一种方式是基于后构建(Post-build)实现该汽车领域的底层软件架构的开发。该Post-build在一定程度上可以实现底层软件的复用性。该Post-build存在两种类型,分别是Post-build loadable和Post-build selectable。其中,Post-build loadable把需要变更的配置参数专门存放到一个闪存(flash)区域。当需要更改功能时,通过刷新程序更新该flash区域中的配置参数。但是,刷新程序需要重新编译代码。而且可更新的配置参数比较有限。Post-build selectable把需要变更的多种配置参数存放到一个flash区域。当ECU上电(可以理解为通电源),可以根据外部情况选择该flash区域中的一种配置参数加载。该Post-build selectable在编译之前,需要将变更的配置参数存放到flash区域中,当变更的配置参数不是flash区域中存储的配置参数,需要重新刷写全部代码,灵活性较差。
另一种方式是基于通用测量标定协议(universal measurement and calibration protocol,XCP)的标定可以实现免编译修改底层软件的配置参数。但是,XCP需要把配置项的物理地址固定,当需求发生变化,配置项的类型和数量不能发生变化。例如,ECU出厂时配 置了支持接收100个控制器域网(controller area network,CAN)信号,通过XCP无法改为接收101个CAN信号。
发明内容
本申请提供一种控制器软件架构、控制器软件升级方法、控制器和装置,可以实现对控制器的开发工作。
第一方面,提供了一种控制器软件架构,包括:驱动层、接口层、应用层和全局缓冲区,所述接口层,用于通过所述全局缓冲区和所述应用层进行数据交换;所述接口层,还用于通过所述全局缓冲区和所述驱动层进行数据交换。
示例性地,该控制器可以包括基于微控制单元(microcontroller unit,MCU)开发的,使用运行在只读存储器(read-only memory,ROM)上的操作系统的控制器。
本申请实施例对该控制器应用的领域不作限定。示例性地,该控制器可以应用于汽车领域。例如,该控制器可以包括ECU或车辆接口单元(vehicle interface unit,VIU)等。
本申请实施例提供的控制器软件架构,可以通过全局缓冲区,实现接口层和应用的数据交换以及接口层和驱动层的数据交换,进而实现对控制器开发的工作。
结合第一方面,在第一方面的某些实现方式中,所述接口层,具体用于:所述接口层,用于根据目标信号的参数值,执行第一目标操作;所述接口层,还用于根据所述目标信号在所述全局缓冲区存储的地址,将针对所述第一目标操作的结果缓存至所述全局缓存区中;所述应用层,具体用于:获取所述第一目标操作的结果。
示例性地,目标信号的参数值包括但不限于:采集周期值、目标信号传输的通道号、目标信号的采集模式等。
示例性地,采样模式可以理解为需要采集的信息。例如,采样模式可以包括采集输入频率、采集占空比、采集上升沿/下降沿的数据。
示例性地,目标信号可以是通过ADC、ICU、DI、DO、DI、H桥、LIN、CAN、和/或ETH传输的。
示例性地,第一目标操作可以是采集目标信号,针对第一目标操作的结果可以是所采集的目标信号。
接口层根据目标信号的参数值,执行第一目标操作,并根据目标信号在全局缓冲区存储的地址,将针对第一目标操作的结果缓存至全局缓存区中。然后,应用层获取第一目标操作的结果。进而实现接口层将第一目标操作的结果写入全局缓存区中,应用层从全局缓存区中读取第一目标操作的结果的方案,使得控制器可以实现相应的功能,完成该控制器开发的工作。
结合第一方面,在第一方面的某些实现方式中,所述接口层,还用于:读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
结合第一方面,在第一方面的某些实现方式中,所述应用层,还具体用于:根据所述目标信号在所述全局缓冲区的地址,从所述全局缓冲区中读取所述第一目标操作的结果。
结合第一方面,在第一方面的某些实现方式中,所述应用层,还具体用于:读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
结合第一方面,在第一方面的某些实现方式中,所述应用层,具体用于:所述应用层,用于根据目标信号的参数值,执行第一目标操作;所述应用层,还用于根据所述目标信号在所述全局缓冲区存储的地址,将针对所述第一目标操作的结果缓存至所述全局缓存区中;所述接口层,具体用于:获取所述第一目标操作的结果。
应用层根据目标信号的参数值,执行第一目标操作,并根据目标信号在全局缓冲区存储的地址,将针对第一目标操作的结果缓存至全局缓存区中。然后,接口层获取第一目标操作的结果。进而实现应用层将第一目标操作的结果写入全局缓存区中,接口层从全局缓存区中读取第一目标操作的结果的方案,使得控制器可以实现相应的功能,完成该控制器开发的工作。
结合第一方面,在第一方面的某些实现方式中,所述应用层,还用于:读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
结合第一方面,在第一方面的某些实现方式中,所述接口层,还具体用于:根据所述目标信号在所述全局缓冲区的地址,从所述全局缓冲区中读取所述第一目标操作的结果。
结合第一方面,在第一方面的某些实现方式中,所述接口层,还具体用于:读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
结合第一方面,在第一方面的某些实现方式中,所述接口层,还用于:根据所述第一目标操作的结果,执行第二目标操作。
结合第一方面,在第一方面的某些实现方式中,所述第一目标操作的结果包括采集目标信号,所述第二目标操作包括转发所述目标信号;或者,所述第一目标操作的结果包括目标输出值,所述目标输出值为改变后的所述驱动层的目标驱动通道的输出值,所述第二目标操作包括将所述目标驱动通道的输出值改成所述目标输出值。
结合第一方面,在第一方面的某些实现方式中,所述控制器软件架构还包括刷写程序层,所述刷写程序层,用于:获取机器码;将所述机器码刷写到所述控制器的存储内存中,以修改所述配置数据。
结合第一方面,在第一方面的某些实现方式中,所述接口层还包括管理面函数,所述管理面函数,用于监控所述接口层的运行状态,以便所述接口层运行异常时,使所述接口层采取异常应对措施。
结合第一方面,在第一方面的某些实现方式中,所述接口层还包括初始化函数,所述初始化函数,用于初始化所述接口层运行时的通信参数。
结合第一方面,在第一方面的某些实现方式中,所述应用层还包括数据面函数,所述数据面函数的行为由所述配置数据确定。
结合第一方面,在第一方面的某些实现方式中,所述控制器软件架构还包括基础软件层BSW,所述接口层位于所述BSW的通信服务中。
第二方面,提供了一种控制器,所述控制器的软件架构采用第一方面或第一方面的某些实现方式中任一种实现方式所述的控制器软件架构。
结合第二方面,在第二方面的某些实现方式中,所述控制器包括第一存储器,所述第一存储器为所述控制器的运行内存,所述第一存储器的全局缓冲区用于缓存所述控制器运行时产生的数据。
结合第二方面,在第二方面的某些实现方式中,述控制器包括第二存储器,所述第二存储器为所述控制器的存储内存,所述第二存储器用于存储配置数据。
本申请实施例提供的控制器,无需对控制器的硬件进行改进,只需将几十个配置数据刷写到控制器的存储内存中,这样控制器可以直接从控制器的存储内存中读取配置数据,并根据配置数据,从控制器的运行内存读取该配置数据对应的运行数据,即可实现控制器的功能的开发。从而将配置数据由几百个缩减到几十个,便可完成对控制器的开发工作,减小了控制器开发的工作量,降低了控制器的开发成本,加快了控制器的开发速度。
第三方面,提供了一种控制器软件升级的方法,所述控制器的存储内存中存储有配置数据,所述配置数据为与所述控制器功能相关的数据,所述方法包括:读取所述配置数据;根据所述配置数据,执行与所述配置数据对应的操作。
结合第三方面,在第三方面的某些实现方式中,所述配置数据包括目标信号的参数值和所述目标信号在所述控制器中存储的地址。
结合第三方面,在第三方面的某些实现方式中,所述读取所述配置数据包括:在所述控制器启动或重启的情况下,读取所述配置数据。
在控制器启动或重启的情况下,读取配置数据,即实现在控制器每次启动的时候,加载配置数据,进而实现动态加载配置数据。
第四方面,提供了一种控制器软件升级的方法,所述方法包括:获取配置数据,所述配置数据与所述控制器的功能相关;根据所述配置数据,生成机器码,所述机器码用于所述控制器升级。
通过获取与控制器的功能相关的配置数据,并生成机器码,实现控制器的升级。
结合第四方面,在第四方面的某些实现方式中,所述方法还包括:将所述机器码刷写到所述控制器的存储内存中。
结合第四方面,在第四方面的某些实现方式中,所述获取配置数据包括:获取用户指令,所述用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。
结合第四方面,在第四方面的某些实现方式中,所述获取用户指令包括:根据用户对软件人机交互界面的操作获取所述用户指令。
当用户需要改变控制器的功能时,无需对控制器的硬件进行改进,也无需编译(即免编译),用户只需通过软件人机交互界面的操作,输入相应的配置数据,进而灵活地实现控制器的升级。从而将配置数据由几百个缩减到几十个,便可完成对控制器的开发工作,减小了控制器开发的工作量,降低了控制器的开发成本,加快了控制器的开发速度。
第五方面,提供了一种存储方法,所述方法包括:将第二存储器的存储区域划分为N个存储区,所述N为大于或等于的正整数;生成至少一个链接文件,所述至少一个连接文件用于标识所述N个存储区;获取N组配置数据;将所述N组配置数据分别存储在所述N个存储区中;根据所述至少一个链接文件,生成目标机器码,所述至少一个链接文件用于标识所述N个存储区。
将第二存储器的存储区域划分为与配置数据组数相同个数的存储区,并在每个存储区中存储一组配置数据。还可以生成标识该N个存储区的至少一个链接文件,这样可以使得每个存储区在相应的存储区中的地址和大小是固定的,以便后续仅通过链接文件,即可获 取配置数据。
结合第五方面,在第五方面的某些实现方式中,所述存储方法还包括:确定所述N个存储区中的第n个存储子区包括未使用的存储空间;采用特定字符填满所述未使用的存储空间。
将第二存储器的存储区中未存满的存储空间填满特定字符,从而可以防止栈溢出。
第六方面,提供了一种控制器升级装置,所述控制器的存储内存中存储有配置数据,所述配置数据为与所述控制器功能相关的数据,所述装置包括:读取单元,用于读取所述配置数据;处理单元,用于根据所述配置数据,执行与所述配置数据对应的操作。
结合第六方面,在第六方面的某些实现方式中,所述配置数据包括目标信号的参数值和所述目标信号在所述控制器中存储的地址。
结合第六方面,在第六方面的某些实现方式中,所述读取单元,具体用于:在所述控制器启动或重启的情况下,读取所述配置数据。
第七方面,一种控制器升级装置,所述装置包括:获取单元,用于获取配置数据,所述配置数据与所述控制器的功能相关;处理单元,用于根据所述配置数据,生成机器码,所述机器码用于所述控制器升级。
结合第七方面,在第七方面的某些实现方式中,所述装置还包括:刷写单元,用于将所述机器码刷写到所述控制器的存储内存中。
结合第七方面,在第七方面的某些实现方式中,所述获取单元,具体用于:获取用户指令,所述用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。
结合第七方面,在第七方面的某些实现方式中,所述获取单元,还具体用于:根据用户对软件人机交互界面的操作获取所述用户指令。
第八方面,提供了一种可读存储介质,其特征在于,所述可读存储介质上存储有程序或指令,所述程序或指令被执行时实现第三方面或第三方面的某些实现方式中任一种实现方式所述的方法。
第九方面,提供了一种可读存储介质,其特征在于,所述可读存储介质上存储有程序或指令,所述程序或指令被执行时实现第四方面或第四方面的某些实现方式中任一种实现方式所述的方法。
第十方面,提供了一种可读存储介质,其特征在于,所述可读存储介质上存储有程序或指令,所述程序或指令被执行时实现第五方面或第五方面的某些实现方式中任一种实现方式所述的方法。
第十一方面,提供了一种装置,其特征在于,包括至少一个存储器和至少一个处理器,所述至少一个存储器用于存储程序,所述至少一个处理器用于运行所述程序,以实现第三方面或第三方面的某些实现方式中任一种实现方式所述的方法,或者,以实现第四方面或第四方面的某些实现方式中任一种实现方式所述的方法,或者,以实现第五方面或第五方面的某些实现方式中任一种实现方式所述的方法。
第十二方面,提供了一种软件工具,所述软件工具用于实现如第四方面或第四方面的某些实现方式中任一种实现方式所述的方法。
第十三方面,提供了一种车辆,包括第二方面或第二方面的某些实现方式中任一种实 现方式所述的控制器。
第十四方面,提供了一种车辆,包括第六方面或第六方面的某些实现方式中任一种实现方式所述的控制器升级装置或第七方面或第七方面的某些实现方式中任一种实现方式所述的控制器升级装置。
第十五方面,提供了一种芯片,包括至少一个处理器和接口电路,所述接口电路用于为所述至少一个处理器提供程序指令或者数据,所述至少一个处理器用于执行所述程序指令,以实现第三方面或第三方面的某些实现方式中任一种实现方式所述的方法,或者,以实现第四方面或第四方面的某些实现方式中任一种实现方式所述的方法,或者,以实现第五方面或第五方面的某些实现方式中任一种实现方式所述的方法。
附图说明
图1是AUTOSAR的底层软件架构示意图。
图2是本申请实施例提供的第二存储器的存储区域的示意图。
图3是本申请实施例提供的一例控制器的软件架构示意图。
图4是本申请实施例提供的一例接口层的架构示意图。
图5是本申请实施例提供的一例应用场景的示意图。
图6是本申请实施例提供的另一例应用场景的示意图。
图7是本申请实施例提供的一例控制器软件升级装置的示意性结构图。
图8是本申请实施例提供的另一例控制器升级装置的示意性结构图。
图9示出了本申请实施例提供的控制器升级装置的示意性结构图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述。
以下实施例中所使用的术语只是为了描述特定实施例的目的,而并非旨在作为对本申请的限制。如在本申请的说明书和所附权利要求书中所使用的那样,单数表达形式“一个”、“一种”、“上述”、“该”和“这一”旨在也包括。例如“一个或多个”这种表达形式,除非其上下文中明确地有相反指示。还应当理解,在本申请以下各实施例中,“至少一个”、“一个或多个”是指一个、两个或两个以上。
在本申请实施例中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
以下,以图1为例,介绍AUTOSAR的底层软件架构示意图。
如图1所示,AUTOSAR的软件架构包括应用层(Application Layer)、运行时环境(Runtime Environment,RTE)、基础软件层(Basic Software Layer,BSW)。
其中,BSW包括操作系统(operation system,OS)、系统服务(system)、诊断服务(Diagnostic)、加密服务(crypto)、内存管理(memory)、通信服务(communication)、 控制器局域网络协议栈(controller area network、CAN)、局域互联网络协议栈(local interconnect network,LIN)、以太网协议栈(ethernet,ETH)、微控制器抽象层(microcontroller abstraction layer,MCAL)、复杂设备驱动(complex device drivers,CDD)和输入输出硬件抽象层(loHwAb)。
系统模块包括:基础软件模式管理(BswM)、通信模式管理(ComM)、电子控制单元模式管理(EcuM)、同步时间基准管理(StbM)、诊断故障追踪(Det)、看门狗管理(WdgM)和看门狗接口(WdgIf)(图1中未示出)。
诊断模块包括:诊断通信模块(Dcm)、诊断事件管理模块(Dem)、功能限制管理(FiM)(图1中未示出)。
存储管理包括:电可檫可编程存储器模拟闪存(Fee)、内存管理接口(MemIf)、电可檫可编程存储器抽象层(Ea)和非易失性内存管理(NvM)(图1中未示出)。
通信模块包括:通信管理(Com)、大数据通信管理(LdCom)、协议数据单元路由器(PduR)、网络管理(Nm)、交互层协议数据单元多路选择器(IpduM)、端对端转换器(E2eXf)、通信转换器(ComXf)、基于互联网协议的可扩展面向服务的中间件转换器(SomeIpXf)、车载通信安全(SecOC)、万能标定协议(Xcp)和基于互联网协议的可扩展面向服务的中间件传输层(SomeIpTp)(图1中未示出)。
CAN通信协议栈包括CAN接口层(CanIf)、CAN网络管理模块(CanNm)、CAN状态管理模块(CanSM)、CAN传输层模块(CanTp)和CAN时间同步模块(CanTsyn)(图1中未示出)。
LIN通信协议栈包括:LIN接口层(LinIf)、LIN网络管理模块(LinNm)、LIN状态管理模块(LinSM)和LIN传输层模块(LinTp)(图1中未示出)。
以太网通信协议栈包括:以太网接口层(EthIf)、套接字适配器(SoAd)、UDP(用户数据报协议)网络管理(UdpNm)、IP(互联网协议)层的诊断协议栈(DoIP)、以太网状态管理(EthSM)、服务发现模块(Sd)、以太网传输层协议栈(TcpIp)和以太网时间同步模块(EthTsyn)(图1中未示出)。
MCAL是与硬件直接相关的驱动软件,其可以驱动芯片,对应用层提供统一的接口,使应用层和芯片解耦。MCAL包括:模拟量数字量转换器(Adc)、通用定时器(Gpt)、微控制器内核驱动(Mcu)、CAN控制器驱动(Can)、数字输入输出驱动(Dio)、闪存驱动(Fls)、输入捕捉单元(Icu)、串行外设接口(Spi)、芯片端口驱动(Port)、脉宽调制模块(Pwm)、以太网控制器驱动(Eth)和LIN控制器驱动(Lin)(图1中未示出)。
CDD是微控制器上的外部设备的驱动模块,CDD为用户提供了一个可以自行编写特殊设备驱动软件的可能性。CDD包括:CAN总线收发器(CanTrcv)、LIN总线收发器(LinTrcv)、以太网路由器(EthSwt)、以太网收发器(EthTrcv)、看门狗(Wdg)、外部电可檫可编程存储器(Eep)和H桥(H bridge)和高边/低边驱动(HS/LS)(图1中未示出)。
因此,本申请实施例提供了一种控制器,无需对控制器的硬件进行改进,也无需编译也无需编译(即免编译),只需将几十个配置数据刷写到控制器的存储内存中,这样控制器可以直接从控制器的存储内存中读取配置数据,并根据配置数据,从控制器的运行内存 读取该配置数据对应的运行数据,即可实现控制器的功能的开发。从而将配置数据由几百个缩减到几十个,便可完成对控制器的开发工作,减小了控制器开发的工作量,降低了控制器的开发成本,加快了控制器的开发速度。
示例性地,该控制器可以是基于MCU开发的,使用运行在只读存储器ROM上的操作系统的控制器。
本申请实施例对该控制器应用的领域不作限定。示例性地,该控制器可以应用于汽车领域。例如,该控制器可以包括ECU或车辆集成单元(vehicle integration unit,VIU)等。
本申请实施例提供的控制器包括第一存储器和第二存储器。
该第一存储器为该控制器的运行内存。示例性地,第一存储器可以是随机存储器(random access memory,RAM)。
该第二存储器为该控制器的存储内存。示例性地,第二存储器可以是ROM。例如,第二存储器可以是闪存存储器(flash memory)。
在一些实施例中,在第二存储器出厂之前,将第二存储器的存储区域分为M个存储区。
在一些实施例中,可以根据用户需求,将相应的配置数据刷写至第二存储器中。
示例性地,若配置数据包括N种类型的配置数据,则该N种类型的配置数据存储在第二存储器中的M个存储区的N个存储区中,其中M大于或等于N。
例如,如图2所示,第二存储器的存储区域包括N个存储区,即第1个存储子区、第2个存储子区、……、第N个存储子区。第1个存储子区存储第1个配置数据,第2个存储子区存储第2个配置数据,……,第N个存储子区存储第N个配置数据,即N个存储子区分别存储N种配置数据。
在一些实施例中,还可以将第二存储器的存储区中未存满的存储空间填满特定字符。从而可以防止栈溢出。
例如,如图2所示,可以将第1个配置数据未使用的存储空间和第2个配置数据未使用的存储空间中分别填满特定字符。
示例性地,该特定字符可以是0。
此外,还可以生成标识该M个存储区的至少一个链接文件。这样可以使得每个存储区在相应的存储区中的地址和大小是固定的,以便后续仅通过链接文件,即可获取配置数据。
以下,结合图3,描述本申请实施例提供的控制器的软件架构。
例如,图3是本申请实施例提供的控制器的底层软件架构的示意图。
如图3所示,该底层软件架构相对图1的AUTOSAR的底层软件架构来说,不同之处在于:一方面,由于控制器的硬件不变,一些系统模块,如初始化顺序可以固定下来,无需根据需求变化,即实现配置固化。另一方面,基础软件层的通信服务包括的内容用接口层替代。由一方面,数据驱动的方式不同。当进行数据驱动时,不再从配置代码里读取配置数据,而是从第二存储器中读取第二存储器中已刷写的配置数据。
以下,结合图4,对本申请实施例提供的控制器的软件架构进行介绍。
例如,如图4所示,该接口层分别和驱动层、应用层进行数据交换。该接口层介于应用层和驱动层之间。
驱动层包括数模转换(analog digital conversion,ADC)驱动、输入捕捉单元(input capture unit,ICU)驱动,数字量输入(digital input,DI)驱动,数字量输出(digital output,DO)驱动,H桥(H bridge)HB驱动,局域互联网络(local interconnect network,LIN)驱动,控制器域网(controller area network,CAN)驱动,以太网(ethernet,ETH)驱动。
本申请实施例提供的接口层包括数据面函数、管理面函数或初始化函数。
数据面函数可以为该软件配置周期性任务。例如,在运行接口层的每个核/进程上,分别配置1毫秒任务,10毫秒任务,100毫秒任务和1秒的周期任务。每个任务依次查询ADC、ICU、DI、DO、HB、CAN/CANFD、LIN和以太网在全局缓冲区中的数据,判断是否需要操纵某些通道。
数据面函数的行为由第二存储器中存储的配置数据定义。
为了便于查找配置数据,可以将目标配置分级管理。示例性地,可以将与ADC、ICU、DI、DO、HB、CAN/CANFD或LIN相关的配置数据分三级,将与以太网相关的配置数据分四级。
示例性地,配置数据具体包括的内容可以参见表1。其中,表1中所示的配置数据是本申请实施例涉及的配置数据的一例。本申请实施例对配置数据具体包括的内容不做限定。
表1
Figure PCTCN2021093991-appb-000001
Figure PCTCN2021093991-appb-000002
如表1所示,第1级配置数据和第2级配置数据都是相同的。第1级配置数据包括目标信号的周期种类;第2级配置数据包括以下至少一项:目标信号的周期、该周期对应的目标信号在第3级配置数据中的起始地址、目标信号的数量。
周期的种类可以理解为周期数量。例如,若周期种类为3,且周期分别包括10ms、20ms和50ms,即有三种读取目标信号的周期。
如表1所示,当待采集的目标信号为通过DI通道传输的信号、通过DO通道传输的信号、通过ADC通道传输的信号或通过HB传输的信号时,第3级配置数据包括目标信号的通道号和/或目标信号在全局缓冲区的地址。
如表1所示,当待采集的目标信号为通过ICU传输的信号时,第3级配置数据包括以下至少一项:目标信号的通道号、目标信号的采样模式、目标信号在全局缓冲区的地址。
示例性地,采样模式可以理解为需要采集的信息。例如,采样模式可以包括采集输入频率、采集占空比、采集上升沿/下降沿的数据。
如表1所示,当待采集的目标信号包括通过CAN接收的信号和/或通过CANFD接收的信号时,第3级配置数据包括以下至少一项:接收目标信号的通道号;目标信号在CANFD报文中的ID,CAN报文包括目标信号,CANFD报文包括目标信号;目标信号在CAN/CANFD报文中的起始比特;目标信号的比特长度;目标信号在全局缓冲区的地址;第一超时阈值,第一超时阈值用于表示目标信号被认为接收超时的阈值;目标信号接收超时后的动作;目标信号的初始值。
目标信号的初始值可以理解为控制器启动或重启(也可以称为刚上电)时,目标信号的初始数值。
如表1所示,当待采集的目标信号包括通过CAN发送的组包和/或通过CANFD发送组包时,第3级配置数据包括以下至少一项:目标信号组包前在全局缓冲区的地址、目标信号组包后在全局缓冲区的地址、目标信号在携带目标信号的报文中的起始比特、目标信号的比特长度、目标信号的大端小端标志位。
目标信号在携带目标信号的报文中的起始比特可以理解为目标信号在携带目标信号的报文中的位置或地址。
小端指的是将低序比特存储在起始地址(低地址),大端是将高序比特存储在起始地址(低地址)。
如表1所示,当待采集的目标信号包括通过CAN发送的报文时,第3级配置数据包括以下至少一项:目标信号承载的CAN通道和/或CANFD通道、目标信号的ID、目标信号的字节长度、目标信号在全局缓冲区的起始地址。
如表1所示,当待采集的目标信号包括通过LIN接收的信号时,第3级配置数据包括以下至少一项:目标信号承载的通道号、目标信号承载的LIN报文的PID、目标信号在LIN报文中的起始比特、目标信号的比特长度、目标信号在全局缓冲区的地址。
如表1所示,当待采集的目标信号包括通过LIN发送的组包时,第3级配置数据包括以下至少一项:目标信号组包前在全局缓冲区的地址、目标信号组包后在全局缓冲区的地址、目标信号在承载目标信号的LIN报文中的起始比特、目标信号的比特长度。
如表1所示,当待采集的目标信号包括通过LIN发送的报文时,第3级配置数据包括以下至少一项:目标信号承载的LIN通道、目标信号的PID、目标信号的字节长度、目标信号在全局缓冲区的起始地址。
如表1所示,当待采集的目标信号包括通过以太网发送的信号时,第3级配置数据包括以下至少一项:目标信号承载的以太网报文的PDU ID、以太网报文包含的目标信号在第4级配置数据中的起始位置、目标信号的数量;第4级配置数据包括以下至少一项:目标信号在目标设备的全局缓冲区的地址;目标信号所在的本地(可以理解为本申请实施例涉及控制器)全局缓冲区地址;目标信号的字节长度。
其中,目标信号在目标设备的全局缓冲区的地址可以理解为该目标信号传输至目标设备后,在目标设备的全局缓冲区中的地址。
可选地,第1级配置数据、第2级配置数据、第3级配置数据和第4级配置数据的等级依次增高。
由此可见,配置数据包括的内容,可以分为两大类:第一类,目标信号在全局缓冲区存储的地址。第二类,目标信号的参数值。其中目标信号的参数值可以包括表1中除目标信号在全局缓冲区存储的地址之外的内容。
管理面函数,监控接口层的运行状态,以便接口层运行异常时,使接口层采取异常应对措施。
示例性地,若数据面函数配置了5毫秒周期性任务,则管理面函数判断通过CAN/CANFD接收的信号是否超时。如果超时,根据第3级配置数据中指示的目标信号接收超时后的动作采取异常应对措施,以恢复接口层的正常运行。此外,若在配置数据中指示了恢复数据的时刻,可以在相应的时刻恢复数据。
示例性地,若数据面函数配置了5毫秒周期性任务,则管理面函数可以处理LIN的调度表。例如,判断调度表是否切换,以及按照调度表的配置发送或接收LIN报文。
初始化函数,用于初始化接口层运行时的通信参数。
示例性地,对于CAN/CANFD,通信参数可以包括波特率和全部信号的初始值。
在MCAL中已经预先把所有CAN控制器的通道设置为支持CANFD,并预先配置了几套常用的CAN/CANFD波特率,初始化函数根据波特率的配置,即可把相应通道设置成CAN或CANFD。
示例性地,对于LIN,初始化函数包括设置LIN波特率和把调度表的信息加载到全局缓冲区中。
示例性地,对于以太网,初始化函数需要读取配置的MAC地址、本地设备和目标设备的IP地址,本地设备和目标设备的端口号,运行时以太网以此为依据接收/发送报文。
下面,对本申请实施例提供的控制器的软件架构的各个层的运行进行介绍。
在本申请实施例中,控制器的软件架构包括的各个层的运行在第二存储器上。在运行的过程中,产生的数据缓存在第一存储器上。
软件架构包括接口层、应用层、驱动层和全局缓冲区。其中,接口层可以通过全局缓冲区和应用层进行数据交换。接口层还可以通过全局缓冲区和所述驱动层进行数据交换。即可以理解为全局缓冲区是接口层和应用层之间的纽带,也是接口层和驱动层之间的纽带。具体进行数据交换的过程可以包括以下步骤S1至S5。下面将详细介绍各个步骤。
在S1至S5中,在一些实施例中,第一层可以是接口层,第二层可以是应用层。在另一些实施例中,第一层可以是应用层,第二层可以是接口层。
S1,第一层读取配置数据。
第一层读取配置数据可以理解为第一层从第二存储器中读取配置数据。
S2,第一层根据目标信号的参数值,执行第一目标操作。
目标的参数值如上文所介绍的,这里不再赘述。
示例性地,第一目标操作可以是采集目标信号。
S3,第一层,根据目标信号在全局缓冲区存储的地址,将针对第一目标操作的结果缓存至全局缓存区中。
示例性地,第一目标操作的结果可以是所采集的目标信号。
S4,第二层,获取第一目标操作的结果。
具体的,第二层可以读取配置数据,并根据目标信号在全局缓冲区的地址,从全局缓 冲区中读取第一目标操作的结果。
在一些实施例中,当用户需要修改控制器的功能时,即需要对控制器软件进行升级时,用户例如可以通过软件(下文所述的目标软件)人际交互界面的操作输入用户指令,该用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。该软件可以根据用户指令指示的配置数据,生成机器码。该控制器的刷写程序层可以将机器码刷写到第二存储器中,以修改控制器中的配置数据。
若控制器在启动(上电)的情况下,用户更改了控制的功能,即第二存储器中的配置数据被更改,在一种可能的实施方式中,需要重启控制器,以使控制器再次读取第二存储器中的配置数据。若控制器在未启动(未上电)的情况下,用户更改了控制器的功能,即第二存储器中的配置数据被更改,在一种可能的实施方式中,只需在使用该控制器时启动该控制器即可。即可以理解为,在一种可能的实施方式中,控制器只有在每次启动或重启(上电)时,才会读取第二存储器中存储的配置数据。
示例性地,用户可以在第二存储器中增加一个或多个配置数据、在第二存储器中删除一个或多个配置数据、和/或在第二存储器中修改一个或多个配置数据。
在一些实施例中,接口层还可以根据第一目标操作的结果,执行第二目标操作。
示例性地,第二目标操作可以是转发该目标信号。
本申请实施例提供的底层软件架构从应用层角度,底层模块的行为和原AUTOSAR一致,即在相同的输入能得到相同的输出,能让应用层进行从原AUTOSAR架构下无缝切换到本申请实施例提供的软件架构。以下,结合不同的应用场景,对本申请实施例提供的控制器(以该控制器应用于汽车领域)的软件架构中各层的运行过程进行介绍。
下文涉及的任务可以包括周期性任务,也可以包括事件性任务。
在一些实施例中,第一层是如图4所示的接口层,第二层是如图4所示的应用层。则控制器的软件架构中各层的运行过程可以分为两个过程:首先,接口层先将数据写入全局缓冲区中;其次,应用层需要从全局缓冲区中读取接口层写入的数据。
在一个示例中,当存在ADC任务,该ADC任务例如可以是通过ADC通道采集刹车输入值。首先,接口层需要先将ADC任务写入全局缓冲区中。其次,应用层需要从全局缓冲区中读取接口层写入的ADC任务。
具体的,首先,接口层可以从第二存储器中读取刹车输入值采集的周期、刹车输入值采集的通道号和刹车输入值采集之后存储在全局缓冲区的地址等(配置数据的一例),根据刹车输入值采集的周期和刹车输入值采集的通道号(目标信号的参数值的一例),通过ADC通道(驱动层相应的ADC驱动对应的通道)对刹车输入值进行采集(执行第一目标操作的一例),并根据刹车输入值采集之后存储在全局缓冲区的地址,将采集的刹车输入值(针对第一目标操作的结果的一例)缓存至全局缓存区中,即接口层实现将采集的刹车输入值(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的箭头1)。其次,应用层可以从第二存储器中读取刹车输入值采集之后存储在全局缓冲区的地址,根据刹车输入值采集之后存储在全局缓冲区的地址,从全局缓冲区中读取采集的刹车输入值(针对第一目标操作的结果的一例),即应用层实现从全局缓冲区中读取采集的刹车输入值(如图4中所示的箭头9)。
此外,接口层还可以将采集的刹车输入值通过LIN/CAN/ETH转发给其他设备(第二目标操作的一例)(如图4所示的箭头6'/箭头7'/箭头8')。
在另一个示例中,当存在ICU任务,该ICU任务例如可以是通过ICU通道采集控制器的输入电压的参数等(例如,输入电压的频率,输入电压的占空比、输入电压的边沿计数等)。首先,接口层需要先将ICU任务写入全局缓冲区中。其次,应用层需要从全局缓冲区中读取接口层写入的ICU任务。
具体的,首先,接口层先将数据写入全局缓冲区中。具体的,接口层可以从第二存储器中读取控制器的输入电压的参数的采样模式、控制器的输入电压的参数采集的通道号和控制器的输入电压的参数采集之后存储在全局缓冲区的地址(配置数据的一例),根据控制器的输入电压的参数的采样模式和控制器的输入电压的参数采集的通道号(目标信号的参数值的一例),通过ICU通道(驱动层相应的ICU驱动对应的通道)对控制器的输入电压的参数进行采集(执行第一目标操作的一例),并根据控制器的输入电压的参数采集之后存储在全局缓冲区的地址,将采集的控制器的输入电压的参数(针对第一目标操作的结果的一例)缓存至全局缓存区中,即接口层实现将采集的控制器的输入电压的参数(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的箭头2)。其次,应用层需要从全局缓冲区中读取接口层写入的数据。具体的,应用层可以从第二存储器中读取控制器的输入电压的参数采集之后存储在全局缓冲区的地址,根据控制器的输入电压的参数采集之后存储在全局缓冲区的地址,从全局缓冲区中读取采集的控制器的输入电压的参数(针对第一目标操作的结果的一例),即应用层实现从全局缓冲区中读取采集的控制器的输入电压的参数(如图4中所示的箭头9)。
此外,接口层还可以将采集的控制器的输入电压的参数通过LIN/CAN/ETH转发给其他设备(第二目标操作的一例)(如图4所示的箭头6'/箭头7'/箭头8')。
在又一个示例中,当存在DI任务,该DI任务例如可以是通过DI通道采集电磁阀的反馈信号。首先,接口层需要先将DI任务写入全局缓冲区中。其次,应用层需要从全局缓冲区中读取接口层写入的DI任务。
具体的,首先,接口层先将数据写入全局缓冲区中。具体的,接口层可以从第二存储器中读取电磁阀的反馈信号的采样模式、电磁阀的反馈信号采集的通道号和电磁阀的反馈信号采集之后存储在全局缓冲区的地址等(配置数据的一例),根据电磁阀的反馈信号的采样模式和电磁阀的反馈信号采集的通道号(目标信号的参数值的一例),通过DI通道(驱动层相应的DI驱动对应的通道)对电磁阀的反馈信号进行采集(执行第一目标操作的一例),并根据电磁阀的反馈信号采集之后存储在全局缓冲区的地址,将采集的电磁阀的反馈信号(针对第一目标操作的结果的一例)缓存至全局缓存区中,即接口层实现将采集的电磁阀的反馈信号(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的箭头3)。其次,应用层需要从全局缓冲区中读取接口层写入的数据。具体的,应用层可以从第二存储器中读取电磁阀的反馈信号采集之后存储在全局缓冲区的地址,根据电磁阀的反馈信号采集之后存储在全局缓冲区的地址,从全局缓冲区中读取采集的电磁阀的反馈信号(针对第一目标操作的结果的一例),即应用层实现从全局缓冲区中读取采集的电磁阀的反馈信号(如图4中所示的箭头9)。
此外,接口层还可以将采集的电磁阀的反馈信号通过LIN/CAN/ETH转发给其他设备 (第二目标操作的一例)(如图4所示的箭头6'/箭头7'/箭头8')。
在又一个示例中,当存在第一LIN/CAN/ETH任务,该第一LIN/CAN/ETH任务例如可以是接收其他设备发送的报文(为了方便描述,下文简称为接收的报文)和/或向其他设备发送报文(为了方便描述,下文简称为发送的报文)。首先,接口层可以先将第一LIN/CAN/ETH任务写入全局缓冲区中。其次,应用层可以从全局缓冲区中读取接口层写入的第一LIN/CAN/ETH任务。下面,以第一LIN/CAN/ETH任务是接收的报文为例,介绍具体实现过程。针对第一LIN/CAN/ETH任务是接收的报文是发送的报文,只需将下文中所述的接收的报文用发送的报文替换即可,这里不再赘述。
具体的,首先,接口层先将数据写入全局缓冲区中。具体的,接口层可以从第二存储器中读取接收的报文的通道号、接收的报文的ID、接收的报文的字节长度、和接收的报文采集之后存储在全局缓冲区的地址等(配置数据的一例),根据接收的报文的通道号、接收的报文的ID、接收的报文的字节长度(目标信号的参数值的一例),通过LIN/CAN/ETH通道(驱动层相应的LIN/CAN/ETH驱动对应的通道)接收报文并将接收报文拆分(执行第一目标操作的一例),拆分成一个或多个解析信号,并根据接收的报文采集之后存储在全局缓冲区的地址,将一个或多个解析信号(针对第一目标操作的结果的一例)缓存至全局缓存区中,即接口层实现将接收的报文拆分后的一个或多核解析信号(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的箭头6'/箭头7'/箭头8')。其次,应用层需要从全局缓冲区中读取接口层写入的数据。具体的,应用层可以从第二存储器中读取接收的报文采集之后存储在全局缓冲区的地址,根据接收的报文采集之后存储在全局缓冲区的地址,从全局缓冲区中读取拆分后的一个或多个解析信号(针对第一目标操作的结果的一例),即应用层实现从全局缓冲区中读取拆分后的一个或多个解析信号(如图4中所示的箭头9)。
此外,接口层还可以根据所配置的通信矩阵,将拆分后的一个或多个解析信号通过另一路LIN/CAN/ETH转发给其他设备(第二目标操作的一例)(如图4所示的箭头6'/箭头7'/箭头8')。
在又一个示例中,当存在第二LIN/CAN/ETH任务,该第二LIN/CAN/ETH任务例如可以是通过LIN/CAN/ETH接收其他设备的第一请求消息,该第一请求消息请求改变第一DO/HB通道的输出值。例如,该第一请求消息中可以携带改变后的第一DO/HB通道的输出值。首先,接口层需要先将第二LIN/CAN/ETH任务写入全局缓冲区中。其次,应用层需要从全局缓冲区中读取应用层写入的第二LIN/CAN/ETH任务。
具体的,首先,接口层可以从第二存储器中读取改变后的第一目标DO/HB通道的输出值采集的周期、改变后的第一目标DO/HB通道的输出值采集的通道号和改变后的第一目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址等(配置数据的一例),根据改变后的第一目标DO/HB通道的输出值采集的周期和改变后的第一目标DO/HB通道的输出值采集的通道号(目标信号的参数值的一例),通过DO/HB通道(驱动层相应的DO/HB驱动对应的通道)对改变后的第一目标DO/HB通道的输出值进行采集(执行第一目标操作的一例),并根据改变后的第一目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,将采集的改变后的第一目标DO/HB通道的输出值(针对第一目标操作的结果的一例)缓存至全局缓存区中,即接口层实现将采集的改变后的第一目标DO/HB通道的输 出值(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的6'/箭头7'/箭头8')。其次,应用层可以从第二存储器中读取改变后的第一目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,根据改变后的第一目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,从全局缓冲区中读取采集的改变后的第一目标DO/HB通道的输出值(针对第一目标操作的结果的一例),即应用层实现从全局缓冲区中读取采集的改变后的第一目标DO/HB通道的输出值(如图4中所示的箭头9)。
此外,接口层可以判断全局缓冲区中改变后的第一目标DO/HB通道的输出值和当前该第一目标DO/HB通道的输出值是否一致(第二目标操作的一例)。如果不一致,则操控该第一目标DO/HB通道,以使该第一目标DO/HB通道的输出值为改变后的第一目标DO/HB通道的输出值。如果一致,则可以不用采取任何措施。
在另一些实施例中,第一层是如图4所示的应用层,第二层是如图4所示的接口层。
首先,应用层先将数据写入全局缓冲区中。其次,接口层需要从全局缓冲区中读取应用层写入的数据。
DO/HB任务
在另一个示例中,当存在DO/HB任务,该DO/HB任务例如可以是应用层请求改变第二目标DO/HB通道的输出值。首先,应用层需要先将DO/HB任务写入全局缓冲区中。其次,应用层需要从全局缓冲区中读取接口层写入的DO/HB任务。
具体的,在一个示例中,首先,应用层可以从第二存储器中读取改变后的第二目标DO/HB通道的输出值采集的周期、改变后的第二目标DO/HB通道的输出值采集的通道号和改变后的第二目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址等(配置数据的一例),根据改变后的第二目标DO/HB通道的输出值采集的周期和改变后的第二目标DO/HB通道的输出值采集的通道号(目标信号的参数值的一例),通过DO/HB通道(驱动层相应的DO/HB驱动对应的通道)对改变后的第二目标DO/HB通道的输出值进行采集(执行第一目标操作的一例),并根据改变后的第二目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,将采集的改变后的第二目标DO/HB通道的输出值(针对第一目标操作的结果的一例)缓存至全局缓存区中,即应用层实现将采集的改变后的第二目标DO/HB通道的输出值(针对第一目标操作的结果的一例)写入全局缓冲区中(如图4中所示的箭头10)。其次,接口层可以从第二存储器中读取改变后的第二目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,根据改变后的第二目标DO/HB通道的输出值采集之后存储在全局缓冲区的地址,从全局缓冲区中读取采集的改变后的第二目标DO/HB通道的输出值(针对第一目标操作的结果的一例),即接口层实现从全局缓冲区中读取采集的改变后的第二目标DO/HB通道的输出值(如图4中所示的箭头4/箭头5)。
此外,接口层可以判断全局缓冲区中改变后的第二目标DO/HB通道的输出值和当前该第二目标DO/HB通道的输出值是否一致(第二目标操作的一例)。如果不一致,则操控该第二目标DO/HB通道,以使该第二目标DO/HB通道的输出值为改变后的第二目标DO/HB通道的输出值。如果一致,则可以不用采取任何措施。
以下,以图5和图6所示的两个应用场景为例,介绍控制器如何控制其他设备的过程。
例如,如图5所示,包括控制器610和汽车座椅620。根据用户的需求,在控制器610在出厂之后,需要新增该控制器610的功能,即需要该控制器610可以控制汽车座椅620 的运动。即需要对控制器610进行开发,使得该控制器610可以控制汽车座椅620运动。
通过上文介绍的控制器,此时,需要将上文中表1所示的配置数据刷写到控制器610的第二存储器中。若汽车座椅620的电机需要控制器610通过H桥控制,且汽车座椅620需要将脉冲宽度调制(pulse width modulation,PWM)信号和ADC信号反馈该控制器610,以便防止过流和运动的精准控制。其中,PWM信号是通过ICU传输的,ADC信号是通过ADC通道传输的。因此,此时,第二存储器中的配置数据中与H桥相关的配置数据、与ICU相关的配置数据和与ADC相关的配置数据是有相应的值,其他配置数据对应的都是0。
例如,与H桥相关的配置数据可以包括通过H桥传输的信号的通道号、控制通过H桥传输的信号的周期和通过H桥传输的信号的在全局缓存区中分配的地址等。
例如,与ICU相关的配置数据可以包括通过ICU传输的信号的通道号、读取通过ICU传输的信号的周期、采样模式和通过ICU传输的信号在全局缓存区中分配的地址等。
例如,与ADC相关的配置数据可以包括通过ADC传输的信号的通道号、读取通过ADC传输的信号的周期和通过ADC传输的信号在全局缓存区中分配的地址等。
首先,用户将上述配置数据输入目标软件中,目标软件将配置数据转换成机器码,控制器610的刷写程序层(如图4所示的刷写程序层)将机器码刷写到第二存储器中,以实现控制器610控制汽车座椅620。其次,可以通过控制器610的刷写程序层(如图4所示),将控制算法刷写在控制器610(630)中。这样控制器610的应用层可以发出控制指令,控制器610的应用层可以从第二存储器中读取配置数据,并将根据配置数据(与H桥相关的配置数据),将控制指令存储在配置数据指示的全局缓冲区的地址中。控制器610的接口层可以从第二存储器中读取配置数据,根据配置数据指示的全局缓冲区的地址,从第二存储器中读取控制指令,并通过H桥,将该控制指令转换为H桥控制信号发送给汽车座椅620。最后,汽车座椅620根据该控制信号,进行运动。
可选地,汽车座椅620还可以将运动的反馈结果(PWM信号和ADC信号),通过ADC通道和ICU传输给控制器610。随后,控制器610的接口层可以从第二存储器中读取配置数据,并从配置数据(与ADC或ICU相关的配置数据)指示的全局缓冲区的地址中读取接收的反馈结果。
可选地,在一些实施例中,由于整车线束的限制,以及节省线束,可以增加一个控制器630。此时,配置数据和控制算法都部署在控制器630上,控制器610可以作为控制器630和汽车座椅620之间传输信息的中间媒介,实现控制器630控制汽车座椅620的过程。其中,控制器620和控制器610之间可以通过ETH传输信息。
具体的,配置数据和控制算法部署在控制器630上的过程可以参考上文中配置数据和控制算法部署在控制器610上的相关描述,这里不再赘述。控制器630可以发出控制指令,并通过例如ETH将控制指令传输给控制器610,控制器610的接口层可以从第二存储器中读取配置数据(与ETH相关的配置数据),并从配置数据指示的全局缓冲区的地址中读取控制指令,进而实现控制器620对控制指令的获取。此时,配置数据中与ETH相关的配置数据有相应的值。在控制器620获取控制指令之后的过程可以参考上文中的描述,这里不再赘述。
进一步地,控制器610可以将运动的反馈结果通过例如ETH发送给控制器630。
例如,与ETH相关的配置数据可以包括组装的PDU ID、发送周期和目标设备(即控制器630)的全局缓冲区地址等。
可选地,该控制器630可以设置在整车中控制器630不容易被破坏的地方或利于散热的地方。例如,控制器630可以设置在整车的四个角。
例如,如图6所示,包括控制器710和控制器720。根据用户的需求,在控制器710在出厂之后,需要新增该控制器710的功能,即需要该控制器710可以控制控制器720。即需要对控制器710进行开发,使得该控制器710可以控制控制器720。
通过上文介绍的控制器,此时,需要将上文中表1所示的配置数据刷写到控制器710的第二存储器中。若控制器720需要控制器710通过高边/低边驱动给它供电,且控制器720需要和终止其710通过CAN/CANFD通信,还会把一些通用型之输入输出(General-purpose input/output,GPIO)信号反馈给控制器710。因此,此时,第二存储器中的配置数据中与CAN/CANFD相关的配置数据、与DO相关的配置数据和与DI相关的配置数据是有相应的值,其他配置数据对应的都是0。
例如,与CAN/CANFD相关的配置数据可以包括波特率、通过CAN/CANFD传输的信号的初始值、通过CAN/CANFD传输的信号通道号、发送/接收通过CAN/CANFD传输的信号的周期、CAN ID、第一超时阈值、通过CAN/CANFD传输的信号和通过CAN/CANFD传输的信号在全局缓存区中分配的地址等。
例如,与DO相关的配置数据(即高边/低边驱动的信息)可以包括通过DO传输的信号的通道号、控制通过DO传输的信号的周期和通过DO传输的信号在全局缓存区中分配的地址等。
例如,与DI相关的配置数据可以包括通过DI传输的信号的通道号、读取通过DI传输的信号的周期和通过DI传输的信号在全局缓存区中分配的地址等。
首先,用户将上述配置数据输入目标软件中,目标软件将配置数据转换成机器码,控制器710的刷写程序层将机器码刷写到第二存储器中,以实现控制器710控制控制器720。其次,可以通过控制器710的刷写程序层(如图4所示),将控制算法刷写在控制器710中。这样控制器710的应用层可以发出电信号,控制器710的应用层可以从第二存储器中读取配置数据,并将根据配置数据,将电信号存储在配置数据(与CAN/CANFD相关的配置数据)指示的全局缓冲区的地址中。控制器710的接口层可以从第二存储器中读取配置数据,根据配置数据(与CAN/CANFD相关的配置数据)指示的全局缓冲区的地址,从第二存储器中读取电信号,并通过CAN/CANFD,将该电信号发送给控制器720。最后,控制器720根据该电信号,进行工作。从而实现控制器710控制控制器720的过程。
可选地,该控制器720还可以将GPIO信号,通过DI通道传输给控制器710。随后,控制器720的接口层可以从第二存储器中读取配置数据,并从配置数据(与DI通道相关的配置数据)指示的全局缓冲区的地址中读取GPIO信号。
可选地,在一些实施例中,由于整车线束的限制,以及节省线束,可以增加一个控制器,配置数据和控制算法都部署在新增的控制器上,新增的控制器可以作为控制器710和控制器720之间传输信息的中间媒介,实现新增的控制器控制控制器720的过程。其中,新增的控制器和控制器720之间可以通过ETH传输信息。
具体的,配置数据和控制算法部署在新增的控制器上的过程可以参考上文中配置数据 和控制算法部署在控制器710上的相关描述,这里不再赘述。新增的控制器可以发出控制指令,并通过例如ETH将控制指令传输给控制器710,控制器710的接口层可以从第二存储器中读取配置数据(与ETH相关的配置数据),并从配置数据指示的全局缓冲区的地址中读取控制指令,进而实现控制器710对控制指令的获取。此时,配置数据中与ETH相关的配置数据有相应的值。在控制器710获取控制指令之后的过程可以参考上文中的描述,这里不再赘述。
进一步地,控制器610可以将运动的反馈结果通过例如ETH发送给控制器630。
通过上述关于图5和图6所述的控制器如何控制其他设备的过程,可以看出:第一,基于此本申请实施例提供的控制器,面对不同项目、不同客户可以采用同一套硬件,降低了成本。第二,控制器的底层软件的配置数据大幅缩减到几十个,减少测试工作量,加快控制器的软件的开发速度。第三,控制器的底层软件配置可以根据用户需求灵活切换,对传统AUTOSAR配置工具依赖程度低,零部件供应商和整车厂可以省去购买AUTOSAR工具的大笔费用。
上文结合图1至图6的描述了本申请实施例的控制器,下面结合图7和图9,描述本申请实施例的装置。
图7是本申请实施例提供的一例控制器升级装置的示意性结构图。
如图7所示,该控制器升级装置700可以包括读取单元710和处理单元720。所述控制器的存储内存中存储有配置数据,所述配置数据为与所述控制器功能相关的数据,所述制器升级装置700包括:读取单元710,用于读取所述配置数据;处理单元720,用于根据所述配置数据,执行与所述配置数据对应的操作。
可选地,所述配置数据包括目标信号的参数值和所述目标信号在所述控制器中存储的地址。
可选地,所述读取单元710,具体用于:在所述控制器启动或重启的情况下,读取所述配置数据。
图8是本申请实施例提供的另一例控制器升级装置的示意性结构图。
如图8所示,该控制器升级装置800可以包括获取单元810和处理单元820。所述该控制器升级装置800包括:获取单元810,用于获取配置数据,所述配置数据与所述控制器的功能相关;处理单元820,用于根据所述配置数据,生成机器码,所述机器码用于所述控制器升级。
可选地,所述控制器升级装置800还包括:刷写单元,用于将所述机器码刷写到所述控制器的存储内存中。
可选地,所述获取单元810,具体用于:获取用户指令,所述用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。
可选地,所述获取单元810,还具体用于:根据用户对软件人机交互界面的操作获取所述用户指令。
图9示出了本申请实施例提供的控制器升级装置900的示意性结构图。该控制器升级装置900包括至少一个存储器410和至少一个处理器420,所述至少一个存储器410用于存储程序,所述至少一个处理器420用于运行所述程序,以实现本申请的技术方案。
应理解,本申请实施例中的处理器可以为中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的随机存取存储器(random access memory,RAM)可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质具有程序指令,当所述程序指令被直接或者间接执行时,使得本申请的技术方案得以实现。
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算设备上运行时,使得计算设备执行本申请的技术方案,或者使得所述计算设备实现前文中的控制器的功能。
本申请实施例还提供一种芯片,包括至少一个处理器和接口电路,所述接口电路用于为所述至少一个处理器提供程序指令或者数据,所述至少一个处理器用于执行所述程序指令,使得本申请的技术方案得以实现。
本申请实施例还提供一种车辆,包括本申请实施例设计的控制器。
在本说明书中使用的术语“部件”、“模块”、“系统”等用于表示计算机相关的实体、硬件、固件、硬件和软件的组合、软件、或执行中的软件。例如,部件可以是但不限于,在处理器上运行的进程、处理器、对象、可执行文件、执行线程、程序和/或计算机。通过图示,在计算设备上运行的应用和计算设备都可以是部件。一个或多个部件可驻留在进程和/或执行线程中,部件可位于一个计算机上和/或分布在2个或更多个计算机之间。此外,这些部件可从在上面存储有各种数据结构的各种计算机可读介质执行。部件可例如根据具有一个或多个数据分组(例如来自与本地系统、分布式系统和/或网络间的另一部件交互的二个部件的数据,例如通过信号与其它系统交互的互联网)的信号通过本地和/或远程进程来通信。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可 以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROMRAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (33)

  1. 一种控制器软件架构,其特征在于,包括:驱动层、接口层、应用层和全局缓冲区,
    所述接口层,用于通过所述全局缓冲区和所述应用层进行数据交换;
    所述接口层,还用于通过所述全局缓冲区和所述驱动层进行数据交换。
  2. 根据权利要求1所述的控制器软件架构,其特征在于,所述接口层,具体用于:
    所述接口层,用于根据目标信号的参数值,执行第一目标操作;
    所述接口层,还用于根据所述目标信号在所述全局缓冲区存储的地址,将针对所述第一目标操作的结果缓存至所述全局缓存区中;
    所述应用层,具体用于:
    获取所述第一目标操作的结果。
  3. 根据权利要求2所述的控制器软件架构,其特征在于,所述接口层,还用于:
    读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
  4. 根据权利要求2或3所述的控制器软件架构,其特征在于,所述应用层,还具体用于:
    根据所述目标信号在所述全局缓冲区的地址,从所述全局缓冲区中读取所述第一目标操作的结果。
  5. 根据权利要求4所述的控制器软件架构,其特征在于,所述应用层,还具体用于:
    读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
  6. 根据权利要求1所述的控制器软件架构,其特征在于,所述应用层,具体用于:
    所述应用层,用于根据目标信号的参数值,执行第一目标操作;
    所述应用层,还用于根据所述目标信号在所述全局缓冲区存储的地址,将针对所述第一目标操作的结果缓存至所述全局缓存区中;
    所述接口层,具体用于:
    获取所述第一目标操作的结果。
  7. 根据权利要求6所述的控制器软件架构,其特征在于,所述应用层,还用于:
    读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
  8. 根据权利要求6或7所述的控制器软件架构,其特征在于,所述接口层,还具体用于:
    根据所述目标信号在所述全局缓冲区的地址,从所述全局缓冲区中读取所述第一目标操作的结果。
  9. 根据权利要求8所述的控制器软件架构,其特征在于,所述接口层,还具体用于:
    读取配置数据,所述配置数据包括所述目标信号的参数值和所述目标信号在所述全局缓冲区存储的地址。
  10. 根据权利要求2至9中任一项所述的控制器软件架构,其特征在于,所述接口层,还用于:
    根据所述第一目标操作的结果,执行第二目标操作。
  11. 根据权利要求10所述的控制器软件架构,其特征在于,
    所述第一目标操作的结果包括采集目标信号,所述第二目标操作包括转发所述目标信号;或者,
    所述第一目标操作的结果包括目标输出值,所述目标输出值为改变后的所述驱动层的目标驱动通道的输出值,所述第二目标操作包括将所述目标驱动通道的输出值改成所述目标输出值。
  12. 根据权利要求1至11中任一项所述的控制器软件架构,其特征在于,所述控制器软件架构还包括刷写程序层,所述刷写程序层,用于:
    获取机器码;
    将所述机器码刷写到所述控制器的存储内存中,以修改所述配置数据。
  13. 根据权利要求1至12中任一项所述的控制器软件架构,其特征在于,所述接口层还包括管理面函数,
    所述管理面函数,用于监控所述接口层的运行状态,以便所述接口层运行异常时,使所述接口层采取异常应对措施。
  14. 根据权利要求1至13中任一项所述的控制器软件架构,其特征在于,所述接口层还包括初始化函数,
    所述初始化函数,用于初始化所述接口层运行时的通信参数。
  15. 根据权利要求1至14中任一项所述的控制器软件架构,其特征在于,所述应用层还包括数据面函数,所述数据面函数的行为由所述配置数据确定。
  16. 根据权利要求1至15中任一项所述的控制器软件架构,其特征在于,所述控制器软件架构还包括基础软件层BSW,所述接口层位于所述BSW的通信服务中。
  17. 一种控制器,其特征在于,所述控制器的软件架构采用如权利要求1至16中任一项所述的控制器软件架构。
  18. 根据权利要求17所述的控制器,其特征在于,所述控制器包括第一存储器,所述第一存储器为所述控制器的运行内存,所述第一存储器的全局缓冲区用于缓存所述控制器运行时产生的数据。
  19. 根据权利要求17或18所述的控制器,其特征在于,所述控制器包括第二存储器,所述第二存储器为所述控制器的存储内存,所述第二存储器用于存储配置数据。
  20. 一种控制器软件升级的方法,其特征在于,所述控制器的存储内存中存储有配置数据,所述配置数据为与所述控制器功能相关的数据,所述方法包括:
    读取所述配置数据;
    根据所述配置数据,执行与所述配置数据对应的操作。
  21. 根据权利要求20所述的方法,其特征在于,所述配置数据包括目标信号的参数值和所述目标信号在所述控制器中存储的地址。
  22. 根据权利要求20或21所述的方法,其特征在于,所述读取所述配置数据包括:
    在所述控制器启动或重启的情况下,读取所述配置数据。
  23. 一种控制器软件升级的方法,其特征在于,所述方法包括:
    获取配置数据,所述配置数据与所述控制器的功能相关;
    根据所述配置数据,生成机器码,所述机器码用于所述控制器升级。
  24. 根据权利要求23所述的方法,其特征在于,所述方法还包括:
    将所述机器码刷写到所述控制器的存储内存中。
  25. 根据权利要求23或24所述的方法,其特征在于,所述获取配置数据包括:
    获取用户指令,所述用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。
  26. 根据权利要求25所述的方法,其特征在于,所述获取用户指令包括:
    根据用户对软件人机交互界面的操作获取所述用户指令。
  27. 一种控制器升级装置,其特征在于,所述装置包括:
    获取单元,用于获取配置数据,所述配置数据与所述控制器的功能相关;
    处理单元,用于根据所述配置数据,生成机器码,所述机器码用于所述控制器升级。
  28. 根据权利要求27所述的控制器升级装置,其特征在于,所述控制器升级装置还包括:
    刷写单元,用于将所述机器码刷写到所述控制器的存储内存中。
  29. 根据权利要求27或28所述的控制器升级装置,其特征在于,所述获取单元,具体用于:
    获取用户指令,所述用户指令用于指示以下至少一项:增加一个或多个所述配置数据、删除一个或多个所述配置数据、修改一个或多个所述配置数据。
  30. 根据权利要求29所述的控制器升级装置,其特征在于,所述获取单元,还具体用于:
    根据用户对软件人机交互界面的操作获取所述用户指令。
  31. 一种可读存储介质,其特征在于,所述可读存储介质上存储有程序或指令,所述程序或指令被执行时实现如权利要求20至22中任一项所述的方法。
  32. 一种可读存储介质,其特征在于,所述可读存储介质上存储有程序或指令,所述程序或指令被执行时实现如权利要求23至26中任一项所述的方法。
  33. 一种车辆,其特征在于,包括如权利要求17至19中任一项所述的控制器。
PCT/CN2021/093991 2021-05-16 2021-05-16 控制器软件架构、控制器软件升级方法、控制器和装置 WO2022241589A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
CN202180006855.3A CN115623871A (zh) 2021-05-16 2021-05-16 控制器软件架构、控制器软件升级方法、控制器和装置
PCT/CN2021/093991 WO2022241589A1 (zh) 2021-05-16 2021-05-16 控制器软件架构、控制器软件升级方法、控制器和装置
EP21940048.8A EP4336347A4 (en) 2021-05-16 2021-05-16 CONTROL UNIT SOFTWARE ARCHITECTURE, METHOD FOR UPDATING CONTROL UNIT SOFTWARE, CONTROL UNIT AND DEVICE
US18/511,105 US20240095016A1 (en) 2021-05-16 2023-11-16 Controller Software Architecture, Controller Software Upgrade Method, Controller, and Apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/093991 WO2022241589A1 (zh) 2021-05-16 2021-05-16 控制器软件架构、控制器软件升级方法、控制器和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/511,105 Continuation US20240095016A1 (en) 2021-05-16 2023-11-16 Controller Software Architecture, Controller Software Upgrade Method, Controller, and Apparatus

Publications (1)

Publication Number Publication Date
WO2022241589A1 true WO2022241589A1 (zh) 2022-11-24

Family

ID=84140946

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/093991 WO2022241589A1 (zh) 2021-05-16 2021-05-16 控制器软件架构、控制器软件升级方法、控制器和装置

Country Status (4)

Country Link
US (1) US20240095016A1 (zh)
EP (1) EP4336347A4 (zh)
CN (1) CN115623871A (zh)
WO (1) WO2022241589A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228185A (zh) * 2017-12-29 2018-06-29 北京经纬恒润科技有限公司 一种嵌入式软件模块化生成方法和装置
CN108897564A (zh) * 2018-06-07 2018-11-27 京信通信系统(中国)有限公司 一种嵌入式系统的软件升级方法及嵌入式系统
CN111258550A (zh) * 2020-01-16 2020-06-09 深圳市元征科技股份有限公司 一种软件架构及软件架构开发方法
US20200412725A1 (en) * 2019-06-25 2020-12-31 Mcafee, Llc Cloud-based shared security cache

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7802263B2 (en) * 2002-12-17 2010-09-21 Stragent, Llc System, method and computer program product for sharing information in a distributed framework
CN102170478B (zh) * 2011-05-16 2014-02-19 浙江大学 基于autosar协议栈的pdu缓存方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228185A (zh) * 2017-12-29 2018-06-29 北京经纬恒润科技有限公司 一种嵌入式软件模块化生成方法和装置
CN108897564A (zh) * 2018-06-07 2018-11-27 京信通信系统(中国)有限公司 一种嵌入式系统的软件升级方法及嵌入式系统
US20200412725A1 (en) * 2019-06-25 2020-12-31 Mcafee, Llc Cloud-based shared security cache
CN111258550A (zh) * 2020-01-16 2020-06-09 深圳市元征科技股份有限公司 一种软件架构及软件架构开发方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4336347A4 *

Also Published As

Publication number Publication date
EP4336347A1 (en) 2024-03-13
EP4336347A4 (en) 2024-06-26
CN115623871A (zh) 2023-01-17
US20240095016A1 (en) 2024-03-21

Similar Documents

Publication Publication Date Title
US20200310782A1 (en) Gateway device, in-vehicle network system, and firmware update method
US11004024B2 (en) Service and resource orchestration system and method, and apparatus
US8347318B2 (en) Application component communication apparatus of SCA-based system and method thereof
US20240053977A1 (en) Gateway device, in-vehicle network system, and firmware update method
CN111338315B (zh) Autosar中的虚拟电子控制单元
US11307550B2 (en) Sequence control of program modules
Staron et al. Autosar standard
WO2022241589A1 (zh) 控制器软件架构、控制器软件升级方法、控制器和装置
Kjorveziroski et al. Evaluating webassembly for orchestrated deployment of serverless functions
Zhang et al. Schedule management framework for cloud-based future automotive software systems
WO2024093731A1 (zh) 汽车开放系统架构、数据处理方法及车载设备
KR20130022804A (ko) 리프로그래밍 제어모듈 및 이를 이용한 리프로그래밍 시스템 및 방법
Subramonian et al. The design and performance of configurable component middleware for distributed real-time and embedded systems
WO2022110970A1 (zh) 参数配置方法、装置及系统
CN113973126A (zh) 车端子系统间的通信方法、装置、电子设备及介质
Lee et al. RSCA: Middleware supporting dynamic reconfiguration of embedded software on the distributed URC robot platform
Robertz et al. Industrial robot motion control with real-time Java and EtherCAT
Anthony et al. A middleware approach to dynamically configurable automotive embedded systems
Haberl Code generation and system integration of distributed automotive applications
JP7344109B2 (ja) リソース割当システム、サーバ、演算装置
Singh Rajput Increasing efficiency in ECU function development for Battery Management Systems
de Almeida Rust-based SOME/IP implementation for robust automotive software
Mader et al. Signal/Service Translation-Where is the place to be?
Völter A generative component infrastructure for embedded systems
Balasubramanian Component Models for Vehicle Software Platforms: Two Case Studies

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21940048

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2021940048

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2021940048

Country of ref document: EP

Effective date: 20231206

NENP Non-entry into the national phase

Ref country code: DE