Vehicle data processing method and device, storage medium and electronic equipment
By using verification data to determine file consistency and perform data recovery operations in vehicle data storage, the problem of low reliability of vehicle data storage is solved, the reliability of data backup is improved, and data loss is avoided when backup files are damaged.
Patent Information
- Application Number
- CN202411996270.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-12-31
AI Technical Summary
Existing technologies have low reliability in vehicle data storage, especially lacking effective recovery solutions when database files and backup files are damaged, leading to abnormal software functions.
By obtaining vehicle data files from multiple on-board storage areas, using verification data to determine file consistency, identifying the files to be recovered, and performing data recovery operations, cyclic redundancy check and hash check are used to enhance data reliability.
It improves the reliability of vehicle data storage, avoids the problem of being unable to recover when too many backup files are corrupted, enhances the reliability of data backup, solves the technical problem of multiple data, improves the reliability of data backup, and solves the problem of data validity in the existing technology.
Smart Images

Figure CN119902714B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of vehicle driving, in particular to a vehicle data processing method and device, a storage medium and an electronic device. BACKGROUND
[0002] At present, with the development of Internet of Things and mobile information technologies, automobiles are changing from traditional mobile tools to super mobile terminals. In this case, software has become the key to determining the performance and functions of automobiles. Software-defined automobile ecology has become a trend in the automobile industry. Software is deeply involved in the processes of automobile definition, development, verification, sales and service. The software development of automobiles is used for advanced driving assistance systems, information entertainment systems and body control modules. The above applications have very high requirements for the integrity and reliability of key data. Therefore, the reliability of vehicle data storage is crucial.
[0003] However, in the current vehicle data storage technology, the data is directly stored into the corresponding file by using the file storage function and the database storage function provided by the operating system. Therefore, for the prior art, the reliability of the data is guaranteed by the characteristics of the file itself, such as write-time copy, transaction log, data rollback, etc. However, if the database file and the backup file are damaged too much, there is no reasonable and effective recovery solution, which further causes abnormal software functions and brings unpredictable problems. That is, the prior art has the technical problem of low reliability of vehicle data storage.
[0004] At present, there is no effective solution to the above problems. SUMMARY
[0005] The embodiments of the present application provide a vehicle data processing method and device, a storage medium and an electronic device to at least solve the technical problem of low reliability of vehicle data storage in related technologies.
[0006] According to an aspect of the embodiments of the present application, a method for processing vehicle data is provided. The method can be applied in a distributed storage device of a vehicle. The method comprises: in response to a vehicle data verification instruction, obtaining a plurality of vehicle data files from a plurality of vehicle storage areas, respectively, wherein the vehicle data files comprise vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data; in a case where a numerical relationship between a first quantity of target files in the plurality of vehicle data files and a second quantity of the plurality of vehicle data files satisfies a first verification condition, determining a reference file in the plurality of vehicle data files as a to-be-restored file, wherein the verification data in each of the target files of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target files; in a case where the numerical relationship between the first quantity of the target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, determining the plurality of vehicle data files as a plurality of to-be-restored files, respectively; and performing a data recovery operation on the to-be-restored files.
[0007] According to another aspect of the embodiments of the present application, a device for processing vehicle data is provided. The device comprises: an obtaining unit configured to obtain a plurality of vehicle data files from a plurality of vehicle storage areas, respectively, in response to a vehicle data verification instruction, wherein the vehicle data files comprise vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data; a first determining unit configured to, in a case where a numerical relationship between a first quantity of target files in the plurality of vehicle data files and a second quantity of the plurality of vehicle data files satisfies a first verification condition, determine a reference file in the plurality of vehicle data files as a to-be-restored file, wherein the verification data in each of the target files of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target files; a second determining unit configured to, in a case where the numerical relationship between the first quantity of the target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, determine the plurality of vehicle data files as a plurality of to-be-restored files, respectively; and a recovery unit configured to perform a data recovery operation on the to-be-restored files.
[0008] As an optional solution, the device for processing vehicle data further comprises: a verification unit configured to perform a file verification operation on the plurality of vehicle data files according to the verification data included in each of the plurality of vehicle data files; in a case where a third quantity of first files that pass the file verification operation does not satisfy a second verification condition, determining the plurality of vehicle data files as a plurality of to-be-restored files; in a case where the third quantity of the first files that pass the file verification operation satisfies the second verification condition, obtaining the verification data in each of the plurality of first files; and performing a data matching verification based on the verification data in each of the plurality of first files.
[0009] As an optional solution, the vehicle data processing apparatus further includes a third determining unit configured to determine that the numerical relationship between the first quantity and the second quantity satisfies the first check condition in a case where a ratio between the first quantity and the second quantity is greater than or equal to a first quantity threshold value; and determine that the numerical relationship between the first quantity and the second quantity satisfies the first check condition in a case where the first quantity is greater than or equal to a second quantity threshold value, wherein the second quantity threshold value is determined according to the second quantity.
[0010] As an optional solution, the vehicle data processing apparatus further includes a fourth determining unit configured to determine that the third quantity does not satisfy the second check condition in a case where a ratio between the third quantity and the second quantity is less than a third quantity threshold value; and determine that the third quantity does not satisfy the second check condition in a case where the first quantity is less than a fourth quantity threshold value.
[0011] As an optional solution, the check unit includes a first check module configured to determine reference cyclic redundancy check information according to the vehicle data included in the vehicle data file in a case where the check data in the current vehicle data file is target cyclic redundancy check information; and determine that the current vehicle data file passes the file check operation in a case where the reference cyclic redundancy check information matches the target cyclic redundancy check information; and a second check module configured to determine reference hash check information according to the vehicle data included in the vehicle data file in a case where the check data in the current vehicle data file is target hash check information; and determine that the current vehicle data file passes the file check operation in a case where the reference hash check information matches the target hash check information.
[0012] As an optional solution, the recovery unit includes a first recovery module configured to perform a data recovery operation on the to-be-recovered file according to the target file in a case where the numerical relationship between the first quantity and the second quantity satisfies the first check condition; and a second recovery module configured to perform a data recovery operation on the to-be-recovered file according to a historical version file matched with the to-be-recovered file in a case where the numerical relationship between the first quantity and the second quantity does not satisfy the first check condition.
[0013] As an optional solution, the second recovery module is further configured to perform a data recovery operation on the to-be-recovered file according to a last historical version file matched with the to-be-recovered file in a case where the last historical version file is found; and perform a data recovery operation on the to-be-recovered file according to an initial version file matched with the to-be-recovered file in a case where the last historical version file is not found.
[0014] As an optional solution, the vehicle data processing apparatus further includes a writing unit configured to, in response to receiving a data writing request, determine backup information of the vehicle data to be written according to a data type of the vehicle data to be written carried by the data writing request, wherein the backup information includes a backup quantity and a check condition matched with the data type; and write a vehicle data file matched with the vehicle data to be written in the plurality of vehicle storage areas according to the backup information.
[0015] As an optional solution, the vehicle data processing apparatus further includes a region recovery unit configured to, in response to a region state of a current vehicle storage area in the plurality of vehicle storage areas satisfying a region check condition, acquire a plurality of vehicle data files in the current vehicle storage area; sequentially perform a file check operation on the plurality of vehicle data files in the current vehicle storage area; in response to a fourth quantity of second files in the current vehicle storage area through the file check operation not satisfying the region check condition, determine the plurality of vehicle data files in the current vehicle storage area as a plurality of files to be recovered; and perform a data recovery operation on the plurality of files to be recovered in the current vehicle storage area.
[0016] According to yet another aspect of the embodiments of the present application, a computer program product or computer program is provided, which includes 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 the processor executes the computer instructions to enable the computer device to perform the vehicle data processing method.
[0017] According to yet another aspect of the embodiments of the present application, an electronic device is also provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor performs the vehicle data processing method by executing the computer program.
[0018] In the above embodiments of the present application, the plurality of vehicle data files are obtained from the plurality of vehicle storage areas respectively in response to the vehicle data verification instruction, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data; then, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files satisfies the first verification condition, the reference file in the plurality of vehicle data files is determined as the to-be-restored file, wherein the verification data of each of the target files of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target file; further, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, the plurality of vehicle data files are respectively determined as a plurality of to-be-restored files; and then, the data recovery operation is performed on the to-be-restored files. Thus, the scheme of performing data recovery on the to-be-restored data according to the plurality of data backup files containing the same data is realized, the reliability of data backup is enhanced by relying on the plurality of data backup files containing the same data, the problem that the backup files cannot be recovered when the backup files are damaged too much is avoided, and the reliability of the data backup files is further enhanced by introducing the first verification condition, thereby solving the problem of low vehicle data storage reliability in the prior art. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are included to provide a further understanding of the present application, form a part of the present application and illustrate the illustrative embodiments of the present application and its description, and do not constitute improper limitations on the present application. In the drawings:
[0020] Figure 1 is a schematic diagram of an application environment of an optional vehicle data processing method according to an embodiment of the present application;
[0021] Figure 2 is a flowchart of an optional vehicle data processing method according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of an optional vehicle data processing method according to an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of another optional vehicle data processing method according to an embodiment of the present application;
[0024] Figure 5 is a flowchart of another optional vehicle data processing method according to an embodiment of the present application;
[0025] Figure 6 is a flowchart of another optional vehicle data processing method according to an embodiment of the present application;
[0026] Figure 7 is a flow chart of still another optional vehicle data processing method according to an embodiment of the application;
[0027] Figure 8 is a schematic diagram of still another optional vehicle data processing method according to an embodiment of the application;
[0028] Figure 9 is a schematic diagram of still another optional vehicle data processing method according to an embodiment of the application;
[0029] Figure 10 is a schematic diagram of a vehicle data processing apparatus according to an embodiment of the application;
[0030] Figure 11 is a structural schematic diagram of an optional electronic device according to an embodiment of the application. DETAILED DESCRIPTION
[0031] In order to enable persons skilled in the art to better understand the schemes of the present application, the technical schemes in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] According to an aspect of an embodiment of the present application, a vehicle data processing method is provided. Optionally, the above-mentioned vehicle data processing method can be applied in a hardware environment as shown in Figure 1 Optionally, the above-mentioned vehicle data processing method provided by the present application can be applied in a vehicle terminal. Figure 1A side view of the vehicle terminal 101 is shown, which can travel on a travel surface 113. The vehicle terminal 101 includes a memory 102 storing an onboard navigation system 103, a digitized road map 104, a space monitoring system 117, a vehicle controller 109, a GPS (Global Positioning System) sensor 110, an HMI (Human / Machine Interface) device 111, and further includes an autonomous controller 112 and a telematics controller 114.
[0034] In one embodiment, the space monitoring system 117 includes one or more space sensors and systems for monitoring a viewable area 105 in front of the vehicle terminal 101, and further includes a space monitoring controller 118. The space sensors for monitoring the viewable area 105 include a lidar sensor 106, a radar sensor 107, a camera 108, and the like. The space monitoring controller 118 can be configured to generate data related to the viewable area 105 based on data input from the space sensors. The space monitoring controller 118 can determine a linear range, a relative speed, and a trajectory of the vehicle terminal 101 based on input from the space sensors, for example, a current speed of the vehicle terminal 101 and a relative speed compared to a preceding vehicle. The space sensors of the vehicle terminal space monitoring system 117 can include object localization sensing devices, which can include range sensors that can be configured to localize objects in front of the vehicle terminal 101, such as a preceding vehicle object.
[0035] The camera 108 is advantageously mounted and positioned on the vehicle terminal 101 in a position that allows for capturing images of the viewable area 105, where the viewable area 105 includes at least a portion of the travel surface 113 in front of the vehicle terminal 101 and including a trajectory of the vehicle terminal 101. The viewable area 105 can further include the surrounding environment. Other cameras can also be employed, for example, a second camera disposed on a rear portion or a side portion of the vehicle terminal 101 to monitor a rear of the vehicle terminal 101 and one of a right side or a left side of the vehicle terminal 101.
[0036] The autonomous controller 112 is configured to implement autonomous driving or advanced driver assistance system (ADAS) vehicle terminal functionality. Such functionality can include a vehicle terminal onboard control system capable of providing a certain level of driving automation. Driving automation can include a range of dynamic driving and vehicle terminal operations. Driving automation can include a certain level of automatic control or intervention involving individual vehicle terminal functions, such as steering, acceleration, and / or braking. For example, the autonomous controller described above can be configured to generate a vehicle travel scenario for the vehicle terminal by performing the following steps:
[0037] S102, in response to the vehicle data verification instruction, obtaining a plurality of vehicle data files from a plurality of vehicle-mounted storage areas respectively, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data;
[0038] S104, in a case where a numerical relationship between a first quantity of target files in the plurality of vehicle data files and a second quantity of the plurality of vehicle data files satisfies a first verification condition, determining a reference file in the plurality of vehicle data files as a to-be-restored file, wherein the respective verification data in the first quantity of target files match each other, and the verification data in the reference file does not match the verification data in the target files;
[0039] S106, in a case where the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, determining the plurality of vehicle data files as a plurality of to-be-restored files respectively;
[0040] S108, performing a data recovery operation on the to-be-restored file.
[0041] The HMI device 111 provides human-machine interaction for the purpose of guiding the infotainment system, GPS (Global Positioning System) sensors 110, on-board navigation system 103, and similar operations, and includes a controller. The HMI device 111 monitors operator requests and provides the operator with status, service, and maintenance information of the vehicle terminal system. The HMI device 111 communicates with and / or controls the operation of a plurality of operator interface devices. The HMI device 111 can also communicate with one or more devices that monitor biometric data associated with the vehicle terminal operator. For simplicity of description, the HMI device 111 is depicted as a single device, but in embodiments of the system described herein, can be configured as a plurality of controllers and associated sensing devices.
[0042] The operator controls can be included in the passenger cabin of the vehicle terminal 101 and can include, by way of non-limiting example, a steering wheel, an accelerator pedal, a brake pedal, and operator input devices that are elements of the HMI device 111. The operator controls enable the vehicle terminal operator to interact with the operating vehicle terminal 101 and direct the operation of the vehicle terminal 101 to provide passenger transportation.
[0043] The on-board navigation system 103 employs a digitized road map 104 for the purpose of providing navigation support and information to the vehicle terminal operator. The autonomous controller 112 employs the digitized road map 104 for the purpose of controlling autonomous vehicle terminal operation or ADAS vehicle terminal functions.
[0044] The vehicle terminal 101 can include a telematics controller 114 that includes a wireless telematics communication system capable of external vehicle terminal communications, including communications with a communications network 115 having wireless and wired communications capabilities. Included in the wireless telematics communication system is a non-onboard server 116 capable of short-range wireless communications with a mobile terminal.
[0045] As an optional implementation, as shown in Figure 2 The processing method of vehicle data can be applied to the distributed storage device on the vehicle, and the specific steps include:
[0046] S202, in response to a vehicle data verification instruction, a plurality of vehicle data files are obtained from a plurality of vehicle storage areas respectively, wherein the vehicle data file includes vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data;
[0047] S204, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files satisfies the first verification condition, the reference file in the plurality of vehicle data files is determined as a to-be-restored file, wherein the verification data of each target file of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target file;
[0048] S206, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, the plurality of vehicle data files are respectively determined as a plurality of to-be-restored files;
[0049] S208, performing a data recovery operation on the to-be-restored file.
[0050] It can be understood that in S202 in the above embodiment, in response to the vehicle data verification instruction, a plurality of vehicle data files are obtained from a plurality of vehicle storage areas respectively, and the plurality of vehicle storage areas each store a plurality of copies of the same vehicle data, each copy (vehicle data file) contains not only the actual vehicle data, but also a set of verification data for subsequent data verification and recovery.
[0051] It should be noted that the above storage area can be a storage disk area corresponding to each of a plurality of storage disks, or a plurality of storage disk areas divided by one storage disk, or a plurality of storage disk areas divided by a storage array composed of a plurality of storage disks, which is not limited here.
[0052] It should be noted that when the plurality of vehicle data files are obtained through the above step S202, it is necessary to check whether the numerical relationship between the number of target files (first number) in the obtained plurality of vehicle data files and the number of all files (second number) satisfies a preset first check condition. It should be noted that the above-mentioned target file refers to a file whose verification data matches each other.
[0053] Further, the obtained plurality of vehicle data files itself carries verification data, and it is checked whether the verification data of the obtained plurality of vehicle data files is consistent with each other, and the vehicle data file whose verification data is consistent with each other is taken as the above-mentioned target file, and according to the numerical relationship between the number of target files (first number) and the obtained plurality of vehicle data files (second number), in the case that the numerical relationship satisfies the first check condition, the reference file in the plurality of vehicle data files is determined as the file to be recovered.
[0054] Specifically, the above-mentioned numerical relationship can be the ratio of the first number to the second number, or in the case that the second number is within a certain numerical value or a certain numerical value range, the first number should have a minimum value.
[0055] Further, in response to the vehicle data verification instruction, after obtaining the plurality of vehicle data files from the plurality of vehicle-mounted storage areas respectively, one of the following is included:
[0056] Method one: in the case that the ratio between the first number and the second number is greater than or equal to the first number threshold, it is determined that the numerical relationship between the first number and the second number satisfies the first check condition;
[0057] Method two: in the case that the first number is greater than or equal to the second number threshold, it is determined that the numerical relationship between the first number and the second number satisfies the first check condition, wherein the second number threshold is determined according to the second number.
[0058] It can be understood that the above-mentioned method one is the determination of whether the numerical relationship satisfies the first check condition in the case that the above-mentioned numerical relationship is the ratio of the first number to the second number. For example, assuming that the preset first number threshold is 60% at this time, the total number of the obtained plurality of vehicle data files is 10, and the number of vehicle data files (target files) whose verification data is the same is 8 among the 10 vehicle data files. At this time, it can be determined that the ratio between the first number and the second number is 80%, which is greater than the preset first number threshold, and it is determined that the numerical relationship between the first number and the second number satisfies the first check condition.
[0059] In the case that the second quantity threshold is 8 and the first quantity is 8, it is determined that the value relationship between the first quantity and the second quantity satisfies the first check condition.
[0060] Optionally, the first quantity threshold and the second quantity threshold can be determined according to the importance of the data. In the case that the vehicle data is important data, a more stringent threshold is required, that is, a higher first quantity threshold and a second quantity threshold are set. For example, the first quantity threshold is set to 80%, and the second quantity threshold is set to 9 in the case that the number of backups is 10. In the case that the vehicle data is ordinary data, the threshold can be reduced to increase the recovery efficiency. For example, the first quantity threshold is set to 60%, and the second quantity threshold is set to 6 in the case that the number of backups is 10.
[0061] Further, in the case that it is determined that the value relationship satisfies the first check condition, the reference file in the plurality of vehicle data files is determined as the to-be-restored file. It can be understood that the check data in the reference file does not match the check data in the target file. Since the value relationship between the first quantity of the target file and the second quantity of the plurality of vehicle data files satisfies the first check condition, the target file is considered to be a correct data file, and the data file that does not match the check value of the target file is considered to be an error file and needs to be restored.
[0062] Optionally, if the value relationship between the first quantity of the target file and the second quantity of the plurality of vehicle data files does not satisfy the first check condition, it is considered that the correctness of the data of the target file is still in doubt, and the data recovery of other files cannot be performed according to the target file. All the vehicle data files obtained, including the target file, should be restored. That is, in the case that the value relationship between the first quantity of the target file in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first check condition, the plurality of vehicle data files are respectively determined as a plurality of to-be-restored files.
[0063] It can be understood that there is no execution order between the above steps S204 and S206, and the execution is selected according to whether the numerical relationship between the first number of the target file in the plurality of vehicle data files and the second number of the plurality of vehicle data files satisfies the first check condition. In the case where the above numerical relationship satisfies the first check condition, the above step S204 is executed, and in the case where the above numerical relationship does not satisfy the first check condition, the above step S206 is executed. Through the above steps S204 and S206, the to-be-restored file can be determined in the case where the above numerical relationship satisfies the first check condition and in the case where the above numerical relationship does not satisfy the first check condition, respectively, and then the above step S208 is executed to perform the data recovery operation on the to-be-restored file.
[0064] Optionally, the above step S208, performing the data recovery operation on the to-be-restored file, comprises:
[0065] S208-1, in the case where the numerical relationship between the first number and the second number satisfies the first check condition, performing the data recovery operation on the to-be-restored file according to the target file;
[0066] S208-2, in the case where the numerical relationship between the first number and the second number does not satisfy the first check condition, performing the data recovery operation on the to-be-restored file according to the historical version file matched with the to-be-restored file.
[0067] It can be understood that after the to-be-restored data is determined through the above steps S204 and S206, the data recovery is performed on the to-be-restored file. For example, in the case where the to-be-restored file is the reference file determined through the step S204, the step S208-1 is executed to restore the reference file according to the content in the target file, so that the data content of the restored reference file is the same as the data content of the target file. In the case where the to-be-restored file is the plurality of vehicle data files determined through the above step S206, the above step S208-2 is executed to perform the data recovery operation on the to-be-restored file according to the historical version file matched with the to-be-restored file.
[0068] According to the above-mentioned embodiments of the present application, in response to a vehicle data verification instruction, a plurality of vehicle data files are obtained from a plurality of vehicle storage areas, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data; then, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files satisfies a first verification condition, a reference file in the plurality of vehicle data files is determined as a to-be-restored file, wherein the verification data of each of the target files of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target file; further, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first verification condition, the plurality of vehicle data files are determined as a plurality of to-be-restored files; then, a data recovery operation is performed on the to-be-restored files. Thus, the scheme of performing data recovery on to-be-restored data according to a plurality of data backup files containing the same data is realized, the reliability of data backup is enhanced by relying on a plurality of data backup files containing the same data, the problem that backup files cannot be recovered when too many backup files are damaged is avoided, and the reliability of data backup files is further enhanced by introducing the first verification condition, thereby solving the problem of low vehicle data storage reliability in the prior art.
[0069] As an optional embodiment, after obtaining the plurality of vehicle data files from the plurality of vehicle storage areas in response to the vehicle data verification instruction, the following steps are further included:
[0070] S1, performing a file verification operation on the plurality of vehicle data files according to the verification data included in each of the plurality of vehicle data files;
[0071] S2, in the case that the third quantity of first files that pass the file verification operation does not satisfy a second verification condition, determining the plurality of vehicle data files as a plurality of to-be-restored files;
[0072] S3, in the case that the third quantity of first files that pass the file verification operation satisfies the second verification condition, obtaining the verification data of each of the plurality of first files;
[0073] S4, performing data matching verification based on the verification data of each of the plurality of first files.
[0074] It can be understood that the above-mentioned steps S1 to S4 are file verification on the obtained plurality of vehicle data files and subsequent operations according to the verification result. Specifically, the above-mentioned step S1 is performed first. It should be noted that the file verification operation in the above-mentioned step S1 can be performed by using a cyclic redundancy check code (CRC code) or a hash code.
[0075] Specifically, the file checking operation is performed on each of the plurality of vehicle data files according to the checking data included in each of the plurality of vehicle data files, including at least one of the following:
[0076] In a first mode, when the checking data in the current vehicle data file is target cyclic redundancy check information, reference cyclic redundancy check information is determined according to the vehicle data included in the vehicle data file; when the reference cyclic redundancy check information matches the target cyclic redundancy check information, it is determined that the current vehicle data file passes the file checking operation. In a second mode, when the checking data in the current vehicle data file is target hash check information, reference hash check information is determined according to the vehicle data included in the vehicle data file; when the reference hash check information matches the target hash check information, it is determined that the current vehicle data file passes the file checking operation.
[0077] It can be understood that the above-mentioned first mode and second mode are respectively a mode of verifying data by cyclic redundancy check code and hash code. In an optional mode, the file checking operation can be performed on each of the plurality of vehicle data files according to the checking data included in each of the plurality of vehicle data files according to the first mode. Specifically, when the vehicle data is stored, cyclic redundancy coding (CRC coding) is performed according to the stored vehicle data to generate corresponding target cyclic redundancy information, and the target cyclic redundancy information is stored. When the data needs to be checked, the data to be checked is read and the cyclic redundancy information (reference cyclic redundancy information) is recalculated. When the recalculated reference cyclic redundancy information is consistent with the previously stored target cyclic redundancy information, it is considered that the data has not been changed, and at this time it is determined that the current vehicle data file passes the file checking operation.
[0078] In another optional mode, the file checking operation can also be performed on each of the plurality of vehicle data files according to the checking data included in each of the plurality of vehicle data files according to the second mode. Specifically, when storing, hash coding is performed according to the stored vehicle data to generate corresponding hash code (target hash check information). When the data needs to be checked, the data to be checked is read and the hash code is recalculated. When the recalculated hash code (reference hash check information) is the same as the hash code generated when storing, it is considered that the data has not been tampered with, and at this time it is determined that the current vehicle data file passes the file checking operation.
[0079] In yet another alternative, the first and second manners described above can also be used simultaneously to perform the file checking operation on the plurality of vehicle data files according to the verification data included in each of the plurality of vehicle data files. That is, the hash code and the CRC code can be used simultaneously. For example, when storing, first, the hash coding is performed according to the stored vehicle data to generate the corresponding hash code (target hash verification information), and then the CRC coding is performed on the hash code to generate the corresponding target cyclic redundancy information described above. When the data needs to be checked, the data to be checked is read and the hash code is first recalculated. When the recalculated hash code (reference hash verification information) is the same as the hash code generated when storing, the recalculated cyclic redundancy information (reference cyclic redundancy information) is further calculated. If the recalculated reference cyclic redundancy information is consistent with the previously stored target cyclic redundancy information, it is considered that the data has not changed. It should be noted that the above process of first performing hash coding and then performing CRC coding is only an example. CRC coding can be performed first and then hash coding. Here, no specific limitation is made.
[0080] Further, in the case where the third number of the first file through the file checking operation does not satisfy the second verification condition, the plurality of vehicle data files is determined as a plurality of files to be recovered, wherein the determination manner of whether the third number satisfies the second verification condition can be the value of the third number itself, or the ratio between the third number and the second number, specifically including:
[0081] S2-1, in the case where the ratio between the third number and the second number is less than a third number threshold, it is determined that the third number does not satisfy the second verification condition;
[0082] S2-2, in the case where the first number is less than a fourth number threshold, it is determined that the third number does not satisfy the second verification condition.
[0083] It can be understood that the step S2-1 is a step of determining whether the second verification condition is satisfied by the ratio between the third number and the second number. In the case where the ratio between the third number and the second number is less than the third number threshold, it is determined that the third number does not satisfy the second verification condition.
[0084] For example, the third number threshold is preset to be 80%, the second number of the plurality of vehicle data files is 10, and the third number of the first file through the file checking operation is 4. At this time, it is determined that the ratio between the third number and the second number is 40%, which is less than the preset third number threshold. At this time, it is determined that the third number does not satisfy the second verification condition.
[0085] It can be understood that the above step S2-2 is a step of determining whether the third quantity satisfies the second check condition by the value of the third quantity itself. When the third quantity is less than the fourth quantity threshold, it is determined that the third quantity does not satisfy the second check condition. For example, the fourth quantity threshold is preset to be 8, and the third quantity of the first file subjected to the file check operation is 4, which is less than the preset fourth quantity threshold. At this time, it is determined that the third quantity does not satisfy the second check condition.
[0086] It should be noted that the above second check condition indicates the number of files subjected to the encoding check, which represents that the data has not changed in the storage stage. However, the data may have been changed accidentally before being stored, for example, when the data is encoded before being stored. Even if the data is not changed subsequently, the stored data is already incorrect data, and therefore further verification is required, that is, the above steps S202 to S208 are performed. Whether the data is correct data is determined by comparing whether the check data of the files subjected to the data check is consistent with each other. When the check data of a certain file is inconsistent with that of other files, it is indicated that the file has changed before being stored, although it has not changed in the storage stage, resulting in incorrect data being stored.
[0087] In the above step S2, when the third quantity of the first file subjected to the file check operation does not satisfy the second check condition, the plurality of vehicle data files are determined as the plurality of files to be recovered. It can be understood that the third quantity not satisfying the second check condition indicates that the number of files subjected to the data check operation is too small, and the stored files have changed too much in the storage stage. Therefore, it can be directly determined that the stored files (the above plurality of vehicle data files) need to be recovered, that is, the plurality of vehicle data files are determined as the plurality of files to be recovered.
[0088] It can be understood that in the above step S3, the third quantity satisfying the second check condition means that the number of files subjected to the check operation is large, that is, the plurality of backup data files have changed little in the storage stage. At this time, it can be further determined whether the data stored by the files subjected to the check operation is correct data, that is, whether the data has changed in a stage other than storage (such as a writing stage). Specifically, the check data of each of the plurality of first files is first acquired. Further, the above step S4 is performed, and data matching check is performed based on the check data of each of the plurality of first files. The first files with the same check data are determined as the files passing the matching check, and the first files with different check data from other first files are determined as the first files not passing the matching check.
[0089] It is worth noting that although the determination of the second check condition occurs before the determination of the first check condition, the second check condition can be set more strictly than the first check condition. Specifically, in actual application, a default first check condition and a default second check condition are set to balance efficiency and security. In a daily non-emergency situation, data security can be further improved by setting more stringent check conditions. Since the determination of the second check condition occurs before the determination of the first check condition, the second check condition only needs to be changed to be more stringent than the original first check condition. This means that the tolerance for data that has changed during the storage stage is lower, resulting in a smaller number of data check failures. Therefore, the overall vehicle data needs to be restored, thereby improving data security.
[0090] Specifically, under the default condition, the number of data backups is 10, the first number threshold in the first check condition is 60%, the second number threshold is 6, and the third number threshold in the second check condition is 50%, and the fourth number threshold is 5. It can be understood that the second check condition is determined first to determine whether the third number satisfies the second check condition, and the numerical relationship is further determined to satisfy the first check condition when the third number satisfies the second check condition. In the case where data security needs to be improved, the third number threshold and the fourth number threshold in the second check condition are changed to higher values than the first number threshold and the second number threshold, for example, the third number threshold is set to 70%, and the fourth number threshold is set to 7.
[0091] It is worth noting that in the case where the third number threshold and the fourth number threshold in the second check condition are changed to higher values than the first number threshold and the second number threshold, if it is determined that the second check condition is not satisfied, the determination of whether the first check condition is satisfied is not performed.
[0092] For example, assuming that the number of data backups is 10, the first number threshold in the first check condition is 40%, and the second number threshold is 4. At this time, the third number threshold in the second check condition is set to 70%, and the fourth number threshold is set to 7, i.e. the second check condition is more stringent than the first check condition. In this case, if the number of vehicle data files that pass the file check operation is 5, it can be determined that the second check condition is not satisfied. Although in fact, the number of vehicle data files with the same check data in the vehicle data files that pass the file check operation can also be 5, i.e. there is a possibility of satisfying the first check condition, at this time, the determination of whether the first check condition is satisfied is not performed, and the multiple obtained vehicle data files are directly determined as files to be restored, and further data recovery operations are performed.
[0093] As an optional implementation, the data recovery operation is performed on the file to be recovered according to the historical version file matched with the file to be recovered, comprising:
[0094] S1, in the case that the last historical version file matched with the file to be recovered is found, performing the data recovery operation on the file to be recovered according to the last historical version file;
[0095] S2, in the case that the last historical version file matched with the file to be recovered is not found, performing the data recovery operation on the file to be recovered according to the initial version file matched with the file to be recovered.
[0096] It can be understood that in the process of performing the data recovery operation on the file to be recovered through the historical version file matched with the file to be recovered, the historical version file needs to be found first, in the case that the last historical version file matched with the file to be recovered is found, the data recovery operation is performed on the file to be recovered using the last historical version file, if the last historical version file matched with the file to be recovered is not found, the data recovery operation is performed on the file to be recovered using the initial version file matched with the file to be recovered.
[0097] Specifically, in the process of each data backup of a piece of data, the last historical version file and the initial version file are retained, in the process of data recovery, the historical version file is found, if the historical version file is not found, the initial version file is used to recover the file to be recovered, optionally, if the historical version file and the initial version file are not found, the data clearing operation is performed to delete the data to be recovered, so as to avoid transmitting invalid data with risk.
[0098] As an optional implementation, before the plurality of vehicle data files are acquired from the plurality of vehicle storage areas in response to the vehicle data verification instruction, further comprising:
[0099] S1, in the case that the data write request is received, determining the backup information of the vehicle data to be written according to the data type of the vehicle data to be written carried by the data write request, wherein the backup information comprises the backup quantity matched with the data type and the verification condition;
[0100] S2, writing the vehicle data file matched with the vehicle data to be written in the plurality of vehicle storage areas according to the backup information.
[0101] It can be understood that the above steps S1 and S2 are used for data backup according to the data type, for example, according to the importance of the data type, when the data type of the data to be written is important, more backup quantity and more stringent verification conditions are set, for example, the backup quantity of the data belonging to the important data type is set to 10, when there is one important data type of data to be backed up, 10 identical vehicle data files will be generated, and strict first verification condition and second verification condition are set, for example, the first quantity threshold in the above first verification condition is 80%, and the second quantity threshold is 8, and the third quantity threshold in the second verification condition is 70%, and the fourth quantity threshold is 7. It is worth noting that the above is only an example, and the backup quantity and the strictness of the verification condition can be dynamically set according to the importance of the data, which is not limited here.
[0102] As an optional implementation, after performing the data recovery operation on the files to be recovered, further comprising:
[0103] S1, in the case that the region state of the current vehicle storage region in the plurality of vehicle storage regions satisfies the region verification condition, obtaining a plurality of vehicle data files in the current vehicle storage region;
[0104] S2, sequentially performing file verification operation on the plurality of vehicle data files in the current vehicle storage region;
[0105] S3, in the case that the fourth quantity of the second file verified by the file verification operation in the current vehicle storage region does not satisfy the region verification condition, determining the plurality of vehicle data files in the current vehicle storage region as a plurality of files to be recovered;
[0106] S4, performing data recovery operation on the plurality of files to be recovered in the current vehicle storage region.
[0107] It should be noted that in the embodiment, the entire backup partition is verified and recovered as a whole by the above steps S1 to S4, taking each storage backup partition as an object.
[0108] Specifically, first, the above step S1 is performed, and in the case that the region state of the current vehicle storage region in the plurality of vehicle storage regions satisfies the region verification condition, a plurality of vehicle data files in the current vehicle storage region are obtained. It should be noted that the above region verification condition can be that the KV (Key-Value, key-value pair) storage is opened, for example, when the KV storage is opened, it is considered that the region state of the current vehicle storage region in the plurality of vehicle storage regions satisfies the region verification condition, and then a plurality of vehicle data files in the current vehicle storage region are obtained.
[0109] Further, the file verification operation is performed on the plurality of vehicle data files in the current vehicle storage area according to the above step S2, and it can be understood that the step is a traversal operation on the current vehicle storage area, each vehicle data file in the current vehicle storage area is traversed, and the file verification operation is performed on each vehicle data file. The verification process can refer to the foregoing embodiments, and will not be described here.
[0110] Further, in the case that the fourth quantity of the second file verified by the file verification operation in the current vehicle storage area does not satisfy the region verification condition, the plurality of vehicle data files in the current vehicle storage area are determined as a plurality of to-be-recovered files; and further, the above step S4 is performed to perform the data recovery operation on the plurality of to-be-recovered files in the current vehicle storage area.
[0111] Figure 3 is a schematic diagram of an optional vehicle data processing method according to an embodiment of the application, as shown in Figure 3 In the case that no data redundancy backup is performed, the backup architecture only includes the main storage and the backup storage, the data in the main storage is recovered through the backup storage, and if the backup file also appears abnormal, the data reading may be abnormal.
[0112] Figure 4 is a schematic diagram of another optional vehicle data processing method according to an embodiment of the application, as shown in Figure 4 The overall technical solution is divided into three parts, data storage backup, data verification, and data recovery. It should be noted that the backup mechanism using redundancy backup is used in the data storage link to ensure the reliability of the entire data. The verification method in the data verification link can be CRC verification or hash verification, etc. The data is verified through the selected verification method to ensure the validity of the data. In the data recovery link, a hierarchical recovery scheme is adopted.
[0113] The specific process of the above data backup link is described in detail in Figure 5 , as shown in Figure 5 The specific process of the data backup link includes steps S50 to S5,
[0114] S501, open the KV storage. The storage system opens the KV (Key-Value, key-value pair) storage.
[0115] S502, verify data validity. The data verification is realized by calling the data verification module 502.
[0116] S503, obtain valid backup data. Specifically, the last valid backup data is obtained and mapped to the memory 504.
[0117] S512, write data. This step triggers the write data operation to write data to the memory 504.
[0118] S522, synchronizing data.
[0119] S523, triggering a synchronization data operation.
[0120] S524, synchronizing memory data to all database backups. It is worth noting that the above-mentioned database can be a vehicle storage area, and the above-mentioned database backup can be a backup file stored in the vehicle storage area, and a plurality of backup files constitute a database backup cluster 506.
[0121] The specific process of the above-mentioned data verification link is described in detail in the following Figure 6 As shown in the following Figure 6 The specific process of the data backup link includes steps S61 to S62.
[0122] S61, database validity verification link. Specifically, it includes steps S601 to S605. It should be noted that the above-mentioned database can be a vehicle storage area, and the above-mentioned database validity verification link is used to verify the validity of the data file in the vehicle storage area.
[0123] S601, open KV storage.
[0124] S602, whether it can be opened, if yes, execute step S603, if no, execute step S606.
[0125] S603, verification. Get the data in the vehicle storage area and calculate the verification value A1, read the vehicle storage area. Store the verification value A2, compare the values of A1 and A2, complete the verification, and the verification calculation method can be CRC verification or Hash verification, which is not limited here.
[0126] S606, confirm invalid data. In the case that the KV storage cannot be opened, the stored data is directly identified as invalid data.
[0127] S604, whether passed. If the data verification in step S603 is passed, execute step S605 to confirm valid data. If not, execute step S606 to confirm invalid data.
[0128] S62, database consistency verification. It includes steps S611 to S615, and it should be noted that the above-mentioned database can be a vehicle storage area, and the above-mentioned database consistency verification is used to filter out valid files with the same verification value in the vehicle storage area.
[0129] S611, determine the number K of valid database files. According to step S61, K valid database files are filtered out.
[0130] S612, whether greater than N. N is a preset threshold, if yes, step S613 is executed, if no, step S616 is executed. It should be noted that if the K valid database files are greater than N, the second check condition is met, otherwise, if K is not greater than N, the second check condition is not met.
[0131] S613, determine the number of consistent databases G. The consistency of the check value of the data obtained from the above step S61 is compared, and the number of consistent databases G is screened out.
[0132] S614, whether greater than Z. Z is a preset threshold, if yes, step S615 is executed, if no, step S616 is executed. It should be noted that if the number of consistent databases G is greater than Z, the first check condition is met, otherwise, if G is not greater than Z, the first check condition is not met.
[0133] S615, restore the error data. The invalid database is restored according to the valid database, specifically, the invalid vehicle-mounted database file is restored according to the valid vehicle-mounted database file in the storage area.
[0134] S616, overall recovery. Trigger the overall recovery of the database file stored in the vehicle-mounted storage area.
[0135] The overall process of the above data recovery link is shown in Figure 7 As shown in Figure 7 S71, restore the damaged database according to the valid database, specifically, S701 to S706 are included. The invalid database file is restored according to the valid database file in the vehicle-mounted storage area through the above steps S701 to S706.
[0136] S701, start database overall recovery. Trigger the starting step of restoring the invalid database file according to the valid database file in the vehicle-mounted storage area.
[0137] S702, whether there is a historical version, if yes, step S705 is executed, if no, step S703 is executed.
[0138] S705, restore to historical version.
[0139] S703, whether there is an initial version, if yes, step S706 is executed, if no, step S704 is executed.
[0140] S706, restore to initial version.
[0141] S704, restore to empty state.
[0142] Figure 8is a schematic diagram of another optional vehicle data processing method according to an embodiment of the present application, and the following takes Figure 8 a data reading and writing process as an example for illustration.
[0143] The diagnostic data is configured to deploy a storage backup scheme A, and the fault data and camera calibration parameters are configured to deploy a storage backup scheme B. The diagnostic data is synchronized to the data backup cluster A when being written. The diagnostic data is read from the valid database file (which can be stored in the on-board storage area) in the data backup cluster A.
[0144] The fault data and camera calibration data are synchronized to the data backup cluster B when being written. The fault data and camera calibration data are read from the valid database file (which can be stored in the on-board storage area) in the data backup cluster B.
[0145] Further, when the A storage backup scheme triggers the overall recovery scheme, the initial database recovery is directly used. It should be noted that the above initial database is directly generated when being configured. When the B storage backup scheme triggers the overall recovery scheme, the historical version is preferred, and the initial version is second.
[0146] Figure 9 is a schematic diagram of another optional vehicle data processing method according to an embodiment of the present application, and the process of configuring different backup schemes and storage is referred to Figure 9 . First, different backup schemes are configured. For example, Figure 9 two backup schemes A0 and A1 are configured in , and then the user stores the data into the specified database file in the on-board storage area according to the business. When the data generated by a certain business is ordinary data, the data backup scheme A1 is selected to generate two backup files. When the data generated by a certain business is important data, the data backup scheme A0 is selected to generate more backup files than ordinary data, for example, three backup files.
[0147] Further, when the KV storage is started, all data is read, and if the storage file cannot be opened, subsequent checking is not performed, and the storage file is directly marked as illegal.
[0148] Further, for all read data, CRC is calculated and added in sequence to obtain the real-time calculated CRC of the storage file. It should be noted that the special key-value pair CRC field is read, which is the CRC calculated when the KV storage is last closed and saved in the KV storage.
[0149] Further, it is checked whether the stored CRC and the CRC of the real-time read data are consistent. If they are not consistent, it means that the data is tampered with accidentally, and the database file is invalid.
[0150] If K is greater than N, CRC comparison is performed among the K database files stored in the on-board storage area, and if Z identical database files can be found, it is indicated that the KV storage is valid, and single storage file recovery can be performed to restore those invalid database files to a valid state. If Z identical valid database files cannot be found, it is indicated that the KV storage is invalid, and overall recovery is performed.
[0151] If K is greater than N, CRC comparison is performed among the K database files stored in the on-board storage area, and if Z identical database files can be found, it is indicated that the KV storage is valid, and single storage file recovery can be performed to restore those invalid database files to a valid state. If Z identical valid database files cannot be found, it is indicated that the KV storage is invalid, and overall recovery is performed.
[0152] In the overall recovery process, first, it is checked whether there is a historical version of the KV storage, such as the previous version, and if so, the previous version is restored. If not, it is checked whether there is an initial KV storage, and if so, the initial version is restored. If not, the KV storage is restored to an empty state to ensure that no invalid data at risk is passed.
[0153] It should be noted that, for each of the foregoing method embodiments, in order to simply describe, each is described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0154] According to another aspect of the embodiments of the present application, a vehicle data processing apparatus for implementing the vehicle data processing method described above is also provided. As shown in FIG. 10, the apparatus includes: Figure 10
[0155] The acquisition unit 1002 is configured to acquire a plurality of vehicle data files from a plurality of on-board storage areas in response to a vehicle data verification instruction, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data;
[0156] The first determination unit 1004 is configured to determine a reference file in the plurality of vehicle data files as a to-be-restored file when a numerical relationship between a first number of target files in the plurality of vehicle data files and a second number of the plurality of vehicle data files satisfies a first verification condition, wherein the verification data in each of the first number of target files matches each other, and the verification data in the reference file does not match the verification data in the target files;
[0157] The second determining unit 1006 is configured to determine the plurality of vehicle data files as the plurality of to-be-restored files in a case where the numerical relationship between the first quantity of the target file in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first check condition.
[0158] The restoring unit 1008 is configured to perform a data restoring operation on the to-be-restored file.
[0159] As an optional solution, the vehicle data processing apparatus further includes a checking unit configured to perform a file checking operation on the plurality of vehicle data files according to the check data included in each of the plurality of vehicle data files, determine the plurality of vehicle data files as the plurality of to-be-restored files in a case where the third quantity of the first file that passes the file checking operation does not satisfy a second check condition, and acquire the check data of each of the plurality of first files in a case where the third quantity of the first file that passes the file checking operation satisfies the second check condition, and perform a data matching check based on the check data of each of the plurality of first files.
[0160] As an optional solution, the vehicle data processing apparatus further includes a third determining unit configured to determine that the numerical relationship between the first quantity and the second quantity satisfies the first check condition in a case where a ratio between the first quantity and the second quantity is greater than or equal to a first quantity threshold, and determine that the numerical relationship between the first quantity and the second quantity satisfies the first check condition in a case where the first quantity is greater than or equal to a second quantity threshold, wherein the second quantity threshold is determined according to the second quantity.
[0161] As an optional solution, the vehicle data processing apparatus further includes a fourth determining unit configured to determine that the third quantity does not satisfy the second check condition in a case where a ratio between the third quantity and the second quantity is less than a third quantity threshold, and determine that the third quantity does not satisfy the second check condition in a case where the first quantity is less than a fourth quantity threshold.
[0162] As an optional solution, the checking unit includes a first checking module configured to determine reference cyclic redundancy check information according to the vehicle data included in the vehicle data file in a case where the check data in the current vehicle data file is target cyclic redundancy check information, and determine that the current vehicle data file passes the file checking operation in a case where the reference cyclic redundancy check information matches the target cyclic redundancy check information, and a second checking module configured to determine reference hash check information according to the vehicle data included in the vehicle data file in a case where the check data in the current vehicle data file is target hash check information, and determine that the current vehicle data file passes the file checking operation in a case where the reference hash check information matches the target hash check information.
[0163] As an optional solution, the recovery unit includes 1008: a first recovery module, configured to perform a data recovery operation on the file to be recovered according to the target file in a case where the numerical relationship between the first quantity and the second quantity satisfies the first check condition; and a second recovery module, configured to perform a data recovery operation on the file to be recovered according to the historical version file matching the file to be recovered in a case where the numerical relationship between the first quantity and the second quantity does not satisfy the first check condition.
[0164] As an optional solution, the second recovery module is further configured to perform a data recovery operation on the file to be recovered according to the last historical version file matching the file to be recovered in a case where the last historical version file matching the file to be recovered is found; and perform a data recovery operation on the file to be recovered according to the initial version file matching the file to be recovered in a case where the last historical version file matching the file to be recovered is not found.
[0165] As an optional solution, the vehicle data processing apparatus further includes a writing unit, configured to determine backup information of the vehicle data to be written according to a data type of the vehicle data to be written carried in the data writing request in a case where the data writing request is received, wherein the backup information includes a backup quantity and a check condition matching the data type; and write a vehicle data file matching the vehicle data to be written in the plurality of vehicle storage areas according to the backup information.
[0166] As an optional solution, the vehicle data processing apparatus further includes a region recovery unit, configured to acquire a plurality of vehicle data files in a current vehicle storage area in a case where a region state of the current vehicle storage area in the plurality of vehicle storage areas satisfies a region check condition; perform a file check operation on the plurality of vehicle data files in the current vehicle storage area in sequence; determine the plurality of vehicle data files in the current vehicle storage area as a plurality of files to be recovered in a case where a fourth quantity of a second file in the current vehicle storage area through the file check operation does not satisfy the region check condition; and perform a data recovery operation on the plurality of files to be recovered in the current vehicle storage area.
[0167] The embodiments can refer to the examples shown in the vehicle data processing method, which will not be described herein.
[0168] According to another aspect of the embodiments of the present application, an electronic device for implementing the data acquisition method is further provided, which can be a terminal device or a server as shown. Figure 11 The embodiments will be described taking the electronic device as a terminal device as an example. Figure 11As shown, the electronic device includes a memory 1102 in which a computer program is stored, and a processor 1104 configured to execute steps in any of the above method embodiments by the computer program.
[0169] The memory 1102 can be configured to store software programs and modules, such as program instructions / modules of the processing method and device for vehicle data according to the embodiments of the present application. The processor 1104 can execute various function applications and data processing by running the software programs and modules stored in the memory 1102, i.e., implement the processing method for vehicle data as described above. The memory 1102 can include a high-speed random access memory, and further include a nonvolatile memory, such as one or more magnetic storage devices, flash memories, or other nonvolatile solid-state memories. In some examples, the memory 1102 can further include a memory remotely arranged with respect to the processor 1104, which can be connected to the terminal through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. Specifically, the memory 1102 can be, but is not limited to, configured to store file information such as target files. As an example, the memory 1102 can be configured to store a target file, and the processor 1104 can be configured to execute the target file to implement the processing method for vehicle data according to the embodiments of the present application. Figure 11 As shown, the memory 1102 can include, but is not limited to, the acquisition unit 1002, the first determination unit 1004, the second determination unit 1006, and the recovery unit 1008 in the processing device for vehicle data. In addition, other module units in the processing device for vehicle data can also be included, which will not be described herein.
[0170] Optionally, the transmission device 1106 is configured to receive or send data via a network. Specifically, the network can include a wired network and a wireless network. In an example, the transmission device 1106 includes a network adapter (NIC), which can be connected to other network devices and routers through a network cable to communicate with the Internet or a local area network. In an example, the transmission device 1106 is a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0171] In addition, the electronic device further includes a display 1108 and a connection bus 1110 for connecting various module components in the electronic device.
[0172] According to an aspect of the present application, a computer program product is provided, which includes computer programs / instructions containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer programs can be downloaded and installed from a network through a communication part, and / or installed from a detachable medium. When the computer programs are executed by a central processing unit, various functions provided by the embodiments of the present application are performed.
[0173] The above-mentioned sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0174] It should be noted that the computer system of the electronic device is only an example, and should not limit the functions and use range of the embodiments of the present application.
[0175] In particular, according to the embodiments of the present application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, the embodiments of the present application include a computer program product including computer programs carried on a computer readable medium, which contains program codes for executing the methods shown in the flowcharts. In such embodiments, the computer programs can be downloaded and installed from a network through a communication part, and / or installed from a detachable medium. When the computer programs are executed by a central processing unit, various functions defined in the system of the present application are performed.
[0176] According to an aspect of the present application, a computer readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions, so that the computer device performs the methods provided in the various optional implementation manners described above.
[0177] Optionally, in the present embodiment, the above-mentioned computer readable storage medium can be configured to store computer programs for executing the following steps:
[0178] S1, in response to a vehicle data verification instruction, obtaining a plurality of vehicle data files from a plurality of vehicle-mounted storage areas respectively, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data;
[0179] S2, in the case that the numerical relationship between the first quantity of target files in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files satisfies a first verification condition, determining a reference file in the plurality of vehicle data files as a to-be-restored file, wherein the verification data of each target file of the first quantity matches each other, and the verification data in the reference file does not match the verification data in the target file;
[0180] S3, in the case that the numerical relationship between the first quantity of the target file in the plurality of vehicle data files and the second quantity of the plurality of vehicle data files does not satisfy the first check condition, determining the plurality of vehicle data files as a plurality of to-be-restored files respectively;
[0181] S4, performing a data recovery operation on the to-be-restored files.
[0182] Optionally, in the embodiment, all or part of the steps in the various methods of the above-described embodiments can be completed by instructing the hardware related to the electronic device by a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0183] The serial numbers of the embodiments of the application described above are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0184] The integrated units in the above-described embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above-described computer-readable storage medium. Based on such understanding, the technical solutions of the application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the embodiments of the application.
[0185] In the above-described embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0186] In the several embodiments provided by the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Of course, the device embodiment described above is only illustrative, and for example, the division of units is only a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual units can be indirect coupling or communication connection through some interfaces, units or modules, and can be electrical or other forms.
[0187] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0188] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0189] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled persons in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A method of processing vehicle data, characterized by, The method comprises: in response to a vehicle data verification instruction, obtaining a plurality of vehicle data files from a plurality of vehicle-mounted storage areas respectively, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data; in a case where a numerical relationship between a first number of target files in the plurality of vehicle data files and a second number of the plurality of vehicle data files satisfies a first verification condition, determining a reference file in the plurality of vehicle data files as a to-be-restored file, wherein the verification data in each of the target files matches each other, and the verification data in the reference file does not match the verification data in the target files; in a case where the numerical relationship between the first number of the target files in the plurality of vehicle data files and the second number of the plurality of vehicle data files does not satisfy the first verification condition, determining the plurality of vehicle data files as a plurality of to-be-restored files respectively; performing a data recovery operation on the to-be-restored files.
2. The method of claim 1, wherein, After the plurality of vehicle data files are obtained from the plurality of vehicle-mounted storage areas in response to the vehicle data verification instruction, the method further comprises: performing a file verification operation on the plurality of vehicle data files according to the verification data included in each of the plurality of vehicle data files; in a case where a third number of first files that pass the file verification operation does not satisfy a second verification condition, determining the plurality of vehicle data files as the plurality of to-be-restored files; in a case where the third number of the first files that pass the file verification operation satisfies the second verification condition, obtaining the verification data in each of the plurality of first files; performing a data matching verification based on the verification data in each of the plurality of first files.
3. The method of claim 2, wherein, After the plurality of vehicle data files are obtained from the plurality of vehicle-mounted storage areas in response to the vehicle data verification instruction, the method comprises one of the following: in a case where a ratio between the first number and the second number is greater than or equal to a first number threshold, it is determined that the numerical relationship between the first number and the second number satisfies the first verification condition; in a case where the first number is greater than or equal to a second number threshold, it is determined that the numerical relationship between the first number and the second number satisfies the first verification condition, wherein the second number threshold is determined according to the second number.
4. The method of claim 2, wherein, After the plurality of vehicle data files are obtained from the plurality of vehicle-mounted storage areas in response to the vehicle data verification instruction, the method comprises one of the following: in a case where a ratio between the third number and the second number is less than a third number threshold, it is determined that the third number does not satisfy the second verification condition; in a case where the third number is less than a fourth number threshold, it is determined that the third number does not satisfy the second verification condition.
5. The method of claim 2, wherein, The performing of the file verification operation on the plurality of vehicle data files according to the verification data included in each of the plurality of vehicle data files comprises at least one of the following: In a case where the check data in the current vehicle data file is target cyclic redundancy check information, determining reference cyclic redundancy check information according to the vehicle data included in the vehicle data file; In a case where the reference cyclic redundancy check information matches the target cyclic redundancy check information, determining that the current vehicle data file passes the file check operation; In a case where the check data in the current vehicle data file is target hash check information, determining reference hash check information according to the vehicle data included in the vehicle data file; In a case where the reference hash check information matches the target hash check information, determining that the current vehicle data file passes the file check operation.
6. The method of claim 1, wherein, The data recovery operation performed on the to-be-recovered file includes: In a case where the numerical relationship between the first quantity and the second quantity satisfies the first check condition, performing the data recovery operation on the to-be-recovered file according to the target file; In a case where the numerical relationship between the first quantity and the second quantity does not satisfy the first check condition, performing the data recovery operation on the to-be-recovered file according to a historical version file matched with the to-be-recovered file.
7. The method of claim 6, wherein, The data recovery operation performed on the to-be-recovered file according to the historical version file matched with the to-be-recovered file includes: In a case where a last historical version file matched with the to-be-recovered file is found, performing the data recovery operation on the to-be-recovered file according to the last historical version file; In a case where a last historical version file matched with the to-be-recovered file is not found, performing the data recovery operation on the to-be-recovered file according to an initial version file matched with the to-be-recovered file.
8. The method of claim 1, wherein, Before the multiple vehicle data files are acquired from the multiple vehicle-mounted storage areas in response to the vehicle data check instruction, the method further includes: In a case where a data write request is received, determining backup information of to-be-written vehicle data according to a data type of the to-be-written vehicle data carried by the data write request, wherein the backup information includes a backup quantity matched with the data type and a check condition; Writing, according to the backup information, the vehicle data file matched with the to-be-written vehicle data in the multiple vehicle-mounted storage areas.
9. The method of claim 1, wherein, After the data recovery operation is performed on the to-be-recovered file, the method further includes: In a case where a region state of a current vehicle-mounted storage area in the multiple vehicle-mounted storage areas satisfies a region check condition, acquiring multiple vehicle data files in the current vehicle-mounted storage area; Performing, in sequence, a file check operation on the multiple vehicle data files in the current vehicle-mounted storage area; In a case where a fourth quantity of a second file passing the file check operation in the current vehicle-mounted storage area does not satisfy the region check condition, determining the multiple vehicle data files in the current vehicle-mounted storage area as multiple to-be-recovered files; Performing a data recovery operation on the multiple to-be-recovered files in the current vehicle-mounted storage area.
10. A processing device of vehicle data, characterized by, includes: An acquisition unit is configured to acquire a plurality of vehicle data files from a plurality of vehicle storage areas in response to a vehicle data verification instruction, wherein the vehicle data files include vehicle data and verification data, and the plurality of vehicle data files correspond to the same vehicle data. A first determination unit is configured to determine a reference file in the plurality of vehicle data files as a file to be recovered when a numerical relationship between a first number of target files in the plurality of vehicle data files and a second number of the plurality of vehicle data files satisfies a first verification condition, wherein the verification data in each of the target files matches each other, and the verification data in the reference file does not match the verification data in the target files. A second determination unit is configured to determine the plurality of vehicle data files as a plurality of files to be recovered when the numerical relationship between the first number of the target files in the plurality of vehicle data files and the second number of the plurality of vehicle data files does not satisfy the first verification condition. A recovery unit is configured to perform a data recovery operation on the file to be recovered.
11. A computer readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein the program is run by an electronic device to perform the method described in any one of claims 1 to 9.
12. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 9 by using the computer program.
13. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method described in any one of claims 1 to 9.
Citation Information
Patent Citations
Vehicle-mounted system data verification method and device, electronic equipment and storage medium
CN117421780A
Intelligent verification method and device for data integrity
CN117992408A