Electric bicycle key module communication mutual recognition and tamper-proofing method
By serving at electric bicycles, the ECU loaded and compared the communication mutual identification information of key modules, leading the communication mutual recognition, solving the problem of insufficient communication between the communication between key modules of electric bicycles, and realizing the security protection of electric bicycles.
Patent Information
- Application Number
- CN202411453556.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-28
AI Technical Summary
The lack of effective communication mutual recognition mechanism between key modules of existing electric bicycles is easy to be tampered with, resulting in safety hazards.
When the electric bicycle is powered on, the ECU loads the communication mutual identification information of all key modules stored in all key modules in the register, and the communication between the communication between the key modules is dominated by the RS485 MODBUS RTU protocol. The key module is illegally modified and cannot be ride on the electricity normally.
Effective communication between the key modules of electric bicycles is realized to prevent illegal modifications and avoid hidden dangers brought about by the tampering of key modules of electric bicycles.
Smart Images

Figure CN119382954A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of electric bicycles, and in particular to a communication mutual recognition and tamper-proof method for key modules of an electric bicycle. Background Art
[0002] With the popularity of electric bicycles, the safety of vehicles has become a focus of attention for consumers and manufacturers. The key modules of electric bicycles, such as the electronic control unit (ECU), controller, battery, and motor, need to communicate with each other during operation to ensure the normal operation of the vehicle. However, these key modules are susceptible to tampering, leading to safety hazards. Therefore, it is particularly important to design a system that can achieve mutual recognition and tamper-proof communication between key modules.
[0003] In the prior art, some key modules of electric bicycles lack an effective communication mutual recognition mechanism, which makes it easy for criminals to tamper with the modules or forge signals to perform illegal operations, thereby causing safety accidents. In addition, the existing anti-tampering system can be illegally modified by simply replacing the key modules of electric bicycles, which poses a great safety hazard. Summary of the invention
[0004] One of the purposes of the present invention is to provide a method for mutual recognition and tamper-proofing of key modules of an electric bicycle, which can achieve mutual recognition of communication when the electric bicycle is powered on and avoid the safety hazards caused by tampering of the key modules of the electric bicycle.
[0005] A method for mutual recognition and tamper-proofing of key modules of an electric bicycle, comprising the following steps:
[0006] S1. When the electric bicycle is powered on, the ECU loads the communication and mutual recognition information of all key modules stored in the read-only register;
[0007] S2. The communication mutual recognition between key modules is dominated by the ECU, and the ECU sends a communication mutual recognition request message to the remaining key modules except the ECU;
[0008] S3. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition number from the read-write register storing the communication mutual recognition request number, and returns the communication mutual recognition number response message in response to the ECU's request;
[0009] S4. After receiving the communication mutual recognition number response message from each key module, the ECU compares the number. If the communication mutual recognition number returned by any key module differs from that of other key modules by five times or more, a warning message is output;
[0010] S5. ECU sends a communication mutual recognition request message and a communication mutual recognition request times update message to the remaining key modules respectively;
[0011] S6. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition identification information from the read-only register, responds to the ECU's request, and returns a communication mutual recognition response message;
[0012] S7. If the communication and mutual recognition of all key modules are successful, it will be prompted that the electric bicycle is powered on successfully, riding is allowed, and the owner circuit of the electric bicycle is turned on. If the communication and mutual recognition of any key module fails, it will be prompted that the electric bicycle is powered on unsuccessfully, and riding is not allowed.
[0013] When the electric bicycle is powered on, the key modules communicate and recognize each other. If any key module is illegally modified, the electric bicycle cannot be powered on and ridden normally, thus avoiding the potential safety hazards caused by tampering with the key modules of the electric bicycle.
[0014] The present invention also has the following preferred design:
[0015] The key modules of the present invention include ECU, controller, battery and motor.
[0016] The communication mutual recognition identification information of the present invention is a cryptographic hash function value, namely, an MD5 code. The value of the MD5 code is generated in a manner specified by the manufacturer. After generation, each key module uses a read-only register to store the MD5 code value, which is read and used during communication mutual recognition.
[0017] The communication between the key modules of the present invention adopts RS485 Modbus RTU protocol, and the inline communication rate can adopt 9600 baud rate, 115200 baud rate or 38400 baud rate, etc.
[0018] The present invention selects ECU as the host and other key modules as slaves.
[0019] The communication between the key modules of the present invention adopts a three-layer simplified ISO / OSI reference model of an application layer, a data link layer and a physical layer.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] 1. When the electric bicycle is powered on, the key modules communicate and recognize each other. If any key module is illegally modified, the electric bicycle cannot be powered on and ridden normally, thus avoiding the potential safety hazards caused by tampering with the key modules of the electric bicycle.
[0022] 2. Each key module of the present invention uses a read-only register to store communication mutual recognition information, which can prevent criminals from performing illegal operations by tampering with the module or forging signals. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1A control flow chart of a method for mutual recognition and tamper-proofing of key modules of an electric bicycle provided by the present invention;
[0024] Figure 2 It is a serial communication model between key modules of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the present invention more obvious, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described herein. Based on the embodiments of the present invention described in the present invention, all other embodiments obtained by those skilled in the art without creative work should fall within the protection scope of the present invention.
[0026] In the following description, a large number of specific details are provided to provide a more thorough understanding of the present invention. However, it is apparent to those skilled in the art that the present invention can be implemented without one or more of these details. In other examples, in order to avoid confusion with the present invention, some technical features well known in the art are not described.
[0027] It should be understood that the present invention can be implemented in different forms and should not be interpreted as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to make the disclosure thorough and complete and to fully convey the scope of the present invention to those skilled in the art.
[0028] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present invention. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0029] In order to fully understand the present invention, a detailed structure will be presented in the following description to illustrate the technical solution proposed by the present invention. The optional embodiments of the present invention are described in detail as follows, but in addition to these detailed descriptions, the present invention may also have other implementations.
[0030] like Figure 1 As shown, a method for mutual recognition and tamper-proofing of key modules of an electric bicycle comprises the following steps:
[0031] S1. When the electric bicycle is powered on, the ECU loads the communication and mutual recognition information of all key modules stored in the read-only register;
[0032] S2. The communication mutual recognition between key modules is dominated by the ECU, and the ECU sends a communication mutual recognition request message to the remaining key modules except the ECU;
[0033] S3. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition number from the read-write register storing the communication mutual recognition request number, and returns the communication mutual recognition number response message in response to the ECU's request;
[0034] S4. After receiving the communication mutual recognition number response message from each key module, the ECU compares the number. If the communication mutual recognition number returned by any key module differs from that of other key modules by five times or more, a warning message is output;
[0035] S5. ECU sends a communication mutual recognition request message and a communication mutual recognition request times update message to the remaining key modules respectively;
[0036] S6. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition identification information from the read-only register, responds to the ECU's request, and returns a communication mutual recognition response message;
[0037] S7. If the communication and mutual recognition of all key modules are successful, it will be prompted that the electric bicycle is powered on successfully, riding is allowed, and the owner circuit of the electric bicycle is turned on. If the communication and mutual recognition of any key module fails, it will be prompted that the electric bicycle is powered on unsuccessfully, and riding is not allowed.
[0038] In one embodiment, the key modules include an ECU, a controller, a battery, and a motor, which are used to protect the above key modules from being tampered with, thereby avoiding potential safety hazards caused by tampering with the key modules of the electric bicycle.
[0039] In one embodiment, the communication mutual recognition identification information is a cryptographic hash function value, namely, an MD5 code. The value of the MD5 code is generated in a manner specified by the manufacturer. After generation, each key module uses a read-only register to store the MD5 code value, which is read and used during communication mutual recognition.
[0040] In one embodiment, the communication between key modules adopts RS485 Modbus RTU protocol, and the inline communication rate can adopt 9600 baud rate, 115200 baud rate or 38400 baud rate, etc.
[0041] According to RS485 Modbus RTU protocol, select ECU as the master and other key modules as slaves.
[0042] In one embodiment, if Figure 2 As shown in Table 1, the communication between key modules adopts the three-layer simplified ISO / OSI reference model of application layer, data link layer and physical layer.
[0043] Table 1: Serial communication protocol model
[0044]
[0045] Among them, the physical layer:
[0046] RS485 serial electrical interface requirements:
[0047] a) The driving and receiving ends are resistant to electrostatic discharge (ESD) ±15kV (human body model);
[0048] b) Common mode input voltage: (-7~12)V; Differential mode input voltage: greater than 0.2V;
[0049] c) Drive output voltage: at load impedance 54Ω, maximum 5V, minimum 1.5V; three-state output;
[0050] d) Half-duplex communication mode: driving capability is not less than 32 similar interfaces;
[0051] e) Communication speed: no check, 1 stop bit, communication in big-endian mode. The bus is passive, and the system power supply provides power to each RS485 node.
[0052] RS485 communication is a half-duplex communication. Sending and receiving share the same physical channel. Only one node is allowed to be in the sending state at any time. The agreement is as follows:
[0053] a) Each slave device strictly complies with the session mode requirements and timing requirements and shall not occupy the bus for a long time;
[0054] b) Each node on the bus can add a bus conflict detection circuit. When a bus conflict is detected for a long time, it is necessary to start its own software repair mechanism to eliminate the software reasons that cause the bus to be in a conflict state.
[0055] Data Link Layer:
[0056] Frame format:
[0057] The frame format consists of: slave node address, function code, data content, and checksum.
[0058] Slave node address:
[0059] As shown in Table 2, the node address consists of 1 byte. The legal node address is 1-247, and the broadcast address is 0.
[0060] Table 2: Slave node address allocation
[0061] Slave Node Test Node Controller Battery Motor address 0x01 0x03 0x05 0x09
[0062] Function code:
[0063] As shown in Table 3, the function code consists of 1 byte and indicates the action to be performed.
[0064] Table 3: Function code
[0065] Function code Functional Description use 0x03 Read Register Read the specified register 0x01 Write Register Write data to the specified register
[0066] Data content:
[0067] The data content consists of N bytes, with a minimum of 0 bytes and a maximum of 252 bytes. The specific meaning is defined according to the function code.
[0068] The data content is defined differently according to different function code formats, and each function code is divided into request data packets and response data packets.
[0069] The data contents are shown in Tables 4 to 9:
[0070] Table 4: Data content format of read register request
[0071] Field Definition length Register start address high byte 1byte Register start address low byte 1byte Register number high byte 1byte Register number low byte 1byte
[0072] Table 5: Data content format of read register response
[0073]
[0074]
[0075] Table 6: Data content format of write register request
[0076] Field Definition length Register start address high byte 1byte Register start address low byte 1byte Register number high byte 1byte Register number low byte 1byte Number of bytes 1byte Data 1 high byte 1byte Data 1 low byte 1byte … … Data N high byte 1byte Data N low byte 1byte
[0077] Table 7: Data content format of write register response
[0078] Field Definition length Register start address high byte 1byte Register number high byte 1byte Register number low byte 1byte
[0079] Table 8: Slave register definition
[0080] Register Address Number of registers Data Types Read and write permissions Data Description 0xA000 2 32bit Read-only Device Type 0xA008 2 8bit Read-only Slave version number 0xA00A 1 8bit Read-only Slave Hardware Version 0xA00B 8 String(32bit) Read-only From the machine manufacturer information 0xA02B 8 String(32bit) Read-only Communication mutual recognition information 0xA04B 1 16bit Read and Write Communication request times 0xA04D 1 8bit Read-only Model Number 0XA04E 4 8bit Read-only reserve
[0081] Table 9: Host register definition
[0082] Register Address Number of registers Data Types Read and write permissions Data Description 0xA000 2 32bit Read-only Device Type 0xA008 2 8bit Read-only Host version number 0xA00A 1 8bit Read-only Host hardware version 0xA00B 8 String(32bit) Read-only Host manufacturer information 0xA02B 32 String(32bit) Read-only Communication mutual recognition information 0xA0AB 1 16bit Read and Write Communication request times 0xA0AD 1 8bit Read-only Model Number 0XA0AE 4 8bit Read-only reserve
[0083] Application examples:
[0084] 1. Power on and load the communication mutual recognition information.
[0085] When the electric bicycle is powered on, the ECU loads the communication mutual recognition information in the read-only registers of each key module.
[0086] 2. ECU sends a communication mutual recognition request message.
[0087] The ECU sends a communication mutual recognition request message to other key modules.
[0088] 3. Other key modules respond to the communication mutual recognition request.
[0089] Key module A reads the stored communication mutual recognition times: for example, 5 times.
[0090] Key module B reads the stored communication mutual recognition times: for example, 5 times.
[0091] The key module C reads the stored communication mutual recognition times: for example, 5 times.
[0092] Each key module packages the number of reads into a response message and returns it to the ECU.
[0093] 4. ECU compares the number of communication mutual recognitions.
[0094] The ECU compares the number of communication mutual recognition times returned by each key module. If the number of times returned by a key module (such as 10 times) is abnormally different from the number of times returned by other key modules, the ECU outputs a warning message.
[0095] 5. ECU sends communication mutual recognition request message and update message.
[0096] The ECU sends communication mutual recognition request messages and update messages to each key module, requiring each key module to communicate mutually and update the number of records.
[0097] 6. Other key modules respond to communication mutual recognition requests.
[0098] Key module A reads the communication mutual recognition identification information and returns the communication mutual recognition response message.
[0099] Key module B reads the communication mutual recognition identification information and returns the communication mutual recognition response message.
[0100] The key module C reads the communication mutual recognition identification information and returns the communication mutual recognition response message.
[0101] Each module records the new number of communication mutual recognitions, for example, 6 times.
[0102] 7. Power-on success prompt
[0103] If the communication and mutual recognition of all key modules are successful, the ECU prompts that the electric bicycle is powered on successfully, allowing riding, and starts the main circuit of the electric bicycle.
[0104] 8. Power-on failure prompt
[0105] If the communication and mutual recognition of any key module fails, the ECU will prompt that the electric bicycle has failed to power on, riding is not allowed, and the main circuit of the electric bicycle will not be turned on.
[0106] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for mutual recognition and tamper-proof communication of key modules of an electric bicycle, characterized in that: The following steps are involved: S1. When the electric bicycle is powered on, the ECU loads the communication and mutual recognition information of all key modules stored in the read-only register; S2. The communication mutual recognition between key modules is dominated by the ECU, and the ECU sends a communication mutual recognition request message to the remaining key modules except the ECU; S3. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition number from the read-write register storing the communication mutual recognition request number, and returns the communication mutual recognition number response message in response to the ECU's request; S4. After receiving the communication mutual recognition number response message from each key module, the ECU compares the number. If the communication mutual recognition number returned by any key module differs from that of other key modules by five times or more, a warning message is output; S5. ECU sends a communication mutual recognition request message and a communication mutual recognition request times update message to the remaining key modules respectively; S6. After receiving the communication mutual recognition request message, each key module reads the stored communication mutual recognition identification information from the read-only register, responds to the ECU's request, and returns a communication mutual recognition response message; S7. If the communication and mutual recognition of all key modules are successful, it will be prompted that the electric bicycle is powered on successfully, riding is allowed, and the owner circuit of the electric bicycle is turned on. If the communication and mutual recognition of any key module fails, it will be prompted that the electric bicycle is powered on unsuccessfully, and riding is not allowed.
2. The method for mutual recognition and tamper-proofing of key modules of an electric bicycle according to claim 1, characterized in that: The key modules include ECU, controller, battery and motor.
3. The method for mutual recognition and tamper-proofing of key modules of an electric bicycle according to claim 2, characterized in that: The communication mutual recognition identification information is a cryptographic hash function value, namely, an MD5 code. The value of the MD5 code is generated in a manner specified by the manufacturer. After generation, each key module uses a read-only register to store the MD5 code value, which is read and used during communication mutual recognition.
4. The method for mutual recognition and tamper-proofing of key modules of an electric bicycle according to claim 3, characterized in that: The communication between key modules adopts RS485 Modbus RTU protocol, and the inline communication rate can adopt 9600 baud rate, 115200 baud rate or 38400 baud rate, etc.
5. The method for mutual recognition and tamper-proofing of key modules of an electric bicycle according to claim 4, characterized in that: Select ECU as the master and other key modules as slaves.
6. The method for mutual recognition and tamper-proofing of key modules of an electric bicycle according to claim 5, characterized in that: The communication between key modules adopts the three-layer simplified ISO / OSI reference model of application layer, data link layer and physical layer.