Data storage method, reading method and device of vehicle gateway

By performing classified storage according to the data update cycle, the problem of frequent memory operation and failure risks during data storage of on-board gateway data is solved, and the reliability and stability of on-board gateways are improved.

CN114428591BActive Publication Date: 2025-03-11BEIJING HAINACHUAN AUTOMOTIVE PARTS
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210099904.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-27
Publication Date
2025-03-11
Estimated Expiration
2042-01-27

AI Technical Summary

Technical Problem

When the on-board gateway stores data, mixed storage causes frequent memory operation, which increases the risk of failure. Especially in the case of unstable voltage, electromagnetic interference or abnormal power failure, it may lead to data loss and affect the function of the gateway product.

Method used

By obtaining the data update cycle of the data to be stored, its storage path is determined, and it is divided into internal memory and external memory for classification storage, reducing the probability of frequent update of data to the memory reading and writing abnormalities.

Benefits of technology

It improves the reliability and overall stability of the vehicle gateway in complex environments and reduces the risk of data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114428591B_ABST
    Figure CN114428591B_ABST
Patent Text Reader

Abstract

The present invention discloses a data storage method and device, a data reading method and device, and a computer-readable storage medium of a vehicle-mounted gateway, wherein the data storage method comprises: obtaining a data update cycle of data to be stored; and determining a storage path of the data to be stored according to the data update cycle of the data to be stored. The data storage method of the present invention classifies and stores the data to be stored by type, thereby reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle-mounted gateway in a complex environment and improving the overall stability of the vehicle-mounted gateway.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle technology, and in particular to a data storage method for a vehicle gateway, a data reading method for a vehicle gateway, a data storage device for a vehicle gateway, a data reading device for a vehicle gateway, and a computer-readable storage medium. Background Art

[0002] With the improvement of vehicle intelligence and the addition of functions such as autonomous driving, the number of vehicle controllers and data throughput are gradually increasing, which has put higher requirements on the reliability of vehicle central gateway products. Static routing tables and dynamic routing tables are often stored in vehicle gateways. Vehicle gateways also need to store a lot of vehicle dynamic data, such as vehicle configuration information and fault records and logs during vehicle operation.

[0003] In the related art, when the vehicle gateway stores data, it usually stores the data in a mixed manner in a memory, which leads to frequent operations on the memory. In addition, the memory may encounter abnormal operations during faster read and write operations, such as unstable vehicle voltage, electromagnetic interference, or even abnormal power failure, which may cause the memory to malfunction, resulting in the risk of loss of all data stored in the memory, thereby affecting the function of the entire gateway product. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the first purpose of the present invention is to propose a data storage method for a vehicle gateway, which classifies and stores the data to be stored according to the type, thereby reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle gateway in a complex environment and improving the overall stability of the vehicle gateway.

[0005] A second objective of the present invention is to provide a method for reading data of a vehicle-mounted gateway.

[0006] A third object of the present invention is to provide a computer-readable storage medium.

[0007] A fourth object of the present invention is to provide another computer-readable storage medium.

[0008] A fifth objective of the present invention is to provide a data storage device for a vehicle-mounted gateway.

[0009] A sixth objective of the present invention is to provide a data reading device for a vehicle-mounted gateway.

[0010] To achieve the above objectives, a first aspect of the present invention provides a data storage method for a vehicle gateway, comprising: obtaining a data update cycle of data to be stored; and determining a storage path of the data to be stored according to the data update cycle of the data to be stored.

[0011] According to the data storage method of the vehicle gateway of the embodiment of the present invention, when storing data, the data update cycle of the data to be stored is first obtained, and then the storage path of the data to be stored is determined according to the data update cycle of the data to be stored. Therefore, the method classifies and stores the data to be stored according to the type of data to be stored, reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle gateway in complex environments and improving the overall stability of the vehicle gateway.

[0012] In addition, the data storage method of the vehicle gateway according to the above embodiment of the present invention may also have the following additional technical features:

[0013] According to one embodiment of the present invention, the vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and the storage path of the data to be stored is determined according to the data update cycle of the data to be stored, including: when the data update cycle of the data to be stored is less than a set cycle, the data to be stored is stored in the first main storage area; when the data update cycle of the data to be stored is greater than or equal to the set cycle, the data to be stored is stored in the second main storage area.

[0014] According to one embodiment of the present invention, the internal memory also includes a first backup storage area. After the data to be stored is successfully stored in the first main storage area, the method also includes: obtaining the data level of the data to be stored; when the data level of the data to be stored is a preset level, backing up the data to be stored to the first backup storage area; when the data to be stored is successfully backed up to the first backup storage area, determining that the data storage is successful.

[0015] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the first backup storage area, the method further includes: synchronizing the data to be stored stored in the first main storage area to the first backup storage area.

[0016] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the first main storage area, the method also includes: if the data level of the data to be stored is not a preset level, determining that the data storage has failed; if the data level of the data to be stored is a preset level, storing the data to be stored in the first backup storage area; when the data to be stored is successfully stored in the first backup storage area, synchronizing the data to be stored stored in the first backup storage area to the first main storage area.

[0017] According to one embodiment of the present invention, the data storage method of the above-mentioned vehicle gateway also includes: when the data to be stored in the first main storage area is consistent with the data to be stored in the first backup storage area, determining that the synchronization of the data to be stored is successful; when the data to be stored in the first storage area is inconsistent with the data to be stored in the first backup storage area, determining that the synchronization of the data to be stored has failed.

[0018] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After the data to be stored is successfully stored in the second main storage area, the method also includes: obtaining the data level of the data to be stored; when the data level of the data to be stored is a preset level, backing up the data to be stored to the second backup storage area; when the data to be stored is successfully backed up to the second backup storage area, determining that the data storage is successful.

[0019] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the second backup storage area, the method further includes: synchronizing the data to be stored stored in the second main storage area to the second backup storage area.

[0020] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the second main storage area, the method also includes: if the data level of the data to be stored is not a preset level, determining that the data storage has failed; if the data level of the data to be stored is a preset level, storing the data to be stored in the second backup storage area; when the data to be stored is successfully stored in the second backup storage area, synchronizing the data to be stored stored in the second backup storage area to the second main storage area.

