Battery data processing methods and vehicles

By generating a combined identifier for the vehicle and battery system, and reading and calculating battery sensor data in batches independently, the problem of memory overflow in multi-battery systems of new energy trucks is solved, and efficient and accurate battery data processing is achieved.

CN123104466APending Publication Date: 2026-11-17GREAT WALL MOTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611286110.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, since data reading is done at the vehicle as a whole as the smallest unit, the amount of data loaded into memory at one time increases as the number of battery systems increases, which can easily lead to memory overflow when server memory resources are limited.

Method used

By generating a combined identifier of vehicle identifier and battery system identifier, battery sensor data is read in batches using the combined identifier as the smallest unit. Data belonging to the same combined identifier is divided into the same data segment, and the battery charge change of each data segment is calculated independently, avoiding the shared memory usage of different battery system data due to bundling.

Benefits of technology

It reduces the risk of memory overflow under limited memory resources, improves the efficiency and accuracy of data processing, and ensures the accuracy of independent accounting and energy consumption statistics for each battery system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123104466A_ABST
    Figure CN123104466A_ABST
Patent Text Reader

Abstract

This application provides a battery data processing method and a vehicle. The method includes: acquiring a vehicle identifier and a battery system identifier of the vehicle to be processed, and generating a combined identifier based on the vehicle identifier and the battery system identifier; reading battery sensor data corresponding to the combined identifier in batches according to a preset reading batch; dividing the battery sensor data belonging to the same combined identifier into the same data slice, obtaining several data slices; calculating the battery charge change corresponding to each data slice; and summarizing and outputting the battery charge change of each data slice. This ensures that the data loading and calculation of each battery system are performed independently at the granularity of a single battery system, avoiding the shared memory occupation of different battery system data due to bundling. As the number of battery systems increases, the amount of data loaded into memory at one time will not increase synchronously, thereby reducing the risk of memory overflow under limited memory resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a battery data processing method and a vehicle. Background Technology

[0002] New energy freight vehicles have been widely deployed in core logistics scenarios such as urban delivery, long-haul transportation, and sanitation operations. As the core power component of these vehicles, the accurate and efficient processing of their operational data is the fundamental basis for intelligent vehicle operation monitoring, energy consumption statistics and accounting, and battery safety management. New energy freight vehicles exhibit typical operational characteristics distinct from passenger cars: to meet heavy-load range requirements, heavy-duty freight vehicles are generally equipped with 2 to 4 independently operating battery systems; simultaneously, large-scale logistics companies operate thousands of new energy freight vehicles, generating hundreds of millions of battery data points daily, placing stringent demands on the memory capacity and computing efficiency of data processing systems.

[0003] Currently, the processing of power battery data for new energy trucks is usually done in the following way: the data of all battery systems in the vehicle are aggregated as a whole, and then read and processed on a vehicle-by-vehicle basis. After processing, the data of each battery system is uniformly calculated.

[0004] However, in the above-mentioned existing technical solutions, since data reading is based on the entire vehicle as the smallest unit, as the number of battery systems increases, the amount of data loaded into memory at one time also increases, which can easily lead to memory overflow when server memory resources are limited. Summary of the Invention

[0005] This application provides a battery data processing method and a vehicle to solve the problem in the prior art where data reading is done at the vehicle as the smallest unit. As the number of battery systems increases, the amount of data loaded into memory at one time also increases, which can easily lead to memory overflow when server memory resources are limited.

[0006] In a first aspect, this application provides a battery data processing method, including: Obtain the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier; Read battery sensor data corresponding to the combined identifier in batches according to the preset reading batch; Battery sensor data belonging to the same combination of identifiers are divided into the same data slice, resulting in several data slices; Calculate the change in battery charge for each of the data segments; The battery charge changes of each data segment are summarized and output.

[0007] In one possible implementation, obtaining the vehicle identifier and battery system identifier of the vehicle to be processed includes: Retrieve vehicle operation records within a preset date range; Extract the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed from the vehicle operation records.

[0008] In one possible implementation, the step of reading the battery sensor data corresponding to the combined identifier in batches according to a preset reading batch includes: Get the current available memory capacity of the server; The threshold for the amount of data read in a single operation is determined based on the currently available memory capacity. According to the data volume threshold, all combined identifiers are processed in batches to obtain multiple batches; Read the battery sensor data corresponding to each batch in batches.

[0009] In one possible implementation, after reading the battery sensor data corresponding to the combined identifier in batches according to a preset reading batch, the method further includes: Detect the original format of the time field in the battery sensing data; Identify non-standard time format features in the original format to obtain the identification result; Based on the recognition results, the original format is uniformly converted into a preset standard time format.

[0010] In one possible implementation, calculating the battery charge change corresponding to each of the data segments includes: For each data segment, the battery sensing data in the data segment are arranged into several data points in chronological order; Based on several of the aforementioned data points, charging data is removed from the data slices; After removing the charging data, the data points are arranged in chronological order. Select two data points from adjacent time points in sequence, and calculate the difference between the battery charge value of the data point at the later time point and the battery charge value of the data point at the previous time point; The battery charge change corresponding to the data segment is obtained by summing all the differences and then inverting them.

