Method, device and equipment for preventing signal from being tampered, and storage medium
By obtaining the signal complement value of the previous cycle when a signal to be verified is received, the problem of loss of control caused by vehicle signal tampering is solved, ensuring the accuracy of program operation and driving safety.
Patent Information
- Application Number
- CN202210733671.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-06-24
AI Technical Summary
In the existing technology, there are frequent occurrences of vehicle signals being tampered with, leading to loss of vehicle control and personal injury. How to ensure the accuracy of the signals of the target program running in each module of the vehicle has become an urgent problem to be solved.
When a signal to be verified is received, the signal complement value of the previous running cycle is obtained, and the signal is verified. The target program is only run after the verification is passed. This includes obtaining the signal complement value, the verification result, and the use of the verification module.
By verifying whether signals have been tampered with before the program runs, the accuracy of the program operation is ensured, thereby guaranteeing driving safety and preventing safety accidents caused by signal tampering.
Smart Images

Figure CN115098891B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobiles, and in particular to a program running method and device for preventing signal tampering, equipment and a storage medium. BACKGROUND
[0002] With the increasing trend of automobile electrification and intelligentization, signal interaction and software logic are becoming more and more complex, which inevitably leads to the rewriting of part of the signals and logic during operation, causing varying degrees of personal injury. The functional safety design in the prior art is also superficial, and accidents caused by signal tampering leading to vehicle loss of control and personal injury occur from time to time. Therefore, how to ensure the accuracy of the signals of the target program running of each module of the vehicle has become a problem to be solved.
[0003] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0004] The main purpose of the present application is to provide a program running method and device for preventing signal tampering, equipment and a storage medium, which aims to solve the technical problem that the use of tampered signals during program running in the prior art can lead to vehicle loss of control.
[0005] To achieve the above-mentioned purpose, the present application provides a program running method for preventing signal tampering, which comprises the following steps:
[0006] Upon receiving the to-be-verified signal sent by the target function module, the signal complement value corresponding to the to-be-verified signal in the last running cycle is obtained;
[0007] The to-be-verified signal is subjected to signal verification according to the signal complement value, and a verification result is obtained;
[0008] When the verification result is a verification pass, the to-be-verified signal is used to run the target program.
[0009] Optionally, the step of verifying the to-be-verified signal according to the signal complement value to obtain a verification result comprises:
[0010] determining the to-be-verified signal value corresponding to the to-be-verified signal;
[0011] determining a signal verification value according to the to-be-verified signal value and the signal complement value;
[0012] determining a verification result according to the signal verification value.
[0013] Optionally, the step of determining a verification result according to the signal verification value comprises:
[0014] determining a target check bit according to the signal check value;
[0015] determining whether the target check bit meets a preset signal check condition;
[0016] if the target check bit meets the preset signal check condition, determining that the check result is a check pass.
[0017] Optionally, before the step of obtaining the signal complement value corresponding to the to-be-checked signal in the last running period when the to-be-checked signal sent by the target function module is received, the method further comprises:
[0018] obtaining a to-be-output signal;
[0019] determining a signal complement value corresponding to the to-be-output signal.
[0020] Optionally, the step of determining the signal complement value corresponding to the to-be-output signal comprises:
[0021] determining a signal numerical type corresponding to the to-be-output signal;
[0022] when the signal numerical type is a Boolean type, performing numerical conversion on the to-be-output signal to obtain a converted signal;
[0023] performing complement operation on the converted signal to obtain a signal complement value.
[0024] Optionally, the step of determining the signal complement value corresponding to the to-be-output signal comprises:
[0025] when the number of bits of the to-be-output signal is greater than a preset number of bits, performing bit extraction processing on the to-be-output signal to obtain a to-be-processed signal;
[0026] performing complement calculation on the to-be-processed signal to obtain a complement value of the to-be-processed signal;
[0027] determining a signal complement value according to the complement value of the to-be-processed signal.
[0028] Optionally, after the step of performing signal check on the to-be-checked signal according to the signal complement value to obtain a check result, the method further comprises:
[0029] when the check result is a check fail, issuing a preset instruction to make the vehicle enter a safe state.
[0030] In addition, to achieve the above object, the application further provides a program running device for preventing signal tampering, which comprises:
[0031] The acquisition module is configured to acquire a signal complement value corresponding to the to-be-verified signal in a previous running period when receiving the to-be-verified signal sent by the target function module.
[0032] The verification module is configured to perform signal verification on the to-be-verified signal according to the signal complement value, and obtain a verification result.
[0033] The program running module is configured to run a target program by using the to-be-verified signal when the verification result is a verification pass.
[0034] In addition, to achieve the above object, the present application further provides a program running device for preventing signal tampering, which comprises a memory, a processor, and a program running program for preventing signal tampering stored in the memory and capable of running on the processor, wherein the program running program for preventing signal tampering is configured to implement the steps of the program running method for preventing signal tampering as described above.
[0035] In addition, to achieve the above object, the present application further provides a storage medium having a program running program for preventing signal tampering stored thereon, wherein the program running program for preventing signal tampering, when executed by a processor, implements the steps of the program running method for preventing signal tampering as described above.
[0036] The present application acquires a signal complement value corresponding to the to-be-verified signal in a previous running period when receiving the to-be-verified signal sent by the target function module, performs signal verification on the to-be-verified signal according to the signal complement value, and runs a target program by using the to-be-verified signal when the verification result is a verification pass. Compared with the existing method of directly running a program by using a received signal, the above method of the present application can verify whether the received signal is tampered with before running the program, thereby ensuring the accuracy of program running and further ensuring driving safety. BRIEF DESCRIPTION OF DRAWINGS
[0037] Figure 1 FIG. 1 is a structural schematic diagram of a program running device for preventing signal tampering in a hardware running environment according to an embodiment of the present application;
[0038] Figure 2 FIG. 2 is a flowchart of a program running method for preventing signal tampering according to a first embodiment of the present application;
[0039] Figure 3 FIG. 3 is a functional implementation schematic diagram of a program running method for preventing signal tampering according to an embodiment of the present application;
[0040] Figure 4 Flowchart of a second embodiment of a program running method for preventing signal tampering of the present application;
[0041] Figure 5 Flowchart of a third embodiment of a program running method for preventing signal tampering of the present application;
[0042] Figure 6 Structural block diagram of a first embodiment of a program running device for preventing signal tampering of the present application.
[0043] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are merely illustrative of the present application and do not limit the present application.
[0045] Reference Figure 1 , Figure 1 Structural diagram of a program running device for preventing signal tampering of the present application.
[0046] As shown in Figure 1 , the program running device for preventing signal tampering can include a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 can include a display, an input unit such as a keyboard, and can also include a standard wired interface, a wireless interface. The network interface 1004 can optionally include a standard wired interface, a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 can be a high-speed random access memory (RAM), and can also be a stable non-volatile memory (NVM), such as a disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0047] Those skilled in the art can understand that Figure 1 the structure shown in the foregoing embodiments does not constitute a limitation on the program running device for preventing signal tampering, and can include more or fewer components than those shown, or combine certain components, or different component arrangements.
[0048] As Figure 1 shown, the memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and a signal tamper-proof program running program.
[0049] In Figure 1 the signal tamper-proof program running device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the signal tamper-proof program running device of the application can be arranged in the signal tamper-proof program running device, and the signal tamper-proof program running device calls the signal tamper-proof program running program stored in the memory 1005 through the processor 1001, and executes the signal tamper-proof program running method provided in the embodiments of the application.
[0050] Based on the above signal tamper-proof program running device, the embodiments of the application provide a signal tamper-proof program running method, which refers to Figure 2 , Figure 2 the flowchart of the first embodiment of the signal tamper-proof program running method of the application.
[0051] In this embodiment, the signal tamper-proof program running method includes the following steps:
[0052] Step S10: When receiving the to-be-verified signal sent by the target function module, the signal complement value corresponding to the last running cycle of the to-be-verified signal is obtained.
[0053] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, a vehicle-mounted computer, etc., or an electronic device or each function module on a vehicle capable of realizing the above functions. The following will take the function module as an example to describe the present embodiment and each of the following embodiments.
[0054] It should be understood that each function module on the subject vehicle of the embodiment can be a function module with a safety level of ASILC or above, for example, a function module with a safety level of ASILC and ASILD. The signal generated by the function module is transmitted to at least one other function module for program running. For example, function module A sends an output signal to module B for program running after the program running is completed. Module B returns the output signal to function module A after the program running is completed. Thus, one running cycle is completed. In the prior art, the signal returned by module B to function module A can be tampered with. At this time, program running errors can occur when function module A uses the received signal for program running in the next running cycle, thereby causing vehicle accidents. Therefore, the embodiment proposes a program running method for preventing signal tampering based on the above problems.
[0055] It should be understood that the embodiment is applied to a vehicle with E-GAS architecture functional safety. The E-GAS architecture is provided with a three-layer architecture, including a Level 1 function layer, a Level 2 function monitoring layer, and a Level 3 chip monitoring layer. The Level 1 function layer includes normal engine control functions, such as engine demand torque coordination, throttle control, fuel injection, ignition control, component diagnosis, input and output signal inspection, and various system responses during faults. The Level 2 function monitoring layer monitors various important software calculations of the Level 1 function layer, such as monitoring engine torque. Once a fault is detected, a fault response is triggered. The Level 3 chip monitoring layer is respectively run on a main chip and a monitoring chip, and is used to perform query and / or response flow check functions.
[0056] It should be noted that the target function module can be a module that sends a signal to the subject function module in a running cycle, such as module B described above. The signal to be verified can be the signal sent by the target function module to the subject function module. When the subject function module sends an output signal to the next module in the running cycle, the signal complement value corresponding to the output signal is calculated. Therefore, the signal complement value corresponding to the signal to be verified in the last running cycle can be the complement value corresponding to the output signal of the subject function module in the last running cycle.
[0057] Step S20: performing signal verification on the signal to be verified according to the signal complement value to obtain a verification result.
[0058] It should be noted that the signal verification of the to-be-verified signal according to the signal complement value can be determining the complement value corresponding to the to-be-verified signal, judging whether the complement value corresponding to the to-be-verified signal is same as the signal complement value, if yes, it is indicated that the output signal of the execution subject function module in the last running period is same as the to-be-verified signal sent by the target function, and then it is indicated that the signal is not tampered, and the verification result is that the verification is passed.
[0059] Step S30: when the verification result is that the verification is passed, running a target program by using the to-be-verified signal.
[0060] It should be noted that the target program can be a program stored on the execution subject function module, which needs to be run by using the to-be-verified signal, and after the running is completed, the signal is sent to the next function module to start the running of the next running period.
[0061] Further, in order to prevent the signal from being tampered, causing the program running error, and further causing the safety accident of the vehicle, after the step S30, the method further comprises: when the verification result is that the verification is not passed, issuing a preset instruction to make the vehicle enter a safety state.
[0062] It should be noted that the preset instruction can be a control instruction sent by the execution subject function module to a Level 3 chip monitoring layer in the E-GAS architecture, so that when the Level 3 chip monitoring layer receives the control instruction, the ECU enters a safety state reset, and the controller no longer works, thereby ensuring that the vehicle no longer outputs torque and current, to ensure personal safety.
[0063] In the specific implementation, the E-GAS architecture can be referred to Figure 3 , Figure 3 is a function implementation schematic diagram of an embodiment of the program running method for preventing signal tampering of the application; refer to Figure 3 It can be known that Figure 3 01 in the E-GAS architecture is used to represent a Level 2 layer, the safety level of the module corresponding to the Level 2 layer is ASILC, and the Level 2 layer includes a function call of a complement check and a complement function call. When the output signal is output to the next function module for program running, the complement function call needs to be called. The complement function call interface can be used to call the complement function in the Level 3 to generate a signal complement value corresponding to the output signal, which is used for signal verification of the received to-be-verified signal. When the to-be-verified signal is received by 01, the complement check interface needs to be used to call the check function in the Level 3 to obtain a verification result. Figure 3The 02 in the figure can be used to represent the Level 1 layer in the E-GAS architecture, the module corresponding to the security level ASILD, and the function can refer to the above-mentioned module 01. Figure 3 The 03 in the figure is used to represent an intermediate module, and the Level 1 layer and the Level 2 layer need to pass through the RTE intermediate module to call the function in the Level 3 layer. The check function and the complement function are stored in the Level 3 layer 04, the complement function is used to generate the complement value of the output signal, and the check function is used for signal verification. The Level 3 layer 04 also includes an ECUReset function for resetting the ECU when receiving the control instruction of each function module.
[0064] The embodiment receives the to-be-verified signal sent by the target function module, obtains the signal complement value corresponding to the last running period of the to-be-verified signal, performs signal verification on the to-be-verified signal according to the signal complement value, obtains a verification result, and runs the target program using the to-be-verified signal when the verification result is verified. Since the embodiment obtains the signal complement value corresponding to the last running period of the to-be-verified signal when receiving the to-be-verified signal, performs signal verification on the to-be-verified signal according to the signal complement value, and runs the target program using the to-be-verified signal when the verification result is verified. Compared with the existing method of directly running the program using the received signal, the above-mentioned method can verify whether the received signal is tampered with before the program is run, ensures the accuracy of the program running, and further ensures the driving safety.
[0065] Reference Figure 4 , Figure 4 The figure is a flowchart of the second embodiment of the program running method for preventing signal tampering.
[0066] Based on the above-mentioned first embodiment, in the embodiment, the step S20 comprises:
[0067] Step S201: Determine the to-be-verified signal value corresponding to the to-be-verified signal.
[0068] It should be noted that the to-be-verified signal can be a Boolean type signal, a Unit8 type signal, a 32-bit or 64-bit type signal, etc. The to-be-verified signal value can be a numerical representation of the signal corresponding to the to-be-verified signal.
[0069] Step S202: Determine the signal verification value according to the to-be-verified signal value and the signal complement value.
[0070] It should be noted that the determination of the signal verification value according to the to-be-verified signal value and the signal complement value can be adding the to-be-verified signal value and the signal complement value, and taking the addition result as the signal verification value.
[0071] Step S203: determining a check result according to the signal check value.
[0072] It should be noted that the determination of the check result according to the signal check value can be a judgment of whether the signal check value is a preset check value. When the signal check value is the preset check value, it is determined that the check result is a check pass. When the signal check value is not the preset check value, it is determined that the check result is a check fail. The preset check value can be a value preset for checking the signal check value.
[0073] Further, in order to prevent the signal from being tampered, the step S203 can include: determining a target check bit according to the signal check value; judging whether the target check bit meets a preset signal check condition; and determining that the check result is a check pass if the target check bit meets the preset signal check condition.
[0074] It should be noted that the target check bit can be the last 8 bits in the signal check value, or can be adaptively adjusted according to the signals of each module. The preset signal check condition can be that all the target check bits are 0. If all the target check bits are 0, it is determined that the check result is a check pass. If one or more of the target check bits are not 0, it is determined that the check result is a check fail.
[0075] The embodiment determines a to-be-checked signal value corresponding to the to-be-checked signal; determines a signal check value according to the to-be-checked signal value and the signal complement value; determines a target check bit according to the signal check value; judges whether the target check bit meets a preset signal check condition; and determines that the check result is a check pass if the target check bit meets the preset signal check condition. The embodiment determines a to-be-checked signal value corresponding to the to-be-checked signal; determines a signal check value according to the to-be-checked signal value and the signal complement value; and determines a check result according to the signal check value. The embodiment can accurately judge whether the signals received by each module are tampered, thereby ensuring the accuracy of program running.
[0076] Reference Figure 5 , Figure 5 The figure is a flowchart of a third embodiment of the program running method for preventing the signal from being tampered.
[0077] Based on the above embodiments, before the step S10, the method further includes:
[0078] Step S001: obtaining a to-be-output signal.
[0079] It should be noted that the signal to be output can be a signal that needs to be input to a next function module for program running when the execution subject function module completes program running.
[0080] Step S002: Determine the signal complement value corresponding to the signal to be output.
[0081] It should be noted that the signal complement value corresponding to the signal to be output can be determined by calling the complement function in Level3.
[0082] Further, the types of output signals corresponding to different function modules can be different. In order to calculate the signal complement values of signals of different types, the step S002 can include: determining the signal numerical value type corresponding to the signal to be output; when the signal numerical value type is a Boolean type, performing numerical value conversion on the signal to be output to obtain a converted signal; and performing complement operation on the converted signal to obtain a signal complement value.
[0083] It should be noted that the numerical value conversion on the signal to be output can be converting the signal to be output into a Unit8 type signal through a Unit8 converter, and then performing complement operation on the converted signal. The complement operation on the converted signal can be calculated through the following formula:
[0084] Xcpl = 255 - X + 1
[0085] Wherein, Xcpl is used to represent the signal complement value, and X is used to represent the signal to be output.
[0086] It should be understood that for the signal numerical value type of Unit8 type signal, the signal complement value corresponding to the signal to be output can be directly calculated through the above formula.
[0087] Further, in order to calculate the signal complement values of different types of signals to be output, the step S002 can include: when the number of bits of the signal to be output is greater than a preset number of bits, performing bit extraction processing on the signal to be output to obtain a signal to be processed; performing complement calculation on the signal to be processed to obtain a complement value of the signal to be processed; and determining the signal complement value according to the complement value of the signal to be processed.
[0088] It should be noted that the preset number of bits can be 8 bits. The bit extraction processing on the signal to be output can be cutting the signal to be output into several Unit8 type signals according to the cutting mode of 8 bits, and then calculating the complement values corresponding to each segmented signal through the above formula, and taking each calculated complement value as the signal complement value corresponding to the signal to be output.
[0089] The embodiment obtains a to-be-output signal, determines a signal numerical type corresponding to the to-be-output signal, performs numerical conversion on the to-be-output signal to obtain a converted signal when the signal numerical type is a Boolean type, and performs a complement operation on the converted signal to obtain a signal complement value. The embodiment obtains a to-be-output signal, determines a signal complement value according to the type of the to-be-output signal, and is used for checking a to-be-verified signal received by each module, thereby avoiding using a tampered signal to run a program and ensuring driving safety.
[0090] Reference Figure 6 , Figure 6 FIG. 1 is a structural block diagram of a program running device for preventing signal tampering according to a first embodiment of the present application.
[0091] As shown in Figure 6 , the program running device for preventing signal tampering according to the embodiment of the present application comprises:
[0092] An obtaining module 10 is configured to obtain a signal complement value corresponding to a to-be-verified signal in a previous running period when the to-be-verified signal is received from a target function module.
[0093] A checking module 20 is configured to perform signal checking on the to-be-verified signal according to the signal complement value to obtain a checking result.
[0094] A program running module 30 is configured to run a target program by using the to-be-verified signal when the checking result is a check pass.
[0095] The embodiment obtains a signal complement value corresponding to a to-be-verified signal in a previous running period when the to-be-verified signal is received from a target function module, performs signal checking on the to-be-verified signal according to the signal complement value to obtain a checking result, and runs a target program by using the to-be-verified signal when the checking result is a check pass. Compared with the prior art of directly running a program by using a received signal, the above-mentioned method of the embodiment can check whether the received signal is tampered with before the program is run, thereby ensuring the accuracy of the program running and further ensuring driving safety.
[0096] It should be noted that the above-described workflow is merely illustrative and does not limit the protection scope of the present application. In actual applications, a person skilled in the art can select some or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
[0097] In addition, technical details not described in detail in the present embodiment can be found in the program running method for preventing signal tampering provided by any embodiment of the present application, which will not be described here.
[0098] Based on the first embodiment of the program running device for preventing signal tampering described above, the second embodiment of the program running device for preventing signal tampering is proposed.
[0099] In the present embodiment, the checking module 20 is further configured to determine a to-be-checked signal value corresponding to the to-be-checked signal; determine a signal check value according to the to-be-checked signal value and the signal complement value; and determine a check result according to the signal check value.
[0100] Further, the checking module 20 is further configured to determine a target check bit according to the signal check value; determine whether the target check bit satisfies a preset signal check condition; and determine that the check result is a check pass if the target check bit satisfies the preset signal check condition.
[0101] Further, the obtaining module 10 is further configured to obtain a to-be-output signal; and determine a signal complement value corresponding to the to-be-output signal.
[0102] Further, the obtaining module 10 is further configured to determine a signal numerical type corresponding to the to-be-output signal; perform numerical conversion on the to-be-output signal to obtain a converted signal when the signal numerical type is a Boolean type; and perform complement operation on the converted signal to obtain a signal complement value.
[0103] Further, the obtaining module 10 is further configured to perform bit extraction processing on the to-be-output signal to obtain a to-be-processed signal when the number of bits of the to-be-output signal is greater than a preset number of bits; perform complement calculation on the to-be-processed signal to obtain a complement value of the to-be-processed signal; and determine a signal complement value according to the complement value of the to-be-processed signal.
[0104] Further, the program running module 30 is further configured to issue a preset instruction to make the vehicle enter a safe state when the check result is a check fail.
[0105] Other embodiments or specific implementation manners of the program running device for preventing signal tampering can refer to the above method embodiments, which will not be described here.
[0106] In addition, the present embodiment further proposes a storage medium, and the storage medium stores a program running program for preventing signal tampering. When the program running program for preventing signal tampering is executed by a processor, the steps of the program running method for preventing signal tampering described above are implemented.
[0107] It should be noted that, in this document, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0108] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0109] From the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be realized by means of software and the necessary general hardware platform, and of course, they can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for making a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present application.
[0110] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent flow transformation made by using the content of the specification and drawings, or directly or indirectly applied to other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A program execution method for preventing tampering of a signal, characterized by, The method for preventing the signal from being tampered comprises the following steps: When receiving the to-be-verified signal sent by the target function module, a signal complement value corresponding to the to-be-verified signal in the last running cycle is obtained, the running cycle comprises that the original function module runs the target program and outputs a signal to the next function module, the next function module runs the program, and then returns the processed signal to the original function module, the to-be-verified signal is the signal sent by the target function module to the execution subject function module, and the signal complement value corresponding to the to-be-verified signal in the last running cycle is the complement value corresponding to the output signal of the execution subject function module in the last running cycle; signal verification is performed on the to-be-verified signal according to the signal complement value, and a verification result is obtained; when the verification result is verified, the target program is run by using the to-be-verified signal; Before the step of obtaining the signal complement value corresponding to the to-be-verified signal in the last running cycle when receiving the to-be-verified signal sent by the target function module, the method further comprises the following steps: a to-be-output signal is obtained, the to-be-output signal is a signal input to the next function module for program running after the target program runs in the last running cycle; a signal complement value calculated by the to-be-output signal is obtained.
2. The program execution method for preventing tampering of a signal according to Claim 1, wherein The step of performing signal verification on the to-be-verified signal according to the signal complement value and obtaining a verification result comprises the following steps: a to-be-verified signal value corresponding to the to-be-verified signal is determined; a signal verification value is determined according to the to-be-verified signal value and the signal complement value; the verification result is determined according to the signal verification value.
3. The method of claim 2, wherein the program is executed by the computer. The step of determining the verification result according to the signal verification value comprises the following steps: a target verification bit is determined according to the signal verification value; whether the target verification bit meets a preset signal verification condition is judged; if the target verification bit meets the preset signal verification condition, it is determined that the verification result is verified.
4. The method of claim 1, wherein the program is executed by a computer. The step of obtaining the signal complement value calculated by the to-be-output signal comprises the following steps: a signal numerical value type corresponding to the to-be-output signal is determined; when the signal numerical value type is a Boolean type, numerical value conversion is performed on the to-be-output signal to obtain a converted signal; complement operation is performed on the converted signal to obtain a signal complement value.
5. The method of claim 1, wherein the program is executed by a computer. The step of obtaining the signal complement value calculated by the to-be-output signal comprises the following steps: when the bit number of the to-be-output signal is greater than a preset bit number, bit extraction processing is performed on the to-be-output signal to obtain a to-be-processed signal; complement calculation is performed on the to-be-processed signal to obtain a complement value of the to-be-processed signal; the signal complement value is determined according to the complement value of the to-be-processed signal.
6. The method of claim 1-5, wherein After the step of performing signal verification on the to-be-verified signal according to the signal complement value and obtaining a verification result, the method further comprises the following steps: when the verification result is not verified, a preset instruction is sent to make the vehicle enter a safe state.
7. A program execution device for preventing signal tampering, characterized in that, The device for preventing the signal from being tampered comprises: The acquisition module is configured to acquire a signal complement value corresponding to a last running period of a to-be-verified signal when receiving the to-be-verified signal sent by a target function module, the running period comprising running a target program by an original function module and outputting a signal to a next function module, returning the processed signal to the original function module after the next function module runs the program, the to-be-verified signal being a signal sent by the target function module to an execution subject function module, and the signal complement value corresponding to the last running period of the to-be-verified signal being a complement value corresponding to an output signal of the execution subject function module in a last running period; The verification module is configured to perform signal verification on the to-be-verified signal according to the signal complement value, and obtain a verification result. The program running module is configured to run the target program by using the to-be-verified signal when the verification result is a verification pass. The acquisition module is further configured to acquire a to-be-output signal, the to-be-output signal being a signal input to a next function module for program running after a last running period of the target program ends, and acquire a signal complement value calculated by using the to-be-output signal.
8. A program execution device for preventing tampering of a signal, characterized by comprising: The device comprises a memory, a processor, and a program running program for preventing signal tampering stored on the memory and running on the processor, the program running program for preventing signal tampering being configured to implement the steps of the program running method for preventing signal tampering according to any one of claims 1 to 6.
9. A storage medium, characterized by The storage medium stores a program running program for preventing signal tampering, the program running program for preventing signal tampering being executed by the processor to implement the steps of the program running method for preventing signal tampering according to any one of claims 1 to 6.
Citation Information
Patent Citations
Communication data verification method and device, equipment and medium
CN111555841A
Communication method and device, ECU, vehicle and storage medium
CN113162928A
Secure data transmission method and apparatus
WO2009036891A1