Method, system and device for predicting remaining endurance time of battery

By using the battery life prediction model trained based on historical data to obtain the current power usage data of smart locks and other electrical equipment, the problem of inaccurate battery life prediction of electrical equipment in the existing technology is solved, and a more accurate and reliable prediction effect is achieved. , which improves the user experience.

CN119335403APending Publication Date: 2025-01-21GUANGDONG KETYOO INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411344468.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The remaining battery life prediction of existing smart locks and other electrical equipment is inaccurate, mainly because traditional methods rely on average power consumption and cannot accurately reflect the differences in usage habits and needs of each user.

Method used

Predict the remaining battery life by obtaining the current power usage data of the electrical device and calling the battery life prediction model trained based on historical power usage data. This model takes into account the differences in usage habits and needs of different users and avoids the limitations of traditional methods.

Benefits of technology

A more accurate and reliable remaining battery life prediction is achieved, which can more accurately reflect the actual situation of each user and improve the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119335403A_ABST
    Figure CN119335403A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric quantity prediction of electric equipment, in particular to a method, a system and a device for predicting the remaining endurance time of a battery, and the method comprises the steps: obtaining the current electric quantity use data of the electric equipment, calling an endurance prediction model obtained through training based on the historical electric quantity use data, and predicting the remaining endurance time of the battery. Therefore, a more accurate prediction effect is realized. According to the method, using habits and demand differences of different users are considered, and the limitation that a traditional method only depends on average used electricity consumption for prediction is avoided, so that the actual situation of each user can be reflected more accurately, more reliable remaining endurance time prediction is provided, and the user experience is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of power prediction of electrical equipment, and specifically to a method, system and device for predicting the remaining battery life of a battery. Background Art

[0002] With the rapid development of Internet of Things technology, smart home products are becoming more and more popular. As an important part of home security, smart locks are favored by the majority of users for their convenience and security. However, in the functional evolution of smart locks, the power prediction function has become a relatively lagging field. Smart locks currently on the market generally lack accurate and personalized prediction capabilities in power management, which to some extent affects the user experience and the overall performance of the product.

[0003] At present, most of the power prediction functions on the smart lock market rely on simple built-in algorithms. These algorithms are usually based on an assumption: the usage frequency and habits of all users are similar, so an average power usage can be calculated as a benchmark. Subsequently, the remaining usage time is estimated by dividing the current remaining power by the average power usage. Although this method is relatively simple to implement, in actual applications, due to the different usage habits and needs of each user, some users may frequently open and close the lock, while others may relatively rarely. This difference makes it difficult for the prediction method based on average power usage to accurately reflect the actual situation of each user, resulting in large deviations in the prediction results.

[0004] This shows that the prior art has the problem of inaccurate prediction of the remaining battery life of electrical equipment such as smart locks. Summary of the invention

[0005] The purpose of this application is to provide a method, system and device for predicting the remaining battery life of a battery, so as to solve the problem of inaccurate prediction of the remaining battery life of electrical equipment such as smart locks in the prior art.

[0006] In order to achieve the above purpose, the technical solution adopted in this application is as follows:

[0007] According to one aspect of an embodiment of the present application, a method for predicting remaining battery life is provided, characterized in that it includes: obtaining current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize usage of the electric device; calling a battery life prediction model to predict the remaining battery life of the electric device based on the current power usage data to obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using historical power usage data of the electric device.

[0008] According to the above technical means, by obtaining the current power usage data of the power-consuming equipment and calling the battery life prediction model trained based on the historical power usage data, the remaining battery life is predicted, thereby achieving a more accurate prediction effect. This method takes into account the usage habits and demand differences of different users, avoiding the limitations of traditional methods that only rely on average power usage for prediction. Therefore, it can more accurately reflect the actual situation of each user, provide more reliable remaining battery life prediction, and effectively improve the user experience.

[0009] Further, the battery life prediction model is called to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, including: converting the current power usage data into a target format, wherein the target format is a data format that can be processed by the battery life prediction model; inputting the current power usage data after format conversion into the battery life prediction model, running the prediction function in the battery life prediction model to obtain a predicted value of the remaining battery life, wherein the prediction function is used to characterize the functional relationship between the current power usage data and the predicted value of the remaining battery life.