[0011] In one possible implementation, the step of removing charging data from the data slices based on a plurality of the data points includes: Obtain the vehicle speed and net output power of the fuel cell corresponding to each of the data points; Data points where the vehicle speed is zero and the net output power of the fuel cell is zero are identified as charging status data points; Based on a number of continuously distributed charging state data points, a candidate charging segment is formed. When the duration of the candidate charging segment reaches a preset threshold, all data points within the candidate charging segment are determined to be charging data. Remove the charging data from the data slice.

[0012] In one possible implementation, calculating the battery charge change corresponding to each of the data segments includes: Each data shard is assigned to multiple processes in a process pool, and each process executes the step of calculating the change in battery power corresponding to each data shard in parallel.

[0013] In one possible implementation, the step of summarizing and outputting the battery charge changes for each of the data segments includes: The battery power change of each data segment is grouped according to the preset batch size to obtain multiple data groups; The data is grouped and written to the database using a streaming loading method.

[0014] In one possible implementation, generating the combined identifier based on the vehicle identifier and the battery system identifier includes: The vehicle identifier and the battery system identifier are concatenated to generate an intermediate identifier in string form; The intermediate identifier is determined as the combined identifier, wherein each of the combined identifiers uniquely corresponds to a set of battery systems for a vehicle.

[0015] Secondly, this application provides a battery data processing device, comprising: The acquisition module is used to acquire the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier; The reading module is used to read the battery sensing data corresponding to the combined identifier in batches according to a preset reading batch. The partitioning module is used to divide battery sensor data belonging to the same combination of identifiers into the same data segment, resulting in several data segments. The calculation module is used to calculate the change in battery power corresponding to each of the data segments; The output module is used to summarize and output the changes in battery power of each data segment.

[0016] In one possible implementation, the acquisition module is specifically used for: Retrieve vehicle operation records within a preset date range; Extract the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed from the vehicle operation records.

[0017] In one possible implementation, the reading module is specifically used for: Get the current available memory capacity of the server; The threshold for the amount of data read in a single operation is determined based on the currently available memory capacity. According to the data volume threshold, all combined identifiers are processed in batches to obtain multiple batches; Read the battery sensor data corresponding to each batch in batches.

[0018] In one possible implementation, the device further includes a conversion module for: Detect the original format of the time field in the battery sensing data; Identify non-standard time format features in the original format to obtain the identification result; Based on the recognition results, the original format is uniformly converted into a preset standard time format.

[0019] In one possible implementation, the computing module is specifically used for: For each data segment, the battery sensing data in the data segment are arranged into several data points in chronological order; Based on several of the aforementioned data points, charging data is removed from the data slices; After removing the charging data, the data points are arranged in chronological order. Select two data points from adjacent time points in sequence, and calculate the difference between the battery charge value of the data point at the later time point and the battery charge value of the data point at the previous time point; The battery charge change corresponding to the data segment is obtained by summing all the differences and then inverting them.

[0020] In one possible implementation, the computing module is further configured to: Obtain the vehicle speed and net output power of the fuel cell corresponding to each of the data points; Data points where the vehicle speed is zero and the net output power of the fuel cell is zero are identified as charging status data points; Based on a number of continuously distributed charging state data points, a candidate charging segment is formed. When the duration of the candidate charging segment reaches a preset threshold, all data points within the candidate charging segment are determined to be charging data. Remove the charging data from the data slice.

[0021] In one possible implementation, the computing module is further configured to: Each data shard is assigned to multiple processes in a process pool, and each process executes the step of calculating the change in battery power corresponding to each data shard in parallel.

[0022] In one possible implementation, the output module is specifically used for: The battery power change of each data segment is grouped according to the preset batch size to obtain multiple data groups; The data is grouped and written to the database using a streaming loading method.

[0023] In one possible implementation, the acquisition module is further configured to: The vehicle identifier and the battery system identifier are concatenated to generate an intermediate identifier in string form; The intermediate identifier is determined as the combined identifier, wherein each of the combined identifiers uniquely corresponds to a set of battery systems for a vehicle.

[0024] Thirdly, this application provides a vehicle, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in a memory, it implements the battery data processing method described in any of the first aspects above.

[0025] Fourthly, this application provides a storage medium storing one or more programs that can be executed by one or more processors to implement the battery data processing method described in any one aspect.

[0026] Fifthly, this application provides a computer program product containing instructions that, when run on a computer, causes the computer to perform any of the battery data processing methods described above.

