Data processing method and device, equipment, storage medium and program product

By using multi-partition storage and counter marking, the problem that data storage and retrieval methods cannot meet the needs of modern computer development is solved, and effective management and traceability of data versions are achieved, avoiding waste of hardware resources.

CN120973759APending Publication Date: 2025-11-18XIAOMI EV TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510867055.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In existing technologies, data storage and retrieval methods cannot meet the needs of modern computer development, resulting in wasted hardware resources and a lack of data version control, making it impossible to effectively manage and trace historical data.

Method used

A multi-partition storage method is adopted, in which different versions of data are stored in different partitions, and a counter is used to mark the version of the data stored in each partition. The target data in the target partition is read using the counter to achieve version control.

Benefits of technology

It effectively avoids the waste of hardware resources, enables the management and backtracking of data versions, and ensures that the latest and valid data version is read.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120973759A_ABST
    Figure CN120973759A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, equipment, a storage medium and a program product. Belongs to the technical field of computers. The method comprises the following steps: respectively storing data of different versions into different partitions, and marking the version of the data stored in each partition through a counter; target data of a target version stored in a target partition is read according to the counter, the partition comprises the target partition, the version comprises the target version, and the data comprises the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure belongs to the field of computer technology, and more specifically, relates to a data processing method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product. Background Technology

[0002] In modern life and work, computers are used more and more frequently, and the development of computers themselves is accelerating, with new technologies emerging one after another. Data storage and retrieval in computers are becoming increasingly important. Existing data storage and retrieval methods in related technologies are no longer sufficient to meet these demands. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a data processing method, apparatus, electronic device, non-transitory computer-readable storage medium, and computer program product, which can achieve more efficient data storage and retrieval.

[0004] According to a first aspect of the present disclosure, a data processing method is provided, the method comprising: storing different versions of data into different partitions respectively, and marking the version of the data stored in each partition with a counter; reading target data of a target version stored in a target partition according to the counter, wherein the partition includes the target partition, the version includes the target version, and the data includes the target data.

[0005] In some possible implementations, the partitions include a first partition and a second partition, the versions include a first version, a second version, and a third version, the data of the first version is first data, the data of the second version is second data, and the data of the third version is third data; the counters include a first counter and a second counter. Specifically, storing different versions of data in different partitions and marking the version of the data stored in each partition using counters includes: storing the first data of the first version, the first checksum of the first data, and the first value of the first counter in the first partition; storing the second data of the second version, the second checksum of the second data, and the second value of the second counter in the second partition; obtaining the third data of the third version and its third checksum; and storing the third data of the third version and its third checksum in the first partition and / or the second partition based on the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter.

[0006] In some possible implementations, storing the third version of the third data and its third checksum in the first partition and / or the second partition based on the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter includes: determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; comparing the magnitudes of the first value of the first counter and the second value of the second counter to obtain a comparison result; and storing the third version of the third data and its third checksum in the first partition and / or the second partition based on whether the first data and the second data are valid and the comparison result.

[0007] In some possible implementations, determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum includes: calculating a first checksum of the first data, calculating a second checksum of the second data; determining whether the calculated first checksum matches the first checksum stored in the first partition; if the calculated first checksum matches the first checksum stored in the first partition, then the first data is determined to be valid; if the calculated first checksum does not match the first checksum stored in the first partition, then the first data is determined to be invalid; determining whether the calculated second checksum matches the second checksum stored in the second partition; if the calculated second checksum matches the second checksum stored in the second partition, then the second data is determined to be valid; if the calculated second checksum does not match the second checksum stored in the second partition, then the second data is determined to be invalid.

[0008] In some possible implementations, storing the third version of the third data and its third checksum in the first partition and / or the second partition based on whether the first data and the second data are valid, and the comparison result, includes: if both the first data and the second data are valid, and the comparison result is that the first value of the first counter is greater than or equal to the second value of the second counter and neither is 0, then storing the third version of the third data and its third checksum in the second partition, and updating the second value of the second counter; if the comparison result is that the first value of the first counter is less than the second value of the second counter, then storing the third version of the third data and its third checksum in the first partition, and updating the first value of the first counter; if the comparison result is that the first value of the first counter is less than the second value of the second counter, then storing the third version of the third data and its third checksum in the first partition, and updating the first value of the first counter; if the first value of the first counter and the second checksum are valid, then storing the third version of the third data and its third checksum in the first partition, and updating the first value of the first counter; if the comparison result is that the first value of the first counter and the second checksum are valid, then storing the third version of the third data and its third checksum in the first partition, and updating the first value of the first counter; if the comparison result is that the first value of the first counter and the second checksum are valid, then storing the third version of the third data and its third checksum in the first partition, and updating the second checksum ... If the second value of the counters is 0 for both, then the third data of the third version and its third checksum are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated; if the first data is valid, then the third data of the third version and its third checksum are stored in the second partition, and the second value of the second counter is updated; if the first data is invalid and the second data is valid, then the third data of the third version and its third checksum are stored in the first partition, and the first value of the first counter is updated; if both the first data and the second data are invalid, then the third data of the third version and its third checksum are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated.

[0009] In some possible implementations, the partition includes a first partition and a second partition; the version includes a first version and a second version, where the data of the first version is first data and the data of the second version is second data; the counter includes a first counter and a second counter; the first partition stores the first data of the first version, a first checksum of the first data, and a first value of the first counter; the second partition stores the second data of the second version, a second checksum of the second data, and a second value of the second counter. Reading the target data of the target version stored in the target partition according to the counter includes: determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; comparing the first value of the first counter and the second value of the second counter to obtain a comparison result; and, based on whether the first data and the second data are valid and the comparison result, reading the first data of the first version stored in the first partition, or reading the second data of the second version stored in the second partition, as the target data of the target version in the target partition.

[0010] In some possible implementations, reading the first version of the first data stored in the first partition, or reading the second version of the second data stored in the second partition, based on whether the first data and the second data are valid and the comparison result, includes: if both the first data and the second data are valid, and the first value of the first counter is greater than or equal to the second value of the second counter, then reading the first version of the first data stored in the first partition; if the first value of the first counter is less than the second value of the second counter, then reading the second version of the second data stored in the second partition; if the first data is valid, then reading the first version of the first data stored in the first partition; if the first data is invalid, and the second data is valid, then reading the second version of the second data stored in the second partition.

[0011] In some possible implementations, the first partition and the second partition are contained in a general-purpose flash memory.

[0012] In some possible implementations, the general-purpose flash memory is included in a system-on-a-chip (SoC), which further includes random access memory (RAM); wherein the method further includes: the SoC receiving third version of third data and its third checksum; and the SoC storing the third version of the third data and its third checksum into the RAM.

[0013] In some possible implementations, the system-on-a-chip receives the third version of the third data and its third checksum from the microcontroller unit. The microcontroller unit includes non-volatile memory storing the third version of the third data and its third checksum.

[0014] In some possible implementations, the non-volatile memory includes a third partition and a fourth partition. The third partition stores the third version of the third data and its third checksum; the fourth partition stores the fourth version of the fourth data and its fourth checksum.

[0015] In some possible implementations, reading target data of a target version stored in a target partition according to the counter includes: obtaining a read instruction, the read instruction containing target version information; and responding to the read instruction, reading data stored in a partition whose version indicated by the counter matches the target version information, as the target data of the target version in the target partition.

[0016] According to a second aspect of the present disclosure, a data processing apparatus is provided, comprising: a storage unit for storing different versions of data into different partitions, and marking the version of the data stored in each partition by a counter;

[0017] The reading unit is used to read target data of the target version stored in the target partition according to the counter, wherein the partition includes the target partition, the version includes the target version, and the data includes the target data.