[0010] According to the above technical means, the current power usage data is first converted into a target format that can be processed by the battery life prediction model, and then the converted data is input into the model, and the prediction function in the model is run to obtain the predicted value of the remaining battery life. This series of operations fully considers the data processing requirements and prediction mechanism of the battery life prediction model, ensuring the compatibility of the data and the accuracy of the prediction. In particular, the application of the prediction function characterizes the linear relationship between the current power usage data and the predicted value of the remaining battery life, making the prediction result more scientific and reasonable, thereby effectively improving the accuracy and reliability of the prediction of the remaining battery life of the power-consuming equipment.

[0011] Furthermore, before obtaining the current power usage data of the battery of the power-consuming device, it includes: generating original power data when the power data of the power-consuming device changes; pushing the original power data to the message queue through the Internet of Things platform for storage; and consuming the original power data in the message queue in real time through the data processing engine to obtain the current power usage data.

[0012] According to the above technical means, by real-time monitoring of the power data changes of power-consuming equipment, once a change occurs, the original power data is generated and pushed to the message queue for storage through the Internet of Things platform. Subsequently, the data processing engine is used to consume the original power data in the message queue in real time to obtain the current power usage data. This series of operations ensures the real-time and accuracy of the power data, and provides a reliable data basis for the subsequent prediction of the remaining battery life. At the same time, through the application of the Internet of Things platform and message queue, efficient data transmission and storage are achieved, and the overall efficiency of data processing is improved.

[0013] Furthermore, the raw power data in the message queue is consumed in real time by the data processing engine to obtain current power usage data, including: extracting target power data related to battery life from the raw power data through the data processing engine; performing data cleaning on the target power data to obtain current power usage data, wherein the current power usage data includes: the current battery voltage, timestamp and usage function data of the battery of the power-consuming device.

[0014] According to the above technical means, the data processing engine accurately extracts the target power data closely related to the battery life from the original power data, and then carefully cleans the data to ensure the accuracy and availability of the data. The current power usage data finally obtained, including the current battery voltage, timestamp, and usage function data, provides comprehensive and accurate information support for the prediction of the remaining battery life. This process not only improves the efficiency and accuracy of data processing, but also enhances the reliability of the prediction model and the accuracy of the prediction results.

[0015] Furthermore, the original power data is pushed to the message queue through the Internet of Things platform for storage, including: receiving the original power data pushed by the Internet of Things platform; storing the original power data in the Topic in the Kafka message queue corresponding to the device ID of the power-consuming device.

[0016] According to the above technical means, the original power data is efficiently pushed to the specific Topic in the Kafka message queue corresponding to the device ID of the power-consuming device through the IoT platform, realizing the rapid transmission and orderly storage of data. This approach not only ensures the real-time and integrity of the data, but also optimizes the data processing process through Kafka's high throughput and low latency characteristics, providing strong support for subsequent data consumption and analysis. At the same time, the storage method based on device ID also facilitates the classification management and rapid retrieval of data, further improving the efficiency of data processing and application.

[0017] Furthermore, after obtaining the predicted value of the remaining battery life, the method includes: storing the current power usage data in a data warehouse; when a model update operation is triggered, obtaining from the data warehouse all current power usage data of the battery life prediction model since the last update to the current update, wherein the model update operation is an operation of training the battery life prediction model by a timed-triggered scheduling linear regression model training program; and updating the battery life prediction model using all current power usage data.

[0018] According to the above technical means, after obtaining the predicted value of the remaining battery life, by storing the data in the data warehouse, a rich data source is provided for subsequent model updates. When the model update operation is triggered regularly, the power usage data of the latest time period can be efficiently retrieved from the data warehouse, and these data are used to train and update the battery life prediction model. This process not only ensures that the model can continuously learn the latest power usage patterns, but also enhances the adaptability and accuracy of the model through regular updates, thereby providing users with more accurate battery remaining life prediction services.

[0019] Furthermore, after obtaining the predicted value of the remaining battery life, the method further includes: pushing the predicted value of the remaining battery life to a user device, wherein the user device is associated with a device ID of the power-consuming device.

[0020] According to the above technical means, after obtaining the predicted value of the remaining battery life, this key information is pushed to the user device associated with the device ID of the power-consuming device. This instant feedback mechanism greatly improves the user experience. Users can know the remaining battery life of the power-consuming devices at home in real time, so as to arrange the usage plan reasonably and avoid device shutdown or function limitation due to insufficient power.

[0021] According to another aspect of an embodiment of the present application, a system for predicting remaining battery life is also provided, including: a data acquisition module, used to obtain current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize the usage of the electric device; a time prediction module, used to call a battery life prediction model, predict the remaining battery life of the electric device based on the current power usage data, and obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using historical power usage data of the electric device.