[0027] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application generates a combined identifier of vehicle identifier and battery system identifier, and reads battery sensor data in batches with the combined identifier as the smallest unit. This makes the amount of data read at one time no longer limited to the total amount of all battery systems in the vehicle, but rather the amount of data of a single battery system as the basic loading unit. On this basis, data belonging to the same combined identifier is divided into the same data slice, so that each data slice remains independent and does not interfere with each other in the subsequent calculation process. This allows the data loading and calculation of each battery system to be performed independently at the granularity of a single battery system, avoiding the common memory occupation due to the bundling of data from different battery systems. When the number of battery systems increases, the amount of data loaded into memory at one time will not increase synchronously, thereby reducing the risk of memory overflow under limited memory resources. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0031] Figure 1 A flowchart illustrating an embodiment of a battery data processing method provided in this application; Figure 2 A flowchart illustrating an embodiment of another battery data processing method provided in this application; Figure 3 A flowchart illustrating another embodiment of a battery data processing method provided in this application; Figure 4 A block diagram illustrating an embodiment of a battery data processing device provided in this application; Figure 5 This is a structural schematic diagram of a vehicle provided in an embodiment of this application. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0034] New energy freight vehicles have been widely deployed in core logistics scenarios such as urban delivery, long-haul transportation, and sanitation operations. As the core power component of these vehicles, the accurate and efficient processing of their operational data is fundamental for intelligent vehicle operation monitoring, energy consumption statistics, and battery safety management. New energy freight vehicles exhibit distinct operational characteristics compared to passenger cars: to meet heavy-load range requirements, heavy-duty freight vehicles typically carry 2 to 4 independently operating battery systems; simultaneously, large-scale logistics companies operate thousands of new energy freight vehicles, generating hundreds of millions of battery data points daily, placing stringent demands on the memory capacity and computational efficiency of data processing systems. Currently, the processing of power battery data for new energy freight vehicles typically employs the following method: data from all battery systems in the vehicle are aggregated as a whole, read and processed on a vehicle-by-vehicle basis, and then uniformly calculated for each battery system after processing. However, in this existing technical solution, because data reading is done at the vehicle-wide level, the amount of data loaded into memory increases dramatically with the number of battery systems, easily leading to memory overflow when server memory resources are limited.

[0035] To address the aforementioned shortcomings, this application proposes a core inventive concept of batch reading and independent calculation using the combination of vehicle identifier and battery system identifier as the smallest data granularity: by generating a combined identifier of vehicle identifier and battery system identifier, battery sensor data is read in batches using the combined identifier as the smallest unit, thus decoupling the amount of data read in a single transaction from the number of battery systems; furthermore, by dividing data belonging to the same combined identifier into the same data segment and calculating the charge change of each data segment separately, each battery system remains independent in subsequent calculations, avoiding multiple battery systems sharing memory due to data bundling, thereby reducing the risk of memory overflow under limited memory resources.

[0036] Based on the above inventive concept, such as Figure 1 The diagram shown is a schematic representation of an implementation flow of a battery data processing method provided in this application. This method is applied to vehicles and may specifically include the following steps: S101. Obtain the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier.

[0037] Vehicle identification: refers to information used to uniquely identify the vehicle to be processed. Its specific form is not limited. For example, it can be VIN (Vehicle Identification Number), license plate number or other identification information that can uniquely identify the vehicle.

[0038] Battery system identifier: refers to information used to uniquely identify the battery system installed in the vehicle. Its specific form is not limited, such as battery system number or other identification information that can uniquely identify the battery system.

[0039] Combination identifier: refers to the combination key information generated by combining the vehicle identifier and the battery system identifier, which is used to uniquely identify "one battery system of a vehicle".

[0040] In this embodiment, the vehicle identifier of the vehicle to be processed and the battery system identifiers of each battery system mounted on the vehicle are first obtained. Then, the vehicle identifier and the battery system identifiers are combined to generate a combined identifier. For vehicles equipped with multiple battery systems, the vehicle identifier is combined with the battery system identifiers of each battery system to generate multiple combined identifiers. For example, for vehicle A and its battery systems B1 and B2, combined identifiers A-B1 and A-B2 are generated respectively, with each combined identifier uniquely corresponding to one battery system of one vehicle. By generating combined identifiers, the granularity of subsequent data reading and data partitioning operations is reduced from the entire vehicle to a single battery system, establishing an index foundation for the independent loading and independent accounting of data for each battery system.

[0041] S102. Read the battery sensing data corresponding to the combined identifier in batches according to the preset reading batch.

[0042] Preset read batch: refers to a pre-defined batch read strategy used to control the number of combined identifiers processed in a single read operation, so as to avoid the amount of data loaded into memory at one time exceeding the server's memory capacity.

[0043] Battery sensing data: refers to various sensing parameter data generated by the power battery of new energy trucks during operation, including but not limited to time-series data such as SOC (State of Charge, battery capacity), voltage, current, and temperature.

[0044] In this embodiment, battery sensor data corresponding to each combination identifier is read in batches according to a preset reading batch, using combination identifiers as the reading granularity. Specifically, based on the amount of data read per batch determined by the preset reading batch, a portion of the combination identifiers are selected as a batch, and the battery sensor data corresponding to each combination identifier in that batch is read batch by batch until all battery sensor data corresponding to all combination identifiers has been read. The number of combination identifiers read per batch is configured such that the total amount of data read in that batch does not exceed the current available memory capacity, thereby avoiding the risk of memory overflow caused by excessive data loading per batch. Through this batch reading method, the memory usage per batch is controlled within the range that the server memory can bear.

[0045] It should be noted that the specific method for determining the batch size can be flexibly set according to the actual application scenario. For example, the number of combined identifiers processed in each batch can be dynamically calculated based on the current available memory capacity, or a fixed batch size can be preset. As long as the purpose of batch reading and controlling the memory usage of a single operation can be achieved, those skilled in the art can flexibly set it according to the actual application scenario.

[0046] S103. Divide the battery sensing data belonging to the same combination identifier into the same data segment to obtain several data segments.

[0047] Data sharding: refers to the subset of data obtained by dividing the read battery sensor data according to the combination identifier. Each data shard contains only all battery sensor data belonging to the same combination identifier, and is used as the basic data unit for subsequent independent calculation.