[0021] According to one embodiment of the present invention, the data storage method of the above-mentioned vehicle gateway also includes: when the data to be stored in the second main storage area is consistent with the data to be stored in the second backup storage area, determining that the synchronization of the data to be stored is successful; when the data to be stored in the second storage area is inconsistent with the data to be stored in the second backup storage area, determining that the synchronization of the data to be stored has failed.

[0022] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a data reading method for a vehicle gateway, comprising: executing the data storage method for the vehicle gateway of the first aspect of the present invention to determine the stored data; upon receiving a data reading instruction, determining a data update period of the data to be read according to the data reading instruction; and determining a reading path of the data to be read according to the data update period of the data to be read.

[0023] According to the data reading method of the vehicle gateway of the embodiment of the present invention, when receiving the data reading instruction, the data update cycle of the data to be read is first determined according to the data reading instruction, and then the reading path of the data to be read is determined according to the data update cycle of the data to be read. Therefore, the method can ensure the accuracy of the read data, improve the reliability of the vehicle gateway working in a complex environment, and improve the overall stability of the vehicle gateway.

[0024] In addition, the data reading method of the vehicle gateway according to the above embodiment of the present invention may also have the following additional technical features:

[0025] According to one embodiment of the present invention, the vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and a reading path of the data to be read is determined according to a data update cycle of the data to be read, including: when the data update cycle of the data to be read is less than a set cycle, determining to read the data from the first main storage area; when the data update cycle of the data to be read is greater than or equal to the set cycle, determining to read the data from the second main storage area.

[0026] According to one embodiment of the present invention, the internal memory also includes a first backup storage area. After successfully reading data from the first main storage area, the method also includes: obtaining a data level of the data to be read; when the data level of the data to be read is a preset level, reading the data from the first backup storage area; when successfully reading the data from the first backup storage area, if the data read from the first main storage area is the same as the data read from the first backup storage area, determining that the data reading is successful.

[0027] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After successfully reading data from the second main storage area, the method also includes: obtaining a data level of the data to be read; when the data level of the data to be read is a preset level, reading the data from the second backup storage area; when successfully reading data from the second backup storage area, if the data read from the second main storage area is the same as the data read from the second backup storage area, determining that the data reading is successful.

[0028] To achieve the above objectives, the third aspect of the present invention provides a computer-readable storage medium on which a data storage program for a vehicle gateway is stored. When the data storage program for the vehicle gateway is executed by a processor, the data storage method for the vehicle gateway of the first aspect of the present invention is implemented.

[0029] According to the computer-readable storage medium of the embodiment of the present invention, by executing the above-mentioned data storage method of the vehicle gateway, it is possible to improve the reliability of the vehicle gateway working in a complex environment and improve the overall stability of the vehicle gateway.

[0030] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present invention proposes another computer-readable storage medium, on which a data reading program for a vehicle gateway is stored. When the data reading program for the vehicle gateway is executed by a processor, the data reading method for the vehicle gateway of the second aspect embodiment is implemented.

[0031] According to the computer-readable storage medium of the embodiment of the present invention, by executing the above-mentioned data reading method of the vehicle gateway, the accuracy of the read data can be guaranteed, the reliability of the vehicle gateway working in a complex environment can be improved, and the overall stability of the vehicle gateway can be improved.

[0032] To achieve the above-mentioned purpose, the fifth aspect of the present invention proposes a data storage device for a vehicle gateway, including: a first acquisition module, used to obtain a data update period of the data to be stored; and a first determination module, used to determine a storage path of the data to be stored according to the data update period of the data to be stored.

[0033] According to the data storage device of the vehicle gateway of the embodiment of the present invention, when storing data, the first acquisition module acquires the data update cycle of the data to be stored, and the first determination module determines the storage path of the data to be stored according to the data update cycle of the data to be stored. Thus, the device stores data by type, reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle gateway in complex environments and improving the overall stability of the vehicle gateway.

[0034] To achieve the above-mentioned purpose, the sixth aspect of the present invention proposes a data reading device for a vehicle gateway, comprising: the data storage device of the vehicle gateway of the fifth aspect of the present invention, used to determine the stored data; a second determination module, used to determine the data update period of the data to be read according to the data reading instruction when receiving the data reading instruction; and a third determination module, used to determine the reading path of the data to be read according to the data update period of the data to be read.

[0035] According to the data reading device of the vehicle gateway of the embodiment of the present invention, when receiving the data reading instruction, the second determination module determines the data update cycle of the data to be read according to the data reading instruction, and the third determination module determines the reading path of the data to be read according to the data update cycle of the data to be read. Thus, the device can ensure the accuracy of the read data, improve the reliability of the vehicle gateway working in a complex environment, and improve the overall stability of the vehicle gateway.

[0036] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a flowchart of a data storage method for a vehicle gateway according to an embodiment of the present invention;

[0038] Figure 2 A flowchart of a data synchronization process according to a specific example of the present invention;

[0039] Figure 3 A flowchart of a data storage method for a vehicle gateway according to a specific example of the present invention;

[0040] Figure 4 is a flow chart of a method for reading data from a vehicle gateway according to an embodiment of the present invention;

[0041] Figure 5 A flowchart of a method for reading data from a vehicle gateway according to a specific example of the present invention;

[0042] Figure 6 It is a block diagram of a data storage device of a vehicle gateway according to an embodiment of the present invention;

[0043] Figure 7 FIG. 4 is a block diagram of a data reading device of a vehicle gateway according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0045] The following describes a data storage method for a vehicle gateway, a data reading method for a vehicle gateway, a data storage device for a vehicle gateway, a data reading device for a vehicle gateway, and a computer-readable storage medium proposed in embodiments of the present invention with reference to the accompanying drawings.

[0046] Figure 1 The present invention is a flowchart of a data storage method of a vehicle gateway according to an embodiment of the present invention.

[0047] like Figure 1 As shown, the data storage method of the vehicle gateway of the embodiment of the present invention may include the following steps:

[0048] S101, obtaining a data update period of data to be stored.

[0049] In some embodiments of the present invention, the data update cycle may include data with a fast update speed and data with a slow update speed. For example, data with a fast update speed includes: dynamic routing table data and vehicle operation log data, etc., and data with a slow update speed includes: vehicle offline configuration data and vehicle operation fault data, etc.

