A data encryption method and related device for charging pile

By generating an encryption key and initial vector between the control unit of the charging pile and the matching control unit, and encrypting sensitive data, the problem of safety hazards of data interaction by charging piles is solved, and the security of data interaction is improved.

CN119788276APending Publication Date: 2025-04-08SUNGROW POWER SUPPLY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510005734.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

There are security risks in data interaction between controllers in charging piles, and third parties may steal user data through network monitors.

Method used

A data encryption method of a charging pile is adopted. After powering on the charging pile, the control unit and the matching control unit send a handshake signal, generate a key and an initial vector of the preset encryption algorithm, and encrypt it before sending sensitive data.

Benefits of technology

It improves the security of data interaction between the internal control units of the charging pile, enhances the security of key parameter transmission, and prevents user data from being stolen by third parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788276A_ABST
    Figure CN119788276A_ABST
Patent Text Reader

Abstract

The present application discloses a data encryption method and related devices for a charging pile, and relates to the field of charging piles. Each time the charging pile is powered on, a control unit in the charging pile and a corresponding matching control unit carry different key parameters when sending a handshake signal to each other. The transmission of the key parameters is more concealed, and the security of the key parameter transmission is improved. After the control unit generates a dynamic key based on the key parameters and obtains an initial vector of a preset encryption algorithm randomly generated by the control unit or the matching control unit, the control unit can use the above-mentioned key and initial vector to encrypt the sensitive data before sending the sensitive data to the matching control unit, thereby improving the security of data interaction between the control units inside the charging pile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of charging piles, and in particular to a data encryption method and related devices for charging piles. Background Art

[0002] With the popularization of new energy vehicles, there are more and more charging piles.

[0003] During the charging process, data will be exchanged between the controllers in the charging pile. Since the controllers communicate using network cables, a third party may steal user data through devices such as network port monitors, posing a security risk. Summary of the invention

[0004] In view of the above problems, this application provides a data encryption method and related devices for a charging pile to improve the security of data interaction between control units inside the charging pile. The specific scheme is as follows: In a first aspect, the present application provides a data encryption method for a charging pile, which is applied to a control unit in the charging pile, wherein the control unit corresponds to at least one matching control unit, and the data encryption method for the charging pile includes: After the charging pile is powered on, a first handshake signal carrying a first parameter is sent to the matching control unit, and a second handshake signal carrying a second parameter is received from the matching control unit; Generate a key of a preset encryption algorithm based on the first parameter and the second parameter; Acquire an initial vector of the preset encryption algorithm, wherein the initial vector is randomly generated by the control unit or the matching control unit; Before sending the sensitive data to the matching control unit, the sensitive data is encrypted using the key and the initialization vector.

[0005] In a possible implementation, the generating a key of a preset encryption algorithm based on the first parameter and the second parameter includes: The first parameter and the second parameter are arranged in a preset order to obtain the key, wherein the matching control unit also arranges the first parameter and the second parameter in the preset order to obtain the key.

[0006] In a possible implementation, the first parameter sent by the control unit to the matching control unit each time has a different value but the same length, and the second parameter sent by the matching control unit to the control unit each time has a different value but the same length.

[0007] In a possible implementation, the first parameter is a salt value parameter, and the second parameter is a seed parameter.

[0008] In a possible implementation, the data encryption method of the charging pile further includes: After the key is generated, the key is stored in a volatile memory, and after the initial vector is acquired, the initial vector is stored in the volatile memory; Wherein, all data stored in the volatile memory are cleared after power failure.

[0009] In a possible implementation, encrypting the sensitive data by using the key and the initial vector includes: The key and the initialization vector in the volatile memory are read, and the sensitive data is encrypted using the key and the initialization vector.

[0010] In a possible implementation, the sensitive data includes at least one of a charging key, a charging pile book, and a digital signature.

[0011] In a possible implementation, the data encryption method of the charging pile further includes: The encrypted data sent by the matching control unit is received, the key and the initial vector in the volatile memory are read, and the encrypted data is decrypted using the key and the initial vector.

[0012] In a possible implementation, the data encryption method of the charging pile further includes: When it is detected that the matching control unit is offline, the method returns to the step of sending a first handshake signal carrying a first parameter to the matching control unit and receiving a second handshake signal carrying a second parameter sent by the matching control unit.