[0048] In this embodiment, after batch reading is completed, the read battery sensor data is grouped based on the combination identifier. Battery sensor data belonging to the same combination identifier are divided into the same data slice, so that each data slice uniquely corresponds to one combination identifier, that is, uniquely corresponds to one battery system of one vehicle. Data from different battery systems under the same vehicle are allocated to different data slices because they belong to different combination identifiers, and are physically or logically independent of each other. Through this division, the data of each battery system do not intertwine or interfere with each other in subsequent calculations, providing a data organization basis for realizing independent accounting of the operating status of each battery system.

[0049] S104. Calculate the change in battery power corresponding to each of the data segments.

[0050] Battery charge change: refers to the degree of change in the charge of the battery system within a preset time interval, used to characterize the charge and discharge state and energy consumption level of the battery system.

[0051] In this embodiment, the battery charge change corresponding to each data segment is calculated independently. Specifically, based on the battery sensor data in each data segment, the battery charge value at each time point is determined in chronological order. Before calculation, optionally, data belonging to the charging period in the data segment is identified and removed to eliminate the interference of the charging process on the statistical accuracy. Then, the battery charge change corresponding to the data segment is calculated based on the processed data segment. The specific calculation method can be based on the difference between charge values ​​at adjacent time points, or other statistical algorithms that can characterize the degree of charge change can be used, as long as they can reflect the degree of charge change of the battery system within a preset time interval. Each data segment performs the above calculation independently without interference, thereby obtaining independent charge change calculation results for each battery system.

[0052] S105. Summarize and output the changes in battery power for each data segment.

[0053] In this embodiment, the changes in battery charge calculated from each data segment are collected, and the changes in battery charge from all data segments are summarized to obtain the calculation results of the changes in battery charge of each battery system in all vehicles. The summarized calculation results are then output. By summarizing the output, the independent calculation results scattered in each data segment are aggregated to form a complete data processing result, which can be used for subsequent energy consumption statistics, operational accounting, and other business scenarios.

[0054] It should be noted that the specific output method after aggregation can be flexibly selected according to the actual application scenario. For example, the results can be persisted to the database through the database write interface, exported in the form of a file, or sent to the downstream business system through the transmission interface. Those skilled in the art can flexibly set it according to the actual application scenario.

[0055] The technical solution provided in this application generates a combined identifier of vehicle identifier and battery system identifier, and reads battery sensor data in batches with the combined identifier as the smallest unit. This means that the amount of data read in a single transaction is no longer limited to the total amount of data from all battery systems in the vehicle, but is instead loaded in units of data from a single battery system. Furthermore, data belonging to the same combined identifier is divided into the same data slice, ensuring that each data slice remains independent and does not interfere with each other during subsequent calculations. This allows the loading and calculation of data for each battery system to be performed independently at the granularity of a single battery system, avoiding the shared memory usage caused by bundled data from different battery systems. As the number of battery systems increases, the amount of data loaded into memory in a single transaction does not increase proportionally, thus reducing the risk of memory overflow with limited memory resources.

[0056] In existing technologies, vehicle identifiers are typically used as unique index keys to point to all sensor data of all battery systems in the vehicle. The data granularity remains at the vehicle level, making it impossible to distinguish the data ownership of different battery systems under the same vehicle.

[0057] Based on this, in one embodiment, a combined identifier can be generated by the following steps: concatenating the vehicle identifier with the battery system identifier to generate an intermediate identifier in the form of a string; determining the intermediate identifier as the combined identifier, wherein each of the combined identifiers uniquely corresponds to a set of battery systems for a vehicle.

[0058] Concatenation: refers to the operation of combining two independent strings into a new string in a specific order. For example, concatenating the vehicle identifier "VIN123" with the battery system identifier "BAT01" will result in "VIN123BAT01".

[0059] Intermediate identifier: refers to temporary combination key information in string form obtained by concatenating the vehicle identifier and the battery system identifier, which is used to be subsequently determined as the final combined identifier.

[0060] In this embodiment, for each battery system, the corresponding vehicle identifier and battery system identifier are concatenated to generate an intermediate identifier in string form. This intermediate identifier is then used as the combined identifier for that battery system, so that each combined identifier uniquely corresponds to a battery system of a vehicle.

[0061] For example, for vehicle A (vehicle identifier "VIN123") and its battery systems B1 (battery system identifier "BAT01") and B2 (battery system identifier "BAT02"), a concatenation operation is performed: "VIN123" and "BAT01" are concatenated to obtain the intermediate identifier "VIN123BAT01", which is identified as the combined identifier corresponding to battery system B1 of vehicle A; "VIN123" and "BAT02" are concatenated to obtain the intermediate identifier "VIN123BAT02", which is identified as the combined identifier corresponding to battery system B2 of vehicle A. Thus, data from different battery systems within the same vehicle are distinguished by belonging to different combined identifiers. Each combined identifier is globally unique within the system, pointing to one and only one specific set of battery systems.

[0062] The combined identifier generated in the above manner serves as the basic index unit for data reading and data partitioning in subsequent processing. That is, the data reading operation uses the combined identifier as the query key to retrieve the corresponding battery sensor data from the database, and the data partitioning operation uses the combined identifier as the grouping basis to divide the data belonging to the same combined identifier into the same data segment.

[0063] In existing technologies, vehicle identification and battery system identification of vehicles to be processed are usually obtained through manual input or full data reading. In large-scale operation scenarios, this is inefficient, prone to errors, and leads to resource waste due to the introduction of invalid data.