[0018] In some possible implementations, the partition includes a first partition and a second partition; the version includes a first version, a second version, and a third version; the data of the first version is first data; the data of the second version is second data; and the data of the third version is third data; the counter includes a first counter and a second counter. The storage unit is further configured to: store the first data of the first version, the first checksum of the first data, and the first value of the first counter in the first partition; and store the second data of the second version, the second checksum of the second data, and the second value of the second counter in the second partition. The apparatus further includes a receiving unit configured to acquire the third data of the third version and its third checksum. The storage unit is further configured to: store the third data of the third version and its third checksum in the first partition and / or the second partition according to the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter.

[0019] In some possible implementations, the storage unit is further configured to: determine whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; compare the magnitudes of the first value of the first counter and the second value of the second counter to obtain a comparison result; and store the third version of the third data and its third checksum in the first partition and / or the second partition based on whether the first data and the second data are valid and the comparison result.

[0020] In some possible implementations, the partition includes a first partition and a second partition, the version includes a first version and a second version, the data of the first version is first data, and the data of the second version is second data; the counter includes a first counter and a second counter. The first partition stores the first data of the first version, a first checksum of the first data, and a first value of the first counter; the second partition stores the second data of the second version, a second checksum of the second data, and a second value of the second counter. The reading unit is further configured to: determine whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; compare the first value of the first counter and the second value of the second counter to obtain a comparison result; and, based on whether the first data and the second data are valid and the comparison result, read the first data of the first version stored in the first partition, or read the second data of the second version stored in the second partition, as the target data of the target version in the target partition.

[0021] In some possible implementations, the apparatus further includes a receiving unit for acquiring a read instruction containing target version information. The reading unit is further configured to: in response to the read instruction, read data stored in a partition whose version indicated by the counter matches the target version information, and use this data as target data for the target version in the target partition.

[0022] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to: implement the steps of any of the data processing methods described herein.

[0023] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform any of the data processing methods described herein.

[0024] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the data processing methods described in the present disclosure.

[0025] The technical solutions provided by the embodiments of this disclosure can include the following beneficial effects: On the one hand, by storing different versions of data in different partitions, different versions of the data can be stored. Since different partitions store different versions of data, rather than a simple copy of the data, the waste of hardware resources is avoided. On the other hand, a counter is used to mark the version of the data stored in each partition, so that the target version of the target data stored in the target partition can be read according to the counter. This is beneficial to be able to trace back the required version of the data when reading, that is, to realize version control of the data.

[0026] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

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

[0028] Figure 1 This is a schematic diagram illustrating a data processing method according to an exemplary embodiment of the present disclosure.

[0029] Figure 2 This is a schematic diagram of a data processing system according to an exemplary embodiment of the present disclosure.

[0030] Figure 3 This is a schematic diagram of a data processing system according to another exemplary embodiment of the present disclosure.

[0031] Figure 4 This is a flowchart illustrating a data processing method according to another exemplary embodiment of the present disclosure.

[0032] Figure 5 This is a schematic diagram illustrating a data processing method according to yet another exemplary embodiment of this disclosure.

[0033] Figure 6 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment of the present disclosure.

[0034] Figure 7 This is a schematic diagram illustrating an application scenario of the method provided in this embodiment.

[0035] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure.

[0036] Figure 9 This is a functional block diagram of a vehicle according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0037] Exemplary embodiments of this disclosure will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. Various changes, modifications, and equivalents of the methods, apparatus, and / or systems described herein will become apparent upon understanding this disclosure. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but can be changed as will become apparent upon understanding this disclosure, except for operations that must be performed in a particular order. Furthermore, for clarity and brevity, descriptions of features known in the art may be omitted.

[0038] The embodiments described below, which are examples of some of the embodiments of this disclosure, do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0039] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0040] In some embodiments, a single-partition storage mode is adopted for data storage. Single-partition storage mode refers to storing data in a single storage area, using contiguous space, treating all data as a whole, and reading and writing sequentially without segmentation or partitioning. For example, in a single-partition storage scheme, the first part of the storage area stores data, followed by a checksum of the stored data, such as a CRC (Cyclic Redundancy Check) code. That is, the data and the CRC checksum are stored contiguously in a single partition, and the data integrity is verified through the CRC checksum. The following embodiments all use CRC checksum as an example, but this disclosure does not limit the specific checksum method; it only needs to be able to verify whether the stored data is valid. However, CRC can only detect errors (such as transmission corruption), but cannot correct errors or recover lost data. Single-partition data storage lacks fault tolerance and backup mechanisms, resulting in unrecoverable data loss. For example, damage to the storage medium (such as bad sectors on a hard drive or SSD (Solid State Disk) flash memory failure) directly leads to permanent data loss. Once data loss occurs, it will cause data corruption, severely impacting the user experience. At the same time, the single data storage method only saves the latest data. Any data change will overwrite the historical records, making it impossible to recover the historical versions of the data.

[0041] In other embodiments, a dual-partition storage scheme is adopted for data storage. One partition is used to store the data, and the other partition is used as a backup. For example, the data stored in partition A and the CRC checksum are copied to partition B. This method can provide redundant backup of the data, and the data can be recovered from the other partition if a single partition fails. However, backing up each piece of data one by one leads to excessive redundancy in storage and management, requiring twice the storage space (100% redundancy), and the cost increases linearly with the amount of data. Furthermore, since all backup data is identical, it is impossible to distinguish data changes at different points in time, i.e., there is a lack of version control. It can only be restored to the last backup state, making it impossible to trace historical data changes. This backup strategy wastes hardware costs and resources.

[0042] Figure 1 This is a schematic diagram illustrating a data processing method according to an exemplary embodiment of this disclosure. The method provided in this embodiment can be executed by any electronic device or computer device with information processing capabilities, such as a terminal (e.g., a mobile terminal) and / or a server; this disclosure does not limit its scope. The electronic devices used in this embodiment may include smartphones, tablets, wearable electronic devices, vehicles, etc., and are not limited thereto. Figure 1 As shown, the method provided in this disclosure embodiment may include the following steps.

[0043] In S110, different versions of data are stored in different partitions, and a counter is used to mark the version of the data stored in each partition.

[0044] The data in this disclosure refers to any data to be stored in an electronic device, such as user data (running logs, user input, etc.), configuration data, program code (algorithm logic), etc. In the following embodiments, the storage and retrieval of configuration data are used as examples, but this disclosure is not limited thereto. For example, the data could be all the data information of an in-vehicle entertainment system. Exemplarily, the in-vehicle entertainment system can be contained in a vehicle, such as a new energy vehicle.

[0045] The configuration data in this embodiment can also be referred to as system configuration information, system configuration information, or system information. It is key metadata that defines system behavior, parameters, and initial settings. It determines the operation of hardware, software, or complex devices, but does not involve program logic or user data.

[0046] In this embodiment, the system configuration information is an adjustable set of static parameters that can be used for hardware initialization, such as defining device operating modes (e.g., clock frequency, I / O pin functions); software behavior control, such as setting algorithm parameters, function switches, and safety thresholds; and resource allocation, such as planning the usage strategies for resources like memory, storage, and bandwidth. The system configuration information can be modified through configuration tools or interfaces without recompiling the code. The system configuration information can be persistently stored and remain effective after a system restart (e.g., EEPROM (Electrically Erasable Programmable Read-Only Memory) or UFS (Universal Flash Storage) storage). The system configuration information can be global, affecting the entire system (e.g., language settings), module-level, targeting specific components (e.g., motor control PID (Proportional Integral Derivative) parameters), or user-configured for personalized settings (e.g., seat position memory). For new energy vehicles, system configuration information can include motor torque curves, battery SOC (State of Charge) thresholds, and headlight brightness settings to optimize performance and user experience. For cloud computing, system configuration information can include virtual machine resource quotas, network ACL rules, and storage replica counts to achieve elastic resource management and security protection. For the Industrial Internet of Things (IIoT), system configuration information can include sensor sampling rates, alarm trigger conditions, and communication protocol versions to ensure device collaboration and data accuracy. For operating systems, system configuration information includes kernel parameters, file system mount options, and user permission tables to provide flexible system customization capabilities.