[0013] A second aspect of the present application provides a control unit, comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the control unit can implement the data encryption method of the charging pile according to the above-mentioned first aspect or any implementation manner of the first aspect.

[0014] A third aspect of the present application provides a charging pile, comprising: a control unit and at least one matching control unit corresponding to the control unit; The control unit is communicatively connected with at least one matching control unit via a network cable; The control unit is used to implement the data encryption method of the charging pile according to the first aspect or any implementation manner of the first aspect.

[0015] The fourth aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on a control unit, the control unit implements the data encryption method for a charging pile according to the first aspect or any implementation of the first aspect.

[0016] The fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by a control unit, the control unit can implement the data encryption method for the charging pile of the above-mentioned first aspect or any implementation method of the first aspect.

[0017] With the help of the above technical scheme, the data encryption method and related devices of the charging pile provided by the present application, each time the charging pile is powered on, the control unit in the charging pile and the corresponding matching control unit carry different key parameters when sending handshake signals to each other, and the transmission of the key parameters is more concealed, thereby improving the security of the key parameter transmission. The control unit generates a dynamic key based on the key parameters, and obtains the initial vector of the preset encryption algorithm randomly generated by the control unit or the matching control unit. After that, the control unit can use the above key and initial vector to encrypt the sensitive data before sending the sensitive data to the matching control unit, thereby improving the security of data interaction between the control units inside the charging pile. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0019] Figure 1 A schematic diagram of a data encryption method for a charging pile provided in an embodiment of the present application; Figure 2 A schematic diagram of a process for generating a key and an initialization vector by a TCU and a CCU provided in an embodiment of the present application; Figure 3 A schematic diagram of data interaction between a TCU and a CCU provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a control unit provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0021] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0022] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0023] The embodiment of the present application provides a data encryption method for a charging pile, which is applied to a control unit in the charging pile. The control unit corresponds to at least one matching control unit. Exemplarily, the control unit may be a TCU (Telematics Control Unit) or a CCU (Charging Control Unit). If the control unit is a TCU, the matching control unit is the CCU. If the control unit is a CCU, the matching control unit is the TCU. The TCU is responsible for tasks such as cloud communication and UI (User Interface) display, and the CCU is responsible for tasks such as realizing communication between the vehicle and the charging pile. The TCU and the CCU are deployed on different hardware circuit boards, and the TCU is connected to the CCU via a network cable. The data encryption method for the charging pile in the embodiment of the present application is described in detail below in conjunction with the accompanying drawings.

[0024] Reference Figure 1 , Figure 1 The following is a flow chart of a data encryption method for a charging pile provided in an embodiment of the present application. Figure 1 As shown, a data encryption method for a charging pile provided in an embodiment of the present application may include steps 101 to 104, and these steps are described in detail below.

[0025] 101: after the charging pile is powered on, sending a first handshake signal carrying a first parameter to the matching control unit, and receiving a second handshake signal carrying a second parameter sent by the matching control unit; This embodiment does not limit the order in which the control unit sends the first handshake signal to the matching control unit and receives the second handshake signal sent by the matching control unit.

[0026] Take the three-way handshake between TCU and CCU as an example. The three-way handshake includes: The TCU randomly generates key parameters of the preset encryption algorithm and sends a handshake signal carrying key parameters and other parameters to the CCU, indicating that the TCU is ready to send data; After receiving the handshake signal, the CCU randomly generates another key parameter of the preset encryption algorithm, and sends a handshake signal carrying the key parameter and other parameters to the TCU as a response to the handshake signal sent by the TCU.

[0027] After receiving the handshake signal sent by the CCU, the TCU sends a handshake signal to the CCU again as a response to the handshake signal sent by the CCU.

[0028] Among them, if the control unit is TCU, the matching control unit is CCU, the control unit needs to send two handshake signals to the matching control unit and receive one handshake signal, the first parameter is the key parameter in the first handshake, and the second parameter is the key parameter in the second handshake; if the control unit is CCU, the matching control unit is TCU, the control unit needs to receive two handshake signals sent by the matching control unit and send one handshake signal to the matching control unit, the first parameter is the key parameter in the second handshake, and the second parameter is the key parameter in the first handshake.

