WO2022110970A1 - 参数配置方法、装置及系统 - Google Patents

参数配置方法、装置及系统 Download PDF

Info

Publication number
WO2022110970A1
WO2022110970A1 PCT/CN2021/117521 CN2021117521W WO2022110970A1 WO 2022110970 A1 WO2022110970 A1 WO 2022110970A1 CN 2021117521 W CN2021117521 W CN 2021117521W WO 2022110970 A1 WO2022110970 A1 WO 2022110970A1
Authority
WO
WIPO (PCT)
Prior art keywords
hardware
resource
hardware resource
resource management
attribute
Prior art date
Application number
PCT/CN2021/117521
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 EP21896474.0A priority Critical patent/EP4235402A4/en
Priority to JP2023532418A priority patent/JP7547636B2/ja
Publication of WO2022110970A1 publication Critical patent/WO2022110970A1/zh
Priority to US18/324,422 priority patent/US20230297395A1/en

Links

Images

Classifications

    • 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
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Definitions

  • the present application relates to the field of smart cars, and in particular, to a parameter configuration method, device and system.
  • Automotive open system architecture (AUTOSAR) is an open and standardized software architecture developed for the automotive industry.
  • users can connect to the device remotely through protocols such as remote terminal (Telnet) or secure shell (ssh), and determine the hardware form of the device by entering a command line.
  • protocols such as remote terminal (Telnet) or secure shell (ssh)
  • the user can check the hardware manual to determine the hardware form of the device.
  • the user can manually input the hardware resource parameters in the AUTOSAR configuration tool according to the hardware form.
  • the configuration tool can generate a description file based on the hardware configuration parameters input by the user, and the AUTOSAR generation tool can then generate a configuration file and an executable file based on the description file.
  • the present application provides a parameter configuration method, device and system, which can solve the problem of low parameter configuration efficiency caused by manual parameter configuration.
  • a parameter configuration method is provided, which is applied to an embedded device using AUTOSAR, where the embedded device includes a hardware layer, a service layer and an application layer; the method includes: the service layer obtains hardware resource parameters of the hardware layer, and send the hardware resource parameter to the AUTOSAR development tool, the hardware resource parameter is used for the AUTOSAR development tool to generate an executable file and a configuration file, and the executable file and the configuration file can be stored in the hardware layer; after that, the The service layer can run the executable file based on the configuration file.
  • the service layer can directly obtain the hardware resource parameters of the hardware layer and send the hardware resource parameters to the AUTOSAR development tool, there is no need for developers to manually input the hardware resource parameters in the development tool, which can effectively improve the parameter configuration efficiency and reduce the parameters. Probability of misconfiguration.
  • the configuration file includes a resource management policy; the method may further include: the service layer adjusts the running state of the hardware resources included in the hardware layer based on the resource management policy.
  • the service layer can implement flexible scheduling of hardware resources.
  • the resource management policy may include: an identifier of the target hardware resource and a first attribute, where the first attribute is used to indicate a resource management mode for the target hardware resource; the service layer adjusts the hardware layer based on the resource management policy
  • the process of the included running state of the hardware resource may include: the service layer adjusts the running state of the target hardware resource indicated by the identifier according to the resource management manner indicated by the first attribute.
  • different hardware resources can be configured with different resource management methods, so that the service layer can make targeted adjustments to the running states of different hardware resources based on the resource management strategy.
  • the resource management policy may further include: a second attribute; the second attribute is used to indicate a start condition for resource management of the target hardware resource; the service layer adjusts the resource management mode indicated by the first attribute
  • the process of the running state of the target hardware resource indicated by the identifier may include: if the service layer determines that the running state of the target hardware resource indicated by the identifier satisfies the startup condition indicated by the second attribute, then manage the resource according to the resource indicated by the first attribute mode to adjust the running state of the target hardware resource.
  • the service layer may adjust the running state of the target hardware resource after determining that the running state of the target hardware resource satisfies the activation condition. If the service layer determines that the running state of the target hardware resource does not satisfy the starting condition, it does not need to adjust the running state of the target hardware resource. In this way, it is possible to avoid incorrectly adjusting the running state of the hardware resources to affect the performance of the embedded device, and to ensure the reliability of resource scheduling.
  • the resource management manner includes: turning off the target hardware resource, or reducing the working frequency of the target hardware resource.
  • the service layer can effectively reduce the power consumption of embedded devices by closing the target hardware resources or reducing the operating frequency of the target hardware resources.
  • the process of adjusting the operating state of the hardware resources included in the hardware layer by the service layer may include: if the service layer detects that there is a state switch in the embedded device, and the state switch satisfies the hardware resource If the adjustment condition is set, the running state of the hardware resource is adjusted based on the resource management policy.
  • the adjustment condition may be pre-configured in the service layer, or may be carried in the configuration file.
  • the process of the service layer acquiring the hardware resource parameters of the hardware layer may include: the service layer receiving a configuration command sent by the AUTOSAR development tool; and the service layer acquiring the hardware resource parameters of the hardware layer based on the configuration command.
  • the hardware resource parameters may include: machine parameters and system parameters.
  • the machine parameters may include at least: related parameters of the processor, related parameters of the memory, and related parameters of the hard disk.
  • the system parameters may include network parameters, for example, may include related parameters of the network card.
  • an embedded device adopts AUTOSAR, and the embedded device includes a hardware layer, a service layer and an application layer; the service layer may include a communication interface and at least one module, the communication interface and At least one module can be used to implement the parameter configuration method provided by the above aspects.
  • an embedded device adopts AUTOSAR, and the embedded device includes a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program stored in the memory So that the embedded device executes the parameter configuration method provided by the above aspects.
  • a parameter configuration system comprising: an AUTOSAR development tool, and the embedded device provided in the above aspect; wherein, the AUTOSAR development tool is used for sending data based on a service layer of the embedded device Hardware resource parameters generate executables and configuration files.
  • a computer-readable storage medium where instructions are stored in the computer-readable storage medium, and the instructions are executed by a processor to implement the parameter configuration method provided by the above aspects.
  • a computer program product containing instructions when the computer program product runs on a computer, the computer executes the parameter configuration method provided by the above aspects.
  • a chip in another aspect, includes a programmable logic circuit and/or program instructions, and when the chip is running, the parameter configuration method provided by the above aspect is implemented.
  • the present application provides a parameter configuration method, device and system.
  • the service layer of the embedded device can directly obtain the hardware resource parameters of the hardware layer, and send the hardware resource parameters to the AUTOSAR development tool, so that the AUTOSAR development tool can generate configuration files and executable file. Since there is no need for developers to manually input hardware resource parameters in the development tool, the efficiency of parameter configuration can be effectively improved, the probability of parameter configuration errors can be reduced, and the development efficiency of applications can be improved.
  • Fig. 1 is the architecture diagram of a kind of AUTOSAR AP provided by the embodiment of the present application
  • FIG. 2 is a schematic diagram of an application scenario of a parameter configuration method provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a parameter configuration method provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a target service module in a service layer provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a configuration interface of a configuration tool provided by an embodiment of the present application.
  • FIG. 6 is a schematic diagram of a configuration interface of another configuration tool provided by an embodiment of the present application.
  • FIG. 7 is a flowchart of a method for adjusting the running state of hardware resources provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a service layer provided by an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of an embedded device provided by an embodiment of the present application.
  • the basic software (BSW) layer in the AUTOSAR layered software architecture can be applied to vehicles produced by different manufacturers and electronic components provided by different suppliers, thereby reducing research and development costs and adapting to increasingly complex automotive electrical and software architectures.
  • AUTOSAR mainly includes two different types of platforms:
  • AUTOSAR classic platform (classic platform, CP).
  • AUTOSAR CP is an embedded real-time electronic control unit (ECU) standard based on the open systems and the corresponding interfaces for automotive electronics (OSEK) standard.
  • the architecture of the AUTOSAR CP includes an application layer running on a microcontroller, a runtime environment (RTE) layer, and a BSW layer.
  • the application layer is basically independent of the hardware, the software components of the application layer communicate through the RTE layer, and the software components also need to pass the RTE to access the BSW.
  • AUTOSAR adaptive platform can use two types of interfaces: services and application programming interfaces (APIs).
  • the AUTOSAR AP consists of functional clusters distributed in the service layer and the AUTOSAR Adaptive Platform Base (AUTOSAR AP base).
  • FIG. 1 is an architecture diagram of an AUTOSAR AP provided by an embodiment of the present application.
  • the architecture of the AUTOSAR AP may include: a hardware layer 01, an operating system (operating system, OS) interface (interface) 02, service layer 03 and application layer 04.
  • the OS interface 02 may be a portable operating system interface (portable operating system interface, POSIX).
  • the service layer 03 may include a plurality of middleware, which may also be referred to as service modules.
  • the service layer 03 may include the following service modules: a communication management (CM) module, a core type (core type) module, a RESTful module, a persistence (persistency) module, an execution management (execution management) module , EM) module, time synchronization (time synchronization) module, platform health management (platform health management, PHM) module, identity and access management (identity and access management, IAM) module, diagnostics (diagnostics) module, log and trace ( log and trace) module, encryption (cryptograph) module, state management (state management, SM) module, network management (network management, NM) module and update and configuration management (update and configuration management) module and so on.
  • RESTful is a development method based on representational state transfer (REST).
  • FIG. 2 is a schematic diagram of an application scenario of a parameter configuration method provided by an embodiment of the present application.
  • the application scenario may include an embedded device 001 using AUTOSAR, and an AUTOSAR development tool 002 .
  • the AUTOSAR development tool 002 may include a configuration tool 0021 and a generation tool 0022.
  • the configuration tool 0021 is used to generate a description file based on the acquired configuration parameters (including hardware resource parameters and functional configuration parameters).
  • the generation tool 0022 is used to generate a configuration file and an executable (executable, exe) file based on the description file. For example, the generation tool 0022 may generate a code file based on the description file, and then compile the code file to obtain an executable file.
  • the description file may be a file in AUTOSAR extensible markup language (AUTOSAR extensible markup language, arxml) format.
  • the configuration file may be a file in JavaScript (a scripting language) object notation (JavaScript object notation, JSON) format.
  • FIG. 3 is a flowchart of a parameter configuration method provided by an embodiment of the present application, and the method may be applied to the application scenario shown in FIG. 2 .
  • the embedded device 002 shown in FIG. 2 may adopt AUTOSAR AP, and as shown in FIG. 1 , the embedded device 002 may include a hardware layer 01 , a service layer 03 and an application layer 04 .
  • the method includes:
  • Step 101 The configuration tool sends a configuration instruction to the service layer.
  • the configuration tool when the configuration tool needs to acquire the hardware resource parameters of the hardware layer in the embedded device to generate the description file, the configuration tool can send a configuration instruction to the service layer.
  • the configuration instruction is used to instruct the service layer to obtain hardware resource parameters of the hardware layer.
  • the target service module may be a target service module among the plurality of service modules included in the service layer of the embedded device, and the target service module can communicate with the configuration tool and can schedule and manage the hardware resources included in the hardware layer.
  • the target service module may be an EM module, an SM module, a CM module, or a PHM module in the service layer.
  • FIG. 4 is a schematic structural diagram of a target service module in a service layer provided by an embodiment of the present application.
  • the target service module may include a communication interface 031 and a resource management module 032 .
  • the communication interface 031 is used to communicate with the configuration tool.
  • the configuration tool may send the configuration instruction to the communication interface 031 of the target service module in the service layer.
  • the resource management module 032 includes a parsing sub-module 032a and a management sub-module 032b.
  • the parsing sub-module 032a is used to parse and acquire hardware resource parameters of the hardware layer
  • the management sub-module 032b is used to schedule and manage the hardware resources included in the hardware layer.
  • the communication interface 031 may be an interface developed based on protocols such as transmission control protocol (transmission control protocol, TCP), hypertext transfer protocol (hypertext transfer protocol, HTTP) or remote procedure call (remote procedure call, RPC).
  • transmission control protocol transmission control protocol
  • hypertext transfer protocol hypertext transfer protocol
  • HTTP hypertext transfer protocol
  • remote procedure call remote procedure call
  • Step 102 The service layer acquires hardware resource parameters of the hardware layer based on the configuration instruction.
  • the service layer of the embedded device can acquire the hardware resource parameters of the hardware layer in response to the configuration instruction.
  • the hardware resource parameters may include machine (machine) parameters and system (system) parameters.
  • the machine parameters may at least include: related parameters of the processor, related parameters of the memory, and related parameters of the hard disk.
  • the system parameter may include network parameters, for example, may include related parameters of the network card.
  • the processor may include a central processing unit (central processing unit, CPU), etc., and the processor may include multiple processor cores (cores).
  • the hardware resource parameter may also include other types of parameters, and the other type parameters may include related parameters of an electronic control unit (electronic control unit, ECU), a micro control unit (micro control unit) -controller unit, MCU) related parameters and peripherals (such as cameras and sensors such as lidar) related parameters, etc.
  • ECU electronice control unit
  • MCU micro control unit
  • peripherals such as cameras and sensors such as lidar
  • the communication interface 031 of the target service module in the service layer can send the configuration instruction to the resource management module 032 .
  • the parsing sub-module 032a in the resource management module 032 may further acquire hardware resource parameters of the hardware layer in response to the configuration instruction.
  • Step 103 The service layer sends the hardware resource parameter to the configuration tool.
  • the service layer After the service layer obtains the hardware resource parameters, it can send the hardware resource parameters to the configuration tool in the AUTOSAR development tool.
  • the hardware resource parameter is used for the configuration tool to generate a description file, and the generation tool in the development tool can then generate an executable file and a configuration file based on the description file.
  • the target service module in the service layer may send the acquired hardware resource parameters to the configuration tool through the communication interface 031 .
  • FIG. 5 is a schematic diagram of a configuration interface of a configuration tool provided by an embodiment of the present application.
  • the machine parameters sent by the service layer received by the configuration tool may include relevant parameters of the CPU, and the relevant parameters of the CPU may be Include parameters for each core in the CPU.
  • the relevant parameters of the CPU may include the parameters of core0 to core3 in CPU0, and the parameters of core0 and core1 in CPU1.
  • the parameters of each core may include the following attributes: category, checksum, core ID, short name, timestamp, and universally unique identifier. unique identifier, UUID).
  • FIG. 6 is a schematic diagram of a configuration interface of another configuration tool provided by an embodiment of the present application.
  • the system parameters sent by the service layer received by the configuration tool may include Ethernet-related parameters.
  • the relevant parameters of the Ethernet may include at least one of the following properties: baudrate, sum check code, coupling port switchoff delay, protocol name ( protocol name), protocol version, speed and timestamp.
  • the relevant parameters of the Ethernet may also include configuration parameters of Internet protocol version 4 (Internet protocol version 4, IPv4), and the IPv4 configuration parameters may include at least one of the following attributes: assignment priority, sum check code, default gateway (default gateway), domain name system (DNS) server address (server address), IP address keep behavior (IP address keep behavior), IPv4 address (IPv4address), IPv4 address source (IPv4address source) , network mask (network mask), timestamp and time to live value (time to live, TTL).
  • IPv4 configuration parameters may include at least one of the following attributes: assignment priority, sum check code, default gateway (default gateway), domain name system (DNS) server address (server address), IP address keep behavior (IP address keep behavior), IPv4 address (IPv4address), IPv4 address source (IPv4address source) , network mask (network mask), timestamp and time to live value (time to live, TTL).
  • IP address retention behavior is: store persistently
  • IPv4 address source is: DHCPV-4, which represents the dynamic host used to configure the IP address required by the IPv4 host Configuration protocol (dynamic host configuration protocol, DHCP).
  • Step 104 The configuration tool generates a description file based on the hardware resource parameter.
  • the configuration tool is preconfigured with an AUTOSAR metamodel.
  • the configuration tool After the configuration tool receives the hardware resource parameters sent by the service layer, it can generate an AUTOSAR model based on the hardware resource parameters and the metamodel. This process may also be referred to as: mapping the hardware resource parameters to an AUTOSAR model. After that, export the AUTOSAR model from the memory of the configuration tool to the hard disk of the configuration tool to get the description file.
  • the description file can be a file in .arxml format.
  • the AUTOSAR metamodel is a unified modeling language (UML) model used to define the language used to describe the AUTOSAR system, which is a template (templates define structures such as software components and ECUs to create AUTOSAR software hardware system) graphical representation.
  • UML unified modeling language
  • An AUTOSAR model is an instance of an AUTOSAR model.
  • Step 105 The generation tool generates an executable file and a configuration file based on the description file.
  • the generation tool can obtain the description file and generate an executable file and a configuration file based on the description file.
  • the executable file may be a file in .exe format
  • the configuration file may be a file in .jason format.
  • the developer may also store both the executable file and the configuration file generated by the generation tool in the hardware layer of the embedded device.
  • Step 106 The service layer runs the executable file based on the configuration file.
  • the service layer may read a configuration file in the hardware layer, and run the executable file based on the configuration file.
  • Step 107 The service layer adjusts the running state of the hardware resources included in the hardware layer based on the resource management policy in the configuration file.
  • the configuration file may include a resource management strategy, and the service layer may adjust the running state of the hardware resources included in the hardware layer based on the resource management strategy during the running process of the embedded device.
  • the resource management policy in the configuration file may include: at least one policy configuration item, each policy configuration item being used to indicate a management policy for a hardware resource in the hardware layer.
  • the policy configuration item of the target hardware resource may include: an identifier of the target hardware resource and a first attribute. The first attribute is used to indicate a resource management mode for the target hardware resource, and the resource management mode may include: turning off the target hardware resource, or reducing the operating frequency of the target hardware resource.
  • the identifier of the target hardware resource may include: an identification (identification, ID) of the processor core and the ID of the processor to which the processor core belongs. If the target hardware resource is a sensor, the identifier of the target hardware resource may be the ID of the sensor.
  • the policy configuration item of the target hardware resource may further include a second attribute, where the second attribute is used to indicate a start condition for resource management of the target hardware resource. That is, the service layer may adjust the running state of the target hardware resource after determining that the running state of the target hardware resource satisfies the activation condition. In this way, it can be avoided that the running state of the resource is adjusted incorrectly and the performance of the embedded device is affected, and the reliability of the resource scheduling is ensured.
  • the implementation process of the above step 107 is introduced.
  • the above step 107 may include:
  • Step 1071 When the service layer detects that the embedded device has a state switch, it determines whether the state switch satisfies the adjustment condition of the hardware resources.
  • the service layer can monitor the state of the embedded device (also referred to as the state of the machine) in real time during the running process of the embedded device.
  • the service layer detects that the state of the embedded device changes, that is, when the embedded device switches state, it can further detect whether the state switch satisfies the adjustment condition of hardware resources. If the service layer determines that the state switching satisfies the adjustment condition of the hardware resource, step 1072 may be executed. If the service layer determines that the state switching does not meet the adjustment condition of the hardware resource, the operation can be ended, that is, the running state of the hardware resource is not adjusted. And, the service layer can continue to monitor the state of the embedded device.
  • the adjustment condition may be pre-configured in the service layer, or may be carried in the configuration file.
  • the adjustment condition may include one or more of the following conditions: before and after the state switch, the change in the usage rate of hardware resources (for example, the CPU occupancy rate) is greater than the change amount threshold; after the state switch, the usage rate of hardware resources is less than Usage threshold; some processes are in a zombie state after state switching; tasks executed by the embedded device after state switching are tasks whose performance consumption is lower than the consumption threshold.
  • the running state of the hardware resource can be adjusted when the state switching meets the adjustment condition, the situation of frequently adjusting the running state of the hardware resource and causing the unstable state of the embedded device can be avoided.
  • Step 1072 The service layer detects whether the running state of the target hardware resource in the hardware layer satisfies the startup condition indicated by the second attribute.
  • the service layer When the service layer detects that the state switching of the embedded device satisfies the adjustment condition of the hardware resource, it can adjust the running state of the hardware resource included in the hardware layer based on the resource management policy in the configuration file. If the resource management policy includes a policy configuration item of the target hardware resource, the service layer can determine the target hardware resource in the hardware layer according to the identifier in the policy configuration item, and detect whether the target hardware resource satisfies the second attribute indication start condition.
  • step 1073 may be continued. If the service layer determines that the running state of the target hardware resource does not satisfy the start condition indicated by the second attribute, the operation can be ended, that is, the running state of the target hardware resource is not adjusted. In this way, it is possible to avoid incorrectly adjusting the running state of the hardware resources to affect the performance of the embedded device, and to ensure the reliability of resource scheduling.
  • Step 1073 The service layer adjusts the running state of the target hardware resource according to the resource management mode indicated by the first attribute.
  • the service layer determines that the running state of the target hardware resource satisfies the startup condition indicated by the second attribute, it can adjust the running state of the target hardware resource according to the resource management mode indicated by the first attribute.
  • the target hardware resource is a certain processor core in the hardware layer
  • the resource management method indicated by the first attribute is: shutting down the processor core
  • the second attribute indicating The startup condition is: the occupancy rate of the processor core is less than 10%.
  • the service layer can turn off the processor core when detecting that the occupancy rate of the processor core is less than 10%.
  • the hardware layer may include various hardware resources, for example, may include processors, memory, network cards, ECUs, MCUs, peripherals, etc., and the processors may also include multiple different processor cores. Therefore, the resource management policy may include a plurality of policy configuration items of different hardware resources.
  • the service layer can adjust the running state of the corresponding hardware resource based on each policy configuration item, thereby realizing flexible scheduling of hardware resources in the hardware layer.
  • the meta-model stored by the configuration tool may be newly added for the hardware
  • the strategy config item for resource management After the configuration tool generates a configuration file based on the meta-model, the configuration file can include the policy configuration item of the hardware resource.
  • the new policy configuration items in the meta-model can be as shown in Table 1.
  • the base type of the policy configuration item is AUTOSAR object (AR object) class. Referring to Table 1, it can be seen that the policy configuration item includes multiple attributes (attribute, attr).
  • the attribute name is: Shortname
  • the attribute type (type) can be a string (String)
  • the configurable number of the attribute is 1
  • the attribute can be used to identify the name of the policy configuration item.
  • the name of the strategy configuration item for CPU can be: CPU Strategy Config.
  • the attribute name is:
  • the type of the attribute CpuId can be a non-negative integer, and the configurable number of this attribute is 1. This attribute can be used to identify the processor to which the processor core belongs (corresponding to the one in the machine parameter). processor), and the value range of this attribute can be greater than or equal to 0.
  • Attribute name The type of the attribute of CoreId can be a non-negative integer, and the configurable number is 1. This attribute can be used to identify the processor core (corresponding to the Processor Core in the machine parameter), and the value range of this attribute can be greater than or equal to 0.
  • the attribute name is: Method (method)
  • the type of the attribute can be an enumeration (enum) class, the configurable number is 1, this attribute can be used to indicate the resource management method, and its value can be reduced (reduce) work frequency or close.
  • the attribute name is: Threshold (threshold)
  • the type of the attribute can be a non-negative integer, and the configurable number is 0 or 1.
  • This attribute can be used to indicate the lower limit that the occupancy rate needs to reach when resource management is started, and its The value range can be [0,100]. That is, when the occupancy rate of the processor core is greater than the value of the attribute named Threshold, the service layer can run the processor core according to the resource management method indicated by the attribute named Method. status is adjusted.
  • the configurable number of attributes in Table 1 refers to whether the attribute needs to be included in the policy configuration item. If the configurable number is 1, it means that the policy configuration item should contain the attribute; if the configurable number is 0 or 1, it means that the policy configuration item can contain this attribute or not. . For example, in the policy configuration item of the processor core shown in Table 1, it is not necessary to include the attribute named Threshold.
  • the identifier of the processor core includes the following: the value of the attribute named CpuId, and the value of the attribute named CpuId.
  • the new policy configuration items in the meta-model can be shown in Table 2.
  • the policy configuration item may also include multiple attributes.
  • the type of the attribute named: Shortname can be a string, the configurable number of the attribute is 1, and the attribute can be used to identify the name of the policy configuration item.
  • the name could be: Device Power Config.
  • the attribute name is:
  • the type of the attribute of DeviceID can be a non-negative integer, the configurable number of the attribute is 1, and the attribute can be used to identify the identification of the peripheral device that needs to be managed.
  • the attribute name is:
  • the type of the attribute of Method can be an enumeration class, and the configurable number is 1.
  • This attribute can be used to indicate the resource management method. For example, the value of this attribute can be reduced operating frequency or closed.
  • the target service module can perform resource management on the hardware resource according to the device state during the running process of the embedded device. For example, if the configuration file includes the resource configuration item of the lidar, and the value of the attribute named Method in the resource configuration item is off, the target service module can turn off the power of the lidar in the parking state. If the configuration file includes the resource configuration item of the front camera, and the value of the attribute named Method in the resource configuration item is off, the target service module can turn off the power of the front camera when reversing.
  • the sequence of steps of the above-mentioned parameter configuration method provided in the embodiment of the present application may be appropriately adjusted, and the steps may be correspondingly increased or decreased according to the situation.
  • the above step 101 may be deleted according to the situation.
  • the above step 1071 can be deleted according to the situation, that is, the service layer can directly adjust the operating state of the hardware resource according to the resource management policy when detecting that the embedded device has state switching, without judging whether the state switching satisfies the adjustment condition.
  • the above step 1072 may also be deleted according to the situation, that is, the second attribute may not be included in the policy configuration item.
  • the service layer does not need to first determine whether the running state of the target hardware resource satisfies the startup condition, but can directly adjust the running state of the target hardware resource according to the resource management mode indicated by the first attribute.
  • the method may include:
  • Step 201 read the configuration file.
  • the configuration file stored in the hardware layer may be read first. Afterwards, the EM module can perform the following steps 202 , 203 and 204 .
  • Step 202 Start other service modules in the service layer based on the configuration file, and start the application of the application layer.
  • the EM can activate other service modules (such as the CM module and the SM module, etc.) in the service layer, and start the application of the application layer.
  • service modules such as the CM module and the SM module, etc.
  • Step 203 Start the command monitoring function.
  • the EM module may start the command monitoring function based on the configuration file, and execute step 205 .
  • Step 204 Activate the status monitoring function.
  • the EM module may also enable a state monitoring function based on the configuration file, and execute step 209 .
  • Step 205 Detect whether an instruction is received.
  • step 206 may be executed; if the EM module does not receive the instruction, step 205 may be continued to be executed, that is, to detect whether the instruction is received.
  • Step 206 Parse the instruction type.
  • the EM module After the EM module receives the instruction, it can parse the instruction to determine the instruction type of the instruction.
  • Step 207 If the instruction is a configuration instruction, acquire hardware resource parameters.
  • the EM module determines that the instruction is a configuration instruction issued by the configuration tool for instructing to acquire hardware resource parameters, the EM module can acquire the hardware resource parameters of the hardware resources included in the hardware layer based on the configuration instruction.
  • Step 208 Send the hardware resource parameters to the configuration tool.
  • the hardware resource parameters can be sent to the configuration tool through the communication interface.
  • Step 209 Detect whether there is a state switch.
  • step 204 after the EM module starts the state monitoring function, it can monitor the state of the embedded device in real time, and determine whether the state of the embedded device is switched. If the EM module determines that the state of the embedded device has been switched, step 210 may be performed; if the EM module determines that the state of the embedded device has not been switched, it may continue to perform step 209, that is, continue to monitor the state of the embedded device.
  • the EM module can determine that there is a state switch in the embedded device when it detects that a new process is started or a process is restarted.
  • Step 210 Determine whether the state switching satisfies the adjustment condition of the hardware resource.
  • the EM module can continue to judge whether the state switching satisfies the adjustment condition of the hardware resources, that is, whether the state switching affects the scheduling of the hardware resources. If the EM module determines that the state switch satisfies the adjustment condition of the hardware resource, step 211 may be performed; if the EM module determines that the state switch does not satisfy the adjustment condition of the hardware resource, then step 209 may be performed. For the implementation process of this step 210, reference may be made to the foregoing step 1071, which will not be repeated here.
  • Step 211 Determine whether the running state of the hardware resource needs to be adjusted according to the resource management policy in the configuration file.
  • step 212 may be performed; if the EM module determines that the operating state of the hardware resource does not need to be adjusted, step 209 may be performed.
  • step 211 reference may be made to the foregoing step 1072, which will not be repeated here.
  • Step 212 Adjust the running state of the hardware resources included in the hardware layer.
  • the EM module determines that the operating state of the hardware resource needs to be adjusted, it can adjust the operating state of the hardware resource included in the hardware layer according to the resource management mode indicated by the first attribute in the resource management policy.
  • the EM module determines that the operating state of the hardware resource needs to be adjusted, it can adjust the operating state of the hardware resource included in the hardware layer according to the resource management mode indicated by the first attribute in the resource management policy.
  • the service layer adjusts the running state of the processor based on the resource management policy in the configuration file to achieve the following effects:
  • the processor core When it is detected that the CPU occupancy rate of a certain processor core is lower than the threshold value, or the task is not executed, the processor core is turned off, or the frequency of the processor core is reduced.
  • the processor core whose frequency is turned off or reduced may be a high-performance processor core in the CPU.
  • some processor cores can be turned off , or reduce the frequency of some processor cores.
  • the method provided by the embodiment of the present application can flexibly schedule the CPU based on the state of the embedded device during the running process of the embedded device, that is, the method provided by the embodiment of the present application can realize the hot swap of the CPU.
  • the embodiment of the present application provides a parameter configuration method, and the service layer in the embedded device can directly obtain the hardware resource parameters of the hardware layer, and send the hardware resource parameters to the AUTOSAR development tool. Since the developer does not need to manually input the hardware resource parameters in the development tool, the configuration efficiency of the parameters can be effectively improved, thereby improving the development efficiency of the application.
  • the service layer can also adjust the running state of hardware resources based on the resource management policy in the configuration file, it can be a flexible scheduling of the hardware resources, which can ensure that the embedded device can be effectively operated without affecting the normal operation of the embedded device. Reduce the power consumption of the embedded device.
  • Embodiments of the present application further provide an embedded device, which can be applied to a vehicle, for example, can be applied to a smart car, a connected car, or a new energy car.
  • the embedded device adopts AUTOSAR, for example, the AUTOSAR AP architecture or the AUTOSAR CP architecture can be adopted.
  • the embedded device may include a hardware layer 01 , a service layer 03 and an application layer 04 .
  • the service layer 03 includes:
  • a resource management module 032 configured to acquire hardware resource parameters of the hardware layer.
  • the resource management module 032 reference may be made to the relevant descriptions of step 102 and step 207 in the foregoing method embodiments.
  • the communication interface 031 is used to send the hardware resource parameters to the AUTOSAR development tool, and the hardware resource parameters are used for the AUTOSAR development tool to generate an executable file and a configuration file, and the executable file and the configuration file can be stored in the embedded in the hardware layer of the device.
  • the communication interface 031 For the functional realization of the communication interface 031, reference may be made to the relevant descriptions of step 103 and step 208 in the foregoing method embodiments.
  • the running module 033 is configured to run the executable file based on the configuration file.
  • the running module 033 reference may be made to the relevant description of step 106 in the foregoing method embodiments.
  • the configuration file includes a resource management policy; the resource management module 032 may also be configured to adjust the running state of the hardware resources included in the hardware layer based on the resource management policy.
  • the resource management module 032 For the function implementation of the resource management module 032, reference may also be made to the relevant descriptions of step 107 and step 212 in the foregoing method embodiments.
  • the resource management policy includes: an identifier of the target hardware resource and a first attribute, where the first attribute is used to indicate a resource management mode for the target hardware resource; the resource management module 032 can be used for: according to the first attribute The resource management mode indicated by the attribute adjusts the running state of the target hardware resource indicated by this flag.
  • the resource management policy further includes: a second attribute; the second attribute is used to indicate a start condition for performing resource management on the target hardware resource; the resource management module 032 can be used for: if the target indicated by the identifier is determined If the running state of the hardware resource satisfies the startup condition indicated by the second attribute, the running state of the target hardware resource is adjusted according to the resource management mode indicated by the first attribute.
  • step 1072 For the function implementation of the resource management module 032, reference may also be made to the relevant description of step 1072 in the foregoing method embodiment.
  • the resource management manner includes: turning off the target hardware resource, or reducing the working frequency of the target hardware resource.
  • the resource management module 032 may be configured to adjust the running state of the hardware resource based on the resource management policy if it is detected that the embedded device has a state switch, and the state switch satisfies the adjustment condition of the hardware resource.
  • step 1071 For the function implementation of the resource management module 032, reference may also be made to the relevant descriptions of step 1071, step 209, and step 210 in the foregoing method embodiment.
  • the resource management module 032 may be configured to: receive a configuration command sent by the AUTOSAR development tool; and obtain hardware resource parameters of the hardware layer based on the configuration command.
  • the resource management module 032 For the function implementation of the resource management module 032, reference may also be made to step 102 and the related descriptions of 205 to 207 in the foregoing method embodiment.
  • the hardware resource parameters acquired by the resource management module 032 may include: machine parameters and system parameters.
  • the embodiments of the present application provide an embedded device, in which the service layer of the embedded device can directly obtain the hardware resource parameters of the hardware layer, and send the hardware resource parameters to the AUTOSAR development tool. Since the developer does not need to manually input the hardware resource parameters in the development tool, the configuration efficiency of the parameters can be effectively improved, thereby improving the development efficiency of the application.
  • the service layer can also adjust the running state of hardware resources based on the resource management policy in the configuration file, it can be a flexible scheduling of the hardware resources, which can ensure that the embedded device can be effectively operated without affecting the normal operation of the embedded device. Reduce the power consumption of the embedded device.
  • the embedded device provided by the embodiments of the present application may also be implemented by an application-specific integrated circuit (ASIC), or a programmable logic device (PLD), and the above-mentioned PLD may be a complex Program logic device (complex programmable logical device, CPLD), field-programmable gate array (field-programmable gate array, FPGA), general array logic (generic array logic, GAL) or any combination thereof.
  • ASIC application-specific integrated circuit
  • PLD programmable logic device
  • CPLD complex programmable logical device
  • FPGA field-programmable gate array
  • GAL general array logic
  • the parameter configuration method provided by the above method embodiments may also be implemented by software.
  • each module in the embedded device may also be a software module.
  • FIG. 10 is a schematic structural diagram of an embedded device provided by an embodiment of the present application.
  • the embedded device may include: a processor 1001 , a memory 1002 , a network interface 1003 and a bus 1004 .
  • the bus 1004 is used to connect the processor 1001 , the memory 1002 and the network interface 1003 .
  • the communication connection with other devices can be realized through the network interface 1003 (which may be wired or wireless).
  • the memory 1002 stores a computer program 10021 for realizing various application functions.
  • the processor 1001 may be a CPU, and the processor 1001 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays ( FPGA), GPU or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSPs digital signal processors
  • ASICs application specific integrated circuits
  • FPGA field programmable gate arrays
  • GPU GPU or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or any conventional processor or the like.
  • Memory 1002 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
  • enhanced synchronous dynamic random access memory enhanced SDRAM, ESDRAM
  • synchronous link dynamic random access memory direct rambus RAM, DR RAM
  • bus 1004 may also include a power bus, a control bus, a status signal bus, and the like. However, for clarity of illustration, the various buses are labeled as bus 1004 in the figure.
  • the processor 1001 is configured to execute the computer program stored in the memory 1002, and the processor 1001 implements the steps in the above method embodiments by executing the computer program 10021.
  • Embodiments of the present application further provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and the instructions are executed by a processor to implement the steps in the foregoing method embodiments.
  • the embodiments of the present application also provide a computer program product containing instructions, when the computer program product is run on a computer, the computer is made to execute the steps in the above method embodiments.
  • Attributes means one or more, and the term “plurality” in this application means two or more, for example, a plurality of attributes means two or more Attributes.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media.
  • the semiconductor medium may be a solid state drive (SSD).