[0047] When the method provided in this embodiment is applied to a vehicle, the configuration data may be the vehicle's overall configuration information, such as wheel size, interior and exterior colors, vehicle refrigerator, HUD (head-up display), electric drive type (e.g., four-wheel drive or two-wheel drive), etc.

[0048] In this embodiment, a multi-partition storage method is adopted, for example, dividing the data into N partitions, where N is a positive integer greater than or equal to 2. Each of the N partitions stores a different version of the data, that is, the N partitions store N different versions of the data. In other words, the N partitions do not copy the exact same data N times, but each partition stores a different version of the data. The data between the different versions has at least some data updates, such as adding fields, deleting fields, or modifying the values ​​of one or more fields.

[0049] In this embodiment of the disclosure, the version of the data stored in different partitions is distinguished by the value of a counter. For example, as the number of times the data in a partition is stored increases, the value of the counter corresponding to the partition is increased, thereby determining the version of the data stored in that partition.

[0050] For example, the partition includes a first partition and a second partition, the version includes a first version, a second version, and a third version, the data of the first version is first data, the data of the second version is second data, and the data of the third version is third data; the counter includes a first counter and a second counter; wherein, storing data of different versions into different partitions and marking the version of the data stored in each partition with a counter includes: storing the first data of the first version, the first checksum of the first data, and the first value of the first counter into the first partition; storing the second data of the second version, the second checksum of the second data, and the second value of the second counter into the second partition; obtaining the third data of the third version and its third checksum; and storing the third data of the third version and its third checksum into the first partition and / or the second partition according to the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter.

[0051] In the following embodiments, dual-partition data storage is used as an example, which includes a first partition and a second partition. The first partition stores the first version of the first data, and the second partition stores the second version of the second data. However, this disclosure is not limited to this. In other embodiments, more partitions can be set according to actual needs. For example, if it is desired to backtrack to more versions of data, a corresponding number of partitions can be set to store the corresponding number of versions of data.

[0052] For example, the third version of the third data can be the latest version of the data received, which, when the data is configuration data, is the latest configuration.

[0053] For example, storing the third version of the third data and its third checksum in the first partition and / or the second partition according to the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter includes: determining whether the first data and the second data are valid according to the first data, the first checksum, the second data, and the second checksum; comparing the first value of the first counter and the second value of the second counter to obtain a comparison result; and storing the third version of the third data and its third checksum in the first partition and / or the second partition according to whether the first data and the second data are valid and the comparison result.

[0054] For example, determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum includes: calculating a first checksum of the first data, calculating a second checksum of the second data; determining whether the calculated first checksum matches the first checksum stored in the first partition; if the calculated first checksum matches the first checksum stored in the first partition, then the first data is determined to be valid; if the calculated first checksum does not match the first checksum stored in the first partition, then the first data is determined to be invalid; determining whether the calculated second checksum matches the second checksum stored in the second partition; if the calculated second checksum matches the second checksum stored in the second partition, then the second data is determined to be valid; if the calculated second checksum does not match the second checksum stored in the second partition, then the second data is determined to be invalid.

[0055] For example, storing the third version of the third data and its third checksum in the first partition and / or the second partition according to whether the first data and the second data are valid and the comparison result includes: if both the first data and the second data are valid, and the comparison result is that the first value of the first counter is greater than or equal to the second value of the second counter and neither is 0, then storing the third version of the third data and its third checksum in the second partition and updating the second value of the second counter; if the comparison result is that the first value of the first counter is less than the second value of the second counter, then storing the third version of the third data and its third checksum in the first partition and updating the first value of the first counter; if the first value of the first counter and the second counter are valid, then storing the third version of the third data and its third checksum in the first partition and updating the first value of the first counter; if the comparison result is that ... If the second value of each of the above is 0, then the third data of the third version and its third checksum are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated; if the first data is valid, then the third data of the third version and its third checksum are stored in the second partition, and the second value of the second counter is updated; if the first data is invalid and the second data is valid, then the third data of the third version and its third checksum are stored in the first partition, and the first value of the first counter is updated; if both the first data and the second data are invalid, then the third data of the third version and its third checksum are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated.

[0056] Through the above-described data storage method, this disclosure embodiment ensures that, except for certain special times, such as the initial time (e.g., when the first value equals the second value and both are 0), different versions of data are stored in different partitions. On the other hand, it can ensure that the different versions of data stored in different partitions are valid as much as possible. When the data stored in one or more partitions is invalid, the received latest version of the data and its checksum will overwrite or replace the invalid data.

[0057] In S120, target data of the target version stored in the target partition is read according to the counter. The partition includes the target partition, the version includes the target version, and the data includes the target data.

[0058] For example, the partition includes a first partition and a second partition, the version includes a first version and a second version, the data of the first version is first data, and the data of the second version is second data; the counter includes a first counter and a second counter. The first partition stores the first data of the first version, the first checksum of the first data, and the first value of the first counter; the second partition stores the second data of the second version, the second checksum of the second data, and the second value of the second counter. Reading the target data of the target version stored in the target partition according to the counter includes: determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; comparing the first value of the first counter and the second value of the second counter to obtain a comparison result; and, based on whether the first data and the second data are valid and the comparison result, reading the first data of the first version stored in the first partition, or reading the second data of the second version stored in the second partition, as the target data of the target version in the target partition.

[0059] For example, reading the first version of the first data stored in the first partition or reading the second version of the second data stored in the second partition, based on whether the first data and the second data are valid and the comparison result, includes: if both the first data and the second data are valid, and the first value of the first counter is greater than or equal to the second value of the second counter, then reading the first version of the first data stored in the first partition; if the first value of the first counter is less than the second value of the second counter, then reading the second version of the second data stored in the second partition; if the first data is valid, then reading the first version of the first data stored in the first partition; if the first data is invalid and the second data is valid, then reading the second version of the second data stored in the second partition.

[0060] The data reading method provided in this embodiment can ensure that valid and latest versions of data are read from different versions of data stored in different partitions.

[0061] For example, reading target data of a target version stored in a target partition according to the counter includes: obtaining a read instruction, the read instruction containing target version information; and responding to the read instruction, reading data stored in a partition whose version indicated by the counter matches the target version information, as the target data of the target version in the target partition.

[0062] The data reading method provided in this disclosure can respond to the target version information in the reading command and realize the backtracking of the specified version of the data.

[0063] The method provided in this disclosure, on the one hand, stores different versions of data in different partitions, thereby storing different versions of the data. Since different partitions store different versions of data, rather than simply copying the data, it avoids wasting hardware resources. On the other hand, it also marks the version of the data stored in each partition with a counter, so that the target version of the target data stored in the target partition can be read according to the counter. This is beneficial for backtracking the required version of the data when reading, that is, it realizes version control of the data.

[0064] For example, the first partition and the second partition are contained in Universal Flash Memory (UFS).

[0065] For example, the general-purpose flash memory is included in a system-on-chip (SOC), which further includes random access memory (RAM). The method further includes: the SOC receiving third version of third data and its third checksum; and the SOC storing the third version of the third data and its third checksum in the RAM.

[0066] For example, the system-on-a-chip receives the third version of the third data and its third checksum from a microcontroller unit (MCU); wherein the microcontroller unit includes a non-volatile memory (e.g., EEPROM) that stores the third version of the third data and its third checksum.

[0067] The following examples illustrate the methods provided in the embodiments of this disclosure by describing the storage and retrieval of configuration data.

