Method and device for storing different vehicle end data, electronic equipment and storage medium

By classifying and storing vehicle-side data according to the recording time, and using preset interval lengths to divide time intervals, the inefficiency problem of the cloud platform in storing different vehicle-side data is solved, and efficient data storage and fast query are achieved.

CN118796785AActive Publication Date: 2024-10-18CHENGDU CELIS TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411268467.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-10-18
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

When existing cloud platforms store data from different vehicles, they are partitioned and stored directly based on the vehicle frame number, resulting in high storage resource consumption, reduced response speed, and low efficiency.

Method used

Determine the initial directory file based on the recording time of the vehicle-side data, divide the time interval by preset interval time, classify and store it, store the data of the same vehicle identity in the same initial directory file, and distribute it to the target directory file to reduce the number of files .

Benefits of technology

It improves data storage efficiency, reduces file writing operations, improves response speed, and facilitates quick query of vehicle-side data corresponding to vehicle identity marks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796785A_ABST
    Figure CN118796785A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of vehicles, and discloses a storage method and device for different vehicle end data, electronic equipment and a storage medium, and the method comprises the steps: determining an initial directory file for storing each piece of vehicle end data according to the recording time of each piece of vehicle end data; storing each piece of vehicle end data to a corresponding initial directory file, so that each initial directory file stores the vehicle end data corresponding to different vehicle identities in a corresponding specified time interval; and distributing the vehicle end data corresponding to the same vehicle identity identifier in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle end data corresponding to the same vehicle identity identifier with the same data recording date. Classified buffer storage can be carried out in real time according to the recording time of the vehicle end data, and compared with a storage mode of direct classification according to the vehicle frame number, the number of data writing files is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a method, device, electronic device and storage medium for storing different vehicle-side data. Background Art

[0002] At present, in order to facilitate the query of different vehicle-side data, the cloud platform directly stores different vehicle-side data in real time according to the partitions of the frame number. That is, the vehicle-side data with the same frame number is written into the same file. This storage method consumes a lot of storage resources. If there are multiple vehicle-side data with different frame numbers, multiple files need to be opened at the same time for data writing operations. When the file handle data reaches a certain value, it will affect the response speed of the storage process, resulting in reduced data storage efficiency. Summary of the invention

[0003] In view of the above problems, the present application provides a storage method, device, electronic device and storage medium for different vehicle-side data, which are used to classify and store data from different vehicle-sides to improve the efficiency of data storage.

[0004] According to one aspect of the present application, a storage method for different vehicle-side data is provided, and the storage method includes: determining an initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data; wherein the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is a directory corresponding to the time interval obtained by dividing a single day according to a preset interval duration; storing each vehicle-side data in a corresponding initial directory file, so that each initial directory file stores vehicle-side data corresponding to different vehicle identity identifiers in the corresponding specified time interval; wherein the vehicle-side data corresponding to the same vehicle identity identifier is stored in the same initial directory file; distributing the vehicle-side data corresponding to the same vehicle identity identifier in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity identifier of the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity identifier.

[0005] In an optional manner, distributing the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file further includes: merging the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain a plurality of merged vehicle-side data; determining a corresponding distribution thread based on the vehicle identity corresponding to each merged vehicle-side data, and distributing the plurality of merged vehicle-side data to the corresponding target directory file based on the respective corresponding distribution threads; wherein different distribution threads correspond to different target directory files.

[0006] In an optional manner, the vehicle-side data corresponding to the same vehicle identity in each initial directory file are merged to obtain multiple merged vehicle-side data, further including: traversing each vehicle-side data in each initial directory file, and taking the traversed vehicle-side data as the target vehicle-side data; if the vehicle identity corresponding to the target vehicle-side data is a historical vehicle identity, merging the target vehicle-side data into the historical vehicle-side data corresponding to the historical vehicle identity; wherein the historical vehicle identity is the vehicle identity corresponding to the traversed vehicle-side data; if the vehicle identity corresponding to the target vehicle-side data is not the historical vehicle identity, taking the target vehicle-side data as the new historical vehicle-side data for merging the vehicle-side data corresponding to the same vehicle identity.