[0064] Based on this, in one embodiment, the vehicle identifier and battery system identifier of the vehicle to be processed can be obtained through the following steps: obtaining vehicle operation records within a preset date range; extracting the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed from the vehicle operation records.

[0065] Vehicle operation records refer to the business records generated during the actual operation of a vehicle, including but not limited to information such as vehicle identification, operating date, mileage, and operating duration, which are used to reflect whether the vehicle was actually put into operation within a specific date range.

[0066] In this embodiment, vehicle operation records within a preset date range are first obtained. This preset date range can be set according to actual business needs, such as the current day, the last 24 hours, or a specified working day. Then, the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed are extracted from the obtained vehicle operation records. Specifically, since the vehicle operation records record vehicle information that actually generates operation data on the current day, by extracting the vehicle identifier from the operation records, the vehicles that are actually online and operating on the current day can be accurately located, avoiding the introduction of vehicles that are not operating on the current day. Furthermore, the battery system identifier of each battery system installed in the vehicle is obtained from the vehicle configuration information and combined with the vehicle identifier to generate a combined identifier, so that the generated combined identifier is a valid combined identifier that actually needs to be processed on the current day.

[0067] This solution uses vehicle operation records to filter the vehicles actually in operation on the day, avoiding the tediousness and errors of manual data entry, and also avoiding the large number of invalid combination identifiers that would result from reading the entire basic information table and participating in subsequent batch readings. This reduces the number of invalid database queries and memory usage, and further improves data processing efficiency.

[0068] In existing technologies, the batch size for reading battery data is usually a preset fixed value, which cannot adapt to the dynamic changes in the available memory capacity of the server. Improper batch settings can easily lead to memory overflow or reduced processing efficiency.

[0069] Based on this, in one embodiment, such as Figure 2 As shown, the battery sensor data corresponding to the combined identifier can be read in batches according to the preset reading batches through the following steps: S201. Obtain the current available memory capacity of the server; S202. Determine the data volume threshold for a single read based on the currently available memory capacity; S203. According to the data volume threshold, all combined identifiers are processed in batches to obtain multiple batches; S204. Read the battery sensing data corresponding to each batch in batches.

[0070] For ease of understanding, the following provides a unified explanation of S201-204: Current available memory capacity: refers to the amount of free memory available for loading battery sensor data at the current moment when the server is executing this method.

[0071] Data volume threshold: refers to the maximum number of combined identifiers that can be processed in a single read operation. It is used to limit the data size of each batch of reads, and its specific value is dynamically determined based on the current available memory capacity of the server.

[0072] In this embodiment, the combined identifier is used as the reading granularity. Before batch reading, the current available memory capacity of the server executing this method is first obtained. This current available memory capacity reflects the amount of free memory available on the server at the current moment for loading battery sensor data. Then, the data volume threshold for a single read is dynamically determined based on the current available memory capacity. This data volume threshold represents the maximum number of combined identifiers that can be read in each batch, ensuring that the total amount of battery sensor data read in each batch does not exceed the current available memory capacity. Next, all combined identifiers are processed in batches according to this data volume threshold, dividing all combined identifiers into multiple batches. The number of batches is equal to the total number of combined identifiers divided by the data volume threshold and rounded up. The number of combined identifiers in each batch does not exceed the data volume threshold. Finally, the battery sensor data corresponding to the combined identifiers in each batch is read batch by batch. That is, the battery sensor data corresponding to each combined identifier in each batch is read from the database until all batches of battery sensor data are read.

[0073] In this solution, the data volume threshold is dynamically determined based on the current available memory capacity, so that the amount of data read in each batch matches the real-time memory status of the server. When memory is sufficient, the batch size is appropriately increased to reduce the number of batches and database queries, thereby improving processing efficiency. When memory is tight, the batch size is reduced to avoid memory overflow, thus ensuring both system stability and data processing efficiency.

[0074] In practical applications, data acquisition devices for different vehicles may come from different manufacturers, or devices deployed by the same manufacturer at different times may differ, leading to inconsistencies in the format of the time field in the reported battery sensor data. For example, some devices use the format "yyyy-MM-dd HH:mm:ss", while others use "yyyy / MM / dd HH:mm:ss". Some data includes millisecond-level precision, and some time strings contain abnormal separators. Directly processing time data in different formats will result in time parsing failures or sorting errors, affecting the accuracy of subsequent calculations of battery charge changes.

[0075] Based on this, in one embodiment, after S102, the following steps may be included: detecting the original format of the time field in the battery sensing data; identifying non-standard time format features in the original format to obtain an identification result; and converting the original format into a preset standard time format according to the identification result.

[0076] Original format: refers to the existing format type of the time field in battery sensor data before it is detected.

[0077] Non-standard time format features: refers to format features that do not conform to the preset standard time format, including but not limited to abnormal separators and / or high-precision time bits.

[0078] Preset standard time format: refers to a pre-defined unified time format standard, which is used as the target format for time format conversion.

