Vehicle data processing method, device, equipment and medium

CN118132269BActive Publication Date: 2024-11-26CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410343949.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-25
Publication Date
2024-11-26
Estimated Expiration
2044-03-25

AI Technical Summary

Benefits of technology

[0039] The vehicle data processing method disclosed by the present invention first virtualizes the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file. The purpose is to increase the speed of reading data from the file and export the analyzed data. data; then read the data to be parsed in parallel through the first number of parsing threads based on the memory file and parse the data to be parsed in parallel, obtain the parsed data file, and execute the data parsing task in parallel through multiple threads, which greatly improves Data parsing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118132269B_ABST
    Figure CN118132269B_ABST
Patent Text Reader

Abstract

The present invention discloses a vehicle data processing method, device, equipment and medium, the vehicle data processing method comprising: virtualizing the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file; based on the memory file, reading the data to be parsed in parallel through a first number of parsing threads and performing parallel parsing on the data to be parsed to obtain the parsed data file; wherein the first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of CPU cores of the computer system and the maximum number of threads supported by each CPU core. The processing efficiency of vehicle data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicle data processing, and in particular to a vehicle data processing method, device, equipment and medium. Background Art

[0002] CAN (controller area network) bus is an important communication bus in the car, which is used to record vehicle speed signals, motor speed signals, brake signals, and battery-related signals. Therefore, it is possible to analyze whether the various indicators of the vehicle are normal by analyzing the CAN signal.

[0003] Usually, a vehicle reports a CAN signal per second (including hundreds of indicators of the whole vehicle: glass, brakes, windows, lights, doors, speed assistance, locks, atmospheric pressure monitoring, navigation, reversing images, steering wheels, rearview mirrors, driving modes, etc.). If the vehicle is powered on for 6 hours a day, the vehicle will report 6*60*60=21600 CAN signals a day. If you need to export the CAN signals of 10 vehicles for a year, you need to export 21600*10*365=78840000 CAN signals. Therefore, it is particularly important to analyze tens of millions or even hundreds of millions of CAN signals with high performance while ensuring the stability of the system.

[0004] In view of this, the present invention is proposed. Summary of the invention

[0005] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.

[0006] The present application provides a method for processing vehicle data, which improves the processing efficiency of vehicle data.

[0007] In a first aspect, the present invention provides a method for processing vehicle data, comprising the following steps:

[0008] Virtualize the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file;

[0009] Based on the memory file, the first number of parsing threads are used to read the data to be parsed in parallel and parse the data to be parsed in parallel to obtain a parsed data file;

[0010] The first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of CPU (Central Processing Unit) cores of the computer system and the maximum number of threads supported by each CPU core.

[0011] Further, the data to be parsed includes a CAN signal to be parsed;

[0012] There are multiple original data files, and there are multiple corresponding memory files;

[0013] The method of reading the data to be parsed in parallel through a first number of parsing threads based on the memory file and parsing the data to be parsed in parallel includes:

[0014] Different parsing threads read the data to be parsed from different memory files in parallel and parse the data to be parsed in parallel.

[0015] Furthermore, there are multiple parsed data files for each vehicle, and each parsed data file includes multiple parsed data;

[0016] The processing method further includes: using a first number of sorting threads to use a merge sort algorithm to sort the data in each of the single parsed data files in parallel to obtain each sorted single file;

[0017] A merge sort algorithm is used to sort the data in the plurality of sorted single files to obtain a sorted data file.

[0018] Further, the step of using a merge sort algorithm to sort the data in each of the parsed data files in parallel by using the first number of sorting threads to obtain each sorted single file includes:

[0019] For each data in the single parsed data file, the data is divided into multiple groups, and the data in each group is sorted respectively to obtain multiple sorted signal groups, and then the data in the sorted signal groups are sorted until all the data in the single parsed data file are sorted to obtain a sorted single file.

[0020] Furthermore, the data are divided into a plurality of groups, and the data in each group are sorted to obtain a plurality of sorted signal groups, including:

