Data transmission method and device, storage medium and new energy commercial vehicle
By performing text encoding conversion processing on vehicle information, text signal packets are generated and transmitted, the problem of insufficient transmission of CAN bus is solved, and the direct transmission of Chinese characters, letters and numbers is realized, and the entire vehicle information backup and application is supported.
Patent Information
- Application Number
- CN202510423331.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, the data transmission of the CAN bus is poorly rich, and it is difficult to effectively transmit text information of Chinese characters, letters and numbers.
After obtaining vehicle information and determining that it is text information, the conversion process is performed using the preset text encoding rules to generate a text signal message, and transmit it to the data collector via the bus. The text signal message includes at least one text unit, and each unit occupies a preset byte length.
It realizes the direct transmission of Chinese characters, letters and numbers text information through the CAN bus, optimizes the richness of data transmission, and supports the application of vehicle information backup and other components.
Smart Images

Figure CN120415941A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to technical fields such as big data technology and data acquisition technology, and particularly relates to a method, device, storage medium, and new energy commercial vehicle for data transmission. Background Art
[0002] Currently, most commercial vehicles in the market use the Controller Area Network (CAN) bus as the vehicle communication network to achieve information transmission and signal interaction between the Electronic Control Units (ECUs) of the vehicle. Summary of the Invention
[0003] This application provides a method, device, storage medium, and new energy commercial vehicle for data transmission, which can solve the problem of poor richness of CAN bus data transmission. The technical solutions are as follows:
[0004] In a first aspect, a method for data transmission is provided. The method includes:
[0005] Obtain vehicle information to be processed, where the vehicle information includes identification information;
[0006] Based on the identification information, determine whether the vehicle information is text information;
[0007] In response to the vehicle information being text information, use a preset text encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information. The text signal message includes at least one text unit, and each text unit occupies a preset byte length;
[0008] Transmit the text signal message to the bus to transmit the text signal message to the data collector through the bus.
[0009] In a possible implementation manner, the step of, in response to the vehicle information being text information, using a preset encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information includes:
[0010] Based on the text information, the preset byte length, and the fixed byte length of the text signal message, obtain the sequence numbers and signal attributes of multiple text signal messages corresponding to the text information;
[0011] For each text signal message, based on the sequence number and signal attributes of the text signal message, determine the coding information corresponding to the fixed bytes of each text signal message, and perform conversion processing on the text in the text information according to the preset byte length to obtain at least one text unit for each text signal message;
[0012] Based on the coding information corresponding to the fixed bytes of each text signal message and at least one text unit of each text signal message, obtain the text signal message corresponding to the text information.
[0013] In a possible implementation manner, the performing conversion processing on the text in the text information according to the preset byte length to obtain at least one text unit for each text signal message includes:
[0014] Perform conversion processing on the text in the text information according to the preset byte length to obtain multiple text units;
[0015] In response to determining that the byte length corresponding to the text in the text information is less than the preset byte length, perform byte filling on the text in the text information that is less than the preset byte length so that the byte length of the text in the filled text information is equal to the preset byte length.
[0016] In a possible implementation manner, the text in the text information includes at least one of Chinese characters, letters, and numbers.
[0017] In a possible implementation manner, the preset text coding rule includes one of the UTF-8 coding rule and the custom coding rule.
[0018] In a second aspect, a data transmission system is provided, which is applied to an electronic control unit of a vehicle. The device includes:
[0019] An acquisition unit, configured to acquire vehicle information to be processed, where the vehicle information includes identification information;
[0020] A determination unit, configured to determine whether the vehicle information is text information based on the identification information;
[0021] An obtaining unit, configured to, in response to the vehicle information being text information, perform conversion processing on the text information by using a preset text coding rule to obtain a text signal message corresponding to the text information, where the text signal message includes at least one text unit, and each text unit occupies a preset byte length;
[0022] A transmission unit, configured to transmit the text signal message to a bus, so as to transmit the text signal message to a data collector through the bus.
[0023] In a third aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement the method of the above-described aspect and any possible implementation manner.
[0024] In a fourth aspect, a computer program product is provided, including a computer program, and the computer program implements the method of the above-described aspect and any possible implementation manner when executed by a processor.
[0025] In a fifth aspect, a new energy commercial vehicle is provided, including the system described above.
[0026] The beneficial effects of the technical solution provided by this application at least include:
[0027] As can be seen from the above technical solution, embodiments of this application can obtain vehicle information to be processed; the vehicle information includes identification information, and further, based on the identification information, it can be determined whether the vehicle information is text information. In response to the vehicle information being text information, using a preset text encoding rule, the text information is converted to obtain a text signal message corresponding to the text information. The text signal message includes at least one text unit, and each text unit occupies a preset byte length. The text signal message is transmitted to the bus, and through the bus, the text signal message is transmitted to a data collector. Since the text information can be converted by using a preset text encoding rule to obtain a text signal message that can be used for bus transmission, and the text information is transmitted to the data collector of the vehicle through the bus, the collection and storage of text information can be realized. It can directly transmit text information of Chinese characters, letters, and numbers through the CAN bus to the data collector of the vehicle for vehicle information backup and application of other components, which can optimize the richness of data transmission on the CAN bus.
[0028] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of this application, nor is it used to limit the scope of this application. Other features of this application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of this application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0030] Figure 1 It is a schematic flowchart of a data transmission method provided by an embodiment of this application;
[0031] Figure 2 It is a schematic architecture diagram of a data transmission device provided by another embodiment of the present application;
[0032] Figure 3 It is a schematic architecture diagram of an application scenario of a data transmission method / device provided by another embodiment of the present application. Detailed implementation manners
[0033] The following describes exemplary embodiments of the present application with reference to the accompanying drawings. Various details of the embodiments of the present application are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0034] Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts belong to the scope of protection of the present application.
[0035] It should be noted that the terminal devices involved in the embodiments of the present application may include, but are not limited to, intelligent devices such as mobile phones, personal digital assistants (PDAs), wireless handheld devices, and tablet computers (Tablet Computers); display devices may include, but are not limited to, devices with display functions such as personal computers and televisions.
[0036] In addition, the term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0037] Please refer to Figure 1 , which shows a schematic flowchart of a data transmission method provided by an embodiment of the present application. This data transmission method can be applied to the electronic control unit of a vehicle and specifically may include:
[0038] Step 101, obtain vehicle information to be processed, where the vehicle information includes identification information.
[0039] Step 102, based on the identification information, determine whether the vehicle information is text information.
[0040] Step 103: In response to the vehicle information being text information, use a preset text encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information. The text signal message includes at least one text unit, and each text unit occupies a preset byte length.
[0041] Step 104: Transmit the text signal message to the bus, so as to transmit the text signal message to the data collector through the bus.
[0042] It should be noted that the vehicle information may include identification information, application program information, vehicle driving information, status values of various vehicle components, etc.
[0043] It should be noted that the text information may include information obtained based on the application program of the in-vehicle central control. For example, navigation destination address information, vehicle positioning address information, etc.
[0044] It should be noted that here, the bus may include a CAN bus, a CANFD bus, etc.
[0045] In this way, by using a preset text encoding rule to perform conversion processing on the text information, a text signal message that can be used for bus transmission can be obtained, and the text information can be transmitted to the data collector of the vehicle through the bus, realizing the collection and storage of the text information. It can directly transmit text information of Chinese characters, letters, and numbers through the CAN bus to the data collector of the vehicle for the backup of the whole vehicle information and the application of other components, which can optimize the richness of the data transmission of the CAN bus.
[0046] Optionally, in a possible implementation manner of this embodiment, in step 103, first, based on the text information, the preset byte length, and the fixed byte length of the text signal message, obtain the sequence numbers and signal attributes of multiple text signal messages corresponding to the text information. Secondly, for each text signal message, based on the sequence number and signal attribute of the text signal message, determine the encoding information corresponding to the fixed byte of each text signal message, and perform conversion processing on the text in the text information according to the preset byte length to obtain at least one text unit of each text signal message. Thirdly, based on the encoding information corresponding to the fixed byte of each text signal message and at least one text unit of each text signal message, obtain the text signal message corresponding to the text information.
[0047] In a specific implementation process of this implementation manner, the characters in the text information can be converted according to a preset byte length to obtain a plurality of character units. Furthermore, in response to determining that the byte length corresponding to the characters in the text information is less than the preset byte length, byte padding can be performed on the characters in the text information with a byte length less than the preset byte length, so that the byte length of the characters in the filled text information is equal to the preset byte length.
[0048] In one case of this specific implementation process, preset characters can be used to perform byte padding on the characters in the text information with a byte length less than the preset byte length.
[0049] Here, the preset character can be FF or the like.
[0050] In this implementation manner, a text signal message can include 8 bytes, the preset byte length can be 3 byte lengths, and the length of the fixed bytes of the text signal message can be 2 byte lengths. A text signal message can include 2 bytes of the preset byte length and 1 byte of the fixed byte length. The 2 bytes of the preset byte length are 2 character units.
[0051] In this implementation manner, the sequence number of the text signal message can be the sequence number of the text signal message in the plurality of text signal messages corresponding to the text information.
[0052] In this implementation manner, the signal attributes of the text signal message can include a character category value and the number of messages. For example, a character category value of 0 can indicate that the character represents a country, and a character category value of 1 can indicate that the character represents a province or city.
[0053] In a specific implementation process of this implementation manner, based on the text information, the preset byte length, and the length of the fixed bytes of the text signal message, the number of text signal messages corresponding to the text information, that is, the number of message strips corresponding to the text information, the sequence number of each text signal message, and the character category value corresponding to each character in the text information can be obtained.
[0054] Optionally, in a possible implementation manner of this embodiment, the characters in the text information include at least one of Chinese characters, letters, and numbers.
[0055] In a specific implementation process of this implementation manner, one Chinese character can correspond to a preset byte length, that is, 3 bytes. One Chinese character can be used as one character unit. Letters and padding characters can correspond to a preset byte length. Numbers and padding characters can correspond to a preset byte length.
[0056] Here, a text signal message can include 8 bytes. When the preset byte length is 3 bytes, a text signal message can include 2 text units.
[0057] Exemplarily, if the vehicle information to be transmitted is navigation address information, 1 Chinese character in the navigation address information corresponds to 1 text unit, 1 letter corresponds to 1 text unit, and 1 digit corresponds to 1 text unit. Thus, it is possible to directly transmit the navigation address information to the data collector through the CAN bus.
[0058] It can be understood that a text signal message can include 2 Chinese characters, 2 letters, 2 digits, 1 Chinese character and 1 letter, 1 Chinese character and digit, 1 letter and 1 digit.
[0059] Optionally, in a possible implementation manner of this embodiment, the preset text encoding rule includes one of the UTF-8 encoding rule and the custom encoding rule.
[0060] In this implementation manner, the custom encoding rule is the rule of custom text encoding. [[ID=I3]]
[0061] Optionally, in a possible implementation manner of this embodiment, after step 104, the data collector can locally store the text information corresponding to the text signal message and upload the text information corresponding to the text signal message to the cloud.
[0062] Optionally, in a possible implementation manner of this embodiment, after step 102, in response to the vehicle information not being text information, use the preset data transmission protocol to transmit the vehicle information to the bus, so as to transmit the text signal message to the data collector through the bus.
[0063] In this implementation manner, here, when the vehicle information is not text information, the vehicle information can be physical value information.
[0064] In a specific implementation process of this implementation manner, use the preset data transmission protocol to convert the vehicle information into a physical value message, and then the physical value message can be transmitted to the bus.
[0065] It should be noted that the specific implementation process provided in this implementation manner can be combined with the multiple specific implementation processes provided in the foregoing implementation manner to implement the data transmission method of this embodiment. For detailed description, reference can be made to the relevant content in the foregoing implementation manner, which will not be elaborated here.
[0066] Figure 2 Shows the structural block diagram of a data transmission device provided by an embodiment of the present application, as Figure 2As shown in the figure. The data transmission device 200 in this embodiment can be applied to the electronic control unit of a vehicle and may include an acquisition unit 201, a determination unit 202, an obtaining unit 203, and a transmission unit 204. Among them, the acquisition unit 201 is used to acquire vehicle information to be processed; the vehicle information includes identification information; the determination unit 202 is used to determine whether the vehicle information is text information based on the identification information; the obtaining unit 203 is used to, in response to the vehicle information being text information, perform conversion processing on the text information by using a preset text encoding rule to obtain a text signal message corresponding to the text information, where the text signal message includes at least one character unit, and each character unit occupies a preset byte length; the transmission unit 204 is used to transmit the text signal message to a bus, so as to transmit the text signal message to a data collector through the bus.
[0067] Optionally, in a possible implementation manner of this embodiment, the obtaining unit 203 is used to obtain the sequence numbers and signal attributes of multiple text signal messages corresponding to the text information based on the text information, the preset byte length, and the length of the fixed bytes of the text signal message; for each text signal message, determine the encoding information corresponding to the fixed bytes of each text signal message based on the sequence number and signal attribute of the text signal message, perform conversion processing on the characters in the text information according to the preset byte length to obtain at least one character unit of each text signal message; and obtain the text signal message corresponding to the text information based on the encoding information corresponding to the fixed bytes of each text signal message and at least one character unit of each text signal message.
[0068] Optionally, in a possible implementation manner of this embodiment, the obtaining unit 203 is used to perform conversion processing on the characters in the text information according to a preset byte length to obtain multiple character units; in response to determining that the byte length corresponding to the characters in the text information is less than the preset byte length, perform byte filling on the characters in the text information with a byte length less than the preset byte length, so that the byte length of the characters in the filled text information is equal to the preset byte length.
[0069] Optionally, in a possible implementation manner of this embodiment, the characters in the text information include at least one of Chinese characters, letters, and numbers.
[0070] Optionally, in a possible implementation manner of this embodiment, the preset text encoding rule includes one of the UTF-8 encoding rule and a custom encoding rule.
[0071] In this embodiment, an acquisition unit 201 can be used to acquire vehicle information to be processed; the vehicle information includes identification information; a determination unit 202 is used to determine whether the vehicle information is text information based on the identification information; an obtaining unit 203 is used to, in response to the vehicle information being text information, perform conversion processing on the text information by using a preset text encoding rule to obtain a text signal message corresponding to the text information, where the text signal message includes at least one text unit, and each text unit occupies a preset byte length, and a transmission unit transmits the text signal message to a bus, so as to transmit the text signal message to a data collector through the bus. Since the text information can be converted and processed by using the preset text encoding rule to obtain a text signal message that can be used for bus transmission, and the text information is transmitted to the data collector of the vehicle through the bus, the collection and storage of the text information can be realized, and the text information of Chinese characters, letters and numbers can be directly transmitted through the CAN bus to the data collector of the vehicle for the backup of the whole vehicle information and the application of other components, which can optimize the richness of the data transmission of the CAN bus.
[0072] In this embodiment, Figure 3 is a schematic architecture diagram of an application scenario of a data transmission method / device provided in another embodiment of the present application, as Figure 3 shown. This application scenario may include a CAN bus, an ECU, a data collector, and a cloud background.
[0073] In this embodiment, CAN1 and CAN2 are CAN buses, serving as networks for transmitting signal messages. The ECU is a controller in the vehicle and can be used to send CAN signal messages. The data collector can be used to receive the signal messages of each CAN bus and realize local storage and upload to the cloud background.
[0074] In this embodiment, first, the ECUs 1, 2, 3, 4, 5, and 6 in each network segment of the whole vehicle can obtain information such as Chinese characters, letters, and Arabic numerals in real time. When the ECU needs to transmit text information such as Chinese characters, letters, and Arabic numerals, the Chinese characters, letters, and Arabic numerals can be converted into signals of 3 bytes according to the UTF-8 protocol. Second, 8 bytes of valid data can be transmitted in each message. 3 bytes represent 1 Chinese character, letter, or Arabic numeral, that is, two valid characters can be sent in one message. The remaining two bytes in the message are used for fixed format definition. Such as the corresponding number values of each text signal information, and the number values can be used to distinguish the currently sent signal, the number of messages required to be sent corresponding to the current text signal information, heartbeat signals, etc. According to the above definition method, different text signal information can be integrated and defined as a message with a fixed format. Third, in the way of continuous frames, the bus messages converted from Chinese characters, letters, and Arabic numerals can be transmitted to the bus. After the current text signal information is sent, a specific data format message is sent as a sign that the information sending is completed. In this way, the integrity of the transmitted data can be guaranteed. Third, each network segment of the whole vehicle is connected to the data collector through the CAN bus, that is, the data collector can collect the data of each network segment. The data collector can locally store and upload to the cloud the information sent by each network segment of the whole vehicle.
[0075] Adopting the solution in this embodiment can solve the problem of transmitting Chinese characters, letters, and Arabic numerals on the CAN bus, and can locally store and upload the information for vehicle information backup and other applications.
[0076] It should be noted that for the foregoing embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0077] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0078] In the technical solution of this application, the collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved, such as the user's images and attribute data, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0079] In the embodiment of this application, an electronic device is further provided, and the electronic device may include the ECU of the vehicle.
[0080] In an embodiment of the present application, a readable storage medium and a computer program product are further provided.
[0081] According to an embodiment of the present application, further, a new energy commercial vehicle including the provided electronic device is provided. The new energy commercial vehicle may include a new energy commercial vehicle with manual control at L2 level or above. For example, the new energy commercial vehicle may include commercial vehicles, household vehicles, large vehicles, etc.
[0082] Those of ordinary skill in the art can understand that all or part of the steps to implement the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, an optical disc, or the like.
[0083] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added, or deleted. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present application can be achieved. This is not limited herein.
[0084] The above specific embodiments do not constitute a limitation on the protection scope of the present application. 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 principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for data transmission, characterized in that, An electronic control unit applied to a vehicle, the method comprising: Obtaining vehicle information to be processed, the vehicle information including identification information; Based on the identification information, determining whether the vehicle information is text information; In response to the vehicle information being text information, using a preset text encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information, the text signal message including at least one character unit, and each of the character units occupying a preset byte length; Transmitting the text signal message to a bus to transmit the text signal message to a data collector through the bus.
2. The method according to claim 1, characterized in that, The step of, in response to the vehicle information being text information, using a preset encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information, includes: Based on the text information, the preset byte length, and the length of the fixed bytes of the text signal message, obtaining the sequence numbers and signal attributes of multiple text signal messages corresponding to the text information; For each text signal message, based on the sequence number and signal attribute of the text signal message, determining the encoding information corresponding to the fixed bytes of each text signal message, and performing conversion processing on the characters in the text information according to the preset byte length to obtain at least one character unit of each text signal message; Based on the encoding information corresponding to the fixed bytes of each text signal message and at least one character unit of each text signal message, obtaining a text signal message corresponding to the text information.
3. The method according to claim 2, wherein The step of performing conversion processing on the characters in the text information according to the preset byte length to obtain at least one character unit of each text signal message includes: Performing conversion processing on the characters in the text information according to the preset byte length to obtain multiple character units; In response to determining that the byte length of the characters in the text information is less than the preset byte length, performing byte filling on the characters in the text information with a byte length less than the preset byte length so that the byte length of the characters in the filled text information is equal to the preset byte length.
4. The method according to claim 1, wherein The characters in the text information include at least one of Chinese characters, letters, and numbers.
5. The method according to claim 1, wherein The preset text encoding rule includes one of UTF-8 encoding rule and custom encoding rule.
6. A device for data transmission, characterized in that, An electronic control unit applied to a vehicle, the device comprising: An obtaining unit, configured to obtain vehicle information to be processed, the vehicle information including identification information; A determining unit, configured to determine whether the vehicle information is text information based on the identification information; An obtaining unit, configured to, in response to the vehicle information being text information, use a preset text encoding rule to perform conversion processing on the text information to obtain a text signal message corresponding to the text information, the text signal message including at least one character unit, and each of the character units occupying a preset byte length; A transmitting unit, configured to transmit the text signal message to a bus to transmit the text signal message to a data collector through the bus.
7. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-5.
8. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.
9. A computer program product, comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
10. A new energy commercial vehicle, comprising the electronic device according to claim 7.