Vehicle data processing method, device, equipment, storage medium and program product
Patent Information
- Application Number
- CN202611172628.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]但是,在4G/5G网络切换、隧道场景和地下停车场等复杂的网络环境下,由于网络传输延迟的不确定性,导致数据包的存储顺序紊乱,进而会导致后续车辆数据的分析的效率低下
[0016]第五方面,本申请提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序产品中的指令由电子设备的处理器执行时,使得所述电子设备执行如本申请第一方面所述的车辆数据的处理方法。
Smart Images

Figure CN122985784A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a method, apparatus, device, storage medium, and program product for processing vehicle data. Background Technology
[0002] With the rapid development of vehicle-to-everything (V2X) technology, the amount of data generated by vehicles is growing explosively. These different types of vehicle data need to be uploaded to the cloud in real time for storage and analysis to support services such as remote vehicle monitoring, fault diagnosis, and driving behavior analysis.
[0003] However, in complex network environments such as 4G / 5G network switching, tunnel scenarios, and underground parking lots, the uncertainty of network transmission latency leads to disordered data packet storage order, resulting in low efficiency in subsequent vehicle data analysis. Therefore, it is urgent to solve the problem of low data analysis efficiency caused by disordered vehicle data storage order. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of related technologies, this application provides a method, apparatus, device, storage medium and program product for processing vehicle data, which effectively solves the problem of disordered storage order of vehicle data, thereby improving data analysis efficiency.
[0005] In a first aspect, this application provides a method for processing vehicle data, the method comprising: In response to a data storage request for a first time window, a target time slot array associated with the first time window is constructed, wherein the first time window is a preset time window with data analysis requirements, and the data storage request is used to request vehicle data stored in the first time window for data analysis. Based on the target time slot array, a storage operation is performed on the first vehicle data collected within the first time window, wherein the storage operation includes: The first vehicle data is encoded to obtain a target encoding result. The target encoding result is used for data analysis related to the first vehicle data, where the first vehicle data is any vehicle data collected within the first time window. Based on the first sampling timestamp of the first vehicle data, the target time slot position information corresponding to the target encoding result is determined, and the target time slot position information is used to indicate the target time slot position in the target time slot array; Based on the target time slot location information, a storage operation is performed on the target encoding result at the target time slot location.
[0006] In an optional implementation, determining the target time slot location information corresponding to the target encoding result based on the first sampling timestamp of the first vehicle data includes: The relative time offset is determined based on the first sampling timestamp and the window reference time of the first time window; The time slot offset is determined based on the relative time offset and the sampling time granularity, wherein the sampling time granularity is the interval between adjacent sampling timestamps within the first time window; The target time slot position information is determined based on the time slot offset and the length of the target time slot array.
[0007] In an optional implementation, the step of performing a storage operation on the target encoding result at the target time slot location based on the target time slot location information includes: Based on the target time slot location information, read the original encoding result of the target time slot location; Based on the target encoding result and the original encoding result, determine the encoding result to be stored; Based on the target time slot location information, the encoding result to be stored is written to the target time slot location.
[0008] In an optional implementation, determining the encoding result to be stored based on the target encoding result and the original encoding result includes any one of the following: Replace the original encoding result with the target encoding result as the encoding result to be stored; Perform an OR operation on the target encoding result and the original encoding result to obtain the encoding result to be stored; Based on the priority of the target encoding result and the priority of the original encoding result, the encoding result to be stored is determined from the target encoding result and the original encoding result.
[0009] In an optional implementation, the target time slot location information includes a target array index and a target bit offset. The step of writing the encoding result to be stored to the target time slot location according to the target time slot location information includes: The position of the target time slot in the target time slot array is determined based on the target array index; The target timing slot position is cleared according to the clear mask corresponding to the target bit offset; Based on the target bit offset, the encoding result to be stored is written into the target timing slot position after clearing.
[0010] In an optional implementation, after constructing the target time slot array associated with the first time window in response to a data storage request for the first time window, the method further includes: In response to the acquisition of second vehicle data, if the second sampling timestamp of the second vehicle data is before the first time window, the second vehicle data is discarded, or the second vehicle data is cached in a storage space other than the target time slot array. In response to the acquisition of third vehicle data, if the third sampling timestamp of the third vehicle data is located after the first time window, the first time window is slid to obtain a second time window, and the second time window is associated with the target time slot array. The second time window is a time window that includes the third sampling timestamp, and the target time slot array is used to re-perform storage operations on the third vehicle data sampled within the second time window.
[0011] In an optional implementation, encoding the first vehicle data to obtain the target encoding result includes: Based on the first vehicle data, determine the target data status corresponding to the first sampling timestamp; Based on the target data status, the first vehicle data is bit encoded to obtain a target bit encoded value corresponding to the first sampling timestamp, wherein the target encoding result includes the target bit encoded value, and the target bit encoded value is used to indicate the target data status.
[0012] In an optional implementation, the target data status includes any one of data missing, abnormal status, normal status, and suspicious data.
[0013] Secondly, this application provides a vehicle data processing apparatus, the apparatus comprising: An array construction module is used to construct a target time slot array associated with the first time window in response to a data storage request for the first time window, wherein the first time window is a preset time window with data analysis requirements, and the data storage request is used to request vehicle data stored in the first time window for data analysis. The storage operation module is used to perform a storage operation on the first vehicle data collected within the first time window according to the target time slot array, wherein the storage operation includes: The first vehicle data is encoded to obtain a target encoding result. The target encoding result is used for data analysis related to the first vehicle data, where the first vehicle data is any vehicle data collected within the first time window. Based on the first sampling timestamp of the first vehicle data, the target time slot position information corresponding to the target encoding result is determined, and the target time slot position information is used to indicate the target time slot position in the target time slot array; Based on the target time slot location information, a storage operation is performed on the target encoding result at the target time slot location.
[0014] Thirdly, this application provides a vehicle data processing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle data processing method as described in the first aspect of this application.
[0015] Fourthly, this application 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 in the first aspect of this application.
[0016] Fifthly, this application provides a computer program product comprising a computer program, wherein the instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the vehicle data processing method as described in the first aspect of this application.
[0017] The vehicle data processing method, apparatus, device, storage medium, and program product provided in this application, in response to a data storage request for a first time window, constructs a target time slot array associated with the first time window; and performs a storage operation on the first vehicle data collected within the first time window according to the target time slot array. The storage operation includes: encoding the first vehicle data to obtain a target encoding result; determining the time slot position information corresponding to the target encoding result based on the first sampling timestamp of the first vehicle data; and performing a storage operation on the target encoding result at the target time slot position according to the target time slot position information. Data storage based on a time slot array structure means that data memory usage depends only on the time window size and time sampling granularity, and is independent of data flow rate and out-of-order rate, supporting precise resource planning and capacity management, making it suitable for large-scale vehicle network deployments. Simultaneously, by directly mapping the sampling timestamp to the storage location, out-of-order data is directly overwritten or merged without the need for searching, comparing, and sorting, effectively improving storage efficiency and data analysis efficiency, and meeting the latency requirements of real-time monitoring in vehicle networks. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a first schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 2 This is a second schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 3 This is a third schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 4 This is the fourth schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 5 This is the fifth schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 6 This is the sixth schematic diagram of the vehicle data processing method provided in the embodiments of this application; Figure 7 This is a schematic diagram of the vehicle data processing device provided in the embodiments of this application; Figure 8 This is a schematic diagram of the structure of a vehicle data processing device provided in an embodiment of this application.
[0020] Explanation of key component symbols: 700. Vehicle data processing device; 710. Array construction module; 720. Storage operation module; 800. Vehicle data processing equipment; 810. Processor; 820. Communication interface; 830. Memory; 840. Communication bus. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be further described clearly and completely below with reference to the accompanying drawings of the embodiments. It should be noted that the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0022] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0024] Currently, in complex network environments, due to the uncertainty of network transmission latency, vehicle data arrives out of order. Traditional methods of storing data in the order of arrival lead to distortion of time-series analysis results. If a cache queue is used to sort the data before writing it to storage, the introduced overhead will cause significant memory pressure. Furthermore, vehicle status signals typically only need to express a limited set of states (e.g., normal, abnormal, and missing), but traditional solutions use complete data structures such as JSON objects for storage, resulting in wasted storage space and low storage efficiency. These limitations in vehicle data storage further contribute to the problem of low data analysis efficiency.
[0025] To address the technical problems in related technologies, this application provides a method for processing vehicle data, effectively solving the problem of low efficiency in vehicle data analysis by improving storage efficiency. This vehicle data processing method can be applied to vehicle data processing equipment, which can be a vehicle or electronic equipment, such as an in-vehicle terminal, user terminal, or server. Figure 1 As shown, the method specifically includes steps S110-S120.
[0026] S110. In response to a data storage request for the first time window, construct a target time slot array associated with the first time window.
[0027] In this embodiment, the first time window is a preset time window with data analysis requirements. This first time window includes at least parameters such as window size, window base time, and window end time, where the window size is the total duration covered by the time window, and the window base time is the start time of the time window. t_base The window end time is the time of the latest data in the time window. t_latest The time window boundaries can be implicitly managed using two time pointers; the effective data range of the time window is... [t_base, t_latest ].
[0028] For example, if a user needs to analyze vehicle data from 12:00 to 13:00 to determine the vehicle's battery status, a preset time window can be set as the first time window within the time range of 12:00 to 13:00. For example, if the window base time is set to 12:00:00 and the window size is 60 minutes, then the first time window is [12:00:00, 13:00:00].
[0029] It is understandable that data analysis requirements refer to the goal and requirement of systematically analyzing vehicle data generated from vehicle operation, user behavior, and system status to support services such as remote vehicle monitoring, fault diagnosis, and driving behavior analysis. Different data analysis requirements necessitate the analysis of different vehicle data, thus requiring different data storage requests. In this embodiment, the data storage request is used to request vehicle data stored within a first time window for data analysis. For example, if a user's data analysis requirement is to analyze the vehicle status from 12:00 to 13:00, then they need to request vehicle status data such as vehicle speed, engine speed, and battery level stored within the first time window as the vehicle data for vehicle status data analysis.
[0030] Furthermore, a target time-series slot array associated with the first time window can be constructed based on the parameters of the first time window. This target time-series slot array is used to store the time-series state data of a single vehicle and a single type of vehicle. Based on the first time window, the continuous time axis is discretized into time-series slots of fixed granularity. Each time-series slot is the smallest unit used to store the state of vehicle data at a single point in time. That is, the continuous time axis is divided into time-series slots of equal length, for example, one time-series slot per second. Each time-series slot corresponds to a specific storage location. Regardless of the order in which the vehicle data arrives, vehicle data with the same sampling timestamp are always mapped to the same location.
[0031] In one optional implementation, the target time-series slot array may include a metadata area and a storage data area. The metadata area stores management parameters, including but not limited to vehicle identifier, signal identifier, window size, window reference time, window end time, sampling time granularity, total number of time-series slots, time-series slot array length, write count, and version number. This metadata area provides all the parameters required to manage the target time-series slot array, supporting dynamic configuration and monitoring statistics.
[0032] The storage data area is used to store the target encoding results corresponding to the actual vehicle data. These target encoding results can be used for data analysis related to vehicle data, such as time series analysis of vehicle driving status or time series analysis of vehicle battery status.
[0033] Optionally, the storage data area can be a circular bit array comprising multiple timing slots. The total number of timing slots is determined by the window size of the first time window and the sampling time granularity, where the sampling time granularity is the interval between adjacent sampling timestamps within the first time window. The array length of the target timing slot array can be determined based on the total number of timing slots and the number of bits in the target encoding result. Each target encoding result is stored using target bit integers, eliminating memory alignment and object header overhead. All elements of the constructed target timing slot array are initialized to 0.
[0034] The target integer can be a 32-bit integer or a 64-bit integer, etc. For example, if the target encoding result is 2 bits, a 32-bit integer can store 16 target encoding results, and a 64-bit integer can store 32 target encoding results.
[0035] In this embodiment of the application, the management parameters of the metadata area can be used to calculate the storage location of any sampling timestamp in the storage data area. The mapping from time slot to array index can be established through time-series mapping calculation, so as to realize the cooperation between time slot and array element.
[0036] Optionally, a circular buffer controller can be set in the storage data area to control the read / write pointers and circular multiplexing of the circular bit group.
[0037] Optionally, there can be one or more target time-series slot arrays. A time-series slot array manager can be configured to manage multiple time-series slot arrays, providing interfaces for creation, destruction, and querying. A two-level time-series slot architecture can also be configured. The first-level target time-series slot array stores recent high-frequency data, such as the data from the last hour, with a sampling time granularity of 1 second. The second-level target time-series slot array stores historical low-frequency data, such as the data from the last 7 days, with an aggregated sampling time granularity of 1 minute, thus supporting data storage over a longer time range.
[0038] In this embodiment, the memory usage of the target time slot array depends only on the window size and sampling time granularity of the first time window, and is unrelated to the data flow rate and out-of-order rate. The target time slot array is a fixed-size contiguous memory block, and no memory allocation is performed after initialization. The circular reuse mechanism achieves data coverage through pointer advancement, without the need for expansion, supports precise resource planning and capacity management, and is suitable for large-scale vehicle network deployment.
[0039] S120. Based on the target time slot array, perform a storage operation on the first vehicle data collected within the first time window. The storage operation includes: encoding the first vehicle data to obtain a target encoding result; determining the time slot position information corresponding to the target encoding result based on the first sampling timestamp of the first vehicle data; and performing a storage operation on the target encoding result at the target time slot position based on the target time slot position information.
[0040] In this embodiment, the first vehicle data refers to any vehicle data collected within a first time window, including but not limited to vehicle speed, engine speed, and battery charge. The first vehicle data can be encoded to obtain target encoding results. The target encoding results corresponding to each vehicle data are stored through a target time slot array, and these target encoding results can be directly used for data analysis related to the first vehicle data.
[0041] It is understandable that each piece of first vehicle data has a corresponding first sampling timestamp, which represents the logical time of data sampling for the first vehicle data. Since the first vehicle data is collected within the first time window, i.e., the first sampling timestamp is within the first time window range, timing mapping based on the first sampling timestamp can obtain the target timing slot position information corresponding to the target encoding result of the first vehicle data. This target timing slot position information is used to indicate the target timing slot position in the target timing slot array.
[0042] Furthermore, based on the aforementioned target time slot position information, the corresponding target time slot position can be determined. This target time slot position is the integer position of the target bit in the target time slot array used to store the corresponding target encoding result. Using the target time slot position information, a storage operation can be performed on the target encoding result at the target time slot position, thereby storing the target encoding result corresponding to each first vehicle data into the target time slot array.
[0043] Based on this, encoding vehicle data effectively improves storage density, avoids object header overhead, and stores only the target encoded result corresponding to the vehicle data, rather than storing the original value. The sampling timestamp is implicitly expressed through array indexes, eliminating the need for explicit storage, thus reducing storage costs and network transmission bandwidth. Furthermore, the elimination of search, comparison, and sorting effectively improves storage and data analysis efficiency, meeting the latency requirements of real-time vehicle network monitoring.
[0044] In some implementations, a window manager can be configured to handle window boundary checks and maintain the boundaries of the time window, ensuring that the target encoding results of vehicle data are stored within the correct time window range. For example... Figure 2 As shown, after step S110, the method further includes step S210 and / or step S220.
[0045] S210. In response to obtaining the second vehicle data, if the second sampling timestamp of the second vehicle data is before the first time window, then the second vehicle data is discarded, or the second vehicle data is cached in a storage space other than the target time slot array.
[0046] It is understandable that the second vehicle data is similar to the first vehicle data, belonging to newly arrived vehicle data. If the second sampling timestamp of the second vehicle data is before the first time window, that is, the second sampling timestamp is less than the window base time of the first time window, it means that the second vehicle data has expired. At this time, the second vehicle data is discarded, or the second vehicle data is cached in the storage space other than the target time slot array for offline processing.
[0047] S220. In response to obtaining the third vehicle data, if the third sampling timestamp of the third vehicle data is after the first time window, the first time window is slid to obtain the second time window, and the second time window is associated with the target time slot array.
[0048] In this embodiment, the third vehicle data is similar to the first vehicle data, belonging to newly arrived vehicle data. If the third sampling timestamp of the third vehicle data is located after the first time window, that is, the third sampling timestamp is greater than or equal to the sum of the window reference time and the window size of the first time window, it means that the third sampling timestamp of the third vehicle data has exceeded the current first time window. At this time, it is necessary to slide the first time window towards the latest time direction to obtain the second time window.
[0049] The second time window includes the third sampling timestamp. By using the latest third sampling timestamp, the sliding amount of the first time window can be calculated and the window base time updated, thus obtaining the various parameters of the second time window, as follows: First, the slippage is calculated. This slippage can be set as the excess of the third sampling timestamp relative to the end time of the first time window, plus a sampling time granularity. This ensures that new third vehicle data is written to the target time slot array. The formula for calculating the slippage is as follows:
[0050] In the above formula, Indicates the amount of slip. Indicates the third sampling timestamp. This indicates the window reference time for the first time window. This indicates the window size for the first time window. This indicates the sampling time granularity, which is the interval between adjacent sampling timestamps within the first time window.
[0051] Then update the base time. The formula for calculating the updated window base time is as follows:
[0052] In the above formula, This indicates the updated window base time.
[0053] Understandably, the first time window slides a corresponding amount towards the latest time to obtain a second time window that includes the updated window reference time. The oldest first vehicle data is moved out of the second time window, meaning that some of the first vehicle data in the first time window becomes expired data. Simultaneously, the target time slot array is used to re-perform storage operations on the third vehicle data sampled within the second time window. The target encoding result of the new third vehicle data can be stored in the location of the expired data, thus achieving circular reuse of the target time slot array.
[0054] As an optional implementation, expired time slots in the target time slot array can also be marked, for example, by marking expired time slots as code 00 or keeping them to be overwritten.
[0055] Based on this, the effective data range is determined by the window reference time and the latest sampling timestamp. When new vehicle data exceeds the time range of the current time window, the window reference time is updated and the time window is cyclically reused and overwritten by the latest data, achieving fixed memory usage that is independent of data flow rate and out-of-order rate. This avoids dynamic memory allocation and release operations, supports precise planning and capacity management of storage resources, and is suitable for high-frequency writing scenarios of vehicle data.
[0056] In some implementations, bit encoding can be used to encode the first vehicle data, such as... Figure 3 As shown, encoding the first vehicle data to obtain the target encoding result includes steps S310 to S320.
[0057] S310. Based on the first vehicle data, determine the target data status corresponding to the first sampling timestamp.
[0058] In this embodiment of the application, the target data status is used to indicate the data arrival status and numerical logic status of the first vehicle data obtained by sampling the first sampling timestamp. The target data status may include any one of data missing, abnormal status, normal status, and suspicious data.
[0059] Among them, missing data indicates that no vehicle data was collected, corresponding to scenarios such as communication interruption or packet loss; abnormal status indicates that vehicle data arrived but is invalid, such as initial values or invalid values; normal status indicates that vehicle data arrived but the logic is false, such as normal reporting but no alarm; suspicious data indicates that vehicle data arrived but the logic is true, such as normal reporting and an alarm.
[0060] Based on this, the above four types of target data states cover all possible situations of vehicle data states. By determining the target data states of each sampling timestamp, a reliable basis is provided for the subsequent encoding of vehicle data.
[0061] S320. Based on the target data status, perform bit encoding on the first vehicle data to obtain the target bit encoding value corresponding to the first sampling timestamp.
[0062] As an optional implementation, the target data state corresponding to the first sampling timestamp of each first vehicle data can be encoded using a two-bit four-state encoding to obtain a target bit encoding value, which serves as the target encoding result. This target bit encoding value uses two bits to indicate the target data state, specifically including four encoding values: 00, 01, 10, and 11, corresponding to four target data states: missing data, abnormal state, normal state, and suspicious data, respectively.
[0063] Specifically, the first vehicle data may include various types, such as numerical, Boolean, and enumerated types. Numerical vehicle data represents quantitative indicators of the vehicle using continuous or discrete values, such as vehicle speed, engine speed, coolant temperature, cumulative mileage, and remaining battery charge percentage. Boolean vehicle data takes values of "true / false," "yes / no," or "0 / 1," used to represent binary states or conditional triggers, such as door lock status, brake pedal engagement, engine malfunction indicator light illumination, automatic headlight activation, and rapid acceleration indicators. Enumerated vehicle data takes values from a predefined finite set of discrete values to identify categories, modes, or operating states, such as gear position, driving mode, fuel type, and tire position. Therefore, the encoder can be configured to perform target data state confirmation and bit encoding for different types of first vehicle data according to a pre-configured encoding rule engine, obtaining the target bit encoded value.
[0064] For example, for numerical vehicle data, numerical threshold rules can be set. For continuous variables such as battery level and vehicle speed, they can be discretized into multiple target data states based on preset thresholds. For example, a battery level >20% indicates a normal state, and a battery level ≤20% indicates an abnormal state. For Boolean vehicle data, Boolean mapping rules can be set to determine the target data state based on the Boolean value and directly map it to 01 or 10. For example, whether the brake pedal is pressed: if the Boolean value is yes (i.e., the brake is pressed), it is mapped to 01; if the Boolean value is no (i.e., the brake is not pressed), it is mapped to 10. For enumerated vehicle data, quality marking rules can be set to override the encoding based on the data quality mark. When the data source determines that the current enumerated value is unreliable (e.g., sensor failure, communication interruption, verification error, or undefined state), the encoder ignores the original enumeration mapping and forces the output to be overridden to 11.
[0065] Optionally, the decoder can be configured to perform reverse operations. This decoder maintains a lookup table that is completely symmetrical to the encoding rules. Upon receiving a 2-bit target bit encoding value, it decodes the target bit encoding value into information such as data quality or alarm service status through the lookup table.
[0066] Optionally, bit encoding can also employ three-bit six-state encoding, using three bits to represent six target data states. This supports finer-grained state classification, enhances expressive power, and is suitable for business scenarios requiring more precise state hierarchies. Furthermore, other bit encoding methods can be selected based on the specific application scenario.
[0067] Based on this, the target data status of the first vehicle data is directly encoded as a target bit-coded value, rather than storing the original value. For example, the vehicle data "battery level 85.5%" would require 4 bytes of floating-point data if stored using traditional floating-point methods, but by using bit encoding to convert it to "10" to represent a normal status, only 2 bits are needed. Compared to directly storing and transmitting the original data, this greatly saves storage space, reduces network transmission bandwidth, and provides clear state semantics, supporting direct mapping of business state logic.
[0068] In some embodiments, a time slot mapper can perform time mapping calculations based on a first sampling timestamp and management parameters in the target time slot array to obtain the target time slot location information. This time slot mapper acts as a bridge connecting logical time (i.e., the sampling timestamp) and physical storage (e.g., array index and bit offset), mapping any sampling timestamp to a unique storage location through a series of mathematical calculations. Figure 4 As shown, the target time slot position information corresponding to the target encoding result is determined based on the first sampling timestamp of the first vehicle data, specifically including steps S410 to S430.
[0069] S410. Determine the relative time offset based on the first sampling timestamp and the window reference time of the first time window.
[0070] As can be understood, relative time offset represents the time offset of the sampling timestamp relative to the window reference time of the first time window. The absolute sampling timestamp is converted into an offset relative to the window reference time. The formula for calculating relative time offset is as follows:
[0071] In the above formula, Indicates relative time offset. Indicates the first sampling timestamp. This indicates the window base time for the first time window.
[0072] S420. Determine the time slot offset based on the relative time offset and the sampling time granularity. The sampling time granularity is the interval between adjacent sampling timestamps within the first time window.
[0073] In this embodiment, the time slot offset is used to represent the linear index of the time slot, which can start from 0, thereby converting the time offset into a time slot index. The calculation formula for the time slot offset is as follows:
[0074] In the above formula, Indicates timing slot offset, Indicates the sampling time granularity.
[0075] S430. Determine the target time slot position information based on the time slot offset and the length of the target time slot array.
[0076] It should be noted that the length of the target time slot array is determined by the total number of time slots and the target integer. For example, to store a 2-bit target encoding result for a 32-bit integer, 16 states can be stored, meaning the target slot length is 16. Therefore, the length of the time slot array is... M = N ÷16, where N This represents the total number of time slots. Since time slots are obtained by discretizing the continuous time series of the first time window according to the same sampling time granularity, the total number of time slots is... N=window_size ÷ granularity ,in window_size This indicates the window size for the first time window.
[0077] In this embodiment, the target time slot location information may include a target array index and a target bit offset. The target array index is used to implicitly represent the sampling timestamp, mapping the linear time slot index to the physical location of the target time slot array. For example, it can be 0 to...M -1 indicates that the target array index is calculated as follows:
[0078] In the above formula, This represents the index of the target array, / / represents integer division, and % represents the modulo operation. w Indicates the number of target slots in the target integer. This indicates the length of the timing slot array.
[0079] Based on this, the modulo operation naturally ensures that the index value of the target array is always within the valid range, and array out-of-bounds errors will not occur.
[0080] The target bit offset is used to determine the specific position of the target encoded result within the target bit integer of the timing slot. For example, it can be represented by 0, 2, 4, ..., 30 within a 32-bit integer. The formula for calculating the target bit offset is as follows:
[0081] In the above formula, This indicates the target bit offset, and % indicates the modulo operation. w Indicates the number of target slots in the target integer. n This indicates the number of bits in the target encoding result, for example, a target encoding result of 2 bits. n Take 2.
[0082] Based on this, the target time slot location information can be determined through time-series mapping calculations, providing an accurate target storage location for subsequent data storage. This target storage location is uniquely determined by each mapping calculation formula, eliminating the need for searching and sorting. Moreover, the entire calculation process involves only integer operations and can be completed in constant time, effectively improving storage efficiency. It supports data analysis and processing operations such as rapid refresh of real-time monitoring panels, rapid data acquisition by anomaly detection algorithms, and efficient backtracking analysis of historical data.
[0083] In some implementations, a bitwise merger can be used to perform a merge and storage operation on the target encoding results based on bitwise operations, thereby achieving sequential storage of the target encoding results corresponding to out-of-order vehicle data. For example... Figure 5 As shown, based on the target time slot location information, a storage operation is performed on the target encoding result at the target time slot location, specifically including steps S510 to S530.
[0084] S510. Based on the target timing slot position information, read the original encoding result of the target timing slot position.
[0085] In this embodiment, a bitmask can be used to quickly read the 2-bit original encoding result at the target time slot position based on the target array index and the target bit offset. This original encoding result can be the initialized time slot array encoding, the target encoding result corresponding to expired vehicle data, or the marker encoding of the expired time slot. The specific reading of the original encoding result is as follows:
[0086] In the above formula, This represents the original encoding result. This means shifting the integer corresponding to the target index in the target array to the right by the target bit offset, so that the target position is moved to the least significant bit. & represents a AND operation, 0 x 3 represents a constant, which is hexadecimal and corresponds to binary 11. By performing a bitwise AND operation between the encoded result at the target position and binary 11, the high-order bits are masked and the lowest two bits are retained to obtain the original encoded result.
[0087] Understandably, if the target time slot position information is obtained based on the first sampling timestamp of the first vehicle data in the first time window, the original encoding result is the initialized time slot array encoding, i.e., all original encoding results are 00. If the target time slot position information is obtained based on the third sampling timestamp of the third vehicle data in the second time window, or based on the sampling timestamps of vehicle data obtained in subsequent sliding time windows, the original encoding result is the target encoding result corresponding to expired vehicle data, or the marker encoding of expired time slots.
[0088] Based on this, the original encoded result can be read with a single instruction, without the need to parse complex data structures.
[0089] S520. Determine the encoding result to be stored based on the target encoding result and the original encoding result.
[0090] In this embodiment, various bit-level merging strategies can be defined to determine the encoding result to be stored based on the target encoding result and the original encoding result. These bit-level merging strategies include, but are not limited to, overlay strategies, OR operation strategies, and priority strategies, which can be selected according to the actual application scenario.
[0091] S530. Write the encoding result to be stored to the target time slot position according to the target time slot position information.
[0092] In this embodiment, the target timing slot position can be determined based on the target array index and the target bit offset, and the encoding result to be stored can be written to the target timing slot position through bit operations. This is a lock-free atomic operation and does not require thread synchronization overhead.
[0093] Based on this, when out-of-order vehicle data arrives, the original encoding result in the target time slot array can be directly read through bit operations. The merging strategy is then executed to determine the encoding result to be stored and written to the target time slot array. No data movement or structural adjustment is required. The merging operation is entirely based on bit operations, making full use of the CPU's parallel bit processing capabilities. It supports high-concurrency CPU instruction writing of data, and the operation latency is stabilized within a very short time, effectively improving the efficiency of data storage.
[0094] In some implementations, the encoding result to be stored can be determined based on the target encoding result and the original encoding result according to the configured bit-level merging strategy. The bit-level merging strategy includes any one of the following: overlay strategy, operation strategy, and priority strategy.
[0095] The overlay strategy replaces the original encoding result with the target encoding result as the encoding result to be stored. final_code = new_code ,in final_code This indicates the encoding result to be stored. new_code This represents the target encoding result.
[0096] The OR operation strategy performs an OR operation on the target encoding result and the original encoding result to obtain the encoding result to be stored, i.e., f. inal_code = old_code | new_code ,in final_code This indicates the encoding result to be stored. old_code This represents the original encoding result. new_code This represents the target encoding result.
[0097] The priority strategy determines the encoding result to be stored based on the priority of the target encoding result and the priority of the original encoding result. This can be achieved by using a lookup table to select the higher priority state. The priority order of states is: Abnormal State > Suspicious Data > Normal State > Missing Data. Specifically, 01 in the target encoding result takes precedence over 11, which in turn takes precedence over 10, which takes precedence over 00. For example, if the target encoding result is 01 and the original encoding result is 11, then the encoding result to be stored is the target encoding result, i.e., 01. Similarly, if the target encoding result is 00 and the original encoding result is 10, then the encoding result to be stored is the original encoding result, i.e., 10.
[0098] Based on this, a flexible bit-level merging strategy can be selected according to the business scenario of vehicle data analysis. The overlay strategy is used to refresh the status in real time, ensuring the latest value takes effect; or the calculation strategy can accumulate multiple alarm flags to avoid information loss; the priority strategy ensures that the highest-risk status is not overwritten by lower-level ones. In the event of data fusion storage and multi-source conflicts, key status information can be retained, improving the robustness of subsequent data analysis and the accuracy of real-time response.
[0099] In some implementations, the write operation can be performed on the encoded result to be stored by clearing the mask to zero and performing an OR operation. For example... Figure 6 As shown, the encoding result to be stored is written to the target time slot position according to the target time slot position information, specifically including steps S610 to S630.
[0100] S610. Determine the position of the target timing slot in the target timing slot array based on the target array index.
[0101] It is understandable that the target time slot position can be directly located based on the target data index, and the integer bit array of the target time slot position is... Array [ array_index ].
[0102] S620. Clear the target timing slot position according to the clear mask corresponding to the target bit offset.
[0103] In this embodiment, a zeroing mask can be constructed based on the target bit offset as follows:
[0104] In the above formula, mask This represents the zeroing mask, 0. x 3 represents a constant, in hexadecimal. Indicates a left shift operation. This indicates the target offset.
[0105] It should be noted that the binary representation of 0x3 is 00000011. After shifting the target bit left, the two 1s are exactly located in the bits that need to be cleared (i.e., the first bit). bit_offset Position and bit_offset +1 bit). After inverting, only these two bits become 0, and all other bits become 1. This mask is used to clear the target two bits at the target timing slot position without affecting the other bits.
[0106] The following bitwise operations are used to clear the target timing slot position:
[0107] In the above formula, by performing a bitwise AND operation between the integer bit array of the target timing slot position and the clear mask, since the clear mask is 0 in the two target bits, these two target bits are forced to be 0 after the AND operation, while the other bits remain unchanged because the mask is 1, thus clearing the original encoding result.
[0108] S630. Based on the target bit offset, write the encoding result to be stored into the target timing slot position after clearing.
[0109] In this embodiment of the application, the operation of writing the encoded result to be stored is as follows:
[0110] First, the encoded result to be stored is... final_code Left shift target offset bit_offset The bits are aligned to the target timing slot position. Then, a bitwise OR operation is performed with the integer bit array Array[array_index] of the target timing slot position. Since the two target bits were cleared in the previous step, the OR operation will only write the new value and will not interfere with other bits.
[0111] Based on this, the encoding result of the target time slot position is safely updated by clearing and setting bits, without destroying the values of other adjacent encoding results in the same integer bit. The target encoding results of the same time slot are naturally mapped to the same position, and out-of-order data is directly overwritten or merged. The increase in the out-of-order rate does not affect the processing latency, meeting the latency requirements of real-time monitoring of vehicle networks and supporting high-frequency data stream processing.
[0112] As an exemplary implementation in this application, a consistent hash router can be configured to route vehicle data to the corresponding storage node based on the vehicle ID, thereby routing data for the same vehicle to the same processing thread and avoiding multiple threads competing for the same vehicle data. Horizontal scaling can be achieved by adding more processing nodes. Each storage node is configured with a storage node manager to manage the registration, discovery, and load balancing of storage nodes.
[0113] Optionally, each storage node can also use the target time-series slot array as the underlying storage, but build a skip list index on it to accelerate range queries, thereby improving range query performance.
[0114] Based on this, by storing the target encoding results of vehicle data from different vehicles in independent target time slot arrays, the vehicle data from different vehicles is physically isolated while having linear scalability. Adding storage nodes can support more vehicles. The lock-free design avoids thread context switching overhead, is suitable for multi-core CPU architectures, and makes full use of hardware resources.
[0115] As another exemplary implementation in this application, a structure table for the target time slot array can be pre-set, thereby quickly constructing the target time slot array after determining the first time window. The metadata area contains 11 fields, totaling 108 bytes, and the management parameter structure of the metadata area is shown in Table 1 below.
[0116] Table 1. Schematic diagram of the management parameter structure of the metadata area in the target time slot array.
[0117] In the table above, the vehicle identifier uses a 32-byte string to uniquely identify the vehicle; the signal identifier uses a 32-byte string to uniquely identify the signal; the window reference time uses a 64-bit integer to identify the window start time; the window end time uses a 64-bit integer to identify the latest data time; the sampling time granularity uses a 32-bit integer to identify the time interval between adjacent sampling points; the window size uses a 32-bit integer to identify the total duration of the time window; the total number of timing slots uses a 32-bit integer, determined by the window size and the sampling time granularity; the timing slot array length uses a 32-bit integer, determined by the total number of timing slots and the target integer bits used in the circular bit array; the write count uses a 64-bit integer to count the number of writes; and the version number uses a 32-bit integer for concurrency control.
[0118] The circular bit array in the data storage area uses 32-bit integers to store the encoding results of each target. The structure of the circular bit array is shown in Table 2 below.
[0119] Table 2. Schematic diagram of the structure of the circular bit array in the target timing slot array
[0120] Each 32-bit integer stores 16 double-bit target encoding results. The bit layout of a certain 32-bit integer is shown in Table 3 below.
[0121] Table 3. Schematic diagram of the bit layout of a 32-bit integer.
[0122] For example, if the sampling time granularity granularity =100ms, length of timing slot array M= If the value is 100, then the mapping relationship between the timing slot and the array index is shown in Table 4 below.
[0123] Table 4. Schematic diagram of the mapping relationship between timing slots and array indices
[0124] As another exemplary implementation in this application, the circular bit array is constructed and initialized according to the first time window as follows: First, the window manager allocates the window base time. t_base When the system starts, the window base time t_base Get the current time, such as the system timestamp.
[0125] Then calculate the total number of timing slots. total_slots =Window size window_size ÷Sampling time granularity granularity For example, if the window size is 100s and the sampling time granularity is 1s, then the total number of time slots is...total_slots It is 100.
[0126] Simultaneously calculate the slot index where the first data packet falls. slot_index = floor (( t_first - t_base ) ÷ granularity ),in t_first This represents the sampling timestamp of the first data packet, due to the window base time. t_base With a fixed allocation value, the first data packet may fall into any valid timing slot position.
[0127] Next, calculate the length of the circular bit array. array_length = total_slots ÷16, meaning every 16 timing slots are packaged into a 32-bit integer, with each timing slot occupying 2 bits, thus creating an array of length 16. array_length An integer array, where each element is a 32-bit integer.
[0128] Finally, all elements of the circular bit array are initialized to 0, that is, all two-bit status bits are initialized to 00 to represent empty timing slots, thus obtaining the initialized circular bit array.
[0129] As an exemplary implementation of this application, the Flink stream processing engine can be used to continuously receive vehicle data packets. After each vehicle data packet enters the first time window, the time window boundary check and storage operation are performed in ascending order of the sampling timestamp. Then, the loop starts and the next vehicle data packet is received. This loop process continues until an external termination signal is received, such as a job stop command.
[0130] The vehicle data processing method provided in this application embodiment is based on a time-series slot array structure for data storage. Data memory usage depends only on the time window size and time sampling granularity, and is independent of data flow rate and out-of-order rate. This supports precise resource planning and capacity management, making it suitable for large-scale vehicle network deployments. Simultaneously, sampling timestamps are directly mapped to storage locations, and out-of-order data is directly overwritten or merged without the need for searching, comparing, and sorting, effectively improving storage efficiency and data analysis efficiency, and meeting the latency requirements of real-time vehicle network monitoring.
[0131] Based on the same technical concept as the above embodiments, the vehicle data processing method provided in this application can be executed by a vehicle data processing device. This application uses a vehicle data processing device executing the vehicle data processing method as an example to illustrate the vehicle data processing device provided in this application. Figure 7 As shown, the vehicle data processing device 700 includes: The array construction module 710 is used to construct a target time slot array associated with the first time window in response to a data storage request for the first time window, wherein the first time window is a preset time window with data analysis requirements, and the data storage request is used to request vehicle data stored in the first time window for data analysis.
[0132] The storage operation module 720 is used to perform a storage operation on the first vehicle data collected within the first time window according to the target time slot array. The storage operation includes: encoding the first vehicle data to obtain a target encoding result; determining the time slot position information corresponding to the target encoding result according to the first sampling timestamp of the first vehicle data; and performing a storage operation on the target encoding result at the target time slot position according to the target time slot position information.
[0133] In some implementations, the storage operation module 720 is specifically used to determine the target time slot position information corresponding to the target encoding result based on the first sampling timestamp of the first vehicle data, including: The relative time offset is determined based on the first sampling timestamp and the window reference time of the first time window; The time slot offset is determined based on the relative time offset and the sampling time granularity. The sampling time granularity is the interval between adjacent sampling timestamps within the first time window. The target time slot location information is determined based on the time slot offset and the length of the target time slot array.
[0134] In some embodiments, the storage operation module 720 is specifically used to perform a storage operation on the target encoding result at the target time slot position according to the target time slot position information, including: Based on the target time slot location information, read the original encoding result of the target time slot location; Based on the target encoding result and the original encoding result, determine the encoding result to be stored; Based on the target time slot location information, the encoding result to be stored is written to the target time slot location.
[0135] In some implementations, the storage operation module 720 is specifically used to determine the encoding result to be stored based on the target encoding result and the original encoding result, including any one of the following: Replace the original encoding result with the target encoding result as the encoding result to be stored. Perform an OR operation on the target encoding result and the original encoding result to obtain the encoding result to be stored. Based on the priority of the target encoding result and the priority of the original encoding result, determine the encoding result to be stored from the target encoding result and the original encoding result.
[0136] In some implementations, the target timing slot location information includes the target array index and the target bit offset. The storage operation module 720 is specifically used to write the encoding result to be stored to the target timing slot location according to the target timing slot location information, including: Determine the position of the target time slot in the target time slot array based on the target array index; The target timing slot position is cleared according to the clear mask corresponding to the target bit offset; Based on the target bit offset, write the encoding result to be stored at the target timing slot position after clearing.
[0137] In some embodiments, the vehicle data processing device 700 is further configured to: In response to the acquisition of second vehicle data, if the second sampling timestamp of the second vehicle data is before the first time window, the second vehicle data is discarded, or the second vehicle data is cached in a storage space other than the target time slot array. In response to the acquisition of third vehicle data, if the third sampling timestamp of the third vehicle data is after the first time window, the first time window is slid to obtain a second time window, and the second time window is associated with the target time slot array. The second time window is a time window that includes the third sampling timestamp, and the target time slot array is used to re-perform storage operations on the third vehicle data sampled within the second time window.
[0138] In some implementations, the storage operation module 720 is specifically used to encode the first vehicle data to obtain a target encoding result, including: Based on the first vehicle data, determine the target data status corresponding to the first sampling timestamp; Based on the target data status, the first vehicle data is bit encoded to obtain a target bit encoded value corresponding to the first sampling timestamp. The target encoding result includes the target bit encoded value, and the target bit encoded value is used to indicate the target data status.
[0139] In some implementations, the target data status includes any one of data missing, status abnormal, status normal, and data suspicious.
[0140] It is understood that the implementation methods of vehicle data processing methods in the above-described method embodiments are also applicable to the vehicle data processing device in this embodiment, and can achieve the same technical effect, so they will not be described again here.
[0141] Based on the same concept, this application also provides a vehicle data processing device. This device can be a vehicle or an electronic device. The vehicle can be a private car, such as a sedan, sports / utility vehicle (SUV), multi-purpose vehicle (MPV), or pickup truck. The vehicle can also be a commercial vehicle, such as a van, bus, small truck, or large semi-trailer. The vehicle can be a gasoline-powered vehicle or a new energy vehicle. When the vehicle is a new energy vehicle, it can be a hybrid vehicle or a pure electric vehicle. The electronic device can be an in-vehicle terminal, a user terminal, or a server, etc. Figure 8 As shown, the vehicle data processing device 800 may include a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call logical instructions in the memory 830 to execute the steps of the vehicle data processing methods as described in the above embodiments.
[0142] The processor 810 can be a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0143] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0144] The memory 830 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0145] Based on the same concept, embodiments of this application also provide a computer-readable storage medium storing a computer program containing at least one piece of code that can be executed by a master control device to control the master control device to implement the steps of the vehicle data processing method as described in the above method embodiments.
[0146] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the vehicle data processing method described in the above method embodiments. The computer program may be stored wholly or partially on a computer-readable storage medium packaged with a processor, or it may be stored wholly or partially on a memory not packaged with a processor.
[0147] Based on the same technical concept, this application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to implement the steps of the vehicle data processing method in the above method embodiments.
[0148] Based on the same technical concept, embodiments of this application also provide a processor for implementing the steps of the vehicle data processing method described in the above method embodiments. The processor may be a chip.
[0149] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0150] The functional blocks shown in the structural block diagrams of the above embodiments can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. Machine-readable media can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0151] The embodiments described above are merely examples of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for processing vehicle data, characterized in that, The method includes: In response to a data storage request for a first time window, a target time slot array associated with the first time window is constructed, wherein the first time window is a preset time window with data analysis requirements, and the data storage request is used to request vehicle data stored in the first time window for data analysis. Based on the target time slot array, a storage operation is performed on the first vehicle data collected within the first time window, wherein the storage operation includes: The first vehicle data is encoded to obtain a target encoding result. The target encoding result is used for data analysis related to the first vehicle data, where the first vehicle data is any vehicle data collected within the first time window. Based on the first sampling timestamp of the first vehicle data, the target time slot position information corresponding to the target encoding result is determined, and the target time slot position information is used to indicate the target time slot position in the target time slot array; Based on the target time slot location information, a storage operation is performed on the target encoding result at the target time slot location.
2. The vehicle data processing method according to claim 1, characterized in that, The step of determining the target time slot position information corresponding to the target encoding result based on the first sampling timestamp of the first vehicle data includes: The relative time offset is determined based on the first sampling timestamp and the window reference time of the first time window; The time slot offset is determined based on the relative time offset and the sampling time granularity, wherein the sampling time granularity is the interval between adjacent sampling timestamps within the first time window; The target time slot position information is determined based on the time slot offset and the length of the target time slot array.
3. The vehicle data processing method according to claim 1, characterized in that, The step of storing the target encoding result at the target time slot location based on the target time slot location information includes: Based on the target time slot location information, read the original encoding result of the target time slot location; Based on the target encoding result and the original encoding result, determine the encoding result to be stored; Based on the target time slot location information, the encoding result to be stored is written to the target time slot location.
4. The vehicle data processing method according to claim 3, characterized in that, The step of determining the encoding result to be stored based on the target encoding result and the original encoding result includes any one of the following: Replace the original encoding result with the target encoding result as the encoding result to be stored; Perform an OR operation on the target encoding result and the original encoding result to obtain the encoding result to be stored; Based on the priority of the target encoding result and the priority of the original encoding result, the encoding result to be stored is determined from the target encoding result and the original encoding result.
5. The vehicle data processing method according to claim 3, characterized in that, The target time slot location information includes the target array index and the target bit offset. The step of writing the encoding result to be stored to the target time slot location according to the target time slot location information includes: The position of the target time slot in the target time slot array is determined based on the target array index; The target timing slot position is cleared according to the clear mask corresponding to the target bit offset; Based on the target bit offset, the encoding result to be stored is written into the target timing slot position after clearing.
6. The vehicle data processing method according to claim 1, characterized in that, After constructing the target time slot array associated with the first time window in response to a data storage request for the first time window, the method further includes: In response to the acquisition of second vehicle data, if the second sampling timestamp of the second vehicle data is before the first time window, the second vehicle data is discarded, or the second vehicle data is cached in a storage space other than the target time slot array. In response to the acquisition of third vehicle data, if the third sampling timestamp of the third vehicle data is located after the first time window, the first time window is slid to obtain a second time window, and the second time window is associated with the target time slot array. The second time window is a time window that includes the third sampling timestamp, and the target time slot array is used to re-perform storage operations on the third vehicle data sampled within the second time window.
7. The vehicle data processing method according to claim 1, characterized in that, The process of encoding the first vehicle data to obtain the target encoding result includes: Based on the first vehicle data, determine the target data status corresponding to the first sampling timestamp; Based on the target data status, the first vehicle data is bit encoded to obtain a target bit encoded value corresponding to the first sampling timestamp, wherein the target encoding result includes the target bit encoded value, and the target bit encoded value is used to indicate the target data status.
8. The vehicle data processing method according to claim 7, characterized in that, The target data status includes any one of the following: missing data, abnormal status, normal status, and suspicious data.
9. A vehicle data processing device, characterized in that, The device includes: An array construction module is used to construct a target time slot array associated with the first time window in response to a data storage request for the first time window, wherein the first time window is a preset time window with data analysis requirements, and the data storage request is used to request vehicle data stored in the first time window for data analysis. The storage operation module is used to perform a storage operation on the first vehicle data collected within the first time window according to the target time slot array, wherein the storage operation includes: The first vehicle data is encoded to obtain a target encoding result. The target encoding result is used for data analysis related to the first vehicle data, where the first vehicle data is any vehicle data collected within the first time window. Based on the first sampling timestamp of the first vehicle data, the target time slot position information corresponding to the target encoding result is determined, and the target time slot position information is used to indicate the target time slot position in the target time slot array; Based on the target time slot location information, a storage operation is performed on the target encoding result at the target time slot location.
10. A vehicle data processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the vehicle data processing method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the vehicle data processing method as described in any one of claims 1-8.
12. A computer program product, characterized in that, The computer program product includes a computer program, wherein the instructions in the computer program product, when executed by a processor of an electronic device, cause the electronic device to perform the vehicle data processing method as described in any one of claims 1 to 8.