[0068] Figure 2A schematic diagram illustrating the saving of configuration data is shown. For example... Figure 2 As shown, the data processing system includes an MCU 100 and an SOC 200. Exemplarily, the MCU 100 includes an EEPROM 110. MCUs are often used in battery-powered devices (such as sensor nodes), and the static power consumption of EEPROMs is close to zero. MCUs can be used to store small amounts of critical data such as calibration parameters and firmware versions. EEPROMs support maintaining data integrity under power fluctuations, making them suitable for industrial environments. However, this disclosure is not limited to this; in other embodiments, MCUs begin to use FRAM (ferroelectric memory) or simulated EEPROMs (simulated via flash memory) to replace EEPROMs, improving erase and write lifespan.

[0069] For example, the SOC 200 includes RAM 210 and UFS 220. RAM (Runtime Memory) provides nanosecond-level response speeds, hosting the operating system, application processes, and real-time data. RAM employs dynamic power management (such as LPDDR5's Deep Sleep mode) to balance performance and power consumption. UFS (Storage Memory) achieves GB / s-level bandwidth through multi-channel parallel technology, meeting the high-throughput demands of large application installations and 4K video recording. UFS supports multiple power states (Active / Idle / Sleep) to adapt to different usage scenarios. UFS can scale to terabyte-level storage to meet users' data growth needs.

[0070] UFS is a flash memory storage interface standard designed for high-performance mobile devices and embedded systems. UFS is a flash memory interface standard based on multi-channel parallel transmission, enabling synchronous data read and write operations through full-duplex communication. In UFS, a Bank (storage unit or block) is an independent operating unit within a NAND flash memory chip, which improves the overall performance of the storage system through a parallel access mechanism. Each Bank contains an independent storage array, read / write circuitry, and control logic. It supports the simultaneous activation of multiple Banks to perform different operations (e.g., one Bank reading data while another writes data). For example, the first and second partitions mentioned above can be two different Banks in a UFS220, such as BankA and BankB.

[0071] In the field of automotive electronics, the management of system configuration information must comply with security standards, employing multiple backups (such as EEPROM + UFS dual storage) and verification mechanisms to ensure the reliability of critical parameters (such as brake priority settings). This design balances flexibility (configurability) with security (tamper resistance). This hierarchical storage architecture enables fast processing through RAM, massive storage through UFS, and uses EEPROM to persist basic configurations or back up the latest configurations. This design achieves a precise balance between power consumption, cost, and performance.

[0072] For example, EEPROM 110 includes ConfigData 111 and its corresponding CRC 112. For example, ConfigData 111 included in EEPROM 110 is the latest configuration, for example, ConfigData 111 is third data of the third version (e.g., third configuration data), and CRC 112 is the third checksum.

[0073] For example, RAM 210 includes ConfigData 211 and CRC 212. For example, ConfigData 211 and CRC 212 can be the same as ConfigData 111 and its corresponding CRC 112 stored in EEPROM 110. That is, after MCU 100 parses and obtains the latest configuration, it first stores it in its internal EEPROM 110, and then sends the latest configuration to SOC 200. After receiving the latest configuration, SOC 200 can first store it in RAM 210 to quickly provide the latest configuration to other applications.

[0074] For example, UFS220 includes ConfigData_BankA (e.g., first data of the first version, such as the first configuration data of the first version), Counter_A (e.g., a first counter) and CRC 221 (e.g., a first checksum), ConfigData_BankB (e.g., second data of the second version, such as the second configuration data of the second version), Counter_B (e.g., a second counter) and CRC 222 (e.g., a second checksum).

[0075] For example, ConfigData_BankA contains the previously stored configuration, and ConfigData_BankB contains the configuration stored two years prior. That is, BankA and BankB in UFS220 can be used to store the two most recent versions of configuration data. However, this disclosure is not limited to this; BankA and BankB can be used to store any two versions of configuration data. After SOC 200 stores the latest configuration in RAM 210, the latest configuration in RAM 210 can be used to replace or update the previous versions of data stored in BankA and / or BankB.

[0076] The meanings of the fields storing configuration data or configuration information in this embodiment are as follows:

[0077] ConfigData: Configuration data that needs to be stored;

[0078] ConfigData_BankA: Configuration data stored in BankA, which can be referred to as the first configuration data for distinction;

[0079] ConfigData_BankB: Configuration data stored in BankB, which can be referred to as the second configuration data for distinction;

[0080] Counter_A: Records the number of times BankA stores configuration data; for distinction, it is called the first counter.

[0081] Counter_B: Records the number of times BankB stores configuration data; it is called the second counter for distinction.

[0082] CRC: The CRC of the stored configuration data ConfigData, including the first checksum, second checksum, third checksum, etc.

[0083] For example, the non-volatile memory includes a third partition and a fourth partition; wherein, the third partition stores the third version of the third data and its third checksum; and the fourth partition stores the fourth version of the fourth data and its fourth checksum. The following is in conjunction with... Figure 3 Let's illustrate with examples.

[0084] Figure 3 The data processing system shown is Figure 2 One difference is that EEPROM 110 includes a third partition A and a fourth partition B. Third partition A stores ConfigData 111 (third data, such as third configuration data) and CRC 112 (third checksum). Fourth partition B stores ConfigData 113 (fourth data, such as fourth configuration data) and CRC 114 (fourth checksum). This means that different versions of dual or multiple backups can also be implemented on the MCU side.

[0085] For example, ConfigData 113 and CRC 114 stored in the fourth partition B may be the same as ConfigData_BankA and CRC 221 stored in the first partition in UFS220, but this disclosure is not limited thereto.

[0086] refer to Figure 3 The MCU 100 and SOC 200 can perform bidirectional communication, including channel handshake and data acknowledgment (ACK).

[0087] Figure 2 and Figure 3The system shown is a heterogeneous architecture, and the method provided in this disclosure can be used to save system configuration information under a heterogeneous architecture. Heterogeneous architectures integrate different types of components, technologies, or systems, achieving overall performance optimization or functional expansion through collaborative work, and realizing diverse combinations across multiple dimensions such as hardware, software, and networks. The combination of an MCU and a SoC is a typical heterogeneous hardware architecture, maximizing system efficiency through differentiated division of labor. The MCU focuses on real-time control and low-power tasks (such as sensor data acquisition and motor driving). The SoC integrates multi-core processors such as CPU / GPU / NPU, undertaking complex calculations (such as image processing and operating system operation). For example, in automotive electronics, the MCU drives the window motor, while the SoC runs the in-vehicle infotainment system.

[0088] This tiered storage solution in new energy vehicles combines the storage characteristics of EEPROM, RAM, and UFS, achieving data reliability, access efficiency, and system scalability. On one hand, it provides a triple redundancy mechanism to ensure data reliability. EEPROM (MCU-side) serves as non-volatile storage for original configuration information (e.g., the latest configuration), ensuring no configuration loss in case of power failure. RAM (SoC-side temporary storage) provides fast runtime access, supporting real-time verification and preprocessing of configuration parameters / data. UFS (SoC-side persistent storage) uses flash memory to achieve long-term storage of configuration data, forming a final backup. Data communication between the MCU and SoC can integrate CRC / ECC verification to prevent configuration failure due to transmission errors. On the other hand, tiered storage can improve system response speed. The SoC can directly access configuration parameters from RAM, significantly reducing response time compared to reading directly from UFS. Setting UFS write operations as low-priority background tasks avoids blocking real-time control threads. UFS can employ wear leveling algorithms to distribute configuration data across different flash blocks, improving the overall storage media lifespan. UFS can store multiple configuration data versions, providing rollback capabilities for over-the-air (OTA) upgrades. If the UFS configuration is corrupted, the basic / latest configuration can be reloaded from the MCU's EEPROM or the SOC's RAM to ensure the vehicle enters safe mode.

[0089] For example, during vehicle startup, the SoC loads the complete configuration (including user-personalized settings) from the UFS. When switching driving modes, the MCU updates motor control parameters to the EEPROM, and the SoC simultaneously updates the RAM and UFS. The SoC prioritizes restoring the configuration from the UFS to avoid full parameter re-initialization (saving startup time).

[0090] For example, the ConfigData configuration data saving process is as follows:

[0091] All vehicle configuration information is parsed (the MCU side can store one latest copy or two backups) and stored in the MCU side EEPROM;

[0092] The MCU sends the latest ConfigData configuration data from the EEPROM to the SOC;

[0093] After receiving the latest ConfigData configuration data, the SOC will first put it into RAM, which can then be directly provided to other applications (all app functional modules can use it, through AIDL interface, API interface, proid interface, etc.).

[0094] The SOC side stores the latest ConfigData configuration data it receives into UFS, using an A / B Bank approach; thus, the SOC side simultaneously possesses three copies of the ConfigData configuration data.

[0095] In this embodiment of the disclosure, N different versions of data can be stored in the UFS and / or EEPROM. If more different versions are to be stored, utilizing more banks in the UFS and / or EEPROM, N address blocks are required.

[0096] This solution can be expanded to three or more banks in UFS for backup, with each bank storing different versions of the data.

[0097] Figure 4 A flowchart illustrating UFS data storage is shown. Figure 4 This embodiment uses dual-partition data storage as an example, and assumes that the dual partitions are deployed on the UFS, i.e., the SOC side. However, in other embodiments, such dual-partition data storage can also be performed on the MCU side.

[0098] In S201, calculate the CRC of ConfigData_BankA and ConfigData_BankB.

[0099] In this embodiment of the disclosure, the CRC of the ConfigData data in BankA and BankB is first calculated, that is, the first check code is calculated according to the first configuration data, and the second check code is calculated according to the second configuration data.

[0100] In S202, determine whether the data in BankA and BankB are both valid; if yes, continue to S203; otherwise, proceed to S206.

[0101] In this embodiment of the disclosure, the CRC of the ConfigData data in BankA and BankB obtained by calculation is compared with the stored CRC to determine whether the data in BankA and BankB is valid. If the first checksum stored in BankA matches the calculated first checksum, the first configuration data stored in BankA is valid; otherwise, the first configuration data is invalid. If the second checksum stored in BankB matches the calculated second checksum, the second configuration data stored in BankB is valid; otherwise, the second configuration data is invalid.

[0102] In S203, determine whether Counter_A is greater than or equal to Counter_B; if yes, continue to S204; if no, proceed to S205.

[0103] In S204, the data is stored in BankB. Then the operation ends.

[0104] In step S205, the data is stored in BankA. Then the operation ends.

[0105] In this embodiment of the disclosure, if the ConfigData data in both BankA and BankB are valid, then Counter_A is compared to see if it is greater than or equal to Counter_B.

[0106] If Counter_A is greater than or equal to Counter_B and neither is 0, it means that the data in BankA has been updated. The data (such as the third configuration data and its third check code) is stored in BankB and the second value corresponding to Counter_B is incremented.

[0107] Initially, both the first and second configuration data are 0 or 1, Counter_A = Counter_B = 0, and the RCR check is incorrect because the CRC of all zeros is not all zeros. Therefore, the received third configuration data and its third check code are stored in BankA and BankB at the same time, and Counter_A = Counter_B = 1 is updated simultaneously.

[0108] If Counter_A is less than Counter_B, it means that the data in BankB has been updated, and the data (such as the third configuration data and its third checksum) should be stored in BankA.

[0109] In S206, determine whether the BankA data is valid; if yes, proceed to S207; otherwise, proceed to S208.

[0110] In S207, the data is stored in BankB. Then the operation ends.

[0111] In S208, determine whether the data in BankB is valid; if yes, proceed to S209; otherwise, proceed to S210.

[0112] In step S209, the data is stored in BankA. Then the operation ends.

[0113] In step S210, the data is stored in BankA and BankB. Then the operation ends.

[0114] In this embodiment, if not all ConfigData data in BankA and BankB are valid, the validity of the data in BankA is checked. If the data in BankA is valid, the data (e.g., third configuration data and its third verification code) is stored in BankB. If the data in BankA is invalid, the validity of the data in BankB is checked again. If the data in BankB is valid, the data (e.g., third configuration data and its third verification code) is stored in BankA. If the data in BankB is invalid, the data (e.g., third configuration data and its third verification code) is stored in both BankA and BankB.

[0115] In this embodiment of the disclosure, when both BankA and BankB data are invalid, the latest configuration data is written to both BankA and BankB simultaneously, ensuring that the data in both is identical, so as to maximize the validity of the data in both BankA and BankB.

[0116] Figure 5 The flowchart for reading data from UFS is shown, illustrating the process of reading data from two partitions.

[0117] In S301, the CRC of ConfigData_BankA and ConfigData_BankB is calculated.

[0118] In S302, determine whether the data in BankA and BankB are both valid; if yes, continue to S303; otherwise, proceed to S306.

[0119] For example, calculate the CRC of the ConfigData data in BankA and BankB and the stored CRC to determine whether it is valid.

[0120] In S303, determine whether Counter_A is greater than or equal to Counter_B; if yes, continue to S304; if no, proceed to S305.

[0121] In S304, copy the data from BankA for use. Then end the operation.

[0122] In S305, copy the data from BankB for use. Then end the operation.

[0123] If the ConfigData data in both BankA and BankB is valid, then compare whether Counter_A is greater than or equal to Counter_B.

[0124] If Counter_A is greater than or equal to Counter_B, copy the data from BankA; if Counter_A is less than Counter_B, copy the data from BankB.

[0125] In S306, determine whether the BankA data is valid; if yes, proceed to S304; otherwise, proceed to S307.

[0126] If the ConfigData data in both BankA and BankB is not valid, check if the data in BankA is valid. If the data in BankA is valid, copy the data from BankA.

[0127] In S307, determine whether the BankB data is valid; if yes, continue to S308; otherwise, end the operation.

[0128] In S308, copy the data from BankB for use. Then end the operation.

[0129] If the ConfigData data in both BankA and BankB is not valid, check if the data in BankB is valid. If the data in BankB is valid, copy the data from BankB.

[0130] For example, after the SOC reads the configuration data for the corresponding version, it can send it to the application so that the application can obtain the required configuration data. For example, the configuration data read may be some vehicle configuration information, such as whether it has 360-degree surround view, what the interior and exterior colors are, whether it has HUD function, and the recognition of some functions, etc.

[0131] Figure 5 The procedure described in this embodiment can be used to read the latest version of configuration data. In other embodiments, the values ​​of Counter_A and Counter_B can be used to backtrack to a specific version of configuration data.

[0132] Since different banks store different versions of data, if data in Bank A is lost, a backup of the data in Bank A can be added on the MCU side. Different versions can be traced using the values ​​of counters in different partitions, and the data can be restored to a specific state based on the counter values.

[0133] The solutions provided in this disclosure, on the one hand, ensure data consistency and reliability by implementing fault tolerance and backup mechanisms, reducing potential risks and significantly improving the overall system stability and availability, ensuring effective recovery in the event of data loss. On the other hand, by implementing a version control mechanism, multiple versions of data can be stored, enabling traceability of historical data changes, improving system flexibility and scalability, enhancing market competitiveness, and simplifying maintenance and update costs. Furthermore, by enhancing code portability, cross-platform compatibility is achieved, and the development process is optimized to save development resources. For example, a single set of code can determine the current car model, interior color, and wheel type based on configuration information / data.

[0134] Figure 6 This is a block diagram illustrating a data processing apparatus according to an exemplary embodiment of the present disclosure. Figure 6 As shown, the data processing apparatus 600 provided in this embodiment may include a storage unit 610 and a reading unit 620.

[0135] Storage unit 610 is used to store different versions of data into different partitions, and uses a counter to mark the version of the data stored in each partition.

[0136] The reading unit 620 is used to read the target version of the target data stored in the target partition according to the counter, wherein the partition includes the target partition, the version includes the target version, and the data includes the target data.

[0137] For example, the partition includes a first partition and a second partition; the version includes a first version, a second version, and a third version; the data of the first version is first data; the data of the second version is second data; and the data of the third version is third data; the counter includes a first counter and a second counter. The storage unit 610 is further configured to: store the first data of the first version, the first checksum of the first data, and the first value of the first counter in the first partition; and store the second data of the second version, the second checksum of the second data, and the second value of the second counter in the second partition. The data processing device 600 further includes a receiving unit configured to acquire the third data of the third version and its third checksum. The storage unit 610 is further configured to: store the third data of the third version and its third checksum in the first partition and / or the second partition according to the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter.

[0138] For example, the storage unit 610 is further configured to: determine whether the first data and the second data are valid based on the first data, the first check code, the second data and the second check code; compare the size of the first value of the first counter and the second value of the second counter to obtain a comparison result; and store the third data of the third version and its third check code in the first partition and / or the second partition based on whether the first data and the second data are valid and the comparison result.

[0139] For example, the storage unit 610 is further configured to: calculate a first checksum of the first data, calculate a second checksum of the second data; determine whether the calculated first checksum is consistent with the first checksum stored in the first partition; if the calculated first checksum is consistent with the first checksum stored in the first partition, then determine that the first data is valid; if the calculated first checksum is inconsistent with the first checksum stored in the first partition, then determine that the first data is invalid; determine whether the calculated second checksum is consistent with the second checksum stored in the second partition; if the calculated second checksum is consistent with the second checksum stored in the second partition, then determine that the second data is valid; if the calculated second checksum is inconsistent with the second checksum stored in the second partition, then determine that the second data is invalid.

[0140] For example, the storage unit 610 is further configured to: if both the first data and the second data are valid, and the comparison result is that the first value of the first counter is greater than or equal to the second value of the second counter and neither is 0, then store the third data of the third version and its third checksum in the second partition, and update the second value of the second counter; if the comparison result is that the first value of the first counter is less than the second value of the second counter, then store the third data of the third version and its third checksum in the first partition, and update the first value of the first counter; if both the first value of the first counter and the second value of the second counter are 0, then store the third data of the third version and its third checksum in the second partition. The data is stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated. If the first data is valid, the third data of the third version and its third checksum are stored in the second partition, and the second value of the second counter is updated. If the first data is invalid and the second data is valid, the third data of the third version and its third checksum are stored in the first partition, and the first value of the first counter is updated. If both the first data and the second data are invalid, the third data of the third version and its third checksum are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated.

[0141] For example, the partition includes a first partition and a second partition, the version includes a first version and a second version, the data of the first version is first data, and the data of the second version is second data; the counter includes a first counter and a second counter. The first partition stores the first data of the first version, the first checksum of the first data, and the first value of the first counter; the second partition stores the second data of the second version, the second checksum of the second data, and the second value of the second counter. The reading unit 620 is further configured to: determine whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum; compare the first value of the first counter and the second value of the second counter to obtain a comparison result; and, based on whether the first data and the second data are valid and the comparison result, read the first data of the first version stored in the first partition, or read the second data of the second version stored in the second partition, as the target data of the target version in the target partition.

[0142] For example, the reading unit 620 is further configured to: if both the first data and the second data are valid, and the first value of the first counter is greater than or equal to the second value of the second counter, then read the first data of the first version stored in the first partition; if the first value of the first counter is less than the second value of the second counter, then read the second data of the second version stored in the second partition; if the first data is valid, then read the first data of the first version stored in the first partition; if the first data is invalid, and the second data is valid, then read the second data of the second version stored in the second partition.

[0143] For example, the first partition and the second partition are contained in a general-purpose flash memory.

[0144] For example, the general-purpose flash memory is included in a system-on-a-chip (SoC), which also includes random access memory (RAM). The SoC is used to receive third version of third data and its third checksum. The SoC is also used to store the third version of the third data and its third checksum in the RAM.

[0145] For example, the system-on-a-chip is used to receive the third version of the third data and its third checksum from the microcontroller unit. The microcontroller unit includes non-volatile memory storing the third version of the third data and its third checksum.

[0146] For example, the non-volatile memory includes a third partition and a fourth partition. The third partition stores the third version of the third data and its third checksum; the fourth partition stores the fourth version of the fourth data and its fourth checksum.

[0147] For example, the data processing device 600 further includes a receiving unit for acquiring a read instruction, the read instruction containing target version information.

[0148] The reading unit 620 is further configured to: respond to the reading instruction, read the data stored in the partition whose version indicated by the counter matches the target version information, and use it as the target data of the target version in the target partition.

[0149] The new energy vehicle industry is an emerging sector that has garnered widespread attention. Its core competitive advantage lies in its independent research and development and technological innovation. System information storage is not merely a technical issue, but a strategic business requirement. Effective data management and storage can help companies reduce costs, increase market coverage, enhance user experience, simplify deployment and management, improve flexibility and scalability, mitigate risks, improve product quality, accelerate innovation, ensure compliance and security, enhance competitiveness, increase customer satisfaction, and ultimately achieve sustainable development. Therefore, investing in efficient data storage and management technologies is essential. In the era of big data, data has become one of the core assets of enterprises, and the right data storage strategy is crucial to their success.

[0150] The new energy vehicles in this disclosure refer to vehicles that use new power systems or unconventional vehicle fuels to completely or partially replace traditional fuel engines, with the goal of reducing carbon emissions and dependence on fossil fuels.

[0151] The configuration data for new energy vehicles may include one or more of the following:

[0152] (1) Vehicle identity and basic configuration: VIN code, model number, software version number; power battery type (ternary lithium / lithium iron phosphate), capacity configuration (kWh); motor model (permanent magnet synchronous / induction asynchronous), peak power (kW).

[0153] (2) Power and energy management: energy recovery intensity (weak / medium / strong three levels); charging strategy (fast charging threshold, equalization mode); SOC protection range (e.g. 15%-95% to prevent overcharging and over-discharging).

[0154] (3) Safety and driving assistance: AEB trigger threshold (time to collision (TTC) threshold); lane keeping sensitivity (steering wheel correction torque level); thermal management strategy (battery / motor temperature control curve).

[0155] (4) User experience and personalization: Seat memory position (3D coordinate data); HUD display mode (navigation / energy consumption / entertainment information priority); voice assistant wake-up word and dialect settings.

[0156] (5) Network and remote diagnostics: T-Box communication protocol version; data upload frequency (e.g., 10 seconds / time); remote diagnostic permission level (basic / deep).

[0157] The method provided in this disclosure can be applied to information storage based on in-vehicle entertainment systems. It can solve the problem of storing all data information (not limited to configuration data, but also including user data) of the in-vehicle entertainment system, improve code compatibility and portability (e.g., a platform with multiple vehicle models can be directly distinguished by configuration information, and then the corresponding driver information can be loaded), simplify maintenance and update costs, save development resources (configuration data can be backed up twice, three times, or even more times), enhance consistency and reliability, improve scalability and market competitiveness, and reduce risks, improve system stability, and ensure driving safety. Furthermore, this solution can be extended to other technical fields and to any data storage.

[0158] In-vehicle entertainment systems are intelligent electronic systems integrated into the vehicle, providing drivers and passengers with entertainment, navigation, communication, and vehicle information interaction services through human-computer interaction technology.

[0159] The method provided in this disclosure can optimize the storage of system configuration information under heterogeneous architecture. For example, the update of vehicle configuration words can be improved by using this backup mechanism and the traceability of historical data changes, thereby enhancing the stability and flexibility of the system and enhancing market competitiveness.

[0160] In this embodiment of the disclosure, the vehicle configuration word / vehicle configuration information is a set of key parameters used in automotive engineering to digitally define the vehicle's hardware configuration and functional options. Essentially, it is an encoded binary / hexadecimal data field that is used throughout the entire vehicle lifecycle management. For example, Bits 0-3: Engine type (1.5T / 2.0T); Bits 4-7: Transmission type (AT / DCT); Bits 8-15: Driver assistance level (L2 / L2.5); Bits 16-23: Seating configuration (5-seat / 7-seat).

[0161] As an example, the method provided in this disclosure can be implemented in electronic devices (such as mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.).

[0162] As another example, the methods provided in this disclosure can be implemented in the cloud.

[0163] It is understood that the electronic devices mentioned in the embodiments of this disclosure include, but are not limited to, terminals or servers. In other words, an electronic device can be a server or a terminal, or a system composed of a server and a terminal. A terminal can be an electronic device, including but not limited to mobile phones, tablets, desktop computers, laptops, handheld computers, in-vehicle devices, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, smart TVs, wearable devices, smart speakers, digital cameras, webcams, and other mobile internet devices (MIDs) with network access capabilities, or terminals in scenarios such as trains, ships, and flights.

[0164] The servers mentioned above can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road cooperation, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0165] Optionally, the data involved in the embodiments of this disclosure may be stored in a computer device or may be stored based on cloud storage technology, without limitation.