Landscapes

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

Abstract

本申请提供了一种参数配置方法、装置及系统,属于智能汽车领域。本申请提供的方案中,嵌入式设备的服务层可以直接获取硬件层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具,以便AUTOSAR开发工具生成配置文件和可执行文件。由于无需开发人员在开发工具中手工输入硬件资源参数,因此可以有效提高参数的配置效率,降低参数配置错误的概率,进而提高应用的开发效率。其中,该嵌入式设备能够应用在智能汽车、网联汽车或新能源汽车等车辆中。

Description

参数配置方法、装置及系统
本申请要求于2020年11月27日提交的申请号为202011364749.6、发明名称为“参数配置方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及智能汽车领域,特别涉及一种参数配置方法、装置及系统。
背景技术
汽车开放系统架构(automotive open system architecture,AUTOSAR)是为汽车工业开发的一个开放的且标准化的软件架构。
在基于AUTOSAR开发应用时,用户可以通过远程终端(Telnet)或安全外壳(secure shell,ssh)等协议远程连接设备,并通过输入命令行的方式确定设备的硬件形态。或者,用户可以查看硬件手册确定设备的硬件形态。之后,用户可以根据该硬件形态在AUTOSAR的配置工具中手工输入硬件资源参数。该配置工具可以基于用户输入的硬件配置参数生成描述文件,AUTOSAR的生成工具进而可以再基于该描述文件生成配置文件和可执行文件。
但是,上述开发流程中,由于需要用户手工输入硬件资源参数,导致参数配置效率较低。
发明内容
本申请提供了一种参数配置方法、装置及系统,可以解决手工配置参数而导致的参数配置效率较低的问题。
一方面,提供了一种参数配置方法,应用于采用AUTOSAR的嵌入式设备,该嵌入式设备包括硬件层、服务层以及应用层;该方法包括:该服务层获取该硬件层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具,该硬件资源参数用于供该AUTOSAR开发工具生成可执行文件和配置文件,该可执行文件和该配置文件能够存储在该硬件层中;之后,该服务层即可基于该配置文件,运行该可执行文件。
由于服务层可以直接获取硬件层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具,因此无需开发人员在开发工具中手工输入硬件资源参数,进而可以有效提高参数的配置效率并降低参数配置错误的概率。
可选地,该配置文件包括资源管理策略;该方法还可以包括:该服务层基于该资源管理策略,调整该硬件层所包括的硬件资源的运行状态。
服务层基于配置文件中的资源管理策略,可以实现对硬件资源的灵活调度。
可选地,该资源管理策略可以包括:目标硬件资源的标识和第一属性,该第一属性用于指示针对该目标硬件资源的资源管理方式;服务层基于该资源管理策略,调整该硬件层所包括的硬件资源的运行状态的过程可以包括:该服务层按照该第一属性指示的资源管理方式,调整该标识指示的目标硬件资源的运行状态。
该资源管理策略中,不同的硬件资源可以配置有不同的资源管理方式,使得该服务层可以基于该资源管理策略对不同硬件资源的运行状态进行针对性的调整。
可选地,该资源管理策略还可以包括:第二属性;该第二属性用于指示对该目标硬件资源进行资源管理的启动条件;该服务层按照该第一属性指示的资源管理方式,调整该标识指 示的目标硬件资源的运行状态的过程可以包括:该服务层若确定该标识指示的目标硬件资源的运行状态满足该第二属性指示的启动条件,则按照该第一属性指示的资源管理方式,调整该目标硬件资源的运行状态。
也即是,服务层可以在确定目标硬件资源的运行状态满足该启动条件后,再调整该目标硬件资源的运行状态。若服务层确定目标硬件资源的运行状态不满足该启动条件,则无需调整该目标硬件资源的运行状态。由此,可以避免误调整硬件资源的运行状态而影响嵌入式设备的性能,确保了资源调度的可靠性。
可选地,该资源管理方式包括:关闭该目标硬件资源,或者,降低该目标硬件资源的工作频率。
服务层通过关闭目标硬件资源或降低目标硬件资源的工作频率,可以有效降低嵌入式设备的功耗。
可选地,该服务层基于该资源管理策略,调整该硬件层所包括的硬件资源的运行状态的过程可以包括:服务层若检测到该嵌入式设备存在状态切换,且该状态切换满足硬件资源的调整条件,则基于该资源管理策略,调整该硬件资源的运行状态。
其中,该调整条件可以是服务层中预先配置的,或者可以携带在该配置文件中。通过在状态切换满足调整条件时再调整该硬件资源的运行状态,可以避免频繁调整硬件资源的运行状态而导致嵌入式设备状态不稳定的情况。
可选地,该服务层获取该硬件层的硬件资源参数的过程可以包括:该服务层接收该AUTOSAR开发工具发送的配置命令;该服务层基于该配置命令,获取该硬件层的硬件资源参数。
可选地,该硬件资源参数可以包括:机器参数和系统参数。其中,该机器参数至少可以包括:处理器的相关参数、内存的相关参数以及硬盘的相关参数。该系统参数可以包括网络参数,比如可以包括网卡的相关参数。
另一方面,提供了一种嵌入式设备,该嵌入式设备采用AUTOSAR,且该嵌入式设备包括硬件层、服务层以及应用层;该服务层可以包括通信接口和至少一个模块,该通信接口和至少一个模块可以用于实现上述方面所提供的参数配置方法。
又一方面,提供了一种嵌入式设备,该嵌入式设备采用AUTOSAR,且该嵌入式设备包括存储器和处理器;该存储器用于存储计算机程序;该处理器用于执行该存储器中存储的计算机程序以使得该嵌入式设备执行上述方面所提供的参数配置方法。
再一方面,提供了一种参数配置系统,该系统包括:AUTOSAR开发工具,以及如上述方面所提供的嵌入式设备;其中,该AUTOSAR开发工具,用于基于该嵌入式设备的服务层发送的硬件资源参数生成可执行文件和配置文件。
再一方面,提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,所述指令由处理器执行以实现上述方面所提供的参数配置方法。
再一方面,提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述方面所提供的参数配置方法。
再一方面,提供了一种芯片,该芯片包括可编程逻辑电路和/或程序指令,该芯片运行时用于实现上述方面所提供的参数配置方法。
本申请提供的技术方案至少包括以下有益效果:
本申请提供了一种参数配置方法、装置及系统,嵌入式设备的服务层可以直接获取硬件 层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具,以便AUTOSAR开发工具生成配置文件和可执行文件。由于无需开发人员在开发工具中手工输入硬件资源参数,因此可以有效提高参数的配置效率,降低参数配置错误的概率,进而提高应用的开发效率。
附图说明
图1是本申请实施例提供的一种AUTOSAR AP的架构图;
图2是本申请实施例提供的一种参数配置方法的应用场景的示意图;
图3是本申请实施例提供的一种参数配置方法的流程图;
图4是本申请实施例提供的一种服务层中目标服务模块的结构示意图;
图5是本申请实施例提供的一种配置工具的配置界面的示意图;
图6是本申请实施例提供的另一种配置工具的配置界面的示意图;
图7是本申请实施例提供的一种调整硬件资源的运行状态的方法流程图;
图8是本申请实施例提供的另一种参数配置方法的流程图;
图9是本申请实施例提供的一种服务层的结构示意图;
图10是本申请实施例提供的一种嵌入式设备的结构示意图。
具体实施方式
下面结合附图详细介绍本申请实施例提供的参数配置方法、装置及系统。
AUTOSAR分层软件架构中的基础软件(basic software,BSW)层能够应用于不同厂家生产的车辆以及不同供应商提供的电子部件,从而降低了研发费用,能够适应日趋复杂的汽车电气和软件构架。AUTOSAR主要包括两种不同类型的平台:
1、AUTOSAR经典平台(classic platform,CP)。AUTOSAR CP是基于汽车电子类开放系统和对应接口(open systems and the corresponding interfaces for automotive electronics,OSEK)标准的嵌入式实时电子控制单元(electronic control unit,ECU)标准。该AUTOSAR CP的架构包括在微控制器上运行的应用层、运行环境(runtime environment,RTE)层以及BSW层。其中,应用层基本独立于硬件,应用层的软件组件之间通过RTE层进行通信,且软件组件访问BSW也需通过RTE。
2、AUTOSAR自适应平台(adaptive platform,AP)。AUTOSAR AP可以使用两种类型的接口:服务和应用程序编程接口(application programming interface,API)。该AUTOSAR AP由分布在服务层中的功能聚类和AUTOSAR自适应平台基础(AUTOSAR AP base)组成。
图1是本申请实施例提供的一种AUTOSAR AP的架构图,如图1所示,该AUTOSAR AP的架构可以包括:硬件(hardware)层01、操作系统(operating system,OS)接口(interface)02、服务层03以及应用层04。其中,该OS接口02可以为可移植操作系统接口(portable operating system interface,POSIX)。该服务层03可以包括多个中间件(middleware),该中间件也可以称为服务模块。
示例的,参考图1,该服务层03可以包括如下服务模块:通信管理(communication management,CM)模块、核心类型(core type)模块、RESTful模块、持久化(persistency)模块、执行管理(execution management,EM)模块、时间同步(time synchronization)模块、平台健康管理(platform health management,PHM)模块、身份识别与访问管理(identity and access management,IAM)模块、诊断(diagnostics)模块、日志和追踪(log and trace)模块、 加密(cryptograph)模块、状态管理(state management,SM)模块、网络管理(network management,NM)模块以及更新和配置管理(update and configuration management)模块等。其中,RESTful是一种基于表征状态转移(representational state transfer,REST)的开发方式。
随着汽车智能化和电气化的到来,汽车电子算力越来越高,内存越来越大,电子电气结构也越来越复杂。由此,导致AUTOSAR的配置项规模庞大,结构复杂,且学习门槛高。例如,随着设备硬件结构的复杂化,会导致用户需要手动输入的硬件资源参数增多,进而导致参数配置过程容易出错,且配置效率较低。
本申请实施例提供了一种参数配置方法,可以解决硬件资源参数配置效率较低的问题。图2是本申请实施例提供的一种参数配置方法的应用场景的示意图。如图2所示,该应用场景可以包括采用AUTOSAR的嵌入式设备001,以及AUTOSAR开发工具002。该AUTOSAR开发工具002可以包括配置工具0021和生成工具0022。该配置工具0021用于基于获取到的配置参数(包括硬件资源参数和功能性配置参数)生成描述文件。该生成工具0022用于基于该描述文件生成配置文件和可执行(executable,exe)文件。例如,该生成工具0022可以基于该描述文件生成代码文件,然后再对该代码文件进行编译得到可执行文件。
其中,该描述文件可以为AUTOSAR可扩展标记语言(AUTOSAR extensible markup language,arxml)格式的文件。该配置文件可以为JavaScript(一种脚本语言)对象简谱(JavaScript object notation,JSON)格式的文件。
图3是本申请实施例提供的一种参数配置方法的流程图,该方法可以应用于如图2所示的应用场景中。例如,该图2所示的嵌入式设备002可以采用AUTOSAR AP,且如图1所示,该嵌入式设备002可以包括硬件层01、服务层03以及应用层04。参考图2,该方法包括:
步骤101、配置工具向服务层发送配置指令。
在本申请实施例中,当配置工具需要获取嵌入式设备中硬件层的硬件资源参数以生成描述文件时,该配置工具可以向该服务层发送配置指令。该配置指令用于指示服务层获取硬件层的硬件资源参数。
可选地,该嵌入式设备的服务层包括的多个服务模块中可以存在一个目标服务模块,该目标服务模块能够与配置工具通信,并能够对硬件层包括的硬件资源进行调度和管理。该目标服务模块可以为服务层中的EM模块、SM模块、CM模块或PHM模块等。
图4是本申请实施例提供的一种服务层中目标服务模块的结构示意图。如图4所示,该目标服务模块可以包括通信接口031和资源管理模块032。其中,该通信接口031用于与配置工具通信。相应的,该配置工具可以向该服务层中目标服务模块的通信接口031发送该配置指令。该资源管理模块032包括解析子模块032a和管理子模块032b。该解析子模块032a用于解析并获取硬件层的硬件资源参数,该管理子模块032b用于对硬件层包括的硬件资源进行调度和管理。
其中,该通信接口031可以为基于传输控制协议(transmission control protocol,TCP)、超文本传输协议(hypertext transfer protocol,HTTP)或者远程过程调用(remote procedure call,RPC)等协议开发的接口。
步骤102、服务层基于该配置指令,获取硬件层的硬件资源参数。
嵌入式设备的服务层接收到该配置指令后,即可响应于该配置指令,获取硬件层的硬件资源参数。在本申请实施例中,该硬件资源参数可以包括机器(machine)参数和系统(system) 参数。该machine参数至少可以包括:处理器(processor)的相关参数、内存的相关参数以及硬盘的相关参数。该system参数可以包括网络参数,例如可以包括网卡的相关参数。其中,该处理器可以包括中央处理器(central processing unit,CPU)、等,且该处理器可以包括多个处理器核(core)。
可选地,除了该machine参数和system参数之外,该硬件资源参数还可以包括其他类型参数,该其他类型参数可以包括电子控制单元(electronic control unit,ECU)的相关参数、微控制单元(micro-controller unit,MCU)的相关参数以及外设(例如摄像头和激光雷达等传感器)的相关参数等。
参考图4,该服务层中的目标服务模块的通信接口031接收到配置指令后,可以将该配置指令发送至资源管理模块032。该资源管理模块032中的解析子模块032a进而可以响应于该配置指令,获取硬件层的硬件资源参数。
步骤103、服务层将该硬件资源参数发送至配置工具。
服务层获取到硬件资源参数后,即可将该硬件资源参数发送至AUTOSAR开发工具中的配置工具。该硬件资源参数用于供该配置工具生成描述文件,该开发工具中的生成工具进而可以基于该描述文件生成可执行文件和配置文件。
示例的,参考图4,该服务层中的目标服务模块可以通过通信接口031将获取到的硬件资源参数发送至配置工具。
图5是本申请实施例提供的一种配置工具的配置界面的示意图,如图5所示,该配置工具接收到的服务层发送的机器参数可以包括CPU的相关参数,该CPU的相关参数可以包括CPU中每个core的参数。例如,参考图5,该CPU的相关参数可以包括CPU0中core0至core3的参数,以及CPU1中core0和core1的参数。其中,每个core的参数可以包括如下属性:类别(category)、总和校验码(checksum)、核ID(core ID)、简称(short name)、时间戳(timestamp)以及通用唯一识别码(universally unique identifier,UUID)。
图6是本申请实施例提供的另一种配置工具的配置界面的示意图,如图6所示,该配置工具接收到的服务层发送的系统参数可以包括以太网的相关参数。参考图6,该以太网的相关参数可以包括如下属性(property)中的至少一种:波特率(baudrate)、总和校验码、耦合端口开关时延(coupling port switchoff delay)、协议名称(protocol name)、协议版本(protocol version)、速率(speed)和时间戳(timestamp)。
该以太网的相关参数还可以包括互联网协议版本4(Internet protocol version 4,IPv4)的配置参数,该IPv4配置参数可以包括如下属性中的至少一种:指定优先级(assignment priority)、总和校验码、缺省网关(default gateway)、域名系统(domain name system,DNS)服务器地址(server address)、IP地址保持行为(IP address keep behavior)、IPv4地址(IPv4address)、IPv4地址源(IPv4address source)、网络掩码(network mask)、时间戳以及生存时间值(time to live,TTL)。其中,属性:IP地址保持行为的值(value)为:持续存储(store persistently),属性:IPv4地址源的值为:DHCPV-4,其表示用于配置IPv4主机所需的IP地址的动态主机配置协议(dynamic host configuration protocol,DHCP)。
步骤104、配置工具基于该硬件资源参数生成描述文件。
在本申请实施例中,该配置工具中预先配置有AUTOSAR元模型。配置工具接收到服务层发送的硬件资源参数后,可以基于该硬件资源参数和该元模型生成AUTOSAR模型。该过程也可以称为:将该硬件资源参数映射成AUTOSAR模型。之后,将该AUTOSAR模型从配置 工具的内存导出至配置工具的硬盘,即可得到描述文件。该描述文件可以为.arxml格式的文件。
其中,AUTOSAR元模型是一种用于定义描述AUTOSAR系统的语言的统一建模语言(unified modeling language,UML)模型,其是模板(模板定义了如软件组件和ECU之类的结构来创建AUTOSAR软硬件系统)的图形化表示。AUTOSAR模型是AUTOSAR模型的实例。
步骤105、生成工具基于该描述文件生成可执行文件和配置文件。
配置工具生成描述文件后,生成工具可以获取该描述文件,并基于该描述文件生成可执行文件和配置文件。其中,该可执行文件可以为.exe格式的文件,该配置文件可以为.jason格式的文件。在本申请实施例中,开发人员还可以将该生成工具生成的可执行文件和该配置文件均存储至嵌入式设备的硬件层中。
步骤106、服务层基于该配置文件,运行该可执行文件。
在本申请实施例中,该服务层可以读取硬件层中的配置文件,并基于该配置文件运行该可执行文件。
步骤107、服务层基于该配置文件中的资源管理策略,调整该硬件层所包括的硬件资源的运行状态。
该配置文件中可以包括资源管理策略,服务层可以在嵌入式设备运行的过程中,基于该资源管理策略,调整该硬件层所包括的硬件资源的运行状态。由此,可以实现对该硬件资源的灵活调度和管理,确保在不影响嵌入式设备正常运行的前提下,有效降低该嵌入式设备的功耗。
可选地,该配置文件中的资源管理策略可以包括:至少一个策略配置项,每个策略配置项用于指示对该硬件层中一种硬件资源的管理策略。以该硬件层中的目标硬件资源为例,该目标硬件资源的策略配置项可以包括:该目标硬件资源的标识和第一属性。该第一属性用于指示针对该目标硬件资源的资源管理方式,该资源管理方式可以包括:关闭该目标硬件资源,或者,降低该目标硬件资源的工作频率。
例如,若该目标硬件资源为处理器核,则该目标硬件资源的标识可以包括:处理器核的标识(identification,ID)以及该处理器核所属的处理器的ID。若该目标硬件资源为传感器,则该目标硬件资源的标识可以为该传感器的ID。
可以理解的是,该资源管理策略中,不同的硬件资源可以配置有不同的资源管理方式,由此该服务层可以基于该资源管理策略对不同硬件资源的运行状态进行针对性的调整。
在本申请实施例中,该目标硬件资源的策略配置项还可以包括第二属性,该第二属性用于指示对该目标硬件资源进行资源管理的启动条件。也即是,服务层可以在确定目标硬件资源的运行状态满足该启动条件后,再调整该目标硬件资源的运行状态。由此可以避免误调整资源的运行状态而影响嵌入式设备的性能,确保了资源调度的可靠性。
以该目标硬件资源的策略配置项包括:目标硬件资源的标识、第一属性和第二属性为例,对上述步骤107的实现过程进行介绍。参考图7,上述步骤107可以包括:
步骤1071、服务层检测到嵌入式设备存在状态切换时,判断该状态切换是否满足硬件资源的调整条件。
在本申请实施例中,该服务层可以在嵌入式设备运行过程中,实时监测嵌入式设备的状态(也可以称为机器的状态)。该服务层在检测到嵌入式设备的状态发生变化时,即嵌入式设备出现状态切换时,还可以进一步检测该状态切换是否满足硬件资源的调整条件。若服务层确定该状态切换满足硬件资源的调整条件,则可以执行步骤1072。若服务层确定该状态切 换不满足硬件资源的调整条件,则可以结束操作,即不对该硬件资源的运行状态进行调整。并且,该服务层可以继续对嵌入式设备的状态进行监测。
其中,该调整条件可以是服务层中预先配置的,或者可以携带在该配置文件中。例如,该调整条件可以包括下述条件中的一种或多种:状态切换前后,硬件资源的使用率(例如CPU占用率)的变化量大于变化量阈值;状态切换后硬件资源的使用率小于使用率阈值;状态切换后某些进程处于僵死状态;状态切换后该嵌入式设备所执行的任务为性能消耗量低于消耗量阈值的任务。
本申请实施例提供的方法,由于可以在状态切换满足调整条件时再调整该硬件资源的运行状态,因此可以避免频繁调整硬件资源的运行状态而导致嵌入式设备状态不稳定的情况。
步骤1072、服务层检测硬件层所中目标硬件资源的运行状态是否满足第二属性指示的启动条件。
服务层在检测到嵌入式设备的状态切换满足硬件资源的调整条件时,即可基于配置文件中的资源管理策略,调整该硬件层所包括的硬件资源的运行状态。若该资源管理策略中包括目标硬件资源的策略配置项,则服务层可以根据该策略配置项中的标识,确定硬件层中的目标硬件资源,并检测该目标硬件资源是否满足该第二属性指示的启动条件。
若服务层确定该目标硬件资源的运行状态满足该第二属性所指示的启动条件,则可以继续执行步骤1073。若服务层确定该目标硬件资源的运行状态不满足该第二属性所指示的启动条件,则可以结束操作,即不对该目标硬件资源的运行状态进行调整。由此,可以避免误调整硬件资源的运行状态而影响嵌入式设备的性能,确保了资源调度的可靠性。
步骤1073、服务层按照第一属性指示的资源管理方式,调整该目标硬件资源的运行状态。
若服务层确定该目标硬件资源的运行状态满足该第二属性所指示的启动条件,则可以按照该第一属性指示的资源管理方式,调整该目标硬件资源的运行状态。
示例的,假设该目标硬件资源为硬件层中的某个处理器核,且该处理器核的资源配置项中,第一属性指示的资源管理方式为:关闭处理器核,该第二属性指示的启动条件为:处理器核的占用率小于10%。则服务层可以在检测到该处理器核的占用率小于10%时,关闭该处理器核。
应理解的是,由于该硬件层可以包括多种硬件资源,例如可以包括处理器、内存、网卡、ECU、MCU和外设等,并且处理器还可以包括多个不同的处理器核。因此,该资源管理策略可以包括多个不同的硬件资源的策略配置项。相应的,该服务层可以基于每个策略配置项对相对应的硬件资源的运行状态进行调整,由此实现对该硬件层中硬件资源的灵活调度。
在本申请实施例中,对于硬件层中的至少一种硬件资源(比如处理器、内存、网卡、ECU、MCU和外设等),配置工具存储的元模型中可以新增有用于对该硬件资源进行资源管理的策略配置(strategy config)项。配置工具基于该元模型生成配置文件后,该配置文件中即可包括该硬件资源的策略配置项。
例如,以硬件层中的处理器为CPU为例,对于CPU中的处理器核,该元模型中新增的策略配置项可以如表1所示,该策略配置项的基础(base)类型为AUTOSAR对象(AR object)类。参考表1可以看出,该策略配置项包括多个属性(attribute,attr)。
其中,属性名为:Shortname的属性的类型(type)可以为字符串(String),该属性的可配置个数为1,该属性可以用于标识该策略配置项的名称。例如,对于CPU的策略配置项的名称可以为:CPU Strategy Config。
属性名为:CpuId的属性的类型可以为非负整数(non-negative integer),该属性的可配置个数为1,该属性可以用于标识处理器核所属的处理器(对应machine参数中的processor),且该属性的取值范围可以大于或等于0。
属性名为:CoreId的属性的类型可以为非负整数,可配置的个数为1,该属性可以用于标识处理器核(对应machine参数中的Processor Core),且该属性的取值范围可以大于或等于0。
属性名为:Method(方式)的属性的类型可以为枚举(enum)类,可配置的个数为1,该属性可以用于指示资源管理方式,且其取值可以为降低(reduce)工作频率或关闭(close)。
属性名为:Threshold(阈值)的属性的类型可以为非负整数,可配置的个数为0或者1,该属性可以用于指示启动资源管理时占用率所需达到的下限值,且其取值范围可以为[0,100]。也即是,当处理器核的占用率大于该属性名为Threshold的属性的取值时,服务层即可按照该属性名为Method的属性所指示的资源管理方式,对该处理器核的运行状态进行调整。
表1中属性的可配置的个数是指该策略配置项中是否需要包含该属性。若可配置的个数为1,则表示该策略配置项中应当包含该属性;若可配置的个数为0或1,则表示该策略配置项中可以包含该属性,也可以不包含该属性。例如表1所示的处理器核的策略配置项中,可以无需包含该属性名为Threshold的属性。
表1
Figure PCTCN2021117521-appb-000001
可以理解的是,配置工具基于上述元模型生成配置文件后,该配置文件中处理器核的策略配置项中,处理器核的标识即包括该:属性名为CpuId的属性的取值,以及该属性名为CoreId的属性的取值;第一属性即为该属性名为Method的属性的取值,第二属性即为该属性名为Threshold的属性的取值。还可以理解的是,该硬件层中ECU和MCU等硬件资源的策略配置项均可以参考表1。
对于该硬件层中的外设,该元模型中新增的策略配置项可以如表2所示。参考表2可以看出,该策略配置项也可以包括多个属性。其中,属性名为:Shortname的属性的类型可以为字符串,该属性的可配置个数为1,该属性可以用于标识该策略配置项的名称。例如,该名称可以为:Device Power Config。
属性名为:DeviceID的属性的类型可以为非负整数,该属性的可配置个数为1,该属性可以用于标识需要进行资源管理的外设的标识。
属性名为:Method的属性的类型可以为枚举类,可配置的个数为1,该属性可以用于指示资源管理方式。例如,该属性的取值可以为降低工作频率或关闭。
表2
Figure PCTCN2021117521-appb-000002
在本申请实施例中,若配置文件中包括某个硬件资源的资源配置项,则目标服务模块即可在嵌入式设备运行过程中,根据设备状态对该硬件资源进行资源管理。比如,假设配置文件包括激光雷达的资源配置项,且该资源配置项中属性名为Method的属性的取值为关闭,则目标服务模块可以在泊车状态下关闭该激光雷达的电源。若配置文件包括前置摄像头的资源配置项,且该资源配置项中属性名为Method的属性的取值为关闭,则目标服务模块可以在倒车时关闭该前置摄像头的电源。
还可以理解的是,本申请实施例提供的上述参数配置方法的步骤的先后顺序可以进行适当调整,步骤也可以根据情况进行相应增减。例如,上述步骤101可以根据情况删除。或者,上述步骤1071可以根据情况删除,即服务层可以在检测到嵌入式设备存在状态切换时,直接根据资源管理策略调整该硬件资源的运行状态,而无需判断该状态切换是否满足调整条件。又或者,上述步骤1072也可以根据情况删除,即该策略配置项中也可以不包括该第二属性。相应的,服务层无需先判断该目标硬件资源的运行状态是否满足启动条件,而是可以直接根据第一属性指示的资源管理方式调整目标硬件资源的运行状态。
下文以服务层中的EM模块为目标服务模块为例,对本申请实施例提供的参数配置方法进行介绍。参考图8,该方法可以包括:
步骤201、读取配置文件。
在本申请实施例中,该EM模块在启动后,可以先读取硬件层中存储的配置文件。之后,该EM模块可以执行下述步骤202、步骤203以及步骤204。
步骤202、基于配置文件启动服务层中的其他服务模块,以及启动应用层的应用。
EM可以基于该配置文件中的配置参数,动服务层中的其他服务模块(例如CM模块和SM模块等),以及启动应用层的应用。
步骤203、启动指令监听功能。
该EM模块可以基于该配置文件,启动指令监听功能,并执行步骤205。
步骤204、启动状态监听功能。
在本申请实施例中,该EM模块还可以基于配置文件启动状态监听功能,并执行步骤209。
步骤205、检测是否接收到指令。
该EM模块启动指令监听功能后,即可实时检测是否接收到其他设备(例如配置工具)发送的指令。若EM模块接收到指令,则可以执行步骤206;若EM模块未接收到指令,则可以继续执行步骤205,即进行检测是否接收到指令。
步骤206、解析指令类型。
EM模块接收到指令后,可以对该指令进行解析,以确定该指令的指令类型。
步骤207、若该指令为配置指令,则获取硬件资源参数。
若EM模块确定该指令为配置工具下发的用于指示获取硬件资源参数的配置指令,则EM模块可以基于该配置指令,获取硬件层所包括的硬件资源的硬件资源参数。
步骤208、将硬件资源参数发送至配置工具。
EM模块获取到硬件资源参数后,即可将该硬件资源参数通过通信接口发送至配置工具。
步骤209、检测是否存在状态切换。
在上述步骤204中,EM模块启动状态监听功能后,即可对嵌入式设备的状态进行实时监测,并判断该嵌入式设备的状态是否发生切换。若EM模块确定该嵌入式设备的状态发生切换,则可以执行步骤210;若EM模块确定该嵌入式设备的状态未切换,则可以继续执行步骤209,即继续对嵌入式设备的状态进行监测。
例如,该EM模块可以在检测到有新的进程被拉起,或者有进程重启时,确定该嵌入式设备存在状态切换。
步骤210、判断该状态切换是否满足硬件资源的调整条件。
EM模块在确定嵌入式设备的状态发生切换后,还可以继续判断该状态切换是否满足硬件资源的调整条件,即判定该状态切换是否影响硬件资源的调度。若EM模块确定该状态切换满足硬件资源的调整条件,则可以执行步骤211;若EM模块确定该状态切换不满足硬件资源的调整条件,则可以继续执行步骤209。该步骤210的实现过程可以参考上述步骤1071,此处不再赘述。
步骤211、根据配置文件中的资源管理策略,确定是否需要调整硬件资源的运行状态。
若EM模块确定该状态切换影响硬件资源的调度,则可以根据资源管理策略中的第二属性,确定是否需要调整硬件资源的运行状态。若EM模块确定需要调整硬件资源的运行状态,则可以执行步骤212;若EM模块确定无需调整硬件资源的运行状态,则可以继续执行步骤209。该步骤211的实现过程可以参考上述步骤1072,此处不再赘述。
步骤212、调整硬件层所包括的硬件资源的运行状态。
若EM模块确定需要调整硬件资源的运行状态,则可以按照该资源管理策略中的第一属性所指示的资源管理方式,调整硬件层所包括的硬件资源的运行状态。该步骤212的实现过程可以参考上述步骤1073,此处不再赘述。
示例的,该服务层基于配置文件中的资源管理策略,调整处理器的运行状态可以实现如下效果:
1、在检测到某个处理器核中运行的进程(例如自动驾驶进程)处于僵死状态时,将该处理器核关闭,或降低该处理器核的频率。
2、在检测到某个处理器核的CPU占用率低于阈值,或未执行任务时,将该处理器核关闭,或降低该处理器核的频率。
3、在检测到处理器的整体CPU占用率低于阈值时,将部分处理器核关闭,或降低部分处理器核的频率。其中,关闭或降低频率的处理器核可以为CPU中的高性能处理器核。
4、在检测到嵌入式设备当前执行的任务的资源消耗较低时,例如在检测到嵌入式设备执行升级任务,自动泊车任务,或者未处于自动驾驶状态时,可以将部分处理器核关闭,或降低部分处理器核的频率。
基于上述举例可知,本申请实施例提供的方法可以在嵌入式设备运行过程,基于嵌入式设备的状态对CPU进行灵活调度,即本申请实施例提供的方法可以实现CPU的热插拔。
综上所述,本申请实施例提供了一种参数配置方法,嵌入式设备中的服务层可以直接获 取硬件层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具。由于无需开发人员在开发工具中手工输入硬件资源参数,因此可以有效提高参数的配置效率,进而提高应用的开发效率。
并且,由于该服务层还可以基于配置文件中的资源管理策略调整硬件资源的运行状态,因此可以是对该硬件资源的灵活调度,进而可以确保在不影响嵌入式设备正常运行的前提下,有效降低该嵌入式设备的功耗。
本申请实施例还提供了一种嵌入式设备,该嵌入式设备可以应用于车辆中,例如可以应用于智能汽车、网联汽车或新能源汽车等。该嵌入式设备采用AUTOSAR,例如可以采用AUTOSAR AP架构或AUTOSAR CP架构。并且如图1所示,该嵌入式设备可以包括硬件层01、服务层03以及应用层04。如图4和图9所示,该服务层03包括:
资源管理模块032,用于获取该硬件层的硬件资源参数。该资源管理模块032的功能实现可以参考上述方法实施例中步骤102和步骤207的相关描述。
通信接口031,用于将该硬件资源参数发送至AUTOSAR开发工具,该硬件资源参数用于供该AUTOSAR开发工具生成可执行文件和配置文件,该可执行文件和该配置文件可以存储在该嵌入式设备的硬件层中。该通信接口031的功能实现可以参考上述方法实施例中步骤103和步骤208的相关描述。
运行模块033,用于基于该配置文件,运行该可执行文件。该运行模块033的功能实现可以参考上述方法实施例中步骤106的相关描述。
可选地,该配置文件包括资源管理策略;该资源管理模块032,还可以用于基于该资源管理策略,调整该硬件层所包括的硬件资源的运行状态。该资源管理模块032的功能实现还可以参考上述方法实施例中步骤107和步骤212的相关描述。
可选地,该资源管理策略包括:目标硬件资源的标识和第一属性,该第一属性用于指示针对该目标硬件资源的资源管理方式;该资源管理模块032可以用于:按照该第一属性指示的资源管理方式,调整该标识指示的目标硬件资源的运行状态。
该资源管理模块032的功能实现还可以参考上述方法实施例中步骤1073的相关描述。
可选地,该资源管理策略还包括:第二属性;该第二属性用于指示对该目标硬件资源进行资源管理的启动条件;该资源管理模块032可以用于:若确定该标识指示的目标硬件资源的运行状态满足该第二属性指示的启动条件,则按照该第一属性指示的资源管理方式,调整该目标硬件资源的运行状态。
该资源管理模块032的功能实现还可以参考上述方法实施例中步骤1072的相关描述。
可选地,该资源管理方式包括:关闭该目标硬件资源,或者,降低该目标硬件资源的工作频率。
可选地,该资源管理模块032可以用于:若检测到该嵌入式设备存在状态切换,且该状态切换满足硬件资源的调整条件,则基于该资源管理策略,调整该硬件资源的运行状态。
该资源管理模块032的功能实现还可以参考上述方法实施例中步骤1071、步骤209以及步骤210的相关描述。
可选地,该资源管理模块032可以用于:接收该AUTOSAR开发工具发送的配置命令;基于该配置命令,获取该硬件层的硬件资源参数。该资源管理模块032的功能实现还可以参考上述方法实施例中步骤102,以及205至207的相关描述。
可选地,该资源管理模块032获取到的硬件资源参数可以包括:机器参数和系统参数。
综上所述,本申请实施例提供了一种嵌入式设备,该嵌入式设备中的服务层可以直接获取硬件层的硬件资源参数,并将该硬件资源参数发送至AUTOSAR开发工具。由于无需开发人员在开发工具中手工输入硬件资源参数,因此可以有效提高参数的配置效率,进而提高应用的开发效率。
并且,由于该服务层还可以基于配置文件中的资源管理策略调整硬件资源的运行状态,因此可以是对该硬件资源的灵活调度,进而可以确保在不影响嵌入式设备正常运行的前提下,有效降低该嵌入式设备的功耗。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的嵌入式设备以及各模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
应理解的是,本申请实施例提供的嵌入式设备还可以用专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现上述方法实施例提供的参数配置方法,当通过软件实现上述方法实施例提供的参数配置方法时,该嵌入式设备中的各个模块也可以为软件模块。
图10是本申请实施例提供的一种嵌入式设备的结构示意图,参考图10,该嵌入式设备可以包括:处理器1001、存储器1002、网络接口1003和总线1004。其中,总线1004用于连接处理器1001、存储器1002和网络接口1003。通过网络接口1003(可以是有线或者无线)可以实现与其他设备之间的通信连接。存储器1002中存储有计算机程序10021,该计算机程序10021用于实现各种应用功能。
应理解,在本申请实施例中,处理器1001可以是CPU,该处理器1001还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)、GPU或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。
存储器1002可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。
总线1004除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线1004。
处理器1001被配置为执行存储器1002中存储的计算机程序,处理器1001通过执行该计算 机程序10021来实现上述方法实施例中的步骤。
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,该指令由处理器执行以实现如上述方法实施例中的步骤。
本申请实施例还提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述方法实施例中的步骤。
应当理解的是,在本申请实施例中提及的“和/或”,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
本申请中术语“至少一个”的含义是指一个或多个,本申请中术语“多个”的含义是指两个或两个以上,例如,多个属性是指两个或两个以上的属性。
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。
以上所述,仅为本申请的可选实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种参数配置方法,其特征在于,应用于采用汽车开放系统架构AUTOSAR的嵌入式设备,所述嵌入式设备包括硬件层、服务层以及应用层;所述方法包括:
    所述服务层获取所述硬件层的硬件资源参数;
    所述服务层将所述硬件资源参数发送至AUTOSAR开发工具,所述硬件资源参数用于供所述AUTOSAR开发工具生成可执行文件和配置文件,所述可执行文件和所述配置文件存储在所述硬件层中;
    所述服务层基于所述配置文件,运行所述可执行文件。
  2. 根据权利要求1所述的方法,其特征在于,所述配置文件包括资源管理策略;所述方法还包括:
    所述服务层基于所述资源管理策略,调整所述硬件层所包括的硬件资源的运行状态。
  3. 根据权利要求2所述的方法,其特征在于,所述资源管理策略包括目标硬件资源的标识和第一属性,所述第一属性用于指示针对所述目标硬件资源的资源管理方式;
    所述服务层基于所述资源管理策略,调整所述硬件层所包括的硬件资源的运行状态,包括:
    所述服务层按照所述第一属性指示的资源管理方式,调整所述标识指示的目标硬件资源的运行状态。
  4. 根据权利要求3所述的方法,其特征在于,所述资源管理策略还包括:第二属性;所述第二属性用于指示对所述目标硬件资源进行资源管理的启动条件;
    所述服务层按照所述第一属性指示的资源管理方式,调整所述标识指示的目标硬件资源的运行状态,包括:
    所述服务层若确定所述标识指示的目标硬件资源的运行状态满足所述第二属性指示的启动条件,则按照所述第一属性指示的资源管理方式,调整所述目标硬件资源的运行状态。
  5. 根据权利要求3或4所述的方法,其特征在于,所述资源管理方式包括:关闭所述目标硬件资源,或者,降低所述目标硬件资源的工作频率。
  6. 根据权利要求2至5任一所述的方法,其特征在于,所述服务层基于所述资源管理策略,调整所述硬件层所包括的硬件资源的运行状态,包括:
    所述服务层若检测到所述嵌入式设备存在状态切换,且所述状态切换满足硬件资源的调整条件,则基于所述资源管理策略,调整所述硬件资源的运行状态。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述服务层获取所述硬件层的硬件资源参数,包括:
    所述服务层接收所述AUTOSAR开发工具发送的配置命令;
    所述服务层基于所述配置命令,获取所述硬件层的硬件资源参数。
  8. 根据权利要求1至7任一所述的方法,其特征在于,所述硬件资源参数包括:机器参数和系统参数。
  9. 一种嵌入式设备,其特征在于,所述嵌入式设备采用汽车开放系统架构AUTOSAR,且所述嵌入式设备包括硬件层、服务层以及应用层;所述服务层包括:
    资源管理模块,用于获取所述硬件层的硬件资源参数;
    通信接口,用于将所述硬件资源参数发送至AUTOSAR开发工具,所述硬件资源参数用于供所述AUTOSAR开发工具生成可执行文件和配置文件,所述可执行文件和所述配置文件存储在所述硬件层中;
    运行模块,用于基于所述配置文件,运行所述可执行文件。
  10. 根据权利要求9所述的设备,其特征在于,所述配置文件包括资源管理策略;所述资源管理模块还用于:
    基于所述资源管理策略,调整所述硬件层所包括的硬件资源的运行状态。
  11. 根据权利要求10所述的设备,其特征在于,所述资源管理策略包括:目标硬件资源的标识和第一属性,所述第一属性用于指示针对所述目标硬件资源的资源管理方式;
    所述资源管理模块,用于:
    按照所述第一属性指示的资源管理方式,调整所述标识指示的目标硬件资源的运行状态。
  12. 根据权利要求11所述的设备,其特征在于,所述资源管理策略还包括:第二属性;所述第二属性用于指示对所述目标硬件资源进行资源管理的启动条件;
    所述资源管理模块,用于:
    若确定所述标识指示的目标硬件资源的运行状态满足所述第二属性指示的启动条件,则按照所述第一属性指示的资源管理方式,调整所述目标硬件资源的运行状态。
  13. 根据权利要求11或12所述的设备,其特征在于,所述资源管理方式包括:关闭所述目标硬件资源,或者,降低所述目标硬件资源的工作频率。
  14. 根据权利要求10至13任一所述的设备,其特征在于,所述资源管理模块,用于:
    若检测到所述嵌入式设备存在状态切换,且所述状态切换满足硬件资源的调整条件,则基于所述资源管理策略,调整所述硬件资源的运行状态。
  15. 根据权利要求9至14任一所述的设备,其特征在于,所述资源管理模块,用于:
    接收所述AUTOSAR开发工具发送的配置命令;
    基于所述配置命令,获取所述硬件层的硬件资源参数。
  16. 根据权利要求9至15任一所述的设备,其特征在于,所述硬件资源参数包括:机器参数和系统参数。
  17. 一种嵌入式设备,其特征在于,所述嵌入式设备采用汽车开放系统架构AUTOSAR,且所述嵌入式设备包括存储器和处理器;
    所述存储器用于存储计算机程序;
    所述处理器用于执行所述存储器中存储的计算机程序以使得所述嵌入式设备执行如权利要求1至8任一所述的方法。
  18. 一种参数配置系统,其特征在于,所述系统包括:AUTOSAR开发工具,以及如权利要求9至17任一所述的嵌入式设备;
    其中,所述AUTOSAR开发工具,用于基于所述嵌入式设备的服务层发送的硬件资源参数生成可执行文件和配置文件。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,所述指令由处理器执行以实现如权利要求1至8任一所述的方法。
  20. 一种芯片,其特征在于,所述芯片包括可编程逻辑电路和/或程序指令,所述芯片运行时用于实现如权利要求1至8任一所述的方法。