[0050] S102: Determine a storage path for the data to be stored according to a data update period of the data to be stored.

[0051] Specifically, according to step S101, the data update cycle of the data to be stored can be obtained. When the data update cycle of the data to be stored is a fast update speed, the data with a fast update speed is stored in the internal memory because the reading time of the internal memory is faster; when the data update cycle of the data to be stored is a slow update speed, the reading time of the external memory is longer than that of the internal memory. Therefore, the data with a slow update speed is stored in the external memory. This can minimize the probability of memory read and write abnormalities caused by frequent data updates, thereby improving the overall stability of the gateway controller product.

[0052] According to one embodiment of the present invention, the vehicle gateway may include: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and the storage path of the data to be stored is determined according to the data update cycle of the data to be stored, including: when the data update cycle of the data to be stored is less than the set cycle, the data to be stored is stored in the first main storage area; when the data update cycle of the data to be stored is greater than or equal to the set cycle, the data to be stored is stored in the second main storage area. The set cycle can be set according to the data update cycle when the vehicle is produced and rolled off the assembly line.

[0053] In some embodiments of the present invention, the internal memory may be a non-volatile memory EEPROM (Electrically Erasable Programmable Read Only Memory) inside the MCU (Microcontroller Unit) controller of the vehicle gateway, and the external memory may be a non-volatile memory FLASH (flash memory) outside the controller. The MCU controller may control the reading and writing of the external FLASH memory via a bus.

[0054] Specifically, when the vehicle gateway stores data, the data to be stored first undergoes an integrity check, for example, a CRC (Cyclic Redundancy Check) check can be used to check the integrity of the data to be stored. When the data to be stored passes the check, the vehicle gateway starts to perform the data storage action; when the data to be stored fails the integrity check, the data storage fails.

[0055] If the data update cycle of the data to be stored is less than the set cycle, that is, the data to be stored is updated quickly, the data to be stored can be stored in the first main storage area of ​​the internal memory. Since the storage rate of the internal memory is fast, it can meet the high read and write requests of frequently updated data, thereby meeting the high read and write requests of frequently updated data, shortening the read and write operation time, and reducing the MCU execution time; if the data update cycle of the data to be stored is greater than or equal to the set cycle, that is, the data to be stored is updated slowly, the data to be stored can be stored in the second main storage area of ​​the external memory. Since the storage rate of the external memory is relatively slow, it is more suitable for storing data with a longer update cycle.

[0056] Therefore, the method classifies the data to be stored according to the update cycle and stores them in the internal memory and the external memory respectively. This can minimize the probability of memory read and write abnormalities caused by frequent data updates, thereby improving the overall stability of the gateway controller product.

[0057] According to an embodiment of the present invention, the internal memory further includes a first backup storage area, and after the data to be stored is successfully stored in the first main storage area, the method further includes: obtaining a data level of the data to be stored; when the data level of the data to be stored is a preset level, backing up the data to be stored in the first backup storage area; when the data to be stored is successfully backed up in the first backup storage area, determining that the data is successfully stored. In some embodiments of the present invention, the data level can be divided into important data and less important data according to the importance of the data to the vehicle, and the preset level can be important.

[0058] In some embodiments of the present invention, the vehicle gateway usually needs to store the following types of data: dynamic routing table data, vehicle offline configuration data, vehicle operation fault data and vehicle operation log data. Among them, the dynamic routing table data records the path of the gateway to route the message, determines the correctness of the gateway data routing, and is the most important data in the gateway storage data. This type of data will be frequently updated and adjusted according to the network load and the working conditions of other controllers, and the corresponding routing table also needs to be updated synchronously, so this type of data will be defined as important and updated faster. The vehicle offline configuration data is extremely important for vehicle operation. The configuration data directly defines the realization and performance indicators of vehicle functions, which is more intuitive for user experience; the configuration data is usually stored and written uniformly when the vehicle is offline, and is rarely updated in the future, unless there is a system upgrade, etc., so this type of data is defined as important and updated slower data. The vehicle operation fault data records the possible causes of the fault when the gateway function is limited, and provides an analysis basis for the future analysis of the fault, but the probability of vehicle failure is relatively low, the data update cycle is relatively long, and the loss of fault data will not have a substantial impact on the normal operation of the vehicle, so this type of data is defined as less important and updated slower data. The vehicle operation log data records the working status and environmental indicators of the gateway during daily operation, which is convenient for statistical analysis of the working conditions of the vehicle under various daily working conditions, and provides support for future performance optimization and updating of fault causes. This type of data will be updated frequently as the gateway works, but this type of data itself does not affect the normal function of the gateway, so this type of data is defined as less important and updated faster.

[0059] Specifically, after the data to be stored is successfully stored according to the update speed of the data to be stored, it is also determined whether to perform backup processing on the data to be stored according to the data level of the data to be stored. Among them, when the data to be stored is updated quickly and is important data, such as dynamic routing table data, the data to be stored is stored in the first main storage area of ​​the internal memory and backed up to the first backup storage area of ​​the internal memory. After the backup is successful, the data storage is considered successful; when the data to be stored is updated quickly but is not important data, such as vehicle operation log data, the data to be stored is stored in the first main storage area of ​​the internal memory, but is not backed up, and the data storage is considered successful. Therefore, by backing up important data, the reliability of important data storage is guaranteed, and by using the two-write method, the probability of encountering a busy device when writing data is reduced, the success rate of a single write is increased, the storage occupancy time is reduced, and the CPU execution efficiency is improved. Due to the increase in the success rate of a single write, multiple write attempts and waiting time are avoided.

[0060] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the first backup storage area, the method further includes: synchronizing the data to be stored stored in the first main storage area to the first backup storage area.

[0061] Specifically, when the data to be stored is not successfully backed up to the first backup storage area, the data to be stored stored in the first main storage area is synchronized to the first backup storage area. The process of synchronizing the data to be stored in the first main storage area to the first backup storage area is: reading the data to be stored in the first main storage area, verifying the integrity of the data, and if the data is complete, synchronizing the data to the first backup storage area. Thus, the reliability of important data is guaranteed by performing a real-time redundant backup mechanism for important data.