[0166] Figure 7 This is a schematic diagram illustrating an application scenario of the method provided in this embodiment. Figure 7 This is a schematic diagram illustrating the application of the method provided in this disclosure embodiment to an in-vehicle scenario. For example... Figure 7 As shown, the vehicle terminal 1202 can store different versions of configuration data through different partitions. When the electronic device 1201 needs a certain version of configuration data, it sends that version of configuration data to the electronic device 1201. The electronic device 1201 can be a server where the application resides, or it can belong to the vehicle terminal 1202 (i.e., the backend of the vehicle terminal 1202), etc., without any restrictions.

[0167] The vehicle terminal 1202 can be installed in the vehicle 1203, and there are no restrictions on this.

[0168] The in-vehicle terminal 1202 can display applications, etc. The applications in this embodiment can be any type of application. Different applications can be used in different scenarios, such as remote video conferencing, education, messaging, travel, audiobooks, advertising, and other applications that can be used in a vehicle. The travel scenario can be further divided into different sub-scenarios such as commuting, traveling, and traffic congestion; the social scenario can be further divided into different sub-scenarios such as gatherings and interactions; and the entertainment scenario can be further divided into different sub-scenarios such as listening to music, reading novels, and playing games.

[0169] Furthermore, this disclosure also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: implement the steps of the data processing method described in any of the above embodiments.