[0021] Divide two adjacent data into one group, and one data belongs to a unique group;

[0022] Sort the two data in each group according to the preset fields to obtain a sorted signal group;

[0023] Correspondingly, the step of sorting the data in the sorted signal group includes:

[0024] Dividing two adjacent sorted signal groups into one team, wherein one sorted signal group belongs to only one team;

[0025] The data in each team is sorted according to the preset fields to obtain a sorted signal team.

[0026] Furthermore, the method of using a merge sort algorithm to sort the data in the plurality of sorted single files to obtain a sorted data file includes:

[0027] The plurality of sorted single files are divided into a plurality of groups, the data in the sorted single files in each group are sorted respectively to obtain a plurality of sorted file groups, and then the data in the sorted file groups are sorted to obtain sorted data files.

[0028] Furthermore, the process of virtualizing the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file includes:

[0029] The original data file stored in the preset disk space is virtualized to the memory address space of the process through the underlying function of the computer system to obtain the memory file.

[0030] In a second aspect, the present invention further provides a vehicle data processing device, comprising:

[0031] A mapping module is used to virtualize the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file;

[0032] A processing module, configured to read the data to be parsed in parallel through a first number of parsing threads based on the memory file and parse the data to be parsed in parallel to obtain a parsed data file;

[0033] The first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of CPU cores of the computer system and the maximum number of threads supported by each CPU core.

[0034] In a third aspect, the present invention further provides an electronic device, the electronic device comprising:

[0035] one or more processors;

[0036] A storage device for storing one or more programs;

[0037] When the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle data processing method as described above.

[0038] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the vehicle data processing method as described above.

[0039] The vehicle data processing method disclosed in the present invention first virtualizes the original data file stored in the preset disk space to the memory address space of the process to obtain a memory file, so as to improve the speed of reading data from the file and export the parsed data; then based on the memory file, the data to be parsed is read in parallel by a first number of parsing threads and the data to be parsed is parsed in parallel to obtain the parsed data file, and the data parsing task is executed in parallel by multiple threads, thereby greatly improving the data parsing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0041] Figure 1 A schematic flow chart of a vehicle data processing method provided by an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a process of a vehicle reporting a CAN signal to the cloud provided by an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of an analytical solution provided by an embodiment of the present invention;

[0044] Figure 4 A schematic diagram of implementing a merge sort algorithm provided in an embodiment of the present invention;

[0045] Figure 5 A schematic diagram of the structure of a vehicle data processing device provided by an embodiment of the present invention;

[0046] Figure 6 FIG. 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0048] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0049] Figure 1 This is a flow chart of a vehicle data processing method proposed in this application, which can be applied to the application scenario of parsing CAN signals uploaded by the vehicle to the cloud. The vehicle data processing method can be executed by a vehicle data processing device, which can be implemented in the form of software and / or hardware and integrated into an electronic device.

[0050] like Figure 1 As shown, the vehicle data processing method includes the following steps:

[0051] S110: Virtualize the original data file stored in the preset disk space to the memory address space of the process to obtain a memory file.

[0052] By virtualizing the original data file stored in the disk space to the memory address space of the process to obtain a memory file, the memory file can be regarded as part of the memory in the process, allowing the process program (i.e., thread) to directly read and write this part of the memory without the need for traditional file input and output calls. This method simplifies the operation of reading and writing data from files and improves the efficiency of data reading and writing. File reading and writing become as efficient as memory access. Otherwise, the data in the file must be copied to the user space of the program through the computer kernel space every time. Such switching back and forth and copying take time, which makes the speed of reading data in the file and writing the processed data to the file lower, affecting the processing efficiency.

