Electric bicycle wireless charging station data real-time storage and rapid retrieval system and method
By combining Redis in-memory database and SQLite embedded relational database, the lack of real-time processing capabilities and data integrity of the wireless charging station data management system is solved, and a combination of high concurrent processing and data reliability is achieved, providing flexible data query and storage solutions.
Patent Information
- Application Number
- CN202411706508.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional wireless charging station data management systems have shortcomings in real-time processing capabilities and data integrity, and cannot meet the needs of high concurrency, high reliability and real-time monitoring.
Using a combination of Redis in-memory database and SQLite embedded relational database, Redis is used to cache real-time data and process high concurrent access, and SQLite is used to persist in storing historical data to ensure the reliability and integrity of the data.
It achieves high concurrent processing performance and data reliability and integrity, and provides flexible query capabilities for real-time and historical data, making it easier to quickly retrieve and integrate other monitoring, analysis and control systems.
Smart Images

Figure CN119557333A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and more specifically to a real-time storage and rapid retrieval system and method for electric bicycle wireless charging station data. Background Art
[0002] With the popularity of electric bicycles, wireless charging stations have gradually become an important part of the charging infrastructure. Traditional charging station data management systems have many deficiencies in real-time processing capabilities and data integrity, and cannot meet the needs of high concurrency, high reliability and real-time monitoring of wireless charging stations; therefore, it is particularly important to develop an efficient real-time storage and fast retrieval system for wireless charging station data; In the prior art, data transmission and storage methods mainly rely on a single data cache or persistent storage solution, which is difficult to meet the requirements of high concurrent access and data persistence at the same time. Common problems include: (1) Insufficient real-time processing capabilities: Traditional database systems often have difficulty providing sufficient concurrent processing capabilities when faced with large amounts of real-time data, resulting in data access delays; (2) Data reliability issues: A single storage solution can easily lead to data loss or inconsistency when the system fails or restarts, making it difficult to ensure data integrity and reliability. (3) Lack of flexible query interface: Existing systems usually lack a unified API interface, making it difficult to flexibly perform data query and system integration. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a system and method for real-time storage and rapid retrieval of data of an electric bicycle wireless charging station.
[0004] The present invention provides a real-time storage and rapid retrieval system for data of an electric bicycle wireless charging station, comprising: An on-board charger module, wherein the on-board charger module includes an on-board charger, which is directly connected to the battery of the electric bicycle and is responsible for charging the battery of the electric bicycle and collecting charging status data of the battery; A ground wireless charging unit, wherein the ground wireless charging unit and the on-board charger in the on-board charger module are connected via LoRa wireless communication, and is used to supply power to the on-board charger and receive charging status data collected by the on-board charger; A central controller module, the central controller module and the ground wireless charging unit are connected via a CAN bus, and receives charging status data collected by the on-board charger; The central controller module includes a storage unit and a data processing unit, and the storage unit includes a Redis memory database and a SQLite embedded relational database; The Redis memory database is used to cache the real-time data of the charging status collected by the on-board charger; The SQLite embedded relational database is used for data storage, and the data in the Redis memory database is regularly synchronized to the SQLite embedded relational database; The data processing unit is used to process the real-time data of the charging status collected by the on-board charger in the Redis memory database in real time, and synchronize the processed data to the SQLite embedded relational database for storage; A data access API module, the data access API module is used to provide external data access services, including reading the charging status data currently collected by the ground wireless charging unit from the Redis memory database; It also includes retrieving the historical data of the charging status collected by the ground wireless charging unit from the SQLite embedded relational database; A safety monitoring module, which is used to perform real-time monitoring based on the real-time data of the charging status collected by the on-board charger in the Redis memory database to determine whether there is any abnormality in charging; When an abnormality occurs, an alarm signal is generated and transmitted to the data access API module, and the alarm signal is issued through the API interface of the data access API module; A transaction settlement management module, the transaction settlement management module includes a data acquisition unit and a management unit, the data acquisition unit is used to collect real-time and historical electricity price data, and the management unit is used to provide charging price strategy management based on the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit.
[0005] Preferably, the real-time data of the ground wireless charging unit is stored in the Redis memory database in the form of a hash table, with the key being the unit identifier. The hash table contains seven fields, which respectively record the real-time power, voltage, current, timestamp of data collection, battery power, charging progress and charging time.
[0006] Preferably, a charging_data table is created in the SQLite embedded relational database to store historical data of the ground wireless charging unit. The charging_data table contains eight fields, which respectively record the identifier, power, voltage, current, data collection timestamp, battery power, charging progress and charging time of the charging unit, so as to track and manage the performance and status of the charging unit.
[0007] Preferably, the specific working steps of regularly synchronizing the data in the Redis memory database to the SQLite embedded relational database are as follows: A time interval is set in advance, and the latest data is extracted from the Redis memory database at a certain time interval and written into the SQLite embedded relational database; During the synchronization process, transactions are used to ensure data consistency; After the real-time data of the ground wireless charging unit in the Redis memory database is successfully synchronized to the SQLite embedded relational database, the expired data in the Redis memory database is cleared.
[0008] Preferably, the data access API module works in a manner that includes real-time data query and historical data query, as follows: Real-time data query, reading data from the Redis memory database through the API interface of the data access API module, and returning the real-time data of the current ground wireless charging unit; Historical data query, retrieving data from the SQLite embedded relational database through the API interface of the data access API module.
[0009] Preferably, the specific working mode of the data processing unit is as follows: The data processing unit continuously receives real-time data sent from the ground wireless charging unit via the CAN bus; Parse the received real-time data into a structured format and extract the data fields; Check whether the data field is complete, and if the data field is complete, complete the processing; The processed real-time data is updated to the Redis memory database and stored in the form of a hash table, with the key being the unique identifier of the charging unit; Synchronize the latest data in the Redis in-memory database to the SQLite embedded relational database at predetermined time intervals; Back up your SQLite database regularly to prevent data loss Preferably, the specific working steps of the security monitoring module are as follows: Setting a safety threshold for each parameter in the battery's state of charge data; Compare each parameter in the real-time data of the charging status collected by the on-board charger in the Redis memory database with the set safety threshold to perform abnormality detection; If an abnormality is detected, an alarm signal is generated; The alarm signal is sent through the API interface of the data access API module.
[0010] Preferably, the specific working method of the security monitoring module also includes: When the ground wireless charging unit receives the charging status data collected by the vehicle charger, it records the model of the vehicle charger; When the current electric bicycle starts to charge, the ground wireless charging unit will record the model of the electric bicycle onboard charger again. If the model of the electric bicycle onboard charger has been charged in the ground wireless charging unit before the current time period, data will be retrieved from the SQLite embedded relational database according to the data access API module; The retrieved data is the charging status data collected by the on-board charger and previously received by the ground wireless charging unit; The safety monitoring module obtains the historical fault data of the vehicle charger according to the retrieved data, and adjusts the charging parameters of the ground wireless charging unit according to the historical fault data.
[0011] Preferably, the transaction settlement management module is used to provide charging price strategy management according to the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit, and the specific steps are: Automatically retrieve data from the SQLite embedded relational database according to the data access API module in the early morning of each working day; The retrieved data is the charging time data in the charging status data collected by the on-board charger and received by the ground wireless charging unit within one week before the current working day; Formulate a peak-valley electricity price strategy based on the electricity price data collected by the data collection unit and the charging time data in the charging status data collected by the on-board charger; Set a pre-charge threshold to remind users to recharge when their account balance falls below the threshold; Generate the user's charging bill, including charging amount, electricity price and fees; The specific working method of setting the pre-charge threshold is as follows: First, collect the total charging amount of each user in a certain period of time, calculate the total charging amount of all users, and divide the total charging amount by the number of users to get the average charging amount; Collect electricity price data for different time periods, calculate the average electricity price for each time period according to the peak-valley electricity price strategy, and take the weighted average of the average electricity prices for all time periods to obtain the overall average electricity price. The weight of each time period is the electricity price data for each time period. The pre-charge threshold is obtained by multiplying the overall average electricity price by the average charge amount.
[0012] The present invention also proposes a method for real-time storage and rapid retrieval of data of an electric bicycle wireless charging station, comprising the following steps: Step 1: The on-board charger collects the battery charging status data through its own sensors and transmits the data to the ground wireless charging unit through LoRa; the ground wireless charging unit collects its own working status data through its own sensors and regularly sends the data to the central controller. The data sent includes the charging status data of the electric bicycle battery received through LoRa and the working status data monitored by the ground wireless charging unit's own sensors; Step 2: The central controller stores the received data in Redis to achieve instant access and efficient real-time data processing; Step 3: The background process periodically synchronizes the data in Redis to SQLite to ensure that the data is not lost when the system restarts or fails.
[0013] Beneficial effects: Since Redis supports high-concurrency operations, the system can handle the data transmission and storage of a large number of charging units and has good scalability. By combining Redis's real-time cache and SQLite's persistent storage, the system ensures both high-concurrency processing performance and data reliability and integrity. It provides an API interface that follows the REST architecture style, supports flexible queries of real-time and historical data, and facilitates rapid retrieval and integration with other monitoring, analysis, and control systems. By using Redis for real-time data caching and regularly synchronizing these data to SQLite for persistent storage, the performance and reliability of data management are significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 is a system architecture diagram of the present invention, including a schematic diagram of the connection between multiple wireless charging units and a central controller; Figure 2 is a data flow diagram of the present invention, showing the data transmission process from the charging unit to the central controller; Figure 3 It is the Redis storage structure table of the present invention, showing the storage method of each charging unit data; Figure 4It is a schematic diagram of the SQLite table structure of the present invention, showing the specific fields for persistent data storage. DETAILED DESCRIPTION
[0015] Application scenarios: Data transmission and storage methods mainly rely on a single data cache or persistent storage solution, which is difficult to meet the needs of high-concurrency access and data persistence at the same time.
[0016] like Figures 1 to 4 Shown: A real-time storage and rapid retrieval system for data of an electric bicycle wireless charging station, comprising: The on-board charger module includes an on-board charger, which is directly connected to the battery of the electric bicycle and is responsible for charging the battery of the electric bicycle and collecting the charging status data of the battery. It should be noted that, in this embodiment, the number of on-board chargers included in the on-board charger module corresponds to the number of electric bicycles that are charged at the charging station at the same time, and the collected battery charging status data includes charging progress: the current charging completion degree of the battery, usually expressed as a percentage, which is used to display the progress of battery charging in real time; Battery power: The current remaining battery power, expressed as a percentage or a specific power value, used to assess the battery charge level; Voltage and Current: Real-time voltage and current readings of the battery during charging to ensure the charging process is within safe and recommended parameters; Charging time: the time that has passed since the battery started charging, or the estimated charging time that is required, which is necessary for users to plan charging time and for the system to manage charging; Temperature: The temperature of the battery during charging, used to prevent overheating and ensure battery safety; A ground wireless charging unit, wherein the ground wireless charging unit and the on-board charger in the on-board charger module are connected via LoRa wireless communication, and is used to supply power to the on-board charger and receive charging status data collected by the on-board charger; A central controller module, the central controller module and the ground wireless charging unit are connected via a CAN bus, and receives charging status data collected by the on-board charger; The central controller module includes a storage unit and a data processing unit, and the storage unit includes a Redis memory database and a SQLite embedded relational database; The Redis memory database is used to cache the real-time data of the charging status collected by the on-board charger; in this embodiment, high concurrent read and write operations are supported to ensure that the system can quickly respond to and process a large amount of real-time data; The SQLite embedded relational database is used for data storage, and the data in the Redis memory database is synchronized to the SQLite embedded relational database regularly; historical data is stored for a long time to ensure data persistence and reliability; The data processing unit is used to process the real-time data of the charging status collected by the on-board charger in the Redis memory database in real time, and synchronize the processed data to the SQLite embedded relational database for storage; A data access API module, the data access API module is used to provide external data access services, including reading the charging status data currently collected by the ground wireless charging unit from the Redis memory database; It also includes retrieving the historical data of the charging status collected by the ground wireless charging unit from the SQLite embedded relational database; in this embodiment, the historical data includes data before the current time period; A safety monitoring module, which is used to perform real-time monitoring based on the real-time data of the charging status collected by the on-board charger in the Redis memory database to determine whether there is any abnormality in charging; When an abnormality occurs, an alarm signal is generated and transmitted to the data access API module, and the alarm signal is issued through the API interface of the data access API module; The transaction settlement management module includes a data acquisition unit and a management unit. The data acquisition unit is used to collect real-time and historical electricity price data. The management unit is used to provide charging price strategy management based on the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit. It should be noted that the data acquisition unit obtains the current electricity price information in real time by connecting with the interface of the electricity market, including but not limited to the electricity prices of the day-ahead market, the intraday market and the real-time market; It should also be noted that by integrating modules such as real-time data processing, security monitoring, and transaction settlement management, not only the data management efficiency of electric bicycle wireless charging stations and the safety of the charging process are improved, but also through innovative energy-saving strategies and dynamic pricing models, energy consumption is optimized and operating costs are reduced. At the same time, the user experience and the economic benefits of the charging station are improved, contributing to the sustainable development of green energy.
[0017] As an optional embodiment: the real-time data of the ground wireless charging unit is stored in the Redis memory database in the form of a hash table, with the key being the unit identifier. This hash table contains seven fields, which respectively record the real-time power, voltage, current, timestamp of data collection, battery power, charging progress and charging time.
[0018] Provides convenient data structures for real-time monitoring and quick access to the status of charging units: It should be noted that, in this embodiment, the specific structure of the hash table includes: Top level structure: Key: unique identifier of the charging unit (unit_id); Value: real-time data of the charging unit; The structure of the hash table: Field1:power-real-time power data; Field2: voltage - real-time voltage data; Field3:current-real-time current data; Field4: timestamp-data collection timestamp; Field5:battery_level-battery power; Field6: charging_progress-charging progress; Field7: charging_time - charging time. It should be noted that, through this structure, the real-time status data of the ground wireless charging unit can be quickly accessed; For example, the unique identifier (unit_id) of the ground wireless charging unit is "unit_123". The real-time data of the charging unit is as follows: Real-time power: 50W; Real-time voltage: 220V; Real-time current: 10A; Data collection timestamp: 2024-11-0810:00:00; Battery level: 80% Charging progress: 50% Charging time (charging_time): 30 minutes; The specific storage method of the Redis memory database is: plaintext HMSETunit_123power50current10voltage220timestamp"2024-11-0810:00:00"battery_level80charging_progress50charging_time30 Here we use the Redis HMSET command, which allows us to assign values to the fields of a hash table. In this example, we set 7 fields and their corresponding values for the hash table of the charging unit "unit_123"; When we need to query the real-time data of this charging unit, we can use the HGETALL command to get the contents of the entire hash table: Plaintext; HGETALLunit_123; After executing this command, Redis will return the following results: Plaintext; (1) "power"; (2) "50"; (3) "current"; (4) "10"; (5) "voltage"; (6) "220"; (7) "timestamp"; (8) "2024-11-08 10:00:00"; (9) "battery_level"; (10) "80"; (11) "charging_progress"; (12) "50"; (13) "charging_time"; (14) "30"; This result contains all the real-time status data of the "unit_123" charging unit, returned in pairs in the form of field name and field value. In this way, we can access and update the real-time status data of each charging unit very quickly while keeping the data structure clear and easy to manage.
[0019] As an optional embodiment: create a charging_data table in the SQLite embedded relational database to store historical data of the ground wireless charging unit, the charging_data table containing eight fields, which respectively record the identifier, power, voltage, current, data collection timestamp, battery power, charging progress and charging time of the charging unit, so as to track and manage the performance and status of the charging unit.
[0020] It should be noted that, in this embodiment, specifically: unit_id: a unique identifier of a charging unit; §power: power; §voltage: voltage; §current: electric current; §timestamp: data collection timestamp; §battery_level: battery level; §charging_progress: charging progress; §charging_time: Charging time.
[0021] It should be noted that unit_id: This is a field used to store the unique identifier of each ground wireless charging unit to ensure that we can accurately identify and distinguish different ground wireless charging units; Power: This field records the power value during the charging process, usually in watts (W), indicating the output power of the charging unit at a specific moment; voltage: This field stores the voltage value, usually in volts (V), which indicates the voltage level provided by the charging unit; Current: This field records the current value in amperes (A), indicating the current intensity flowing through the charging unit; timestamp: This field records the specific time point of data collection, usually a timestamp, which is used to identify when each record was created or collected; battery_level: This field indicates the battery level, usually expressed as a percentage (%), to indicate the current state of charge of the battery; charging_progress: This field records the charging progress, which may be a percentage value, used to indicate the charging completion degree of the battery from the beginning of charging to the present; charging_time: This field records the charging time, usually in minutes or hours, indicating the time it takes for the battery to be charged from the beginning to the present.
[0022] As an optional embodiment: the specific working steps of regularly synchronizing the data in the Redis memory database to the SQLite embedded relational database are as follows: A time interval is set in advance, and the latest data is extracted from the Redis memory database at a certain time interval and written into the SQLite embedded relational database; During the synchronization process, transactions are used to ensure data consistency and avoid data loss or duplication. For example, SQLite's BEGIN TRANSACTION and COMMIT commands are used to ensure the atomicity of the entire synchronization process. After the real-time data of the ground wireless charging unit in the Redis memory database is successfully synchronized to the SQLite embedded relational database, the expired data in the Redis memory database is cleared, wherein the expired data is the real-time data of the ground wireless charging unit in the synchronized Redis memory database.
[0023] As an optional embodiment: the working mode of the data access API module includes real-time data query and historical data query, as follows: Real-time data query, read data from the Redis memory database through the API interface of the data access API module, and return the real-time data of the current ground wireless charging unit; for example, the API interface / api / realtime / {unit_id} returns the real-time data of the specified charging unit; Historical data query, retrieve data from the SQLite embedded relational database through the API interface of the data access API module. Support query based on time range and charging unit ID conditions; for example, the API interface / api / history / {unit_id}?start={start_time}&end={end_time} returns historical data within the specified time range.
[0024] As an optional embodiment: the specific working mode of the data processing unit is as follows: The data processing unit continuously receives real-time data sent from the ground wireless charging unit via the CAN bus; Parse the received real-time data into a structured format and extract data fields, such as power, voltage, current, etc. Check whether the data field is complete. If the data field is complete, the processing is completed. It should be noted that in this embodiment, the integrity can be evaluated by the record value and unique value in the data statistics. For example, if the value missing rate of a certain field is very high, then there is a problem with the integrity of this field. The processed real-time data is updated to the Redis memory database and stored in the form of a hash table, with the key being the unique identifier of the charging unit; Synchronize the latest data in the Redis in-memory database to the SQLite embedded relational database at predetermined time intervals; The SQLite database is backed up regularly to prevent data loss. It should be noted that the real-time data of the charging status is ensured to be processed and stored effectively while maintaining the integrity and reliability of the data.
[0025] As an optional embodiment: the specific working steps of the security monitoring module are as follows: Setting a safety threshold for each parameter in the battery charging state data; for example, in this embodiment, it may be a power threshold (P_threshold), a voltage threshold (V_threshold), a current threshold (I_threshold) and a temperature threshold (T_threshold); Each parameter in the real-time data of the charging status collected by the on-board charger in the Redis memory database is compared with the set safety threshold to perform abnormality detection; in this embodiment, if the power is greater than the power threshold or the voltage is less than the voltage threshold or the current is greater than the current threshold or the temperature is greater than the temperature threshold, then an abnormality is detected, otherwise it is normal; If an abnormality is detected, an alarm signal is generated; the alarm signal can be a simple Boolean value or a more complex data structure containing an alarm level and a timestamp; The alarm signal is sent through the API interface of the data access API module. In this embodiment, it can be a RESTful API call.
[0026] As an optional embodiment: the specific working method of the security monitoring module also includes: When the ground wireless charging unit receives the charging status data collected by the vehicle charger, it records the model of the vehicle charger; When the current electric bicycle starts to charge, the ground wireless charging unit will record the model of the electric bicycle onboard charger again. If the model of the electric bicycle onboard charger has been charged in the ground wireless charging unit before the current time period, data will be retrieved from the SQLite embedded relational database according to the data access API module; The retrieved data is the charging status data collected by the on-board charger and previously received by the ground wireless charging unit; The safety monitoring module obtains the historical fault data of the vehicle charger according to the retrieved data, and adjusts the charging parameters of the ground wireless charging unit according to the historical fault data.
[0027] It should be noted that, assuming that an electric bicycle on-board charger model has often had overheating problems when using the charging unit in the past, this information will be included in the historical fault records of the safety monitoring module. When this model of electric bicycle on-board charger is connected to the charging unit again, the safety monitoring module will identify this risk and automatically reduce the charging current from the default 10A to 8A, while increasing the frequency of temperature monitoring to ensure that the temperature during charging does not exceed the preset safety threshold. If the temperature exceeds the threshold, the charging unit will automatically suspend charging until the temperature drops to a safe level before resuming charging; Through such adjustments, data retrieval can be automatically performed and corresponding charging parameters can be selected for each on-board charger.
[0028] As an optional embodiment: the transaction settlement management module is used to provide charging price strategy management according to the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit, and the specific steps are: Automatically retrieve data from the SQLite embedded relational database according to the data access API module in the early morning of each working day; The retrieved data is the charging time data in the charging status data collected by the on-board charger and received by the ground wireless charging unit within one week before the current working day; it should be noted that, in this embodiment, the ground wireless charging unit also needs to collect the charging time data of the on-board charger; According to the electricity price data collected by the data collection unit and the charging time data in the charging state data collected by the on-board charger, a peak-valley electricity price strategy is formulated; it should be noted that, in this embodiment, the specific steps may be: collecting real-time and historical electricity price data, including peak-valley time periods and electricity prices, setting peak-valley electricity prices according to the peak-valley difference rate of the power system, the peak-valley electricity price difference is not less than 4:1 (where the peak-valley difference rate exceeds 40%) or 3:1 (other places), establishing a peak electricity price mechanism, and the peak electricity price is not less than 20% on the basis of the peak electricity price in principle; The peak and valley time periods are obtained based on the charging time data in the charging status data collected by the on-board charger and received within one week before the current working day; For example, if the peak-to-valley difference of the power system is 45%, according to the strategy of the transaction settlement management module: Peak hours: Assuming it is 7:00 to 9:00 in the morning and 6:00 to 8:00 in the evening every day, the electricity price is set at 0.8 yuan per kilowatt-hour.
[0029] Valley period: Assuming it is from 11 pm to 6 am, the electricity price is set at 0.2 yuan per kilowatt-hour, meeting the peak-to-valley electricity price ratio of 4:1.
[0030] Peak hours: Peak hours are further set within the peak hours, such as 8 to 9 in the morning, and the electricity price will increase by 20% to 0.96 yuan per kilowatt-hour.
[0031] By analyzing the charging time data of the past week, the transaction settlement management module found that most electric bicycles charge during the peak period from 6 to 8 p.m., so the module may recommend users to charge during the off-peak period to reduce charging costs; In addition, if the analysis shows that the power consumption during peak hours is abnormally high, the module may further adjust the peak electricity price to encourage users to charge during off-peak hours, thereby balancing the grid load, reducing the peak-to-valley difference of the power system, and improving energy efficiency; For places with obvious seasonal differences, a seasonal electricity price mechanism should be established; for places with a large proportion of renewable energy such as hydropower, a peak-peak-peak electricity price mechanism should be established; Set a pre-charge threshold to remind users to recharge when their account balance falls below the threshold; Generate the user's charging bill, including charging amount, electricity price and fees; It should be noted that the financial process of the charging station can be effectively managed to ensure the rationality of the charging price strategy and provide accurate bills and financial statements; The specific working method of setting the pre-charge threshold is as follows: First, collect the total charging amount of each user in a certain period of time, calculate the total charging amount of all users, and divide the total charging amount by the number of users to get the average charging amount; Collect electricity price data for different time periods, calculate the average electricity price for each time period according to the peak-valley electricity price strategy, and take the weighted average of the average electricity prices for all time periods to obtain the overall average electricity price. The weight of each time period is the electricity price data for each time period. The pre-charge threshold is obtained by multiplying the overall average electricity price by the average charging amount. It should be noted that the rationality and safety of pre-charges can be ensured, while providing financial guarantees for charging stations and reducing operational risks.
[0032] The present invention also proposes a method for real-time storage and rapid retrieval of data of an electric bicycle wireless charging station, comprising the following steps: Step 1: The on-board charger collects the battery charging status data through its own sensors and transmits the data to the ground wireless charging unit through LoRa; the ground wireless charging unit collects its own working status data through its own sensors and regularly sends the data to the central controller. The data sent includes the charging status data of the electric bicycle battery received through LoRa and the working status data monitored by the ground wireless charging unit's own sensors; Step 2: The central controller stores the received data in Redis to achieve instant access and efficient real-time data processing; Step 3: The background process periodically synchronizes the data in Redis to SQLite to ensure that the data is not lost when the system restarts or fails.
[0033] How it works The on-board charger is directly connected to the electric bicycle battery and is responsible for charging the electric bicycle battery and collecting the battery charging status data; The ground wireless charging unit and the on-board charger in the on-board charger module are connected via LoRa wireless communication, for supplying power to the on-board charger and receiving charging status data collected by the on-board charger; The central controller module is connected to the ground wireless charging unit via a CAN bus to receive charging status data collected by the on-board charger; The central controller module includes a storage unit and a data processing unit, and the storage unit includes a Redis memory database and a SQLite embedded relational database; The Redis memory database is used to cache the real-time data of the charging status collected by the on-board charger; in this embodiment, high concurrent read and write operations are supported to ensure that the system can quickly respond to and process a large amount of real-time data; The SQLite embedded relational database is used for data storage, and the data in the Redis memory database is synchronized to the SQLite embedded relational database regularly; historical data is stored for a long time to ensure data persistence and reliability; The data processing unit is used to process the real-time data of the charging status collected by the on-board charger in the Redis memory database in real time, and synchronize the processed data to the SQLite embedded relational database for storage; A data access API module, the data access API module is used to provide external data access services, including reading the charging status data currently collected by the ground wireless charging unit from the Redis memory database; It also includes retrieving the historical data of the charging status collected by the ground wireless charging unit from the SQLite embedded relational database; in this embodiment, the historical data includes data before the current time period; A safety monitoring module, which is used to perform real-time monitoring based on the real-time data of the charging status collected by the on-board charger in the Redis memory database to determine whether there is any abnormality in charging; When an abnormality occurs, an alarm signal is generated and transmitted to the data access API module, and the alarm signal is issued through the API interface of the data access API module; A transaction settlement management module, the transaction settlement management module includes a data acquisition unit and a management unit, the data acquisition unit is used to collect real-time and historical electricity price data, and the management unit is used to provide charging price strategy management based on the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit.
[0034] The above are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical staff in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of this template.
Claims
1. A real-time data storage and rapid retrieval system for an electric bicycle wireless charging station, characterized in that: include: An on-board charger module, wherein the on-board charger module includes an on-board charger, which is directly connected to the battery of the electric bicycle and is responsible for charging the battery of the electric bicycle and collecting charging status data of the battery; A ground wireless charging unit, wherein the ground wireless charging unit and the on-board charger in the on-board charger module are connected via LoRa wireless communication, and is used to supply power to the on-board charger and receive charging status data collected by the on-board charger; A central controller module, the central controller module and the ground wireless charging unit are connected via a CAN bus, and receives charging status data collected by the on-board charger; The central controller module includes a storage unit and a data processing unit, and the storage unit includes a Redis memory database and a SQLite embedded relational database; The Redis memory database is used to cache the real-time data of the charging status collected by the on-board charger; The SQLite embedded relational database is used for data storage, and the data in the Redis memory database is regularly synchronized to the SQLite embedded relational database; The data processing unit is used to process the real-time data of the charging status collected by the on-board charger in the Redis memory database in real time, and synchronize the processed data to the SQLite embedded relational database for storage; A data access API module, the data access API module is used to provide external data access services, including reading the charging status data currently collected by the ground wireless charging unit from the Redis memory database; It also includes retrieving the historical data of the charging status collected by the ground wireless charging unit from the SQLite embedded relational database; A safety monitoring module, which is used to perform real-time monitoring based on the real-time data of the charging status collected by the on-board charger in the Redis memory database to determine whether there is any abnormality in charging; When an abnormality occurs, an alarm signal is generated and transmitted to the data access API module, and the alarm signal is issued through the API interface of the data access API module; A transaction settlement management module, the transaction settlement management module includes a data acquisition unit and a management unit, the data acquisition unit is used to collect real-time and historical electricity price data, and the management unit is used to provide charging price strategy management based on the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit.
2. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 1 is characterized in that: The real-time data of the ground wireless charging unit is stored in the Redis memory database in the form of a hash table, with the key being the unit identifier. The hash table contains seven fields, which respectively record the real-time power, voltage, current, timestamp of data collection, battery power, charging progress and charging time.
3. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 1 is characterized in that: A charging_data table is created in the SQLite embedded relational database to store historical data of the ground wireless charging unit. The charging_data table contains eight fields, which respectively record the identifier, power, voltage, current, data collection timestamp, battery power, charging progress and charging time of the charging unit, so as to track and manage the performance and status of the charging unit.
4. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 1 is characterized in that: The specific working steps of regularly synchronizing the data in the Redis memory database to the SQLite embedded relational database are as follows: A time interval is set in advance, and the latest data is extracted from the Redis memory database at a certain time interval and written into the SQLite embedded relational database; During the synchronization process, transactions are used to ensure data consistency; After the real-time data of the ground wireless charging unit in the Redis memory database is successfully synchronized to the SQLite embedded relational database, the expired data in the Redis memory database is cleared.
5. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 1 is characterized in that: The data access API module works in two ways: real-time data query and historical data query, as follows: Real-time data query, reading data from the Redis memory database through the API interface of the data access API module, and returning the real-time data of the current ground wireless charging unit; Historical data query, retrieving data from the SQLite embedded relational database through the API interface of the data access API module.
6. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 5, characterized in that: The specific working mode of the data processing unit is as follows: The data processing unit continuously receives real-time data sent from the ground wireless charging unit via the CAN bus; Parse the received real-time data into a structured format and extract the data fields; Check whether the data field is complete, and if the data field is complete, complete the processing; The processed real-time data is updated to the Redis memory database and stored in the form of a hash table, with the key being the unique identifier of the charging unit; Synchronize the latest data in the Redis in-memory database to the SQLite embedded relational database at predetermined time intervals; Back up your SQLite database regularly to prevent data loss.
7. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 6 is characterized in that: The specific working steps of the security monitoring module are as follows: Setting a safety threshold for each parameter in the battery's state of charge data; Compare each parameter in the real-time data of the charging status collected by the on-board charger in the Redis memory database with the set safety threshold to perform abnormality detection; If an abnormality is detected, an alarm signal is generated; The alarm signal is sent through the API interface of the data access API module.
8. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 7, characterized in that: The specific working method of the security monitoring module also includes: When the ground wireless charging unit receives the charging status data collected by the vehicle charger, it records the model of the vehicle charger; When the current electric bicycle starts to charge, the ground wireless charging unit will record the model of the electric bicycle onboard charger again. If the model of the electric bicycle onboard charger has been charged in the ground wireless charging unit before the current time period, data will be retrieved from the SQLite embedded relational database according to the data access API module; The retrieved data is the charging status data collected by the on-board charger and previously received by the ground wireless charging unit; The safety monitoring module obtains the historical fault data of the vehicle charger according to the retrieved data, and adjusts the charging parameters of the ground wireless charging unit according to the historical fault data.
9. The real-time data storage and rapid retrieval system for an electric bicycle wireless charging station according to claim 8, characterized in that: The transaction settlement management module is used to provide charging price strategy management based on the historical data in the SQLite embedded relational database and the real-time and historical electricity price data of the data acquisition unit. The specific steps are: Automatically retrieve data from the SQLite embedded relational database according to the data access API module in the early morning of each working day; The retrieved data is the charging time data in the charging status data collected by the on-board charger and received by the ground wireless charging unit within one week before the current working day; Formulate a peak-valley electricity price strategy based on the electricity price data collected by the data collection unit and the charging time data in the charging status data collected by the on-board charger; Set a pre-charge threshold to remind users to recharge when their account balance falls below the threshold; Generate the user's charging bill, including charging amount, electricity price and fees; The specific working method of setting the pre-charge threshold is as follows: First, collect the total charging amount of each user in a certain period of time, calculate the total charging amount of all users, and divide the total charging amount by the number of users to get the average charging amount; Collect electricity price data for different time periods, calculate the average electricity price for each time period according to the peak-valley electricity price strategy, and take the weighted average of the average electricity prices for all time periods to obtain the overall average electricity price. The weight of each time period is the electricity price data for each time period. The pre-charge threshold is obtained by multiplying the overall average electricity price by the average charge amount.
10. A method for real-time storage and rapid retrieval of data of an electric bicycle wireless charging station, characterized in that: The following steps are involved: Step 1: The on-board charger collects the battery charging status data through its own sensors and transmits the data to the ground wireless charging unit through LoRa; the ground wireless charging unit collects its own working status data through its own sensors and regularly sends the data to the central controller. The data sent includes the charging status data of the electric bicycle battery received through LoRa and the working status data monitored by the ground wireless charging unit's own sensors; Step 2: The central controller stores the received data in Redis to achieve instant access and efficient real-time data processing; Step 3: The background process periodically synchronizes the data in Redis to SQLite to ensure that the data is not lost when the system restarts or fails.
Citation Information
Cited By
Data entry method and system for electric bicycle charging platform
CN121524254A
Data entry method and system for electric bicycle charging platform
CN121524254B