[0062] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the first main storage area, the method also includes: if the data level of the data to be stored is not a preset level, determining that the data storage has failed; if the data level of the data to be stored is a preset level, storing the data to be stored in the first backup storage area; when the data to be stored is successfully stored in the first backup storage area, synchronizing the data to be stored stored in the first backup storage area to the first main storage area.

[0063] Specifically, when the data to be stored is not successfully stored in the first main storage area, it is necessary to judge the data level of the data to be stored. If the data level of the data to be stored is secondary importance, it means that the loss of the data will not have a substantial impact on the normal operation of the vehicle gateway, and there is no need to continue storing the data, and the data storage fails.

[0064] If the data to be stored is important data, the data to be stored is first stored in the first backup storage area. After the data to be stored is successfully stored in the first backup storage area, the data to be stored stored in the first backup storage area is synchronized to the first main storage area. The specific process of synchronizing the data to be stored in the first backup storage area to the first main storage area is: read the data to be stored in the first backup storage area, check the integrity of the data, and if the data is complete, synchronize the data to the first main storage area. In this way, the automatic recovery of erroneous data is achieved through the redundant storage of gateway data and the data synchronization mechanism.

[0065] According to one embodiment of the present invention, the data storage method of the above-mentioned vehicle gateway further includes: when the data to be stored in the first main storage area is consistent with the data to be stored in the first backup storage area, determining that the synchronization of the data to be stored is successful; when the data to be stored in the first storage area is inconsistent with the data to be stored in the first backup storage area, determining that the synchronization of the data to be stored has failed.

[0066] Specifically, in the aforementioned embodiment, during the storage process of the data to be stored, if the data to be stored is important and updated quickly, it is necessary to store it twice in the first main storage area and the first backup storage area, and in the case that the data to be stored is only successfully stored once during the storage process, the data in the storage area storing the data to be stored is synchronized to the storage area that failed to complete. After synchronizing the band storage data, it is also necessary to compare the data to be stored in the first main storage area with the data to be stored in the first backup storage area for consistency. When the data to be stored in the first main storage area is consistent with the data to be stored in the first backup storage area, it is determined that the synchronization of the data to be stored is successful; when the data to be stored in the first storage area is inconsistent with the data to be stored in the first backup storage area, it is determined that the synchronization of the data to be stored has failed. Therefore, by performing consistency verification on the data in the storage area and the data in the backup area, the accuracy of data storage can be improved.

[0067] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After the data to be stored is successfully stored in the second main storage area, the method also includes: obtaining the data level of the data to be stored; when the data level of the data to be stored is a preset level, backing up the data to be stored to the second backup storage area; when the data to be stored is successfully backed up to the second backup storage area, determining that the data storage is successful.

[0068] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the second backup storage area, the method further includes: synchronizing the data to be stored stored in the second main storage area to the second backup storage area.

[0069] Specifically, after the data to be stored is successfully stored according to the update speed of the data to be stored, it is also determined whether to perform backup processing on the data to be stored according to the data level of the data to be stored. Among them, when the data to be stored is updated slowly and is important data, such as vehicle offline configuration data, the data to be stored is stored in the second main storage area of ​​the external memory and backed up to the second backup storage area of ​​the external memory. After the backup is successful, the data storage is considered successful; when the data to be stored is updated slowly but is not important data, such as vehicle operation fault data, the area to be stored is stored in the second main storage area of ​​the external memory, but a backup is performed, and the data storage is considered successful. Therefore, by backing up important data, the reliability of important data storage is guaranteed, and by using a two-time write method, the probability of encountering a busy device when writing data is reduced, the success rate of a single write is increased, the storage occupancy time is reduced, and the CPU execution efficiency is improved. Due to the increase in the success rate of a single write, multiple write attempts and waiting time are avoided.

[0070] When the data to be stored is not successfully backed up to the second backup storage area, the data to be stored stored in the second main storage area is synchronized to the second backup storage area. The process of synchronizing the data to be stored in the second main storage area to the second backup storage area is: reading the data to be stored in the second main storage area, checking the integrity of the data, and if the data is complete, synchronizing the data to the second backup storage area. Thus, the reliability of important data is guaranteed by performing a real-time redundant backup mechanism for important data.

[0071] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the second main storage area, the method also includes: if the data level of the data to be stored is not a preset level, determining that the data storage has failed; if the data level of the data to be stored is a preset level, storing the data to be stored in the second backup storage area; when the data to be stored is successfully stored in the second backup storage area, synchronizing the data to be stored stored in the second backup storage area to the second main storage area.

[0072] Specifically, when the data to be stored is not successfully stored in the second main storage area, it is necessary to judge the data level of the data to be stored. If the data level of the data to be stored is secondary importance, it means that the loss of the data will not have a substantial impact on the normal operation of the vehicle gateway, and there is no need to continue storing the data, and the data storage fails.

[0073] If the data to be stored is important data, the data to be stored is first stored in the second backup storage area. After the data to be stored is successfully stored in the second backup storage area, the data to be stored stored in the second backup storage area is synchronized to the second main storage area. The specific process of synchronizing the data to be stored in the second backup storage area to the second main storage area is: reading the data to be stored in the second backup storage area, checking the integrity of the data, and if the data is complete, synchronizing the data to the second main storage area. Thus, through the redundant storage of gateway data and the data synchronization mechanism, automatic recovery of erroneous data is achieved.

[0074] According to one embodiment of the present invention, the data storage method of the above-mentioned vehicle gateway further includes: when the data to be stored in the second main storage area is consistent with the data to be stored in the second backup storage area, determining that the synchronization of the data to be stored is successful; when the data to be stored in the second storage area is inconsistent with the data to be stored in the second backup storage area, determining that the synchronization of the data to be stored has failed.

[0075] Specifically, in the aforementioned embodiment, during the storage process of the data to be stored, if the data to be stored is important and updated slowly, it is necessary to store it twice in the second main storage area and the second backup storage area, and in the case that the data to be stored is only successfully stored once during the storage process, the data in the storage area storing the data to be stored is synchronized to the storage area that failed to complete. After synchronizing the band storage data, it is also necessary to compare the data to be stored in the second main storage area with the data to be stored in the second backup storage area for consistency. When the data to be stored in the second main storage area is consistent with the data to be stored in the second backup storage area, it is determined that the synchronization of the data to be stored is successful; when the data to be stored in the second storage area is inconsistent with the data to be stored in the second backup storage area, it is determined that the synchronization of the data to be stored has failed. Therefore, by performing consistency verification on the data in the storage area and the data in the backup area, the accuracy of data storage can be improved.