[0053] The preset disk refers to a disk of a cloud storage device, in which the original data file is stored. The original data file is the CAN signal reported by the vehicle. For example, refer to Figure 2The process diagram of a vehicle reporting a CAN signal to the cloud is shown in the figure. The process of a vehicle reporting a CAN signal to the cloud is as follows: the vehicle's CAN signal is sent to the EMQ (Erlang MQTT Broker) message middleware through the vehicle terminal TBOX (Telematics-BOX). The EMQ message middleware pushes the received CAN signal to the gateway. The gateway sends the CAN signal to the Kafka message middleware. The Kafka message middleware sends the CAN signal to the big data service. The big data service stores all the CAN signals reported by each vehicle in a day in the form of files on the disk in the cloud. That is, for a vehicle, there are 365 CAN signal files for a year, and there is one CAN signal file for each day.

[0054] S120: Based on the memory file, read the data to be parsed in parallel through a first number of parsing threads and parse the data to be parsed in parallel to obtain a parsed data file.

[0055] The first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of CPU cores of the computer system and the maximum number of threads supported by each CPU core.

[0056] For example, the number of CPU cores of the computer system is 5, and the maximum number of threads supported by each CPU core is 2, then the first number is 2×5=10.

[0057] By determining the first number according to the maximum number of threads supported by the computer system, the CPU utilization rate can be maximized at all times, thereby fully utilizing the computing resources of the computer system and improving data parsing efficiency.

[0058] In some implementations, the data to be parsed includes a CAN signal to be parsed; there are multiple original data files, and after the original data files are virtualized to the memory address space in the process, there are multiple corresponding memory files.

[0059] The method of reading the data to be parsed in parallel through a first number of parsing threads based on the memory file and parsing the data to be parsed in parallel includes:

[0060] Different parsing threads read the data to be parsed from different memory files in parallel and parse the data to be parsed in parallel. That is, one parsing thread is responsible for reading and parsing the data to be parsed in one original data file. By having multiple parsing threads read and parse the data to be parsed in different files in parallel, the reading and parsing efficiency is greatly improved, and the CPU of the computer system is fully utilized.

[0061] In summary, the embodiments of the present application speed up the analysis of CAN signals by using the idea of ​​splitting and dividing and conquering. The idea of ​​splitting and dividing and conquering is mainly to split a large problem that is difficult to solve directly into a number of smaller-scale identical problems so that they can be solved one by one and divided and conquered. In this solution, some programs of a computing nature consume CPU resources, but CPU resources are not required for writing and reading files. If the CPU resources at this time can be utilized, the performance will be further improved.

[0062] The steps to split and divide and conquer are:

[0063] Decomposition: Decompose the original problem into several smaller, independent sub-problems of the same form as the original problem.

[0064] Solution: Solve the subproblems directly, or recursively solve each subproblem.

[0065] Merge: Merge the solutions to each sub-problem into the solution to the original problem.

[0066] The number of CAN signals reported by each vehicle in a year is as high as 21600*365=7884000, but each piece of data does not affect each other. Therefore, the 7884000 CAN signals can be split into multiple parts. For example, the CAN signals reported every day are one part, that is, the CAN signals in a raw data file are one part. The idle threads in the system (some codes in the program do not require the participation of the CPU, and many threads are idle at this time. It is a waste if they are not used) parse each CAN signal separately, and then merge the parsed CAN signals. Figure 3 The schematic diagram of a parsing solution shown in FIG. 1 shows that, assuming that CAN signals of 30 vehicles need to be parsed for one year, one thread can be responsible for parsing the CAN signals of one vehicle for one year. Furthermore, the CAN signals of one vehicle for one year can be divided into 365 parts, that is, one part of the CAN signals for each day, and one thread can be responsible for parsing the CAN signals for one day, and then the parsing results can be merged.