[0022] According to another aspect of the embodiments of the present application, there is also provided a device for predicting the remaining battery life, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store computer programs; and the processor is used to execute the steps of the method for predicting the remaining battery life in any of the above embodiments by running the computer program stored in the memory.

[0023] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of the method for predicting the remaining battery life in any of the above embodiments when running.

[0024] Beneficial effects of this application:

[0025] This application obtains the current power usage data of the power-consuming device and calls the battery life prediction model trained based on the historical power usage data to predict the remaining battery life, thereby achieving a more accurate prediction effect. This method takes into account the usage habits and demand differences of different users, avoiding the limitations of traditional methods that only rely on average power usage for prediction. Therefore, it can more accurately reflect the actual situation of each user, provide more reliable remaining battery life prediction, and effectively improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0028] Figure 1 It is a schematic diagram of a hardware environment of an optional method for predicting remaining battery life provided in an embodiment of the present application;

[0029] Figure 2 It is a flowchart of an optional method for predicting the remaining battery life provided in an embodiment of the present application;

[0030] Figure 3 This is a flow chart of an optional remaining battery life prediction of a smart lock provided in an embodiment of the present application;

[0031] Figure 4It is a structural block diagram of an optional system for predicting remaining battery life provided in an embodiment of the present application;

[0032] Figure 5 This is a structural block diagram of an optional device for predicting remaining battery life provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0035] According to one aspect of an embodiment of the present application, a method for predicting the remaining battery life is provided. Optionally, in this embodiment, the above-mentioned method for predicting the remaining battery life can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network, and can be used to provide services for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server.

[0036] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless FIdelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.

[0037] The method for predicting the remaining battery life of the embodiment of the present application can be executed by a server, a terminal, or a server and a terminal together. The terminal can also execute the method for predicting the remaining battery life of the embodiment of the present application by a client installed thereon.

[0038] Take the method for predicting the remaining battery life of the battery in this embodiment performed by the server as an example, see Figure 1 , Figure 1 is a schematic diagram of a hardware environment of an optional method for predicting remaining battery life provided in an embodiment of the present application, such as Figure 1 As shown, the hardware environment of the method for predicting the remaining battery life includes: a terminal 102, and a server 104 connected to the terminal 102 via a network. The server 104 is used to deploy a battery life prediction model, and the battery life prediction model executes the method for predicting the remaining battery life of the battery of the embodiment of the present application to predict the remaining battery life of the power-consuming device; the terminal 102 is used to display the predicted value of the remaining battery life to the user, wherein the predicted value can be predicted by the battery life prediction model deployed by the server 104.

[0039] The method for predicting the remaining battery life of the battery in this embodiment can be applied to scenarios such as the prediction of the remaining battery life of electrical equipment, for example, the prediction of the remaining battery life of smart locks, etc. Electrical equipment refers to the integration of modern information technology, computer digital technology, modern communication technology and intelligent control technology into traditional electrical equipment, so that it has intelligent characteristics and can become a terminal for network information transmission. These electrical equipment realizes the intelligence and networking of electrical equipment by embedding technologies such as microprocessors, sensors, and network communication modules. In this embodiment, electrical equipment specifically refers to electrical equipment that provides real-time monitoring, remote control and alarm functions, such as smart door locks, cameras and other household appliances.

[0040] At present, most of the power prediction functions on the smart lock market rely on built-in simple algorithms. These algorithms are usually based on an assumption: the usage frequency and habits of all users are similar, so an average power usage can be calculated as a benchmark. Subsequently, the remaining usage time is estimated by dividing the current remaining power by the average power usage. Although this method is relatively simple to implement, in actual applications, due to the different usage habits and needs of each user, some users may frequently open and close the lock, while others may do so relatively rarely. This difference makes it difficult for the prediction method based on the average power usage to accurately reflect the actual situation of each user, resulting in large deviations in the prediction results. It can be seen that the prior art has the problem of inaccurate prediction of the remaining battery life of electrical equipment such as smart locks.

[0041] To solve the above problem, this embodiment provides a method for predicting the remaining battery life of a battery running on the above server. Figure 2 , Figure 2 is a flow chart of an optional method for predicting the remaining battery life provided in an embodiment of the present application, such as Figure 2 As shown, the method for predicting the remaining battery life of the battery in the embodiment of the present application specifically includes the following steps:

[0042] Step S201, obtaining current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize the usage of the electric device;

[0043] Step S202, calling a battery life prediction model, predicting the remaining battery life of the power-consuming device based on the current power usage data, and obtaining a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