[0079] In this embodiment, after reading the battery sensor data corresponding to the combined identifier in batches according to a preset reading batch, the original format of the time field in the read battery sensor data is detected to determine the format type of the current time field; then, non-standard time format features in the original format are identified, such as the use of non-standard separators in the time string (e.g., " / " instead of "-"), the inclusion of millisecond or nanosecond-level high-precision time bits, etc., to obtain the identification result; finally, based on the identification result, the original format is uniformly converted into a preset standard time format, for example, removing nanosecond-level high-precision time bits from the original time string and replacing abnormal separators with standard separators to obtain the standard time format.

[0080] This solution can automatically accommodate various time formats reported by different data acquisition devices. Even if there are abnormal separators or high-precision time bits in the time field, it can be accurately identified and uniformly converted into the preset standard time format. This avoids time parsing failure or sorting errors caused by inconsistent time formats, ensuring the accuracy of subsequent chronological arrangement of data points and calculation of battery power changes. At the same time, it eliminates the need for manual preprocessing of time formats, improving the system's automation capabilities and robustness.

[0081] In existing technologies, the calculation of changes in battery charge is typically performed directly on the raw sensor data, i.e., directly calculating the charge difference across all data points to reflect battery energy consumption. However, new energy trucks generally operate on a daytime running and nighttime charging model. During the charging period, the battery charge continuously increases. If the data from the charging period is directly included in the calculation, the increase in charge generated during charging will cancel out or add to the energy consumed during driving. This results in the calculated change in charge not accurately reflecting the actual energy consumption level during vehicle operation, severely affecting the accuracy of operational energy consumption accounting.

[0082] Based on this, in one embodiment, such as Figure 3 As shown, the battery charge change corresponding to each data segment can be calculated using the following steps: S301. For each data segment, arrange the battery sensing data in the data segment into several data points in chronological order; S302. Remove charging data from the data slices based on several of the data points; S303. After removing the charging data, arrange the data points in chronological order. S304. Select two data points at adjacent time points in sequence, and calculate the difference between the battery power value of the data point at the next time point and the battery power value of the data point at the previous time point. S305. Summing all the differences and then inverting them, we obtain the change in battery power corresponding to the data segment.

[0083] For ease of understanding, the following provides a unified explanation of S301-305: Data point: refers to a single recording unit obtained by arranging battery sensor data in chronological order. Each data point contains at least time information and the corresponding battery charge value.

[0084] In this embodiment, after data segmentation, the battery charge change calculation is performed independently for each data segment. For each data segment, the battery sensor data is first arranged into several data points in chronological order for subsequent difference calculation based on the time series. Then, charging data is removed from the data segment based on these data points; that is, data points belonging to the charging period are identified and removed from the data segment to eliminate the interference of the charging process on statistical accuracy. After removing the charging data, since the relative order of the data points remains unchanged but some data points have been removed, the remaining data points are rearranged in chronological order to ensure that when selecting data points at adjacent times, the two selected data points are temporally continuous and both belong to the non-charging state. Next, two data points at adjacent times are selected sequentially, and the difference between the battery charge value of the data point at the later time and the battery charge value of the data point at the previous time is calculated. Finally, all differences are summed and inverted to obtain the battery charge change corresponding to the data segment. Each data segment independently performs the above charging data removal and charge change calculation, enabling each battery system to individually identify its charging period and remove data points separately.

[0085] This solution calculates battery charge changes only when the battery is not charging, avoiding interference from the charge increment during charging. This ensures that the calculated charge changes accurately reflect the energy consumption level of the vehicle during actual operation. Furthermore, each data segment is processed independently, allowing for the identification and elimination of charging periods for each battery system, further improving the accuracy of energy consumption calculation in multi-battery system scenarios.

[0086] In existing technologies, charging data identification typically uses a single-parameter judgment method, such as judging solely based on the battery charge increase trend or solely based on the external charging connection signal, which is prone to misjudgment. At the same time, during the charging process, the charging status data may be briefly interrupted due to data reporting delays or signal jitter. If the instantaneous status is judged directly, the same continuous charging process may be misjudged as multiple short charging segments or missed, affecting the accuracy of charging data rejection.

[0087] Based on this, in one embodiment, S302 may specifically include the following steps: acquiring the vehicle speed and fuel cell net output power corresponding to each data point; determining the data points where the vehicle speed is zero and the fuel cell net output power is zero as charging state data points; forming a candidate charging segment based on a plurality of continuously distributed charging state data points; when the duration of the candidate charging segment reaches a preset threshold, determining all data points in the candidate charging segment as charging data; and removing the charging data from the data segment.

[0088] Vehicle speed: refers to the speed of the vehicle at the time corresponding to the data point.

[0089] Fuel cell net output power: refers to the net output power value of the fuel cell system at the time corresponding to the data point.

[0090] Charging status data points: These are data points that meet the conditions for determining the charging status, i.e., when the vehicle speed is zero and the net output power of the fuel cell is zero.

[0091] Candidate charging segment: refers to a time interval consisting of several continuously distributed charging state data points, which is used as a preliminary candidate to determine whether it is a valid charging segment.

[0092] Preset threshold: refers to the pre-set duration threshold used to determine whether a candidate charging segment is a valid charging segment. Its specific value can be set according to the actual application scenario.

[0093] In this embodiment, when removing charging data from the data slice, the vehicle speed and fuel cell net output power corresponding to each data point are first obtained; then, the data points where the vehicle speed is zero and the fuel cell net output power is zero are determined as charging status data points; next, a candidate charging segment is formed based on several continuously distributed charging status data points. This candidate charging segment is the basic unit for determining charging data, rather than directly determining a single data point as charging data; when the duration of the candidate charging segment reaches a preset threshold, all data points in the candidate charging segment are determined as charging data; finally, the charging data is removed from the data slice.

