A data sending method, device, storage medium and vehicle
Patent Information
- Application Number
- CN202611138675.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]本发明的目的在于提供一种数据发送方法、数据发送装置、电子设备、存储介质及车辆,至少解决汽车软件SOA信号、CAN信号及域内通信消息的数据结构不一致导致无法统一接口的问题,解决SOA信号数据结构含有成员变量,时常存在Can信号的俩个不同的帧内,CAN信号发送一般都是单帧发送,这就会导致无法统一的接口提供到APP层的痛点问题,无法实现APP层和系统层的解耦,无法在系统层改动的情况下,APP层不改动的需求的问题中的一个技术问题
本发明通过预先增加的CAN信号接收器,接收CAN信号。可以对CAN信号进行解析存储,为后续数据的自由组合提供数据支撑。
Smart Images

Figure CN122824702A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of signal processing technology, and more particularly to data transmission methods, data transmission devices, storage media, and vehicles. Background Technology
[0002] With the development of electric vehicles, more and more models are being launched simultaneously. To address the issue of frequent interface changes due to system interface variations, a unified interface is designed in the middleware for upper layers to use. Since the system's data sources include Service-Oriented Architecture (SOA) signals and Controller Area Network (CAN) signals, the transmitted structure data differs. Sometimes, the member variables of a structure transmitted from an SOA frame need to be obtained from two different sets of signals in the CAN signal. To resolve this contradiction, it is necessary to extract and combine data from relevant positions in the different frame signals within the CAN signal. This technology solves the problem of different signals being incompatible with the same interface. The direct benefit is that it unifies thousands of interfaces provided to the upper layers, decoupling the upper layers' dependence on the system side, thereby saving development manpower costs.
[0003] Regarding the combination of heterogeneous frame signals, application number "CN207644319U" entitled "Combined Instrument Based on Dual CAN Bus Communication" discloses a combined instrument based on dual CAN bus communication, including a CAN1 bus and the instrument body. This utility model physically sets up two CAN buses to communicate independently without interference, greatly improving the reliability of the vehicle's bus communication. However, this scheme splits a group of signals into two lines, allowing for the simultaneous merging of two heterogeneous frame signals, but it cannot handle more heterogeneous frame signals. Application number "CN119155357A" entitled "A CAN Signal Encapsulation and Data Parsing Method" relates to a CAN signal encapsulation and data parsing method. The encapsulation method processes the CAN signal based on its start bit, length, physical value, offset, and transfer factor using Boolean logic to generate corresponding frame data. Simultaneously, the entire processing is encapsulated into a sub-VI; only the start bit, length, offset, and transfer factor of the CAN signal need to be input to obtain the required frame data. If multiple CAN signals are needed, simply cascade multiple sub-VIs together to output an 8-byte frame of data, which can then be bundled to obtain the required output cluster. However, the combined output data must be within the same frame, which has limitations. Summary of the Invention
[0004] The purpose of this invention is to provide a data transmission method, data transmission device, electronic device, storage medium, and vehicle, at least to solve the problem of inconsistent data structures of SOA signals, CAN signals, and intra-domain communication messages in automotive software, which leads to the inability to provide a unified interface. This addresses the pain point that SOA signal data structures often contain member variables that exist in two different frames of CAN signals, while CAN signal transmission is generally single-frame transmission. This results in the inability to provide a unified interface to the APP layer, hindering the decoupling of the APP layer and the system layer, and preventing changes at the system layer without requiring modifications to the APP layer.
[0005] This invention provides the following solution: According to one aspect of the present invention, a data transmission method is provided, comprising: CAN signals are received based on the controller area network CAN signal receiver pre-added in the data interface; The CAN signal is parsed to obtain frame data and buffered to determine the first data required to constitute the combined data included in the frame data; The system searches for second data in the cached data that constitutes at least one other frame of data in the combined data, and sends the first data and the second data based on the combination interface corresponding to the combined data.
[0006] Preferably, the step of parsing the CAN signal to obtain frame data and buffering it includes: The CAN signal is analyzed to obtain at least one data unit; The data interface name is used as an index to construct a correspondence between the index and the data unit, and the data unit is cached based on the correspondence.
[0007] Preferably, after caching the data unit based on the correspondence, the method further includes: The frame data is sent based on the data interface.
[0008] Preferably, the determination of the first data required to constitute the combined data included in the frame data includes: The frame data is located in the preset combined data mapping table; If the combined data mapping table includes part or all of the frame data, at least one combined data is determined based on the frame data; In the frame data, first data required to constitute each of the combined data is determined.
[0009] Preferably, after determining the first data required for determining the combined data included in the frame data, the method further includes: For each of the combined data, if the first data in the combined data is determined and no asynchronous thread task corresponding to the combined data has been created, an asynchronous thread task for the combined data is created in the combined interface corresponding to the combined data, and a timer is set. Add the asynchronous thread task to the task queue of the composite interface and start the timer corresponding to the asynchronous thread task.
[0010] Preferably, sending the first data and the second data based on the combination interface corresponding to the combined data includes: In response to finding all the second data constituting the combined data in the cached data before the timer expires, the first data and the second data are sent based on the combined interface; End the asynchronous thread task.
[0011] Preferably, the method further includes: In response to the fact that not all of the second data constituting the combined data is found in the cached data before the timer ends, the first data is sent based on the combined interface as the timer ends; End the asynchronous thread task.
[0012] According to a second aspect of the present invention, a data transmission apparatus is provided, comprising: The signal receiving module is used to receive CAN signals based on the controller area network CAN signal receiver pre-added in the data interface; A data caching module is used to parse the CAN signal to obtain frame data and cache it, and determine the first data required to constitute the combined data included in the frame data; The data sending module is used to find second data in the cached data that constitutes at least one other frame data of the combined data, and send the first data and the second data based on the combination interface corresponding to the combined data.
[0013] According to three aspects of the present invention, an electronic device is provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a data transmission method.
[0014] According to four aspects of the present invention, a computer-readable storage medium is provided, comprising: storing a computer program executable by an electronic device, wherein when the computer program is run on the electronic device, the electronic device performs the steps of a data transmission method.
[0015] According to five aspects of the present invention, a vehicle is provided, comprising: Electronic equipment, comprising the steps for implementing a data transmission method; The processor runs programs, and when the program runs, it executes the steps of a data transmission method from data output by an electronic device. Storage medium used to store programs, which, when running, execute steps of a data transmission method for data output from an electronic device.
[0016] The above solution achieves the following beneficial technical effects: This invention receives CAN signals through a pre-added CAN signal receiver. The CAN signals can be parsed and stored, providing data support for subsequent free combination of data.
[0017] This invention enables the transmission of all necessary data using a single frame by including the first data required for combining data in the frame data, searching for the second data required for combining data in the cached data, and sending the first and second data based on the combination interface corresponding to the combined data. It can achieve the function of arbitrarily combining data from different frames without delay or blocking, without affecting the system's functions or other signal transmission rates. After the upper-layer interface is unified, modifications to the lower layer will not affect changes to the upper layer, completely decoupling the APP layer and the system layer, saving development costs and debugging time, and ensuring a significant improvement in system stability. Attached Figure Description
[0018] Figure 1 This is a flowchart of a data transmission method provided by one or more embodiments of the present invention.
[0019] Figure 2 This is a schematic diagram of a frame data structure provided in a specific embodiment of the present invention.
[0020] Figure 3 This is a schematic diagram of inter-frame data combination provided in a specific embodiment of the present invention.
[0021] Figure 4 This is a structural diagram of a data transmission device provided in one or more embodiments of the present invention.
[0022] Figure 5 This is a block diagram of an electronic device structure for a data transmission method provided in one or more embodiments of the present invention. Detailed Implementation
[0023] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.
[0025] It should be understood that the term "and / or" used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship. It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish descriptions. For example, without departing from the scope of the embodiments of this application, first can also be referred to as second, and similarly, second can also be referred to as first. Depending on the context, the words "if" or "if" as used herein can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrases "if determined" or "if detected (the stated condition or event)" can be interpreted as "when determined," "in response to determination," "when detected (the stated condition or event)," or "in response to detection (the stated condition or event)." It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0026] Figure 1 This is a flowchart of a data transmission method provided by one or more embodiments of the present invention.
[0027] like Figure 1 The data transmission methods shown include: Step S1: Receive CAN signals based on the CAN signal receiver pre-added in the data interface.
[0028] In this embodiment, a CAN signal receiver can be pre-embedded in each data interface layer, so that CAN signals of different frames can be received through the CAN signal receiver.
[0029] Step S2: Parse the CAN signal to obtain frame data and buffer it. If the frame data includes the first data required to form the combined data.
[0030] The frame data obtained by parsing the CAN signal through the CAN signal receiver is obtained by buffering all the data units in the frame data. The data units are then analyzed to determine whether the data is part of the combined data to be transmitted provided by the data interface.
[0031] Furthermore, the parsed frame data is cached in a specified cache space.
[0032] If the frame data includes the data required to form the combined data, then the required data is determined as the first data.
[0033] Step S3: Locate the second data in the cached data that constitutes at least one other frame data of the combined data, and send the first data and the second data based on the combination interface corresponding to the combined data.
[0034] In the cached data, the second data constituting at least one other frame of data is located. Based on the combination interface corresponding to the combined data, the first data and the second data are sent. Each piece of combined data corresponds to one combination interface, and the second data of at least one other frame of data includes data units included in at least one other frame of data.
[0035] In this embodiment, the CAN signals received by the CAN signal receiver from different frames are serial frames. Figure 2 This is a schematic diagram of a frame data structure provided in a specific embodiment of the present invention. For example... Figure 2 As shown, 01, 02, and 03 are the frame numbers, and the information on the right is the frame information: composed of frame information, frame ID, and a data field. The data field stores multiple data units, as shown in 0102-0B in the diagram. Each data unit has its own ID and data. Different data units are independent and unrelated to each other.
[0036] The CAN signal receiver then parses the CAN signal to obtain at least one data unit. Using the data interface name (ID) as an index, it establishes a correspondence between the index and the data unit, and caches the data units based on this correspondence. That is, the interface name ID is used as the index, and the parsed data is used as the value.<Key,Value> The data units are stored in the buffer. After buffering, the data interface receiving the frame data immediately sends all the parsed data without affecting the data transmission of the original data interface. That is, the combined data is sent by the combined interface, and the data interface receiving the frame data will still send the received data without affecting the data transmission of this data interface itself. The data received by the pre-embedded CAN signal receiver in this embodiment buffers the data, providing the combined interface with the data units that constitute the combined data.
[0037] In this embodiment, a combined data mapping table can also be set in the data interface according to the combined data required by the data interface. The combined data mapping table contains the data interface information to be sent and all data IDs required by the current data interface.
[0038] For example, taking the combined interface 3 in the combined data mapping table as an example, combined interface 3 includes a data interface with ID 1 and a data interface with ID 2. The combined data A can be the fifth data unit in the frame data with ID 1 and the third data unit in the frame data with ID 2. The combined data B can be the second data unit in the frame data with ID 1 and the first data unit in the frame data with ID 4.
[0039] Taking the combined interface 5 in the combined data mapping table as an example, the combined interface 5 includes a data interface with ID 4 and a data interface with ID 6. The combined data can be the third data unit in the frame data with ID 6 and the third data unit in the frame data with ID 4.
[0040] The combined data includes two or more data units, that is, the combined data can include three or more data units.
[0041] Furthermore, the frame data is searched in a preset combined data mapping table. If the combined data mapping table includes part or all of the frame data, at least one combined data is determined based on the frame data. For example, if the frame data is frame data with ID 1, then it can be determined that the fifth data unit of combined data A and the second data unit of combined data B exist in the frame data.
[0042] Thus, in the frame data, the first data required to constitute each combined data is determined, that is, the first data of combined data A is determined to be the fifth data unit in the frame data, and the first data of combined data B is determined to be the second data unit in the frame data.
[0043] Next, an asynchronous thread task corresponding to each combination of data is started. This asynchronous thread task is a scheduled task.
[0044] Specifically, for each set of combined data, in response to the lack of a corresponding asynchronous thread task created in the combination interface for the combined data, an asynchronous thread task for the combined data is created in the combination interface, and a timer is set. The duration of the timer can be determined based on the number of combined data sets. For example, asynchronous thread task A is created for combined data A, and timer A is set; similarly, asynchronous thread task B is created for combined data B, and timer B is set.
[0045] After determining that the frame data includes the first data required for the combination data, the asynchronous thread task is added to the task queue of the combination interface, and the timer corresponding to the asynchronous thread task is started.
[0046] It should be noted that each composite interface may require multiple composite data. Once the first data of multiple composite data is determined, its corresponding asynchronous thread task is added to the task queue of the composite interface and the corresponding timer is started.
[0047] In one embodiment of this example, if the second data constituting the combined data is found in the cached data before the timer ends, the first data and the second data are sent based on the combined interface corresponding to the combination, and the asynchronous thread task is terminated.
[0048] In another embodiment of this example, if the second data constituting the combined data is not found in the cached data before the timer ends, the first data is sent based on the combined interface and the asynchronous thread task is terminated at the same time the timer ends.
[0049] In this context, ending an asynchronous thread task means recycling that asynchronous thread task.
[0050] In this embodiment, CAN signals from different frames perform mutual checks for existence during the parsing and buffering of their frame data. That is, while the first data in the combined data is searching for the second data in the buffer, the second data in the buffer is also searching for the first data. This continues until mutual confirmation of existence is achieved. Then, the timer for the scheduled task (asynchronous thread task) is immediately reset to zero, and the first and second data are sent immediately through the designated combination interface. If no other data is found in the combined data, the task waits until the timer for the asynchronous thread task expires before sending the buffered data out through the designated combination interface.
[0051] It should be noted that after the timer expires, the asynchronous thread task is completed and completely removed from the queue. One asynchronous thread task is handled by one thread, and the thread is recycled after the asynchronous thread task is completed.
[0052] Figure 3 This is a schematic diagram of inter-frame data combination provided in a specific embodiment of the present invention. For example... Figure 3 As shown, the signal transmitting unit sends multiple frames of CAN signals, for example... Figure 3 The CAN signal consists of frame 1 to frame n. Each frame includes multiple data units; for example, in frame 1, a, b, c, and d are all data units. The frame CAN signal is sent to the interface layer, which includes an interface with ID 1 (the data interface in this embodiment), an interface with ID 2, and an interface with ID 3. Each interface receives the frame CAN signal, parses and buffers the data units, and immediately sends the parsed data to the application layer.
[0053] Each interface cached data unit is placed in a common cache space, that is Figure 3 The interface with ID 1 caches the target data unit of frame 1 into the cache space, the interface with ID 2 caches the target data unit of frame 2 into the cache space, and the interface with ID 3 caches the target data unit of frame 3 into the cache space, thus obtaining data units 1, 2, 3, ..., n in the cache space. An asynchronous thread task is then created and added to the asynchronous timer thread queue. For each asynchronous thread task, its corresponding interface is monitored until the asynchronous thread task ends. The condition for the asynchronous thread task to end is that the set timer expires, or all the data required for data combination has been obtained.
[0054] This embodiment's inter-frame combination signal technology enables the arbitrary combination of data from different frames without delay or blocking, and does not affect system functionality or other signal transmission rates. After unifying the upper-layer interface, modifications to the lower layers will not affect changes to the upper layers, achieving complete decoupling, saving development costs and debugging time, and ensuring a significant improvement in system stability.
[0055] Figure 4 This is a structural diagram of a data transmission device provided in one or more embodiments of the present invention.
[0056] like Figure 4 The data transmission device shown includes: a signal receiving module, a data buffer module, and a data transmission module.
[0057] The signal receiving module is used to receive CAN signals based on the controller area network CAN signal receiver pre-added in the data interface; The data caching module is used to parse the CAN signal to obtain frame data and cache it, and to determine the first data required to constitute the combined data included in the frame data; The data sending module is used to find second data in the cached data that constitutes at least one other frame data of the combined data, and send the first data and the second data based on the combination interface corresponding to the combined data.
[0058] A data caching module is used to parse the CAN signal to obtain at least one data unit; to construct a correspondence between the data interface name and the data unit using the data interface name as an index, and to cache the data unit based on the correspondence.
[0059] The data sending module is also used to send the frame data based on the data interface.
[0060] A data caching module is used to search for the frame data in a preset combined data mapping table; if the combined data mapping table includes part or all of the frame data, at least one combined data is determined based on the frame data; and in the frame data, first data required to constitute each combined data is determined.
[0061] The data caching module is used to, for each of the combined data, if the first data in the combined data is determined and no asynchronous thread task corresponding to the combined data has been created, create an asynchronous thread task for the combined data in the combined interface corresponding to the combined data and set a timer; add the asynchronous thread task to the task queue of the combined interface and start the timer corresponding to the asynchronous thread task.
[0062] A data sending module is configured to, in response to finding all the second data constituting the combined data in the cached data before the timer expires, send the first data and the second data based on the combination interface; and terminate the asynchronous thread task.
[0063] A data sending module is configured to send the first data based on the combination interface when the timer expires and all the second data constituting the combined data is not found in the cached data before the timer expires; and to terminate the asynchronous thread task.
[0064] Figure 5 This is a block diagram of an electronic device structure for a data transmission method provided in one or more embodiments of the present invention.
[0065] like Figure 5 As shown, the present invention provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a data transmission method.
[0066] The present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a data transmission method.
[0067] The present invention also provides a vehicle, comprising: Electronic equipment for implementing steps based on a data transmission method; The processor runs programs, and when the program runs, it executes the steps of a data transmission method from data output by an electronic device. Storage medium used to store programs, which, when running, execute steps of a data transmission method for data output from an electronic device.
[0068] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0069] The electronic device comprises a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on the operating system. The hardware layer includes hardware such as a central processing unit (CPU), a memory management unit (MMU), and memory. The operating system can be any one or more computer operating systems that control the electronic device through processes, such as Linux, Unix, Android, iOS, or Windows. Furthermore, in this embodiment of the invention, the electronic device can be a smartphone, tablet computer, or other handheld device, or a desktop computer, portable computer, or other electronic device; there is no particular limitation in this embodiment.
[0070] In this embodiment of the invention, the executing entity for electronic device control can be an electronic device itself, or a functional module within an electronic device capable of calling and executing a program. The electronic device can obtain the firmware corresponding to the storage medium. This firmware is provided by the supplier, and different storage media may have the same or different firmware; no limitation is made here. After obtaining the firmware corresponding to the storage medium, the electronic device can write this firmware into the storage medium; specifically, it burns the firmware corresponding to the storage medium into the storage medium. The process of burning the firmware into the storage medium can be implemented using existing technology, and will not be elaborated upon in this embodiment of the invention.
[0071] Electronic devices can also obtain reset commands corresponding to storage media. These reset commands are provided by the supplier, and the reset commands for different storage media can be the same or different, which is not limited here.
[0072] At this time, the storage medium of the electronic device is a storage medium on which the corresponding firmware has been written. The electronic device can respond to the reset command corresponding to the storage medium on which the corresponding firmware has been written, thereby resetting the storage medium on which the corresponding firmware has been written according to the reset command. The process of resetting the storage medium according to the reset command can be implemented by existing technology and will not be described in detail in this embodiment of the invention.
[0073] For ease of description, the above apparatus is described by dividing it into various units and modules according to their functions. Of course, in implementing this invention, the functions of each unit and module can be implemented in one or more software and / or hardware.
[0074] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined.
[0075] For the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0076] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data transmission method, characterized in that, include: CAN signals are received based on the controller area network CAN signal receiver pre-added in the data interface; The CAN signal is parsed to obtain frame data and buffered to determine the first data that constitutes the combined data included in the frame data; The system searches for second data in the cached data that constitutes at least one other frame of data in the combined data, and sends the first data and the second data based on the combination interface corresponding to the combined data.
2. The data transmission method according to claim 1, characterized in that, The process of parsing the CAN signal to obtain frame data and buffering it includes: The CAN signal is analyzed to obtain at least one data unit; The data interface name is used as an index to construct a correspondence between the index and the data unit, and the data unit is cached based on the correspondence.
3. The data transmission method according to claim 2, characterized in that, After caching the data unit based on the correspondence, the method further includes: The frame data is sent based on the data interface.
4. The data transmission method according to claim 1, characterized in that, The determination of the first data required to constitute the combined data included in the frame data includes: The frame data is located in the preset combined data mapping table; If the combined data mapping table includes part or all of the frame data, at least one combined data is determined based on the frame data; In the frame data, first data required to constitute each of the combined data is determined.
5. The data transmission method according to claim 1 or 4, characterized in that, After determining the first data required for determining the combined data included in the frame data, the method further includes: For each of the combined data, if the first data in the combined data is determined and no asynchronous thread task corresponding to the combined data has been created, an asynchronous thread task for the combined data is created in the combined interface corresponding to the combined data, and a timer is set. Add the asynchronous thread task to the task queue of the composite interface and start the timer corresponding to the asynchronous thread task.
6. The data transmission method according to claim 5, characterized in that, Sending the first data and the second data based on the combination interface corresponding to the combined data includes: In response to finding all the second data constituting the combined data in the cached data before the timer expires, the first data and the second data are sent based on the combined interface; End the asynchronous thread task.
7. The data transmission method according to claim 6, characterized in that, The method further includes: In response to the fact that not all of the second data constituting the combined data is found in the cached data before the timer ends, the first data is sent based on the combined interface as the timer ends; End the asynchronous thread task.
8. A data transmission device, characterized in that, The method described using any one of claims 1-7 includes: The signal receiving module is used to receive CAN signals based on the controller area network CAN signal receiver pre-added in the data interface; A data caching module is used to parse the CAN signal to obtain frame data and cache it, and determine the first data required to constitute the combined data included in the frame data; The data sending module is used to find second data in the cached data that constitutes at least one other frame data of the combined data, and send the first data and the second data based on the combination interface corresponding to the combined data.
9. A computer-readable storage medium, characterized in that, The device stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the data transmission method as described in any one of claims 1 to 7.
10. A vehicle, characterized in that, include: An electronic device for implementing the steps of the data transmission method as described in any one of claims 1 to 7; A processor that runs a program that, when the program is running, performs the steps of the data transmission method as described in any one of claims 1 to 7 on data output from an electronic device. A storage medium for storing a program that, when running, performs the steps of the data transmission method as described in any one of claims 1 to 7 on data output from an electronic device.
Citation Information
Patent Citations
CAN signal packaging and data analysis method
CN119155357A
Combination meter based on two CAN bus communication
CN207644319U