PCT/CN2021/117521 2020-11-27 2021-09-09 参数配置方法、装置及系统 WO2022110970A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP21896474.0A EP4235402A4 (en) 2020-11-27 2021-09-09 PARAMETER CONFIGURATION METHOD, DEVICE AND SYSTEM
JP2023532418A JP7547636B2 (ja) 2020-11-27 2021-09-09 パラメータ構成方法、装置、およびシステム
US18/324,422 US20230297395A1 (en) 2020-11-27 2023-05-26 Parameter Configuration Method, Apparatus, and System

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011364749.6 2020-11-27
CN202011364749.6A CN114564179A (zh) 2020-11-27 2020-11-27 参数配置方法、装置及系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/324,422 Continuation US20230297395A1 (en) 2020-11-27 2023-05-26 Parameter Configuration Method, Apparatus, and System

Publications (1)

Publication Number Publication Date
WO2022110970A1 true WO2022110970A1 (zh) 2022-06-02

Family

ID=81712409

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/117521 WO2022110970A1 (zh) 2020-11-27 2021-09-09 参数配置方法、装置及系统

Country Status (5)

Country Link
US (1) US20230297395A1 (zh)
EP (1) EP4235402A4 (zh)
JP (1) JP7547636B2 (zh)
CN (1) CN114564179A (zh)
WO (1) WO2022110970A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024138413A1 (zh) * 2022-12-28 2024-07-04 华为技术有限公司 一种配置方法和装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104781789A (zh) * 2012-12-20 2015-07-15 三菱电机株式会社 车载装置以及程序
CN109002290A (zh) * 2018-10-15 2018-12-14 昆明理工鼎擎科技股份有限公司 一体化ecu嵌入式目标代码自动生成器及自动生成方法
US20190163446A1 (en) * 2017-11-30 2019-05-30 The Mathworks, Inc. Systems and methods for evaluating compliance of implementation code with a software architecture specification
US20190258460A1 (en) * 2018-02-22 2019-08-22 Dspace Digital Signal Processing And Control Engineering Gmbh Method and system for generating a software component
CN110515366A (zh) * 2019-07-29 2019-11-29 华为技术有限公司 一种故障诊断方法及装置
CN111338638A (zh) * 2020-02-26 2020-06-26 东风电子科技股份有限公司 实现自动生成嵌入式软件部件之间通信的系统及其方法

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7043393B2 (en) * 2001-08-15 2006-05-09 National Instruments Corporation System and method for online specification of measurement hardware
US20130103379A1 (en) * 2011-10-20 2013-04-25 Electronics And Elecommunications Research Institute Apparatus and method for verifying interoperability between application software and autosar service
TWI526847B (zh) * 2012-09-28 2016-03-21 微盟電子(昆山)有限公司 計算機及其硬體參數設定方法
JP6192781B1 (ja) 2016-07-26 2017-09-06 三菱電機株式会社 データ管理プログラム及びデータ管理装置
JP2018036972A (ja) 2016-09-01 2018-03-08 ポップコーンサー コー リミテッド ファイルフォーマット変換装置及びその変換方法
JP2019213081A (ja) 2018-06-06 2019-12-12 ルネサスエレクトロニクス株式会社 半導体装置及び情報処理方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104781789A (zh) * 2012-12-20 2015-07-15 三菱电机株式会社 车载装置以及程序
US20190163446A1 (en) * 2017-11-30 2019-05-30 The Mathworks, Inc. Systems and methods for evaluating compliance of implementation code with a software architecture specification
US20190258460A1 (en) * 2018-02-22 2019-08-22 Dspace Digital Signal Processing And Control Engineering Gmbh Method and system for generating a software component
CN109002290A (zh) * 2018-10-15 2018-12-14 昆明理工鼎擎科技股份有限公司 一体化ecu嵌入式目标代码自动生成器及自动生成方法
CN110515366A (zh) * 2019-07-29 2019-11-29 华为技术有限公司 一种故障诊断方法及装置
CN111338638A (zh) * 2020-02-26 2020-06-26 东风电子科技股份有限公司 实现自动生成嵌入式软件部件之间通信的系统及其方法

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANONYMOUS: "Adaptive Platform AUTOSAR (AP) platform design (2) - architecture ", AUTOMOTIVE ELECTRONICS, 13 April 2020 (2020-04-13), pages 1 - 8, XP055934308, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/128582125> [retrieved on 20220622] *
BURIBURI ZAEMON: "Graphical AUTOSAR (3) - Methodology", 13 May 2018 (2018-05-13), pages 1 - 5, XP055934310, Retrieved from the Internet <URL:https://blog.csdn.net/ChenGuiGan/article/details/80302651> [retrieved on 20220622] *
See also references of EP4235402A4