[0076] As a specific example, Figure 2 As shown, the data storage process in the data storage method of the vehicle gateway may include the following steps:

[0077] S201, start storing data.

[0078] S202, perform integrity check to determine whether the data to be stored is complete. If yes, execute step S204; if not, execute step S203.

[0079] S203, data storage fails.

[0080] S204, determine whether the data update period of the data to be stored is less than the set period. If yes, execute step S205; if not, execute step S206.

[0081] S205: Store the data to be stored in the first main storage area.

[0082] S206, storing the data to be stored in the second main storage area.

[0083] S207, determine whether the data to be stored is stored successfully. If yes, execute step S208; if not, execute step S212.

[0084] S208, determining whether the data level of the data to be stored is a preset level. If yes, executing step S209; if no, executing step S211.

[0085] S209, backing up the data to be stored to the corresponding backup storage area.

[0086] S210, determining whether the data to be stored is backed up to the corresponding backup storage area. If yes, executing step S211; if not, executing step S214.

[0087] S211, determining that the data is stored successfully.

[0088] S212, determine whether the data level of the data to be stored is a preset level. If yes, execute step S213; if no, execute step S215.

[0089] S213, backing up the data to be stored to the corresponding backup storage area.

[0090] S214, determining whether the data to be stored is backed up to the corresponding backup storage area. If yes, executing step S215; if not, executing step S216.

[0091] S215, start the data synchronization process.

[0092] S216, data storage failed.

[0093] For ease of understanding, the data synchronization process in the internal memory of the vehicle gateway of the present invention is described in a specific embodiment. Figure 3 As shown, the data synchronization process in the internal memory data storage process of the vehicle gateway may include the following steps:

[0094] S301, data synchronization starts.

[0095] S302: Read the data to be stored in the first main storage area.

[0096] S303, perform integrity check to determine whether the data to be stored is complete. If yes, execute step S204; if not, execute step S307.

[0097] S304: Synchronize the data to be stored in the first primary storage area to the first backup storage area.

[0098] S305, perform integrity check to determine whether the data to be stored is complete. If yes, execute step S310; if not, execute step S306.

[0099] S306: Data synchronization failed.

[0100] S307: Read the data to be stored in the first backup storage area.

[0101] S308, perform integrity check to determine whether the data to be stored is complete. If yes, execute step S310; if not, execute step S309.

[0102] S309, data synchronization failed.

[0103] S310, determining whether the data to be stored in the first primary storage area is consistent with the data to be stored in the first backup storage area. If yes, executing step S311; if not, executing step S309.

[0104] S311, data synchronization is successful.

[0105] It should be noted that the details of the data synchronization process in the external memory of the vehicle gateway can refer to the data synchronization process in the internal memory, which will not be repeated here.

[0106] In summary, according to the data storage method of the vehicle gateway of the embodiment of the present invention, when storing data, the data update cycle of the data to be stored is first obtained, and then the storage path of the data to be stored is determined according to the data update cycle of the data to be stored. Therefore, the method classifies and stores the data to be stored according to the type of data to be stored, reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle gateway in complex environments and improving the overall stability of the vehicle gateway.

[0107] In order to clearly explain the above embodiment, a second aspect of the present invention provides a method for reading data from a vehicle-mounted gateway. Figure 4 This is a flowchart of a method for reading data from an in-vehicle gateway provided in an embodiment of the second aspect of the present application.

[0108] like Figure 4 As shown, the data reading method of the vehicle gateway may include the following steps:

[0109] S401, executing the data storage method of the vehicle gateway of the first aspect embodiment to determine the storage data.

[0110] S402, when a data read instruction is received, determining a data update period of the data to be read according to the data read instruction.

[0111] S403, determining a reading path of the data to be read according to a data update period of the data to be read.

[0112] According to one embodiment of the present invention, the vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and a reading path of the data to be read is determined according to a data update cycle of the data to be read, including: when the data update cycle of the data to be read is less than a set cycle, determining to read the data from the first main storage area; when the data update cycle of the data to be read is greater than or equal to the set cycle, determining to read the data from the second main storage area.

[0113] Specifically, if the data update cycle of the data to be read is less than the set cycle, that is, the data to be read is updated quickly, the data can be read from the first main storage area of ​​the internal memory. Since the reading rate of the internal memory is fast, it can meet the high read and write requests of frequently updated data, thereby shortening the read and write operation time and reducing the execution time of the on-board gateway MCU.

[0114] If the data update cycle of the data to be read is greater than the set cycle, that is, the data to be read is updated slowly, the data storage can be read from the second main storage area of ​​the external memory. Since the reading rate of the external memory is relatively slow, it is more suitable for reading and writing data with a longer update cycle, thereby reducing the risk of data loss caused by frequent operations.

[0115] According to one embodiment of the present invention, the internal memory also includes a first backup storage area. After successfully reading data from the first main storage area, the method also includes: obtaining a data level of the data to be read; when the data level of the data to be read is a preset level, reading the data from the first backup storage area; when successfully reading the data from the first backup storage area, if the data read from the first main storage area is the same as the data read from the first backup storage area, determining that the data reading is successful.

[0116] Specifically, after successfully reading data from the first main storage area according to the update speed of the data to be read, it is also determined whether to read the data from the first backup storage area according to the data level of the data to be read. Among them, when the data to be read is updated quickly and is important data, such as dynamic routing table data, after successfully reading the data from the first main storage area of ​​the internal memory, the data is also read from the first backup storage area of ​​the internal memory. After the data is read successfully, the data read from the first main storage area is compared with the data read from the first backup storage area for consistency. If the two are the same, the vehicle gateway successfully reads the data. When the data to be read is updated quickly but is not important data, such as vehicle operation log data, after successfully reading the data from the first main storage area of ​​the internal memory, there is no need to read the data from the first backup storage area, and the data is considered to be read successfully. Therefore, the accuracy of data reading is improved by reading and verifying twice.

[0117] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After successfully reading data from the second main storage area, the method also includes: obtaining a data level of the data to be read; when the data level of the data to be read is a preset level, reading the data from the second backup storage area; when successfully reading data from the second backup storage area, if the data read from the second main storage area is the same as the data read from the second backup storage area, determining that the data reading is successful.