[0170] See Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. For example... Figure 8 As shown, the electronic device 1300 in this embodiment may include one or more processors 1301, a memory 1302, and an input / output interface 1303. The processor 1301, memory 1302, and input / output interface 1303 are connected via a bus 1304. The memory 1302 stores a computer program, which includes program instructions. The input / output interface 1303 receives and outputs data, such as for data interaction between a host machine and a computer device, or for data interaction between various virtual machines within the host machine. The processor 1301 executes the program instructions stored in the memory 1302.

[0171] The processor 1301 can perform the following operations: store different versions of data into different partitions, and mark the version of the data stored in each partition with a counter; read the target version of the target data stored in the target partition according to the counter, wherein the partition includes the target partition, the version includes the target version, and the data includes the target data.

[0172] The memory 1302 may include read-only memory and random access memory, and provides instructions and data to the processor 1301 and the input / output interface 1303. A portion of the memory 1302 may also include non-volatile random access memory.

[0173] Figure 9This is a functional block diagram illustrating a vehicle according to an exemplary embodiment of the present disclosure. For example, vehicle 1400 can be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or other types of vehicle. Vehicle 1400 can be an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle. (Refer to...) Figure 9 The vehicle 1400 may include various subsystems, such as an infotainment system 1410, a perception system 1420, a decision control system 1430, a drive system 1440, and a computing platform 1450. The vehicle 1400 may also include more or fewer subsystems, and each subsystem may include multiple components. Furthermore, each subsystem and component of the vehicle 1400 can be interconnected via wired or wireless means. In some embodiments, the infotainment system 1410 may include a communication system, an entertainment system, and a navigation system. The perception system 1420 may include several sensors for sensing information about the environment surrounding the vehicle 1400. For example, the perception system 1420 may include a global positioning system (which may be GPS, BeiDou, or other positioning systems), an inertial measurement unit (IMU), lidar, millimeter-wave radar, ultrasonic radar, and a camera device. The decision control system 1430 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system. The drive system 1440 may include components that provide power to the vehicle 1400. In one embodiment, the drive system 1440 may include an engine, an energy source, a transmission system, and wheels. The engine may be one or a combination of internal combustion engines, electric motors, and compressed air engines. The engine is capable of converting energy provided by the energy source into mechanical energy. Some or all of the functions of the vehicle 1400 are controlled by a computing platform 1450. The computing platform 1450 may include at least one processor 1451 and a memory 1452, the processor 1451 being capable of executing instructions 1453 stored in the memory 1452.