[0007] In an optional manner, the corresponding distribution thread is determined based on the vehicle identity identifier corresponding to each merged vehicle-side data, and the multiple merged vehicle-side data are distributed to the corresponding target directory file based on the respective corresponding distribution threads, further including: generating a corresponding number of distribution threads according to the number of different vehicle identity identifiers corresponding to the multiple merged vehicle-side data; and distributing each merged vehicle-side data to the corresponding target directory file through the corresponding number of distribution threads.

[0008] In an optional manner, the corresponding distribution thread is determined based on the vehicle identity identifier corresponding to each merged vehicle-side data, and the multiple merged vehicle-side data are distributed to the corresponding target directory file based on the corresponding distribution threads, further including: determining the number of vehicle identity identifiers corresponding to each distribution thread according to the number of different vehicle identity identifiers corresponding to the multiple merged vehicle-side data and a preset number of distribution threads; distributing the vehicle-side data corresponding to the corresponding number of vehicle identity identifiers to the corresponding target directory file through each distribution thread; wherein the vehicle identity identifier corresponding to each distribution thread is different.

[0009] In an optional manner, the recording time includes the recording date and the recording time; determining the initial directory file for storing each vehicle-end data based on the recording time of each vehicle-end data further includes: matching the recording date of each vehicle-end data with the preset data recording date corresponding to the initial first-level directory to obtain each successfully matched preset data recording date; determining the initial directory file for storing each vehicle-end data in the initial second-level directory under each successfully matched preset data recording date based on the recording time of each vehicle-end data.

[0010] In an optional manner, the storage method also includes: dividing the duration of a single day by a preset interval duration, and constructing a corresponding number of the initial secondary directories based on the calculated quotient, so that the number of initial secondary directories under each initial first-level directory is the same.

[0011] According to another aspect of the present application, a storage device for different vehicle-side data is provided, and the storage device includes: a determination module, used to determine the initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data; wherein the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is the directory corresponding to the time interval obtained by dividing a single day according to a preset interval duration; an initial storage module, used to store each vehicle-side data in the corresponding initial directory file, so that each initial directory file stores the vehicle-side data corresponding to different vehicle identity identifiers in the corresponding specified time interval; wherein the vehicle-side data corresponding to the same vehicle identity identifier is stored in the same initial directory file; a target storage module, used to distribute the vehicle-side data corresponding to the same vehicle identity identifier in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity identifier of the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity identifier.

[0012] According to one aspect of the present application, an electronic device is provided, including: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned storage method is executed.

[0013] According to one aspect of the present application, a computer-readable storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the above-mentioned storage method.

[0014] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned storage method.

[0015] The present application can classify and buffer the data of each vehicle in real time according to the recording time, and store it in the initial directory file in the corresponding initial secondary directory; wherein, the initial secondary directory is a directory corresponding to the time interval obtained by dividing a single day with a preset interval, rather than setting a corresponding storage directory for different vehicle frame numbers. Compared with the storage method directly classified according to the vehicle frame number, the number of data written files is reduced. The present application distributes the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity on the same data recording date, and at the same time, the final stored secondary directory only stores one file for storing the vehicle-side data corresponding to a certain vehicle identity, so as to facilitate quick query of the vehicle-side data corresponding to the corresponding vehicle identity.

[0016] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 It is a flowchart of a storage method of different vehicle-side data shown in an exemplary embodiment of the present application.

[0019] Figure 2 It is a schematic diagram of an initial directory system shown in an exemplary embodiment of the present application.

[0020] Figure 3 is based on Figure 1 The exemplary embodiment shown is a flowchart of another method for storing different vehicle-side data.

[0021] Figure 4 is based on Figure 3 The exemplary embodiment shown is a flowchart of another method for storing different vehicle-side data.

[0022] Figure 5 It is a schematic diagram of the application scenarios of different vehicle-side data storage methods of the present application.

[0023] Figure 6It is a schematic diagram of a distribution process shown in an exemplary embodiment of the present application.

[0024] Figure 7 It is a schematic diagram of the structure of a storage device for different vehicle-side data shown in an exemplary embodiment of the present application.