[0118] Specifically, after successfully reading data from the second main storage area according to the update speed of the data to be read, it is also determined whether to read the data from the second backup storage area according to the data level of the data to be read. Among them, when the data to be read is updated quickly and is important data, such as dynamic routing table data, after successfully reading the data from the second main storage area of ​​the internal memory, the data is also read from the second backup storage area of ​​the internal memory. After the data is read successfully, the data read from the second main storage area is compared with the data read from the second backup storage area for consistency. If the two are the same, the vehicle gateway successfully reads the data. When the data to be read is updated quickly but is not important data, such as vehicle operation log data, after successfully reading the data from the second main storage area of ​​the internal memory, there is no need to read the data from the second backup storage area, and the data is considered to be read successfully. Therefore, the accuracy of data reading is improved by reading and verifying twice.

[0119] As a specific example, Figure 5 As shown, the process of the data reading method of the vehicle gateway may include the following steps:

[0120] S501, receiving a data read instruction.

[0121] S502, determining a data update period of the data to be read according to the data reading instruction.

[0122] S503, determining a reading path according to an update period of the data to be read.

[0123] S504, perform integrity check to determine whether the data to be read is complete. If yes, execute step S505; if not, execute step S509.

[0124] S505, determining whether the data level of the data to be stored is a preset level. If yes, executing step S506; if no, executing step S508.

[0125] S506, reading data from the corresponding backup storage area.

[0126] S507, determine whether the data to be read in the primary storage area is consistent with the data to be read in the corresponding backup storage area. If yes, execute step S508; if not, execute step S512.

[0127] S508, data read successfully

[0128] S509, determine whether the data level of the data to be stored is a preset level. If yes, execute step S510; if not, execute step S513.

[0129] S510, reading data from a corresponding backup storage area.

[0130] S511, perform integrity check to determine whether the data to be stored is complete. If yes, execute step S512; if not, execute step S513.

[0131] S512, enter the data synchronization process.

[0132] S513, data reading failed.

[0133] It should be noted that for details not disclosed in the data reading method of the vehicle gateway in the embodiment of the present invention, please refer to the details disclosed in the data storage method of the vehicle gateway in the above embodiment, and the details will not be repeated here.

[0134] According to the data reading method of the vehicle gateway of the embodiment of the present invention, when receiving the data reading instruction, the data update cycle of the data to be read is first determined according to the data reading instruction, and then the reading path of the data to be read is determined according to the data update cycle of the data to be read. Therefore, the method can ensure the accuracy of the read data, improve the reliability of the vehicle gateway working in a complex environment, and improve the overall stability of the vehicle gateway.

[0135] Corresponding to the first aspect embodiment, the present invention also proposes a computer-readable storage medium.

[0136] The computer-readable storage medium of the embodiment of the present invention stores a data storage program of a vehicle gateway, and when the data storage program of the vehicle gateway is executed by a processor, the data storage method of the vehicle gateway of the first aspect of the embodiment is implemented.

[0137] According to the computer-readable storage medium of the embodiment of the present invention, by executing the above-mentioned data storage method of the vehicle gateway, it is possible to improve the reliability of the vehicle gateway working in a complex environment and improve the overall stability of the vehicle gateway.

[0138] Corresponding to the second aspect embodiment, the present invention also proposes a computer-readable storage medium.

[0139] The computer-readable storage medium of an embodiment of the present invention stores a data reading program for a vehicle gateway, and when the data reading program for the vehicle gateway is executed by a processor, the data reading method for the vehicle gateway of the first embodiment is implemented.

[0140] According to the computer-readable storage medium of the embodiment of the present invention, by executing the above-mentioned data reading method of the vehicle gateway, the accuracy of the read data can be guaranteed, the reliability of the vehicle gateway working in a complex environment can be improved, and the overall stability of the vehicle gateway can be improved.

[0141] Corresponding to the first aspect embodiment, the present invention also proposes a data storage device for a vehicle-mounted gateway.

[0142] Figure 6 FIG. 4 is a block diagram of a data storage device of a vehicle gateway according to an embodiment of the present invention.

[0143] like Figure 6 As shown, the data storage device 600 of the vehicle gateway according to the embodiment of the present invention includes: a first acquisition module 610 and a first determination module 620 .

[0144] The first acquisition module 610 is used to acquire the data update cycle of the data to be stored. The first determination module 620 is used to determine the storage path of the data to be stored according to the data update cycle of the data to be stored.

[0145] According to one embodiment of the present invention, the vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, and the external memory includes a second main storage area. The first determination module 620 determines the storage path of the data to be stored according to the data update period of the data to be stored, and is specifically used to store the data to be stored in the first main storage area when the data update period of the data to be stored is less than the set period; and store the data to be stored in the second main storage area when the data update period of the data to be stored is greater than or equal to the set period.

[0146] According to one embodiment of the present invention, the internal memory also includes a first backup storage area. After the data to be stored is successfully stored in the first main storage area, the first determination module 620 is also used to obtain the data level of the data to be stored; when the data level of the data to be stored is a preset level, the data to be stored is backed up to the first backup storage area; when the data to be stored is successfully backed up to the first backup storage area, it is determined that the data storage is successful.

[0147] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the first backup storage area, the method further includes: synchronizing the data to be stored stored in the first main storage area to the first backup storage area.

[0148] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the first main storage area, the first determination module 620 is also used to determine that the data storage has failed if the data level of the data to be stored is not a preset level; if the data level of the data to be stored is a preset level, the data to be stored is stored in the first backup storage area; when the data to be stored is successfully stored in the first backup storage area, the data to be stored stored in the first backup storage area is synchronized to the first main storage area.

[0149] According to one embodiment of the present invention, the first determination module 620 is also used to determine that the synchronization of the data to be stored is successful when the data to be stored in the first main storage area is consistent with the data to be stored in the first backup storage area; and to determine that the synchronization of the data to be stored has failed when the data to be stored in the first storage area is inconsistent with the data to be stored in the first backup storage area.

