Program control method and device for vehicle, vehicle and storage medium

文档序号:1428890 发布日期:2020-03-17 浏览:29次 中文

阅读说明:本技术 车辆的程序控制方法、装置、车辆及存储介质 (Program control method and device for vehicle, vehicle and storage medium ) 是由 王克坚 尚鑫 于 2019-11-11 设计创作,主要内容包括:本申请提出了车辆的程序控制方法、装置、车辆及存储介质。其中,一种车辆的程序控制方法,包括:响应于程序操作请求,确定所述程序操作请求是否为目标操作请求;在确定所述程序操作请求为所述目标操作请求时,确定所述目标操作请求对应的处于锁定状态的目标代码;对所述处于锁定状态的目标代码进行解锁操作,得到解锁状态的目标代码,其中,所述锁定状态表示所述目标代码不可执行,所述解锁状态表示所述目标代码可执行;通过所述解锁状态的目标代码执行相应的目标操作;在完成所述目标操作后,对所述处于解锁状态的目标代码进行锁定操作,得到锁定状态的目标代码。(The application provides a program control method and device for a vehicle, the vehicle and a storage medium. The program control method of the vehicle comprises the following steps: in response to a program operation request, determining whether the program operation request is a target operation request; when the program operation request is determined to be the target operation request, determining a target code in a locked state corresponding to the target operation request; unlocking the target code in the locked state to obtain the target code in the unlocked state, wherein the locked state represents that the target code is not executable, and the unlocked state represents that the target code is executable; executing corresponding target operation through the target code in the unlocking state; and after the target operation is finished, locking the target code in the unlocked state to obtain the target code in the locked state.)

1. A program control method of a vehicle, characterized by comprising:

in response to a program operation request, determining whether the program operation request is a target operation request;

when the program operation request is determined to be the target operation request, determining a target code in a locked state corresponding to the target operation request, wherein the locked state represents that the target code is not executable;

unlocking the target code in the locked state to obtain the target code in the unlocked state, wherein the unlocked state represents that the target code is executable;

executing corresponding target operation through the target code in the unlocking state;

and after the target operation is finished, locking the target code in the unlocked state to obtain the target code in the locked state.

2. The program control method according to claim 1, wherein the target operation request is any one of: an erase operation request to the memory or a write operation request to the memory.

3. The program control method according to claim 1, wherein the object code in the locked state is a result of exclusive or operation on binary data of an original object code;

the unlocking operation of the target code in the locked state comprises the following steps:

and carrying out exclusive OR operation on the binary data of the target code in the locking state.

4. The program control method according to claim 1, wherein the object code in the locked state is a result of an encryption operation performed on binary data of an original object code;

the unlocking operation of the target code in the locked state comprises the following steps:

and carrying out decryption operation on the binary data of the target code in the locked state.

5. The program control method according to claim 1, wherein the object code in the locked state is a result of an inversion operation on binary data of an original object code;

the unlocking operation of the target code in the locked state comprises the following steps:

and performing negation operation on the binary data of the target code in the locked state.

6. The program control method according to claim 1, wherein a center control system of the vehicle is loaded with a binary file regarding the object code, the binary file including: the file system comprises a file header, initialization code and the target code, wherein the file header comprises a starting address of the target code, and the initialization code is used for executing initialization operation related to the target code;

the determining the target code in the locked state corresponding to the target operation request includes:

and determining the target code in a locked state by accessing the file header of the binary file.

7. The program control method of claim 6, wherein said performing a corresponding target operation with said unlocked state of the target code comprises:

executing the initialization code;

and calling the target code in the unlocked state to execute the target operation.

8. A program control device of a vehicle, characterized by comprising:

the judging unit is used for responding to a program operation request and determining whether the program operation request is a target operation request;

the query unit is used for determining a target code in a locked state corresponding to the target operation request when the judging unit determines that the program operation request is the target operation request, wherein the locked state represents that the target code cannot be executed;

the code processing unit is used for unlocking the target code in the locked state to obtain the target code in the unlocked state, wherein the unlocked state represents that the target code is executable;