[0029] The preset encryption algorithm can be AES (Advanced Encryption Standard), DES (DataEncryption Standard), 3DES (Triple Data Encryption Algorithm), SM4 and other encryption algorithms. The control unit and the matching control unit pre-agree on the preset encryption algorithm, and the preset encryption algorithm should be an encryption algorithm supported by the control unit chip and the matching control unit chip.

[0030] In one possible implementation, the preset encryption algorithm is the AES encryption algorithm. AES has undergone extensive cryptographic analysis and evaluation, is mature and has high security. Most high-performance microcontrollers have hardware AES encryption and decryption units, and encryption and decryption performance loss is relatively small.

[0031] The first parameter and the second parameter are partial parameters used to generate the key, such as the salt parameter and the seed parameter. The salt parameter (salt) is a random number, and the seed parameter is also a random number.

[0032] Exemplarily, the first parameter is a salt value parameter, and the second parameter is a seed parameter.

[0033] Exemplarily, the first parameter is a seed parameter, and the second parameter is a salt value parameter.

[0034] Since the first parameter and the second parameter are hidden in the normal power-on interaction information, the transmission of the key parameters is more concealed, which improves the security of the key parameter transmission. The first control unit and the second control unit each provide part of the key parameters, which increases the disturbance in the key generation process and makes the finally generated key more random.

[0035] 102: Generate a key of a preset encryption algorithm based on the first parameter and the second parameter; It should be noted that the matching control unit will also generate a key of the preset encryption algorithm based on the first parameter and the second parameter. Since the control unit and the matching control unit both generate keys based on the same set of key parameters and using the same preset encryption algorithm, the keys generated by the control unit and the matching control unit are the same.

[0036] It can be understood that different preset encryption algorithms have different methods of generating keys, and the generated key lengths may also be different. For example: the key length of the AES encryption algorithm is 128 bits, the key length of the DES encryption algorithm is 64 bits, the key length of the 3DES encryption algorithm is 193 bits, and the key length of the SM4 encryption algorithm is 128 bits. I will not go into details here.

[0037] 103: Obtain an initial vector of a preset encryption algorithm, where the initial vector is randomly generated by a control unit or a matching control unit; Take the control unit as TCU and the matching control unit as CCU as an example. Figure 2 As shown, the control unit actively and randomly generates an initial vector of a preset encryption algorithm and sends the initial vector to the matching control unit.

[0038] In addition, if the control unit is CCU and the matching control unit is TCU, the control unit may also first send a request message to the matching control unit, requesting the matching control unit to send an initial vector, and the matching control unit randomly generates an initial vector of a preset encryption algorithm and sends the initial vector to the control unit.

[0039] Different preset encryption algorithms may have different methods for generating initialization vectors, which will not be described here.

[0040] 104: Before sending the sensitive data to the matching control unit, encrypt the sensitive data using the key and the initialization vector.

[0041] After the control unit and the matching control unit generate the key and initial vector of the preset encryption algorithm, they enter the normal communication process. During the communication process, the control unit and the matching control unit will send normal data and sensitive data to each other. The sensitive data can be charging keys, charging certificates, digital signatures, etc.

[0042] In this embodiment, the control unit and the matching control unit only encrypt a small amount of sensitive data transmitted in internal communication during charging, which has little impact on the overall performance.

[0043] Before sending data to the other party, the control unit or the matching control unit first determines whether the data to be sent is sensitive data. If the data to be sent is sensitive data, the sensitive data is encrypted using the key and initial vector of the preset encryption algorithm.

[0044] Exemplarily, sensitive data types may be pre-configured, and if the data to be sent belongs to the pre-configured sensitive data type, the data to be sent is determined to be sensitive data.

[0045] The present embodiment discloses a data encryption method for a charging pile. Each time the charging pile is powered on, the control unit in the charging pile and the corresponding matching control unit carry different key parameters when sending handshake signals to each other. The transmission of the key parameters is more concealed, thereby improving the security of the key parameter transmission. After the control unit generates a dynamic key based on the key parameters and obtains an initial vector of a preset encryption algorithm randomly generated by the control unit or the matching control unit, the control unit can use the above-mentioned key and initial vector to encrypt the sensitive data before sending the sensitive data to the matching control unit, thereby improving the security of data interaction between the control units inside the charging pile.