[0150] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After the data to be stored is successfully stored in the second main storage area, the first determination module 620 is also used to obtain the data level of the data to be stored; when the data level of the data to be stored is a preset level, the data to be stored is backed up to the second backup storage area; when the data to be stored is successfully backed up to the second backup storage area, it is determined that the data storage is successful.

[0151] According to an embodiment of the present invention, when the data to be stored is not successfully backed up to the second backup storage area, the first determining module 620 is further configured to synchronize the data to be stored in the second main storage area to the second backup storage area.

[0152] According to one embodiment of the present invention, when the data to be stored is not successfully stored in the second main storage area, the first determination module 620 is also used to determine that the data storage has failed if the data level of the data to be stored is not a preset level; if the data level of the data to be stored is a preset level, the data to be stored is stored in the second backup storage area; when the data to be stored is successfully stored in the second backup storage area, the data to be stored stored in the second backup storage area is synchronized to the second main storage area.

[0153] According to one embodiment of the present invention, the first determination module 620 is also used to determine that the synchronization of the data to be stored is successful when the data to be stored in the second main storage area is consistent with the data to be stored in the second backup storage area; and to determine that the synchronization of the data to be stored has failed when the data to be stored in the second storage area is inconsistent with the data to be stored in the second backup storage area.

[0154] It should be noted that for details not disclosed in the data storage device of the vehicle gateway in the embodiment of the present invention, please refer to the details disclosed in the data storage method of the vehicle gateway in the embodiment of the present invention, and the details will not be repeated here.

[0155] According to the data storage device of the vehicle gateway of the embodiment of the present invention, when storing data, the first acquisition module acquires the data update cycle of the data to be stored, and the first determination module determines the storage path of the data to be stored according to the data update cycle of the data to be stored. Thus, the device stores data by type, reducing the probability of abnormal reading and writing of the memory caused by frequent data updates, thereby improving the reliability of the vehicle gateway in complex environments and improving the overall stability of the vehicle gateway.

[0156] Corresponding to the second aspect of the embodiment, the present invention also proposes a data reading device for a vehicle-mounted gateway.

[0157] Figure 7 FIG. 4 is a block diagram of a data reading device of a vehicle gateway according to an embodiment of the present invention.

[0158] like Figure 7 As shown, the data reading device 700 of the vehicle gateway according to the embodiment of the present invention includes: the data storage device 600 of the vehicle gateway mentioned above, a second determination module 720 and a third determination module 730 .

[0159] The data storage device 600 of the vehicle gateway is used to determine the stored data. The second determination module 720 is used to determine the data update cycle of the data to be read according to the data read instruction when receiving the data read instruction. The third determination module 730 is used to determine the reading path of the data to be read according to the data update cycle of the data to be read.

[0160] According to one embodiment of the present invention, the vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and the reading path of the data to be read is determined according to the data update cycle of the data to be read. The third determination module 730 is specifically used to determine to read the data from the first main storage area when the data update cycle of the data to be read is less than the set cycle; when the data update cycle of the data to be read is greater than or equal to the set cycle, determine to read the data from the second main storage area.

[0161] According to one embodiment of the present invention, the internal memory also includes a first backup storage area. After successfully reading data from the first main storage area, the third determination module 730 is also used to obtain the data level of the data to be read; when the data level of the data to be read is a preset level, the data is read from the first backup storage area; when the data is successfully read from the first backup storage area, if the data read from the first main storage area is the same as the data read from the first backup storage area, it is determined that the data reading is successful.

[0162] According to one embodiment of the present invention, the external memory also includes a second backup storage area. After successfully reading data from the second main storage area, the third determination module 730 is also used to obtain the data level of the data to be read; when the data level of the data to be read is a preset level, the data is read from the second backup storage area; when the data is successfully read from the second backup storage area, if the data read from the second main storage area is the same as the data read from the second backup storage area, it is determined that the data reading is successful.

[0163] It should be noted that for details not disclosed in the data reading device of the vehicle gateway in the embodiment of the present invention, please refer to the details disclosed in the data reading method of the vehicle gateway in the embodiment of the present invention, and the details will not be repeated here.

[0164] According to the data reading device of the vehicle gateway of the embodiment of the present invention, when receiving the data reading instruction, the second determination module determines the data update cycle of the data to be read according to the data reading instruction, and the third determination module determines the reading path of the data to be read according to the data update cycle of the data to be read. Thus, the device can ensure the accuracy of the read data, improve the reliability of the vehicle gateway working in a complex environment, and improve the overall stability of the vehicle gateway.

[0165] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0166] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0167] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0168] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0169] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0170] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A data storage method for a vehicle gateway, characterized in that: in, The data types that the vehicle gateway needs to store include: dynamic routing table data, vehicle offline configuration data, vehicle operation fault data and vehicle operation log data. The method includes: Obtaining the data update cycle of the data to be stored; Determining a storage path for the data to be stored according to a data update period of the data to be stored; The vehicle-mounted gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, and the external memory includes a second main storage area, and the storage path of the data to be stored is determined according to the data update period of the data to be stored, including: When the data update period of the data to be stored is less than the set period, storing the data to be stored in the first main storage area; When the data update period of the data to be stored is greater than or equal to the set period, storing the data to be stored in the second main storage area; The internal memory further includes a first backup storage area. After the data to be stored is successfully stored in the first main storage area, the method further includes: Acquire the data level of the data to be stored; When the data level of the data to be stored is a preset level, backing up the data to be stored to the first backup storage area; When the data to be stored is successfully backed up to the first backup storage area, determining that the data storage is successful; When the data to be stored is not successfully stored in the first main storage area, the method further includes: If the data level of the data to be stored is not a preset level, determining that the data storage fails; If the data level of the data to be stored is a preset level, storing the data to be stored in the first backup storage area; When the data to be stored is successfully stored in the first backup storage area, the data to be stored stored in the first backup storage area is synchronized to the first main storage area.

2. The data storage method of the vehicle gateway according to claim 1, characterized in that: When the data to be stored is not successfully backed up to the first backup storage area, the method further includes: The data to be stored stored in the first main storage area is synchronized to the first backup storage area.

3. The data storage method of the vehicle gateway according to claim 1 or 2, characterized in that: Also includes: When the data to be stored in the first primary storage area is consistent with the data to be stored in the first backup storage area, determining that the data to be stored is successfully synchronized; When the data to be stored in the first main storage area is inconsistent with the data to be stored in the first backup storage area, it is determined that the synchronization of the data to be stored has failed.