[0174] Processor 1451 can be any conventional processor, such as a commercially available CPU. The processor may also include, for example, a Graphics Processing Unit (GPU), a Field Programmable Gate Array (FPGA), a System on Chip (SOC), an Application Specific Integrated Circuit (ASIC), or a combination thereof. Memory 1452 can be implemented using any type of volatile or non-volatile memory device or a combination thereof. In addition to instructions 1453, memory 1452 may also store data, such as road maps, route information, vehicle position, direction, speed, etc. The data stored in memory 1452 can be used by computing platform 1450. In embodiments of this disclosure, processor 1451 can execute instructions 1453 to perform all or part of the steps of the methods described above.

[0175] This disclosure provides an electronic device including a processor, an input / output interface, and a memory. The processor retrieves a computer program from the memory and executes the steps of the method shown in any of the above embodiments.

[0176] This disclosure also provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the text processing method provided in each step of any of the above embodiments. Specific implementations of each step in each of the above embodiments can be found therein and will not be repeated here. Furthermore, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this disclosure, please refer to the description of the method embodiments of this disclosure. As an example, the computer program can be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network.

[0177] The computer-readable storage medium may be an internal storage unit of the apparatus provided in any of the foregoing embodiments or the electronic device, such as a hard disk or memory of a computer device. The computer-readable storage medium may also be an external storage device of the computer device. Further, the computer-readable storage medium may include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or will be output.

[0178] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described in any of the above embodiments.

[0179] This disclosure also provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative embodiments described above.

[0180] The terms "first," "second," etc., in the specification, claims, and drawings of this disclosure are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. It should be understood that this disclosure is not limited to the precise structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A data processing method, characterized in that, include: Different versions of data are stored in different partitions, and a counter is used to mark the version of the data stored in each partition; The target version of the target data is read from the target partition stored in the target partition according to the counter. The partition includes the target partition, the version includes the target version, and the data includes the target data.

2. The method according to claim 1, characterized in that, The partition includes a first partition and a second partition; the version includes a first version, a second version, and a third version; the data in the first version is first data; the data in the second version is second data; and the data in the third version is third data; the counter includes a first counter and a second counter. This involves storing different versions of data in different partitions, and using a counter to mark the version of the data stored in each partition, including: Store the first data of the first version, the first checksum of the first data, and the first value of the first counter in the first partition; store the second data of the second version, the second checksum of the second data, and the second value of the second counter in the second partition; Obtain the third version of the third data and its third verification code; Based on the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter, the third data of the third version and its third checksum are stored in the first partition and / or the second partition.