[0025] Figure 8 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0026] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0030] In order to facilitate the query of different vehicle-side data, the existing cloud platform directly performs real-time storage according to the partitions of the frame number during the storage process of different vehicle-side data. That is, the vehicle-side data with the same frame number is written into the same file. This storage method consumes a lot of storage resources. If there are multiple vehicle-side data with different frame numbers, multiple files need to be opened at the same time for data writing operations. When the file handle data reaches a certain value, it will affect the response speed of the storage process, resulting in reduced data storage efficiency.

[0031] To this end, one aspect of the present application provides a storage method for different vehicle-side data, which improves the storage method of different vehicle-side data while ensuring convenient query, so as to improve the efficiency of data storage. Figure 1 , Figure 1 1 is a flow chart of a storage method of different vehicle-side data shown in an exemplary embodiment of the present application. The storage method at least includes S110 to S130, which are described in detail as follows: S110: Determine the initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data; wherein, the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is the directory corresponding to the time interval divided for a single day according to the preset interval duration.

[0032] Each vehicle-side data has a corresponding recording time, including but not limited to the data recording date and recording time. At the same time, each vehicle-side data has a corresponding vehicle identification, which is used to identify the source vehicle of the vehicle-side data. The vehicle identification can be an identification such as a frame number that represents the vehicle identity.

[0033] The initial directory file is a file set under the initial secondary directory. Figure 2 , Figure 2 It is a schematic diagram of an initial directory system shown in an exemplary embodiment of the present application. Among them, the initial first-level directory is the data recording date, and each initial first-level directory is set with multiple initial second-level directories, and the number of initial second-level directories set under each initial first-level directory is the same. Each initial second-level directory corresponds to a time interval, which is a directory corresponding to the time interval obtained by dividing a single day.

[0034] For example, the vehicle-side data A is recorded at 10:00 on August 1, 2024. The corresponding initial first-level directory is determined according to August 1, 2024, and the corresponding initial second-level directory is determined under the initial first-level directory according to 10:00, so as to store the vehicle-side data A in the initial directory file in the corresponding initial second-level directory. The number of files in each initial second-level directory can be adaptively adjusted according to the specific scenario, or can be fixed, or related to the number of different vehicle identifications, for example, one initial directory file is set for 10 different vehicle identifications.

[0035] In another exemplary embodiment, the construction of the initial secondary directory is exemplarily described as follows: The single-day duration is divided by the preset interval duration, and a corresponding number of initial secondary directories are constructed based on the calculated quotient, so that the number of initial secondary directories under each initial first-level directory is the same.

[0036] The units of the single-day duration and the preset interval duration are unified, which can be unified into hour units, minute units, etc., and this embodiment does not limit this.

[0037] For example, the preset interval time is 5 minutes, 24 hours × 60 minutes ÷ 5 minutes = 288, that is, 288 initial secondary directories are constructed under each initial primary directory.

[0038] S120: Storing each vehicle-side data into a corresponding initial directory file, so that each initial directory file stores vehicle-side data corresponding to different vehicle identity identifiers in a corresponding specified time interval; wherein, vehicle-side data corresponding to the same vehicle identity identifier is stored in the same initial directory file.

[0039] The single initial directory file in this embodiment does not store only the vehicle-side data corresponding to one vehicle identity, but can store the vehicle-side data corresponding to multiple different vehicle identity at the same time. However, under the premise of the same data recording date, the vehicle-side data of the same vehicle identity are stored in the same initial directory file, so as to quickly obtain all the vehicle-side data corresponding to a certain vehicle identity at any recording time.

[0040] It is worth noting that the initial directory file in this embodiment can be understood as a temporary storage file in the buffer storage process, and is not the final storage file of each vehicle-side data.

[0041] S130: Distribute the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity with the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity.

[0042] This embodiment can distribute the data in each initial directory file at the same time, that is, it can distribute the directory files under the initial secondary directory in parallel, and take each initial directory file as a unit to distribute the vehicle-side data therein to different target directory files according to the vehicle identity, so that the vehicle-side data with the same data recording date and the same vehicle identity are aggregated and stored in the same target directory file to complete the final storage of each vehicle-side data.