the execution unit executes corresponding target operation through the target code in the unlocking state;

after the execution unit completes the target operation, the code processing unit is further configured to perform a locking operation on the target code in the unlocked state to obtain the target code in the locked state.

9. A vehicle, characterized by comprising:

a processor;

a memory storing a program for execution by the processor, the program comprising instructions for performing the method of any of claims 1-7.

10. A storage medium storing a program comprising instructions that, when executed by a central control apparatus, cause the central control apparatus to perform the method of any one of claims 1-7.

Technical Field

The present application relates to the field of vehicle technologies, and in particular, to a method and an apparatus for controlling a program of a vehicle, and a storage medium.

Background

During operation of a system program (also referred to as a central control system) of a vehicle, there is a risk that a program pointer runs away. In other words, the pointer of the system program may accidentally jump to a piece of code of the system program and execute. Here, the code that is accidentally executed may be, for example, key code such as an erase or write code. Therefore, the current system program has the risk that the key code is executed accidentally, which causes a safety hazard.

Disclosure of Invention

According to an aspect of the present application, there is provided a program control method of a vehicle, including:

in response to a program operation request, determining whether the program operation request is a target operation request;

when the program operation request is determined to be the target operation request, determining a target code in a locked state corresponding to the target operation request;

unlocking the target code in the locked state to obtain the target code in the unlocked state, wherein the locked state represents that the target code is not executable, and the unlocked state represents that the target code is executable;

executing corresponding target operation through the target code in the unlocking state;

and after the target operation is finished, locking the target code in the unlocked state to obtain the target code in the locked state.

In some embodiments, the target operation request is any one of: an erase operation request to the memory or a write operation request to the memory.

In some embodiments, the target code in the locked state is a result of exclusive-or operation on binary data of the original target code; the unlocking operation of the target code in the locked state comprises the following steps: and carrying out exclusive OR operation on the binary data of the target code in the locking state.

In some embodiments, the target code in the locked state is a result of an encryption operation on binary data of the original target code; the unlocking operation of the target code in the locked state comprises the following steps: and carrying out decryption operation on the binary data of the target code in the locked state.

In some embodiments, the target code in the locked state is a result of negating binary data of the original target code; the unlocking operation of the target code in the locked state comprises the following steps: and performing negation operation on the binary data of the target code in the locked state.

In some embodiments, a central control system of the vehicle is loaded with a binary file regarding the object code, the binary file comprising: the file system comprises a file header, initialization code and the target code, wherein the file header comprises a starting address of the target code, and the initialization code is used for executing initialization operation related to the target code; the determining the target code in the locked state corresponding to the target operation request includes: and determining the target code in a locked state by accessing the file header of the binary file.

In some embodiments, said executing the corresponding target operation by the target code in the unlocked state comprises: executing the initialization code; and calling the target code in the unlocked state to execute the target operation.

According to an aspect of the present application, there is provided a program control device of a vehicle, including:

a judging unit that determines whether or not a program operation is a target operation request in response to the program operation request;

the query unit is used for determining a target code in a locked state corresponding to the target operation request when the judgment unit determines that the program operation request is the target operation request;

the code processing unit is used for unlocking the target code in the locked state to obtain the target code in the unlocked state, wherein the locked state represents that the target code is not executable, and the unlocked state represents that the target code is executable;

the execution unit executes corresponding target operation through the target code in the unlocking state;

after the execution unit completes the target operation, the code processing unit is further configured to perform a locking operation on the target code in the unlocked state to obtain the target code in the locked state.

According to one aspect of the present application, there is provided a vehicle including: a processor; a memory storing a program executed by the processor, the program including instructions for executing the program control method of the vehicle according to the present application.

According to an aspect of the present application, there is provided a storage medium storing a program including instructions that, when executed by a center control apparatus, cause the center control apparatus to execute instructions of a program control method of a vehicle.

In summary, the program control scheme of the present application can prevent the target code from being accidentally executed by unlocking the target code before a normal code call (non-accidental code execution) and re-locking the target code after the code call, thereby improving the safety of code execution and greatly improving the safety of vehicle operation.

Drawings