[0067] For example, a vehicle usually reports a CAN signal once per second (including hundreds of indicators of the entire vehicle: glass, brakes, windows, lights, doors, speed assistance, locks, atmospheric pressure monitoring, navigation reversing image, steering wheel, rearview mirror, driving mode, etc.). If the vehicle is driven for 6 hours a day, the vehicle will report 6*60*60=21600 times a day. The CAN signals of a vehicle in a year are as high as 21600*365=7884000. If the CAN signals of 30 vehicles for a year are exported at one time, then 7884000*30=236520000 CAN signals need to be exported. Since parsing CAN signals takes a certain amount of time, according to the conventional parsing scheme, CAN signals are parsed one by one through a thread. Assuming that it takes 2ms to parse each CAN signal, it takes 7884000*2 / 1000 (milliseconds) = 15768 seconds = 262.8 minutes to parse the CAN signals of a car for one year; it takes 30*262.8 = 7884 minutes to parse the CAN signals of 30 cars for one year. And through the optimization scheme of this application, assuming that a total of 10 threads are created, each thread is responsible for the CAN signal of a car, and the CAN signals of 10 cars are parsed in parallel at the same time, it will take 7884÷10=788.4 minutes, and the parsing efficiency will be improved by 10%. If a total of 20 threads are created, it will take 7884÷20=394.2 minutes, and the parsing efficiency will be improved by 20%.

[0068] Furthermore, by adopting the idea of ​​splitting and dividing and conquering (i.e., one parsing thread is responsible for reading and parsing the data to be parsed in an original data file, and multiple parsing threads are used in parallel to read and parse the data to be parsed in different files), idle CPU resources are fully utilized (for example, CPU resources are not required for writing and reading files. If the CPU resources at this time can be utilized, the performance will be further improved). Overall, the efficiency can be improved by about 30% (through multiple experiments, it was found that although there are more threads and the competition for CPU is fierce, the utilization rate of the computer CPU reaches the maximum at all times). Then, in the case of 10 threads, the time spent on parsing the CAN signals of 30 vehicles for one year is about 788.4*(1-0.3)=551.88 minutes. In the case of 20 threads, the time spent on parsing the CAN signals of 30 vehicles for one year is about 394.2*(1-0.3)=275.9 minutes, and the parsing efficiency is significantly improved.

[0069] The vehicle data processing method disclosed in the embodiment of the present invention first virtualizes the original data file stored in the preset disk space to the memory address space of the process to obtain a memory file, so as to improve the speed of reading data from the file and export the parsed data; then, based on the memory file, the data to be parsed is read in parallel by a first number of parsing threads and the data to be parsed is parsed in parallel to obtain the parsed data file, and the data parsing task is executed in parallel by multiple threads, thereby greatly improving the data parsing efficiency.

[0070] Understandably, each vehicle reports about millions of CAN signals in a year, and these millions of data are stored in multiple raw data files. As mentioned above, there is one raw data file for each CAN signal reported by a vehicle in a day. However, after the CAN signals to be parsed in each raw data file are parsed, they are not sorted according to the time when the original CAN signals were generated. Therefore, after parsing the CAN signals, the parsed CAN signals need to be sorted in ascending order of time. If you sort according to conventional ideas, you must first read these millions of data into the computer memory, and then sort them one by one in a single thread. This will take too long to sort, and the longer these millions of data stay in the memory, the more likely it is to cause system crashes. However, using multi-file merging and multi-threaded merging sorting algorithms will greatly shorten the sorting time and improve system performance.

[0071] Specifically, in some implementations, there are multiple parsed data files for each vehicle, and each parsed data file includes multiple parsed data.

[0072] The processing method further includes: using a first number of sorting threads to use a merge sorting algorithm to sort the data in each single parsed data file in parallel to obtain each sorted single file; using a merge sorting algorithm to sort the data in multiple sorted single files to obtain sorted data files. That is, first sort the data in a single data file, and then merge the data in multiple sorted files. Such a design can shorten the sorting time and improve system performance.

[0073] Further, the step of using a merge sort algorithm to sort the data in each of the parsed data files in parallel by using the first number of sorting threads to obtain each sorted single file includes:

[0074] For each data in the single parsed data file, the data is divided into multiple groups, and the data in each group is sorted respectively to obtain multiple sorted signal groups, and then the data in the sorted signal groups are sorted until all the data in the single parsed data file are sorted to obtain a sorted single file.