[0046] In a possible implementation, when the control unit detects that the other party is offline, it returns to execute step 101 in the above embodiment, that is, each time after power-on or disconnection and reconnection, the control unit needs to regenerate the key parameters, and carry the generated key parameters when sending a handshake signal to the matching control unit, and then regenerate the initial vector of the preset encryption algorithm. In other words, each time after power-on or disconnection and reconnection, the key and initial vector of the preset encryption algorithm need to be dynamically generated, which greatly increases the difficulty of cracking the key and initial vector.

[0047] In a possible implementation, the value of the first parameter sent by the control unit to the matching control unit each time is different but the length is the same, and the value of the second parameter sent by the matching control unit to the control unit each time is different but the length is the same, so that the length of the key parameter generated by the control unit and the matching control unit meets the requirements of the preset encryption algorithm. Exemplarily, the first parameter is a salt value parameter, the second parameter is a seed parameter, the seed parameter is 8 bytes in length, and the salt value parameter is 24 bytes in length.

[0048] Since the control unit and the matching control unit both hold the key parameters generated by themselves and the key parameters sent by the other party after sending a handshake signal to each other, that is, they hold the first parameter and the second parameter at the same time, in order to ensure that the keys generated by the control unit and the matching control unit based on the first parameter and the second parameter are the same, in a possible implementation, the method for the control unit to generate the key is specifically: arranging the first parameter and the second parameter in a preset order to obtain the key, such as the first parameter + the second parameter, or the second parameter + the first parameter. It should be noted that the matching control unit also arranges the first parameter and the second parameter in a preset order to obtain the key. Specifically, the preset order can be that the first parameter of the control unit is before the second parameter of the matching control unit (that is, the first parameter + the second parameter), or the first parameter of the control unit is after the second parameter of the matching control unit (that is, the second parameter + the first parameter).

[0049] In a possible implementation, after the control unit generates the key, the key is stored in the volatile memory of the control unit. After the matching control unit generates the key, the key is also stored in the volatile memory of the matching control unit. In a possible implementation, after the controller acquires the initial vector, the controller stores the initial vector in a volatile memory of the control unit. After the matching control unit acquires the initial vector, the matching control unit also stores the initial vector in a volatile memory of the matching control unit.

[0050] The volatile memory can be one of the static random access memory (SRAM), dynamic random access memory (DRAM), and random access memory (RAM). Since the volatile memory will lose the saved data when the power is off, the key and initial vector of the preset encryption algorithm saved in the volatile memory will be directly lost after each power failure and cannot be read again, thereby ensuring the security of the data.

[0051] Based on this, when the control unit or the matching control unit uses the key and initial vector of the preset encryption algorithm to encrypt sensitive data, the key and initial vector in the volatile memory are read, and the sensitive data is encrypted using the key and initial vector, without the need to regenerate a new key and initial vector each time encryption is performed.

[0052] On the other hand, after receiving the encrypted data, the control unit or the matching control unit needs to decrypt the encrypted data. Specifically, the control unit reads the key and the initial vector in the volatile memory and uses the key and the initial vector to decrypt the encrypted data.

[0053] It should be noted that the control unit receives the encrypted data sent by the matching control unit, which is also encrypted according to the key and the initial vector. The key and the initial vector held by the matching control unit are the same as the key and the initial vector held by the control unit, and the preset encryption algorithm is also the same. Specifically, the control unit and the matching control unit pre-agree on the preset encryption algorithm and the preset order of the first parameter and the second parameter when generating the key. After each power-on, the control unit and the matching control unit exchange the first parameter and the second parameter in the handshake phase, so that each arranges the first parameter and the second parameter in a preset order to obtain the same key. Regardless of whether the initial vector is randomly generated by the control unit or generated by the matching control unit, the same initial vector will be saved. Therefore, the key and the initial vector held by the control unit and the matching control unit are the same, and the preset encryption algorithm is also the same. After the control unit encrypts the sensitive data using the key and the initial vector, the matching control unit can use the key and the initial vector to decrypt the encrypted data. After the matching control unit encrypts the sensitive data using the key and the initial vector, the control unit can also use the key and the initial vector to decrypt the encrypted data.