FIG. 1 illustrates a flow chart of a method 100 of program control of a vehicle according to some embodiments of the present application;

FIG. 2 illustrates a structural schematic of a binary file according to some embodiments of the present application;

FIG. 3 illustrates a flow of execution of step S104 according to some embodiments of the present application;

FIG. 4 illustrates a schematic diagram of a program control device of a vehicle according to some embodiments of the present application;

FIG. 5 illustrates a block diagram of the components of a central control device of a vehicle according to some embodiments of the present application.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below by referring to the accompanying drawings and examples.

In some application scenarios, the central control system of the vehicle runs away from the program, and there is a risk that the key code is executed accidentally. Therefore, the application provides a program control scheme which can improve the safety of program execution in the vehicle.

FIG. 1 illustrates a flow chart of a method 100 of program control of a vehicle according to some embodiments of the present application. The method 100 may be performed, for example, in a central control system of a vehicle, but is not limited thereto. Here, the center control system refers to a software system of a vehicle center control device (for example, an operating system of the center control device).

In step S101, in response to the program operation request, it is determined whether the program operation request is a target operation request. The target operation request refers to an operation on a key code in the vehicle. The program operation request is, for example, a system call of the operating system. The critical code is, for example, a code for performing an erase operation on the nonvolatile memory, a code for performing a write operation on the memory, or the like. The target operation request is, for example, an erase operation request or a write operation request to the memory, but is not limited thereto. Here, the method 100 may perform a type determination on the program operation request to be executed through step S101, thereby determining whether the program operation request to be executed is a predetermined target operation request.

When it is determined in step S101 that the program operation request is the target operation request, the method 100 may execute step S102 to determine a target code in a locked state corresponding to the target operation request. Wherein the locked state indicates that the target code is not executable. Here, the locking operation on the object code may be, for example, a result of performing an inversion operation or an exclusive or operation on binary data of the original object code. For another example, the object code of the lock state is a result of performing an encryption operation on binary data of the original object code. In summary, the target code in the locked state refers to the original target code modified by a predetermined data modification manner (i.e. encryption, exclusive-or, negation, etc.). When a program runs off in a central control system of a vehicle, the embodiment of the application can prevent a key code (namely the target code) from being executed accidentally by locking the target code, so that the safety of code execution is improved.

In step S103, an unlocking operation is performed on the target code in the locked state, and the target code in the unlocked state is obtained. The unlocked state indicates that the object code is executable. In other words, the target code in the unlocked state is the unlocked target code and is the original code that can be executed.

For example, when the target code in the locked state is a result of performing an exclusive or operation on binary data of the original target code, step S103 may perform an exclusive or operation on the binary data of the target code in the locked state, thereby obtaining the target code in the unlocked state.

For another example, when the target code in the locked state is a result of performing an encryption operation on binary data of the original target code, step S103 may perform a decryption operation on the binary data of the target code in the locked state. Here, the encryption operation may be various algorithms for encrypting data, and the present application is not limited thereto. The decryption operation corresponds to the manner of the encryption operation.

For another example, when the target code in the locked state is a result of performing an inversion operation on binary data of the original target code, step S103 may perform an inversion operation on the binary data of the target code in the locked state to obtain the target code in the unlocked state.

After acquiring the target code in the unlocked state in step S103, the method 100 may execute step S104, and execute a corresponding target operation through the target code in the unlocked state.

After the target operation is completed in step S104, the method 100 may execute step S105 to perform a locking operation on the target code in the unlocked state, so as to obtain the target code in the locked state. Here, the lock operation is an operation of modifying executable object code by encryption, exclusive or, negation, or the like.

In summary, the program control scheme of the present application can prevent the target code from being accidentally executed by unlocking the target code before a normal code call (non-accidental code execution) and re-locking the target code after the code call, thereby improving the safety of code execution and greatly improving the safety of vehicle operation.

In some embodiments, a central control system of a vehicle is loaded with a binary file regarding object code. Here, the binary file includes a header, an initialization code, and an object code. Wherein the header includes a start address of the object code. The initialization code is used to perform initialization operations with respect to the object code. For example, FIG. 2 illustrates a structural schematic of a binary file according to some embodiments of the present application.