[0043] This embodiment can classify and buffer the data of each vehicle in real time according to the recording time, and store it in the initial directory file in the corresponding initial secondary directory; wherein, the initial secondary directory is a directory corresponding to the time interval obtained by dividing a single day with a preset interval, rather than setting a corresponding storage directory for different vehicle frame numbers. Compared with the storage method of directly classifying according to the vehicle frame number, the number of data written files is reduced. This embodiment distributes the vehicle-side data corresponding to the same vehicle identity identifier in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity identifier with the same data recording date, and at the same time, only one file for storing the vehicle-side data corresponding to a certain vehicle identity identifier is stored in the final stored secondary directory, so as to facilitate quick query of the vehicle-side data corresponding to the corresponding vehicle identity identifier.

[0044] In another exemplary embodiment of the present application, it is described in detail how to distribute the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file. For details, please refer to Figure 3 , Figure 3 is based on Figure 1 The exemplary embodiment shown is a flow chart of another method for storing different vehicle-side data. Figure 1 The S130 shown further includes S310 to S320, which are described in detail as follows: S310: Merge the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain a plurality of merged vehicle-side data.

[0045] The merged vehicle-side data all correspond to the same data recording date and the same vehicle identification. The merger can be understood as packaging, packaging multiple specified data into one unit to reduce the number of processing objects and optimize the processing objects.

[0046] S320: Determine a corresponding distribution thread based on the vehicle identity identifier corresponding to each merged vehicle-side data, and distribute the multiple merged vehicle-side data to the corresponding target directory file based on the respective corresponding distribution threads; wherein different distribution threads correspond to different target directory files.

[0047] The distribution thread is a thread that distributes the corresponding vehicle-side data to the corresponding target directory file. This embodiment uses different distribution threads to distribute multiple merged vehicle-side data. Compared with a single thread, multiple threads can be processed in parallel and relatively independently, which improves the distribution efficiency to a certain extent.

[0048] The settings of the distribution thread can be adjusted according to the actual situation. The following two examples are introduced: As an example, a corresponding number of distribution threads are generated according to the number of different vehicle identity identifiers corresponding to the multiple merged vehicle-side data; and each merged vehicle-side data is distributed to the corresponding target directory file through the corresponding number of distribution threads.

[0049] For example, if the number of different vehicle identifications is 100, 100 distribution threads are used for data distribution to ensure that each distribution thread distributes the vehicle-side data of the same vehicle identification, thereby ensuring that the vehicle-side data of each vehicle identification is processed in a targeted manner and all vehicle-side data can be distributed in parallel at one time.

[0050] In another exemplary embodiment, the number of vehicle identity identifiers corresponding to multiple merged vehicle-side data and a preset number of distribution threads are determined; the vehicle-side data corresponding to the corresponding number of vehicle identity identifiers are distributed to the corresponding target directory file through each distribution thread; wherein the vehicle identity identifier corresponding to each distribution thread is different.

[0051] For example, if the number of different vehicle identifications is 100 and the number of preset distribution threads is 10, and the distribution threads are used for average distribution, then each distribution thread can distribute the vehicle-side data of 10 different identifications, and distribute all vehicle-side data in parallel to quickly complete the distribution of vehicle-side data. In addition, 10 parallel distribution processes can be performed, and during each distribution process, each distribution thread distributes the vehicle-side data corresponding to 1 vehicle identification, so that each parallel distribution process can be performed on the vehicle-side data corresponding to 10 different vehicle identifications. This method can perform parallel distribution processing in batches when the amount of data is large to complete data classification.

[0052] This embodiment merges the vehicle-side data corresponding to the same vehicle identity in each initial directory file, and completes the distribution operation of the merged vehicle-side data based on the corresponding distribution thread, thereby quickly completing the classified storage of the vehicle-side data.

[0053] In another exemplary embodiment of the present application, it is described in detail how to merge the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain multiple merged vehicle-side data. For details, please refer to Figure 4 , Figure 4 is based on Figure 3 The exemplary embodiment shown is a flow chart of another method for storing different vehicle-side data. Figure 3 The S310 shown further includes S410 to S430, which are described in detail as follows: S410: traverse each vehicle-side data in each initial directory file, and use the traversed vehicle-side data as the target vehicle-side data.

[0054] This embodiment adopts a traversal method to ensure that all vehicle-side data in each initial directory file are merged and processed without omission.