4. The data storage method of the vehicle gateway according to claim 1, characterized in that: The external memory further includes a second backup storage area. After the data to be stored is successfully stored in the second main storage area, the method further includes: Acquire the data level of the data to be stored; When the data level of the data to be stored is a preset level, backing up the data to be stored to the second backup storage area; When the data to be stored is successfully backed up to the second backup storage area, it is determined that the data is stored successfully.

5. The data storage method of the vehicle gateway according to claim 4, characterized in that: When the data to be stored is not successfully backed up to the second backup storage area, the method further includes: The data to be stored stored in the second primary storage area is synchronized to the second backup storage area.

6. The data storage method of the vehicle gateway according to claim 4, characterized in that: When the data to be stored is not successfully stored in the second main storage area, the method further includes: If the data level of the data to be stored is not a preset level, determining that the data storage fails; If the data level of the data to be stored is a preset level, storing the data to be stored in the second backup storage area; When the data to be stored is successfully stored in the second backup storage area, the data to be stored stored in the second backup storage area is synchronized to the second main storage area.

7. The data storage method of the vehicle gateway according to claim 5 or 6, characterized in that: Also includes: When the data to be stored in the second main storage area is consistent with the data to be stored in the second backup storage area, determining that the data to be stored is successfully synchronized; When the data to be stored in the second main storage area is inconsistent with the data to be stored in the second backup storage area, it is determined that the synchronization of the data to be stored has failed.

8. A method for reading data from a vehicle-mounted gateway, characterized in that: in, The data types that the vehicle gateway needs to store include: dynamic routing table data, vehicle offline configuration data, vehicle operation fault data and vehicle operation log data. The method includes: Execute the data storage method of the vehicle gateway according to any one of claims 1 to 7 to determine the stored data; When receiving a data reading instruction, determining a data update period of the data to be read according to the data reading instruction; Determining a reading path of the data to be read according to a data update period of the data to be read; The vehicle-mounted gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, and the external memory includes a second main storage area, and determining a reading path of the data to be read according to a data update period of the data to be read includes: When the data update period of the to-be-read data is less than a set period, determining to read the data from the first main storage area; When the data update period of the data to be read is greater than or equal to the set period, it is determined to read the data from the second main storage area.

9. The method for reading data from a vehicle gateway according to claim 8, characterized in that: The internal memory further includes a first backup storage area. After successfully reading data from the first main storage area, the method further includes: Acquire the data level of the data to be read; When the data level of the data to be read is a preset level, reading the data from the first backup storage area; When the data is successfully read from the first backup storage area, if the data read from the first main storage area is the same as the data read from the first backup storage area, it is determined that the data reading is successful.

10. The method for reading data of the vehicle gateway according to claim 8, characterized in that: The external memory further includes a second backup storage area. After successfully reading data from the second main storage area, the method further includes: Acquire the data level of the data to be read; When the data level of the data to be read is a preset level, reading the data from the second backup storage area; When the data is successfully read from the second backup storage area, if the data read from the second main storage area is the same as the data read from the second backup storage area, it is determined that the data reading is successful.

11. A computer-readable storage medium, characterized in that: A data storage program of the vehicle gateway is stored thereon, and when the data storage program of the vehicle gateway is executed by the processor, the data storage method of the vehicle gateway according to any one of claims 1-7 is implemented.

12. A computer-readable storage medium, characterized in that: A data reading program of the vehicle gateway is stored thereon, and when the data reading program of the vehicle gateway is executed by the processor, the data reading method of the vehicle gateway according to any one of claims 8-10 is implemented.

13. A data storage device for a vehicle gateway, characterized in that: in, The types of data that the vehicle gateway needs to store include: dynamic routing table data, vehicle offline configuration data, vehicle operation fault data and vehicle operation log data. The device includes: A first acquisition module, used for acquiring a data update period of data to be stored; A first determining module, configured to determine a storage path of the data to be stored according to a data update period of the data to be stored; The vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, and the external memory includes a second main storage area. The first determination module determines the storage path of the data to be stored according to the data update period of the data to be stored, specifically for: When the data update period of the data to be stored is less than the set period, storing the data to be stored in the first main storage area; When the data update period of the data to be stored is greater than or equal to the set period, storing the data to be stored in the second main storage area; The internal memory further includes a first backup storage area, and after the data to be stored is successfully stored in the first main storage area, the internal memory further includes: Acquire the data level of the data to be stored; When the data level of the data to be stored is a preset level, backing up the data to be stored to the first backup storage area; When the data to be stored is successfully backed up to the first backup storage area, determining that the data storage is successful; When the data to be stored is not successfully stored in the first main storage area, the method further includes: If the data level of the data to be stored is not a preset level, determining that the data storage fails; If the data level of the data to be stored is a preset level, storing the data to be stored in the first backup storage area; When the data to be stored is successfully stored in the first backup storage area, the data to be stored stored in the first backup storage area is synchronized to the first main storage area.

14. A data reading device for a vehicle gateway, characterized in that: in, The types of data that the vehicle gateway needs to store include: dynamic routing table data, vehicle offline configuration data, vehicle operation fault data and vehicle operation log data. The device includes: The data storage device of the vehicle gateway according to claim 13, used to determine the stored data; A second determination module, configured to determine a data update period of the data to be read according to the data read instruction when receiving the data read instruction; A third determining module, configured to determine a reading path of the data to be read according to a data update period of the data to be read; The vehicle gateway includes: an internal memory and an external memory, wherein the internal memory includes a first main storage area, the external memory includes a second main storage area, and the third determination module determines a reading path of the data to be read according to a data update period of the data to be read, specifically for: When the data update period of the to-be-read data is less than a set period, determining to read the data from the first main storage area; When the data update period of the data to be read is greater than or equal to the set period, it is determined to read the data from the second main storage area.

Citation Information

Patent Citations

  • Method and apparatus for coherent memory copy with duplicated write request

    CN102326153A

  • Request processing method and device based on object storage, equipment and storage medium

    CN110888838A

  • Storage position selection method and device, terminal equipment and storage medium

    CN111679791A

  • Application data storage method

    CN113655958A

  • Cable modem and operating method thereof

    US20190171366A1