[0075] The step of dividing the data into a plurality of groups and sorting the data in each group to obtain a plurality of sorted signal groups comprises:

[0076] Two adjacent data are divided into a group, and one data belongs to a unique group; the two data in each group are sorted according to preset fields to obtain a sorted signal group; the preset field can be a time field or other fields.

[0077] Correspondingly, the step of sorting the data in the sorted signal group includes:

[0078] Two adjacent sorted signal groups are divided into one team, and one sorted signal group belongs to a unique team; the data in each team is sorted according to the preset field to obtain a sorted signal team.

[0079] Similarly, the method of using a merge sort algorithm to sort the data in the plurality of sorted single files to obtain a sorted data file includes:

[0080] The plurality of sorted single files are divided into a plurality of groups, the data in the sorted single files in each group are sorted respectively to obtain a plurality of sorted file groups, and then the data in the sorted file groups are sorted to obtain sorted data files.

[0081] In summary, the idea of ​​data sorting is: for the smallest split unit of the data, first sort the local smallest split unit, then merge the sorted local units, and finally get the sorted result.

[0082] For example, see Figure 4 The implementation diagram of the merge sort algorithm shown in the figure, first decompose the task (divide the sorted numbers into 2 groups), for example, the above 10, 6, 7, 1, 3, 9, 4, 2 is divided into 2 groups, namely 10, 6, 7, 1 and 3, 9, 4, 2. The task is further divided into 2 groups, 10, 6, 7, 1 is divided into 10, 6 and 7, 1; 3, 9, 4, 2 is divided into 3, 9 and 4, 2. Since 10, 6; 7, 1; 3, 9; 4, 2 cannot be further divided, the minimum split unit has been reached. At this time, sorting is performed, and the sorted numbers are 6, 10; 1, 7; 3, 9; 2, 4. Then merge and sort the minimum split units 6, 10 and 1, 7, and the merged sort is 1, 6, 7, 10. 3, 9 and 2, 4 are merged and sorted to 2, 3, 4, 9. Continue to merge sort 1, 6, 7, 10 and 2, 3, 4, 9 to get 1, 2, 3, 4, 6, 7, 9, 10.

[0083] In other words, the method of using a first number of sorting threads to use a merge sort algorithm to sort the data in each of the single parsed data files in parallel to obtain each sorted single file; and using a merge sort algorithm to sort the data in multiple sorted single files to obtain a sorted data file includes the following steps:

[0084] Step 1: Read the file content that needs to be sorted. You can read the file content in a stream manner, then convert the stream into binary, and finally convert it into a string text that technicians can understand.

[0085] Step 2: Sort the contents of each file. First, assign multiple data files of a car for one year to multiple threads for simultaneous execution. The number of threads = the number of CPU cores * the number of threads supported by each CPU core. The threads can be created using the functions provided by the system. Each thread is responsible for sorting the CAN signals parsed from each file, which can be quickly completed using the merge sort algorithm mentioned above.

[0086] Step 3: Merge and sort each file that has been sorted in step 2. Assume that there are 365 data files for a car in one year. The contents of each of these 365 files have been sorted above, so merge and sort these 365 files next. According to the number of threads and the total number of files supported by the system, the number of files that each thread needs to sort can be calculated. For example, if there are 300 files and the total number of threads supported by the system is 10, each thread needs to be responsible for sorting 30 files. Each thread reads the content of the file it is responsible for, reads the file content into the memory and stores it in the array queue of the system. Each file occupies an array. Then use the merge sort algorithm to sort multiple files. By sorting multiple files in the previous step, the sorted data is finally merged and stored in a large array queue, and the data in it is taken out one by one and written into a new file (the file name can be "vehicle ID + current date + self-incrementing sequence number"). When the size of a file reaches the set 40M or number of entries, the new data is written to the next file.

[0087] Exemplarily, the original data file stored in the preset disk space can be virtualized to the memory address space of the process through the underlying function of the computer system to obtain the memory file.

[0088] In some implementations, reading the data to be parsed from the original data file comprises the following steps:

[0089] It is implemented using the MappedByteBuffer class in Java. Its underlying layer is to call the mmap function of the Linux kernel to virtualize the original data file stored in the disk space to the memory address space of the process. Get the file channel, call the FileChannel.open function and assign it to the variable readChannel. The parameters in the function are the storage address of the file on the disk and the input is the read identifier of the file. Call readChannel.map(FileChannel.MapMode.READ_ONLY, 0, readChannel.size()) to get the MappedByteBuffer object and assign it to the mappedByteBuffer variable, where FileChannel.MapMode.READ_ONLY means reading the file identifier, 0 means reading the content in the file, and the position defaults to starting from the beginning. ReadChannel.size() indicates the length of the read, which defaults to the length of the entire file content. Use the get function in mappedByteBuffer to read the binary content stored in the file into a byte array.

[0090] Writing the parsed data to a file includes the following steps: Get the file channel, build a FileOutputStream object and pass in the file path parameter, and assign the object to fileOutputStream. Call the getChannel function according to the fileOutputStream object to get the FileChannel object and assign it to fileChannel; convert the data after the can signal is parsed into binary and store it in a byte array container named dataByte; call the wrap function in the ByteBuffer class to pass in dataByte to get a ByteBuffer object and save it in the variable buffer. Call the write method in the fileChannel object to pass in buffer. Call the close function in fileChannel to close the file channel.

[0091] The solution provided in this embodiment can greatly reduce the number of CPU cores when parsing the same data, and make full use of the CPU resources allocated to the thread by the system. The parsing efficiency and system performance are improved. By using a multi-threaded merge sorting algorithm, the sorting efficiency is improved, which is conducive to improving the user experience. Using the underlying functions of the computer operating system to virtualize the files stored in the disk into the memory address space of the process helps to quickly read the data in the original data file and export the parsed data to the file.

[0092] Figure 5It is a structural schematic diagram of a vehicle data processing device provided by an embodiment of the present invention, wherein a mapping module 310 of the device is used to virtualize an original data file stored in a preset disk space to a memory address space of a process to obtain a memory file; a processing module 320 is used to read the data to be parsed in parallel through a first number of parsing threads based on the memory file and parse the data to be parsed in parallel to obtain a parsed data file; wherein the first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of CPU cores of the computer system and the maximum number of threads supported by each CPU core.

[0093] The vehicle data processing device provided in the embodiment of the present disclosure can execute the steps in the vehicle data processing method provided in the method embodiment of the present disclosure, and the execution steps and beneficial effects are no longer repeated here.

[0094] Figure 6 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 6 , which shows a structural schematic diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure. Figure 6 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 disclosure.

[0095] like Figure 6 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes to implement the method of the embodiment described in the present disclosure according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 to the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0096] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart, thereby implementing the vehicle data processing method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0097] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, 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 may 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 or 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 disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0098] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: amends the preset SOC value according to the temperature of the battery cell and / or the service life of the battery to obtain a target SOC value; and controls the vehicle's range extender according to the target SOC value.

[0099] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0100] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or 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 foregoing.

[0101] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0102] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and its core ideas of this application. The above is only the preferred implementation method of this application. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of the present invention, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the inventive concept and technical solution to other occasions without improvement, should be regarded as the scope of protection of this application.

Claims