[0055] S420: If the vehicle identity identifier corresponding to the target vehicle-side data is a historical vehicle identity identifier, the target vehicle-side data is merged into the historical vehicle-side data corresponding to the historical vehicle identity identifier; wherein the historical vehicle identity identifier is the vehicle identity identifier corresponding to the vehicle-side data that has been traversed.

[0056] The vehicle identity is a historical vehicle identity, indicating that the corresponding vehicle-side data has established a merged data set. There is no need to establish a new data set. The traversed vehicle-side data can be directly merged into the corresponding historical vehicle-side data. S430: If the vehicle identity identifier corresponding to the target vehicle-side data is not a historical vehicle identity identifier, the target vehicle-side data is used as new historical vehicle-side data to merge the vehicle-side data corresponding to the same vehicle identity identifier.

[0057] The vehicle identity is not a historical vehicle identity, which means that the vehicle-side data corresponding to the vehicle identity has not been merged before. In this case, a new historical vehicle-side data set needs to be established to merge the vehicle-side data corresponding to the current vehicle identity, so as to facilitate the subsequent rapid merging of vehicle-side data with the same vehicle identity.

[0058] This embodiment adopts a traversal method, which can ensure that all vehicle-side data in each initial directory file are merged and processed without omission, so as to accurately obtain multiple merged vehicle-side data.

[0059] In another exemplary embodiment of the present application, how to determine the initial directory file storing each vehicle-side data according to the recording time of each vehicle-side data is described in detail, that is, the above S110 further includes S111 to S112; wherein the recording time includes the recording date and the recording time, which is described in detail as follows: S111: Match the recording date of each vehicle-side data with the preset data recording date corresponding to the initial first-level directory to obtain the preset data recording date that has been successfully matched.

[0060] S112: Determine an initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data in the initial secondary directory under the preset data recording date that has been successfully matched.

[0061] An exemplary explanation is given in conjunction with Table 1: the recording date of the vehicle-side data B is August 2, 2024, and the recording time is 01:00. The preset data recording date 20240802 that matches it is determined in Table 1, and the initial secondary directory 0100 corresponding to 01:00 is used as the initial secondary directory corresponding to the vehicle-side data B, thereby determining the initial directory file of the vehicle-side data B (the initial first-level directory of the file is 20240802, and the initial second-level directory is 0100).

[0062] Table 1: Correspondence between preset data recording date and initial secondary directory In another exemplary embodiment of the present application, the application scenarios of the above-mentioned multiple storage methods are exemplarily described. Figure 5 , Figure 5 It is a schematic diagram of the application scenarios of different vehicle-side data storage methods of the present application.

[0063] Vehicle-side data - The high-frequency original messages of the vehicle are first uploaded to the message queue of the cloud platform for cache to play the role of data buffering. Common high-frequency messages include CAN original messages. The format of the message queue message is: the key of the topic is the vehicle identity (such as the frame number), and the value of the topic is the original message in hexadecimal.

[0064] The message storage program can write each vehicle-side data storage into the object storage / local file system to complete the initial storage operation of the vehicle-side data. Specifically, according to the recording date of the vehicle-side data, its initial first-level directory is determined, and according to the recording time of the vehicle-side data, its initial second-level directory is determined. Among them, the message storage program sets a checkpoint every N minutes (taking N as the interval length for the directory corresponding to the time interval divided for a single day, that is, the number of initial second-level directories), and the parallelism is set to M (the number of workers that can be distributed and processed at the same time). In some embodiments, the parallelism is divided by the hash value of the frame number, that is, the vehicle-side data of the same vehicle identity is processed in the same sub-thread, which will make each initial second-level directory have M initial directory files, and the vehicle-side data corresponding to the same vehicle identity is stored in the same initial directory file. There may be vehicle-side data corresponding to multiple different identities in an initial directory file.

[0065] The parameters stored in the object storage / local file system in real time include the device number (vehicle identity), original message time (recording time: recording date + recording time), and original message (vehicle-side data). The data is stored in a column storage format such as parquet, and the data is compressed using a data compression method such as zstd.