Also Published As

Publication number Publication date
JP2023551005A (ja) 2023-12-06
US20230297395A1 (en) 2023-09-21
CN114564179A (zh) 2022-05-31
EP4235402A1 (en) 2023-08-30
JP7547636B2 (ja) 2024-09-09
EP4235402A4 (en) 2024-04-10

Similar Documents

Publication Publication Date Title
US11385908B1 (en) Cloning of firmware configuration settings using rest over IPMI interface
US9563442B2 (en) Baseboard management controller and method of loading firmware
JP6537046B2 (ja) ファームウェアのアップデート中のファームウェア設定の保持
US10860308B1 (en) Peripheral device firmware update using rest over IPMI interface firmware update module
TWI610167B (zh) 改善平台管理的計算裝置建置方法、保持電腦可執行指令之非暫存媒體及配置為提供強化管理資訊之計算裝置
US9734100B2 (en) Network controller sharing between SMM firmware and OS drivers
WO2016029792A1 (zh) 硬件设备的调试方法、装置和系统
US10404538B1 (en) Remote platform configuration
US7552217B2 (en) System and method for Automatic firmware image recovery for server management operational code
CN110908753B (zh) 一种智能融合的云桌面服务器、客户端及系统
CN112953775B (zh) 一种车机升级系统及方法
US10430225B1 (en) Traffic management on an interconnect
US10628176B1 (en) Firmware configuration using REST over IPMI interface
US10572242B1 (en) Firmware update using rest over IPMI interface
US20140317615A1 (en) Systems and Methods for Installing Applications
US10776286B1 (en) Rest over IPMI interface for firmware to BMC communication
US20230229481A1 (en) Provisioning dpu management operating systems
WO2022110970A1 (zh) 参数配置方法、装置及系统
WO2023098052A1 (zh) 一种服务器运维方法、装置、设备及存储介质
CN116431546B (zh) 参数配置方法、电子设备、存储介质及程序产品
US10394619B2 (en) Signature-based service manager with dependency checking
US20230325203A1 (en) Provisioning dpu management operating systems using host and dpu boot coordination
CN106922189B (zh) 设备代理装置及其控制方法
US11593121B1 (en) Remotely disabling execution of firmware components
WO2020119139A1 (zh) Pch万兆以太网的pxe功能的启停方法及相关装置

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: 21896474

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023532418

Country of ref document: JP

ENP Entry into the national phase

Ref document number: 2021896474

Country of ref document: EP

Effective date: 20230523

WWE Wipo information: entry into national phase

Ref document number: 202317037061

Country of ref document: IN

NENP Non-entry into the national phase

Ref country code: DE