[0044] Through the above steps S201 to S202, the current power usage data of the power-consuming device is obtained, and the battery life prediction model trained based on the historical power usage data is called to predict the remaining battery life of the battery, thereby solving the problem of inaccurate prediction of the remaining battery life of power-consuming devices such as smart locks in related technologies. This method takes into account the usage habits and demand differences of different users, avoids the limitations of traditional methods that only rely on average power usage for prediction, and can more accurately reflect the actual situation of each user, provide more reliable remaining battery life prediction, and effectively improve user experience.

[0045] Combine the following Figure 2 The method for predicting the remaining battery life in the embodiment of the present application is explained.

[0046] In the technical solution of step S201, the current power usage data of the battery of the power-consuming device is obtained. In the present embodiment, the current power usage data is used to characterize the usage of the power-consuming device. In specific practice, the current power usage data includes: the current battery voltage, timestamp and usage function data of the battery of the power-consuming device. In order to save power, the power-consuming device generally goes into sleep mode when not in use and wakes up when needed, and the function when waking up the power-consuming device is the usage function. Taking a smart lock as an example, functions such as unlocking and viewing monitoring will wake it up, so functions such as unlocking and viewing monitoring are usage functions. In the present embodiment, each usage function corresponds to a function ID, a timestamp when the usage function starts, and a timestamp when the usage function ends.

[0047] It is understandable that the current battery voltage is an important indicator of the current state of the battery, which is directly related to the remaining battery power and the power it can provide. The voltage level can roughly reflect the battery's charging state and is a key parameter in the power details. The current timestamp, although the timestamp itself does not directly reflect the power information, it provides a time context for the power data. Knowing the specific time when a certain power state or event occurs is of great significance for analyzing power usage and predicting power consumption trends. The usage function data records the usage of different functions in detail, including the start and end time of the function. This information is crucial for analyzing which functions consume the most power, the power consumption pattern in different time periods, etc. Through the function usage data, the changes in battery power can be indirectly inferred, especially when these functions are associated with specific power consumption patterns.

[0048] In specific practice, the current power usage data is the characteristic data related to the battery life selected from the original power data when the power data of the power-consuming device changes. The current power usage data is stored in the memory. In this embodiment, the memory is a data warehouse. A data warehouse (Data Warehouse, referred to as a data warehouse) is a subject-oriented, integrated, relatively stable data set that reflects historical changes and is used to support enterprise-level decision analysis. In the data warehouse, data will be organized according to a specific model for subsequent data analysis and mining.

[0049] As an optional embodiment, before obtaining the current power usage data of the battery of the power-consuming device, it includes: generating original power data when the power data of the power-consuming device changes; pushing the original power data to a message queue through the Internet of Things platform for storage; and consuming the original power data in the message queue in real time through a data processing engine to obtain the current power usage data.

[0050] Existing power-consuming devices generally have built-in power monitoring modules that can detect battery power usage in real time or at a certain frequency (such as every hour, every day, etc.). When the power data changes, the power-consuming device will generate raw power data, which includes but is not limited to battery voltage, current current, device power, usage timestamp, function usage records (such as function ID, start time, end time), etc.

[0051] The electrical equipment establishes a connection with the Internet of Things (IoT) platform through a wireless network, and uploads the generated raw power data to the IoT platform. It should be noted that the upload process may involve security measures such as data encryption and compression to ensure the security and efficiency of data transmission. In this embodiment, there is no specific limitation on specific security measures such as data encryption and compression. Wireless networks such as Wi-Fi, Bluetooth, etc.

[0052] After the IoT platform receives the raw power data uploaded by the power-consuming device, it will perform preliminary data verification and analysis to ensure the integrity and correctness of the data. After verification, the raw power data will be pushed to the message queue by the IoT platform. During peak hours, the battery remaining life prediction system may face huge request pressure. Using a message queue, these requests can be temporarily stored and then smoothly distributed to the back-end service for processing, thereby avoiding system crashes due to overload. In this embodiment, the message queue can be Kafka. Kafka is a distributed stream processing platform with multi-partition, multi-copy and distributed messaging system characteristics based on Zookeeper coordination. Kafka is widely used for its high throughput, persistence, horizontal scalability, and support for stream data processing.

[0053] The data processing engine consumes power usage data in real time, performs real-time cleaning operations on the data to remove noise data, correct erroneous data, and extract data related to battery life. In this embodiment, the data processing engine is Flink, which is an open source distributed stream processing and batch processing system designed for real-time data processing, batch processing, and large-scale data processing scenarios integrating streams and batches. Its core concept is to provide a unified data processing model so that both real-time stream processing and batch processing can be efficiently executed in a consistent manner in the same system.