[0066] The distribution program distributes the vehicle-side data in the initial directory file in the object storage / local file system. The distribution process is as follows: Figure 6 As shown. Among them, the main entry class 1 mainly receives the record date (that is, distributes all the data of a certain day), corresponds to the above-mentioned initial first-level directory, scans the number of initial second-level directories under the initial first-level directory (the number of initial second-level directories is X=24*60 / N, N is the configured minute data), and generates a temporary DS (apachedolphinscheduler) workflow temp_workflow1 based on the data, and generates the number of tasks in the workflow based on the number of initial second-level directories. For example, if X=3, 3 tasks are generated. The content of each task execution is the same, but the parameters passed in are different. The parameters are the path of the initial second-level directory of OBS; each task in the workflow calls the main entry class 2 to process the vehicle-side data of an initial second-level directory, and all tasks Service parallel; restart this temporary workflow temp_workflow1 to schedule in all workers of DS and obtain the execution result of the workflow; determine whether it is necessary to merge files according to business needs (whether it is necessary to merge the vehicle-side data on the same day after distribution into one file), and if so, generate a temporary workflow temp_workflow2 again; each task in the workflow passes in the device number (i.e., vehicle identity) to call the main entry class 3, merge the vehicle-side data with the same recording date and the same device number into the same file, and restart this temporary workflow temp_workflow2 to schedule in all workers of DS and obtain the execution result of the workflow; return the execution result status, and the main entry class 1 is processed.

[0067] The main entry class 2 mainly receives the initial secondary directory as a parameter, traverses the distributed Python scripts, and generates a single-threaded script or a multi-threaded parallel script according to different configurations. The single-threaded script is a thread that reads and distributes all files under this initial secondary directory according to the device number. The multi-threaded script generates a distribution script for each initial directory file under the initial secondary directory, starts a thread to execute, obtains the execution result status of the distributed Python script and returns it.

[0068] The main entry class 3 mainly receives the results distributed by the main entry class 2: the device number is used as the input parameter, and multiple files of the same device number are merged into one file to obtain multiple target directory files; among which, the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identification.

[0069] This embodiment adopts a distributed scheduling execution strategy throughout the distribution scheduling, that is, the same DS worker only processes the data of one initial secondary directory or one initial directory file at the same time, and cooperates with multiple DS workers to perform parallel computing, and uses workflows to aggregate distributed computing results to achieve overall efficient and high-speed vehicle-side data distribution. At the same time, this embodiment can support the export of long-term historical vehicle-side data. By recording the time and device number, the file directory can be directly located, and there is only one file in the same directory, which can quickly query data export.

[0070] Another aspect of the present application also provides a storage device for different vehicle-side data, such as Figure 7 As shown, Figure 7 700 is a schematic diagram of a storage device for different vehicle-side data shown in an exemplary embodiment of the present application. The storage device 700 includes: Determination module 710 is used to determine the initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data; wherein the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is the directory corresponding to the time interval obtained by dividing a single day according to the preset interval duration.

[0071] The initial storage module 730 is used to store each vehicle-side data into the corresponding initial directory file, so that each initial directory file stores the vehicle-side data corresponding to different vehicle identity identifiers in the corresponding specified time interval; wherein the vehicle-side data corresponding to the same vehicle identity identifier is stored in the same initial directory file.

[0072] The target storage module 750 is used to distribute the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity with the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity.

[0073] In another exemplary embodiment, the target storage module 750 further includes: The merging unit is used to merge the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain multiple merged vehicle-side data.

[0074] The target storage unit is used to determine the corresponding distribution thread based on the vehicle identity identifier corresponding to each merged vehicle-side data, and distribute the multiple merged vehicle-side data to the corresponding target directory file based on the respective corresponding distribution threads; wherein different distribution threads correspond to different target directory files.

[0075] In another exemplary embodiment, the merging unit further comprises: The traversal section is used to traverse each vehicle-side data in each initial directory file, and use the traversed vehicle-side data as the target vehicle-side data.

[0076] The first merging section is used to merge the target vehicle-side data into the historical vehicle-side data corresponding to the historical vehicle identity if the vehicle identity corresponding to the target vehicle-side data is a historical vehicle identity; wherein the historical vehicle identity is the vehicle identity corresponding to the vehicle-side data that has been traversed.

[0077] The second merging section is used to use the target vehicle-side data as new historical vehicle-side data if the vehicle identity identifier corresponding to the target vehicle-side data is not a historical vehicle identity identifier, so as to merge the vehicle-side data corresponding to the same vehicle identity identifier.

