Vehicle data transmission method and device, vehicle, equipment and medium
By creating text files in the designated directory of the vehicle computer host hard disk and delaying uploading of CAN bus data, the problems of data loss and errors during real-time transmission are solved, and the complete storage and accurate transmission of data are achieved.
Patent Information
- Application Number
- CN202510355490.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-29
AI Technical Summary
In the prior art, vehicle data is susceptible to interference during real-time transmission, resulting in data loss or data errors, making the stored data incomplete enough and the transmission accuracy is low.
Create text files in the specified directory of the vehicle's computer host hard disk according to the preset cycle, receive and store CAN bus data to form the target file, and then create search text in the next preset cycle and search for target files in the specified directory of the hard disk, and finally upload it to the data server for storage.
Through delayed uploading, interference during data transmission is reduced, ensuring that the CAN bus data is stored intact before uploading, and improving the accuracy and completeness of data transmission.
Smart Images

Figure CN120386767A_ABST
Abstract
Description
Background Art
[0002] In the wave of automotive intelligence, the accuracy and efficiency of vehicle data transmission have become increasingly crucial. Currently, vehicles mainly achieve data processing and storage through real-time transmission. However, during the real-time transmission process, data is prone to interference, resulting in data loss or data errors, making the stored data incomplete and the accuracy of data transmission relatively low. Summary of the Invention
[0003] To overcome the problem in the prior art that data is prone to interference during real-time transmission, leading to data loss or data errors, making the stored data incomplete and the accuracy of data transmission relatively low, this application provides a vehicle data transmission method, device, vehicle, equipment, and medium.
[0004] In a first aspect, to solve the above technical problem, this application provides a vehicle data transmission method, including:
[0005] Create a text file in a specified directory of the hard disk of the vehicle's computer host according to a preset period, with no time interval between adjacent preset periods;
[0006] Control the computer host to receive CAN bus data through the CAN interface within each preset period and store the CAN bus data in the corresponding text file to form a target file;
[0007] In the next preset period after the target file is formed, create a search text corresponding to the target file according to a preset rule;
[0008] Use the search text to search in the specified directory of the hard disk. When the target file is found, upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
[0009] In a second aspect, this application also provides a vehicle data transmission device, including:
[0010] A first creation module for creating a text file in a specified directory of the hard disk of the vehicle's computer host according to a preset period, with no time interval between adjacent preset periods;
[0011] A receiving module for controlling the computer host to receive CAN bus data through the CAN interface within each preset period and store the CAN bus data in the corresponding text file to form a target file;
[0012] A second creation module for creating a search text corresponding to the target file according to a preset rule in the next preset period after the target file is formed;
[0013] A search module, which is used to search in a specified directory of the hard disk using a search text. When a target file is found, the target file is uploaded to a data server for storage to complete the complete transmission of CAN bus data.
[0014] In a third aspect, the present application also provides a vehicle that applies the above-mentioned vehicle data transmission method. The vehicle includes:
[0015] A CAN interface card, which is used to receive CAN bus data;
[0016] A computer host, which is connected to the CAN interface card and is used to store and upload the CAN bus data received by the CAN interface card;
[0017] A router, which is connected to the computer host through a switch and is used to provide a network for the computer host.
[0018] In a fourth aspect, the present application also provides a computing device, including a memory, a processor, and a program stored on the memory and running on the processor. When the processor executes the program, it implements the steps of the above-mentioned vehicle data transmission method.
[0019] In a fifth aspect, the present application also provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a terminal device, the terminal device is caused to execute the steps of a vehicle data transmission method.
[0020] The beneficial effects of the present application are as follows: First, a text file is created in a specified directory of the hard disk of the computer host in the vehicle according to a preset period. The computer host is controlled to receive CAN bus data through the CAN interface in each preset period and store the CAN bus data into the corresponding text file to form a target file. Then, in the next preset period after the target file is formed, a search text corresponding to the target file is created according to a preset rule, and the search text is used to search in the specified directory of the hard disk. When the target file is found, the target file is uploaded to the data server for storage to complete the complete transmission of CAN bus data. In this way, by searching and uploading the target file created in the previous preset period with the search text created in the subsequent preset period, the delayed upload of CAN bus data can be achieved. And since it takes time for the CAN bus data to be completely stored, and the time for this complete storage is less than the duration of the preset period, this delayed upload method can ensure that the target file can store the complete CAN bus data before uploading, reducing the situation of data loss or data error caused by the interference of real-time transmission during the data transmission process, so as to improve the integrity of the CAN bus data finally stored in the data server, and thus improve the transmission accuracy of the CAN bus data. Description of the Drawings
[0021] Figure 1 Schematic flowchart of a vehicle data transmission method shown in an exemplary embodiment of the present application;
[0022] Figure 2 Schematic structural diagram of a vehicle data transmission device shown in an exemplary embodiment of the present application. Detailed implementation manners
[0023] The following embodiments are further explanations and supplements to the present application and do not constitute any limitation to the present application.
[0024] The currently mainly adopted data transmission methods for driverless vehicles mainly include V2X communication, LTE / 5G communication, Wi-Fi and vehicular ad hoc network (VANET), and low-power wide area network (LPWAN). V2X communication realizes real-time data exchange between vehicles and between vehicles and infrastructure through an on-board unit (OBU). Compared with DSRC, C-V2X technology provides wider coverage and more stable connections and is suitable for driverless applications. LTE and 5G provide support for long-distance, high-bandwidth, and low-latency data transmission. In particular, the advantages of 5G in terms of ultra-low latency and large-scale connection help to meet the requirements of real-time decision-making in autonomous driving. Wi-Fi and VANET technologies are suitable for short-range and low-power data exchange and are often used for communication between in-vehicle systems and short-range devices. LPWAN provides support in scenarios that require long-distance and low-frequency data transmission.
[0025] Although these methods perform well in their respective application scenarios, they also face challenges in terms of bandwidth, latency, network coverage, security, cost, etc., and cannot meet the data transmission requirements of driverless vehicles. In addition, driverless sightseeing vehicles used in low-speed park scenarios also have higher requirements for cost, lightweight, and maintainability.
[0026] To solve the above problems, embodiments of the present application provide a vehicle data transmission method, device, vehicle, equipment, and medium, and the following will elaborate on these embodiments in detail.
[0027] In the present disclosure, all actions for obtaining signals, information, or data are carried out on the basis of strictly following relevant data protection regulations and policies of the country where the location is located and with the authorization of the owner of the corresponding device.
[0028] The owner refers to an individual or entity that owns or controls the relevant device (which may be a device, system, or other tool that can collect data).
[0029] In the field of intelligent connected vehicles, the "owner" mainly includes:
[0030] (1) Automobile manufacturers: As developers of vehicle hardware and systems, they control the underlying vehicle hardware and software platforms and have the management and control rights over the data generated during vehicle operation, such as driving and fault data.
[0031] (2) Component suppliers: Provide key components for automobiles and have certain ownership of the data collected and processed by the components, which is used for product optimization and after-sales, such as the data generated by sensors and chips.
[0032] (3) Vehicle owners or users: The actual users of the vehicle, who have the right to decide on the usage method and scope of vehicle data, such as whether to share data such as driving trajectories and driving habits, and have the need and right to protect the privacy of their own relevant data.
[0033] (4) Service providers: Provide services such as software and data analysis, and have the right to use and manage the data obtained and processed within the framework of the agreement, but the ownership usually belongs to other entities.
[0034] A vehicle data transmission method provided by an embodiment of the present application can be specifically executed by a server. It should be noted that the server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms, and no limitation is made here.
[0035] Please refer to Figure 1 , Figure 1 which shows a vehicle data transmission method shown in an exemplary embodiment of the present application. As Figure 1 shown, the present application provides a vehicle data transmission method, including:
[0036] Step S11, create a text file in a specified directory of the hard disk of the vehicle's computer host according to a preset period, and there is no time interval between adjacent preset periods;
[0037] Step S12, control the computer host to receive CAN bus data through the CAN interface within each preset period and store the CAN bus data in the corresponding text file to form a target file;
[0038] Step S13, in the next preset period after the target file is formed, create a search text corresponding to the target file according to a preset rule;
[0039] Step S14, use the search text to search in the specified directory of the hard disk. When the target file is found, upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
[0040] A vehicle data transmission method according to an embodiment provided by this application first creates a text file in a specified directory of the hard disk of the vehicle's computer host according to a preset period, controls the computer host to receive CAN bus data through the CAN interface within each preset period, and stores the CAN bus data in the corresponding text file to form a target file. Then, in the next preset period after the target file is formed, a search text corresponding to the target file is created according to a preset rule, and the search text is used to search in the specified directory of the hard disk. When the target file is found, the target file is uploaded to the data server for storage to complete the complete transmission of the CAN bus data. In this way, by searching and uploading the target file created in the previous preset period with the search text created in the subsequent preset period, the delayed upload of the CAN bus data can be achieved. And since it takes time to store the CAN bus data completely, the time for complete storage is less than the cycle duration of the preset period. The time for completely storing 10 minutes of CAN bus data is generally several tens of seconds or more than one minute. This method of delayed upload can ensure that the target file stores complete CAN bus data before uploading, reducing the situation of data loss or data error caused by interference during real-time transmission in the data transmission process, so as to improve the integrity of the CAN bus data finally stored in the data server, and thus improve the transmission accuracy of the CAN bus data.
[0041] In an exemplary embodiment provided by this application, through experiments, it is measured that the cycle time of the preset period can be 10 minutes, a text file is created at the integer multiple minute moment every 10 minutes, and then every time it reaches an integer multiple minute moment of 10, the text file created in the current preset period is closed, and a text file for the next preset period is created to store the CAN bus data received in the next preset period.
[0042] Optionally, storing the CAN bus data in the corresponding text file to form a target file includes:
[0043] Pushing the CAN bus data into the buffer memory of the computer host according to a preset condition to obtain buffer data;
[0044] Reading the buffer data pushed out of the buffer memory according to the first-in, first-out order rule to obtain read data;
[0045] Writing the read data into the corresponding text file in the specified directory of the hard disk to form a target file.
[0046] In this embodiment provided by the present application, the CAN bus data is pushed into the buffer memory of the computer host according to preset conditions to obtain buffer data, and the buffer data pushed out of the buffer memory is read according to the first-in-first-out order rule to obtain read data, and then the read data is written into a corresponding text file in a specified directory of the hard disk to form a target file. In this way, during the process of storing the CAN bus data into the corresponding text file, the storage speed of the CAN bus data can be controlled through a buffer memory in the current preset cycle to reduce the difference between the data push speed and the data pop speed, so as to reduce the data frame loss phenomenon during the storage process of the CAN bus data in the current preset cycle, further improve the transmission integrity of the CAN bus data, and further improve the transmission accuracy of the CAN bus data.
[0047] Optionally, pushing the CAN bus data into the buffer memory of the computer host according to preset conditions to obtain buffer data includes:
[0048] Pushing the data frames of the CAN bus data into the buffer memory of the computer host in the form of a message data frame stack;
[0049] Obtaining the push speed, pop speed, and the number of data frames already pushed into the buffer memory;
[0050] When the push speed is greater than the pop speed and the number of data frames already pushed is greater than the set number, deleting the latest pushed data frame in the CAN bus data to obtain buffer data.
[0051] In this embodiment provided by the present application, pushing the data frames of the CAN bus data into the buffer memory of the computer host in the form of a message data frame stack can stabilize the transmission speed during the process of storing the CAN bus data into the text file, making the push speed of pushing data into the buffer memory and the pop speed of pushing the data in the buffer memory out consistent, reducing the situation of data loss during the process of storing the CAN bus data into the text file, and improving the integrity of the CAN bus data subsequently stored in the text file. At the same time, since the storage space of the buffer memory is limited and there is a maximum set number, each time a data frame is pushed into the buffer memory, it is necessary to judge the number of data frames already pushed into the buffer memory. When the push speed of the buffer memory is greater than the pop speed and the number of data frames already pushed is greater than the set number, it means that the stack in the buffer memory is full. At this time, deleting the latest pushed data frame in the CAN bus data to obtain buffer data can reduce the situation of the transmission speed reduction caused by data blockage during the process of storing the CAN bus data into the text file, so as to improve the storage efficiency of subsequently storing the buffer data into the text file, and further improve the transmission efficiency of the CAN bus data.
[0052] Optionally, within the next preset period after the target file is formed, a search text corresponding to the target file is created according to a preset rule, including:
[0053] Within the next preset period after the target file is formed, obtain the file name format of the target file;
[0054] Create a search text according to the preset creation period and the file name format, so that the format of the search text is the same as the file name format of the target file; wherein, the period duration of the preset creation period is less than the period duration of the preset period.
[0055] In this embodiment provided by the present application, within the next preset period after the target file is formed, a search text with the same format as the file name format of the target file is created according to the preset creation period and the file name format of the target file, and the period duration of the preset creation period is less than the period duration of the preset period, so that multiple search texts can be sequentially created within the next preset period, increasing the number of search texts, so that there is a search text with the same file name as the target file among the multiple search texts, ensuring that the target file created in the previous preset period can be searched based on the search text created in the next preset period, enabling each target file to be delayed searched and uploaded, reducing the situation where CAN bus data is not uploaded due to missed search when searching for the target file, thereby further improving the transmission accuracy of CAN bus data. Among them, the file name format consists of a vehicle number, a file creation date, and a specific time, and the period duration of the preset creation period can be 1 minute.
[0056] In an exemplary embodiment provided by the present application, the search text created according to the preset creation period and the file name format includes a vehicle number, a file creation date, and a specific time, and the specific time of the search text is the corresponding time within the preset period at the creation moment. For example, the period duration of the preset creation period is 1 minute, the period duration of the preset period is 10 minutes, the previous preset period is from 10:00 to 10:09:59, the creation moment of the search text is 10:15, then the next preset period is from 10:10 to 10:19:59, and the specific time of the search text is 10:05, so as to enable the CAN bus data of the previous preset period to be continuously stored in the next preset period. The time for completely storing 10 minutes of CAN bus data is generally dozens of seconds or more than one minute, so that the CAN bus data stored in the previous preset period is delayed uploaded after the target file storing the complete CAN bus data is stored completely in the next preset period, so as to separate the local storage and upload processes of the CAN bus data, improving the integrity and reliability of the CAN bus data in the target file and the transmission accuracy of the CAN bus data.
[0057] Optionally, search in the specified directory of the hard disk using the search text. When the target file is found, upload the target file to the data server for storage to complete the complete transmission of CAN bus data, including:
[0058] Obtain the file names of the stored files in the specified directory of the hard disk;
[0059] Match the search text in each file name to obtain the matching result;
[0060] When the matching result is that a file name identical to the search text is matched, use the matched file name as the target file name;
[0061] Use the stored file corresponding to the target file name as the searched target file, compress the target file, and upload it to the data server for storage to complete the complete transmission of CAN bus data.
[0062] In this embodiment provided by the present application, use the search text constructed in the next preset period to globally search the file names of all stored files in the specified directory of the hard disk to avoid missing searches. And only when a file name identical to the search text is found, it indicates that there is a target file constructed in the previous preset period in the specified directory of the hard disk. Then, use the stored file corresponding to the searched file name as the target file, compress it, and upload it to the data server for storage to complete the delayed transmission of the target file and realize the complete transmission of CAN bus data, thereby improving the transmission accuracy of CAN bus data. At the same time, compress the target file, compress the target file into a zip file with the same name, which can reduce the file size of the target file to one-tenth of the original, and upload the compressed zip file to the specified directory of the data server through the http method for storage, which can improve the reliability and security of data transmission.
[0063] In an exemplary embodiment provided by the present application, when compressing the target file, the original target file is not deleted, and the target file is backed up. In this way, even if the target file is interrupted during compression and upload, resulting in an incomplete target file, it is possible to trace the backed-up target file later to realize the complete reproduction of the CAN bus data in the target file. In addition, the specified directory of the data server is fixed in the data upload client program and can only be changed through program updates.
[0064] Optionally, the method further includes:
[0065] Create an intermediate text file in the specified directory of the hard disk when the computer host is powered on;
[0066] The control computer host receives the intermediate CAN bus data through the CAN interface and stores the intermediate CAN bus data in an intermediate text file to form an intermediate target file;
[0067] In the first preset cycle after the computer host is powered on, an intermediate search text corresponding to the intermediate target file is created according to a preset rule;
[0068] Use the intermediate search text to search in the specified directory of the hard disk. When the intermediate target file is found, upload the intermediate target file to the data server for storage to complete the complete transmission of the intermediate CAN bus data.
[0069] In this embodiment provided by the present application, when the computer host is powered on, a data delay transmission of the CAN bus data is also performed to record the network situation when the vehicle is powered on, which is convenient for subsequent tracing of the network situation when the vehicle is powered on, and improves the timeliness and effectiveness of the CAN bus data transmission. Compared with the traditional method, the method of the present application has lower cost, easier access to equipment, lower deployment difficulty, lower maintenance difficulty, and lower operation complexity, which is convenient for the popularization in the application scenario of low-speed unmanned vehicles.
[0070] In an exemplary embodiment provided by the present application, the CAN bus data is continuously generated after the vehicle is powered on and complies with the CAN bus protocol. Through the CAN interface, the vehicle CAN bus is connected to the computer host of the vehicle, and a CAN interface card driver program and a data upload client program are installed on the computer host. The CAN interface card driver program is run to control the computer host to receive the CAN bus data through the CAN interface. The data upload client program is set to start automatically when the computer is turned on. After the computer host is restarted, the data upload client starts automatically, and the data upload client program stops running when the computer host is shut down. The specified directory of the hard disk is used to store data files, and the location of the specified directory of the hard disk is fixed by the data upload client program and can only be changed through program update.
[0071] Please refer to Figure 2 , Figure 2 which shows a vehicle data transmission device according to an exemplary embodiment of the present application. As Figure 2 shown, the present application provides a vehicle data transmission device 200, including:
[0072] A first creation module 201, configured to create a text file in the specified directory of the hard disk of the computer host of the vehicle according to a preset cycle, and there is no time interval between two adjacent preset cycles;
[0073] A receiving module 202, configured to control the computer host to receive the CAN bus data through the CAN interface in each preset cycle and store the CAN bus data in the corresponding text file to form a target file;
[0074] A second creation module 203, configured to create a search text corresponding to the target file according to a preset rule in the next preset period after the target file is formed;
[0075] A search module 204, configured to search in a specified directory of the hard disk by using the search text, and when the target file is found, upload the target file to a data server for storage to complete the complete transmission of CAN bus data.
[0076] A vehicle data transmission device 200 according to the embodiment provided by the present application uses a first creation module 201 to first create a text file in a specified directory of the hard disk of the vehicle's computer host according to a preset period, and uses a receiving module 202 to control the computer host to receive CAN bus data through a CAN interface in each preset period, and store the CAN bus data into a corresponding text file to form a target file. Then, a second creation module 203 is used to create a search text corresponding to the target file according to a preset rule in the next preset period after the target file is formed, and a search module 204 is used to search in a specified directory of the hard disk by using the search text, and when the target file is found, the target file is uploaded to a data server for storage to complete the complete transmission of CAN bus data. In this way, by searching and uploading the target file created in the previous preset period with the search text created in the next preset period, the delayed upload of CAN bus data can be realized. And since it takes time for the CAN bus data to be stored completely, and the time for this complete storage is less than the duration of the preset period, this method of delayed upload can ensure that the target file can store the complete CAN bus data before uploading, reducing the situation of data loss or data error caused by the interference of real-time transmission during the data transmission process, so as to improve the integrity of the CAN bus data finally stored in the data server, thereby improving the transmission accuracy of the CAN bus data.
[0077] Optionally, the receiving module 202 is specifically configured to:
[0078] Push the CAN bus data into the buffer memory of the computer host according to a preset condition to obtain buffer data;
[0079] Read the buffer data pushed out of the buffer memory according to the first-in-first-out order rule to obtain read data;
[0080] Write the read data into a corresponding text file in the specified directory of the hard disk to form a target file.
[0081] Optionally, the receiving module 202 is specifically configured to:
[0082] Push the data frame of the CAN bus data into the buffer memory of the computer host in the form of a message data frame stack;
[0083] Obtain the push speed, pop speed of the buffer memory, and the number of pushed data frames;
[0084] When the push speed is greater than the pop speed and the number of pushed data frames is greater than the set number, delete the latest pushed data frame in the CAN bus data to obtain the buffered data.
[0085] Optionally, the second creation module 203 is specifically configured to:
[0086] Obtain the file name format of the target file in the next preset cycle after the target file is formed;
[0087] Create a search text according to the preset creation cycle and the file name format, so that the format of the search text is the same as the file name format of the target file; wherein, the cycle duration of the preset creation cycle is less than the cycle duration of the preset cycle.
[0088] Optionally, the search module 204 is specifically configured to:
[0089] Obtain the file names of the stored files in the specified directory of the hard disk;
[0090] Match the search text in each file name to obtain a matching result;
[0091] When the matching result is that a file name identical to the search text is matched, use the matched file name as the target file name;
[0092] Use the stored file corresponding to the target file name as the searched target file, and compress and upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
[0093] Optionally, the device 200 further includes an intermediate data transmission module 205, and the intermediate data transmission module 205 is specifically configured to:
[0094] Create an intermediate text file in the specified directory of the hard disk when the computer host is powered on;
[0095] Control the computer host to receive intermediate CAN bus data through the CAN interface, and store the intermediate CAN bus data in the intermediate text file to form an intermediate target file;
[0096] Create an intermediate search text corresponding to the intermediate target file according to the preset rule in the first preset cycle after the computer host is powered on;
[0097] Search in the specified directory of the hard disk using the intermediate search text, and when the intermediate target file is found, upload the intermediate target file to the data server for storage to complete the complete transmission of the intermediate CAN bus data.
[0098] It should be noted that the vehicle data transmission device provided in the above embodiments and the vehicle data transmission method provided in the above embodiments belong to the same concept. The specific ways in which each module and unit perform operations have been described in detail in the method embodiments, and will not be elaborated here. In practical applications, the vehicle data transmission device provided in the above embodiments can, as needed, allocate the above functions to different functional modules, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above. This will not be limited here either.
[0099] A vehicle according to an embodiment of the present application applies the above vehicle data transmission method. The vehicle includes:
[0100] A CAN interface card for receiving CAN bus data;
[0101] A computer mainframe connected to the CAN interface card for storing and uploading the CAN bus data received by the CAN interface card;
[0102] A router connected to the computer mainframe through a switch for providing a network for the computer mainframe.
[0103] A computing device according to an embodiment of the present application includes a memory, a processor, and a program stored on the memory and running on the processor. When the processor executes the program, it implements some or all of the steps of the above vehicle data transmission method.
[0104] Among them, the computing device can be a computer. Correspondingly, its program is computer software. And the above parameters and steps in a computing device of the present application can refer to the parameters and steps in the embodiments of the above vehicle data transmission method, and will not be elaborated here.
[0105] A computer-readable storage medium according to an embodiment of the present application stores instructions that, when running, execute the steps of the above vehicle data transmission method.
[0106] Among them, the computer-readable storage medium can be a transient computer-readable storage medium or a non-transient computer-readable storage medium.
[0107] The technical solution of the embodiments of the present disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of the embodiments of the present disclosure. The aforementioned computer-readable storage medium may be a non-transitory computer-readable storage medium, including: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes, or it may also be a transitory computer-readable storage medium.
[0108] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of apparatuses, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0109] Those skilled in the art of the relevant technology know that the present application can be implemented as a system, a method, or a computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be completely hardware, can also be completely software (including firmware, resident software, microcode, etc.), or can also be in the form of a combination of hardware and software, which is generally referred to as a "module" or "device" in this article. In addition, in some embodiments, the present application can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable media contains computer-readable program codes. The computer-readable storage medium can be, for example, but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above.
[0110] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0111] Although the embodiments of this application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting this application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A vehicle data transmission method, characterized in that: Including: Create a text file in the specified directory of the hard disk of the vehicle's computer host according to a preset period, and there is no time interval between two adjacent preset periods; Control the computer host to receive CAN bus data through the CAN interface within each preset period, and store the CAN bus data into the corresponding text file to form a target file; In the next preset period after forming the target file, create a search text corresponding to the target file according to a preset rule; Use the search text to search in the specified directory of the hard disk. When the target file is found, upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
2. The method according to claim 1, characterized in that The storing the CAN bus data into the corresponding text file to form a target file includes: Push the CAN bus data into the buffer memory of the computer host according to a preset condition to obtain buffer data; Read the buffer data pushed out of the buffer memory according to the first-in-first-out order rule to obtain read data; Write the read data into the corresponding text file in the specified directory of the hard disk to form a target file.
3. The method according to claim 2, wherein The pushing the CAN bus data into the buffer memory of the computer host according to a preset condition to obtain buffer data includes: Push the data frame of the CAN bus data into the buffer memory of the computer host in the form of a message data frame stack; Obtain the pushing speed, popping speed and the number of data frames already pushed into the buffer memory; When the pushing speed is greater than the popping speed and the number of data frames already pushed is greater than a set number, delete the latest pushed data frame in the CAN bus data to obtain buffer data.
4. The method according to claim 1, wherein The creating a search text corresponding to the target file according to a preset rule in the next preset period after forming the target file includes: In the next preset period after forming the target file, obtain the file name format of the target file; Create a search text according to a preset creation period and the file name format, so that the format of the search text is the same as the file name format of the target file; wherein, the period duration of the preset creation period is less than the period duration of the preset period.
5. The method according to claim 1, characterized in that, The using the search text to search in the specified directory of the hard disk and uploading the target file to the data server for storage when the target file is found to complete the complete transmission of the CAN bus data includes: Obtain the file name of the stored file in the specified directory of the hard disk; Use the search text to match in each file name to obtain a matching result; When the matching result is that a file name identical to the search text is matched, use the matched file name as the target file name; Use the stored file corresponding to the target file name as the found target file, and compress and upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
6. The method according to any one of claims 1 to 5, characterized in that The method further includes: When the computer host is powered on, create an intermediate text file in the specified directory of the hard disk; Control the computer host to receive intermediate CAN bus data through the CAN interface, and store the intermediate CAN bus data into the intermediate text file to form an intermediate target file; Create an intermediate search text corresponding to the intermediate target file according to the preset rule within the first preset period after the computer host is powered on; Use the intermediate search text to search in the specified directory of the hard disk. When the intermediate target file is found, upload the intermediate target file to the data server for storage to complete the complete transmission of the intermediate CAN bus data.
7. A vehicle data transmission device, characterized in that: It includes: A first creation module, configured to create a text file in the specified directory of the hard disk of the computer host of the vehicle according to a preset period, and there is no time interval between two adjacent preset periods; A receiving module, configured to control the computer host to receive CAN bus data through the CAN interface within each preset period, and store the CAN bus data into the corresponding text file to form a target file; A second creation module, configured to create a search text corresponding to the target file according to a preset rule in the next preset period after the target file is formed; A search module, configured to use the search text to search in the specified directory of the hard disk. When the target file is found, upload the target file to the data server for storage to complete the complete transmission of the CAN bus data.
8. A vehicle, characterized in that, Apply the vehicle data transmission method according to any one of claims 1 to 6, wherein the vehicle includes: A CAN interface card, configured to receive CAN bus data; A computer host, connected to the CAN interface card, configured to store and upload the CAN bus data received by the CAN interface card; A router, connected to the computer host through a switch, configured to provide a network for the computer host.
9. A computing device comprising a memory, a processor, and a program stored in the memory and running on the processor, characterized in that: When the processor executes the program, it implements the steps of the vehicle data transmission method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium. When the instructions are run on the terminal device, the terminal device is caused to execute the steps of the vehicle data transmission method according to any one of claims 1 to 6.