Charging control method of electric moped and electric moped
By collaboratively determining the charging start time through IoT smart locks and battery management systems, and combining the power conversion control system and CAN bus communication system, fully automatic intelligent charging of electric bicycles is achieved, solving the problem of poor user experience in traditional charging management and improving user convenience and economy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU RIMSEA TECH CO LTD
- Filing Date
- 2026-01-16
- Publication Date
- 2026-04-28
AI Technical Summary
The charging management of electric bicycles is traditional and passive. Users need to manually check the peak and off-peak electricity prices of the power grid to charge their vehicles, resulting in a poor user experience. Furthermore, there is a lack of efficient collaboration between various hardware modules, making it difficult to achieve refined energy management.
By acquiring electricity price information during specific time periods through IoT smart locks and combining it with the status information of the battery management system, the charging start time is automatically determined. Fully automatic intelligent charging scheduling is achieved through the power conversion control system. Two sets of power conversion branches are designed to support different charging interfaces. A modular communication system based on CAN bus is constructed to realize real-time data interaction and intelligent decision-making among multiple modules.
It achieves fully automatic intelligent charging scheduling, allowing users to save on electricity bills by taking advantage of off-peak electricity prices without manual intervention, improving convenience and economy, and enhancing the system's synergy and user experience.
Smart Images