[0078] In another exemplary embodiment, the target storage unit further comprises: The thread generation section is used to generate a corresponding number of distribution threads according to the number of different vehicle identity identifiers corresponding to multiple merged vehicle-side data.

[0079] The first distribution section is used to distribute each merged vehicle-side data to the corresponding target directory file through a corresponding number of distribution threads.

[0080] In another exemplary embodiment, the target storage unit further comprises: The thread determination section is used to determine the number of vehicle identification tags corresponding to each distribution thread based on the number of different vehicle identification tags corresponding to multiple merged vehicle-side data and a preset number of distribution threads.

[0081] The second distribution section is used to distribute the vehicle-side data corresponding to the corresponding number of vehicle identity identifiers to the corresponding target directory file through each distribution thread; wherein the vehicle identity identifier corresponding to each distribution thread is different.

[0082] In another exemplary embodiment, the recording time includes the recording date and the recording time; the determination module 710 further includes: The first matching unit is used to match the recording date of each vehicle-side data with the preset data recording date corresponding to the initial first-level directory to obtain the preset data recording date of each successful match.

[0083] The second matching unit is used to determine the initial directory file storing each vehicle-side data according to the recording time of each vehicle-side data in the initial secondary directory under the preset data recording date of each successful match.

[0084] In another exemplary embodiment, the storage device 700 further includes: The calculation module is used to divide the single-day duration by the preset interval duration, and construct a corresponding number of initial secondary directories according to the calculated quotient, so that the number of initial secondary directories under each initial first-level directory is the same.

[0085] The storage device of the present application can classify and buffer the data of each vehicle in real time according to the recording time, and store it in the initial directory file in the corresponding initial secondary directory; wherein, the initial secondary directory is a directory corresponding to the time interval obtained by dividing a single day with a preset interval, rather than setting a corresponding storage directory for different vehicle frame numbers. Compared with the storage method of directly classifying according to the vehicle frame number, the number of data written to the file is reduced. The storage device of the present application distributes the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity on the same data recording date, and at the same time, the final stored secondary directory only stores one file for storing the vehicle-side data corresponding to a certain vehicle identity, so as to facilitate quick query of the vehicle-side data corresponding to the corresponding vehicle identity.

[0086] It should be noted that the storage device provided in the above embodiment and the storage method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0087] Another aspect of the present application provides an electronic device, comprising: a controller; and a memory for storing one or more programs, wherein when the one or more programs are executed by the controller, the above-mentioned storage method is executed.

[0088] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a computer system of an electronic device shown in an exemplary embodiment of the present application, which shows a schematic diagram of the structure of a computer system of an electronic device suitable for implementing an embodiment of the present application.

[0089] It should be noted that Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0090] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0091] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0092] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.

[0093] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0094] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0095] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0096] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the storage method described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0097] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the storage method provided in each of the above embodiments.

[0098] According to one aspect of an embodiment of the present application, a computer system is also provided, including a central processing unit (CPU), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage portion into a random access memory (RAM), such as executing the method in the above embodiment. In RAM, various programs and data required for system operation are also stored. CPU, ROM and RAM are connected to each other via a bus. Input / output (I / O) interface is also connected to the bus.

[0099] The following components are connected to the I / O interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0100] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A method for storing different vehicle-side data, characterized in that: The storage method comprises: According to the recording time of each vehicle-side data, an initial directory file for storing each vehicle-side data is determined; wherein the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is a directory corresponding to the time interval obtained by dividing a single day according to the preset interval time; Storing each vehicle-side data in a corresponding initial directory file, so that each initial directory file stores vehicle-side data corresponding to different vehicle identifications in a corresponding specified time interval; wherein the vehicle-side data corresponding to the same vehicle identification is stored in the same initial directory file; Distribute the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory files, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity with the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity.

2. The storage method according to claim 1, characterized in that: The step of distributing the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file further includes: Merging the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain a plurality of merged vehicle-side data; The corresponding distribution thread is determined based on the vehicle identity identifier corresponding to each merged vehicle-side data, and the multiple merged vehicle-side data are distributed to the corresponding target directory file based on the respective corresponding distribution threads; wherein different distribution threads correspond to different target directory files.