3. The method according to claim 2, characterized in that, Based on the first data, the first checksum, the first value of the first counter, the second data, the second checksum, and the second value of the second counter, the third version of the third data and its third checksum are stored in the first partition and / or the second partition, including: Determine whether the first data and the second data are valid based on the first data, the first verification code, the second data, and the second verification code; Compare the first value of the first counter with the second value of the second counter to obtain the comparison result; Based on whether the first data and the second data are valid, and the comparison result, the third data of the third version and its third check code are stored in the first partition and / or the second partition.

4. The method according to claim 3, characterized in that, Determining whether the first data and the second data are valid based on the first data, the first checksum, the second data, and the second checksum includes: Calculate the first checksum of the first data, and calculate the second checksum of the second data; Determine whether the calculated first checksum is consistent with the first checksum stored in the first partition; If the calculated first checksum matches the first checksum stored in the first partition, then the first data is determined to be valid. If the calculated first checksum does not match the first checksum stored in the first partition, then the first data is determined to be invalid. Determine whether the calculated second checksum matches the second checksum stored in the second partition; If the calculated second checksum matches the second checksum stored in the second partition, then the second data is determined to be valid. If the calculated second checksum does not match the second checksum stored in the second partition, then the second data is determined to be invalid.

5. The method according to claim 3, characterized in that, Based on whether the first data and the second data are valid, and the comparison result, the third data of the third version and its third checksum are stored in the first partition and / or the second partition, including: If both the first and second data are valid, and the comparison result is that the first value of the first counter is greater than or equal to the second value of the second counter and neither is 0, then the third data of the third version and its third checksum are stored in the second partition, and the second value of the second counter is updated; if the comparison result is that the first value of the first counter is less than the second value of the second counter, then the third data of the third version and its third checksum are stored in the first partition, and the first value of the first counter is updated; if both the first value of the first counter and the second value of the second counter are 0, then the third data of the third version and its third checksum are stored in both the first and second partitions, and the first value of the first counter and the second value of the second counter are updated. If the first data is valid, then the third data of the third version and its third check code are stored in the second partition, and the second value of the second counter is updated; If the first data is invalid and the second data is valid, then the third data of the third version and its third check code are stored in the first partition, and the first value of the first counter is updated. If both the first data and the second data are invalid, then the third data of the third version and its third check code are stored in the first partition and the second partition, and the first value of the first counter and the second value of the second counter are updated.

6. The method according to claim 1, characterized in that, The partition includes a first partition and a second partition; the version includes a first version and a second version, where the data in the first version is first data and the data in the second version is second data; the counter includes a first counter and a second counter. The first partition stores the first data of the first version, the first checksum of the first data, and the first value of the first counter; the second partition stores the second data of the second version, the second checksum of the second data, and the second value of the second counter. The process of reading target data of the target version stored in the target partition according to the counter includes: Determine whether the first data and the second data are valid based on the first data, the first verification code, the second data, and the second verification code; Compare the first value of the first counter with the second value of the second counter to obtain the comparison result; Based on whether the first data and the second data are valid, and the comparison result, the first data of the first version stored in the first partition, or the second data of the second version stored in the second partition, is read as the target data of the target version in the target partition.

7. The method according to claim 6, characterized in that, Based on whether the first data and the second data are valid, and the comparison result, reading the first version of the first data stored in the first partition, or reading the second version of the second data stored in the second partition, includes: If both the first data and the second data are valid, and the first value of the first counter is greater than or equal to the second value of the second counter, then the first version of the first data stored in the first partition is read; if the first value of the first counter is less than the second value of the second counter, then the second version of the second data stored in the second partition is read. If the first data is valid, then read the first version of the first data stored in the first partition; If the first data is invalid and the second data is valid, then read the second version of the second data stored in the second partition.

8. The method according to any one of claims 2 to 7, characterized in that, The first partition and the second partition are contained in a general-purpose flash memory.

9. The method according to claim 8, characterized in that, The general-purpose flash memory is contained in a system-on-a-chip (SoC), which further includes random access memory (RAM); wherein, the method further includes: The system-on-a-chip receives the third version of the third data and its third checksum. The system-on-a-chip stores the third version of the third data and its third checksum in the random access memory.

10. The method according to claim 9, characterized in that, The system-on-a-chip receives the third version of the third data and its third checksum from the microcontroller unit; The microcontroller unit includes a non-volatile memory, which stores the third version of the third data and its third checksum.

11. The method according to claim 10, characterized in that, The non-volatile memory includes a third partition and a fourth partition; The third partition stores the third version of the third data and its third verification code. The fourth partition stores the fourth version of the fourth data and its fourth checksum.

12. The method according to claim 1, characterized in that, Read the target version of the target data stored in the target partition according to the counter, including: Obtain a read instruction, wherein the read instruction contains target version information; In response to the read command, the data stored in the partition whose version indicated by the counter matches the target version information is read and used as the target data of the target version in the target partition.

13. A data processing apparatus, characterized in that, include: Storage units are used to store different versions of data into different partitions, and a counter is used to mark the version of the data stored in each partition; The reading unit is used to read target data of the target version stored in the target partition according to the counter, wherein the partition includes the target partition, the version includes the target version, and the data includes the target data.

14. The apparatus according to claim 13, characterized in that, The partition includes a first partition and a second partition; the version includes a first version, a second version, and a third version; the data in the first version is first data; the data in the second version is second data; and the data in the third version is third data; the counter includes a first counter and a second counter. The storage unit is further configured to: store the first data of the first version, the first checksum of the first data, and the first value of the first counter in the first partition; and store the second data of the second version, the second checksum of the second data, and the second value of the second counter in the second partition. The device further includes a receiving unit for acquiring the third version of the third data and its third verification code; The storage unit is further configured to: store the third data of the third version and its third check code to the first partition and / or the second partition according to the first data, the first check code, the first value of the first counter, the second data, the second check code and the second value of the second counter.

15. The apparatus according to claim 14, characterized in that, The storage unit is further configured to: determine whether the first data and the second data are valid based on the first data, the first check code, the second data, and the second check code; and compare the magnitudes of the first value of the first counter and the second value of the second counter to obtain a comparison result; Based on whether the first data and the second data are valid, and the comparison result, the third data of the third version and its third check code are stored in the first partition and / or the second partition.

16. The apparatus according to claim 13, characterized in that, The partition includes a first partition and a second partition; the version includes a first version and a second version, where the data in the first version is first data and the data in the second version is second data; the counter includes a first counter and a second counter. The first partition stores the first data of the first version, the first checksum of the first data, and the first value of the first counter; the second partition stores the second data of the second version, the second checksum of the second data, and the second value of the second counter. The reading unit is further configured to: determine whether the first data and the second data are valid based on the first data, the first check code, the second data, and the second check code; and compare the first value of the first counter with the second value of the second counter to obtain a comparison result. Based on whether the first data and the second data are valid, and the comparison result, the first data of the first version stored in the first partition, or the second data of the second version stored in the second partition, is read as the target data of the target version in the target partition.

17. The apparatus according to claim 13, characterized in that, It also includes a receiving unit for acquiring a read instruction, wherein the read instruction contains target version information; The reading unit is further configured to: respond to the reading instruction and read the data stored in the partition whose version indicated by the counter matches the target version information, as the target data of the target version in the target partition.

18. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The steps of implementing the data processing method according to any one of claims 1 to 12.

19. A non-transitory computer-readable storage medium, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to perform the data processing method of any one of claims 1 to 12.

20. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data processing method as described in any one of claims 1 to 12.