Vehicle-mounted Ethernet control method and related equipment
By using state awareness and dynamic power control, the initialization requirements of the Ethernet switch are dynamically determined, which solves the connection interruption problem caused by fixed initialization in vehicle Ethernet control and improves the stability and robustness of the vehicle network under different states.
Patent Information
- Application Number
- CN202511166418.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-11
AI Technical Summary
In existing vehicle Ethernet control solutions, the initialization of switches is usually a fixed process that does not distinguish between device operating states. This leads to unnecessary connection interruptions and stability issues during controller restarts or sleep/wake-up processes, especially when smart cars frequently restart or are in low-power states.
By using state awareness and dynamic power control, the operating status parameters of the Ethernet switch are obtained, initialization requirements are dynamically determined, and initialization is performed only when necessary. The power enable register is turned on in sleep mode and turned off in wake-up mode to avoid unnecessary reset operations and GPIO level fluctuations.
It improves the connection stability and system robustness of the vehicle network during restart and sleep/wake-up processes, reduces the risk of communication interruption, and enhances the system's adaptability and fault tolerance.
Smart Images

Figure CN120934922A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle control technology, and more specifically, to an in-vehicle Ethernet control method and related equipment. Background Technology
[0002] With the rapid development of intelligent connected vehicles and autonomous driving technologies, automotive Ethernet, as a core technology supporting high-bandwidth, low-latency communication, has gradually replaced traditional buses such as CAN and LIN, and is widely used in key data interaction scenarios such as autonomous driving perception systems, in-vehicle entertainment systems, and over-the-air (OTA) updates for vehicles. Especially in electronic and electrical architectures where multiple controllers operate collaboratively, Ethernet switches play a crucial role in high-speed data transmission between controllers, and the stability of their connections and initialization response speed directly affect the real-time performance and reliability of the entire vehicle network system.
[0003] However, in existing automotive Ethernet control solutions, switch initialization typically follows a fixed procedure, disregarding device operating states. It often unconditionally resets and initializes upon controller startup, easily leading to unnecessary connection interruptions during short restarts or sleep / wake-up processes. This affects the system's continuous communication capabilities and may also cause erroneous resets of the physical layer interface chip (PHY) or switch due to voltage fluctuations, further interfering with Ethernet connection stability. This is particularly problematic in intelligent vehicles requiring frequent restarts, remote wake-ups, or low-power operation, where related technologies suffer from poor automotive Ethernet connection stability and weak restart recovery capabilities. Summary of the Invention
[0004] The summary section of this application introduces a series of simplified concepts, which will be further explained in detail in the detailed description section. The summary section of this application is not intended to limit the key features and essential technical features of the claimed technical solution, nor is it intended to determine the scope of protection of the claimed technical solution.
[0005] The vehicle Ethernet control method and related equipment provided in this application can realize on-demand initialization and stable wake-up of Ethernet switches through status perception and dynamic power control, thereby improving the connection stability and system robustness of the vehicle network during restart and sleep wake-up processes.
[0006] In a first aspect, this application provides an in-vehicle Ethernet control method, comprising: in response to a start signal for an in-vehicle controller, acquiring operating status parameters of an Ethernet switch; determining initialization requirements of the Ethernet switch based on the operating status parameters; when the in-vehicle controller is in a sleep state, setting the switch state of a preset power enable register to an on state; when the in-vehicle controller is in a wake-up state, setting the switch state to an off state; and performing control operations on the Ethernet switch based on the initialization requirements and the switch state.
[0007] In some implementations, obtaining the operating status parameters of the Ethernet switch includes: reading the hardware identifier register value of the Ethernet switch through a user space process; and determining the hardware identifier register value as the operating status parameter.
[0008] In some implementations, determining the initialization requirements of the Ethernet switch based on the operating status parameters includes: when the hardware identifier register value is within a preset device identifier range, determining that the Ethernet switch is in a normal operating state and determining that the initialization requirement is no initialization required; when the hardware identifier register value is not within the preset device identifier range, determining that the Ethernet switch is in an abnormal operating state and determining that the initialization requirement is reset initialization required.
[0009] In some implementations, the control operation on the Ethernet switch based on the initialization requirement and the switch state includes: when the initialization requirement is that a reset initialization is needed, setting the switch state to the off state, triggering the reset pin level toggling operation of the Ethernet switch, and loading preset register configuration parameters to complete the initialization; when the initialization requirement is that no initialization is needed, constraining the reset pin level toggling operation of the Ethernet switch based on the switch state, and maintaining the current register configuration parameters of the Ethernet switch.
[0010] In some embodiments, the vehicle-mounted Ethernet control method further includes: in response to the start signal, reading the transmission data packet count register value of the physical layer chip; when the count register value is greater than a preset statistical threshold, skipping the physical layer reset operation for the physical layer chip and maintaining the current link state; when the count register value is less than or equal to the preset statistical threshold, performing a hard reset operation on the physical layer chip and turning off the power enable register.
[0011] In some embodiments, the vehicle Ethernet control method further includes: maintaining the reset pin of the Ethernet switch at a constant low level when the vehicle controller is in the boot program stage; and removing the preset level toggling operation on the reset pin when the vehicle controller is in the operating system kernel loading stage, wherein the preset level toggling operation includes pulling the level high and maintaining it for a preset duration before pulling it low.
[0012] In some implementations, the start signal includes a power-on start signal for the vehicle controller, a sleep / wake-up event signal, and a vehicle system abnormal restart signal.
[0013] Secondly, this application also provides an in-vehicle Ethernet control device, comprising: a parameter acquisition unit, configured to acquire operating status parameters of an Ethernet switch in response to a start signal for an in-vehicle controller; a demand determination unit, configured to determine the initialization requirements of the Ethernet switch based on the operating status parameters; a sleep control unit, configured to set the switch state of a preset power enable register to an on state when the in-vehicle controller is in a sleep state; a wake-up control unit, configured to set the switch state to an off state when the in-vehicle controller is in a wake-up state; and an Ethernet control unit, configured to perform control operations on the Ethernet switch based on the initialization requirements and the switch state.
[0014] Thirdly, this application also provides an electronic device, including: a memory and a processor, wherein the processor is configured to implement the steps of the vehicle Ethernet control method described in the first aspect when executing a computer program stored in the memory.
[0015] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the vehicle Ethernet control method described in the first aspect.
[0016] Fifthly, this application also provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implement the vehicle Ethernet control method provided in the embodiments of this application.
[0017] In summary, this application obtains the operating status parameters of the Ethernet switch when the controller starts up and determines whether initialization is required, thus avoiding indiscriminate reset operations on the switch every time the system starts. This effectively reduces the risk of Ethernet connection interruption caused by unnecessary resets and ensures the continuous communication capability of the vehicle network during controller restart. By enabling the power enable register when the controller enters sleep mode and disabling it when it wakes up, the power supply status of related peripherals is effectively controlled. This retains the necessary network wake-up capability while avoiding the abnormal impact of general purpose input / output (GPIO) level fluctuations on the switch, thereby improving the stability and response efficiency of the system's sleep-wake-up process. By controlling the Ethernet switch based on operating status parameters and power control status, dynamic and refined management of the initialization process is achieved, avoiding the drawbacks of fixed processes in traditional solutions. This enhances the system's adaptability and fault tolerance under different operating states and improves the robustness of network control. In summary, the vehicle Ethernet control method provided in this application, through state perception and dynamic power control, can realize on-demand initialization and stable wake-up of Ethernet switches, thereby improving the connection stability and system robustness of the vehicle network during restart and sleep-wake-up processes. Attached Figure Description
[0018] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit this specification. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0019] Figure 1 A flowchart illustrating an in-vehicle Ethernet control method provided in an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of the composition structure of an in-vehicle Ethernet control device provided in an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0022] The terms used in the specification, claims, and drawings of this application, such as "first," "second," "third," "fourth," etc. (if any), are used to distinguish similar objects and not to describe a specific order or sequence. Therefore, it is to be understood that these terms can be used interchangeably where appropriate, allowing the described embodiments to be used in different orders, unless specifically required by the illustrations or description. Furthermore, the terms "is" and "has," and any variations thereof, are intended to cover, non-exclusively, all possible constituent elements. For example, a process, method, system, product, or apparatus comprising several steps or units is not necessarily limited to the steps or units explicitly listed, but may also include other steps or units not explicitly listed, or steps or units inherent to the process, method, product, or apparatus.
[0023] In this application, a "module" or "unit" refers to a computer program or part of a computer program that has a specific function and works in conjunction with other related parts to achieve a predetermined goal. These modules or units can be implemented by software, hardware (e.g., processing circuitry or memory), or a combination of both. One or more processors or memories can implement one or more modules or units. Furthermore, each module or unit can also be part of a larger module or unit.
[0024] The technical solutions of this application will be described in detail below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are only a part of this application, and not all embodiments. In the following description, the "some embodiments" mentioned are only a subset of all possible embodiments, which may be the same or different subsets, and different embodiments can be combined with each other without conflict.
[0025] Figure 1 This is a schematic flowchart illustrating an in-vehicle Ethernet control method provided in an embodiment of this application. For example, see [link to example]. Figure 1 The vehicle Ethernet control method provided in this application embodiment may include the following steps 101 to 104:
[0026] Step 101: In response to the start signal for the vehicle controller, obtain the operating status parameters of the Ethernet switch;
[0027] In some examples, when the vehicle controller receives a start signal—a control command instructing it to transition from a shutdown or hibernation state to a normal operating state—it can automatically trigger a detection operation on the current operating status of the Ethernet switch. The Ethernet switch is a core component for multi-node data forwarding and communication scheduling in the vehicle's local area network, and its operating status directly affects the integrity and stability of the vehicle's communication link. To ensure that subsequent control processes are targeted and to improve startup efficiency, operating status parameters, including device identification, port operating status, link connection status, and packet statistics, can be collected by accessing the switch's internal preset register interfaces. These operating status parameters can be read from the Ethernet switch's control registers or status registers, which are hardware logic units within the switch used to store real-time operating information. By analyzing key parameters such as port data transmission counts, receive buffer status, and link detection flags, the vehicle controller can determine whether the switch is in a normal communication state, whether there is an abnormal interruption, or whether the initialization process has been completed. If the collected parameters show that the switch is operating normally and maintaining a valid communication connection, the redundant initialization operation can be skipped in the future; otherwise, if the status parameters are abnormal or fail to be read, the switch initialization process will be executed accordingly.
[0028] By implementing step 101, the current operating status of the Ethernet switch can be monitored in real time during the controller startup phase, providing a basis for subsequent initialization decisions, thereby avoiding blind or redundant operations and improving the adaptability and efficiency of the startup process.
[0029] Step 102: Determine the initialization requirements of the Ethernet switch based on the operating status parameters;
[0030] In some examples, operating status parameters refer to several data points output by the vehicle-mounted Ethernet switch through its internal status register, reflecting the switch's current operating status. These parameters include, but are not limited to, link status, port activity, data transmission count, error flags, and device identification codes. The vehicle controller reads values from, for example, the packet transmission count register, which records the actual number of data transmissions completed by the switch port. If the value is zero or a read failure occurs, it can be inferred that the switch has not participated in data communication or is in an abnormal state, thus indicating that it has not completed initialization and needs to re-execute the initialization process. Conversely, if the parameter value is normal and continuously increasing, and other parameters such as the connection flag in the link status detection register are valid, it indicates that the switch is in a stable operating mode and does not require repeated initialization.
[0031] By implementing step 102, it can be determined whether the switch status parameters are abnormal, and it can be dynamically decided whether to execute the initialization process, thereby avoiding unnecessary reset of switches with normal status, effectively reducing the risk of communication interruption during startup, and improving the continuity and stability of network connection.
[0032] Step 103: When the vehicle controller is in sleep mode, set the switch state of the preset power enable register to the on state.
[0033] In some examples, the vehicle controller entering a sleep state refers to the controller reducing its own power consumption while maintaining the standby capability of some core functions when the vehicle is in a state of engine shutdown, parking, or low power mode, through system-level power management strategies. To ensure that the Ethernet switch and physical layer devices still have the ability to be remotely woken up or reactivated during the controller's sleep state, step 103 sets the power enable register to the "on" state. The preset power enable register refers to the power enable register (Power SaveDisable Register, psd_en) pre-configured in the system to control the enable state of the power modules. The on / off state of this register directly affects the power supply and sleep / wake-up logic of the peripheral modules. By setting this register to the "on" state, it allows the Ethernet switch to be provided with sustained power, enabling it to maintain a low-power standby mode during the vehicle controller's sleep state, rather than being completely powered off. This allows the switch to respond promptly after detecting external events (such as network wake-up requests or remote communication signals) and complete the wake-up transmission link function. This strategy differs from the traditional approach of uniformly powering off all modules during the sleep state, effectively ensuring the availability of the Ethernet link and the continuous awareness capability of the network system. Especially in scenarios where intelligent connected vehicles need to support remote fault diagnosis, online updates, or remote control, keeping the power enable register on can reserve a communication channel for the system wake-up mechanism, thereby improving the overall intelligence level and responsiveness of the electronic control system.
[0034] By implementing step 103, the power enable signal is kept on when the controller is in sleep mode, ensuring that the Ethernet switch has wake-up capability. This helps to achieve remote wake-up and network online operation in low-power mode, improving the system's intelligent management capabilities and energy efficiency ratio.
[0035] Step 104: When the vehicle controller is in the wake-up state, set the switch state to the off state;
[0036] In some examples, when the vehicle controller is in a wake-up state, it means that the controller has completed basic processes such as power recovery and self-test initialization, entered normal operating mode, and the system resources are activated, possessing the ability to handle communication tasks and execute various control logics. During this process, the power enable register is set to the off state, thereby controlling the connected Ethernet switch or physical layer device to enter a stable power supply mode. As the core register for the controller's power management of peripherals, the power enable register, when off, indicates that the system no longer relies on the wake-up channel to maintain standby current, but instead the main power module provides continuous power to the peripherals. By disabling the switch state of this register during wake-up, the problem of general input / output pin level transitions caused by continuous enable signals can be effectively avoided, thereby preventing the Ethernet switch from erroneously triggering the reset process or entering an abnormal state due to abnormal levels.
[0037] By implementing step 104, interference or accidental reset of the Ethernet switch caused by GPIO level transitions can be effectively avoided, thereby improving the stability of the wake-up process and ensuring the smoothness of network connection recovery.
[0038] Step 105: Based on the initialization requirements and switch status, perform control operations on the Ethernet switch;
[0039] In some examples, Ethernet switches, as crucial network devices for high-speed communication and data forwarding between vehicle controllers, directly impact the stability of the vehicle's network topology and the real-time performance of information transmission. Specific control operations include whether or not an initialization process is executed, the triggering method of the reset signal, and the reconfiguration of communication parameters. Specifically, if the initialization requirement is determined to be "initialization required," and the current power enable register is off, a complete initialization process can be executed. This process may involve pulling specific general-purpose input / output interface signal lines high or low to guide the switch to complete a reset and reconfigure its internal port control registers, communication negotiation mechanisms, forwarding table entries, and other key parameters to ensure normal communication functionality after network link recovery. Conversely, if the initialization requirement is "initialization not required," or the power enable register is on, the initialization process will be skipped, maintaining the switch's current operating state to avoid communication interruptions or data loss due to redundant control operations.
[0040] By implementing step 105, taking into account the current status of the device and the power supply, initialization or skipping operations are performed to achieve precise control of the switch, which can improve the adaptability to complex state switching and the overall robustness of operation.
[0041] In summary, this application embodiment obtains the operating status parameters of the Ethernet switch when the controller starts up and determines whether initialization is required based on these parameters. This avoids indiscriminate reset operations on the switch every time the system starts up, effectively reducing the risk of Ethernet connection interruption caused by unnecessary resets and ensuring the continuous communication capability of the vehicle network during controller restart. By enabling the power enable register when the controller enters sleep mode and disabling it when it wakes up, the power supply status of related peripherals is effectively controlled. This retains the necessary network wake-up capability while avoiding the abnormal impact of general purpose input / output (GPIO) level fluctuations on the switch, thereby improving the stability and response efficiency of the system's sleep-wake-up process. By controlling the Ethernet switch based on operating status parameters and power control status, dynamic and refined management of the initialization process is achieved, avoiding the drawbacks of fixed processes in traditional solutions. This enhances the adaptability and fault tolerance of the system under different operating states and improves the robustness of network control. In summary, the vehicle Ethernet control method provided in this application, through state perception and dynamic power control, can realize on-demand initialization and stable wake-up of Ethernet switches, thereby improving the connection stability and system robustness of the vehicle network during restart and sleep-wake-up processes.
[0042] In some embodiments, the aforementioned acquisition of the operating status parameters of the Ethernet switch may include: reading the hardware identifier register value of the Ethernet switch through a user space process; and determining the hardware identifier register value as the operating status parameter.
[0043] In some examples, the aforementioned process of obtaining the operating status parameters of an Ethernet switch can be implemented in a specific way: by having a user-space process read the hardware identifier register value of the Ethernet switch and use that value as the operating status parameter. A user-space process refers to a program process running in the operating system's user space. User space is the memory area within the operating system where applications execute, as opposed to kernel space, which is the memory area where the operating system's kernel code runs. The two are isolated to ensure system stability. An Ethernet switch is a network device used in Ethernet networks, capable of receiving and forwarding data frames. It can identify different devices based on Media Access Control (MAC) addresses to achieve targeted data transmission. The hardware identifier register is an internal register within the Ethernet switch used to store unique identification information for the device. A register is a high-speed storage unit used to temporarily store data or instructions. The hardware identifier register value is the specific data stored in this register, which can be a string of numbers or characters used to uniquely identify the Ethernet switch. Obtaining operating status parameters in this way allows for direct determination of the device's status based on its inherent hardware-level identification information, ensuring the uniqueness and reliability of the obtained parameters and providing an accurate basis for subsequently determining initialization requirements.
[0044] By implementing the above embodiments, reading the hardware identifier register value of the Ethernet switch in the user space process enables non-intrusive judgment of the switch's operating status; it avoids direct operational interference to the Ethernet switch during the underlying driver or boot program stage, and reduces the probability of misjudgment of status due to cross-level permission; in the vehicle scenario, this isolated status acquisition method makes the judgment of the switch status more accurate, provides a reliable basis for subsequent initialization decisions, and ensures the consistency of the vehicle's Ethernet control logic under complex operating conditions.
[0045] In some embodiments, the aforementioned step 102 may include: when the hardware identifier register value is within a preset device identifier range, determining that the Ethernet switch is in a normal working state and determining that the initialization requirement is no initialization required; when the hardware identifier register value is not within the preset device identifier range, determining that the Ethernet switch is in an abnormal working state and determining that the initialization requirement is reset initialization required.
[0046] In some examples, the preset device identifier range is a numerical range of hardware identifiers for normal Ethernet switches pre-defined in the system. When the read hardware identifier register value is within this preset device identifier range, it indicates that the hardware identification information of the Ethernet switch meets the system's expectations, thus determining that the Ethernet switch is in a normal working state. In this case, the corresponding initialization requirement is no initialization required, meaning no additional initialization operation needs to be performed on the Ethernet switch. When the read hardware identifier register value exceeds this preset device identifier range, it indicates that the hardware identification information of the Ethernet switch does not meet the system's expectations, thus determining that the Ethernet switch is in an abnormal working state. In this case, the corresponding initialization requirement is a reset initialization, meaning the Ethernet switch needs to be reset and reconfigured.
[0047] Through the implementation of the above embodiments, the initialization requirements are determined based on the hardware identifier register value, realizing differentiated processing of the Ethernet switch. Initialization is skipped under normal conditions, and reset is only performed under abnormal conditions. This can reduce unnecessary initialization operations in vehicle scenarios, shorten the network recovery time when the vehicle starts or wakes up, and avoid interference with vehicle data transmission caused by repeated resets. For example, it can ensure the continuous connection between the in-vehicle entertainment system and the cloud, thus improving the user experience.
[0048] In some embodiments, step 105 may include: when the initialization requirement is that a reset initialization is required, setting the switch state to the off state, triggering the reset pin level toggling operation of the Ethernet switch, and loading preset register configuration parameters to complete the initialization; when the initialization requirement is that no initialization is required, constraining the reset pin level toggling operation of the Ethernet switch based on the switch state, and maintaining the current register configuration parameters of the Ethernet switch.
[0049] In some examples, when the initialization requirement is a reset initialization, the switch state is first set to the off state. Here, the switch state refers to the operating state of the preset power enable register; the off state indicates that the register stops outputting enable signals. Then, the reset pin level of the Ethernet switch is triggered, which is the physical interface on the Ethernet switch used to trigger the reset operation. The level transition refers to the process of changing the pin's level from low to high or vice versa, thus initiating the device's reset procedure. Simultaneously, preset register configuration parameters are loaded to complete the initialization. These preset register configuration parameters are a set of parameters pre-set to configure various functions of the Ethernet switch; these parameters are stored in registers, and loading them restores the device to the configuration state required for normal operation. When the initialization requirement is no longer needed, the reset pin level transition of the Ethernet switch is constrained based on the switch state. This constraint here means limiting unnecessary level changes on the reset pin to avoid meaningless reset actions, while maintaining the current register configuration parameters of the Ethernet switch, i.e., maintaining the register parameter settings currently used by the device, ensuring it continues to operate normally according to its existing configuration.
[0050] The implementation of the above embodiments provides a more targeted reset control mechanism, dynamically constraining or triggering the reset pin level based on actual initialization requirements and the current switch state. This approach ensures the switch is correctly reset when initialization is required, while preventing false triggering caused by reset pin level jitter when initialization is not needed. This enhances the accuracy of the control strategy and the robustness of system operation, further guaranteeing the stable operation of Ethernet devices.
[0051] In some embodiments, the aforementioned vehicle Ethernet control method may further include: in response to a start signal, reading the transmission data packet count register value of the physical layer chip; when the count register value is greater than a preset statistical threshold, skipping the physical layer reset operation for the physical layer chip and maintaining the current link state; when the count register value is less than or equal to the preset statistical threshold, performing a hard reset operation for the physical layer chip and turning off the power enable register.
[0052] In some examples, the aforementioned vehicle-mounted Ethernet control method may also include corresponding physical layer chip processing procedures. Upon receiving a start signal, the transmission packet count register value of the physical layer chip can be read. The physical layer chip refers to the hardware component in the Ethernet protocol stack responsible for physical layer signal transmission, reception, and conversion. The transmission packet count register is a storage unit within the chip used to record the number of data packets sent. The system compares the read count register value with a preset statistical threshold, which is a pre-set reference value used to determine the working status of the physical layer chip. When the count register value is greater than the preset statistical threshold, it indicates that the physical layer chip is currently in a normal data transmission state. In this case, the system will skip the physical layer reset operation, which is the process of resetting the physical layer chip's configuration parameters while maintaining its current link state. The link state refers to the connection and communication state between the physical layer chip and other network devices. When the count register value is less than or equal to the preset statistical threshold, it indicates that the physical layer chip may be malfunctioning. A hard reset operation can be performed on the physical layer chip. The hard reset operation is an operation that forcibly restores the chip to its initial state through hardware signals and disables the power enable register, which is the register unit that controls the power supply to the physical layer chip.
[0053] Through the implementation of the above embodiments, the physical layer chip determines the reset requirement by transmitting the data packet count register value, avoiding link interruptions caused by fixed resets. In automotive scenarios, this allows the physical layer chip to maintain the existing link when in normal condition, reducing network fluctuations during vehicle sleep / wake-up or startup, ensuring stability for low-latency scenarios such as real-time uploading of vehicle diagnostic data and transmission of remote control commands, and improving the response speed of vehicle-to-everything (V2X) interaction.
[0054] In some embodiments, the aforementioned vehicle Ethernet control method may further include: maintaining the reset pin of the Ethernet switch at a constant low level when the vehicle controller is in the boot program stage; and removing the preset level toggling operation on the reset pin when the vehicle controller is in the operating system kernel loading stage, wherein the preset level toggling operation may include pulling the level high and maintaining it for a preset duration before pulling it low.
[0055] In some examples, the Ethernet switch's reset pin is kept at a constant low level when the vehicle controller is in the bootstrap phase. The bootstrap phase refers to the initial program phase during the vehicle controller's startup process, primarily responsible for initializing hardware and booting the operating system. An Ethernet switch is a network device used to forward data frames in automotive Ethernet, and the reset pin is the physical interface on the Ethernet switch used to trigger a device reset operation. A low level means the pin is in a low voltage state. Conversely, when the vehicle controller is in the operating system kernel loading phase, the preset level toggling operation on the reset pin needs to be removed. The operating system kernel loading phase refers to the process of the vehicle controller loading the operating system kernel program, which manages and configures hardware resources. The preset level toggling operation refers to a pre-set operation that changes the voltage of the reset pin, which can include pulling the reset pin high and maintaining it for a preset duration before pulling it low. Pulling the level high means keeping the pin in a higher voltage state, and the preset duration is a pre-set time length based on actual needs. By taking specific actions on the Ethernet switch's reset pin at different stages, unnecessary reset behavior can be avoided, reducing the impact on the stability of the automotive Ethernet connection.
[0056] By implementing the above embodiments, the switch reset pin is kept at a low level during the boot process and the preset level toggling operation is removed during the kernel process, thus avoiding unnecessary reset triggering during startup. In the vehicle scenario, the momentary interruption of Ethernet connection caused by pin level jumps during the initial stage of vehicle startup can be eliminated, ensuring the network continuity of the vehicle controller from startup to operation. For example, after the vehicle is powered on, a communication link with the backend can be quickly established, shortening the system readiness time.
[0057] In some embodiments, the aforementioned startup signal may include a power-on startup signal for the vehicle controller, a sleep / wake-up event signal, and a vehicle system abnormal restart signal.
[0058] In some examples, power-on startup refers to the process of the vehicle controller switching from a power-off state to power and starting the initialization program. During this process, the controller gradually activates various hardware modules and loads the basic operating environment. Sleep / wake-up event signals involve the vehicle controller's low-power management mechanism. Sleep mode is a low-power consumption mode that the controller enters when it does not need to perform its main functions, while wake-up event signals are instructions that trigger the controller to return from sleep mode to normal operation. These can be triggered by user operation or changes in vehicle status. Vehicle system abnormal restart signals are restart instructions automatically triggered when the vehicle system cannot operate normally due to abnormal conditions such as program errors or hardware failures. The purpose is to restore the system's normal function through a restart. These startup signals, as triggering conditions, prompt the vehicle Ethernet control method to initiate corresponding processing flows, ensuring that network components such as Ethernet switches and physical layer chips can operate stably under different startup scenarios, maintaining the reliability of the vehicle Ethernet connection.
[0059] Through the implementation of the above embodiments, it is clarified that the startup signal covers scenarios such as power-on startup, hibernation wake-up, and abnormal restart, enabling the embodiments of this application to adapt to the entire lifecycle operation of the vehicle controller. In the vehicle scenario, regardless of whether the vehicle is starting for the first time, waking up from hibernation, or experiencing an abnormal system restart, the Ethernet connection can be kept stable through unified control logic, which can improve the universality and reliability of the method and provide comprehensive support for network management in complex vehicle environments.
[0060] Furthermore, as an implementation of the aforementioned method embodiments, this application also provides an in-vehicle Ethernet control device for implementing the aforementioned method embodiments. This device embodiment corresponds to the aforementioned method embodiments. For ease of reading, this in-vehicle Ethernet control device embodiment will not repeat the details of the aforementioned method embodiments one by one, but it should be understood that the device in this application embodiment can correspondingly implement all the contents of the aforementioned method embodiments. For example... Figure 2 As shown, the vehicle-mounted Ethernet control device 20 includes: a parameter acquisition unit 201, a demand determination unit 202, a sleep control unit 203, a wake-up control unit 204, and an Ethernet control unit 205. The parameter acquisition unit 201 is used to acquire the operating status parameters of the Ethernet switch in response to a start signal from the vehicle controller. The demand determination unit 202 is used to determine the initialization requirements of the Ethernet switch based on the operating status parameters. The sleep control unit 203 is used to set the switch state of a preset power enable register to the on state when the vehicle controller is in sleep mode. The wake-up control unit 204 is used to set the switch state to the off state when the vehicle controller is in wake-up mode. The Ethernet control unit 205 is used to perform control operations on the Ethernet switch based on the initialization requirements and the switch state.
[0061] In some embodiments, the parameter acquisition unit 201 is further configured to read the hardware identifier register value of the Ethernet switch through a user space process and determine the hardware identifier register value as a running status parameter.
[0062] In some embodiments, the requirement determination unit 202 is further configured to determine that the Ethernet switch is in normal working state and the initialization requirement is no initialization when the hardware identifier register value is within the preset device identifier range; and to determine that the Ethernet switch is in abnormal working state and the initialization requirement is reset initialization when the hardware identifier register value is not within the preset device identifier range.
[0063] In some embodiments, the Ethernet control unit 205 is further configured to, when the initialization requirement is that a reset initialization is required, set the switch state to the off state, trigger the reset pin level toggling operation of the Ethernet switch, and load preset register configuration parameters to complete the initialization; when the initialization requirement is that no initialization is required, constrain the reset pin level toggling operation of the Ethernet switch based on the switch state, and maintain the current register configuration parameters of the Ethernet switch.
[0064] In some embodiments, the vehicle-mounted Ethernet control device 20 further includes a physical layer status detection unit, which is used to read the transmission data packet count register value of the physical layer chip in response to a start signal; when the count register value is greater than a preset statistical threshold, skip the physical layer reset operation of the physical layer chip and maintain the current link state; when the count register value is less than or equal to the preset statistical threshold, perform a hard reset operation on the physical layer chip and turn off the power enable register.
[0065] In some embodiments, the vehicle Ethernet control device 20 further includes a reset timing control unit, used to maintain the reset pin of the Ethernet switch at a constant low level when the vehicle controller is in the boot program stage; and to remove the preset level toggling operation of the reset pin when the vehicle controller is in the operating system kernel loading stage, wherein the preset level toggling operation includes pulling the level high and maintaining it for a preset duration before pulling it low.
[0066] In some embodiments, the start signal includes the vehicle controller power-on start, the hibernation wake-up event signal, and the vehicle system abnormal restart signal.
[0067] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, will cause the processor to perform any step of the in-vehicle Ethernet control method provided in this application.
[0068] In some embodiments, the computer-readable storage medium may be a random access memory (RAM), a read-only memory (ROM), flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); or it may be a variety of devices that include one or any combination of the above-mentioned memories.
[0069] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0070] In some embodiments, computer-executable instructions may, but do not necessarily, correspond to files in a file system, and may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0071] In some embodiments, computer-executable instructions may be deployed to execute on an electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0072] like Figure 3 As shown, this application also provides an electronic device 30, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor. When the processor 320 executes the computer program 311, it implements any step of the above-described vehicle Ethernet control method.
[0073] This application also provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer program or computer-executable instructions from the computer-readable storage medium and executes the computer program or computer-executable instructions, causing the electronic device to perform any step of the in-vehicle Ethernet control method described above.
[0074] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A vehicle-mounted Ethernet control method, characterized in that, include: In response to the start signal for the vehicle controller, the operating status parameters of the Ethernet switch are acquired; Based on the operating status parameters, the initialization requirements of the Ethernet switch are determined; When the vehicle controller is in sleep mode, the switch state of the preset power enable register is set to the on state; When the vehicle controller is in a wake-up state, the switch state is set to the off state; Based on the initialization requirements and the switch status, control operations are performed on the Ethernet switch.
2. The vehicle-mounted Ethernet control method according to claim 1, characterized in that, The acquisition of the operating status parameters of the Ethernet switch includes: The hardware identifier register value of the Ethernet switch is read by a user-space process; The hardware identifier register value is determined as the operating status parameter.
3. The vehicle-mounted Ethernet control method according to claim 2, characterized in that, Determining the initialization requirements of the Ethernet switch based on the operating status parameters includes: When the hardware identifier register value is within the preset device identifier range, it is determined that the Ethernet switch is in normal working condition, and the initialization requirement is determined to be no initialization required. When the value of the hardware identifier register is not within the preset device identifier range, it is determined that the Ethernet switch is in an abnormal working state, and the initialization requirement is determined to be a reset initialization.
4. The vehicle-mounted Ethernet control method according to claim 1, characterized in that, The control operation of the Ethernet switch based on the initialization requirements and the switch state includes: When the initialization requirement is a reset initialization, the switch state is set to the off state, triggering the reset pin level toggling operation of the Ethernet switch, and loading preset register configuration parameters to complete the initialization; When the initialization requirement is no initialization required, based on the switch state, the reset pin level of the Ethernet switch is constrained to toggle, and the current register configuration parameters of the Ethernet switch are maintained.
5. The vehicle-mounted Ethernet control method according to claim 1, characterized in that, The in-vehicle Ethernet control method further includes: In response to the start signal, the value of the transmission data packet counter register of the physical layer chip is read; When the value of the counter register is greater than the preset statistical threshold, the physical layer chip skips the physical layer reset operation and maintains the current link state. When the value of the counter register is less than or equal to the preset statistical threshold, a hard reset operation is performed on the physical layer chip and the power enable register is turned off.
6. The vehicle-mounted Ethernet control method according to claim 1, characterized in that, The in-vehicle Ethernet control method further includes: When the vehicle controller is in the boot process phase, the reset pin of the Ethernet switch is kept at a constant low level. When the vehicle controller is in the operating system kernel loading stage, the preset level toggling operation of the reset pin is removed, wherein the preset level toggling operation includes pulling the level high and maintaining it for a preset duration before pulling it low.
7. The vehicle-mounted Ethernet control method according to any one of claims 1 to 6, characterized in that, The start signals include power-on start of the vehicle controller, sleep wake-up event signals, and abnormal restart signals of the vehicle system.
8. A vehicle-mounted Ethernet control device, characterized in that, include: The parameter acquisition unit is used to acquire the operating status parameters of the Ethernet switch in response to the start signal for the vehicle controller. The requirement determination unit is used to determine the initialization requirements of the Ethernet switch based on the operating status parameters. The sleep control unit is used to set the switch state of the preset power enable register to the on state when the vehicle controller is in sleep state; A wake-up control unit is used to set the switch state to the off state when the vehicle controller is in a wake-up state; An Ethernet control unit is used to control the Ethernet switch based on the initialization requirements and the switch status.
9. An electronic device, comprising: The memory and processor are characterized in that the processor, when executing a computer program stored in the memory, implements the steps of the vehicle Ethernet control method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the vehicle Ethernet control method as described in any one of claims 1 to 7.