Summary of the invention
One technical problem to be solved by the embodiment of the invention is that: a kind of battery management method, system and device are provided,
Not scientific to solve management method existing in the prior art, management program oversimplification or complexity, the efficiency of management is low, can not
The problem of carrying out life-cycle management.
According to an aspect of an embodiment of the present invention, a kind of battery management method provided, comprising:
Battery MCU records battery information, and the battery information includes: the record type of battery, battery pack total voltage, battery
Export electric current, battery pack temperature, MOS temperature, battery status, single-unit battery core voltage;
According to the agreement process of battery management ICP/IP protocol, battery information is uploaded to server;
Check that the information for storing the battery records by server using the sequence number of battery;
By the battery information of the storage entire service life of electrolytic cell, check in battery use process whether battery occur
Unfavorable condition.
In another embodiment based on the above-mentioned battery management method of the present invention, the association of the battery management ICP/IP protocol
Discussing process includes:
Battery MCU idle mode, battery identity certification mode, read battery information mode, uploads of battery information pattern and
Error pattern;
The circular flow under this 5 kinds of modes of battery management ICP/IP protocol, runs respective program under different modes, and two
Conflict is not will cause between person.
It is described according to battery management ICP/IP protocol in another embodiment based on the above-mentioned battery management method of the present invention
Agreement process, battery information, which is uploaded to server, includes:
Battery MCU establishes connection by SIM800C module and server;
Battery MCU requests uploads of battery information data to server, and server returns to battery identity certification letter to battery MCU
Breath;
Battery MCU is re-transmitted to server after coding by the encryption to battery identity authentication information;
Encryption data is decrypted in server, returns to storage vernier to battery MCU after comparing successfully, and battery MCU passes through
The record number for storing vernier and battery compares;
If battery information record strip number is read enough, battery MCU reads battery record information automatically, in the time of setting
It is interior to be packaged the battery information read, it is uploaded to server after coding, then battery MCU is disconnected and the company of server automatically
It connects, prevents battery MCU from occupying server for a long time;
If not completing to upload by battery information before the deadline, server is forced to disconnect the connection of battery MCU.
In another embodiment based on the above-mentioned battery management method of the present invention, the battery information by storage understands
The entire service life of battery checks in battery use process that battery unfavorable condition whether occur includes:
Battery MCU reads battery information, record number, record vernier and the secret cipher key code of internal TEA encryption, and data are beaten
Bao Hou is encoded using Base64, is uploaded onto the server by ICP/IP protocol;
Server receives the upload data of battery MCU, is decoded by Base64, TEA decryption, the key of the TEA decryption
It is stored in the cipher key store of server, the decryption of battery information is needed using the key in server key library, and uses key
Key selection in library is determined by the secret cipher key code in uploads of battery information;
It is stored in server after battery information decryption, server stores the information of each battery;
The service condition of each battery of monitoring server analyzes battery operation shape by the battery information that battery MCU is uploaded
Whether state is normal.
In another embodiment based on the above-mentioned battery management method of the present invention, the battery MCU idle mode includes:
Battery MCU waits the time tag set of uploads of battery information, and the time interval of the time tag set is by electricity
Pond MCU setting;
When uploads of battery information time reaches, uploads of battery Information sign set, system mode is switched to battery identity
Certification mode
In another embodiment based on the above-mentioned battery management method of the present invention, the battery identity certification mode includes:
Battery MCU reads battery record number, record vernier and secret cipher key code;
Battery MCU establishes TCP/IP with server and connect, if battery identity certification does not pass through, server is forced to disconnect electricity
Pond MCU connection, battery MCU system are switched to error pattern;
After successful connection, server will initiate battery identity certification request to battery MCU, and the ID authentication request is
Server sends the authentication information of 16 system random numbers of 8 bytes to battery MCU;
Battery MCU encrypts the authentication information for receiving 8 bytes with TEA, is encoded with BASE64, after coding
The sequence progress data packing of data, battery record number, battery sequence number, and data after packing are sent to server;
Server parses the battery MCU data packet sent, and the server is to 8 in the data packet after parsing
16 system random numbers of byte judge whether consistent compared with 8 bytes, the 16 system random number that original server is sent;
If consistent, illustrate that battery identity certification passes through, at this point, if server to battery MCU to return to the battery current
Vernier value is stored, then battery MCU, which enters, reads battery information mode, and otherwise battery MCU need to re-request the server battery
Vernier value is recorded, is still failed after battery MCU continuously requests 3 storage verniers, battery disconnects server connection, and system is switched to
Error pattern;
If inconsistent, battery identity certification does not pass through, and server is forced to disconnect battery MCU connection, and system is switched to mistake
Accidentally mode.
In another embodiment based on the above-mentioned battery management method of the present invention, the reading battery information mode includes:
Battery MCU compared with battery records frequency threshold value, swims present battery storage vernier value if present battery stores
Scale value is less than battery and records frequency threshold value, and battery MCU, which is executed, reads battery information program;
Battery MCU reads out the battery information of battery FLASH storage unit according to battery communications protocol, battery letter
It is carried out in threshold value between the reading at the time of reading of breath, if reading battery time-out, battery MCU is switched to error pattern;
Battery MCU combines the secret cipher key code of server, updated record vernier value and battery information and is packaged, and will beat
Information after packet carries out Base64 coding;
Battery MCU prepares to upload the battery information after coding, and battery MCU is switched to uploads of battery information pattern.
In another embodiment based on the above-mentioned battery management method of the present invention, the battery record frequency threshold value is battery
Record number subtracts 16.
In another embodiment based on the above-mentioned battery management method of the present invention, the read access time threshold value is 2 seconds.
In another embodiment based on the above-mentioned battery management method of the present invention, the uploads of battery information pattern includes:
The connection duration threshold value of battery MCU connection server is set;
Whether the connection duration for judging battery MCU connection server is more than connection duration threshold value;
If so, server is forced to disconnect the connection of battery MCU;
If not, whether the battery information for judging that battery MCU prepares to upload after encoding is completed in connection duration threshold value;
If so, battery actively and automatically disconnects server connection, battery MCU is switched to battery MCU idle mode;
If not, server is forced to disconnect battery MCU connection, battery MCU is switched to error pattern.
In another embodiment based on the above-mentioned battery management method of the present invention, the connection duration threshold value is 20 seconds.
In another embodiment based on the above-mentioned battery management method of the present invention, the error pattern includes:
Battery MCU handles it according to the information of system mistake, removes error message;
System enters battery MCU idle mode, waits the time tag set of battery upload information.
Other side according to an embodiment of the present invention, a kind of battery management system provided, including battery client and
Server;
The battery client includes battery MCU, is uploaded to battery for automatically recording battery information, and by battery information
Server, and the instruction sent according to server and battery information upload state, execute corresponding mode;
The server is used for storage batteries information, authenticates to battery identity, the battery uploaded to battery client
Information data is parsed, and is read out to battery information.
In another embodiment based on the above-mentioned battery management system of the present invention, the battery information that automatically records includes:
Record type, battery pack total voltage, cell output current, battery pack temperature, MOS temperature, battery status, the single-unit battery core of battery
Voltage.
In another embodiment based on the above-mentioned battery management system of the present invention, the working condition of the battery MCU includes 5
Kind mode: battery MCU idle mode, reads battery information mode, uploads of battery information pattern and mistake at battery identity certification mode
Accidentally mode;
After the initialization of battery MCU electrification reset, battery MCU enters battery MCU idle mode;
Battery MCU waits the time tag set of uploads of battery information, when the time tag for receiving uploads of battery information
After set, battery MCU enters battery identity certification mode;
In battery identity certification mode, server sends 8 byte random number authentication information and battery MCU, battery MCU is given to receive
Information exchange is carried out with server based on 8 byte random numbers after random number, after judging that battery identity certification passes through, battery
MCU, which enters, reads battery information mode;
Battery information mode is being read, server judges whether the information of battery storage meets and reads item number, if battery
Information bar number meet and read, battery MCU will read battery information by UART mode, and battery MCU enters uploads of battery information
Mode;
In uploads of battery information pattern, battery information is uploaded to server in the time threshold of setting by battery MCU, clothes
The connection being engaged between device disconnection and MCU, completes the upload of battery information;
The error pattern is to be directly entered wrong mould in case of mistake or time-out, battery MCU under each mode
Formula, battery MCU remove wrong data, return to battery MCU idle mode.
Other side according to an embodiment of the present invention, a kind of cell managing device provided, including battery-end, pressure stabilizing electricity
Road unit, MCU control unit, UART communication interface protection location, SIM800C module, LED unit and server;
The battery-end includes: battery protecting plate, battery core and shell;
The voltage regulator circuit unit provides steady dc voltage and electric current for device;
The MCU control unit is read for uploads of battery information time to be arranged by UART communication interface protection location
Battery information is packaged, coding battery information, the battery information after coding is uploaded to server by SIM800C module;
The battery-end is connect by UART communication interface protection location with MCU control unit, and connecting interface is asynchronous string
Line interface, the MCU control unit are connect by Asynchronous Serial Interface with SIM800C module, SIM800C module pass through it is wired or
Wireless mode is connect with server, and the voltage regulator circuit unit is electrically connected with battery-end, MCU control unit, SIM800C module,
The LED unit and the electrical connection of SIM800C module.
In another embodiment based on the above-mentioned cell managing device of the present invention, the MCU control unit is using chip
EFM32ZG210F32 chip, the chip read battery information by UART mode, are built by SIM800C module with server
Vertical connection receives server data by SIM800C module and sends data to server, is packaged, carries out to battery information
BASE64 coding carries out encryption to server authentication information and BASE64 is encoded.
Compared with prior art, the present invention includes the following advantages:
Battery management method, system and device of the invention automatically records battery information by battery MCU, and fixation is arranged
Time interval battery information is uploaded onto the server, server storage battery information uses battery sequence number, battery size etc.
The information of the battery can easily be searched, thus whether occur in electrolytic cell entire service life battery unfavorable condition or its
His situation, the battery MCU idle mode of battery MCU, read battery information mode, uploads of battery letter at battery identity certification mode
Breath mode and error pattern keep battery management of the invention more scientific, efficient, and program more simplifies.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment only
It is a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
A kind of battery management method provided by the invention, system and device are carried out with reference to the accompanying drawings and examples more detailed
Carefully illustrate.
Fig. 1 is the flow chart of one embodiment of battery management method of the invention, as shown in Figure 1, the electricity of the embodiment
Pond management method includes:
10, battery MCU record battery information, the battery information include: the record type of battery, battery pack total voltage,
Cell output current, battery pack temperature, MOS temperature, battery status, single-unit battery core voltage, time interval of the battery MCU in setting
It is interior that battery information is uploaded to server preservation;
11, according to the agreement process of battery management ICP/IP protocol, battery information is uploaded to server;
12, check that the information for storing the battery records by server using the sequence number of battery;
13, by the battery information of the storage entire service life of electrolytic cell, check in battery use process whether occur
Battery unfavorable condition.
Fig. 2 is the flow chart of another embodiment of battery management method of the invention, as shown in Fig. 2, the cell tube
Reason ICP/IP protocol agreement process include:
Battery MCU idle mode, battery identity certification mode, read battery information mode, uploads of battery information pattern and
Error pattern;
The circular flow under this 5 kinds of modes of battery management ICP/IP protocol, runs respective program under different modes, and two
Conflict is not will cause between person;
When battery MCU runs failure in one of the states, error pattern is jumped directly to, battery MCU is in error pattern
After lower removing relevant error information, battery MCU idle mode is jumped to again, carries out next detection cycle;
Power on the processing of rear battery MCU reset initialization, whole system using 10ms as the state of the operation of interval detection system,
To switch in different states, 5 kinds of modes of battery MCU relative to be 5 state machines, system is in this 5 kinds of states
It ceaselessly runs, respective program is run in different states.
Fig. 3 is the flow chart of the further embodiment of battery management method of the invention, as shown in figure 3, described according to electricity
Pond manages the agreement process of ICP/IP protocol, and battery information, which is uploaded to server, includes:
110, battery MCU establish connection by SIM800C module and server;
111, battery MCU request uploads of battery information data to server, and server, which returns to battery identity to battery MCU, to be recognized
Demonstrate,prove information;
112, battery MCU are re-transmitted to server after coding by the encryption to battery identity authentication information;
113, encryption data is decrypted in server, returns to storage vernier, battery MCU to battery MCU after comparing successfully
It is compared by the record number of storage vernier and battery;
114, if battery information record strip number is read enough, battery MCU reads battery record information automatically, in setting
The battery information read is packaged in time, is uploaded to server after coding, then battery MCU is disconnected and server automatically
Connection prevents battery MCU from occupying server for a long time;
115, if not completing to upload by battery information before the deadline, server is forced to disconnect the company of battery MCU
It connects.
Fig. 4 is the flow chart of another embodiment of battery management method of the invention, as shown in figure 4, described by depositing
The battery information of the storage entire service life of electrolytic cell, checks in battery use process battery unfavorable condition whether occur includes:
150, battery MCU read battery information, record number, record vernier and the secret cipher key code of internal TEA encryption, will count
It after packing, is encoded using Base64, is uploaded onto the server by ICP/IP protocol;
151, server receives the upload data of battery MCU, is decoded by Base64, TEA decryption, the TEA decryption
Key is stored in the cipher key store of server, and the decryption of battery information is needed using the key in server key library, and is used
Key selection in cipher key store is determined by the secret cipher key code in uploads of battery information;
152, it is stored in server after battery information decryption, server stores the information of each battery;
153, the service condition of each battery of monitoring server analyzes battery fortune by the battery information that battery MCU is uploaded
Whether row state is normal.
Fig. 5 is the flow chart of another embodiment of battery management method of the invention, as shown in figure 5, the battery MCU
Idle mode includes:
20, battery MCU wait the time tag set of uploads of battery information, the time interval of the time tag set by
Battery MCU setting;
21, when uploads of battery information time reaches, uploads of battery Information sign set, system mode is switched to battery body
Part certification mode.
Fig. 6 is the flow chart of another embodiment of battery management method of the invention, as shown in fig. 6, the battery body
Part certification mode includes:
30, battery MCU read battery record number, record vernier and secret cipher key code;
31, battery MCU establishes TCP/IP with server and connect, if battery identity certification does not pass through, server is forced disconnected
Battery MCU connection is opened, battery MCU system is switched to error pattern;
32, after successful connection, server will initiate battery identity certification request to battery MCU, and the authentication is asked
Seek the authentication information for sending 16 system random numbers of 8 bytes to battery MCU for server;
33, battery MCU encrypts the authentication information for receiving 8 bytes with TEA, is encoded with BASE64, according to coding
The sequence progress data packing of data, battery record number, battery sequence number afterwards, and data after packing are sent to service
Device;
34, server parses the battery MCU data packet sent, and the server is in the data packet after parsing
16 system random numbers of 8 bytes judge whether consistent compared with 8 bytes, the 16 system random number that original server is sent;
35, if unanimously, illustrating that battery identity certification passes through, at this point, working as if server returns to the battery to battery MCU
Preceding storage vernier value, then battery MCU, which enters, reads battery information mode, and otherwise battery MCU need to re-request the server battery
Record vernier value, still fail after battery MCU continuously requests 3 storage verniers, battery disconnect server connection, system switching
For error pattern;
36, if inconsistent, battery identity certification does not pass through, and server is forced to disconnect battery MCU connection, and system is switched to
Error pattern.
Fig. 7 is the flow chart of another embodiment of battery management method of the invention, as shown in fig. 7, the reading is electric
Pond information pattern includes:
Present battery is stored vernier value compared with battery records frequency threshold value by 40, battery MCU, if present battery stores
Vernier value is less than battery and records frequency threshold value, and battery MCU, which is executed, reads battery information program;
41, battery MCU read out the battery information of battery FLASH storage unit, battery according to battery communications protocol
It is carried out in threshold value between the reading at the time of reading of information, if reading battery time-out, battery MCU is switched to error pattern;
42, battery MCU combine the secret cipher key code of server, updated record vernier value and battery information and are packaged, and
Information after packing is subjected to Base64 coding;Wherein, after MCU is read successfully, updated record vernier is original record
Vernier adds 1;
43, battery MCU prepare to upload the battery information after coding, and battery MCU is switched to uploads of battery information pattern.
Wherein, the battery record frequency threshold value is that battery record number subtracts 16, and the read access time threshold value is 2 seconds.
In reading battery information mode, when battery MCU is read out battery information program, need to avoid 3 kinds of situations, the
One kind is exactly that inside battery information is emptied, but server stores the battery information of the battery not while being emptied, and electricity occurs
The record number in pond is less than the storage vernier of server, so server has error correcting capability, when the electricity for receiving battery MCU upload
When pond records number less than the server battery storage vernier, server is opened up a piece of new again after repeating this operation 3 times
Memory headroom storage battery information;It is exactly for second that the FLASH memory space of storage battery is limited, when FALSH is filled with
Afterwards, storing oldest battery information will be wiped free of, then store new battery information again, and battery MCU, which is skipped, at this time is wiped free of
Battery information reads newer battery information;The third is that storage vernier is greater than battery record frequency threshold value and is less than battery note
Number is recorded, battery MCU is continued waiting at this time, and enough 16 battery informations is waited to read battery information again.
Fig. 8 is the flow chart of another embodiment of battery management method of the invention, as shown in figure 8, conducting electricity on described
Pond information pattern includes:
50, the connection duration threshold value of battery MCU connection server is set;
51, judge whether the connection duration of battery MCU connection server is more than connection duration threshold value;
52, if so, server is forced to disconnect the connection of battery MCU;
53, if not, whether the battery information for judging that battery MCU prepares to upload after encoding is complete in connection duration threshold value
At;
54, if so, battery actively and automatically disconnects server connection, battery MCU is switched to battery MCU idle mode;
55, if not, server is forced to disconnect battery MCU connection, battery MCU is switched to error pattern.
Wherein, the connection duration threshold value is 20 seconds.
Fig. 9 is the flow chart of another embodiment of battery management method of the invention, as shown in figure 9, the mistake mould
Formula includes:
60, battery MCU handles it according to the information of system mistake, removes error message;
61, system enters battery MCU idle mode, waits the time tag set of battery upload information.
Battery MCU is in error pattern, the error message mainly occurred in treatment of battery MCU operational process, such as one
The error message that authentication unsuccessfully generates when being Identity Authentication Mode, second is that information bar number is inadequate when reading battery information mode
16, the error message that battery information time-out generates either is read in the error message that can not read generation, third is that conducting electricity on MCU
Occur timeout error message when the information of pond, at this time battery information not yet upload successfully caused by error message, these cause be
System enters error pattern, and the information in error pattern according to system mistake makes corresponding processing.
Other side according to an embodiment of the present invention, a kind of battery management system provided, Figure 10 are electricity of the invention
The structural schematic diagram of one embodiment of pond management system, as shown in Figure 10, the battery management system include: battery client
1 and server 2;
The battery client 1 includes battery MCU, is uploaded to electricity for automatically recording battery information, and by battery information
Pool server 2, and the instruction sent according to server 2 and battery information upload state, execute corresponding mode;
The server 2 is used for storage batteries information, authenticates to battery identity, the electricity uploaded to battery client 1
Pond information data is parsed, and is read out to battery information.
Wherein, the battery information that automatically records includes: the record type of battery, battery pack total voltage, battery output electricity
Stream, battery pack temperature, MOS temperature, battery status, single-unit battery core voltage.
The working condition of the battery MCU includes 5 kinds of modes: battery MCU idle mode, is read battery identity certification mode
Take battery information mode, uploads of battery information pattern and error pattern;
After the initialization of battery MCU electrification reset, battery MCU enters battery MCU idle mode;
Battery MCU waits the time tag set of uploads of battery information, when the time tag for receiving uploads of battery information
After set, battery MCU enters battery identity certification mode;
In battery identity certification mode, server 2 sends 8 byte random number authentication information and battery MCU, battery MCU is given to receive
Information exchange is carried out with server 2 based on 8 byte random numbers after to random number, after judging that battery identity certification passes through,
Battery MCU, which enters, reads battery information mode;
Battery information mode is being read, server 2 judges whether the information of battery storage meets and reads item number, if battery
Information bar number meet and read, battery MCU will read battery information by UART mode, and battery MCU enters uploads of battery information
Mode;
In uploads of battery information pattern, battery information is uploaded to server 2 in the time threshold of setting by battery MCU,
Server 2 disconnects the connection between MCU, completes the upload of battery information;
The error pattern is to be directly entered wrong mould in case of mistake or time-out, battery MCU under each mode
Formula, battery MCU remove wrong data, return to battery MCU idle mode.
Other side according to an embodiment of the present invention, a kind of cell managing device provided, Figure 11 are electricity of the invention
The structural schematic diagram of one embodiment of pond managing device, as shown in figure 11, the cell managing device include: battery-end 81,
Voltage regulator circuit unit 82, MCU control unit 83, UART communication interface protection location 84, SIM800C module 85,86 and of LED unit
Server 87;
The battery-end 81 includes: battery protecting plate, battery core and shell;
The voltage regulator circuit unit 82 provides steady dc voltage and electric current for device;
The MCU control unit 83 passes through UART communication interface protection location 84 for uploads of battery information time to be arranged
Battery information is read, is packaged, coding battery information, the battery information after coding is uploaded to by service by SIM800C module 85
Device 87;
The battery-end 81 is connect by UART communication interface protection location 84 with MCU control unit 83, and connecting interface is
Asynchronous Serial Interface, the MCU control unit 83 are connect by Asynchronous Serial Interface with SIM800C module 85, SIM800C module
85 are connect by wired or wireless way with server 87, the voltage regulator circuit unit 82 and battery-end 81, MCU control unit
83, SIM800C module 85 is electrically connected, and the LED unit 86 and SIM800C module 85 are electrically connected.
The MCU control unit 83 is EFM32ZG210F32 chip using chip, and the chip is read by UART mode
Battery information establishes connection by SIM800C module 85 and server 87, receives the number of server 87 by SIM800C module 85
According to send data to server 87, to battery information be packaged, carry out BASE64 coding, 87 authentication information of server is added
Close and BASE64 coding.
A kind of battery management method provided by the present invention, system and device are described in detail above, herein
Apply that a specific example illustrates the principle and implementation of the invention, the explanation of above example is only intended to help
Understand method and its core concept of the invention;At the same time, for those skilled in the art, according to the thought of the present invention,
There will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed as to this
The limitation of invention.
Finally, it should be noted that the foregoing is only a preferred embodiment of the present invention, it is not intended to restrict the invention,
Although the present invention is described in detail referring to the foregoing embodiments, for those skilled in the art, still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features,
All within the spirits and principles of the present invention, any modification, equivalent replacement, improvement and so on should be included in of the invention
Within protection scope.