Vehicle electric drive control method and device
By introducing random number generation, key expansion and symmetric key packet cipher algorithms into the electric drive control system, the problem of insufficient security of the electric drive system is solved, and higher security and attack prevention capabilities are achieved.
Patent Information
- Application Number
- CN202411780249.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-03-11
AI Technical Summary
The existing electric drive system is insecure and is vulnerable to attacks and illegal intervention, resulting in theft of vehicles or safety accidents.
By introducing random number generation, key expansion, permutation operation and symmetric key packet cipher algorithms into the electric drive control system, we ensure that each authentication process is unique and improve the security of the key, thereby enhancing the security of the electric drive system.
By generating highly random numbers and performing key expansion, the security of the electric drive system is improved, preventing attackers from predicting and cracking, and ensuring the legitimacy of the commands and the security of the system.
Smart Images

Figure CN119602959A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle control technology, and in particular to a vehicle electric drive control method and device. Background Art
[0002] As energy crisis and environmental pollution become increasingly serious, electric vehicles have received widespread attention and promotion worldwide due to their advantages in emissions and noise. Compared with traditional fuel vehicles, electric vehicles use electric drive technology to achieve power output and driving control through a powerful electric drive control system. In this system, the safety of the electric drive control system, the core component of electric vehicles, has become an important consideration. Abnormal or illegal intervention in the electric drive system may not only lead to vehicle theft, but also cause driving safety accidents.
[0003] In some technical solutions, the whole vehicle electric drive control solution is constructed through identity verification, but this solution has weak anti-attack capabilities and poor security. Therefore, it is particularly urgent to develop a highly secure electric drive system control technology. Summary of the invention
[0004] The problem solved by the present invention is how to increase the safety of the electric drive system.
[0005] In order to solve the above problems, the present invention provides a vehicle electric drive control method and device.
[0006] In a first aspect, the present invention provides a vehicle electric drive control method, which is applied to an electric drive controller. The vehicle electric drive control method includes:
[0007] In response to the wake-up instruction, generating a first random number;
[0008] Perform key expansion on the preset initial key to obtain a subkey;
[0009] Performing a first permutation on the first random number to obtain a second random number;
[0010] Encrypting the second random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a first password;
[0011] In response to a second password and a command from a zone controller, determining whether the first password and the second password match;
[0012] When the first password and the second password match, the command is executed, wherein the command includes at least one of an unlock command, a close command, and a disable command.
[0013] Optionally, in response to the wake-up instruction, generating a first random number includes:
[0014] The first random number is generated by a random number generator, wherein the random number generator satisfies a first constraint condition, the first constraint condition includes: the random number generator is a true random number generator, and the random number generator is unique; the first random number satisfies a second constraint condition, the second constraint condition includes: the first random number is not zero, and a data space of a preset proportion of the first random number is unified.
[0015] Optionally, the step of performing key expansion on a preset initial key to obtain a subkey includes:
[0016] Padding the initial key to obtain a padding key, wherein the length of the padding key is consistent with a preset key length of the symmetric key block cipher algorithm;
[0017] The padding key is shifted and second-permuted to obtain the subkey, wherein the key expansion includes the padding, the shift and the second permutation, and the shift includes a logical shift and an arithmetic shift.
[0018] Optionally, performing a first permutation on the first random number to obtain a second random number includes:
[0019] The first random number is divided into at least two number blocks, and the order of the number blocks is rearranged to obtain the second random number.
[0020] Optionally, encrypting the second random number based on the subkey by using a preset symmetric key block cipher algorithm to obtain the first password includes:
[0021] Based on the subkey, the second random number is encrypted for n rounds to obtain the first password, wherein in each round of encryption, key addition, nonlinear transformation substitution and linear transformation are performed on the encryption result of the previous round, and n represents a preset round.
[0022] Optionally, the key addition includes performing a bit-by-bit XOR operation on the subkey and a current random number, wherein the current random number includes the second random number or the encryption result of the previous round;
[0023] The nonlinear transformation substitution includes replacing data in the current random number according to a preset lookup table, wherein the length of the current random number before and after the replacement is the same.
[0024] Optionally, after determining whether the first password and the second password match in response to the second password and the command from the zone controller, the method further includes:
[0025] When the first password and the second password do not match, returning to the step of generating the first random number to generate a new first password;
[0026] In response to the new second password, re-determining whether the new first password and the new second password match;
[0027] When the new first password and the new second password match, executing the command;
[0028] When the first password and the second password do not match each other for consecutive preset rounds, the electric drive controller is locked.
[0029] In a second aspect, the present invention provides a vehicle electric drive control method, which is applied to a zone controller, and the vehicle electric drive control method includes:
[0030] In response to a first random number and an initiation flag from the electric drive controller, performing key expansion on a preset initial key to obtain a subkey;
[0031] Performing a first permutation on the first random number to obtain a third random number;
[0032] Encrypting the third random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a second password;
[0033] The second password and the acquired command are sent to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0034] In a third aspect, the present invention provides a vehicle electric drive control device, which is applied to an electric drive controller, and the vehicle electric drive control device includes:
[0035] A random number generation module, configured to generate a first random number in response to a wake-up instruction;
[0036] The first expansion module is used to expand the preset initial key to obtain a subkey;
[0037] A first replacement module, used for performing a first replacement on the first random number to obtain a second random number;
[0038] A first encryption module, used to encrypt the second random number based on the subkey by using a preset symmetric key block encryption algorithm to obtain a first password;
[0039] a first communication module, configured to determine whether the first password and the second password match in response to a second password and a command from a zone controller;
[0040] A matching module is used to execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0041] In a fourth aspect, the present invention provides a vehicle electric drive control device, which is applied to a zone controller, and the vehicle electric drive control device includes:
[0042] A second expansion module, configured to perform key expansion on a preset initial key in response to a first random number and an initiation flag from the electric drive controller to obtain a subkey;
[0043] A second replacement module, used for performing a first replacement on the first random number to obtain a third random number;
[0044] A second encryption module, used to encrypt the third random number based on the subkey through a preset symmetric key block encryption algorithm to obtain a second password;
[0045] The second communication module is used to send the second password and the acquired command to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0046] The beneficial effects of the vehicle electric drive control method of the present invention are:
[0047] The generated first random number has a high degree of randomness, so that the random number generated each time is different, which increases the difficulty for attackers to predict and crack. The random number generated each time is different, which can effectively prevent replay attacks, that is, attackers cannot reuse the previous random number by recording it. By generating random numbers, each authentication process is ensured to be unique, thereby improving the security of the electric drive system. The subkey generated by key expansion meets the requirements of the symmetric key block cipher algorithm for the key, and improves the security of the key, making it difficult for attackers to crack the entire system through the initial key. Through key expansion, the security of the key is improved, thereby increasing the security of the electric drive system. The bit order of the first random number is changed by the permutation operation, increasing the complexity and randomness of the data. The permutation operation makes it difficult for attackers to restore the original random number through reverse analysis, which is used to improve the security of the system. Through the permutation operation, the degree of data obfuscation is increased, further improving the security of the electric drive system. The symmetric key block cipher algorithm has a high encryption strength and can effectively protect the security of data. Encryption using subkeys further improves the security of the key and prevents key leakage. When the first password and the second password match, the command is executed to ensure the legitimacy of the command. Through the password matching mechanism, illegal operations and unauthorized access are prevented, thereby improving the security of the system. From random number generation, key expansion, permutation operation, encryption algorithm, two-way verification to command execution, multiple links work together, layer by layer, to effectively improve the safety of the electric drive system. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic flow chart of a vehicle electric drive control method according to an embodiment of the present invention;
[0049] Figure 2 Another schematic diagram of a flow chart of a vehicle electric drive control method according to an embodiment of the present invention;
[0050] Figure 3 A flowchart of a vehicle electric drive control method according to an embodiment of the present invention;
[0051] Figure 4 An exemplary diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0053] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0054] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to"; the term "based on" means "based at least in part on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0055] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0056] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not intended to limit the scope of these messages or information.
[0057] In view of the problems existing in the above-mentioned related technologies, this embodiment provides a vehicle electric drive control method and device.
[0058] like Figure 1 and Figure 3 As shown, an embodiment of the present invention provides a vehicle electric drive control method, which is applied to an electric drive controller. The vehicle electric drive control method includes:
[0059] Step S100: generating a first random number in response to a wake-up instruction.
[0060] In one embodiment, the wake-up instruction includes an instruction for instructing the electric drive system to start, such as a vehicle power-on wake-up instruction. The wake-up instruction can be triggered by a button in the vehicle, or a wake-up instruction from other devices can be received by wire or wirelessly; when the wake-up instruction is received, the electric drive controller internally generates a set of random numbers and an Avl flag that allows anti-theft authentication to be initiated. The random number is used to generate the corresponding password according to the symmetric key block cipher algorithm, and the Avl flag that allows anti-theft authentication to be initiated is used together with the first random number as a flag to determine the start of encryption authentication to prevent misoperation.
[0061] Step S200: Expand the preset initial key to obtain a subkey.
[0062] In one embodiment, the initial key is a preset array. When encryption is performed using a symmetric key block cipher algorithm, the initial key used for encryption in the electric drive controller is the same as the initial key used for encryption in the zone controller, and is used to obtain the same password through the same set of first random numbers, so that the command is executed when the first password and the second password match. In order to ensure the encryption effect and the compatibility of the key with the symmetric key block cipher algorithm, the initial key is key expanded to meet the requirements of the symmetric key block cipher algorithm. For example, the initial key is expanded to obtain multiple subkeys, which are used to encrypt using different subkeys in each operation when the symmetric key block cipher algorithm has multiple operations, so as to obtain better security; the initial key is expanded to make the subkey meet the length requirements of the symmetric key block cipher algorithm, so as to increase the versatility of the symmetric key block cipher algorithm.
[0063] Step S300: performing a first permutation on the first random number to obtain a second random number.
[0064] Before encryption, in order to ensure higher security, a first permutation operation is performed on the first random number to change the bit sequence of the array in the first random number, thereby further increasing confusion, reducing the risk of leakage of the first random number, and increasing security.
[0065] Step S400: encrypt the second random number based on the subkey using a preset symmetric key block encryption algorithm to obtain a first password.
[0066] In one embodiment, the preset symmetric key block cipher algorithm in the electric drive controller and the zone controller is the same, and is used to obtain the same password when the random numbers are the same. Based on the subkey, the second random number is encrypted to obtain a first password calculated according to the electric drive controller, and the password is used to confirm whether the communication content of the electric drive controller has been cracked and intercepted.
[0067] Step S500, in response to the second password and command from the zone controller, determining whether the first password and the second password match.
[0068] The electric drive controller also receives the second password calculated from the regional controller to confirm whether the communication content of the regional controller has been cracked or intercepted. It is determined whether the first password and the second password match, that is, whether the first password and the second password are consistent. If they are consistent, it means that the communication content between the electric drive controller and the regional controller has not been cracked or intercepted.
[0069] In one embodiment, the zone controller and the electric drive controller communicate through a CAN channel, use CAN for anti-theft authentication, and utilize the real-time and enhanced security features of CAN to further enhance the ability to quickly identify and prevent unauthorized access or manipulation, thereby improving the protection of the vehicle from unauthorized access.
[0070] Step S600: When the first password and the second password match, execute the command, wherein the command includes at least one of an unlock command, a close command, and a disable command.
[0071] In one embodiment, when the first password and the second password match, a command from the zone controller is executed, wherein the command from the zone controller includes NoMtn, Mtn, Imobn, TurnOff;
[0072] NoMtn and Mtn represent unlocking commands, where NoMtn represents the anti-theft remote unlocking state, at which the electric drive system is not allowed to output torque;
[0073] Mtn indicates the anti-theft local unlocking state, at which the electric drive system allows output torque;
[0074] Imobn means the prohibited state, which is the initial state of anti-theft. At this time, the electric drive system is not allowed to output torque;
[0075] TurnOff indicates the off state, and anti-theft authentication is no longer performed. At this time, the electric drive system is not allowed to output torque.
[0076] In this embodiment, the generated first random number has a high degree of randomness, so that the random number generated each time is different, which increases the difficulty of prediction and cracking by attackers. The random number generated each time is different, which can effectively prevent replay attacks, that is, attackers cannot reuse the previous random number by recording it. By generating random numbers, each authentication process is ensured to be unique, thereby improving the security of the electric drive system. The subkey generated by key expansion enables the subkey to meet the requirements of the symmetric key block cipher algorithm for the key, and improves the security of the key, making it difficult for attackers to crack the entire system through the initial key. Through key expansion, the security of the key is improved, thereby increasing the security of the electric drive system. Through the permutation operation, the bit order of the first random number is changed, increasing the complexity and randomness of the data. The permutation operation makes it difficult for attackers to restore the original random number through reverse analysis, thereby improving the security of the system. Through the permutation operation, the degree of obfuscation of the data is increased, thereby improving the security of the electric drive system. The symmetric key block cipher algorithm has a high encryption strength and can effectively protect the security of data. Using subkeys for encryption further improves the security of the key and prevents key leakage. When the first password and the second password match, the command is executed to ensure the legitimacy of the command. The password matching mechanism prevents illegal operations and unauthorized access, improving system security. Strict command execution conditions ensure the safety of the electric drive system.
[0077] Optionally, in response to the wake-up instruction, generating a first random number includes:
[0078] The first random number is generated by a random number generator, wherein the random number generator satisfies a first constraint condition, the first constraint condition includes: the random number generator is a true random number generator, and the random number generator is unique; the first random number satisfies a second constraint condition, the second constraint condition includes: the first random number is not zero, and a data space of a preset proportion of the first random number is unified.
[0079] In one embodiment, the first random number is a set of 7-byte random numbers, which must meet the second constraint condition. To ensure that the password generated by the first random number is not easy to be cracked, it is necessary to ensure that the first random number is not zero to improve security; the data space of the preset proportion of the first random number is unified to ensure that the vast majority of digital combinations are covered by the first random number. For example, if the preset proportion is 95%, 95% of the digital combinations can be randomly generated by the first random number. The random number generator must meet the first constraint condition. To ensure the security of the random number generated randomly, the random number generator must meet the unpredictability. For example, it must be ensured that in the process of using the random number generator at least 50,000 times, the next output cannot be predicted by the previous output. Even if the attacker can intercept a communication, the next random number cannot be predicted. It is also necessary to ensure that the random number generator is unique, that is, the first random number generated by the random number generator cannot be predicted by monitoring the data sequence of the same sample of another random number generator.
[0080] Optionally, the step of performing key expansion on a preset initial key to obtain a subkey includes:
[0081] The initial key is padded to obtain a padded key, wherein the length of the padded key is consistent with a preset key length of the symmetric key block cipher algorithm.
[0082] The padding key is shifted and second-permuted to obtain the subkey, wherein the key expansion includes the padding, the shift and the second permutation, and the shift includes a logical shift and an arithmetic shift.
[0083] In one embodiment, the length of the initial key may be inconsistent with the preset key length required by the symmetric key block cipher algorithm, and the initial key is extended with respect to the key length to make it consistent with the preset key length. For example, if the initial key is 32 bits and the preset key length is 256 bits, the initial key is padded with 224 bits to make it consistent with the preset key length. The padding method can be determined according to actual needs. For example, in one embodiment, 0 is padded after the initial key to make it consistent with the preset key length; in another embodiment, 1 is padded after the initial key; in some other embodiments, 0 or 1 is padded in the initial key to make it consistent with the preset key length.
[0084] Shifting refers to moving each bit in a key or data block to the left or right by a specified number of bits. Shifting operations include logical shift (unsigned shift) and arithmetic shift (signed shift). Second permutation includes rearranging the positions of the array in the key. Through expansion, shifting, and second permutation, the degree of obfuscation of the key can be increased, making the relationship between the original data and the encrypted data more difficult to infer, thereby increasing security.
[0085] Optionally, performing key expansion on the preset initial key to obtain a subkey further includes:
[0086] A corresponding number of sub-keys are obtained according to the encryption rounds.
[0087] For example, by performing expansion, displacement and second permutation on the initial key, n subkeys are obtained, where n represents the preset rounds of encryption of the symmetric key block cipher algorithm. In each round of encryption, different subkeys are used for encryption in a preset order to obtain a password.
[0088] Optionally, performing a first permutation on the first random number to obtain a second random number includes:
[0089] The first random number is divided into at least two number blocks, and the order of the number blocks is rearranged to obtain the second random number.
[0090] When performing the first permutation on the first random number, the first random number is divided into multiple blocks, and the order of the blocks is rearranged to obtain the second random number. For example, when the first random number is 101111, the first random number is divided into three blocks of 10, 11, and 11, and the blocks are rearranged to obtain 111011, which is used as the second random number. This further increases obfuscation, reduces the risk of leakage of the first random number, and increases security.
[0091] Optionally, encrypting the second random number based on the subkey by using a preset symmetric key block cipher algorithm to obtain the first password includes:
[0092] Based on the subkey, the second random number is encrypted for n rounds to obtain the first password, wherein in each round of encryption, key addition, nonlinear transformation substitution and linear transformation are performed on the encryption result of the previous round, and n represents a preset round.
[0093] The linear transformation includes linear transformation operations such as permutation, for example, changing the order of data in the second random number.
[0094] In one embodiment, the preset symmetric key block cipher algorithm is the Serpent encryption algorithm. In the Serpent encryption algorithm, 32 rounds of encryption are performed, and n is 32. Accordingly, there are 32 subkeys. In each round of encryption, a different subkey is used to perform key addition with the second random number and perform nonlinear transformation substitution and linear transformation to obtain the first password. For example, in the first round, the first subkey is used to perform key addition with the second random number and perform nonlinear transformation substitution and linear transformation, and then the second subkey is used to perform the second round of encryption on the result obtained in the first round of encryption, until 32 rounds of encryption are performed to obtain the first password.
[0095] Optionally, after n rounds of encryption, the final encryption result is finally permuted to remove certain symmetries in the design to ensure security.
[0096] In one embodiment, the order of key addition, nonlinear transformation substitution and linear transformation can be determined according to actual needs.
[0097] Optionally, the key addition includes performing a bit-by-bit XOR operation on the subkey and a current random number, wherein the current random number includes the second random number or the encryption result of the previous round;
[0098] The nonlinear transformation substitution includes replacing data in the current random number according to a preset lookup table, wherein the length of the current random number before and after the replacement is the same.
[0099] Specifically, the second random number S = 0x123456789ABCDEF0, the subkey K = 0xFEDCBA9876543210, then the two are bit-by-bit XORed, the result is: s = 0xEDF8E000E0B8DCA0. When the result is not the last round result of the symmetric key block cipher algorithm, the result s is used as the current random number of the next round, and the subkey corresponding to the next round is subjected to a bit-by-bit XOR operation.
[0100] Nonlinear transformation substitution includes replacing the data in the current random number through a preset nonlinear lookup table, further increasing the confusion and diffusion of the current random number while ensuring that the length before and after the replacement is the same. The nonlinear lookup table is set to an array of preset bytes, each array element is a value of preset bits, the value input to the nonlinear lookup table is the same as the number of bits of the array element, and the number of bits output is also the same. For example, if the nonlinear lookup table is an array of 256 bytes and each array element is an 8-bit value, then the input and output of the nonlinear lookup table are both 8-bit values.
[0101] In one embodiment, there are multiple nonlinear lookup tables, for example, there are 8 lookup tables, each of which is 8x8, for implementing nonlinear transformation and increasing the degree of data obfuscation. When the current random number is 128 bits, the current random number is divided into 16 8-bit sub-blocks, and each 8-bit sub-block is replaced through 8 different lookup tables to obtain the replaced current random number.
[0102] When the nonlinear lookup table is a 256-byte array, it can be specifically expressed as:
[0103] [0xA5,0x81,0xC4,0x5E,0x23,0xB7,0xF9,0x1A,
[0104] 0x4D,0x32,0x6B,0xE8,0x7F,0x0C,0x99,0xD6,
[0105] 0x1B,0xF2,0x85,0x3C,0xA3,0x54,0x29,0x70,
[0106] 0xC7,0xDE,0x08,0x9F,0x42,0xB1,0x66,0x1D,
[0107] ...256 values in total]
[0108] When the input value is 0x5A, the value with index 90 is searched in the nonlinear lookup table. Assuming that the value with index 90 in the nonlinear lookup table is 0xE3, the output value is 0xE3.
[0109] Optionally, after determining whether the first password and the second password match in response to the second password and the command from the zone controller, the method further includes:
[0110] When the first password and the second password do not match, return to the step of generating the first random number to generate a new first password.
[0111] In response to the new second password, re-determining whether the new first password and the new second password match;
[0112] When the new first password and the new second password match, the command is executed.
[0113] When the first password and the second password do not match each other for consecutive preset rounds, the electric drive controller is locked.
[0114] like Figure 3 As shown, when the first password and the second password from the zone controller do not match, return to step S100, regenerate the first random number, and regenerate the first password. At the same time, regenerate the second password with the new first random number in the zone controller, and determine whether the new first password and the second password match. If they match, execute the corresponding command. If they do not match, return to step S100 again until the first password and the second password do not match in the preset round, then lock the electric drive controller and enter the anti-brute force cracking mode.
[0115] Optionally, the preset number of rounds is 3 rounds.
[0116] Optionally, after executing the command, the method further includes:
[0117] When the motor mode re-enters the inactive state, the next round of anti-theft authentication is re-initiated, that is, waiting for a wake-up instruction, responding to a new wake-up instruction, and re-executing step S100 until the first password and the second password match.
[0118] Second, as Figure 2 As shown, an embodiment of the present invention further provides a vehicle electric drive control method, which is applied to a zone controller. The vehicle electric drive control method includes:
[0119] Step S110 , in response to the first random number and the initiation flag from the electric drive controller, performing key expansion on the preset initial key to obtain a sub-key.
[0120] Step S210: performing a first permutation on the first random number to obtain a third random number.
[0121] Step S310: encrypt the third random number based on the subkey using a preset symmetric key block cipher algorithm to obtain a second cipher.
[0122] Step S410, sending the second password and the acquired command to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a disable command.
[0123] In one embodiment, since the encryption algorithm is a preset symmetric key block cipher algorithm, when the first random number and the symmetric key block cipher algorithm are the same, the second password obtained by the zone controller is the same as the first password. That is, the processing procedures of step S110 and step S200, step S210 and step S300, and step S310 and step S400 are the same.
[0124] In a third aspect, an embodiment of the present invention provides a vehicle electric drive control device, which is applied to an electric drive controller. The vehicle electric drive control device includes:
[0125] A random number generation module, configured to generate a first random number in response to a wake-up instruction;
[0126] The first expansion module is used to expand the preset initial key to obtain a subkey;
[0127] A first replacement module, used for performing a first replacement on the first random number to obtain a second random number;
[0128] A first encryption module, used to encrypt the second random number based on the subkey by using a preset symmetric key block encryption algorithm to obtain a first password;
[0129] a first communication module, configured to determine whether the first password and the second password match in response to a second password and a command from a zone controller;
[0130] A matching module is used to execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0131] In a fourth aspect, an embodiment of the present invention provides a vehicle electric drive control device, which is applied to a zone controller. The vehicle electric drive control device includes:
[0132] A second expansion module, configured to perform key expansion on a preset initial key in response to a first random number and an initiation flag from the electric drive controller to obtain a subkey;
[0133] A second replacement module, used for performing a first replacement on the first random number to obtain a third random number;
[0134] A second encryption module, used to encrypt the third random number based on the subkey through a preset symmetric key block encryption algorithm to obtain a second password;
[0135] The second communication module is used to send the second password and the acquired command to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0136] like Figure 4 As shown, an electronic device 400 provided in an embodiment of the present invention includes a memory 410 and a processor 420; the memory 410 is used to store a computer program; the processor 420 is used to implement the vehicle electric drive control method as described above when executing the computer program.
[0137] In other words, an electronic device 400 includes a memory 410 and a processor 420 coupled to the memory 410; the memory 410 is configured to store a computer program; and the processor 420 is configured to perform the following operations when executing the computer program:
[0138] In response to the wake-up instruction, generating a first random number;
[0139] Perform key expansion on the preset initial key to obtain a subkey;
[0140] Performing a first permutation on the first random number to obtain a second random number;
[0141] Encrypting the second random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a first password;
[0142] In response to a second password and a command from a zone controller, determining whether the first password and the second password match;
[0143] When the first password and the second password match, the command is executed, wherein the command includes at least one of an unlock command, a close command, and a disable command.
[0144] Or do the following:
[0145] In response to a first random number and an initiation flag from the electric drive controller, performing key expansion on a preset initial key to obtain a subkey;
[0146] Performing a first permutation on the first random number to obtain a third random number;
[0147] Encrypting the third random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a second password;
[0148] The second password and the acquired command are sent to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0149] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the vehicle electric drive control method as described above is implemented.
[0150] In other words, a non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the following operations:
[0151] In response to the wake-up instruction, generating a first random number;
[0152] Perform key expansion on the preset initial key to obtain a subkey;
[0153] Performing a first permutation on the first random number to obtain a second random number;
[0154] Encrypting the second random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a first password;
[0155] In response to a second password and a command from a zone controller, determining whether the first password and the second password match;
[0156] When the first password and the second password match, the command is executed, wherein the command includes at least one of an unlock command, a close command, and a disable command.
[0157] Or do the following:
[0158] In response to a first random number and an initiation flag from the electric drive controller, performing key expansion on a preset initial key to obtain a subkey;
[0159] Performing a first permutation on the first random number to obtain a third random number;
[0160] Encrypting the third random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a second password;
[0161] The second password and the acquired command are sent to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
[0162] An electronic device 400 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 400 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 400 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0163] The electronic device 400 includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0164] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0165] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A vehicle electric drive control method, characterized in that: Applied to an electric drive controller, the vehicle electric drive control method includes: In response to the wake-up instruction, generating a first random number; Perform key expansion on the preset initial key to obtain a subkey; Performing a first permutation on the first random number to obtain a second random number; Encrypting the second random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a first password; In response to a second password and a command from a zone controller, determining whether the first password and the second password match; When the first password and the second password match, the command is executed, wherein the command includes at least one of an unlock command, a close command, and a disable command.
2. The vehicle electric drive control method according to claim 1, characterized in that: The generating a first random number in response to the wake-up instruction comprises: The first random number is generated by a random number generator, wherein the random number generator satisfies a first constraint condition, the first constraint condition includes: the random number generator is a true random number generator, and the random number generator is unique; the first random number satisfies a second constraint condition, the second constraint condition includes: the first random number is not zero, and a data space of a preset proportion of the first random number is unified.
3. The vehicle electric drive control method according to claim 1, characterized in that: The step of performing key expansion on the preset initial key to obtain a subkey includes: Padding the initial key to obtain a padding key, wherein the length of the padding key is consistent with a preset key length of the symmetric key block cipher algorithm; The padding key is shifted and second-permuted to obtain the subkey, wherein the key expansion includes the padding, the shift and the second permutation, and the shift includes a logical shift and an arithmetic shift.
4. The vehicle electric drive control method according to claim 1, characterized in that: The performing a first permutation on the first random number to obtain a second random number comprises: The first random number is divided into at least two number blocks, and the order of the number blocks is rearranged to obtain the second random number.
5. The vehicle electric drive control method according to claim 1, characterized in that: The step of encrypting the second random number based on the subkey by using a preset symmetric key block cipher algorithm to obtain the first password comprises: Based on the subkey, the second random number is encrypted for n rounds to obtain the first password, wherein in each round of encryption, key addition, nonlinear transformation substitution and linear transformation are performed on the encryption result of the previous round, and n represents a preset round.
6. The vehicle electric drive control method according to claim 5, characterized in that: The key addition includes performing a bit-by-bit XOR operation on the subkey and a current random number, wherein the current random number includes the second random number or the encryption result of the previous round; The nonlinear transformation substitution includes replacing data in the current random number according to a preset lookup table, wherein the length of the current random number before and after the replacement is the same.
7. The vehicle electric drive control method according to claim 1, characterized in that: After determining whether the first password and the second password match in response to the second password and the command from the zone controller, the method further includes: When the first password and the second password do not match, returning to the step of generating the first random number to generate a new first password; In response to the new second password, re-determining whether the new first password and the new second password match; When the new first password and the new second password match, executing the command; When the first password and the second password do not match each other for consecutive preset rounds, the electric drive controller is locked.
8. A vehicle electric drive control method, characterized in that: Applied to a zone controller, the vehicle electric drive control method includes: In response to a first random number and an initiation flag from the electric drive controller, performing key expansion on a preset initial key to obtain a subkey; Performing a first permutation on the first random number to obtain a third random number; Encrypting the third random number based on the subkey by a preset symmetric key block cipher algorithm to obtain a second password; The second password and the acquired command are sent to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
9. A vehicle electric drive control device, characterized in that: Applied to an electric drive controller, the vehicle electric drive control device comprises: A random number generation module, configured to generate a first random number in response to a wake-up instruction; The first expansion module is used to expand the preset initial key to obtain a subkey; A first replacement module, used for performing a first replacement on the first random number to obtain a second random number; A first encryption module, used to encrypt the second random number based on the subkey by using a preset symmetric key block encryption algorithm to obtain a first password; a first communication module, configured to determine whether the first password and the second password match in response to a second password and a command from a zone controller; A matching module is used to execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.
10. A vehicle electric drive control device, characterized in that: Applied to a regional controller, the vehicle electric drive control device comprises: A second expansion module, configured to perform key expansion on a preset initial key in response to a first random number and an initiation flag from the electric drive controller to obtain a subkey; A second replacement module, used for performing a first replacement on the first random number to obtain a third random number; A second encryption module, used to encrypt the third random number based on the subkey through a preset symmetric key block encryption algorithm to obtain a second password; The second communication module is used to send the second password and the acquired command to the electric drive controller, wherein the electric drive controller is used to generate a first password and execute the command when the first password and the second password match, wherein the command includes at least one of an unlock command, a close command and a prohibit command.