[0094] This solution integrates data from both vehicle speed and fuel cell net output power to determine the charging status, which is more accurate than a single parameter determination method and can effectively avoid misjudgments in scenarios such as vehicles idling but not charging. At the same time, it uses candidate charging segments composed of continuous charging status data points as the basic judgment unit and combines them with time thresholds for filtering. This can identify charging data that is briefly interrupted due to data reporting delays or signal jitter as the same charging segment, avoiding the situation where the same continuous charging process is split into multiple charging segments or is missed, thereby improving the accuracy and robustness of charging data identification.

[0095] In existing technologies, the calculation of power changes in each data segment is usually done in a serial processing manner. The overall time consumption increases linearly with the increase in the number of segments, which cannot make full use of the server's multi-core CPU resources.

[0096] Based on this, in one embodiment, S104 may specifically include the following steps: allocating each of the data shards to multiple processes in a process pool, and having each process execute in parallel the step of calculating the change in battery power corresponding to each of the data shards.

[0097] Process pool: refers to a pre-created resource pool used to manage and reuse multiple processes. The pool contains several processes for executing data processing tasks in parallel.

[0098] In this embodiment of the application, when calculating the battery power change corresponding to each data segment, each data segment is first allocated to multiple processes in the process pool, that is, multiple available processes are selected from the process pool and different data segments are assigned to different processes respectively; then, each process executes the step of calculating the battery power change corresponding to each data segment in parallel, that is, each process independently executes the calculation of the power change on the data segment allocated to its own process, and the processes do not wait for each other or interfere with each other.

[0099] This solution utilizes a process pool to manage and schedule multiple processes in a unified manner, enabling parallel computation of multiple data shards. This reduces the overall computation time from the sum of the computation times of each shard to the computation time of the longest-running shard in a single batch, making full use of the server's multi-core CPU resources and significantly improving data processing efficiency.

[0100] In existing technologies, the calculation results of each data shard are usually written to the database one by one by inserting them. The number of writes is proportional to the number of calculation results, and the overall write time is too long.

[0101] Based on this, in one embodiment, S105 may specifically include the following steps: grouping the battery power change of each data segment according to a preset write batch size to obtain multiple data groups; and writing each data group into a database using a streaming loading method.

[0102] Preset write batch size: refers to the number of calculation result rows included in a single write operation, used to control the data scale of a single write.

[0103] Streaming loading: refers to a loading method that continuously transmits data in the form of a stream and writes it to the database in batches.

[0104] In this embodiment, after summarizing the battery power changes of each data segment, the battery power changes of each data segment are first grouped according to a preset write batch size. That is, according to the preset write batch size, all calculation results are divided into multiple data groups. The number of calculation results in each data group does not exceed the preset write batch size. The number of groups is equal to the total number of calculation results divided by the preset write batch size and rounded up. For example, if there are 1000 calculation results in total and the preset write batch size is 100, then all calculation results are divided into 10 data groups. Then, each data group is written to the database using a streaming loading method. That is, the batch data in each data group is continuously transmitted in the form of a stream and written to the database group by group until all data groups are written.

[0105] This solution aggregates multiple calculation results into a batch before writing them to the database, optimizing the number of writes from being proportional to the number of calculation results to being proportional to the number of groups, which significantly reduces the number of database writes. At the same time, it adopts a streaming loading method, in which data is continuously transmitted in the form of a stream, which further reduces database connection overhead and network transmission overhead, and improves the throughput of result data entering the database.

[0106] Figure 4 This is a block diagram illustrating an embodiment of a battery data processing device provided in this application. Figure 4 As shown, the device includes: The acquisition module 41 is used to acquire the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier; Reading module 42 is used to read the battery sensing data corresponding to the combined identifier in batches according to a preset reading batch; The partitioning module 43 is used to divide battery sensing data belonging to the same combination identifier into the same data segment, resulting in several data segments. Calculation module 44 is used to calculate the change in battery power corresponding to each of the data segments; The output module 45 is used to summarize and output the changes in battery power of each data segment.

[0107] In one possible implementation, the acquisition module is specifically used for: Retrieve vehicle operation records within a preset date range; Extract the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed from the vehicle operation records.

[0108] In one possible implementation, the reading module is specifically used for: Get the current available memory capacity of the server; The threshold for the amount of data read in a single operation is determined based on the currently available memory capacity. According to the data volume threshold, all combined identifiers are processed in batches to obtain multiple batches; Read the battery sensor data corresponding to each batch in batches.

[0109] In one possible implementation, the device further includes a conversion module for: Detect the original format of the time field in the battery sensing data; Identify non-standard time format features in the original format to obtain the identification result; Based on the recognition results, the original format is uniformly converted into a preset standard time format.

[0110] In one possible implementation, the computing module is specifically used for: For each data segment, the battery sensing data in the data segment are arranged into several data points in chronological order; Based on several of the aforementioned data points, charging data is removed from the data slices; After removing the charging data, the data points are arranged in chronological order. Select two data points from adjacent time points in sequence, and calculate the difference between the battery charge value of the data point at the later time point and the battery charge value of the data point at the previous time point; The battery charge change corresponding to the data segment is obtained by summing all the differences and then inverting them.