[0054] Take the control unit as TCU and the control unit as CCU as an example. Figure 3 As shown, during the communication process, the control unit and the matching control unit may send ordinary data and sensitive data to each other. Ordinary data is sent and received according to the existing data transmission method, and sensitive data needs to be encrypted. Specifically, the TCU reads the key and initial vector in the volatile memory, and uses the key and initial vector to encrypt the sensitive data. After receiving the encrypted sensitive data, the CCU reads the key and initial vector in the volatile memory, and uses the key and initial vector to decrypt the encrypted data.

[0055] It should also be noted that if the control unit is a TCU and the matching control unit is a CCU, then the number of the CCUs may be one or more.

[0056] When there are multiple CCUs, the TCU exchanges data with each CCU separately. Before the TCU exchanges data with each CCU, it needs to follow the following steps: Figure 2 The process shown generates a set of keys and initial vectors respectively, that is, the keys and initial vectors used by the TCU and each CCU for data exchange are different.

[0057] The above introduces a data encryption method for a charging pile provided in an embodiment of the present application. The following will introduce a device for executing the data encryption method for the charging pile.

[0058] This embodiment provides a data encryption device for a charging pile, including: a transceiver unit, configured to send a first handshake signal carrying a first parameter to the matching control unit after the charging pile is powered on, and receive a second handshake signal carrying a second parameter sent by the matching control unit; A generating unit, configured to generate a key of a preset encryption algorithm based on the first parameter and the second parameter; An acquisition unit, configured to acquire an initial vector of the preset encryption algorithm, wherein the initial vector is randomly generated by the control unit or the matching control unit; An encryption unit is used to encrypt the sensitive data using the key and the initial vector before sending the sensitive data to the matching control unit.

[0059] In a possible implementation, the generating unit is specifically configured to arrange the first parameter and the second parameter in a preset order to obtain the key.

[0060] In a possible implementation, the first parameter sent by the control unit to the matching control unit each time has a different value but the same length, and the second parameter sent by the matching control unit to the control unit each time has a different value but the same length.

[0061] In a possible implementation, the first parameter is a salt value parameter, and the second parameter is a seed parameter.

[0062] In a possible implementation, the data encryption device of the charging pile further includes: A storage unit is used to store the key in a volatile memory after the key is generated, and to store the initial vector in the volatile memory after the initial vector is acquired; wherein all data stored in the volatile memory is cleared after power failure.

[0063] In a possible implementation, the encryption unit is specifically configured to read the key and the initial vector in the volatile memory, and encrypt the sensitive data using the key and the initial vector.

[0064] In a possible implementation, the sensitive data includes at least one of a charging key, a charging pile book, and a digital signature.

[0065] In a possible implementation, the data encryption device of the charging pile further includes: A decryption unit is used to receive the encrypted data sent by the matching control unit, read the key and the initial vector in the volatile memory, and decrypt the encrypted data using the key and the initial vector.

[0066] The present embodiment discloses a data encryption device for a charging pile. Each time the charging pile is powered on, the control unit in the charging pile and the corresponding matching control unit carry different key parameters when sending handshake signals to each other. The transmission of the key parameters is more concealed, which improves the security of the key parameter transmission. After the control generates a dynamic key based on the key parameters and obtains an initial vector of a preset encryption algorithm randomly generated by the control unit or the matching control unit, the control unit can use the above-mentioned key and initial vector to encrypt the sensitive data before sending the sensitive data to the matching control unit, thereby improving the security of data interaction between the control units inside the charging pile.

[0067] A control unit is also provided in an embodiment of the present application. The control unit may be a TCU or a CCU. If the control unit is a TCU, the matching control unit is a CCU. If the control unit is a CCU, the matching control unit is a TCU.