[0054] It is understandable that by real-time monitoring of the power data changes of power-consuming devices, once a change occurs, the original power data is generated and pushed to the message queue for storage through the IoT platform. Subsequently, the data processing engine is used to consume the original power data in the message queue in real time to obtain the current power usage data. This series of operations ensures the real-time and accuracy of the power data, and provides a reliable data basis for the subsequent prediction of the remaining battery life. At the same time, through the application of the IoT platform and message queue, efficient data transmission and storage are achieved, which improves the overall efficiency of data processing.

[0055] As an optional embodiment, the original power data in the message queue is consumed in real time by a data processing engine to obtain current power usage data, including: extracting target power data related to battery life from the original power data through the data processing engine; performing data cleaning on the target power data to obtain current power usage data, wherein the current power usage data includes: the current battery voltage, timestamp and usage function data of the battery of the power-consuming device.

[0056] The data processing engine selects the feature data most relevant to the battery life from the original power data as the target power data. These features include the current battery voltage, timestamp, and usage function data of the battery of the power-consuming device. In order for the battery life prediction model to successfully use the current power usage data to predict the remaining battery life, after obtaining the target power data, the target power data must be cleaned to obtain the current power usage data, remove noise data, and correct erroneous data to ensure that the battery life prediction model can correctly process the input current power usage data. In this embodiment, data cleaning includes: processing missing values, outliers, etc. The specific data cleaning steps are not specifically limited here.

[0057] In specific practice, the original power data is stored in the message queue in JSON format, and the characteristic data most relevant to the battery life is selected from the original power data as the target power data, that is, the key fields in the JSON (the fields most relevant to the battery life) are extracted; the required fields include the current battery voltage, the timestamp corresponding to the current voltage, the function ID, the timestamp when the function is started, and the timestamp when the function is ended.

[0058] It is understandable that the data processing engine accurately extracts the target power data closely related to the battery life from the raw power data, and then carefully cleans the data, thereby ensuring the accuracy and availability of the data. The final current power usage data, including the current battery voltage, timestamp, and usage function data, provides comprehensive and accurate information support for the prediction of the remaining battery life. This process not only improves the efficiency and accuracy of data processing, but also enhances the reliability of the prediction model and the accuracy of the prediction results.

[0059] As an optional embodiment, the original power data is pushed to the message queue for storage through the Internet of Things platform, including: receiving the original power data pushed by the Internet of Things platform; storing the original power data in the Topic in the Kafka message queue corresponding to the device ID of the power-consuming device.

[0060] In this embodiment, the message queue uses Kafka. In Kafka, the original power data is grouped by Topic. Multiple Topics can be created in advance, each Topic corresponds to the device ID of an electric device, and the original power data is stored in the Topic corresponding to the device ID of the electric device. As an optional embodiment, a Topic can also be created, but the Topic is set with multiple partitions (Partition), each partition corresponds to the device ID of an electric device, and the original power data is stored in the partition corresponding to the device ID of the electric device in the Topic. In Kafka, the original power data is stored in JSON format.

[0061] It is understandable that the IoT platform can efficiently push the raw power data to a specific Topic in the Kafka message queue corresponding to the device ID of the power-consuming device, thus achieving fast data transmission and orderly storage. This approach not only ensures the real-time and integrity of the data, but also optimizes the data processing process through Kafka's high throughput and low latency characteristics, providing strong support for subsequent data consumption and analysis. At the same time, the storage method based on the device ID also facilitates the classification management and rapid retrieval of data, further improving the efficiency of data processing and application.

[0062] In the technical solution of step S202, a battery life prediction model is called to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

[0063] The battery life prediction model is used to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain the predicted value of the remaining battery life. The battery life prediction model is trained based on a linear regression model using the historical power usage data of the power-consuming device. When using the battery life prediction model to predict the battery life of the power-consuming device, we first need to ensure that we have appropriate power detail data as target features, and that there is a linear relationship between these target features and the remaining battery life or that they can be close to a linear relationship after some conversion. In this embodiment, the target features are the current battery voltage, the timestamp corresponding to the current voltage, the function ID, the timestamp when the function is started, and the timestamp when the function is ended.