[0111] In one possible implementation, the computing module is further configured to: Obtain the vehicle speed and net output power of the fuel cell corresponding to each of the data points; Data points where the vehicle speed is zero and the net output power of the fuel cell is zero are identified as charging status data points; Based on a number of continuously distributed charging state data points, a candidate charging segment is formed. When the duration of the candidate charging segment reaches a preset threshold, all data points within the candidate charging segment are determined to be charging data. Remove the charging data from the data slice.

[0112] In one possible implementation, the computing module is further configured to: Each data shard is assigned to multiple processes in a process pool, and each process executes the step of calculating the change in battery power corresponding to each data shard in parallel.

[0113] In one possible implementation, the output module is specifically used for: The battery power change of each data segment is grouped according to the preset batch size to obtain multiple data groups; The data is grouped and written to the database using a streaming loading method.

[0114] In one possible implementation, the acquisition module is further configured to: The vehicle identifier and the battery system identifier are concatenated to generate an intermediate identifier in string form; The intermediate identifier is determined as the combined identifier, wherein each of the combined identifiers uniquely corresponds to a set of battery systems for a vehicle.

[0115] like Figure 5As shown in the figure, this application embodiment provides a vehicle, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114. Memory 113 is used to store computer programs; In one embodiment of this application, when the processor 111 executes the program stored in the memory 113, it implements the battery data processing method provided in any of the foregoing method embodiments, including: Obtain the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier; Read battery sensor data corresponding to the combined identifier in batches according to the preset reading batch; Battery sensor data belonging to the same combination of identifiers are divided into the same data slice, resulting in several data slices; Calculate the change in battery charge for each of the data segments; The battery charge changes of each data segment are summarized and output.

[0116] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the battery data processing method provided in any of the foregoing method embodiments.

[0117] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the battery data processing methods described in the above embodiments.

[0118] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0119] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0120] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0121] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A battery data processing method, characterized in that, The method includes: Obtain the vehicle identifier and battery system identifier of the vehicle to be processed, and generate a combined identifier based on the vehicle identifier and the battery system identifier; Read battery sensor data corresponding to the combined identifier in batches according to the preset reading batch; Battery sensor data belonging to the same combination of identifiers are divided into the same data slice, resulting in several data slices; Calculate the change in battery charge for each of the data segments; The battery charge changes of each data segment are summarized and output.

2. The method according to claim 1, characterized in that, The acquisition of the vehicle identifier and battery system identifier of the vehicle to be processed includes: Retrieve vehicle operation records within a preset date range; Extract the vehicle identifier of the vehicle to be processed and the battery system identifier of each battery system installed in the vehicle to be processed from the vehicle operation records.

3. The method according to claim 1, characterized in that, The step of reading battery sensor data corresponding to the combined identifier in batches according to a preset reading batch includes: Get the current available memory capacity of the server; The threshold for the amount of data read in a single operation is determined based on the currently available memory capacity. According to the data volume threshold, all combined identifiers are processed in batches to obtain multiple batches; Read the battery sensor data corresponding to each batch in batches.

4. The method according to claim 1, characterized in that, After reading the battery sensor data corresponding to the combined identifier in batches according to a preset reading batch, the method further includes: Detect the original format of the time field in the battery sensing data; Identify non-standard time format features in the original format to obtain the identification result; Based on the recognition results, the original format is uniformly converted into a preset standard time format.

5. The method according to claim 1, characterized in that, The calculation of the battery charge change corresponding to each of the data segments includes: For each data segment, the battery sensing data in the data segment are arranged into several data points in chronological order; Based on several of the aforementioned data points, charging data is removed from the data slices; After removing the charging data, the data points are arranged in chronological order. Select two data points from adjacent time points in sequence, and calculate the difference between the battery charge value of the data point at the later time point and the battery charge value of the data point at the previous time point; The battery charge change corresponding to the data segment is obtained by summing all the differences and then inverting them.

6. The method according to claim 5, characterized in that, The step of removing charging data from the data slices based on a plurality of data points includes: Obtain the vehicle speed and net output power of the fuel cell corresponding to each of the data points; Data points where the vehicle speed is zero and the net output power of the fuel cell is zero are identified as charging status data points; Based on a number of continuously distributed charging state data points, a candidate charging segment is formed. When the duration of the candidate charging segment reaches a preset threshold, all data points within the candidate charging segment are determined to be charging data. Remove the charging data from the data slice.

7. The method according to claim 1, characterized in that, The calculation of the battery charge change corresponding to each of the data segments includes: Each data shard is assigned to multiple processes in a process pool, and each process executes the step of calculating the change in battery power corresponding to each data shard in parallel.

8. The method according to claim 1, characterized in that, The process of summarizing and outputting the battery power changes for each data segment includes: The battery power change of each data segment is grouped according to the preset batch size to obtain multiple data groups; The data is grouped and written to the database using a streaming loading method.

9. The method according to claim 1, characterized in that, The step of generating a combined identifier based on the vehicle identifier and the battery system identifier includes: The vehicle identifier and the battery system identifier are concatenated to generate an intermediate identifier in string form; The intermediate identifier is determined as the combined identifier, wherein each of the combined identifiers uniquely corresponds to a set of battery systems for a vehicle.

10. A vehicle, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-9.