[0068] Next, the product form of the above control unit is described: refer to Figure 4 As shown, it shows a schematic diagram of a structure suitable for implementing a control unit in an embodiment of the present application. The control unit in an embodiment of the present application may include but is not limited to a single-chip microcomputer, a chip, etc. Figure 4 The control unit shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0069] like Figure 4 As shown, the control unit may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 to a random access memory (RAM) 403. When the control unit is powered on, various programs and data required for the operation of the control unit are also stored in the RAM 403. The storage device 408 may also include a volatile memory for storing keys and initialization vectors, and all data stored in the volatile memory are cleared after power failure. The processing device 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0070] Typically, an input device 406, an output device 407, a storage device 408, and a communication device 409 may be connected to the I / O interface 405. The communication device 409 may allow the control unit to communicate with other devices wirelessly or by wire to exchange data. Figure 4 A control unit having various devices is shown, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0071] The embodiment of the present application also provides a charging pile, including: a control unit and at least one matching control unit corresponding to the control unit; The control unit is communicatively connected with at least one matching control unit via a network cable; The control unit is used to implement any charging pile data encryption method provided in the embodiments of the present application.

[0072] Although not shown, the charging pile may also include components such as a charging gun, a display screen, sensors with different functions, etc., which will not be described in detail here.

[0073] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on a control unit, the control unit implements any charging pile data encryption method provided in the embodiment of the present application.

[0074] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by a control unit, the control unit can implement any charging pile data encryption method provided in an embodiment of the present application.

[0075] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0076] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0077] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0078] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A data encryption method for a charging pile, characterized in that: A control unit applied to a charging pile, the control unit corresponding to at least one matching control unit, and the data encryption method of the charging pile includes: After the charging pile is powered on, a first handshake signal carrying a first parameter is sent to the matching control unit, and a second handshake signal carrying a second parameter is received from the matching control unit; Generate a key of a preset encryption algorithm based on the first parameter and the second parameter; Acquire an initial vector of the preset encryption algorithm, wherein the initial vector is randomly generated by the control unit or the matching control unit; Before sending the sensitive data to the matching control unit, the sensitive data is encrypted using the key and the initialization vector.

2. The data encryption method of the charging pile according to claim 1, characterized in that: The generating a key of a preset encryption algorithm based on the first parameter and the second parameter includes: The first parameter and the second parameter are arranged in a preset order to obtain the key, wherein the matching control unit also arranges the first parameter and the second parameter in the preset order to obtain the key.

3. The data encryption method of the charging pile according to claim 1, characterized in that: The first parameter sent by the control unit to the matching control unit each time has a different value but the same length, and the second parameter sent by the matching control unit to the control unit each time has a different value but the same length.

4. The data encryption method of the charging pile according to claim 1, characterized in that: The first parameter is a salt value parameter, and the second parameter is a seed parameter.

5. The data encryption method for a charging pile according to any one of claims 1 to 4, characterized in that: The data encryption method of the charging pile also includes: After the key is generated, the key is stored in a volatile memory, and after the initial vector is acquired, the initial vector is stored in the volatile memory; Wherein, all data stored in the volatile memory are cleared after power failure.

6. The data encryption method of the charging pile according to claim 5, characterized in that: The encrypting the sensitive data by using the key and the initial vector includes: The key and the initialization vector in the volatile memory are read, and the sensitive data is encrypted using the key and the initialization vector.

7. The data encryption method of the charging pile according to claim 6, characterized in that: The sensitive data includes at least one of a charging key, a charging pile book and a digital signature.

8. The data encryption method of the charging pile according to claim 5, characterized in that: The data encryption method of the charging pile also includes: The encrypted data sent by the matching control unit is received, the key and the initial vector in the volatile memory are read, and the encrypted data is decrypted using the key and the initial vector.

9. The data encryption method of the charging pile according to claim 1, characterized in that: The data encryption method of the charging pile also includes: When it is detected that the matching control unit is offline, the method returns to the step of sending a first handshake signal carrying a first parameter to the matching control unit and receiving a second handshake signal carrying a second parameter sent by the matching control unit.

10. A control unit, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the control unit can implement the data encryption method of the charging pile as described in any one of claims 1 to 9.

11. A charging pile, characterized in that: include: A control unit and at least one matching control unit corresponding to the control unit; The control unit is communicatively connected with at least one matching control unit via a network cable; The control unit is used to implement the data encryption method for the charging pile as described in any one of claims 1 to 9.

12. A computer program product, characterized in that It includes computer-readable instructions. When the computer-readable instructions are executed on a control unit, the control unit implements the data encryption method for a charging pile as described in any one of claims 1 to 9.

13. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by the control unit, the control unit can implement the data encryption method for the charging pile as described in any one of claims 1 to 9.