3. The storage method according to claim 2, characterized in that: The step of merging the vehicle-side data corresponding to the same vehicle identity in each initial directory file to obtain a plurality of merged vehicle-side data further includes: Traverse each vehicle-side data in each initial directory file, and use the traversed vehicle-side data as the target vehicle-side data; If the vehicle identity identifier corresponding to the target vehicle-side data is a historical vehicle identity identifier, the target vehicle-side data is merged into the historical vehicle-side data corresponding to the historical vehicle identity identifier; wherein the historical vehicle identity identifier is the vehicle identity identifier corresponding to the traversed vehicle-side data; If the vehicle identity identifier corresponding to the target vehicle-side data is not the historical vehicle identity identifier, the target vehicle-side data is used as new historical vehicle-side data to merge the vehicle-side data corresponding to the same vehicle identity identifier.

4. The storage method according to claim 2, characterized in that: The method further includes: determining a corresponding distribution thread based on the vehicle identity corresponding to each merged vehicle-side data, and distributing the plurality of merged vehicle-side data to a corresponding target directory file based on the respective corresponding distribution threads, and further includes: Generate a corresponding number of distribution threads according to the number of different vehicle identifications corresponding to the multiple merged vehicle-side data; Each merged vehicle-side data is distributed to the corresponding target directory file through a corresponding number of distribution threads.

5. The storage method according to claim 2, characterized in that: The method further includes: determining a corresponding distribution thread based on the vehicle identity corresponding to each merged vehicle-side data, and distributing the plurality of merged vehicle-side data to a corresponding target directory file based on the respective corresponding distribution threads, and further includes: Determine the number of vehicle identification tags corresponding to each distribution thread according to the number of different vehicle identification tags corresponding to the plurality of merged vehicle-side data and a preset number of distribution threads; The vehicle-side data corresponding to the corresponding number of vehicle identification tags are distributed to the corresponding target directory file through each distribution thread; wherein the vehicle identification tag corresponding to each distribution thread is different.

6. The storage method according to any one of claims 1 to 5, characterized in that: The recording time includes the recording date and the recording time; the initial directory file for storing each vehicle-side data is determined according to the recording time of each vehicle-side data, further comprising: Matching the recording date of each vehicle-side data with the preset data recording date corresponding to the initial first-level directory to obtain the preset data recording date of each successfully matched one; According to the recording time of each vehicle-side data, in the initial secondary directory under the preset data recording date that matches successfully, the initial directory file for storing each vehicle-side data is determined.

7. The storage method according to any one of claims 1 to 5, characterized in that: The storage method further comprises: The single-day duration is divided by the preset interval duration, and a corresponding number of the initial secondary directories are constructed according to the calculated quotient, so that the number of initial secondary directories under each initial primary directory is the same.

8. A storage device for different vehicle-side data, characterized in that: The storage device comprises: A determination module is used to determine an initial directory file for storing each vehicle-side data according to the recording time of each vehicle-side data; wherein the initial first-level directory to which the initial directory file belongs is the data recording date, and the initial second-level directory to which it belongs is the specified time interval, and the initial second-level directory is a directory corresponding to the time interval obtained by dividing a single day according to a preset interval duration; An initial storage module is used to store each vehicle-side data into a corresponding initial directory file, so that each initial directory file stores vehicle-side data corresponding to different vehicle identifications in a corresponding specified time interval; wherein the vehicle-side data corresponding to the same vehicle identification is stored in the same initial directory file; The target storage module is used to distribute the vehicle-side data corresponding to the same vehicle identity in each initial directory file to the corresponding target directory file, so that each target directory file stores the vehicle-side data corresponding to the same vehicle identity with the same data recording date; wherein the first-level directory to which the target directory file belongs is the data recording date, and the second-level directory to which it belongs is the vehicle identity.

9. An electronic device, characterized in that: include: Controller; A memory for storing one or more programs, wherein when the one or more programs are executed by a controller, the controller implements the storage method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by the memory of the computer, the computer is caused to execute the storage method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Massive data storage and retrieval method

    CN102750377A

  • Method and device for storing real-time messages in intelligent substation

    CN102937956A

  • Method and system for establishing cache directory

    CN103455434A

  • File transmission method and device, electronic equipment and storage medium

    CN117675799A

  • Storage system with directory-based storage tiering

    US10599624B1