Data processing method and device, equipment, medium and product
By introducing a slave core for data forwarding in the vehicle gateway MCU chip, the problem of excessive CPU load in traditional gateways is solved, improving processing efficiency and stability, and making it suitable for the high real-time and high bandwidth requirements of intelligent connected vehicles.
Patent Information
- Application Number
- CN202511400264.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2025-12-12
AI Technical Summary
In intelligent connected vehicle scenarios with high real-time and high bandwidth requirements, traditional automotive gateways suffer from excessive CPU load. This leads to a significant increase in CPU interrupt response and scheduling load when message throughput increases, affecting the real-time performance of critical tasks.
A slave core is introduced into the MCU chip of the vehicle gateway. It receives data processing tasks from the external controller and forwards the data directly in the slave core according to the pre-stored routing rules, without the need for CPU participation. The master core only handles tasks involving data reassembly.
This reduces the CPU load on the MCU chip, improves the processing efficiency and response speed of the vehicle gateway, and enhances operational stability.
Smart Images

Figure CN121125390A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of vehicle technology, and in particular to a data processing method, apparatus, device, medium and product. Background Technology
[0002] Traditional automotive gateways employ a software-based CAN message routing architecture, which relies on the main control CPU for data processing and decision-making. In the context of high real-time performance and high bandwidth requirements of intelligent connected vehicles, the following technical bottlenecks have gradually become apparent:
[0003] CPU load bottleneck: The current solution requires the CPU to parse data frames one by one and perform routing decisions. This leads to a significant increase in CPU interrupt response and scheduling load when message throughput increases. Actual measurements show that the CPU utilization of traditional gateways can reach over 70% during peak communication periods, severely impacting the real-time performance of other critical tasks. Summary of the Invention
[0004] This invention provides a data processing method, apparatus, device, medium, and product to reduce the CPU load of the MCU chip in a vehicle gateway and improve the processing efficiency, response speed, and operational stability of the vehicle gateway.
[0005] According to one aspect of the present invention, a data processing method is provided, executed by a slave core in an MCU chip of a vehicle gateway, the data processing method comprising:
[0006] Receive data processing tasks sent by an external controller, wherein the data processing tasks carry data to be processed, including CAN data and / or CAN-FD data;
[0007] If the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core, the data to be processed is output to the target external controller through the target channel. The routing rules stored in the core include: routing rules corresponding to the first type of data processing task. The first type of data processing task includes: forwarding task, or protocol format conversion task and forwarding task.
[0008] According to another aspect of the present invention, a data processing apparatus is provided, configured in a slave core of an MCU chip in a vehicle gateway, the data processing apparatus comprising:
[0009] The receiving module is used to receive data processing tasks sent by the source external controller, wherein the data processing task carries data to be processed, including CAN data and / or CAN-FD data;
[0010] The output module is used to output the data to be processed to the target external controller through the target channel if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core. The routing rules stored in the core include: routing rules corresponding to the first type of data processing task. The first type of data processing task includes: forwarding task, or protocol format conversion task and forwarding task.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method according to any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the data processing method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer program product is provided, which, when executed by a processor, implements the data processing method as described in any of the embodiments of the present invention.
[0017] In this embodiment of the invention, by receiving a data processing task sent by a source external controller, if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the slave core, the data to be processed is output to the target external controller through the target channel. For the first type of data processing task, which does not involve data reassembly, the forwarding is performed by the data processing module in the slave core of the MCU, without the need for the CPU of the MCU chip to participate, thereby reducing the CPU load of the MCU chip of the vehicle gateway and improving the processing efficiency, response speed and operational stability of the vehicle gateway.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a data processing method according to an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of another data processing method in an embodiment of the present invention;
[0022] Figure 3 This is a schematic diagram of the slave core structure in an MCU chip according to an embodiment of the present invention;
[0023] Figure 4 This is a flowchart of another data processing method in an embodiment of the present invention;
[0024] Figure 5 This is a schematic diagram of the structure of a data processing device according to an embodiment of the present invention;
[0025] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0029] Example 1
[0030] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention. This embodiment is applicable to data processing for vehicle gateways. The method can be executed by the data processing device in this embodiment, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0031] S110 receives data processing tasks sent by the source external controller.
[0032] In this embodiment, the data processing task carries data to be processed, which includes CAN data and / or Controller Area Network with Flexible Data-Rate Data (CAN-FD) data.
[0033] In this embodiment, the source external controller is a controller that provides the data to be processed.
[0034] In this embodiment, the correspondence between the source external controller and the target external controller is pre-defined in the requirements table. This allows the vehicle gateway to process the data to be processed after receiving it from the source external controller and then send the processed data to the target external controller corresponding to the source external controller. Alternatively, the vehicle gateway can directly send the data to be processed to the target external controller corresponding to the source external controller after receiving it from the source external controller.
[0035] S120, if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core, then the data to be processed is output to the target external controller through the target channel.
[0036] In this embodiment, the receiving channel identifier for receiving data to be processed is obtained in advance. The routing rules stored in the kernel are queried according to the receiving channel identifier to obtain the target channel and data processing rules corresponding to the data to be processed. The data to be processed is processed according to the data processing rules, and the processed data is output to the target external controller through the target channel.
[0037] In this embodiment, the receiving channel identifier for receiving data to be processed is obtained in advance. The routing rules stored in the kernel are queried according to the receiving channel identifier to obtain the target channel corresponding to the data to be processed. The data to be processed is then output to the target external controller through the target channel.
[0038] It should be noted that if the first type of data processing task only includes forwarding tasks, then querying the routing rules will only yield the target channel. If the first type of data processing task includes both protocol format conversion tasks and forwarding tasks, then querying the routing rules will yield both the target channel and the protocol format conversion rules.
[0039] In this embodiment, the target external controller is a controller that receives data to be processed. The target external controller corresponds to the source external controller. The correspondence between the source external controller and the target external controller is pre-stored in a demand table.
[0040] In this embodiment, the routing rules stored in the kernel include: routing rules corresponding to a first type of data processing task, wherein the first type of data processing task includes: a forwarding task, or a protocol format conversion task and a forwarding task.
[0041] It should be noted that since the kernel only stores the routing rules corresponding to the first type of data processing task and not the routing rules corresponding to the second type of data processing task, if the data processing task is the second type of data processing task, querying the routing rules stored in the kernel will not yield the target channel corresponding to the data to be processed.
[0042] Optionally, the slave core includes multiple data processing modules and a forwarding module, and the multiple data processing modules are all connected to the forwarding module;
[0043] Outputting the data to be processed to the target external controller through the target channel includes:
[0044] Obtain the target data processing module corresponding to the target channel. If the current data processing module is not the target data processing module, send the data to be processed to the target data processing module through the forwarding module, so that the target processing module outputs the data to be processed to the target external controller through the target channel.
[0045] In this embodiment, one data processing module or multiple data processing modules can be deployed in the slave core.
[0046] It should be noted that the slave core includes multiple data processing modules and a forwarding module, all of which are connected to the forwarding module. The forwarding module can acquire, store, and transmit data. The forwarding module is responsible for transmitting CAN data or CAN-FD data between different data processing modules without CPU intervention from the vehicle gateway's MCU chip.
[0047] In this embodiment, the method for obtaining the target data processing module corresponding to the target channel can be as follows: The channel identifiers of each data processing module are pre-stored in the data processing modules of the slave core. The channel identifiers of each data processing module are then queried based on the target channel identifier to obtain the target data processing module corresponding to the target channel. For example, the channel identifiers of data processing module 1 can be pre-stored as follows: channel 1, channel 2, and channel 3; the channel identifiers of data processing module 2 can be as follows: channel 4, channel 5, and channel 6. If the target channel is channel 4, then the target data processing module corresponding to the target channel is determined to be data processing module 2.
[0048] Optionally, the forwarding module includes: a storage unit RAM;
[0049] If the current data processing module is not the target data processing module, the data to be processed is sent to the target data processing module through the forwarding module, including:
[0050] If the current data processing module is not the target data processing module, the target forwarding channel corresponding to the input channel of the data to be processed in the forwarding module is triggered. The target forwarding channel is used to perform direct memory access operation to read the data to be processed, store the data to be processed in RAM, and send the data to be processed to the target data processing module.
[0051] In this embodiment, the forwarding module can temporarily store the data to be processed in RAM as a relay station.
[0052] In this embodiment, the forwarding module includes multiple forwarding channels, with each data processing module's channel corresponding to one forwarding channel, enabling data transmission across data processing modules. If the current data processing module is not the target data processing module, the target forwarding channel corresponding to the input channel of the data to be processed is triggered in the forwarding module.
[0053] In a specific example, such as Figure 2As shown, the source external controller sends the data to be processed to the data processing module in the slave core through the receiving channel. The data processing module in the slave core includes: a receiving filter, a first-in-first-out (RX-FIFO) queue, a rule channel, and a sending queue. Each receiving channel corresponds to one RX-FIFO queue and one rule channel (if there are four receiving channels, the data processing module includes four corresponding receiving filters, four RX-FIFO queues, and four rule channels). The receiving filter is used to perform preliminary screening or classification operations on the data to be processed. After being filtered by the receiving filter, the data is temporarily stored in the RX-FIFO queue corresponding to the receiving channel. The data stored in each RX-FIFO queue is distributed to the corresponding sending queue through the corresponding rule channel, and then sent to the target external controller through the corresponding channel.
[0054] In this embodiment, the receiving end of the data processing module receives data to be processed through an RX-FIFO buffer. After receiving the data, if the target channel corresponding to the data is obtained by querying the routing rules stored in the core, it determines whether the current data processing module is the target data processing module corresponding to the target channel. If the current data processing module is not the target data processing module, the target forwarding channel corresponding to the input channel of the data to be processed in the forwarding module is triggered to read the data to be processed and store the data to be processed in RAM. The sending end of the data processing module writes the data to be processed into the sending queue of the target data processing module to achieve multi-channel broadcasting. The specific data flow path is: RX-FIFO, forwarding channel, RAM of the forwarding module, sending queue. That is, the forwarding module first copies the data to be processed from the RX-FIFO to the RAM buffer, and then writes it into the sending queue of the target channel in multiple parts to ensure data integrity.
[0055] Optionally, the target forwarding channel is further configured to perform multiple direct memory access operations via a descriptor chain to write the data to be processed into the sending queues of multiple target channels of the target data processing module.
[0056] In this embodiment, when the RX-FIFO of the data processing module receives data to be processed (CAN frame and / or CAN-FD frame), if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core, and the current data processing module is not the target data processing module, the associated forwarding channel is automatically triggered.
[0057] In a specific example, such as Figure 3As shown, the slave core includes: data processing module 0, data processing module 1, and a forwarding module. The forwarding module can be a System Direct Memory Access Controller (SDMAC). The data processing module can be a Controller Area Network Flexible Data-Rate (CAN FD) module. Figure 4 As shown, CANFD UnitA includes components such as: Reception Frame ID (RFID), Reception Frame Pointer (RFPTR), Reception Frame Data Status (RFFDSTS), Reception Frame Data Fields (RFDF0-RFDF16), and First-In-First-Out (FIFO) queue RX-FIFOn. SDMAC includes: SDMAC Channel, Descriptor Chain, and RAM. The SDMAC Channel includes: Descriptor Pointer Register (DPPTR) and Data Path Control Register (DPCR). The Descriptor Chain includes: SAR (Source Address Register), DAR (Destination Address Register), TSR (Transmission Status Register), and Descriptor Pointer Table Pointer (DPPTP). RAM includes: ID (identifier), PTR (pointer), FD (descriptor), and DF0-DF16 (a series of data fields numbered from 0 to 16). The CANFD UnitB includes components such as: Transmit Message ID (TMID), Transmit Message Pointer (RFPTR), Transmit Message Flexible Data Counter (TMFDCTR), Receive Frame Data Fields (RFDF0-RFDF16), and First-In-First-Out (FIFO) queue RX-FIFOn.
[0058] In this embodiment, if the current data processing module is not the target data processing module, the forwarding module is triggered. The forwarding module accesses the storage window of the RX-FIFO (19 long words, covering the maximum frame length of 64 bytes) through direct memory DMA to read the complete data to be processed. The read data to be processed is temporarily stored in RAM, and through the descriptor chain, SDMAC (forwarding module) performs multiple DMA access operations to write the same frame of data into the transmission queues of multiple target channels of the target data processing module.
[0059] In a specific example, the first descriptor reads data from the RX-FIFO into RAM. Subsequent descriptors copy data from RAM to the transmit queues of each target channel.
[0060] In this embodiment, the forwarding module automatically completes data transmission based on the descriptor configuration without CPU involvement, thereby further reducing CPU load.
[0061] It should be noted that if a transmission timeout or queue overflow occurs, the forwarding module will notify the CPU via an interrupt for processing.
[0062] In this embodiment, the forwarding module's forwarding channel settings are as follows: Trigger source: a hardware signal bound to a specific RX-FIFO (e.g., RX-FIFO0 triggers SDMAC channel 0). Transmission mode: set to long word (4-byte) access, address auto-increment, supporting continuous operation. Descriptor chain: configured with a circular linked list structure to ensure the channel can be triggered repeatedly. RX-FIFO depth: at least 2 frames to avoid loss of new frames during DMA transfer. Send queue configuration: the 4th queue is dedicated to writing to the forwarding module, and the other queues are used for internal gateway routing.
[0063] It should be noted that SDMAC's hardware autonomy allows gateway operations to be entirely handled by hardware, with the CPU only processing exceptions, thus reducing CPU complexity. Furthermore, by setting priority and preloading descriptors, transmission latency is reduced, ensuring real-time data transmission.
[0064] The solution provided in this embodiment achieves efficient and autonomous routing of CAN-FD data and / or CAN data across RS-CANFD units through hardware DMA and descriptor chain mechanisms. Its core advantage lies in completely offloading the CPU load, making it suitable for in-vehicle networks with high real-time requirements (such as ADAS data exchange). In practical applications, attention should be paid to channel resource configuration and error monitoring to ensure stability.
[0065] Optionally, the routing rules stored in the core are the routing rules corresponding to the demand information of the first type of data processing task in the demand table. The demand table includes a list of data identifiers for each channel, and the data identifiers include CANID and CAN-FD ID.
[0066] In this embodiment, the requirement table also includes the correspondence between the source external controller and the target external controller.
[0067] In this embodiment, the demand table includes: demand information for a first type of data processing task and demand information for a second type of data processing task. The demand information for the first type of data processing task includes: a list of data identifiers for channels related to the first type of data processing task and parameters corresponding to each data identifier.
[0068] In this embodiment, the data identifier list of the channel related to the first type of data processing task and the parameters corresponding to each data identifier are used to generate the routing rules corresponding to the first type of data processing task, and the routing rules corresponding to the first type of data processing task are stored in the slave core.
[0069] Optionally, the MCU chip may also include a main core;
[0070] The data processing method further includes:
[0071] If the target channel corresponding to the data to be processed is not found by querying the routing rules stored in the kernel, the data to be processed is sent to the main kernel so that the main kernel can process the data to be processed and output the processed data to the target external controller.
[0072] In this embodiment, if the target channel corresponding to the data to be processed is not found in the slave core, it means that the data processing module in the slave core cannot process the data to be processed, and the data processing module in the master core needs to process the data to be processed.
[0073] In this embodiment, the method of sending the data to be processed to the main core so that the main core can process the data to be processed can be as follows: the data to be processed is sent to the main core so that the data processing module in the main core queries the routing rules stored in the main core to obtain the target channel and data processing strategy corresponding to the data to be processed, and processes the data to be processed based on the data processing strategy.
[0074] Optionally, the data to be processed is sent to the main core, so that the main core processes the data and outputs the processed data to the target external controller, including:
[0075] The data to be processed is sent to the main core, so that the data processing module in the main core can query the routing rules stored in the main core to obtain the target channel and data processing strategy corresponding to the data to be processed. Based on the data processing strategy, the data to be processed is processed, and the processed data to be processed is output to the target external controller through the target channel. The routing rules stored in the main core include: routing rules corresponding to the second type of data processing tasks. The second type of data processing tasks stored in the main core include: framing tasks and forwarding tasks.
[0076] In this embodiment, the data processing strategy can be a framing strategy.
[0077] Optionally, the routing rules stored in the main core are the routing rules corresponding to the requirement information of the second type of data processing task in the requirement table.
[0078] It should be noted that the requirements table includes the relationships between the various controllers in the vehicle.
[0079] In this embodiment, routing rules are typically configured in tabular form. The routing table includes: source external controller identifier, destination external controller identifier, data forwarding path, and data processing rules.
[0080] Existing gateway solutions suffer from the following issues: Insufficient bandwidth scalability: The existing CAN bus supports a maximum bandwidth of 500Kbps. The CAN-FD bus supports a maximum bandwidth of 10Mbps, and current routing decisions cannot simultaneously meet the bandwidth requirements of both the CAN bus and CAN-FD bus. Routing arbitration conflicts: In multi-channel parallel routing scenarios (such as cross-communication between the power domain and chassis domain), the software-implemented priority arbitration mechanism is prone to two types of problems: low-priority long messages block high-priority control commands (such as ESP braking signals); message forwarding across controllers requires multiple copies through "receive buffer → memory → send buffer," introducing microsecond-level delays, which does not comply with the timing constraints of the critical path in ISO 26262 functional safety.
[0081] To address the aforementioned issues, this embodiment proposes classifying data processing tasks into different types, as shown in Table 1:
[0082] Table 1
[0083]
[0084] For the first type of data processing task, which does not involve data reassembly, forwarding is carried out by the data processing module in the slave core of the MCU. For the second type of data processing task, forwarding is carried out by the data processing module in the master core of the MCU.
[0085] Through the above combined optimizations, the overall chip load rate is reduced. Furthermore, for the first type of data processing task, priority rules can be configured to enable fast forwarding of high-priority data.
[0086] In a specific example, a test was conducted using single-frame data forwarding: Comparison verifies that the signal is split as the semaphore increases. Compared to before optimization, when all scenarios consumed CPU resources, after optimization, the first type of data processing task does not consume CPU resources. Only the second type of data processing task consumes CPU resources, resulting in an overall reduction in chip load.
[0087] The technical solution of this embodiment receives a data processing task sent by a source external controller. If the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the slave core, the data to be processed is output to the target external controller through the target channel. For the first type of data processing task, which does not involve data reassembly, the forwarding is performed by the data processing module in the slave core of the MCU, without the need for the CPU of the MCU chip to participate. This reduces the CPU load of the MCU chip of the vehicle gateway and improves the processing efficiency, response speed and operation stability of the vehicle gateway.
[0088] Example 2
[0089] Figure 5 This is a schematic diagram of a data processing device provided in an embodiment of the present invention. This embodiment is applicable to data processing applications. The device can be implemented using software and / or hardware, and can be integrated into any device that provides data processing functionality, such as… Figure 5 As shown, the data processing device specifically includes a receiving module 510 and an output module 520.
[0090] The receiving module is used to receive data processing tasks sent by the external controller, wherein the data processing task carries data to be processed, including CAN data and / or CAN-FD data.
[0091] The output module is used to output the data to be processed to the target external controller through the target channel if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core. The routing rules stored in the core include: routing rules corresponding to the first type of data processing task. The first type of data processing task includes: forwarding task, or protocol format conversion task and forwarding task.
[0092] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.
[0093] Example 3
[0094] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0095] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0096] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0097] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as data processing methods.
[0098] In some embodiments, the data processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the data processing method by any other suitable means (e.g., by means of firmware).
[0099] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0100] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0101] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0102] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0103] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0104] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0105] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0106] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method according to any embodiment of the invention.
[0107] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data processing method, characterized in that, The data processing method, executed by the slave core in the MCU chip of the vehicle gateway, includes: Receive data processing tasks sent by an external controller, wherein the data processing tasks carry data to be processed, including CAN data and / or CAN-FD data; If the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core, the data to be processed is output to the target external controller through the target channel. The routing rules stored in the core include: routing rules corresponding to the first type of data processing task. The first type of data processing task includes: forwarding task, or protocol format conversion task and forwarding task.
2. The method according to claim 1, characterized in that, The MCU chip also includes a main core; The data processing method further includes: If the target channel corresponding to the data to be processed is not found by querying the routing rules stored in the kernel, the data to be processed is sent to the main kernel so that the main kernel can process the data to be processed and output the processed data to the target external controller.
3. The method according to claim 1, characterized in that, The slave core includes multiple data processing modules and a forwarding module, and the multiple data processing modules are all connected to the forwarding module; Outputting the data to be processed to the target external controller through the target channel includes: Obtain the target data processing module corresponding to the target channel. If the current data processing module is not the target data processing module, send the data to be processed to the target data processing module through the forwarding module, so that the target processing module outputs the data to be processed to the target external controller through the target channel.
4. The method according to claim 3, characterized in that, The forwarding module includes: a storage unit RAM; If the current data processing module is not the target data processing module, the data to be processed is sent to the target data processing module through the forwarding module, including: If the current data processing module is not the target data processing module, the target forwarding channel corresponding to the input channel of the data to be processed in the forwarding module is triggered. The target forwarding channel is used to perform direct memory access operation to read the data to be processed, store the data to be processed in RAM, and send the data to be processed to the target data processing module.
5. The method according to claim 4, characterized in that, The target forwarding channel is also used to perform multiple direct memory access operations through a descriptor chain to write the data to be processed into the sending queues of multiple target channels of the target data processing module.
6. The method according to claim 1, characterized in that, The routing rules stored in the core are the routing rules corresponding to the demand information of the first type of data processing task in the demand table. The demand table includes a list of data identifiers for each channel, and the data identifiers include CAN ID and CAN-FD ID.
7. The method according to claim 2, characterized in that, The data to be processed is sent to the main core, so that the main core processes the data and outputs the processed data to the target external controller, including: The data to be processed is sent to the main core, so that the data processing module in the main core can query the routing rules stored in the main core to obtain the target channel and data processing strategy corresponding to the data to be processed. Based on the data processing strategy, the data to be processed is processed, and the processed data to be processed is output to the target external controller through the target channel. The routing rules stored in the main core include: routing rules corresponding to the second type of data processing tasks. The second type of data processing tasks stored in the main core include: framing tasks and forwarding tasks.
8. The method according to claim 7, characterized in that, The routing rules stored in the main core are the routing rules corresponding to the requirement information of the second type of data processing tasks in the requirement table.
9. A data processing apparatus, characterized in that, The data processing device, configured in the slave core of the MCU chip in the vehicle gateway, includes: The receiving module is used to receive data processing tasks sent by the source external controller, wherein the data processing task carries data to be processed, including CAN data and / or CAN-FD data; The output module is used to output the data to be processed to the target external controller through the target channel if the target channel corresponding to the data to be processed is obtained by querying the routing rules stored in the core. The routing rules stored in the core include: routing rules corresponding to the first type of data processing task. The first type of data processing task includes: forwarding task, or protocol format conversion task and forwarding task.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the data processing method according to any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the data processing method according to any one of claims 1-8.