Method and apparatus for processing bus data, electronic device and storage medium
By grouping controllers into controller groups and allocating data storage according to configuration information, the problem of cache saturation in the CAN bus network is solved, achieving a deeper cache space and higher data processing efficiency, and avoiding data loss and network congestion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FUZHOU ROCKCHIP SEMICON
- Filing Date
- 2023-01-18
- Publication Date
- 2026-04-28
AI Technical Summary
In CAN bus networks, the buffer of the receiving device is prone to saturation, leading to data loss or network congestion. Existing technologies make it difficult to improve buffer capacity without increasing chip costs.
By grouping controllers into a controller group, the transmitted data is distributed to the buffers of multiple controllers for processing through configuration information. By utilizing the buffer space of multiple controllers, flexible data storage and read/write processes can be achieved, including control of ping-pong storage and switching functions.
It improves data caching efficiency, increases cache depth, reduces the requirements for controller processing speed, avoids data accumulation, and enhances data real-time performance and network stability.
Smart Images

Figure CN116132217B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission, and in particular to methods and apparatuses, electronic devices and storage media for processing bus data. Background Technology
[0002] Controller Area Network (CAN) bus networks use ID tokens for full-duplex data transmission and reception, meaning all nodes on the network can send and receive data. Due to the large data volume, the receiving end needs sufficient data storage depth to buffer the data. However, chip design cannot incorporate excessively large data buffers, as this increases chip cost. This can lead to a situation where, under heavy system load, the local receiver receives so much data from the network that the buffer becomes full and cannot be processed. Several scenarios can then occur.
[0003] If the local receiver's controller unit does not send an acknowledgment character (ACK) signal to the network, the transmitter, not receiving an ACK signal, will determine that the data is lost and perform retransmission operations. The retransmitted data then enters the CAN bus network, causing network congestion and potentially actual frame loss. If the local receiver's controller unit sends an overload frame, it will delay the transmission of subsequent data on the bus, affecting data real-time performance and increasing network congestion. Furthermore, if the local receiver's controller unit does not send an ACK signal but other receivers do, no error frames will be triggered in the network, and the transmitter will not retransmit. In this case, the receiver that does not send an ACK signal will directly lose the data of the current frame. Summary of the Invention
[0004] The present invention provides methods and apparatuses, electronic devices and storage media for processing bus data, which can improve the data buffering capacity of bus receiving devices such as CAN bus.
[0005] In one aspect of the invention, a method for processing bus data is provided. The method includes: acquiring configuration information associated with a plurality of buffers, the plurality of buffers being respectively included in a plurality of controllers of a controller group; if a receive switching function of the controller group is enabled, causing a first controller in the controller group to begin receiving transmission data from the bus according to the configuration information, and storing a first portion of the transmission data into a first buffer corresponding to the first controller; and causing a second controller in the controller group to continue receiving the transmission data according to the configuration information, and storing a second portion of the transmission data into a second buffer corresponding to the second controller.
[0006] In some embodiments, the configuration information includes identification information associated with the first cache and the second cache, and storage information associated with the size of the data to be stored in the first cache and the second cache.
[0007] In some embodiments, causing a first controller in the controller group to start receiving transmission data from the bus according to the configuration information includes: causing the first controller corresponding to the first cache to start receiving the transmission data according to first identification information representing the first cache; storing a first portion of the transmission data into a first cache corresponding to the first controller includes: storing the first portion of data corresponding to the first data size into the first cache according to first storage information representing the first data size to be stored in the first cache; causing a second controller in the controller group to continue receiving the transmission data according to the configuration information includes: causing the second controller corresponding to the second cache to continue receiving the transmission data after the first portion of data is stored in the first cache according to second identification information representing the second cache; storing a second portion of the transmission data into a second cache corresponding to the second controller includes: storing the second portion of data corresponding to the second data size into the second cache according to second storage information representing the second data size to be stored in the second cache.
[0008] In some embodiments, the method further includes: if the size of the received transmitted data is greater than the sum of the sizes of the first part of the data and the second part of the data, then, according to the configuration information, the third controller in the controller group continues to receive the transmitted data, and stores the third part of the transmitted data into a third buffer corresponding to the third controller.
[0009] In some embodiments, the configuration information further includes switching ratio information, and storing the first portion of the transmitted data into a first cache corresponding to the first controller includes: if, during the period of storing the transmitted data into the first cache, the size of the stored data reaches the switching ratio represented by the switching ratio information, then notifying the second controller to prepare for switching to receive the transmitted data; and continuing to store the transmitted data into the first cache until the size of the stored data reaches the size of the first portion of the data.
[0010] In some embodiments, the method further includes: if the receive switching function of the controller group is disabled, associating at least two of the plurality of caches with a first controller in the controller group according to the configuration information; and causing the first controller to receive the transmission data and store the transmission data in the at least two caches.
[0011] In some embodiments, the method further includes: if the receive switching function of the controller group is turned off, then according to the configuration information, the plurality of controllers simultaneously receive the corresponding part of the transmitted data, and store the corresponding part of the data into the plurality of caches respectively.
[0012] In some embodiments, receiving transmission data from the bus includes receiving transmission data from the controller domain network CAN bus.
[0013] In another aspect of the invention, an apparatus for processing bus data is provided. The apparatus includes a controller group comprising a plurality of controllers, each of the plurality of controllers including a buffer; and a data selector configured to be electrically coupled to a bus and switched according to configuration information associated with the plurality of buffers, such that at least one of the plurality of controllers is electrically coupled to the bus, wherein the data selector is configured to: if the receive switching function of the controller group is enabled, cause a first controller in the controller group to begin receiving transmitted data from the bus according to the configuration information, such that the first controller stores a first portion of the transmitted data into a first buffer corresponding to the first controller according to the configuration information; and cause a second controller in the controller group to continue receiving the transmitted data according to the configuration information, such that the second controller stores a second portion of the transmitted data into a second buffer corresponding to the second controller according to the configuration information.
[0014] In some embodiments, the device further includes: a configurable master control unit electrically coupled to the controller group and the data selector, configured to enable or disable the receive switching function of the controller group, and generate the configuration information, the configuration information including identification information associated with the plurality of caches and storage information associated with the size of data to be stored in the plurality of caches, and / or switching ratio information indicating the switching timing for notifying the next controller in the controller group to prepare to receive the transmitted data.
[0015] In some embodiments, the central control unit is further configured to: if the receive switching function of the controller group is disabled, associate at least two of the plurality of caches with the first controller in the controller group according to the configuration information; and control the data selector to enable the first controller to receive the transmitted data, such that the first controller stores the transmitted data in the at least two caches.
[0016] In some embodiments, the central control unit is further configured to: if the receive switching function of the controller group is turned off, control the data selector according to the configuration information so that the plurality of controllers simultaneously receive the corresponding part of the transmitted data, so that the plurality of controllers store the corresponding part of the data into the plurality of buffers respectively.
[0017] In some embodiments, the addresses of the plurality of caches are consecutive and the data stacking direction is consistent.
[0018] In some embodiments, each of the plurality of controllers further includes a register configured to store the first address of a cache corresponding to the register, such that the controller corresponding to the register obtains the capacity and address of the cache.
[0019] In some embodiments, the transmitting end of the register is electrically coupled to the receiving end of the data selector, and the receiving end of the register is electrically coupled to the transmitting end of the data selector.
[0020] In some embodiments, the bus includes a Controller Area Network (CAN) bus, and the controller includes a CAN controller.
[0021] In another aspect of the invention, an electronic device is provided. The electronic device includes a memory configured to store a computer program; and a processor configured to execute the computer program to perform the aforementioned method for processing bus data.
[0022] In another aspect of the invention, a computer-readable medium is provided. This medium stores a computer program that is executed by a processor to implement the above-described method for processing bus data.
[0023] According to an embodiment of the present invention, the controllers are integrated into a controller group to uniformly complete the data reception and storage operations. Configuration information is set to control the amount of data stored in each controller. When storing new transmission data, if the switching function is enabled, the data is stored in the next controller when the configuration information is satisfied. This allows the cache of multiple controllers to store a single transmission data, improving data storage efficiency. At the same time, the increased cache depth reduces the processing speed requirement of the controller, enabling the expansion of the data cache at the receiving end and improving the data caching capability of the receiving device on the bus. Attached Figure Description
[0024] Figure 1 This is a flowchart of a method for processing bus data according to an embodiment of the present invention;
[0025] Figure 2This is a flowchart of a method for processing bus data in a real-world scenario according to an embodiment of the present invention;
[0026] Figure 3 This is a schematic diagram of the structure of a device for processing bus data according to an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram illustrating the structure of a device for processing bus data with a central control unit according to an embodiment of the present invention;
[0028] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0029] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0030] In existing technologies, the CAN bus network, due to its full-duplex communication characteristics, frequently receives and sends data simultaneously, which leads to the saturation of the buffer of the receiving device. The cost of expanding the buffer is high and uneconomical.
[0031] To address at least the aforementioned technical problems, this disclosure provides a method for processing bus data. According to embodiments of this disclosure, after receiving transmitted data from the bus network, it is processed through an integrated controller group. If a switching function is enabled, the transmitted data is distributed across multiple controllers for caching, and the storage of each controller is configured using configuration information. In this manner, embodiments of this disclosure can accelerate the data caching efficiency at the receiving end and, without changing the hardware structure design, expand the cache space by using virtual integration instead of physical structure changes, providing a deeper cache space. This enables timely caching of data in the bus network and avoids data accumulation in the bus network.
[0032] In the following, the technical solutions according to this disclosure will be described with reference to specific embodiments and in conjunction with the accompanying drawings.
[0033] Figure 1 This is a flowchart illustrating a method 100 for processing bus data according to an embodiment of the present disclosure. (Refer to...) Figure 1 The method 100 includes the following steps 102 to 106.
[0034] In step 102, configuration information associated with multiple caches is obtained, the multiple caches being included in multiple controllers of a controller group. In some embodiments, the configuration information includes identification information associated with the first cache and the second cache, and storage information associated with the size of the data to be stored in the first cache and the second cache.
[0035] In step 104, if the receive switching function of the controller group is enabled, the first controller in the controller group starts receiving transmission data from the bus according to the configuration information, and stores a first portion of the transmission data into a first buffer corresponding to the first controller. In some embodiments, starting the first controller in the controller group to receive transmission data from the bus according to the configuration information includes: starting the first controller corresponding to the first buffer to receive the transmission data according to first identification information representing the first buffer; storing a first portion of the transmission data into the first buffer corresponding to the first controller includes: storing the first portion of data corresponding to the first data size into the first buffer according to first storage information representing the first data size to be stored in the first buffer.
[0036] In one alternative embodiment, receiving transmission data from the bus includes receiving transmission data from the controller domain network CAN bus.
[0037] In step 106, according to the configuration information, the second controller in the controller group continues to receive the transmitted data, and the second portion of the transmitted data is stored in the second cache corresponding to the second controller. In some embodiments, according to the configuration information, the second controller in the controller group continues to receive the transmitted data, after the first portion of the data is stored in the first cache, according to the second identification information representing the second cache, and the second controller corresponding to the second cache continues to receive the transmitted data, and the storage of the second portion of the transmitted data in the second cache corresponding to the second controller includes: according to the second storage information representing the second data size to be stored in the second cache, the second portion of data corresponding to the second data size is stored in the second cache.
[0038] In an optional embodiment, if the size of the received transmitted data is greater than the sum of the sizes of the first part of the data and the second part of the data, then according to the configuration information, the third controller in the controller group continues to receive the transmitted data, and stores the third part of the transmitted data into the third buffer corresponding to the third controller.
[0039] In this way, the data size for each controller can be configured to vary according to the characteristics of the transmitted data, enabling flexible allocation. Some controllers with lower communication volumes don't require large buffers, so their buffers can be distributed to other controllers. Once a controller's buffer is written to, it is immediately marked as readable, allowing the receiving end to immediately read and use the data. Transmitted data can then continue to be written to the buffer of the next controller, implementing a hardware-based ping-pong caching process—the storage process for the first, second, and third controllers mentioned above. Furthermore, the buffer for the next controller is only used after the total configured buffer size for each controller is full, ensuring high utilization of the controller buffers, reducing the number of switching operations, and shortening processing time.
[0040] In one optional embodiment, when storing data in the controller's cache, if the used size of the cache for this write meets the configuration information, the cache's flag is switched to readable. Only after all data in the cache has been read is the cache switched back to writable. In this way, the cache cycles through writable-write-readable-read states, achieving ping-pong storage. This avoids wasting cache size, prevents data from being overwritten before processing, and eliminates the need to check the cache's usage status during writes.
[0041] In an optional embodiment, the configuration information further includes switching ratio information. Step 104, storing the first portion of the transmitted data into a first buffer corresponding to the first controller, includes: if, during the period of storing the transmitted data into the first buffer, the size of the stored data reaches the switching ratio indicated by the switching ratio information, then the second controller is notified to prepare for switching to receive the transmitted data; and the transmitted data continues to be stored into the first buffer until the size of the stored data reaches the size of the first portion of the data. Since the controller receives data frame by frame, in this way, when the switching ratio is reached, the next controller is first notified to prepare for switching the data buffer. Therefore, when storing the transmitted data into the buffer of the next controller, no preparatory steps are required; the data can be directly written into the buffer, further improving data processing efficiency.
[0042] In an optional embodiment, if the receive switching function of the controller group is disabled, at least two of the plurality of caches are associated with the first controller in the controller group according to the configuration information; and the first controller receives the transmitted data and stores the transmitted data in the at least two caches. In this way, the currently used controller can utilize all the cache resources in the controller group, increasing the storage depth.
[0043] In one optional embodiment, if the receive switching function of the controller group is disabled, the multiple controllers are instructed to simultaneously receive the corresponding portion of the transmitted data according to the configuration information, and the corresponding portion of the data is stored in the multiple buffers respectively. In this way, after configuring the total buffer size for each controller, each controller receives and processes the data independently, improving data processing efficiency.
[0044] The following will describe, through examples, the application scenarios of the signature firmware upgrade method and device according to embodiments of the present invention.
[0045] Figure 2 This is a flowchart illustrating a method for processing bus data in a real-world scenario according to an embodiment of the present invention, including steps 202 to 210.
[0046] Take a CAN controller group consisting of two CAN controllers as an example.
[0047] In step S202, the transmitted data in the CAN bus network is received.
[0048] In step S204, the configuration information is read. The configuration information includes the total cache size of 6 frames corresponding to the first CAN controller F1 and the total cache size of 6 frames corresponding to the second CAN controller F2; and the switching ratio of 80%.
[0049] In step 206, determine whether the switching function is enabled. If yes, proceed to step 208; otherwise, proceed to step 210.
[0050] In step 208, the transmitted data is stored in the cache of the currently used CAN controller. If there is other data in the cache, it is directly overwritten. It is determined whether the used size has reached the switching size of 4 frames corresponding to the switching ratio. If so, the other CAN controller is notified to prepare to switch the data cache, and the transmitted data is continued to be stored in the cache corresponding to the currently used CAN controller until the used size of the cache corresponding to the currently used CAN controller reaches the total cache size of 6 frames.
[0051] In step 210, if only one CAN controller is used, the total buffer size of 12 frames corresponding to the first CAN controller F1 and the second CAN controller F2 is configured to the total buffer size corresponding to one CAN controller, and the CAN controller with the configured total buffer size is used as the currently used CAN controller. That is, if the total buffer size corresponding to the first CAN controller F1 is configured to be 12 frames, the first CAN controller F1 is used as the currently used CAN controller, or if the total buffer size corresponding to the second CAN controller F2 is configured to be 12 frames, the second CAN controller is used as the currently used CAN controller.
[0052] If it is necessary to use both the first CAN controller F1 and the second CAN controller F2 at the same time, the first CAN controller F1 and the second CAN controller F2 respectively receive the transmitted data into their own configured buffers for processing.
[0053] According to another aspect of the invention, Figure 3 This is a block diagram illustrating an apparatus 300 for processing bus data according to an embodiment of the present invention. (Refer to...) Figure 3 The device 300 includes a data selector 304 and a controller group 302.
[0054] The controller group 302 includes multiple controllers, each of which includes a cache.
[0055] Data selector 304 is configured to be electrically coupled to the bus and to switch according to configuration information associated with multiple buffers, such that at least one of the multiple controllers is electrically coupled to the bus. Data selector 304 is configured to: if the receive switching function of the controller group is enabled, cause a first controller in the controller group to begin receiving transmitted data from the bus according to the configuration information, such that the first controller stores a first portion of the transmitted data into a first buffer corresponding to the first controller according to the configuration information; and cause a second controller in the controller group to continue receiving the transmitted data according to the configuration information, such that the second controller stores a second portion of the transmitted data into a second buffer corresponding to the second controller according to the configuration information.
[0056] In an optional embodiment, the transmitting end TX of each controller in the controller group 302 is connected to the receiving end RX of the data selector 304, and the receiving end RX of each controller in the controller group 302 is connected to the transmitting end TX of the data selector 304.
[0057] In one alternative embodiment, the transmitter (TX) and receiver (RX) of each controller are implemented by a single interface, and the transmitter (TX) and receiver (RX) of the data selector are implemented by a single interface.
[0058] In some embodiments, each of the plurality of controllers further includes a register 3022. The register 3022 is configured to store the first address of a cache 3024 corresponding to the register 3022, such that the controller 302 corresponding to the register 3022 can obtain the capacity and address of the cache 3024. The transmitting end TX of the register 3022 is electrically coupled to the receiving end RX of the data selector 304, and the receiving end RX of the register 3022 is electrically coupled to the transmitting end TX of the data selector 304. In this way, a register is added to each controller, filled with its cache first address; during operation, each controller can know its cache capacity and address; that is, the cache size used by the controller can be changed by adjusting the cache first address in the register, without changing the actual size of the controller in hardware.
[0059] In summary, for example Figure 3 In the CAN controller, C1 and F1 form a CAN controller, and C2 and F2 form a CAN controller. However, by adjusting the first and second addresses of the cache in C1, the CAN controller corresponding to C1 can actually use the F2 cache of another controller. The data selector can switch the data into the cache corresponding to different controllers according to the configuration.
[0060] In some embodiments, the addresses of the multiple caches are contiguous and the data stacking direction is consistent. In this way, when the CAN processor retrieves data, it increments the counter in one direction, without needing to jump to read the starting address of the second controller's cache after reading the first controller's cache, thus improving read efficiency. Furthermore, by using register placement to merge and utilize the data cache units of the two controllers, the cache depth is increased.
[0061] Figure 4 This is a schematic diagram illustrating the structure of a device for processing bus data, including a central control unit, according to an embodiment of the present invention. (Refer to...) Figure 4 In some embodiments, the device further includes a configurable master control unit 306 electrically coupled to the controller group 302 and the data selector 304, and configured to enable or disable the receive switching function of the controller group 302, and generate the configuration information, which includes identification information associated with the plurality of caches, storage information associated with the size of the data to be stored in the plurality of caches, and / or switching ratio information indicating the switching timing for notifying the next controller in the controller group 302 to prepare to receive the transmitted data; the output of the master control unit 306 is connected to the data input of the data selector; the input of the master control unit is used to connect to the CAN bus. In this way, configuration information corresponding to each controller can be set, reducing the processing load on the data selector.
[0062] In an optional embodiment, the central control unit is further configured to: if the receive switching function of the controller group is disabled, associate at least two of the plurality of caches with the first controller in the controller group according to the configuration information; and control the data selector to enable the first controller to receive the transmitted data, such that the first controller stores the transmitted data in the at least two caches. In this way, even when the switching function is disabled, the cache sets of different controllers can be used, thereby increasing the cache depth.
[0063] In an optional embodiment, the central control unit is further configured to: if the receive switching function of the controller group is disabled, control the data selector according to the configuration information to enable the multiple controllers to simultaneously receive the corresponding portion of the transmitted data, so that the multiple controllers store the corresponding portion of the data into the multiple buffers respectively. In this way, multiple controllers can be used independently while flexibly adjusting the buffers corresponding to each controller.
[0064] In one alternative embodiment, the bus includes a Controller Area Network (CAN) bus, and the controller includes a CAN controller. This approach improves the transmission characteristics of the CAN bus and resolves the data congestion problem during CAN bus transmission.
[0065] According to another aspect of the invention, Figure 5 This is a schematic diagram illustrating an electronic device 500 according to an embodiment of the present invention. (Refer to...) Figure 5 The electronic device 500 includes a memory 502 and a processor 504. The memory 502 stores a computer program that can run on the processor 504. When the processor 504 executes the computer program, it implements the various steps or actions of the method for processing bus data as described above.
[0066] According to another aspect of the present invention, a computer-readable medium is provided. The computer-readable medium stores a computer program that is executed by a processor to implement the method for processing bus data as described above.
[0067] In summary, the method, apparatus, device, and storage medium for processing bus data provided by this invention, by grouping different controllers into a controller group and uniformly configuring and calling the caches of different controllers, deepens the cache of the controllers without changing the hardware structure of a single controller. When the switching function is enabled, ping-pong storage can be achieved by changing the read, write, and load operations of multiple caches corresponding to multiple controllers, thereby improving the efficiency of data processing and transmission. When the switching function is disabled, the caches corresponding to all controllers can be integrated or multiple controllers can be used separately, depending on the configuration, to meet the needs of different production scenarios and enhance the storage depth without increasing the on-chip area.
[0068] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for processing bus data, characterized in that, include: Obtain configuration information associated with multiple caches, which are respectively included in multiple controllers of a controller group; If the receive switching function of the controller group is enabled, the first controller in the controller group will start receiving the transmitted data from the bus according to the configuration information, and the first part of the transmitted data will be stored in the first buffer corresponding to the first controller. as well as According to the configuration information, the second controller in the controller group continues to receive the transmitted data, and stores the second portion of the transmitted data into the second buffer corresponding to the second controller. When storing the first part of the data into the first cache corresponding to the first controller or storing the second part of the data into the second cache corresponding to the second controller, if the used size of the first cache or the second cache for this write meets the configuration information, the first cache or the second cache is switched to a readable flag, and the data in the first cache or the second cache is read out before being switched to a writable flag.
2. The method according to claim 1, characterized in that, The configuration information includes identification information associated with the first cache and the second cache, as well as storage information associated with the size of the data to be stored in the first cache and the second cache.
3. The method according to claim 2, characterized in that, The configuration information is used to cause the first controller in the controller group to start receiving transmitted data from the bus, which includes: according to the first identification information representing the first buffer, causing the first controller corresponding to the first buffer to start receiving the transmitted data. Storing the first portion of the transmitted data into a first cache corresponding to the first controller includes: storing the first portion of data corresponding to the first data size into the first cache according to first storage information representing the first data size to be stored in the first cache. The configuration information allows the second controller in the controller group to continue receiving the transmitted data, which includes, based on the second identifier information representing the second buffer, causing the second controller corresponding to the second buffer to continue receiving the transmitted data after the first portion of data is stored in the first buffer. Storing the second portion of the transmitted data into the second cache corresponding to the second controller includes: storing the second portion of data corresponding to the second data size into the second cache according to second storage information representing the second data size to be stored in the second cache.
4. The method according to claim 1, characterized in that, Also includes: If the size of the received transmitted data is greater than the sum of the sizes of the first part of the data and the second part of the data, then according to the configuration information, the third controller in the controller group continues to receive the transmitted data, and stores the third part of the transmitted data into the third buffer corresponding to the third controller.
5. The method according to claim 1, characterized in that, The configuration information also includes switching ratio information, and storing the first portion of the transmitted data into a first cache corresponding to the first controller includes: If, during the process of storing the transmitted data in the first buffer, the size of the stored data reaches the switching ratio indicated by the switching ratio information, then the second controller is notified to prepare for switching to receive the transmitted data; and Continue storing the transmitted data into the first buffer until the size of the stored data reaches the size of the first part of the data.
6. The method according to claim 1, characterized in that, Also includes: If the receive switching function of the controller group is disabled, then at least two of the plurality of caches are associated with the first controller in the controller group according to the configuration information; as well as The first controller receives the transmitted data and stores the transmitted data in the at least two buffers.
7. The method according to claim 1, characterized in that, Also includes: If the receive switching function of the controller group is turned off, the multiple controllers are made to receive the corresponding part of the transmitted data simultaneously according to the configuration information, and the corresponding part of the data is stored in the multiple buffers respectively.
8. The method according to claim 1, characterized in that, Receiving transmitted data from the bus includes: Receives data transmitted from the controller area network CAN bus.
9. An apparatus for processing bus data, characterized in that, include: A controller group, comprising multiple controllers, each of which includes a cache; and A data selector, configured to be electrically coupled to the bus, switches according to configuration information associated with multiple caches, such that at least one of the multiple controllers is electrically coupled to the bus. The data selector is configured as follows: If the receive switching function of the controller group is enabled, the first controller in the controller group will start receiving the transmitted data from the bus according to the configuration information, so that the first controller will store the first part of the transmitted data into the first buffer corresponding to the first controller according to the configuration information. as well as According to the configuration information, the second controller in the controller group continues to receive the transmitted data, and the second controller stores the second portion of the transmitted data into the second buffer corresponding to the second controller, according to the configuration information. When storing the first part of the data into the first cache corresponding to the first controller or storing the second part of the data into the second cache corresponding to the second controller, if the used size of the first cache or the second cache for this write meets the configuration information, the first cache or the second cache is switched to a readable flag, and the data in the first cache or the second cache is read out before being switched to a writable flag.
10. The apparatus according to claim 9, characterized in that, Also includes: A configurable master control unit is electrically coupled to the controller group and the data selector, and is configured to enable or disable the receive switching function of the controller group, and generate the configuration information. The configuration information includes identification information associated with the plurality of caches and storage information associated with the size of the data to be stored in the plurality of caches, and / or switching ratio information indicating the switching timing for notifying the next controller in the controller group to prepare to receive the transmitted data.
11. The apparatus according to claim 10, characterized in that, The central control unit is further configured as follows: If the receive switching function of the controller group is disabled, then at least two of the plurality of caches are associated with the first controller in the controller group according to the configuration information; as well as The data selector is controlled to cause the first controller to receive the transmitted data, and the first controller stores the transmitted data in the at least two buffers.
12. The apparatus according to claim 10, characterized in that, The central control unit is further configured as follows: If the receive switching function of the controller group is turned off, the data selector is controlled according to the configuration information so that the multiple controllers simultaneously receive the corresponding part of the transmitted data, and the multiple controllers store the corresponding part of the data into the multiple buffers respectively.
13. The apparatus according to claim 9, characterized in that, The addresses of the multiple caches are consecutive and the data stacking direction is consistent.
14. The apparatus according to claim 9, characterized in that, Each of the plurality of controllers further includes a register configured to store the first address of a cache corresponding to the register, such that the controller corresponding to the register obtains the capacity and address of the cache.
15. The apparatus according to claim 14, characterized in that, The transmitting end of the register is electrically coupled to the receiving end of the data selector, and the receiving end of the register is electrically coupled to the transmitting end of the data selector.
16. The apparatus according to claim 9, characterized in that, The bus includes a Controller Area Network (CAN) bus, and the controller includes a CAN controller.
17. An electronic device, characterized in that, include: Memory, configured to store computer programs; as well as A processor is configured to execute the computer program to perform the method according to any one of claims 1 to 8.
18. A computer-readable medium having a computer program stored thereon, characterized in that, The computer program is executed to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Real-time high-speed data transmission method and system based on USB3.0 auxiliary protocol
CN110096461A