[0064] As an optional embodiment, a battery life prediction model is called to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, including: converting the current power usage data into a target format, wherein the target format is a data format that can be processed by the battery life prediction model; inputting the current power usage data after format conversion into the battery life prediction model, running the prediction function in the battery life prediction model, and obtaining a predicted value of the remaining battery life, wherein the prediction function is used to characterize the functional relationship between the current power usage data and the predicted value of the remaining battery life.

[0065] In the data warehouse, the current power usage data has been stored according to certain specifications. However, in order to train machine learning or deep learning models, these data need to be converted into a format that the model can recognize. In this embodiment, the battery life prediction model is trained using PyTorch. PyTorch is a widely used open source machine learning library, particularly suitable for deep learning applications. The battery life prediction model trained using PyTorch has a data structure of input data as tensors, which is a multidimensional array. PyTorch's tensors can accelerate calculations on the GPU, thereby significantly improving computing performance. In order for the battery life prediction model to smoothly process the current power usage data, the current power usage data is converted into a target format, and the target format is a data format that the battery life prediction model can handle. In this embodiment, the target format is a tensor.

[0066] The current power usage data after format conversion is input into the battery life prediction model, and the prediction function in the battery life prediction model is run to obtain the predicted value of the remaining battery life. The prediction function is used to characterize the functional relationship between the current power usage data and the predicted value of the remaining battery life. The functional relationship can be expressed by the following formula:

[0067] y=β0+β1x1+β2x2+...+βnxn+∈, where y represents the remaining battery life, x1,x2,...,xn represent input features, β0,β1,...,βn are model parameters, and ∈ is the error term.

[0068] In the early model training process, the historical power usage data of the power-consuming equipment and the corresponding remaining battery life are used to train the pre-built linear regression model, that is, to solve the model parameters β0, β1, ..., βn so that the difference between the model prediction value and the actual value is minimized. The minimum difference is usually verified by minimizing the mean square error.

[0069] When it is necessary to predict the remaining battery life of a new power-consuming device, the current power usage data of the power-consuming device is collected and preprocessed accordingly. The preprocessed current power usage data is input into the trained battery life prediction model to obtain the predicted remaining battery life.

[0070] It is understandable that according to the above technical means, the current power usage data is first converted into a target format that can be processed by the battery life prediction model, and then the converted data is input into the model, and the prediction function in the model is run to obtain the predicted value of the remaining battery life. This series of operations fully considers the data processing requirements and prediction mechanism of the battery life prediction model, ensuring the compatibility of the data and the accuracy of the prediction. In particular, the application of the prediction function, which characterizes the linear relationship between the current power usage data and the predicted value of the remaining battery life, makes the prediction result more scientific and reasonable, thereby effectively improving the accuracy and reliability of the prediction of the remaining battery life of electrical equipment.

[0071] As an optional embodiment, after obtaining the predicted value of the remaining battery life, the method includes: storing the current power usage data in a data warehouse; when a model update operation is triggered, obtaining from the data warehouse all current power usage data of the battery life prediction model since the last update to the current update, wherein the model update operation is an operation of training the battery life prediction model by a timed-triggered scheduling linear regression model training program; and using all the current power usage data to update the battery life prediction model.

[0072] In specific practice, after obtaining the predicted value of the remaining battery life, the current power usage data is stored in the data warehouse. At this time, the data format of the current power usage data stored in the data warehouse is a data format that can be processed by the battery life prediction model. As an optional embodiment, the current power usage data obtained after being processed by the real-time processing engine can be stored in the data warehouse. However, at this time, the current power usage data has not been formatted and is not in a data format that can be processed by the battery life prediction model. When the current power usage data stored in the data warehouse has not been formatted, the data warehouse can be used for format conversion. In order for the model to better process the current power usage data, it is preferred to save the current power usage data after format conversion in the data warehouse according to the device ID of the power-consuming device.

[0073] The model update operation is an operation of training the battery life prediction model by scheduling the linear regression model training program triggered on a regular basis. In this embodiment, the Pytorch linear regression model training program is scheduled on a regular basis every day through DolphinScheduler, and the battery life prediction model is trained using the new current power usage data, and the trained model is stored persistently in the data warehouse for subsequent prediction. DolphinScheduler is a distributed, easily scalable visual DAG (Directed Acyclic Graph) workflow task scheduling system. The new current power usage data refers to all the current power usage data of the battery life prediction model in the time period from the last update to the current update. In this embodiment, the model update operation is generally performed in idle time, such as: early morning or other idle time. It can be understood that in this embodiment, the battery life prediction model is updated using the new current power usage data, which is actually re-training the battery life prediction model. The re-training operation can make the battery life prediction model better adapt to the new data and improve its performance.