1. A method for processing vehicle data, It is characterized in that include: Virtualize the original data file stored in the preset disk space to the memory address space of the process to obtain a memory file, wherein the original data file contains the CAN signal reported by the vehicle to the cloud; Based on the memory file, the first number of parsing threads are used to read the data to be parsed in parallel and parse the data to be parsed in parallel to obtain a parsed data file; Wherein, the first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of central processing unit cores of the computer system and the maximum number of threads supported by each central processing unit core; There are multiple parsed data files for each vehicle, and each parsed data file includes multiple parsed data; The processing method further includes: using a first number of sorting threads to use a merge sort algorithm to sort the data in each single parsed data file in parallel to obtain each sorted single file; using a merge sort algorithm to sort the data in multiple sorted single files to obtain a sorted data file; The step of using a merge sort algorithm to sort the data in each of the parsed data files in parallel by using the first number of sorting threads to obtain each sorted single file includes: For each data in the single parsed data file, the data is divided into a plurality of groups, the data in each group is sorted respectively to obtain a plurality of sorted signal groups, and the data in the sorted signal groups are sorted again until all the data in the single parsed data file are sorted to obtain a sorted single file; The step of dividing the data into a plurality of groups and sorting the data in each group to obtain a plurality of sorted signal groups comprises: Divide two adjacent data into one group, and one data belongs to a unique group; Sort the two data in each group according to the preset fields to obtain a sorted signal group; Correspondingly, the step of sorting the data in the sorted signal group includes: Dividing two adjacent sorted signal groups into one team, wherein one sorted signal group belongs to only one team; The data in each team is sorted according to the preset fields to obtain a sorted signal team.

2. The vehicle data processing method according to claim 1, It is characterized in that The data to be parsed includes a CAN signal to be parsed; There are multiple original data files, and there are multiple corresponding memory files; The method of reading the data to be parsed in parallel through a first number of parsing threads based on the memory file and parsing the data to be parsed in parallel includes: Different parsing threads read the data to be parsed from different memory files in parallel and parse the data to be parsed in parallel.

3. The vehicle data processing method according to claim 1, It is characterized in that The method of using a merge sort algorithm to sort the data in the plurality of sorted single files to obtain a sorted data file comprises: The plurality of sorted single files are divided into a plurality of groups, the data in the sorted single files in each group are sorted respectively to obtain a plurality of sorted file groups, and then the data in the sorted file groups are sorted to obtain sorted data files.

4. The vehicle data processing method according to claim 1, It is characterized in that The method of virtualizing the original data file stored in the preset disk space to the memory address space of the process to obtain the memory file includes: The original data file stored in the preset disk space is virtualized to the memory address space of the process through the underlying function of the computer system to obtain the memory file.

5. A vehicle data processing device, It is characterized in that include: A mapping module is used to virtualize the original data file stored in the preset disk space to the memory address space of the process to obtain a memory file, wherein the original data file is the CAN signal reported by the vehicle to the cloud; A processing module, configured to read the data to be parsed in parallel through a first number of parsing threads based on the memory file and parse the data to be parsed in parallel to obtain a parsed data file; Wherein, the first number is determined according to the maximum number of threads supported by the computer system, and the maximum number of threads supported by the computer system is determined according to the number of central processing unit cores of the computer system and the maximum number of threads supported by each central processing unit core; There are multiple parsed data files for each vehicle, and each parsed data file includes multiple parsed data; Using a merge sort algorithm to sort the data in each single parsed data file in parallel by a first number of sorting threads to obtain each sorted single file; using a merge sort algorithm to sort the data in multiple sorted single files to obtain a sorted data file; using a merge sort algorithm to sort the data in each single parsed data file in parallel by a first number of sorting threads to obtain each sorted single file, includes: For each data in the single parsed data file, the data is divided into a plurality of groups, the data in each group is sorted respectively to obtain a plurality of sorted signal groups, and the data in the sorted signal groups are sorted again until all the data in the single parsed data file are sorted to obtain a sorted single file; The step of dividing the data into a plurality of groups and sorting the data in each group to obtain a plurality of sorted signal groups comprises: Divide two adjacent data into one group, and one data belongs to a unique group; Sort the two data in each group according to the preset fields to obtain a sorted signal group; Correspondingly, the step of sorting the data in the sorted signal group includes: Dividing two adjacent sorted signal groups into one team, wherein one sorted signal group belongs to only one team; The data in each team is sorted according to the preset fields to obtain a sorted signal team.

6. An electronic device, It is characterized in that The electronic device comprises: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the vehicle data processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the vehicle data processing method according to any one of claims 1 to 4 is implemented.