Figure CN121929010A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electric bicycle technology, and more specifically, to a charging control method for an electric bicycle and an electric bicycle. Background Technology
[0002] Currently, electric bicycles have become an important tool for short-distance urban travel due to their green and convenient characteristics. However, their charging management methods remain relatively traditional and passive. In daily use, to save on electricity bills, users usually need to check the peak and off-peak electricity prices on the power grid and manually charge their bikes only during off-peak hours. This process is cumbersome, relies heavily on user initiative, and offers a poor user experience. Summary of the Invention
[0003] In view of the above, the purpose of this application is to provide a charging control method for an electric-assisted vehicle and an electric-assisted vehicle, which aims to overcome at least one of the above-mentioned defects.
[0004] In a first aspect, this application provides a charging control method for an electric-assisted bicycle, the method comprising: In response to the establishment of a charging connection by the electric-assisted vehicle, the system obtains electricity price and time period information queried by the IoT smart lock of the electric-assisted vehicle, as well as battery status information monitored by the battery management system of the electric-assisted vehicle. The charging start time is determined based on the electricity price period information, the battery status information, and the current time. During the charging start time, a control signal is sent to the power conversion control system of the electric-assisted vehicle to start charging the battery of the electric-assisted vehicle.
[0005] In one possible implementation, the charging start-up time is determined in the following way: Determine if the current time falls within the time period specified in the electricity price time period information; If the current time is at the lowest point in the electricity price period information and the remaining power in the battery status information is lower than the preset power value, then the current time is determined as the charging start time; If the current time is during a peak period in the electricity price information, then determine whether charging of the battery has already started; If charging of the battery has already started, stop charging the battery first, and determine the start time of the next valley period as the charging start time; If charging of the battery is not initiated, the start time of the next valley period is determined as the charging start time.
[0006] In one possible implementation, the power conversion control system includes at least one power conversion branch, each power conversion branch being connected between a corresponding charging interface and the battery, wherein charging of the battery is initiated in the following manner: A control signal is sent to the target power conversion branch corresponding to the charging interface that establishes a charging connection, driving the switching device group of the target power conversion branch to perform switching actions, thereby converting the power from the charging interface into power adapted to the battery.
[0007] In one possible implementation, the at least one power conversion branch includes a first power conversion branch and a second power conversion branch. The first power conversion branch is connected to a first charging interface, which is used to connect a dedicated adapter. The second power conversion branch is connected to a second charging interface, which is used to connect a PD adapter.
[0008] In one possible implementation, each power conversion branch includes an inductor and two dual-switch transistor groups. The first end of each dual-switch transistor group is connected to the corresponding charging interface, and the second ends of the two dual-switch transistor groups are connected to the battery through the inductor in series.
[0009] In one possible implementation, it also includes: The electric-assisted bicycle periodically communicates with the battery management system and the IoT smart lock via the CAN bus of the controller area network. If no heartbeat packet is received from the battery management system or the IoT smart lock within a preset time, a communication abnormality is determined, and the corresponding processing procedure is triggered.
[0010] In one possible implementation, it also includes: After charging is initiated, battery status information monitored by the battery management system is continuously acquired. If an abnormality is detected in the battery status information, a protection command is generated and sent to the power conversion control system to stop charging.
[0011] Secondly, this application provides an electric-assisted bicycle, the electric-assisted bicycle comprising: The control unit is configured to perform the charging control method as described in the first aspect.
[0012] Thirdly, this application also provides an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method described above are performed.
[0013] Fourthly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method described above.
[0014] This application provides a charging control method for an electric-assisted bicycle and the electric-assisted bicycle itself. The method includes: in response to the electric-assisted bicycle establishing a charging connection, acquiring electricity price time information queried by the electric-assisted bicycle's IoT smart lock and battery status information monitored by the electric-assisted bicycle's battery management system; determining a charging start time based on the electricity price time information, the battery status information, and the current time; and sending a control signal to the electric-assisted bicycle's power conversion control system at the charging start time to initiate charging of the electric-assisted bicycle's battery. This application achieves fully automatic intelligent charging scheduling, allowing users to save on electricity costs by taking advantage of off-peak electricity prices without manual intervention, greatly improving convenience and economy.
[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the CAN communication control and data interaction system provided in the embodiments of this application; Figure 2 This illustration shows a schematic diagram of the correspondence between data layer sub-modules and structures provided in an embodiment of this application; Figure 3 A flowchart illustrating a charging control method for an electric-assisted bicycle provided in an embodiment of this application; Figure 4 This is a schematic diagram of the power conversion control system provided in an embodiment of this application; Figure 5 A schematic diagram of the command processing module provided in an embodiment of this application is shown; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0019] First, the applicable scenarios for this application will be introduced. This application can be applied to the field of electric bicycle technology.
[0020] Research has found that electric-assisted bicycles, due to their green and convenient characteristics, have become an important tool for short-distance urban travel. However, their charging management methods remain relatively traditional and passive. In daily use, to save on electricity bills, users typically need to manually check the peak and off-peak electricity prices and only charge during off-peak hours. This process is cumbersome, relies heavily on user oversight, and offers a poor user experience. Furthermore, the existing onboard software systems of electric-assisted bicycles have limited functionality, and the various hardware modules (such as the Battery Management System (BMS) and Vehicle Control Unit (VCU)) lack efficient and unified data exchange and collaborative processing mechanisms. This makes it difficult to achieve real-time collection, fusion, and intelligent decision-making of vehicle status, energy information, and external electricity price signals, limiting further improvements in refined energy management and user experience.
[0021] Based on this, this application provides a charging control method for an electric-assisted bicycle and an electric-assisted bicycle, aiming to achieve fully automatic intelligent charging scheduling, so that users can save electricity costs by taking advantage of off-peak electricity prices without manual intervention, thereby improving convenience and economy.
[0022] Please see Figure 1 , Figure 1 This is a schematic diagram of the CAN communication control and data interaction system provided in an embodiment of this application. The charging control method of this application is implemented based on the CAN communication control and data interaction system. The system adopts a layered modular design, divided into a three-layer architecture: data layer, service layer, and communication layer. Each layer contains multiple functional sub-modules with clear division of labor and coordinated operation.
[0023] Specifically, the data layer, as the system's data foundation, is responsible for storing and synchronizing the raw data of each hardware module, providing data support for the business and communication layers. It includes five sub-modules: the BMS data storage sub-module specifically stores core data collected by the BMS, such as battery capacity, voltage, temperature, and charging / discharging status; the VCU data storage sub-module stores data collected by the VCU, such as power, voltage, and peripheral operating status; the IoT lock data storage sub-module stores data such as electricity price and time period information and device online status obtained by the IoT smart lock from the cloud; the system status storage sub-module stores global information such as the overall system operating status, module connection status, and anomaly markers; and the OTA data storage sub-module stores remote upgrade-related data, including firmware fragment data, CRC checksums, and upgrade status.
[0024] The business layer is the core execution layer of the system, focusing on the implementation of core functions such as data processing, command execution, status monitoring, and remote upgrades. It includes three modules: the command processing module is responsible for responding to and executing various control commands and query commands sent from the outside; the status monitoring module monitors the connection status and data validity of each module in real time, and is further divided into a heartbeat detection submodule and an exception handling submodule; the OTA upgrade module is specifically designed to implement remote upgrades of device firmware, and is further divided into an upgrade information interaction submodule, a firmware data transmission submodule, and an upgrade verification submodule.
[0025] The communication layer is the central hub for message transmission in the system. Its core responsibility is to enable data interaction between modules via the CAN bus. It consists of four sub-modules: the CAN message sending sub-module encapsulates the data stored in the data layer according to the CAN protocol and sends it to the target module; the CAN message receiving sub-module continuously monitors the CAN bus and receives messages from external or other modules; the CAN message parsing sub-module is responsible for parsing the structure of the received message, including key information such as the source node, command type, index, and data; and the CAN message acknowledgment sub-module promptly returns success or failure acknowledgment signals for the received command messages to ensure a closed communication loop.
[0026] Furthermore, such as Figure 2 As shown, Figure 2 The diagram illustrates the correspondence between data layer sub-modules and structures provided in this application embodiment. To clarify the data storage carrier of each module, each data layer sub-module corresponds to a dedicated data structure.
[0027] The BMS data storage submodule corresponds to two structures. The first is the core data structure Can1_BMS_Info, which stores processed BMS core parameters such as total battery capacity, remaining capacity, voltage, temperature, and charging / discharging MOSFET status. The second is the raw data structure Bms_data_info, which is used to temporarily store unprocessed raw data directly collected by the BMS hardware. The two work together to achieve hierarchical storage and synchronization of BMS data.
[0028] The VCU data storage submodule corresponds to the structure Can1_VCU_Info, which stores data such as MPPT power, photovoltaic voltage, peripheral operating status, protection and fault flags collected by the VCU. It is the core data carrier of the VCU's operating status.
[0029] The corresponding structure Can1_Iot_Info in the IoT lock data storage submodule stores data such as peak and off-peak electricity price information, device online status, and charging request instructions obtained by the IoT smart lock from the cloud, providing external information support for charging scheduling.
[0030] The system status storage submodule corresponds to the structure Can1_SYS_Info, which stores global status information such as the module connection status, exception type, and exception occurrence time of the entire system. It is the basic data source for system status monitoring.
[0031] The OTA data storage submodule corresponds to the structure Ota_Date_Buff, which stores remote upgrade-related data such as firmware fragment data, firmware length, and CRC checksum, supporting data transmission and verification during the OTA upgrade process.
[0032] Please see Figure 3 , Figure 3 This is a flowchart illustrating a charging control method for an electric-assisted bicycle provided in an embodiment of this application. Figure 3 As shown in the embodiments of this application, the charging control method for an electric-assisted bicycle includes: S101. In response to the establishment of a charging connection by the electric-assisted vehicle, obtain the electricity price period information queried by the IoT smart lock of the electric-assisted vehicle, and the battery status information monitored by the battery management system of the electric-assisted vehicle.
[0033] Here, the IoT smart lock is equipped with a network communication module (such as a 4G or Bluetooth module) as an information gateway between the vehicle and the cloud server. The IoT smart lock queries electricity price information in the following way: it connects to the cloud server via the network communication module, and the cloud server collects the State Grid peak-valley electricity price information for the current location of the electric bicycle and feeds it back to the IoT smart lock. The IoT smart lock obtains continuous power from the vehicle's electrical system, ensuring its long-term online operation. The queried electricity price information is sent to the vehicle control unit (VCU) via the controller area network bus.
[0034] The Battery Management System (BMS) monitors the battery's core status parameters in real time, including total capacity, remaining capacity, voltage, temperature, and charge / discharge status indicators. These parameters are periodically updated to dedicated data structures within the VCU (such as the core structure Can1_BMS_Info corresponding to the data layer BMS data storage submodule), forming the battery status information. The raw data collected by the BMS hardware is temporarily stored in the raw data structure Bms_data_info of this submodule, and after processing, it is synchronized to Can1_BMS_Info.
[0035] S102. Determine the charging start time based on electricity price period information, battery status information, and the current time.
[0036] In this embodiment, the charging start time is determined as follows: the current time falls within a time period specified in the electricity price information; if the current time falls within a low-price period and the remaining battery power in the battery status information is lower than a preset power value, then the current time is determined as the charging start time; if the current time falls within a high-price period, then it is determined whether battery charging has already started; if battery charging has already started, charging is stopped, and the start time of the next low-price period is determined as the charging start time; if battery charging has not started, the start time of the next low-price period is determined as the charging start time.
[0037] Here, the intelligent charging mode of the electric-assisted bicycle operates based on the charging start time determined above. During the off-peak electricity price period, the power conversion branch is controlled to be turned on, so that the adapter starts charging. During the non-off-peak electricity price period, the power conversion branch is controlled to be turned off, so that charging stops. This fully utilizes the peak-valley electricity price difference to save electricity costs for consumers. This energy-saving effect is more significant, especially in areas with high electricity prices.
[0038] S103. At the charging start time, a control signal is sent to the electric power conversion control system of the electric-assisted vehicle to start charging the battery of the electric-assisted vehicle.
[0039] like Figure 4 As shown, Figure 4This is a schematic diagram of the power conversion control system provided in an embodiment of this application. In this embodiment, the power conversion control system includes at least one power conversion branch, each power conversion branch being connected between a corresponding charging interface and a battery. The at least one power conversion branch includes a first power conversion branch and a second power conversion branch. The first power conversion branch is connected to a first charging interface, which is used to connect a dedicated adapter. The second power conversion branch is connected to a second charging interface, which is used to connect a PD adapter. Each power conversion branch includes an inductor and two dual-switch transistor groups. The first end of each dual-switch transistor group is connected to the corresponding charging interface, and the second ends of the two dual-switch transistor groups are connected to the battery via an inductor connected in series.
[0040] Specifically, the power conversion control system is the hardware foundation for realizing power access, conversion, and management. This system includes at least two power conversion branches, each corresponding to a different charging interface and adapter. The at least two power conversion branches include a first power conversion branch and a second power conversion branch. The first power conversion branch connects to a first charging interface (such as a PV interface) for connecting a dedicated adapter. The second power conversion branch connects to a second charging interface (such as a TYPE-C interface) for connecting a universal USB PD (Power Delivery) adapter.
[0041] Specifically, the first power conversion branch is the first MPPTBUCK-BOOST circuit, including a first NMOS transistor S1, a second NMOS transistor S2, a third NMOS transistor S3, a fourth NMOS transistor S4, a first capacitor C1, a second capacitor C2, and a first inductor L1; the dedicated adapter, i.e., the first standard adapter, is connected to the power grid and the first photovoltaic interface PV1. The first capacitor C1 is connected to both ends of PV1, the drain (D) of the first NMOS transistor is connected to the positive terminal of C1, and the source (S) of the first NMOS transistor is connected to the positive terminal of C1. The drain (D) of the second NMOS transistor is connected to the source (S) of the second NMOS transistor, which is connected to the negative terminal of C1. The first end of the first inductor L1 is connected to the junction of the first and second NMOS transistors, and the second end of the first inductor L1 is connected to the junction of the third and fourth NMOS transistors. The drain (D) of the third NMOS transistor is connected to the positive terminal of C2, and the source (S) of the fourth NMOS transistor is connected to the negative terminal of C2. The positive terminal of C2 is connected to the positive terminal BAT+ of the battery pack, and the negative terminal of C2 is connected to the negative terminal BAT- of the battery pack.
[0042] The second power conversion branch is the second MPPTBUCK-BOOST circuit, which includes the fifth NMOS transistor S5, the sixth NMOS transistor S6, the seventh NMOS transistor S7, the eighth NMOS transistor S8, the third capacitor C3, the fourth capacitor C4, and the second inductor L2; the PD adapter, i.e. the second standard adapter, is connected to the power grid and the second photovoltaic interface PV2. The subsequent circuit connections are the same as the first MPPTBUCK-BOOST circuit, and will not be elaborated further here.
[0043] The power conversion control system also includes a bidirectional DC-DC circuit, which includes a ninth NMOS transistor S9, a tenth NMOS transistor S10, an eleventh NMOS transistor S11, a twelfth NMOS transistor S12, a fifth capacitor C5, a sixth capacitor C6, and a third inductor L3. The positive and negative terminals of the fifth capacitor C5 are connected to the positive terminal BAT+ and the negative terminal BAT- of the battery pack, respectively. Its circuit connection is consistent with the MPPTBUCK-BOOST circuit mentioned above. The two ends of the sixth capacitor C6 are connected to the Type-C interface, which is connected to the PD adapter.
[0044] In this embodiment, battery charging is initiated by sending a control signal to the target power conversion branch corresponding to the charging interface with which the charging connection is established. This drives the switching device group (NMOS transistors) of the target power conversion branch to perform switching operations, thereby converting the electrical energy from the charging interface into electrical energy suitable for the battery. The control signal is issued by an ARM controller or a TYPE-C controller. Depending on the type of the target power conversion branch (MPPTBUCK-BOOST circuit or bidirectional DC-DC circuit), the corresponding controller sends a PWM drive signal to the NMOS transistors of that branch, precisely controlling the switching operation of the NMOS transistors to achieve voltage boost conversion. This ensures that the output electrical energy is adapted to the battery's voltage requirements, thus completing the charging initiation process.
[0045] Specifically, when the dedicated adapter (the first standard adapter) is plugged into the power grid socket, the dedicated adapter converts the AC power into a stable DC voltage and outputs it to the PV interface; the ARM controller sends PWM drive signals to the four NMOS transistors of the two MPPTBUCK-BOOST circuits, and the DC voltage is boosted to the voltage required by the battery through the BUCK-BOOST circuit, thereby charging the battery. At this time, the grid energy is converted into DC power through the adapter, and the DC current flows to the battery after being converted by the BUCK-BOOST.
[0046] When a 100W PD adapter is plugged into a mains socket, the PD adapter converts the AC power from the mains into a stable DC voltage and outputs it to the TYPE-C interface. The TYPE-C controller drives the four NMOS transistors of the BUCK-BOOST circuit to boost the voltage to the voltage required by the battery and charge the battery. The electrical energy is converted into DC power by the PD adapter, and the DC current flows to the battery after being converted by the BUCK-BOOST.
[0047] In this embodiment of the application, it further includes: periodically communicating with the battery management system and the IoT smart lock via the CAN bus of the electric-assisted vehicle's controller area network; if no heartbeat packet is received from the battery management system or the IoT smart lock within a preset time, the communication is determined to be abnormal, and the corresponding processing procedure is triggered.
[0048] Here, the communication monitoring function is implemented through the status monitoring module, which includes a heartbeat detection submodule and an anomaly handling submodule.
[0049] Heartbeat transmission: The general information transmission submodule in the CAN message transmission module triggers the heartbeat packet transmission function (Can1_HeartBeat_Send_Prd()) every 10 seconds to generate a heartbeat packet containing an incrementing counter. The heartbeat packet is then sent to the BMS node (NODE_BMS1) and the VCU node (NODE_VCU) through the CAN1 message transmission function (CAN1_SendMessage()) to inform the receiver of the online status of this node.
[0050] Heartbeat reception and timeout detection: The heartbeat detection submodule listens for heartbeat packets from the BMS and IOT smart lock through the CAN message receiving and parsing module. When a heartbeat packet from another node is received, the timeout counter of the corresponding node is reset (e.g., the BMS heartbeat counter for the BMS node and the IOT heartbeat counter for the IOT smart lock). If the timeout counter of a certain node exceeds the preset threshold (20 cycles, i.e., 200s) without being reset, the node is marked as disconnected (e.g., the BMS connection flag and IOT connection flag in the Can1_SYS_Info structure are set to 0).
[0051] When the heartbeat detection submodule marks a communication interruption (such as a disconnection of the BMS or IoT smart lock), or when the data acquisition and refresh module detects data anomalies (such as battery voltage exceeding the normal range or power data anomalies), the abnormal situation is marked, the anomaly type (communication interruption or data anomaly) and the time of occurrence are recorded in the Can1_SYS_Info structure, and the corresponding processing flow is triggered, such as pausing charging or sending an anomaly reminder to the user's APP.
[0052] In this embodiment of the application, in order to ensure real-time data interaction and accurate command transmission among multiple modules such as BMS, VCU, and IoT smart lock of the electric-assisted bicycle, a complete communication process is constructed with CAN bus as the core communication carrier. Each module achieves efficient collaborative work through the following process.
[0053] The CAN message sending module, as the core of data output, is responsible for encapsulating and sending various raw data acquired by the data acquisition and refresh module according to the CAN protocol format. Its BMS information sending submodule, VCU information sending submodule, and general information sending submodule each perform their own functions.
[0054] The BMS information transmission submodule uses the BMS capacity periodic transmission function (Can1_BMS_Capacity_Prd()) to encapsulate total capacity, remaining capacity, and other data into a CAN message with index 0x3400 every 200ms and transmits it. The data format is "total capacity high 8 bits + total capacity low 8 bits + remaining capacity high 8 bits + remaining capacity low 8 bits + relative capacity high 8 bits + relative capacity low 8 bits + temperature high 8 bits + temperature low 8 bits". It uses the BMS power periodic transmission function (Can1_BMS_Power_Prd()) to transmit current, voltage, and temperature data with index 0x3401 every 100ms. It uses the BMS status periodic transmission function (Can1_BMS_State_Prd()) to transmit BMS status flags (such as charging / discharging status) with index 0x3402 every 500ms. During transmission, an 8-byte data array is initialized first, and the parameters in the Can1_BMS_Info structure are split byte-by-byte and stored in the array. Then, the CAN1 message transmission function is called, specifying the target node, the write command (CMD_WRITE), and the corresponding index to complete the transmission.
[0055] The working logic of the VCU information sending submodule is consistent with that of the BMS information sending submodule. It sends MPPT1 / 2 power and Type-C power data with index 0x3B10 every 100ms through the VCU power periodic sending function (Can1_VCU_Power_Prd()), and photovoltaic voltage, battery voltage, and other data with index 0x3B11 every 200ms through the VCU voltage periodic sending function (Can1_VCU_Vol_Prd()). It sends protection flags (such as overvoltage protection) and fault flags (such as sensor errors) every 500ms through the VCU protection information periodic sending function (Can1_VCU_ProtectInfo_PRD()) and the VCU error information periodic sending function (Can1_VCU_ErrorInfo_PRD()). All of these functions read parameters from the Can1_VCU_Info structure and encapsulate them for sending.
[0056] In addition to sending a heartbeat packet containing an incrementing counter every 10 seconds to inform other modules of the node's online status, the general information sending submodule is also responsible for sending command responses. When it receives an external command (such as querying cell information, voltage setting commands, etc.) and executes the corresponding logic, it returns a success response (CMD_ACK_NORMAL) or a failure response (CMD_ACK_ERROR) through the CAN1 message sending function.
[0057] The CAN message receiving and parsing module, which serves as the central hub of system communication, includes a command parsing submodule and a data distribution submodule. Its core process is as follows: when the CAN controller receives a message, it triggers an interrupt and calls the CAN1 receive and parsing function (CAN1_Receice_Analysis()). This function first parses the message ID (cb_id), extracts the 5-bit source node (src_node=(cb_id>>24)&0x1F), the destination node (dest_node), the 3-bit command type (cmd=(cb_id>>16)&0x07), and the 16-bit index (index=cb_id&0xFFFF), and then reads the message data (Can_Data) and data length (Can_lengt). Subsequently, the command parsing submodule parses the control commands and query commands sent from outside. The data distribution submodule distributes the parsed commands to the corresponding processing modules according to the command type (such as read command CMD_READ, write command CMD_WRITE, and transmit command CMD_TRANSPORT) and the index.
[0058] The command processing module, which acts as the system executor, also contains three sub-modules; please refer to [link / reference]. Figure 5 , Figure 5 The diagram illustrates the structure of the command processing module provided in this embodiment. The command processing module of the business layer, as the core execution unit of the system, comprises three sub-modules: a BMS command processing sub-module, a VCU command processing sub-module, and an IoT command processing sub-module. Each sub-module is responsible for responding to command requests from its corresponding module and completing data interaction and instruction execution based on its dedicated structure.
[0059] The BMS command processing submodule responds to BMS-related commands such as sleep control and cell information query. When it receives a sleep control command (index INDEX_BMS_SLEEP), it parses the sleep flag. If the flag is 0, it calls the sleep command function (Can_Sleep_cmd()) to trigger BMS sleep and returns a success response (ACK_NORMAL). When it receives a cell information query command (indexes INDEX_BMS_CELL1_4 to INDEX_BMS_CELL13_16), it reads the corresponding cell voltage from the Can1_BMS_Info structure, encapsulates the data in the "high 8 bits + low 8 bits" format, and returns the query result through the CAN1 message sending function.
[0060] The VCU command processing submodule handles VCU-related commands such as voltage setting and peripheral control. When it receives a voltage setting command (index INDEX_VCU_VOL), it parses the input data and updates the photovoltaic output voltage (pv1OutVol, pv2OutVol) to the VCU control structure (dcControlInfo) to adjust the hardware output. When it receives a peripheral control command (index INDEX_VCU_MODULE), it parses the module working status flag and updates the DC working state (dcWorkState) in the VCU control structure, thereby controlling the start and stop of peripherals such as MPPT and Type-C.
[0061] The IoT command processing submodule receives IoT module-related commands such as charging requests and power-off time settings. When it receives a charging request command (index INDEX_IOT_CHARGE_CMD), it parses the charging percentage and charging instructions and updates the Can1_Iot_Info structure to trigger the charging logic. When it receives an automatic power-off time setting command (index INDEX_IOT_OFFTIME), it saves the power-off time parameter to the automatic power-off time field (Iot_Aoto_OffTime) of the Can1_Iot_Info structure. The system timing module will execute the power-off logic based on this parameter.
[0062] In this embodiment of the application, the method further includes: after charging is started, continuously acquiring battery status information monitored by the battery management system; if abnormal battery status information is detected, generating a protection command and sending it to the power conversion control system to stop charging.
[0063] Specifically, after charging starts, the data acquisition and refresh module continues to work. The BMS data refresh submodule triggers the BMS data update function according to the configured cycle, continuously acquiring core data such as the battery's total capacity, remaining capacity, voltage, temperature, charge / discharge status, and MOSFET status from the BMS hardware, and updating the system's Can1_BMS_Info structure. The VCU data refresh submodule synchronously and continuously acquires the VCU module's power, voltage, operating status, protection information, and fault information, and updates the Can1_VCU_Info structure, realizing the continuous acquisition of battery status information and VCU operating status information.
[0064] If the BMS data refresh submodule detects abnormal battery status information, including but not limited to battery overvoltage, undervoltage, overheating, underheating, overcurrent during charging / discharging, MOSFET failure, etc., or if the VCU data refresh submodule detects abnormal VCU operation (such as MPPT module failure, Type-C interface failure, sensor failure, etc.), the abnormality handling submodule of the status monitoring module marks the abnormality type in the Can1_SYS_Info structure, generates a protection command, and sends it to the power conversion control system. After receiving the protection command, the power conversion control system stops sending PWM drive signals to the switching device group (NMOS transistor) of the corresponding power conversion branch, controls the switching device group to open, stops power conversion, thereby terminating the charging of the battery and preventing damage to the battery or equipment due to abnormal conditions.
[0065] In this embodiment, the communication system of the electric-assisted bicycle also supports remote firmware upgrades via CAN bus, improving the convenience of equipment maintenance. This function is achieved through an OTA upgrade module, which includes an upgrade information interaction submodule, a firmware data transmission submodule, and an upgrade verification submodule.
[0066] The core process of OTA upgrade is as follows: Upgrade Information Interaction: The upgrade information interaction submodule receives the upgrade module identifier (such as VCU, BMS) and target version information through the CAN message receiving and parsing module. Then, it sends a firmware length request to the upgrade initiator through the CAN message sending module to obtain the firmware length and CRC check value, and performs interactive confirmation.
[0067] Firmware data transmission: The firmware data transmission submodule requests firmware fragment data from the upgrade initiator. After receiving the fragment data via the CAN bus, it concatenates it into the Ota_Date_Buff structure and performs a preliminary check on the integrity of each data fragment.
[0068] Integrity verification: After all fragmented data has been received, the upgrade verification submodule calls the firmware receive processing function (Can1_Rec_Firmware_Handle()) to perform CRC verification on the complete firmware in the firmware data buffer to verify the firmware integrity.
[0069] Upgrade result feedback: If the CRC check passes, the firmware upgrade process is triggered. After the upgrade is completed, the upgrade success status is returned via the CAN message sending module. If the check fails, the upgrade failure status is returned, and the upgrade initiator is requested to retransmit the firmware data.
[0070] The aforementioned OTA upgrade module enables remote firmware updates for modules such as BMS, VCU, and IoT smart locks. Function upgrades or fault repairs can be completed without disassembling the device, improving device maintenance efficiency and user experience.
[0071] Compared to existing technologies, this application automatically acquires peak and off-peak electricity price information from the power grid through an in-vehicle IoT smart lock, and coordinates with the vehicle control unit and battery management system to achieve fully automatic intelligent charging scheduling. Users can save on electricity bills by taking advantage of off-peak electricity prices without manual intervention, greatly improving convenience and economy. Two independent power conversion branches are designed, compatible with high-power fast charging with dedicated adapters and portable charging with universal PD adapters, improving the flexibility of charging scenarios and user convenience. Furthermore, a highly modular in-vehicle software communication system based on the CAN bus is constructed, realizing real-time data acquisition, efficient interaction, reliable monitoring, and remote upgrades of multiple modules such as the battery management system, vehicle control unit, and IoT module. This provides a solid hardware and software foundation for the stable and intelligent operation of electric-assisted bicycles, solving the problems of single functionality and poor coordination capabilities in existing systems.
[0072] This application also provides an electric-assisted bicycle, including a control unit for performing the above-described charging control method.
[0073] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device 300 includes a processor 310, a memory 320, and a bus 330.
[0074] The memory 320 stores machine-readable instructions that can be executed by the processor 310. When the electronic device 300 is running, the processor 310 and the memory 320 communicate via the bus 330. When the machine-readable instructions are executed by the processor 310, the steps of the method described above can be performed. For specific implementation details, please refer to the method embodiment, which will not be repeated here.
[0075] This application also provides a computer-readable storage medium storing a computer program. When the computer program is run by a processor, it can execute the steps of the method described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0076] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0077] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0078] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0079] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0080] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A charging control method for an electric-assisted bicycle, characterized in that, The method includes: In response to the establishment of a charging connection by the electric-assisted vehicle, the system obtains electricity price and time period information queried by the IoT smart lock of the electric-assisted vehicle, as well as battery status information monitored by the battery management system of the electric-assisted vehicle. The charging start time is determined based on the electricity price period information, the battery status information, and the current time. During the charging start time, a control signal is sent to the power conversion control system of the electric-assisted vehicle to start charging the battery of the electric-assisted vehicle.
2. The method according to claim 1, characterized in that, Determine the charging start time using the following methods: Determine if the current time falls within the time period specified in the electricity price time period information; If the current time is at the lowest point in the electricity price period information and the remaining power in the battery status information is lower than the preset power value, then the current time is determined as the charging start time; If the current time is during a peak period in the electricity price information, then determine whether charging of the battery has already started; If charging of the battery has already started, then charging of the battery is stopped, and the start time of the next valley period is determined as the charging start time; If charging of the battery is not initiated, the start time of the next valley period is determined as the charging start time.
3. The method according to claim 1, characterized in that, The power conversion control system includes at least one power conversion branch, and each power conversion branch is connected between a corresponding charging interface and the battery. The charging of the battery is initiated in the following manner: A control signal is sent to the target power conversion branch corresponding to the charging interface that establishes a charging connection, driving the switching device group of the target power conversion branch to perform switching actions, thereby converting the power from the charging interface into power adapted to the battery.
4. The method according to claim 3, characterized in that, The at least one power conversion branch includes a first power conversion branch and a second power conversion branch. The first power conversion branch is connected to a first charging interface, which is used to connect a dedicated adapter. The second power conversion branch is connected to a second charging interface, which is used to connect a PD adapter.
5. The method according to claim 3, characterized in that, Each power conversion branch includes an inductor and two dual-switch transistor groups. The first end of each dual-switch transistor group is connected to the corresponding charging interface, and the second ends of the two dual-switch transistor groups are connected to the battery through the inductor in series.
6. The method according to claim 1, characterized in that, Also includes: The electric-assisted bicycle periodically communicates with the battery management system and the IoT smart lock via the CAN bus of the controller area network. If no heartbeat packet is received from the battery management system or the IoT smart lock within a preset time, a communication abnormality is determined, and the corresponding processing procedure is triggered.
7. The method according to claim 1, characterized in that, Also includes: After charging is initiated, battery status information monitored by the battery management system is continuously acquired. If an abnormality is detected in the battery status information, a protection command is generated and sent to the power conversion control system to stop charging.
8. An electric-assisted bicycle, characterized in that, The electric-assisted bicycle includes: The control unit is configured to perform the charging control method as described in any one of claims 1-7.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 7.