[0074] It is understandable that according to the above technical means, after obtaining the predicted value of the remaining battery life, by storing the data in the data warehouse, a rich data source is provided for subsequent model updates. When the model update operation is triggered regularly, the power usage data of the latest time period can be efficiently retrieved from the data warehouse, and these data are used to train and update the battery life prediction model. This process not only ensures that the model can continuously learn the latest power usage patterns, but also enhances the adaptability and accuracy of the model through regular updates, thereby providing users with more accurate battery remaining life prediction services.

[0075] As an optional embodiment, after obtaining the predicted value of the remaining battery life, the method further includes: pushing the predicted value of the remaining battery life to a user device, wherein the user device is associated with a device ID of the power-using device. In this embodiment, the latest remaining battery life is generally pushed to the user at a fixed time period.

[0076] It is understandable that, according to the above technical means, after obtaining the predicted value of the remaining battery life, this key information is pushed to the user device associated with the device ID of the power-consuming device. This instant feedback mechanism greatly improves the user experience. Users can know the remaining battery life of the power-consuming devices at home in real time, so as to arrange the usage plan reasonably and avoid device shutdown or function limitation due to insufficient power.

[0077] In order to better illustrate the method of this application, the above method is now described by taking a smart lock as an example. Figure 3 , Figure 3This is a flowchart of an optional smart lock remaining battery life prediction provided by an embodiment of the present application, such as Figure 3 As shown in the figure, when the power data of the smart lock changes, the original power data is uploaded to the IoT platform to realize remote monitoring and data collection of the device status. The IoT platform pushes the collected original power data to the Kafka message queue, uses Flink, a real-time data processing engine, to consume the messages in Kafka, cleans and preliminarily processes the original power data, obtains the current power usage data, and then stores the current power usage data in the data warehouse for subsequent analysis. In the data warehouse, the stored current power usage data is converted into a tensor data format that can be recognized and processed by the PyTorch machine learning framework to prepare for model training. Through the DolphinScheduler workflow scheduling system, the training program of the PyTorch linear regression model is triggered regularly every day. The program reads the converted current power usage data from the data warehouse, performs model training, and re-persistently stores the trained model in the data warehouse for subsequent prediction. Using the trained endurance prediction model, the current power usage data is predicted and the predicted value of the remaining endurance time is calculated. Subsequently, this predicted value is pushed to the user's application (App) through appropriate means (such as API interface) so that the user can timely understand the power status of the smart lock and make corresponding preparations. The entire process realizes a closed loop from smart lock data collection to user feedback. Through big data processing and machine learning technology, the intelligent level of device management is improved and the user experience is enhanced.

[0078] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0079] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0080] According to another aspect of the embodiment of the present application, a system for predicting the remaining battery life of a battery is provided for implementing the above-mentioned method for predicting the remaining battery life of a battery. Figure 4 , Figure 4 is a structural block diagram of an optional battery remaining life prediction system provided in an embodiment of the present application, such as Figure 4 As shown, the system may include:

[0081] The data acquisition module 401 is used to acquire the current power usage data of the battery of the power-consuming device, wherein the current power usage data is used to characterize the usage of the power-consuming device;

[0082] The time prediction module 402 is used to call the battery life prediction model to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

[0083] It should be noted that the data acquisition module 401 in this embodiment can be used to execute the above step S201, and the time prediction module 402 in this embodiment can be used to execute the above step S202.

[0084] Regarding the battery remaining life prediction system in this embodiment, the specific manner in which its data acquisition module 401 and time prediction module 402 execute the above-mentioned battery remaining life prediction method has been described in detail in the embodiment of the battery remaining life prediction method, and will not be elaborated here.

[0085] It is understandable that the technical solution provided by this embodiment, each module in the battery remaining life prediction system, obtains the current power usage data of the power-consuming device and calls the life prediction model trained based on the historical power usage data to predict the remaining battery life, thereby achieving a more accurate prediction effect. This method takes into account the usage habits and demand differences of different users, avoids the limitations of traditional methods that only rely on average power usage for prediction, and can therefore more accurately reflect the actual situation of each user, provide a more reliable remaining life prediction, and effectively improve the user experience.

[0086] The system in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the above-mentioned embodiments of the method for predicting the remaining battery life.

[0087] It should be noted that the above modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the system, can be run in the implementation of Figure 1 The hardware environment of the method shown may be implemented by software or hardware, wherein the hardware environment includes a network environment.

