Data storage method and device, storage medium and electronic device
By setting up a safety backup control unit in multiple electronic control units of the smart car, the effectiveness and cost of safe storage of data are reduced, and the problem of high data storage cost in smart cars is solved.
Patent Information
- Application Number
- CN202411386542.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-03
AI Technical Summary
In smart cars, when storing a large amount of data, especially sensitive information, such as the keys of the vehicle's electronic control unit and user personal information, directly storage will bring security problems, and due to the need to deploy hardware security modules, the cost is high. Technology has not effectively solved this problem.
By setting M safety control units in multiple electronic control units of the target vehicle, the storage mode is determined as a safe storage mode, and the target data is stored in the safe storage area of these safety control units, avoiding the need for each electronic control unit Set up secure storage areas to reduce storage costs.
The effectiveness of safely storing data in smart cars is achieved, reducing data storage costs, and avoiding the waste and additional costs of hardware security modules required for each electronic control unit.
Smart Images

Figure CN119248199A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the automotive field, and in particular, to a data storage method, device, storage medium and electronic device. Background Art
[0002] During normal driving of smart cars, the vehicles will generate a large amount of data. This data may include sensitive information of the vehicle's electronic control unit (ECU). For example, keys and certificates for vehicle-to-cloud communication, user personal information, etc. However, this information cannot be transmitted in plain text. Direct storage locally without additional processing will also bring security issues. Usually, component developers will solve these problems by deploying hardware security modules. However, the deployment of multiple ECUs in the car is bound to lead to waste of functions and additional costs.
[0003] From this, we can see that the related technology has the problem of high data storage cost.
[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention
[0005] Embodiments of the present invention provide a data storage method, device, storage medium, and electronic device method and device to at least solve the problem of high data storage cost existing in the related art.
[0006] According to one embodiment of the present invention, there is provided a data storage method, which is applied to a target vehicle, wherein the target vehicle includes N electronic control units, wherein the N electronic control units include a main electronic control unit and N-1 backup electronic control units, wherein the N-1 backup electronic control units include M safety backup control units supporting secure storage, wherein the safety backup control unit includes a secure storage area, wherein N and M are integers, and M is less than N-1, and the main electronic control unit is connected to the backup electronic control unit, and the method includes: determining a storage mode of target data to be stored; when the storage mode is a secure storage model, determining the safety backup control unit supporting secure storage in the backup electronic control unit; determining a target electronic control unit in the safety backup control unit and the main electronic control unit; and storing the target data in the secure storage area included in the target electronic control unit.
[0007] According to another embodiment of the present invention, there is provided a data storage device, comprising: applied to a target vehicle, the target vehicle comprising N electronic control units, the N electronic control units comprising a main electronic control unit and N-1 spare electronic control units, the N-1 spare electronic control units comprising M safety standby control units supporting secure storage, the safety standby control units comprising a secure storage area, N and M being integers, M being less than N-1, the main electronic control unit being connected to the standby electronic control unit, comprising: a first determination module, for determining a storage mode of target data to be stored; a second determination module, for determining the safety standby control unit supporting secure storage in the standby electronic control unit when the storage mode is a secure storage model; a third determination module, for determining a target electronic control unit in the safety standby control unit and the main electronic control unit; a storage module, for storing the target data in the secure storage area included in the target electronic control unit.
[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.
[0009] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0010] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.
[0011] Through the present invention, when it is determined that the storage mode of the target data is the secure storage mode, a secure standby control unit that supports secure storage is determined in the standby electronic control unit; a target electronic control unit is determined in the secure standby control unit and the main electronic control unit; and the target data is stored in the secure storage area included in the target electronic control unit. Since M secure standby control units can be set in N electronic control units, when the storage mode of the target data is the secure storage mode, the target data can be stored in the secure storage area of the secure standby control unit, and there is no need to set a secure storage area for each electronic control unit. Therefore, the problem of high data storage cost existing in the related art can be solved, and the effect of reducing data storage cost can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1It is a hardware structure block diagram of a mobile terminal of a data storage method according to an embodiment of the present invention;
[0013] Figure 2 is a schematic diagram of connecting a main electronic control unit and a standby electronic control unit according to an embodiment of the present invention;
[0014] Figure 3 is a flow chart of a method for storing data according to an embodiment of the present invention;
[0015] Figure 4 is a schematic structural diagram of a main electronic control unit according to an embodiment of the present invention;
[0016] Figure 5 is a schematic diagram of the structure of an electronic control unit according to an embodiment of the present invention;
[0017] Figure 6 is a schematic diagram of a single storage method according to an embodiment of the present invention;
[0018] Figure 7 is a schematic diagram of a round-robin storage method according to an embodiment of the present invention;
[0019] Figure 8 is a flow chart of a method for storing data according to a specific embodiment of the present invention;
[0020] Fig. 9 is a structural block diagram of a data storage device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0023] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a data storage method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0024] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the data storage method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0025] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0026] In this embodiment, a data storage method is provided, which is applied to a target vehicle, wherein the target vehicle includes N electronic control units, wherein the N electronic control units include a main electronic control unit and N-1 spare electronic control units, wherein the N-1 spare electronic control units include M safe standby control units supporting safe storage, wherein the safe standby control units include a safe storage area, wherein N and M are integers, M is less than N-1, and the main electronic control unit is connected to the standby electronic control unit.
[0027] In the above embodiment, the target vehicle may be a fuel vehicle, an electric vehicle, a hybrid vehicle, etc. The target vehicle may include multiple electronic control units ECU. Assume that the number of electronic control units included in the target vehicle is N, and a main electronic control unit may be set among the N electronic control units, hereinafter referred to as the server. The electronic control units included in the N electronic control units except the server are called standby electronic control units, and the standby electronic control units may be referred to as clients. Among the N-1 clients, M clients may be selected as secure standby control units, and secure storage areas may be set in the M clients to achieve secure storage. When sending data to the secure storage area for storage, the secure storage area may encrypt and store the data according to a pre-set storage program to achieve the purpose of securely storing data. Among them, the server may be an ECU that can connect to an external network, such as an ECU deployed on a TBOX (on-board communication terminal) or an ECU deployed on an IVI (in-vehicle infotainment system). The schematic diagram of the connection between the main electronic control unit and the standby electronic control unit can be found in the attached figure. Figure 2 ,like Figure 2 As shown, the main electronic control unit can communicate with each standby electronic control unit, and the main electronic control unit and the standby electronic control unit can send information to each other. The hardware of the main electronic control unit itself has a certain computing power and can process requests from multiple clients at the same time.
[0028] Figure 3 is a flow chart of a method for storing data according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0029] Step S302, determining a storage mode of target data to be stored;
[0030] As an example, the target data may be data received by the server or data received by the client. The target data may be the driving parameters of the vehicle, the setting parameters for the vehicle, and the terminal information data of the vehicle connection terminal. The driving parameters may include the driving model, the vehicle running speed, etc. The setting data of the vehicle may include the parameters for setting the driving model of the vehicle, the parameters for setting the seats of the vehicle, the parameters for setting the atmosphere of the vehicle's cab, etc. The terminal information data may include the terminal's identification, type, multimedia files, address books, images, etc. synchronized by the terminal.
[0031] As an example, the storage mode may include a secure storage mode, in which data needs to be stored in encrypted form. The storage mode may also include a normal mode, in which data may be stored in plain text.
[0032] Step S304, when the storage mode is a secure storage model, determining the secure standby control unit that supports secure storage in the standby electronic control unit;
[0033] As an example, when the storage mode is the secure storage mode and the master electronic control unit supports secure storage, the target data may be directly stored in the secure storage area of the master electronic control unit.
[0034] As another example, when the target vehicle is started, the client can connect to the server, and the server verifies the identity information of the client. If the verification is successful, a communication connection is established with the client. The server and the client can be connected wirelessly or by wire. When the storage mode is the secure storage mode, communication can be performed with the backup electronic control unit to query whether the backup electronic control unit is a secure backup control unit.
[0035] Step S306, determining a target electronic control unit in the safety standby electronic control unit and the main electronic control unit;
[0036] As an example, after the safety standby control unit is determined, a target electronic control unit may be randomly determined from the safety standby control unit and the main electronic control unit as a control unit for storing target data.
[0037] As another example, a first data type of the target data may be determined, and a control unit in the safety standby control unit and the main electronic control unit storing data of the same type as the first data type may be determined as the target electronic control unit.
[0038] Step S308: storing the target data in the secure storage area included in the target electronic control unit.
[0039] In the above embodiment, the structural diagram of the main electronic control unit can be found in the attached Figure 4 ,like Figure 4As shown, the main electronic control unit may include an in-vehicle network communication module, an identity management module, a policy module, and a hardware security module. The in-vehicle network communication module may be used to receive or send data from the in-vehicle network. It provides the identity authentication module with data from other ECUs in the vehicle. When the identity authentication is successful, the client and the server may communicate securely and encrypted. The hardware security module may be a hardware storage module. It often contains a trusted secure storage environment, a key or random number generation environment, and encryption operation acceleration capabilities. The identity management module is used to authenticate the identity of the client communicating with the server in the in-vehicle network. When the in-vehicle ECU is deployed, the module may record the identity identification code of each ECU in its internal device list and save the list to the hardware security module. Access to the list is identity-restricted and can only be accessed by the manufacturer or authorized party of the car. If the device needs to be updated later, it can only be changed through the authorized channel. The module can identify that the client is a device in the device list in the system, and then pass the identity authentication. It can access the data stored in the hardware security module. It can also identify that the client is not a device in the device list. It is prevented from accessing the data in the hardware security module. The policy module can count the secure storage space of each safety control unit in the vehicle. During initialization, the policy module communicates with other clients, asks whether the client component supports secure storage, and the remaining space of the secure storage, and records it. This data will be updated in real time after each startup. The policy module can also schedule the overall vehicle storage space. The sensitive data that needs to be saved is transmitted to the secure storage module of the ECU with free space through the network for storage. If the secure storage area in the ECU is insufficient, it is necessary to select the secure storage area of another ECU for storage. The scheduling storage method can be divided into patrol storage and single storage. After storage, you can also record the location of the saved data and the location of the ECU that has saved the data in the secure storage area. So that when the ECU of the data source reads the data, it can be effectively accessed.
[0040] In the above embodiment, the schematic diagram of the structure of the electronic control unit can be found in the attached Figure 5 ,like Figure 5As shown, the electronic control unit may include a network communication interface and an in-vehicle network communication module. It may also include an encryption and decryption module and a hardware storage module. Before establishing a network connection, the in-vehicle network communication module may pre-set its identity as a client. The encryption and decryption module may be responsible for secure communication with the server. The data sent to the server can be encrypted through this module, and conversely, the data received from the server can be decrypted through this module. The encryption and decryption module is related to the configuration of the ECU itself. If it is an ECU with simple functions, the encryption and decryption module is often not configured. At this time, the communicated data can only be in plain text. The network communication interface provides an abstract interface for network communication for the ECU. The software in the ECU only needs to load the interface to complete the communication with the server.
[0041] Through the present invention, when it is determined that the storage mode of the target data is the secure storage mode, a secure standby control unit that supports secure storage is determined in the standby electronic control unit; a target electronic control unit is determined in the secure standby control unit and the main electronic control unit; and the target data is stored in the secure storage area included in the target electronic control unit. Since M secure standby control units can be set in N electronic control units, when the storage mode of the target data is the secure storage mode, the target data can be stored in the secure storage area of the secure standby control unit, and there is no need to set a secure storage area for each electronic control unit. Therefore, the problem of high data storage cost existing in the related art can be solved, and the effect of reducing data storage cost can be achieved.
[0042] Optionally, the execution entity of the above steps may be a main electronic control unit, but is not limited thereto.
[0043] In an exemplary embodiment, determining the target electronic control unit in the safety standby control unit and the main electronic control unit includes: determining a target storage method for storing the target data; determining the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method. In this embodiment, the target storage method may include a single storage method and a patrol storage method. The single storage method can first store a full electronic control unit, and then store it in another electronic control unit when one storage area is full. The patrol storage method means that it will not be continuously saved in the same electronic control unit. That is, multiple electronic control units store data in rotation.
[0044] In the above embodiment, when the target storage mode is a single storage mode, the electronic control unit currently used to store data included in the safety standby control unit and the main electronic control unit can be determined, and the electronic control unit is determined as the target electronic control unit. When the target storage mode is a patrol storage mode, the electronic control unit that last stored data included in the safety standby control unit and the main electronic control unit can be determined, and the next electronic control unit of the electronic control unit is determined as the target electronic control unit.
[0045] In an exemplary embodiment, determining the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage mode includes: determining the storage order of the safety standby control unit and the main electronic control unit when the target storage mode is a single storage mode; determining the first electronic control unit currently used to store data based on the storage order, wherein the first electronic control unit is any one of the control units included in the safety standby control unit and the main electronic control unit; determining the first capacity of the remaining storage control of the safety storage area of the first electronic control unit; determining the data capacity of the target data; determining the first electronic control unit as the target electronic control unit when the data capacity is less than or equal to the first capacity; determining the second electronic control unit that is located after the first electronic control unit in the storage order and adjacent to the first electronic control unit when the data capacity is greater than the first capacity; determining the second electronic control unit as the target electronic control unit when the data capacity is less than or equal to the second capacity of the remaining storage space of the safety storage area of the second electronic control unit. In this embodiment, in a single storage mode, the storage order of the safety standby control unit and the main electronic control unit can be determined in advance. For example, the main electronic control unit can be used as the first storage device, and the safety standby control units can be sorted according to the number. For example, the safety standby control unit includes ECU1 (client), CECU3 (client), ECU4 (client), and ECU5 (client), and the main electronic control unit is identified as ECU1 (server), then the storage order is ECU1 (server), ECU1 (client), CECU3 (client), ECU4 (client), and ECU5 (client). The first electronic control unit that is currently storing data, such as ECU1 (client), can be determined. If the first capacity of ECU1 (client) is greater than or equal to the data capacity, CECU1 (client) is determined as the target electronic control unit. If the first capacity of ECU1 (client) is less than the data capacity, it means that ECU1 (client) cannot store the target data, then CECU3 (client) is determined to be the second electronic control unit. When the second capacity of CECU3 (client) is greater than or equal to the data capacity, the second electronic control unit is determined to be the target electronic control unit. If the second capacity of CECU3 (client) is less than the data capacity, then continue to determine whether the next electronic control unit of the second electronic control unit in the storage order can be used as the target electronic control unit until the target electronic control unit is determined.
[0046] In the above embodiment, the schematic diagram of the single storage mode can be found in the attached Figure 6 ,like Figure 6 As shown, when the main electronic control unit receives data to be stored and needs to be securely stored, if the remaining storage space of the main electronic control unit is sufficient, the data is saved in the secure storage area of the main electronic control unit. When the storage space of the main electronic control unit is insufficient, the target data is selected to be stored in the next secure control unit.
[0047] In an exemplary embodiment, determining the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method includes: when the target storage method is a patrol storage method, determining the patrol order of the safety standby control unit and the main electronic control unit; and determining the target electronic control unit according to the patrol order. In this embodiment, when the target storage method is a patrol storage method, the patrol order may be to store data in the safety standby control unit and the main electronic control unit in sequence. For example, when the safety standby control unit includes ECU1 (client), CECU3 (client), ECU4 (client), and ECU5 (client), and the main electronic control unit is identified as ECU1 (server), the patrol order may be ECU1 (server), ECU1 (client), CECU3 (client), ECU4 (client), and ECU5 (client) to store data in turn. When CECU3 (client) stored data last time, ECU4 (client) stores data this time. A schematic diagram of the patrol storage method can be found in the attached figure. Figure 7 ,like Figure 7 As shown, the patrol storage method will not be saved continuously to the same ECU.
[0048] In an exemplary embodiment, determining the target electronic control unit according to the patrol sequence includes: determining the third electronic control unit currently used to store data based on the patrol sequence, wherein the third electronic control unit is any one of the safety standby control unit and the main electronic control unit; and determining the third electronic control unit as the target electronic control unit when the third capacity of the remaining storage space in the safety storage area of the third electronic control unit is greater than or equal to the data capacity of the target data. In this embodiment, the third electronic control unit can be determined according to the patrol sequence, and if the third electronic control unit has sufficient capacity to store the target data, the third electronic control unit is determined as the target electronic control unit. If the third electronic control unit does not have sufficient capacity to store the target data, the next electronic control unit in the patrol sequence of the third electronic control unit is determined as the current electronic control unit, and it is determined whether the current electronic control unit has sufficient capacity to store the target data. If so, the current electronic control unit is determined as the target electronic control unit, and if not, the next electronic control unit is continued to be updated as the current electronic control unit.
[0049] In an exemplary embodiment, determining the secure standby control unit that supports secure storage in the standby electronic control unit includes: sending a query instruction to the standby electronic control unit, wherein the query instruction is used to query whether the standby electronic control unit supports secure storage; receiving a response message sent by the standby electronic control unit; and determining the control unit that indicates support for secure storage in the response message as the secure standby control unit. In this embodiment, the main electronic control unit can communicate with the client during initialization, inquire whether the client component supports secure storage, and the size of the remaining space for secure storage, and record it. This data will be updated in real time after each startup, so that the main electronic control unit can better coordinate with the client for secure storage.
[0050] In an exemplary embodiment, determining the storage mode of the target data to be stored includes: determining that the storage model of the target data is the secure storage mode when the target data is data received by the main electronic control unit and the data attribute of the target data is sensitive data; determining that the storage model of the target data is the secure storage mode when a scheduling request is received from a non-secure standby electronic control unit that does not support secure storage and is included in the standby electronic control unit, wherein the scheduling request is a request for requesting the main electronic control unit to determine a control unit for storing the target data when the non-secure standby electronic control unit determines that the storage mode of the target data is the secure storage mode. In this embodiment, the target data may be data received by the server or data received by the client. When the target data is data received by the server, the server may determine whether the storage mode of the target data is the secure storage mode. When the target data is data received by the client, the client may determine whether the storage mode of the target data is the secure storage mode. If it is the secure storage mode and the client does not support secure storage, the client sends a request to the server, requesting the server to schedule a target electronic control unit with secure storage space for the target data.
[0051] In the above embodiment, whether the storage mode of the target data is a secure storage mode can be determined according to the data type of the target data. When the data type is a sensitive data type, the storage mode of the target data can be determined to be a secure storage mode. Sensitive data may include user privacy data, vehicle privacy data, etc. For example, the terminal identifier of the terminal connected to the target vehicle, multimedia files in the terminal, address book, etc. User setting data of the target vehicle, etc.
[0052] The data storage method is described below in conjunction with a specific implementation method:
[0053] Figure 8 is a flow chart of a method for storing data according to a specific embodiment of the present invention. Figure 8 As shown, the process includes:
[0054] Step S802, the client and the server are initialized, and the client and the server are connected, that is, the main electronic control unit and the standby electronic control unit are connected.
[0055] Step S804: The server asks the client whether it supports secure storage and the size of the secure storage space, and saves it locally.
[0056] Step S806: If the client itself has a secure storage module, it may use its own module first.
[0057] Step S808: If the client does not have a secure storage module, it requests storage space from the server and authenticates the server's identity.
[0058] Step S810, after the server authenticates the client's identity, the server schedules the storage space, sends the data to the corresponding ECU, and records the storage location and other information of the data.
[0059] In the above embodiment, data without a secure storage module is saved in the hardware security module of other ECUs through network application, thereby improving the security of sensitive data. That is, the module-related functions of the ECU that has installed hardware security can be shared with other ECUs in the car through the in-vehicle network. This allows other ECUs in the car to remotely call the functions of the hardware security module through the network. Ultimately, the purpose of reducing automobile hardware costs and reducing repeated software adaptation is achieved.
[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0061] In this embodiment, a data storage device is also provided, which is applied to a target vehicle, wherein the target vehicle includes N electronic control units, wherein the N electronic control units include a main electronic control unit and N-1 spare electronic control units, wherein the N-1 spare electronic control units include M safety spare control units that support secure storage, wherein the safety spare control unit includes a secure storage area, wherein N and M are integers, wherein M is less than N-1, and wherein the main electronic control unit is connected to the spare electronic control unit, and wherein the device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated here. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0062] Fig. 9 is a structural block diagram of a data storage device according to an embodiment of the present invention. Fig. 9 As shown, the device comprises:
[0063] A first determining module 92, used to determine a storage mode of target data to be stored;
[0064] A second determination module 94 is used to determine the safe standby control unit that supports safe storage in the standby electronic control unit when the storage mode is a safe storage model;
[0065] A third determination module 96, configured to determine a target electronic control unit in the safety standby control unit and the main electronic control unit;
[0066] The storage module 98 is used to store the target data into the secure storage area included in the target electronic control unit.
[0067] In an exemplary embodiment, the third determination module 96 can determine the target electronic control unit in the safety standby control unit and the main electronic control unit in the following manner: determine the target storage method for storing the target data; and determine the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method.
[0068] In an exemplary embodiment, the third determination module 96 can determine the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method in the following manner: when the target storage method is a single storage method, determine the storage order of the safety standby control unit and the main electronic control unit; determine the first electronic control unit currently used to store data based on the storage order, wherein the first electronic control unit is any one of the control units included in the safety standby control unit and the main electronic control unit; determine the first capacity of the remaining storage control of the safety storage area of the first electronic control unit; determine the data capacity of the target data; when the data capacity is less than or equal to the first capacity, determine the first electronic control unit as the target electronic control unit; when the data capacity is greater than the first capacity, determine the second electronic control unit that is located after the first electronic control unit in the storage order and is adjacent to the first electronic control unit; when the data capacity is less than or equal to the second capacity of the remaining storage space in the safety storage area of the second electronic control unit, determine the second electronic control unit as the target electronic control unit.
[0069] In an exemplary embodiment, the third determination module 96 can determine the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method in the following manner: when the target storage method is a patrol storage method, determine the patrol order of the safety standby control unit and the main electronic control unit; determine the target electronic control unit according to the patrol order.
[0070] In an exemplary embodiment, the third determination module 96 can determine the target electronic control unit according to the patrol order in the following manner: determine the third electronic control unit currently used to store data based on the patrol order, wherein the third electronic control unit is the safety standby control unit and any one of the control units included in the main electronic control unit; when the third capacity of the remaining storage space of the safety storage area of the third electronic control unit is greater than or equal to the data capacity of the target data, determine the third electronic control unit as the target electronic control unit.
[0071] In an exemplary embodiment, the second determination module 94 can determine the safe standby control unit that supports safe storage in the standby electronic control unit in the following manner: send a query instruction to the standby electronic control unit, wherein the query instruction is used to query whether the standby electronic control unit supports safe storage; receive response information sent by the standby electronic control unit; and determine the control unit that indicates support for safe storage in the response information as the safe standby control unit.
[0072] In an exemplary embodiment, the first determination module 92 can determine the storage mode of the target data to be stored in the following manner: when the target data is data received by the main electronic control unit and the data attribute of the target data is sensitive data, determine that the storage model of the target data is the secure storage mode; when receiving a scheduling request sent by a non-secure standby electronic control unit that does not support secure storage and is included in the standby electronic control unit, determine that the storage model of the target data is the secure storage mode, wherein the scheduling request is a request sent by the non-secure standby electronic control unit to request the main electronic control unit to determine a control unit for storing the target data when the non-secure standby electronic control unit determines that the storage mode of the target data is the secure storage mode.
[0073] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0074] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0075] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0076] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0077] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0078] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.
[0079] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0080] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0081] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data storage method, characterized in that: Applied to a target vehicle, the target vehicle includes N electronic control units, the N electronic control units include a main electronic control unit and N-1 standby electronic control units, the N-1 standby electronic control units include M safety standby control units supporting safety storage, the safety standby control unit includes a safety storage area, N and M are integers, M is less than N-1, the main electronic control unit is connected to the standby electronic control unit, including: Determine a storage mode of target data to be stored; In the case where the storage mode is a secure storage model, determining the secure standby control unit supporting secure storage in the standby electronic control unit; Determining a target electronic control unit in the safety standby control unit and the main electronic control unit; The target data is stored in the secure storage area included in the target electronic control unit.
2. The method according to claim 1, characterized in that Determining a target electronic control unit in the safety standby control unit and the main electronic control unit includes: Determining a target storage mode for storing the target data; The target electronic control unit is determined in the safety standby control unit and the main electronic control unit based on the target storage mode.
3. The method according to claim 2, characterized in that Determining the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method includes: When the target storage mode is a single storage mode, determining a storage order of the safety standby control unit and the main electronic control unit; Determine a first electronic control unit currently used to store data based on the storage order, wherein the first electronic control unit is any one of the safety standby control unit and the main electronic control unit; determining a first capacity of a remaining storage control of a secure storage area of the first electronic control unit; determining the data capacity of the target data; In a case where the data capacity is less than or equal to the first capacity, determining the first electronic control unit as the target electronic control unit; In a case where the data capacity is greater than the first capacity, determining a second electronic control unit that is located after the first electronic control unit in the storage order and is adjacent to the first electronic control unit; In a case where the data capacity is less than or equal to a second capacity of the remaining storage space of the secure storage area of the second electronic control unit, the second electronic control unit is determined as the target electronic control unit.
4. The method according to claim 2, characterized in that: Determining the target electronic control unit in the safety standby control unit and the main electronic control unit based on the target storage method includes: When the target storage mode is a patrol storage mode, determining the patrol order of the safety standby control unit and the main electronic control unit; The target electronic control unit is determined according to the patrol order.
5. The method according to claim 4, characterized in that Determining the target electronic control unit according to the patrol order includes: Determine a third electronic control unit currently used to store data based on the patrol sequence, wherein the third electronic control unit is any one of the safety standby control unit and the main electronic control unit; In a case where a third capacity of the remaining storage space of the secure storage area of the third electronic control unit is greater than or equal to the data capacity of the target data, the third electronic control unit is determined as the target electronic control unit.
6. The method according to claim 1, characterized in that Determining in the standby electronic control unit that the secure standby control unit supports secure storage includes: Sending a query instruction to the standby electronic control unit, wherein the query instruction is used to query whether the standby electronic control unit supports secure storage; Receiving a response message sent by the standby electronic control unit; The control unit indicated in the response information as supporting secure storage is determined as the secure standby control unit.
7. The method according to claim 1, characterized in that Determining the storage mode of the target data to be stored includes: In a case where the target data is data received by the main electronic control unit and the data attribute of the target data is sensitive data, determining that the storage model of the target data is the secure storage mode; In case of receiving a scheduling request sent by a non-safe standby electronic control unit that does not support secure storage and is included in the standby electronic control unit, determining that the storage model of the target data is the secure storage mode, wherein the scheduling request is a request sent by the non-safe standby electronic control unit to request the main electronic control unit to determine a control unit for storing the target data when the non-safe standby electronic control unit determines that the storage mode of the target data is the secure storage mode.
8. A data storage device, characterized in that: Applied to a target vehicle, the target vehicle includes N electronic control units, the N electronic control units include a main electronic control unit and N-1 standby electronic control units, the N-1 standby electronic control units include M safety standby control units supporting safety storage, the safety standby control unit includes a safety storage area, N and M are integers, M is less than N-1, the main electronic control unit is connected to the standby electronic control unit, including: A first determining module, used to determine a storage mode of target data to be stored; A second determination module is used to determine the safe standby control unit supporting safe storage in the standby electronic control unit when the storage mode is a safe storage model; A third determination module, used to determine a target electronic control unit in the safety standby control unit and the main electronic control unit; A storage module is used to store the target data in the secure storage area included in the target electronic control unit.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
