Middleware capable of randomly adjusting charging parameters and electronic equipment
By introducing voltage control module, calibration module and log monitoring module into the power adapter, combined with hardware control module, flexible adjustment of charging voltage and current and abnormal warning are achieved, solving the problem that traditional power adapters cannot adapt to different power grid standards, and improving Applicability and safety.
Patent Information
- Application Number
- CN202411035781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
Traditional power adapters cannot control output voltage and current arbitrarily, resulting in limitations when used in different countries and regions.
A middleware including voltage control module, calibration module, log monitoring module and hardware control module was designed to achieve flexible adjustment of charging voltage and current through software, use multi-layer feedback mechanism and AI algorithm for intelligent control, and use calibration. The module calibrates the hardware for improved stability.
Ability to output the charging voltage and current, improve applicability and flexibility, and improve product safety and reliability through abnormal warning and calibration functions.
Smart Images

Figure CN118971249A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic device charging, and in particular to a middleware and electronic device capable of arbitrarily adjusting charging parameters. Background Art
[0002] Universal power adapters are key accessories for international travel and cross-border use of electronic devices. Due to differences in power grid standards in different countries and regions, such as differences in voltage and frequency, it plays an important role in converting the voltage and current provided by the power socket into voltage and current suitable for electronic devices. Traditional power adapters are designed from a hardware perspective to convert fixed voltages according to power grid standards, which makes it impossible to arbitrarily control the output voltage and current, and are very limited in use in some situations. Summary of the invention
[0003] In view of the above problems, the present invention provides a middleware and an electronic device that can arbitrarily adjust charging parameters, which can set the charging parameters according to user needs.
[0004] The present invention discloses a middleware capable of arbitrarily adjusting charging parameters, comprising: a voltage control module, a calibration module, a log monitoring module and a hardware control module;
[0005] The voltage control module is used to generate a power control signal according to the target charging parameters input by the user;
[0006] The hardware control module outputs a charging voltage and a charging current according to the power control signal;
[0007] The log monitoring module is used to record the actual charging parameters during the charging process;
[0008] The calibration module calibrates the hardware control module according to the actual charging parameters.
[0009] As a further improvement of the present invention, the hardware control module includes: a transformer, a current sensing resistor, the voltage control module obtains the target charging parameters, calls the function from the back-end algorithm library to calculate the charging voltage and the charging current, and the voltage control module controls the turns ratio of the transformer to obtain the charging voltage and changes the resistance value of the current sensing resistor to obtain the charging current.
[0010] As a further improvement of the present invention, the power control module is also used to issue an abnormal warning for the charging voltage and the charging current.
[0011] As a further improvement of the present invention, the power control module uses historical charging voltage and historical charging current to construct a neural network model to issue abnormal warnings for the charging voltage and the charging current.
[0012] As a further improvement of the present invention, the hardware control module includes: a sensor, and the calibration module enters a calibration mode when a set time is reached;
[0013] The calibration module calculates the calibration coefficient of the sensor using a linear regression method, and calibrates the calibration parameter table of the sensor based on the calibration coefficient.
[0014] As a further improvement of the present invention, the log monitoring module records the actual charging parameters during the charging process in the form of a timestamp, and sends abnormal actual charging parameters to the user.
[0015] In addition, the present invention also provides an electronic device, comprising: a back-end server, a power adapter;
[0016] The back-end server is provided with the above-mentioned voltage control module, calibration module and log monitoring module;
[0017] The power adapter is provided with the above-mentioned hardware control module.
[0018] The present invention has the following technical effects: a middleware is used to generate a power control signal according to a target charging parameter input by a user through a voltage control module, and a hardware control module controls the output charging voltage and charging current. At the same time, a log monitoring module is used to record the actual charging parameters during the charging process, and the output of any voltage and current value is realized in a software manner. Compared with traditional hardware adapters, it has higher flexibility and applicability. In addition, a calibration module is also provided to calibrate the hardware control module, further improving the safety, reliability and availability of the product. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a framework diagram of the middleware described in the present invention;
[0020] Figure 2 The following is a flowchart of the middleware of the present invention;
[0021] Figure 3 It is a structural schematic diagram of the hardware control module of the present invention.
[0022] Explanation of the reference numerals: 1. voltage control module; 2. calibration module; 3. log monitoring module; 4. hardware control module; 100. client. DETAILED DESCRIPTION
[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0024] Example 1
[0025] Reference Figure 1 , showing a middleware provided by the present invention that can arbitrarily adjust charging parameters, including: a voltage control module 1, a calibration module 2, a log monitoring module 3 and a hardware control module 4; the voltage control module 1 is used to generate a power control signal according to the target charging parameters input by the user; the hardware control module 4 outputs a charging voltage and a charging current according to the power control signal; the log monitoring module 3 is used to record the actual charging parameters during the charging process; the calibration module 2 calibrates the hardware control module 4 according to the actual charging parameters.
[0026] The voltage control module 1 mainly adopts a multi-layer feedback mechanism and AI algorithm training to complete the intelligent protection mechanism to implement the setDianYa (int voltage, int current) algorithm in the algorithm library, and controls the real-time charging voltage and charging current, so that the adapter can quickly and arbitrarily switch and output stably according to the power grid standards of different countries and regions.
[0027] Furthermore, the hardware control module 4 includes: a transformer, a current sensing resistor, and the voltage control module 1 obtains the target charging parameters, calls the function from the back-end algorithm library to calculate the charging voltage and the charging current, and the voltage control module 1 controls the turns ratio of the transformer to obtain the charging voltage and changes the resistance of the current sensing resistor to obtain the charging current.
[0028] After the user inputs the target charging parameters, the hardware control module 4 changes the voltage output by controlling the transformer turns ratio, and synchronously controls the current sensing resistor to change the current output. During the voltage control process, the hardware control module 4 introduces a multi-level feedback mechanism using additional feedback sensors and regulators, and adjusts the output voltage and current in real time through a secondary feedback loop. The PID (proportional-integral-differential) control algorithm is used for the first time to generate a preliminary control signal, and the transformer and current sensing resistor are fine-tuned again through the FPGA in the hardware control module 4. The set value and the preliminary adjustment result are compared to eliminate residual errors and make the output closer to the set value.
[0029] The power control module uses the historical charging voltage and the historical charging current to build a neural network model to give an abnormal warning of the charging voltage and the charging current. For example, this embodiment uses an LSTM neural network model, which is compiled and constructed using the Adam optimizer and the mean square error loss function:
[0030] LSTM1: h t =LSTM(X train ,50 units,return sequence)
[0031] LSTM2: h t =LSTM(h t ,50 units)
[0032] Output layer: y t =Dense(h t ,2 units)
[0033] The LSTM neural network model can predict future voltage and current values, and identify abnormal patterns. The ADC in the hardware control module 4 collects current and the current sensor collects voltage and current. The collected current and voltage data are normalized, and the LSTM model is built and trained to predict the time series data of voltage and current. The underlying circuits of components such as rectifiers, filters, and regulators in the hardware control module 4 are controlled to prepare for early prediction and prevention of abnormal conditions such as overvoltage and overcurrent. The control circuit ensures stable output. When an error detection signal is received, a control signal is immediately generated and the circuit breaker in the hardware control module 4 is triggered to cut off the circuit to protect the equipment.
[0034] The hardware control module 4 includes: a current sensor and a voltage sensor, which are used to obtain parameters in the secondary feedback loop process. The calibration module 2 enters the calibration mode when the set time is reached; the calibration module 2 uses a linear regression method to calculate the calibration coefficient of the sensor, and calibrates the calibration parameter table of the sensor based on the calibration coefficient.
[0035] Specifically, the calibration module 2 uses an adaptive voltage adjustment algorithm to implement the algorithm library real_timeDianYa() algorithm. This function is pre-saved in the algorithm library in a unified naming interface to help stabilize the output voltage and current values, and will not cause excessive output deviations due to environmental changes, sensor aging and other factors. Calibrate the current voltage and current values. Due to environmental changes, sensor aging and other factors, output deviations may occur. When the timer reaches the 480h and 960h set values, the calibration module 2 enters the calibration mode, reads the voltage log information and current log information in the log monitoring module 3, and switches the input of the current sensor to the reference voltage source and current source through the control signal to ensure that the current sensor receives a known standard signal. Since the current sensor output has a linear relationship with the input, the calibration module 2 uses a linear regression method to calculate the deviation to generate a calibration coefficient, compares the reference voltage and current values with the current sensor output value, updates the calibration parameter table of the current sensor, and after completing the calibration, restores the normal working mode of the current sensor and continues data acquisition.
[0036] In addition, the calibration module 2 also synchronously obtains the charging voltage and charging current from the hardware control module 4 and feeds them back to the user end, so that the user can intuitively see the real-time charging status.
[0037] The log monitoring module 3 records the actual charging parameters during the charging process in the form of a timestamp and sends abnormal actual charging parameters to the user. Specifically, the actual charging parameters may include: conventional parameters such as average voltage and average current, etc. If there are abnormal actual charging parameters, an error log is recorded, and abnormal voltage and current conditions such as overvoltage protection, overcurrent protection and short circuit protection are sent to the user via SMS, email, etc.
[0038] like Figure 3 As shown, the hardware control module 4 includes: PID controller, FPGA, transformer, current sensing resistor, feedback regulator, sensor and other hardware components. The voltage control module 1 controls the hardware control module 4, and the power control signal is generated and sent to the transformer and current sensing resistor to control the output charging voltage and charging current. First, the PID controller preliminarily adjusts the output charging voltage and charging current according to the error between the target value and the actual value, and according to the sensor and feedback regulator. Then the FPGA performs secondary fine-tuning to eliminate the residual error, and feeds back the charging voltage and charging current to the LSTM model. The LSTM model predicts the output voltage and current in real time and identifies abnormal modes. When an abnormality is detected, the protection mechanism is triggered, such as disconnecting the circuit to protect the device.
[0039] The hardware control module 4 adopts modular design, and each module has its clear function and interface, making the entire hardware part more flexible and expandable. In addition, the communication and cooperation between the modules also embody the advantages of modular design.
[0040] like Figure 2 As shown, this embodiment is further explained in combination with the specific implementation process as follows:
[0041] The user inputs the required target charging parameters (current, voltage) from the client, and the client calls the voltage control module to control the hardware control module to stably output the charging voltage and charging current, and predicts and detects the output charging voltage and charging current in real time.
[0042] The feedback information of the hardware control module is detected and recorded in the log. According to the voltage and current status, it is divided into: (1) When the voltage and current are normal, the real-time charging voltage and charging current are recorded as log data in the form of timestamp, and the calibration mode is entered regularly to calibrate the sensor deviation according to the data, and the output charging voltage and charging current are displayed in real time on the client. (2) When the charging voltage and charging current are abnormal, the error log is recorded, the voltage control module receives and identifies the abnormal mode and takes corresponding measures to control the hardware control module to ensure output stability, predict or detect the error signal to trigger the circuit breaker to cut off the circuit, and send the abnormal situation such as time and error type to the user through SMS, email, etc.
[0043] Example 2
[0044] This embodiment provides an electronic device, including: a back-end server and a power adapter; the back-end server is provided with the voltage control module, calibration module, and log monitoring module in Embodiment 1; the power adapter is provided with the hardware control module in Embodiment 1.
[0045] The client controls the output of the charging voltage and current of the hardware control module by calling the interface. The client communicates with the backend server through http+mq and calls the voltage control module in the algorithm library of the backend server. The voltage control module stores the setDianYa(int voltage, int current) function, which is pre-saved in the algorithm library in the form of a unified naming interface, allowing users to customize the input of the control voltage and current. Users only need to enter the target charging parameters (such as current and voltage) on the client to meet the charging needs of different customers, such as custom voltages of 110v, 36v, 5v, etc., and custom currents such as 1A, 0.1mA, 0.5mA, etc. You can also call the real_timeDianYa() function of the voltage control module to output the current voltage and current.
[0046] For the specific implementation process of this embodiment, please refer to Embodiment 1, which will not be described in detail here.
[0047] From the above embodiments, it can be seen that the present invention controls the hardware control module through the middleware to achieve arbitrary conversion and stable output of the charging voltage and the charging current, and can issue early warnings for abnormal charging voltage and charging current. At the same time, the calibration module is used to calibrate the sensor to correct the output deviation caused by environmental changes, sensor aging and other factors, thereby significantly improving the safety, reliability and availability of the product.
[0048] The present invention realizes the output of arbitrary voltage and current values through software middleware, which has higher flexibility and applicability than traditional hardware adapters. The calibration module verifies the sensor, and the user end can display the charging voltage and charging current. The user can intuitively understand the output status to ensure that the voltage and current meet the requirements. The voltage control module uses the LSTM neural network model to monitor and predict abnormal charging voltage and charging current, automatically performs actions such as power off, and sends error logs to improve the safety of the product. The log monitoring module records the charging voltage and charging current in the form of timestamps and outputs logs, which is conducive to subsequent analysis and fault location.
[0049] The present invention adopts the method of controlling hardware by software, simplifies the hardware design, reduces the complexity of the hardware circuit, and reduces the cost. The modular design of the hardware control module facilitates the replacement of the module according to different requirements, thereby improving the scalability of the product.
[0050] Through the middleware, users can remotely monitor the output status of charging voltage and charging current, improving the usability of the product. Through software control, high-precision charging voltage and charging current output can be achieved to meet the needs of various electronic devices. The abnormal protection and other functions set up improve the usability of the product.
[0051] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A middleware capable of arbitrarily adjusting charging parameters, characterized in that: include: Voltage control module, calibration module, log monitoring module and hardware control module; The voltage control module is used to generate a power control signal according to the target charging parameters input by the user; The hardware control module outputs a charging voltage and a charging current according to the power control signal; The log monitoring module is used to record the actual charging parameters during the charging process; The calibration module calibrates the hardware control module according to the actual charging parameters.
2. The middleware according to claim 1, characterized in that: The hardware control module includes: a transformer and a current sensing resistor. The voltage control module obtains the target charging parameters, calls a function from a back-end algorithm library to calculate and obtain a charging voltage and a charging current. The voltage control module controls the turns ratio of the transformer to obtain the charging voltage, and changes the resistance value of the current sensing resistor to obtain the charging current.
3. The middleware according to claim 1, characterized in that: The power control module is also used to issue an abnormal warning for the charging voltage and the charging current.
4. The middleware according to claim 3, characterized in that: The power control module uses historical charging voltage and historical charging current to build a neural network model to issue abnormal warnings for the charging voltage and the charging current.
5. The middleware according to claim 1, characterized in that: The hardware control module includes: a sensor, and the calibration module enters a calibration mode when a set time is reached; The calibration module calculates the calibration coefficient of the sensor using a linear regression method, and calibrates the calibration parameter table of the sensor based on the calibration coefficient.
6. The middleware according to claim 3, characterized in that: The log monitoring module records the actual charging parameters during the charging process in the form of a timestamp, and sends abnormal actual charging parameters to the user.
7. An electronic device, characterized in that: include: Backend server, power adapter; The backend server is provided with a voltage control module, a calibration module, and a log monitoring module according to any one of claims 1 to 6; The power adapter is provided with a hardware control module as described in any one of claims 1 to 6.
Citation Information
Cited By
LED bulb dimming system based on user preference
CN119562422A