As shown in fig. 2, binary file 200 includes a header 201, initialization code 202, an erase function 203, and a write function 204. Wherein the erasure function 203 is a piece of object code. Write function 204 is also a piece of object code. Header 201 includes the starting address of erase function 203 and the starting address of write function 204. The start address refers to the start address of the target code in memory.

Taking the memory driver as an example, the object code includes an erase function 203 to the memory and a write function 204 to the memory. Step S104 may include two steps S1041 and S1042. In step S1041, an initialization code is executed. Here, the operation corresponding to the initialization code is an initialization operation of the memory drive related register and related parameters. In step S1042, the target code in the unlocked state is called, and the target operation is executed.

Here, the binary file 200 is an executable file compiled with respect to a source program of an object code, and is in a system program. Step S102 may determine the target code in the locked state by accessing the file header of the binary file. Although binary file 200 in fig. 2 shows only two object codes, the number of object codes may be less than or more than two, which is not limited in this application.

It is further emphasized that embodiments of the present application enable locking and unlocking operations on object code by separately generating a binary file for the object code such that a system program can find a start address of the object code through the binary file.

FIG. 4 shows a schematic diagram of a program control device of a vehicle according to some embodiments of the present application. As shown in fig. 4, the program control device 400 includes: a judging unit 401, an inquiring unit 402, a code processing unit 403, and an executing unit 404.

The determination unit 401 may determine whether the program operation request is a target operation request in response to the program operation request.

When the determining unit 401 determines that the program operation request is the target operation request, the querying unit 402 may determine the target code in the locked state corresponding to the target operation request. The locked state indicates that the target code is not executable.

The code processing unit 403 may perform an unlocking operation on the target code in the locked state, and obtain the target code in the unlocked state. The unlocked state indicates that the object code is executable.

The execution unit 404 may perform a corresponding target operation through the target code in the unlocked state.

After the execution unit 404 completes the target operation, the code processing unit 403 is further configured to perform a locking operation on the target code in the unlocked state, so as to obtain the target code in the locked state.

In summary, the program control device 400 of the present application can prevent the target code from being accidentally executed by unlocking the target code before a normal code call (non-accidental code execution) and re-locking the target code after the code call, thereby improving the safety of code execution and greatly improving the safety of vehicle operation. In addition, more specific embodiments of the apparatus 400 are similar to the method 100 and will not be described herein.

Fig. 5 is a block diagram showing the components of a center control apparatus of a vehicle. As shown in fig. 5, the computing device includes one or more processors (CPUs) 502, a communication module 504, a memory 506, a user interface 510, and a communication bus 508 for interconnecting these components.

The processor 502 may receive and transmit data via the communication module 504 to enable network communications and/or local communications.

The user interface 510 includes one or more output devices 512 including one or more speakers and/or one or more displays on the vehicle dashboard. The user interface 510 also includes one or more input devices 514. The input device 514 is, for example, a touch panel of a vehicle instrument desk, an operation button of a steering wheel, but is not limited thereto.

The memory 506 may be a high-speed random access memory such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.

The memory 506 stores a set of instructions executable by the processor 502, including:

central control system 516 includes programs for handling various basic system services and for performing hardware related tasks. Central control system 516 may store, for example, binary file 200 shown in FIG. 4. Various programs that implement the program control method 100 described above and that can implement the process flows in the examples described above may also be included, such as the program control device 400 of fig. 4.

In addition, each of the examples of the present application may be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like.

The present application thus also discloses a non-volatile storage medium having stored therein a data processing program for executing any one of the examples of the program control method described above in the present application.

In addition, the method steps described in this application may be implemented by hardware, for example, logic gates, switches, Application Specific Integrated Circuits (ASICs), programmable logic controllers, embedded microcontrollers, and the like, in addition to data processing programs. Such hardware capable of implementing the methods described herein may also constitute the present application.

The above description is only a preferred example of the present application and should not be taken as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the scope of the present application.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于深度置信网络的电网虚拟数据注入攻击的检测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类