A vehicle-mounted data processing method, device and computer program product
By integrating temporary data into a pre-defined storage format file template and writing it to disk in batches, the problem of data loss when the vehicle is powered off is solved, improving the efficiency of data writing to disk and system stability, and ensuring the normal operation of the vehicle system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING CO WHEELS TECH CO LTD
- Filing Date
- 2025-01-17
- Publication Date
- 2026-07-21
AI Technical Summary
When the vehicle is powered off, temporary data cannot be uploaded to the cloud in a timely and complete manner, resulting in data loss. Furthermore, frequent data write operations significantly impact the disk I/O usage of the operating system, affecting its normal operation and compromising the integrity of temporary data and the normal operation of the operating system.
Temporary data is integrated using a preset storage format file template and written to permanent storage media in batches, reducing disk I/O frequency and ensuring data integrity.
This reduces the possibility of data loss during power-down, improves data write-to-disk efficiency, reduces disk I/O usage, and ensures the normal operation of the vehicle system.
Smart Images

Figure CN122431589A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to an in-vehicle data processing method, apparatus and computer program product. Background Technology
[0002] During vehicle operation, a significant amount of temporary data is generated, such as sensor data, navigation and map data, multimedia cache data, system adaptive adjustment values, and personalized settings data. This temporary data is typically stored in temporary storage media within the vehicle's system, such as memory, cache, random access memory, and registers. Upon meeting pre-defined upload conditions, the vehicle system uploads the stored temporary data to the cloud. However, because temporary storage media lack the ability to permanently retain temporary data, any incomplete temporary data uploaded when the vehicle is powered off will be deleted from the temporary storage media. This means that even after restarting the vehicle, the cloud cannot retrieve the missing temporary data. Therefore, to prevent incomplete uploads of temporary data when the vehicle is powered off, the vehicle system, upon receiving a power-off notification, proactively writes the temporarily stored data from the temporary storage media to a permanent storage medium capable of persistently storing temporary data. This ensures that the temporary data is not deleted after power-off and facilitates subsequent re-uploading of complete data.
[0003] Because the amount of temporary data is large, in order to ensure that the temporary data is stored in a timely manner, data needs to be written to the permanent storage medium frequently during the power-down process. These operations consume a lot of disk I / O on the permanent storage medium, which in turn affects the normal operation of the operating system. As a result, before the power-down ends, some of the temporary data still fails to be written to the permanent storage medium, affecting the integrity of the temporary data.
[0004] Therefore, how to store temporary data in a timely and complete manner has become an urgent problem to be solved. Summary of the Invention
[0005] In view of the above problems, this application provides an in-vehicle data processing method, apparatus, and computer program product to achieve timely and complete storage of temporary data. The specific solution is as follows:
[0006] The first aspect of this application provides an in-vehicle data processing method, applied to an in-vehicle system, the in-vehicle data processing method comprising:
[0007] Collect temporary data to be stored;
[0008] Determine the preset storage format file template;
[0009] The temporary data to be stored is stored in a temporary storage medium according to the preset storage format file template to obtain a preset storage format file;
[0010] If the preset storage format file meets the preset disk storage conditions and no vehicle power-off signal is received, the preset storage format file is written to the permanent storage medium of the vehicle system, and the amount of data in the preset storage format file reaches a preset threshold.
[0011] Upon receiving the vehicle power-off signal, the preset storage format file stored on the temporary storage medium is copied to the permanent storage medium of the vehicle system.
[0012] One possible implementation also includes:
[0013] If the preset storage format file does not meet the preset disk storage conditions and no power-off signal is received from the vehicle, the step of collecting temporary data to be stored is performed, and the temporary data is stored in the preset storage format file in the temporary storage medium until the preset storage format file meets the preset disk storage conditions.
[0014] In one possible implementation, determining the preset storage format file template includes:
[0015] Determine whether the permanent storage medium contains a file in a preset storage format;
[0016] If the permanent storage medium stores the preset storage format file, then the latest stored preset storage format file is determined based on the disk write time of each preset storage format file; a preset storage format file template is generated based on the latest stored preset storage format file.
[0017] If the preset storage format file is not stored in the permanent storage medium, a preset storage format file template is created based on the temporary data to be stored.
[0018] One possible implementation also includes:
[0019] Determine whether the number of the preset storage format files stored in the permanent storage medium reaches the preset number of files;
[0020] If the number of the preset storage format files stored in the permanent storage medium reaches the preset number of files, then all the preset storage format files stored in the permanent storage medium are merged to obtain the target summary file;
[0021] Compress the target summary file to obtain the target upload file;
[0022] Send the target file to the cloud.
[0023] In one possible implementation, merging all the preset storage format files stored in the permanent storage medium to obtain the target summary file includes:
[0024] Based on the disk write time of each of the preset storage format files in the permanent storage medium, determine the latest stored preset storage format file;
[0025] Based on the latest stored preset storage format file, create an initial summary file template;
[0026] Read the temporary data stored in all the preset storage format files in the permanent storage medium, and write the temporary data into the initial summary file template to obtain the target summary file.
[0027] In one possible implementation, after sending the target file to the cloud, the method further includes:
[0028] Delete all the preset storage format files stored on the permanent storage medium.
[0029] In one possible implementation, the preset storage format file is a columnar storage file.
[0030] One possible implementation also includes:
[0031] The temporary data stored in the preset storage format file in the permanent storage medium is analyzed and processed to obtain data analysis results;
[0032] The data analysis results are sent to the cloud.
[0033] A second aspect of this application provides an in-vehicle data processing device for use in an in-vehicle system, the in-vehicle data processing device comprising:
[0034] The data acquisition unit is used to collect temporary data to be stored.
[0035] The template determination unit is used to determine the preset storage format file template;
[0036] A data storage unit is used to store the temporary data to be stored into a temporary storage medium according to the preset storage format file template, thereby obtaining a preset storage format file;
[0037] The first data storage unit is used to store the preset storage format file on the permanent storage medium of the vehicle system when the preset storage format file meets the preset storage conditions and no vehicle power-off signal is received. The amount of data in the preset storage format file reaches a preset threshold.
[0038] The second data write-to-disk unit is used to write the preset storage format file stored in the temporary storage medium to the permanent storage medium of the vehicle system when the vehicle power-off signal is received.
[0039] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the vehicle data processing method of the first aspect or any implementation thereof.
[0040] By employing the above technical solution, the vehicle data processing method, apparatus, and computer program product provided in this application, before receiving the vehicle power-down signal, integrates and stores temporary data using a preset storage format file template. When the data volume in the preset storage format file reaches a preset threshold, the preset amount of temporary data is written to the permanent storage medium all at once in the form of a preset storage format file. Compared to the prior art that writes all temporary data to the disk in a concentrated manner during power-down, this application writes temporary data to the disk in batches before power-down, reducing the pressure of data writing to the disk during power-down. Even if the writing to the disk fails during power-down, it minimizes the amount of data lost. Furthermore, by integrating and storing temporary data in the form of a preset storage format file, this application reduces the frequency of writing temporary data to the permanent storage medium after receiving the power-down signal, thereby reducing the occupation of disk I / O, allowing the vehicle system to maintain normal operation, thus reducing the possibility of writing to the disk failing during power-down, and ensuring that temporary data can be stored in a timely and complete manner. Attached Figure Description
[0041] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0042] Figure 1 A flowchart illustrating the implementation of the vehicle data processing method provided in this application;
[0043] Figure 2 Another flowchart illustrating the implementation of the vehicle data processing method provided in this application;
[0044] Figure 3 This application provides a system architecture diagram for implementing an on-board data processing method;
[0045] Figure 4 This is a schematic diagram of the structure of an on-board data processing device provided in this application. Detailed Implementation
[0046] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0047] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0048] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0049] During vehicle operation, a large amount of data is generated. However, some of this data is highly time-sensitive and only valid during the driving process. Examples include real-time monitoring data such as speed, acceleration, and location; sensor data; and navigation and map data. Once the vehicle stops or the data is collected, it loses its real-time nature and therefore only needs temporary storage. This temporary data is typically stored in temporary storage media within the vehicle's onboard system, such as memory or cache. This data is cleared after the vehicle is powered off or periodically. The onboard system, which resides on the vehicle's processor or operating system, is a program used to manage the vehicle's computer hardware and software resources.
[0050] Understandably, during vehicle development and testing, engineers need all the vehicle's test data to perform functional analysis and upgrades. Therefore, the in-vehicle system responds to data retrieval requests from the cloud or sends the requested temporary data to the cloud when the temporary data in the temporary storage medium meets the upload requirements. However, because vehicles under test are prone to abnormal power outages, the temporary data in the temporary storage medium can be erased, preventing the cloud from obtaining complete temporary data. Therefore, the in-vehicle system also writes the temporary data from the temporary storage medium to permanent storage media, such as disks, hard drives, and flash memory, to ensure long-term storage. However, during the disk writing process, the temporary data is scattered and frequently written to the file system disk (i.e., to permanent storage media), resulting in significant disk I / O usage. This affects the normal operation of the operating system, reducing the efficiency of temporary data writing and causing data loss. It also affects the storage of data normally stored in permanent storage media, leading to further data loss.
[0051] To address the aforementioned problems, this application provides an in-vehicle data processing method applied to an in-vehicle system, as described above. Figure 1 The flowchart of the vehicle data processing method provided in this application illustrates the implementation process of the vehicle data processing method, and the specific steps include:
[0052] Step S110: Collect temporary data to be stored.
[0053] From the moment a vehicle is powered on or started, it continuously generates temporary data, such as audio and video data collected by vehicle monitoring equipment, data collected by sensors, and vehicle adaptive adjustment parameters. The onboard system can passively receive temporary data sent by software programs and hardware devices to temporary storage media, thereby achieving data collection. Alternatively, the onboard system can actively access software programs or hardware devices to collect temporary data.
[0054] Step S120: Determine the preset storage format file template.
[0055] Step S130: Store the temporary data to be stored in the temporary storage medium according to the preset storage format file template to obtain the preset storage format file.
[0056] In this embodiment, the preset storage format file template serves as a framework for organizing and describing temporary data, defining the structure, data types, indexes, layout, and relationships of the temporary data stored in the temporary storage medium. Storing temporary data according to the preset storage format file template ensures the standardization, consistency, and integrity of the temporary data storage through the relationships and constraints defined by the template, facilitating subsequent management and operation. Furthermore, it integrates scattered temporary data, reducing the write frequency when writing temporary data to disk. For example, if a preset storage format file stores 10 pieces of temporary data, only one write operation is needed to write the file to the permanent storage medium when writing it to disk. However, according to existing technology, 10 write operations are required to write each piece to the permanent storage medium, occupying permanent storage medium I / O for an extended period, affecting the writing and reading of other data, and potentially impacting the normal operation of the operating system due to frequent operations. Therefore, using a preset storage format file to store temporary data not only improves the efficiency of data writing to disk but also enhances the stability and operational efficiency of the operating system.
[0057] The preset storage format file template can be set according to the relationships, data types, and storage requirements of the temporary data collected by the vehicle system. Alternatively, a preset storage format file of historical temporary data can be used as the preset storage format file template, which can improve storage efficiency while ensuring data consistency. Temporary data is stored in the temporary storage medium according to the preset storage format file, resulting in the preset storage format file.
[0058] In this embodiment, the preset storage format file can be an ORC file, which is a columnar storage format file used to store large-scale data. Therefore, the vehicle system introduces a columnar storage component for data storage, using columnar storage in the temporary storage medium to store temporary data. This improves the query performance of the temporary storage medium and compresses the temporary data as much as possible within the ORC file, reducing storage space consumption.
[0059] Step S140: Determine whether a vehicle power-off signal has been received. If not, proceed to step S150; if yes, proceed to step S160.
[0060] Step S150: Determine whether the preset storage format file meets the preset disk storage conditions. If it does, proceed to step S160; otherwise, return to step S110.
[0061] Step S160: The preset storage format file stored on the temporary storage medium is copied to the permanent storage medium of the vehicle system.
[0062] The preset disk storage condition is that the amount of data in the preset storage format file reaches a preset threshold.
[0063] This application embodiment divides the temporary data on the disk into two situations: one is when no vehicle power-off signal is received, and the other is when a vehicle power-off signal is received. The temporary data and the preset storage format file are stored according to the different situations.
[0064] For the first scenario where no vehicle power-off signal is received, temporary data is collected and stored in a preset storage format file template. This process continues until the data volume in the preset storage format file reaches the preset disk write condition. Then, the preset storage format file is written to permanent storage media, achieving long-term preservation of the temporary data. It is understandable that if the data volume in the preset storage format file does not reach the preset threshold, the process returns to step S110 to collect other temporary data to be stored. However, there is no need to determine a new preset storage format file template for storage. Instead, the other temporary data to be stored is stored in a preset storage format file in the current temporary storage media that does not meet the preset disk write condition. This continues until the data volume in the preset storage format file reaches the preset threshold, at which point the disk write operation is performed, avoiding multiple attempts to create a new file without meeting the disk write condition.
[0065] In the second scenario where a vehicle power-off signal is received, regardless of whether the amount of data in the preset storage format file meets the preset disk write conditions, the preset storage format file in the temporary storage medium will be written to the permanent storage medium.
[0066] Specifically, the vehicle power-down signal detection or judgment program can be a program running in parallel with the temporary data storage and disk writing program. This program continuously monitors whether the vehicle's infotainment system is issuing a power-down signal or detects the possibility of an abnormal power-down. Once a power-down signal is received or a potential abnormal power-down is detected, it interacts with the temporary data storage and disk writing program, using the detection result as a trigger signal to initiate step S160, promptly storing the existing temporary data. If the data storage and disk writing program does not receive a trigger signal, it writes the temporary data to permanent storage media in batches according to a preset storage format file before the vehicle power-down, reducing the amount of temporary data waiting to be written when the vehicle power-down occurs. This reduces the pressure on data writing and minimizes the amount of data lost due to abnormal power-down.
[0067] In summary, the vehicle data processing method provided in this application integrates and stores temporary data using a preset storage format file template before receiving a vehicle power-down signal. When the data volume in the preset storage format file reaches a preset threshold, the preset amount of temporary data is written to the permanent storage medium in the form of a preset storage format file all at once. Compared to the prior art, which writes all temporary data to the disk in a concentrated manner during power-down, this application writes temporary data to the disk in batches before power-down, reducing the pressure of data writing to the disk during power-down. Even if the writing to the disk fails during power-down, the amount of data lost is minimized. Furthermore, by integrating and storing temporary data in the form of a preset storage format file, this application reduces the frequency of writing temporary data to the permanent storage medium after receiving a power-down signal, thereby reducing the occupation of disk I / O and allowing the vehicle system to maintain normal operation. This reduces the possibility of writing to the disk failing during power-down, ensuring that temporary data can be stored in a timely and complete manner.
[0068] Next, with reference to the embodiments below, other possible implementations of the above-described vehicle data processing method will be described.
[0069] In one possible implementation, step S120, determining the preset storage format file template, may include: determining whether a preset storage format file is stored in the permanent storage medium; if a preset storage format file is stored in the permanent storage medium, determining the latest stored preset storage format file based on the disk write time of each preset storage format file; generating a preset storage format file template based on the latest stored preset storage format file; and if no preset storage format file is stored in the permanent storage medium, creating a preset storage format file template based on the temporary data to be stored.
[0070] As described above, a preset storage format file template can be understood as a storage framework for temporary data. This framework defines the type of temporary data being stored, the relationships between data, and the amount of data that can be stored. It's understandable that if the vehicle's hardware and software remain unchanged, the type and format of the temporary data generated will not change significantly. Therefore, the same preset storage format file template used to store temporary data can be reused repeatedly.
[0071] Based on this, during the next round of temporary data collection, it can be first determined whether a preset storage format file is stored in the permanent storage medium. If so, the stored preset storage format file can be directly applied to generate a preset storage format file template. Optionally, in this embodiment, the preset storage format file with the latest disk write time in the permanent storage medium is selected to generate the preset storage format file template. If there is no preset storage format file in the file directory of the permanent storage medium, a preset storage format file template is generated based on the data type, collection time, data volume, and other data information of the collected temporary data, and the temporary data is stored accordingly.
[0072] The aforementioned preset storage format files containing temporary data are written to a permanent storage medium. Further, in one possible implementation, it is determined whether the number of preset storage format files stored in the permanent storage medium reaches a preset number of files; if the number of preset storage format files stored in the permanent storage medium reaches the preset number of files, all preset storage format files stored in the permanent storage medium are merged to obtain a target summary file; the target summary file is compressed to obtain a target upload file; and the target upload file is sent to the cloud.
[0073] It is understandable that temporarily written data to permanent storage media can be retained for a long time without worrying about data loss due to abnormal power-off. However, on the one hand, the storage capacity of permanent storage media is limited, making it impossible to continuously write all temporary data to permanent storage media. On the other hand, during the vehicle testing phase, it is also necessary to upload complete temporary data to the cloud. Therefore, in this embodiment, the on-board system is triggered to upload the preset storage format files in the permanent storage media to the cloud when the number of files in the preset storage format stored on the permanent storage media reaches a preset number.
[0074] Considering the problems of loose data and high transmission traffic costs when uploading multiple files simultaneously, this application embodiment merges multiple files into a single file with a preset storage format for aggregated uploading, thereby improving data upload efficiency and saving traffic costs.
[0075] Specifically, the process of merging all preset storage format files stored in the permanent storage medium can include: determining the latest stored preset storage format file based on the disk write time of each preset storage format file in the permanent storage medium; creating an initial summary file template based on the latest stored preset storage format file; reading the temporary data stored in all preset storage format files in the permanent storage medium and writing the temporary data into the initial summary file template to obtain the target summary file.
[0076] In this embodiment, the file format of the summary file must continue the preset storage format to ensure consistency between the uploaded data and the stored data. Therefore, any file in the preset storage format to be summarized can be selected to generate an initial summary file template. Optionally, in this embodiment, the most recently stored preset storage format file in the preset storage format to be summarized is selected to generate the initial summary file template. Then, temporary data in all the preset storage format files to be summarized is read, the summarization values are compared with the initial summary file template, the target summary file is obtained, and the target summary file is sent to the cloud.
[0077] In another possible implementation, the vehicle system responds to the data retrieval request from the cloud and queries the temporary data to be retrieved from the preset storage format file in the permanent storage medium. The columnar storage method of this application can also improve the data retrieval speed and send the retrieved temporary data to the cloud.
[0078] This application embodiment takes into account the limited storage capacity of the permanent storage medium. Therefore, after the target summary file is successfully sent to the cloud, all preset storage format files stored in the permanent storage medium can be deleted, and storage space for preset storage format files containing other temporary data can be reserved.
[0079] In one possible implementation, this application embodiment also deploys a program in the vehicle system for analyzing temporary data, analyzing and processing the temporary data in a preset storage format file stored in a permanent storage medium to obtain data analysis results, and sending the data analysis results to the cloud.
[0080] This tool / program analyzes temporary data locally in the vehicle, storing data in a pre-defined format. This allows test drivers to adjust the vehicle according to its status during test drives. The data analysis results are displayed directly on the vehicle's screen, and can also be sent to the cloud, saving time on cloud data transmission and analysis.
[0081] This application can be applied to the field of vehicle data processing, as follows: Figure 2 This application provides another flowchart illustrating the implementation of an in-vehicle data processing method, and introduces the application scenarios for product implementation.
[0082] First, let's introduce the application scenario of this example, referring to... Figure 3The system architecture diagram for implementing the vehicle-mounted data processing method provided in this application embodiment includes a cloud platform and a vehicle-mounted system. The vehicle-mounted system includes local storage, a disk, and analysis tools. In this example, local storage can be understood as a temporary storage medium for vehicle-mounted data, and the disk is a permanent storage medium for vehicle-mounted data. The vehicle-mounted data processing method is jointly implemented by functional modules such as the file sending module, data acquisition, local storage, integration and compression, and packaged sending of the vehicle-mounted system. This application can also be applied to other devices in the vehicle-mounted system capable of running software code related to the vehicle-mounted data processing method.
[0083] Reference Figure 2 When the vehicle starts and powers on, the initial configuration is performed. First, the system checks the file directory to see if the ORC file from the previous startup cycle exists. The ORC file is equivalent to the preset storage format file mentioned earlier, and the startup cycle represents the time period from when the vehicle powers on to when it powers off. If the query result is "yes," the system reads the last ORC file written in the previous startup cycle, copies the schema information, and removes the comments column. The schema is equivalent to a preset storage format file template; it's a framework or blueprint used to organize and describe data, defining the structure of the data in the database (in this example, the ORC file), including data organization, format, and relationships. Through the schema, developers can clearly define how temporary data in the ORC file is stored and interrelated, facilitating a unified data format and maintaining data consistency.
[0084] In this example, the order of steps S110 and S120 has been reversed. It is understood that step S120 involves identifying existing files, and during this process, the collected temporary data may not be required. Therefore, steps S110 and S120 are executed almost simultaneously. Even if step S120 fails to identify an existing file, it can be delayed until step S110 collects the temporary data, and then a preset storage format file template can be generated based on the temporary data. Therefore, the execution order of steps S110 and S120 can be adjusted as needed, and they can also be executed simultaneously. This embodiment of the application is not limited to a single instance.
[0085] After collecting temporary data, it is further determined whether this collection is the first collection after the vehicle is started. If so, it is necessary to combine the schema information of the previous start cycle copied above to create a new schema for the temporary data and add a memo column. A writer is created using the schema. The memo column is used to note the number of rows of temporary data stored in the orc file. The writer is used to write the temporary data to the orc file.
[0086] Furthermore, it's necessary to determine whether this data collection is the first since the initial report. It's important to note that if the vehicle has just started, the current reporting count is 0, and the result should be "No". If the result is "Yes", then all ORC files in the file directory have been uploaded to the cloud and deleted. Therefore, it's impossible to create a schema using existing ORC files. A new schema needs to be created based on the collected temporary data, with a memo column added, and the writer created using this schema.
[0087] Understandably, the three checks mentioned above are all used to implement the step of "determining whether a file with a preset storage format is stored on the disk". Based on the created schema, memo column, and writer, a new ORC file is obtained, and the collected temporary data is written to the file. This example sets the preset disk write condition to the ORC file reaching the number of lines t. Therefore, after each write, it is checked whether the current number of lines in the ORC file has reached the limit value t. If not, it returns to continue collecting temporary data. When collecting temporary data again, based on... Figure 2 The results for "Is this the first collection after startup?" and "Is this the first collection after reporting?" are both "No". There is no need to create a new schema. Just write to the existing ORC file. Follow the process in the example to reduce the generation of unnecessary files.
[0088] When the number of lines in the ORC file reaches the limit value t, the `close` function is called to write the data to disk, and the ORC file is written to disk. Then, the above process is repeated to collect new temporary data, create new schemas, etc. On disk, after each ORC file is written, it is checked whether the current number of files has reached the preset limit value T. If it has, a summary ORC file is created using the schema of the last ORC file written to disk. Data from all other ORC files is read and written to the summary ORC file, which is then compressed by the "integration and compression" module. The compressed and packaged summary ORC file is then sent to the cloud by the "packaging and sending" and "file sending" modules. Analysis tools can directly read the locally stored ORC files and display the data to developers for debugging.
[0089] In summary, the vehicle-mounted system of this application reports temporary data to the cloud in real time during operation, minimizing the possibility of data loss. Furthermore, by using columnar storage and batch disk write-to-disk, it alleviates problems such as system load, high CPU utilization, and large temporary storage media size. At the same time, local analysis tools facilitate real-time viewing and analysis of vehicle-mounted data, achieving timely early warning.
[0090] The above describes a vehicle data processing method provided by an embodiment of this application. The following describes an apparatus for performing the above vehicle data processing method.
[0091] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an in-vehicle data processing device provided in an embodiment of this application. Figure 4 As shown, the vehicle-mounted data processing device includes:
[0092] The data acquisition unit 100 is used to acquire temporary data to be stored;
[0093] Template determination unit 200 is used to determine a preset storage format file template;
[0094] The data storage unit 300 is used to store the temporary data to be stored into a temporary storage medium according to the preset storage format file template, so as to obtain a preset storage format file;
[0095] The first data storage unit 400 is used to write the preset storage format file to the permanent storage medium of the vehicle system when the preset storage format file meets the preset storage conditions and no vehicle power-off signal is received. The amount of data in the preset storage format file reaches a preset threshold.
[0096] The second data write-to-disk unit 500 is used to write the preset storage format file stored in the temporary storage medium to the permanent storage medium of the vehicle system when the vehicle power-off signal is received.
[0097] In one possible implementation, the on-board data processing unit further includes:
[0098] The cyclic acquisition unit is used to perform the step of acquiring temporary data to be stored when the preset storage format file does not meet the preset disk storage conditions and no power-off signal is received from the vehicle, and to store the temporary data in the preset storage format file in the temporary storage medium until the preset storage format file meets the preset disk storage conditions.
[0099] In one possible implementation, the template determining unit 200 includes:
[0100] A storage determination subunit is used to determine whether a file with a preset storage format is stored in the permanent storage medium;
[0101] The template determines the first sub-unit, which is used to determine the latest stored preset storage format file based on the disk write time of each preset storage format file when the judgment result of the storage judgment sub-unit is yes; and to generate a preset storage format file template based on the latest stored preset storage format file.
[0102] The template determines the second sub-unit, which is used to create a preset storage format file template based on the temporary data to be stored if the judgment result of the storage judgment sub-unit is negative.
[0103] In one possible implementation, the on-board data processing unit further includes:
[0104] The file quantity determination unit is used to determine whether the number of the preset storage format files stored in the permanent storage medium reaches the preset file quantity.
[0105] The file merging unit is used to merge all the preset storage format files stored in the permanent storage medium to obtain a target summary file if the judgment result of the file quantity judgment unit is yes.
[0106] The file compression unit is used to compress the target summary file to obtain the target upload file;
[0107] The file sending unit is used to send the target uploaded file to the cloud.
[0108] In one possible implementation, the file merging unit includes:
[0109] The file determination subunit is used to determine the latest stored preset storage format file based on the disk write time of each preset storage format file in the permanent storage medium.
[0110] The template creation sub-unit is used to create an initial summary file template based on the latest stored preset storage format file;
[0111] The data aggregation subunit is used to read the temporary data stored in all the preset storage format files in the permanent storage medium and write the temporary data into the initial aggregation file template to obtain the target aggregation file.
[0112] One possible implementation also includes:
[0113] After the file sending unit completes the step of sending the target uploaded file to the cloud, it jumps to the file deletion unit to delete all the preset storage format files stored in the permanent storage medium.
[0114] In one possible implementation, the preset storage format file is a columnar storage file.
[0115] In one possible implementation, the on-board data processing unit further includes:
[0116] The data analysis unit is used to analyze and process temporary data in the preset storage format file stored in the permanent storage medium to obtain data analysis results.
[0117] The result sending unit is used to send the data analysis results to the cloud.
[0118] In summary, the vehicle data processing device provided in this application, before receiving a vehicle power-down signal, integrates and stores temporary data using a preset storage format file template. When the data volume in the preset storage format file reaches a preset threshold, the preset amount of temporary data is written to the permanent storage medium all at once in the form of a preset storage format file. Compared to the prior art, which writes all temporary data to the disk in a concentrated manner during power-down, this application writes temporary data to the disk in batches before power-down, reducing the pressure of data writing to the disk during power-down. Even if the writing to the disk fails during power-down, the amount of data lost is minimized. Furthermore, by integrating and storing temporary data in the form of a preset storage format file, this application reduces the frequency of writing temporary data to the permanent storage medium after receiving a power-down signal, thereby reducing the occupation of disk I / O and allowing the vehicle system to maintain normal operation. This reduces the possibility of writing to the disk failing during power-down, ensuring that temporary data can be stored in a timely and complete manner.
[0119] This application also provides a computer program product, including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the vehicle data processing methods described above. The electronic device can be a hardware device capable of running computer programs, such as a processor or controller of a vehicle system.
[0120] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0122] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0123] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. A vehicle-mounted data processing method, characterized in that, Applied to in-vehicle systems, the in-vehicle data processing method includes: Collect temporary data to be stored; Determine the preset storage format file template; The temporary data to be stored is stored in a temporary storage medium according to the preset storage format file template to obtain a preset storage format file; If the preset storage format file meets the preset disk storage conditions and no vehicle power-off signal is received, the preset storage format file is written to the permanent storage medium of the vehicle system, and the amount of data in the preset storage format file reaches a preset threshold. Upon receiving the vehicle power-off signal, the preset storage format file stored on the temporary storage medium is copied to the permanent storage medium of the vehicle system.
2. The vehicle data processing method according to claim 1, characterized in that, Also includes: If the preset storage format file does not meet the preset disk storage conditions and no power-off signal is received from the vehicle, the step of collecting temporary data to be stored is performed, and the temporary data is stored in the preset storage format file in the temporary storage medium until the preset storage format file meets the preset disk storage conditions.
3. The vehicle data processing method according to claim 1, characterized in that, The process of determining the preset storage format file template includes: Determine whether the permanent storage medium contains a file in a preset storage format; If the permanent storage medium stores the preset storage format file, then the latest stored preset storage format file is determined based on the disk write time of each preset storage format file; a preset storage format file template is generated based on the latest stored preset storage format file. If the preset storage format file is not stored in the permanent storage medium, a preset storage format file template is created based on the temporary data to be stored.
4. The vehicle-mounted data processing method according to claim 1, characterized in that, Also includes: Determine whether the number of the preset storage format files stored in the permanent storage medium reaches the preset number of files; If the number of the preset storage format files stored in the permanent storage medium reaches the preset number of files, then all the preset storage format files stored in the permanent storage medium are merged to obtain the target summary file; Compress the target summary file to obtain the target upload file; Send the target file to the cloud.
5. The vehicle-mounted data processing method according to claim 4, characterized in that, The step of merging all the preset storage format files stored in the permanent storage medium to obtain a summary file includes: Based on the disk write time of each of the preset storage format files in the permanent storage medium, determine the latest stored preset storage format file; Based on the latest stored preset storage format file, create an initial summary file template; Read the temporary data stored in all the preset storage format files in the permanent storage medium, and write the temporary data into the initial summary file template to obtain the target summary file.
6. The vehicle-mounted data processing method according to claim 5, characterized in that, After sending the target file to the cloud, the process also includes: Delete all the preset storage format files stored on the permanent storage medium.
7. The vehicle data processing method according to any one of claims 1-6, characterized in that, The preset storage format file is a columnar storage file.
8. The vehicle data processing method according to any one of claims 1-6, characterized in that, Also includes: The temporary data stored in the preset storage format file in the permanent storage medium is analyzed and processed to obtain data analysis results; The data analysis results are sent to the cloud.
9. A vehicle-mounted data processing device, characterized in that, The vehicle data processing device, used in vehicle systems, includes: The data acquisition unit is used to collect temporary data to be stored. The template determination unit is used to determine the preset storage format file template; A data storage unit is used to store the temporary data to be stored into a temporary storage medium according to the preset storage format file template, thereby obtaining a preset storage format file; The first data storage unit is used to store the preset storage format file on the permanent storage medium of the vehicle system when the preset storage format file meets the preset storage conditions and no vehicle power-off signal is received. The amount of data in the preset storage format file reaches a preset threshold. The second data write-to-disk unit is used to write the preset storage format file stored in the temporary storage medium to the permanent storage medium of the vehicle system when the vehicle power-off signal is received.
10. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the vehicle data processing method as described in any one of claims 1 to 6.