[0088] According to another aspect of an embodiment of the present application, a device for predicting remaining battery life for implementing the above-mentioned method for predicting remaining battery life is also provided. The device for predicting remaining battery life can be a server, a terminal, or a combination thereof.

[0089] According to another embodiment of the present application, a device for predicting the remaining battery life is also provided. Figure 5 , Figure 5 is a structural block diagram of an optional device for predicting remaining battery life provided in an embodiment of the present application, such as Figure 5 As shown, the device for predicting the remaining battery life may include: a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other via the communication bus 1504.

[0090] Memory 1503, used for storing computer programs;

[0091] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:

[0092] Step S201, obtaining current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize the usage of the electric device;

[0093] Step S202, calling a battery life prediction model, predicting the remaining battery life of the power-consuming device based on the current power usage data, and obtaining a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

[0094] It is understandable that the technical solution provided in this embodiment, the processor of the device for predicting the remaining battery life, obtains the current power usage data of the power-consuming device and calls the battery life prediction model trained based on the historical power usage data to predict the remaining battery life, thereby achieving a more accurate prediction effect. This method takes into account the differences in usage habits and needs of different users, avoids the limitations of traditional methods that rely only on average power usage for prediction, and can therefore more accurately reflect the actual situation of each user, provide a more reliable remaining battery life prediction, and effectively improve the user experience.

[0095] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.

[0096] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0097] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0098] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.

[0099] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0100] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0102] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0103] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0104] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0106] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for predicting remaining battery life, characterized in that: include: Acquire current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize the usage of the electric device; Call a battery life prediction model to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

2. The method for predicting the remaining battery life according to claim 1, characterized in that: The calling of the battery life prediction model to predict the remaining battery life of the battery of the power-consuming device according to the current power usage data to obtain a predicted value of the remaining battery life includes: Converting the current power usage data into a target format, wherein the target format is a data format that can be processed by the battery life prediction model; The current power usage data after format conversion is input into the battery life prediction model, and the prediction function in the battery life prediction model is run to obtain the predicted value of the remaining battery life, wherein the prediction function is used to characterize the functional relationship between the current power usage data and the predicted value of the remaining battery life.

3. The method for predicting the remaining battery life according to claim 1, characterized in that: Before obtaining the current power usage data of the battery of the power-consuming device, include: When the power data of the power-consuming device changes, generating original power data; Pushing the raw power data to a message queue for storage via the Internet of Things platform; The raw power data in the message queue is consumed in real time by a data processing engine to obtain the current power usage data.

4. The method for predicting the remaining battery life according to claim 3, characterized in that: The real-time consumption of the original power data in the message queue by the data processing engine to obtain the current power usage data includes: Extracting target power data related to battery life from the raw power data through the data processing engine; The target power data is cleaned to obtain the current power usage data, wherein the current power usage data includes: the current battery voltage, timestamp and usage function data of the battery of the power-consuming device.

5. The method for predicting the remaining battery life according to claim 3, characterized in that: The step of pushing the original power data to a message queue through the Internet of Things platform for storage includes: Receiving the original power data pushed by the Internet of Things platform; The original power data is stored in a Topic in the Kafka message queue corresponding to the device ID of the power-consuming device.

6. The method for predicting the remaining battery life according to claim 1, characterized in that: After obtaining the predicted value of the remaining battery life, including: Storing the current power usage data in a data warehouse; When the model update operation is triggered, all current power usage data of the range prediction model from the last update to the current update are obtained from the data warehouse, wherein the model update operation is an operation of training the range prediction model by a time-triggered scheduling linear regression model training program; The battery life prediction model is updated using all the current power usage data.

7. The method for predicting the remaining battery life according to claim 1, characterized in that: After obtaining the predicted value of the remaining battery life, it also includes: The predicted value of the remaining battery life is pushed to a user device, wherein the user device is associated with a device ID of the power-consuming device.

8. A system for predicting remaining battery life, characterized in that: include: A data acquisition module, used to acquire current power usage data of a battery of an electric device, wherein the current power usage data is used to characterize the usage of the electric device; The time prediction module is used to call the battery life prediction model to predict the remaining battery life of the power-consuming device based on the current power usage data to obtain a predicted value of the remaining battery life, wherein the battery life prediction model is trained using the historical power usage data of the power-consuming device.

9. A device for predicting the remaining battery life of a battery, comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is used to execute the method for predicting the remaining battery life of any one of claims 1 to 7 by running the computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method for predicting the remaining battery life of any one of claims 1 to 7 when running.